Re: [Orgmode] Re: export html - doc

2010-12-21 Thread Christian Moe

On 12/21/10 3:04 AM, Eric Abrahamsen wrote:

#+BIND: org-export-html-xml-declaration ()

That did the trick! Thank you.

One small follow-up question: this produces iso-8859-1 encoded text by
default; how do I go about asking for utf-8?


With the same setup I still get utf-8. Though the XML declaration is 
lost, it's still there in the line:


meta http-equiv=Content-Type content=text/html;charset=utf-8/

What values do you have for the following?

org-export-html-coding-system
buffer-file-coding-system
current-language-environment

Yours,
Christian

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: export html - doc

2010-12-21 Thread Eric Abrahamsen
On Tue, Dec 21 2010, Christian Moe wrote:

 On 12/21/10 3:04 AM, Eric Abrahamsen wrote:
 #+BIND: org-export-html-xml-declaration ()
 That did the trick! Thank you.

 One small follow-up question: this produces iso-8859-1 encoded text by
 default; how do I go about asking for utf-8?

 With the same setup I still get utf-8. Though the XML declaration is
 lost, it's still there in the line:

 meta http-equiv=Content-Type content=text/html;charset=utf-8/

 What values do you have for the following?

 org-export-html-coding-system
 buffer-file-coding-system
 current-language-environment

Aha! It's that first one I was looking for (I must not be using apropos
correctly). I had:

org-export-html-coding-system  nil
buffer-file-coding-system  utf-8-with-signature-unix
current-language-environment  UTF-8

Setting org-export-html-coding-system to 'utf-8 resulted in a correct
coding system in the html export, but from the docs you'd think it would
have picked that up from buffer-file-coding-system to begin with…

Thanks,
Eric



 Yours,
 Christian

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [PATCH] org-agenda: rewrite mode-line

2010-12-21 Thread Michael Sperber

Carsten Dominik carsten.domi...@gmail.com writes:

 Hi XEmacs users

 I am about to apply this patch, but I am still wondering
 if :eval in the mode line is working on XEmacs?

Sorry, missed that one: XEmacs does not currently have :eval.  This
might be a good reason to add it to XEmacs, but it would probably take
me a few weeks - I'm totally swamped right now.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: French abbreviations for the week days (`lun.', `mar.', `mer.', ...)

2010-12-21 Thread Sébastien Vauban
Hello,

Sébastien Vauban wrote:
 In the same arena, I've noticed -- since I am on a Windows computer with
 French locales, that I now have Frenchized abbreviations for the dates, in
 the timestamps and in the agenda.

 For example:

CLOCK: [2010-10-26 mar. 09:14]--[2010-10-26 mar. 10:15] =  1:01

 where `mar.' represents `Tue' (mardi, Tuesday).

I finally found the solution, which I'm sharing with you:

#+begin_src emacs-lisp
  (setq system-time-locale C)
#+end_src

instead of:

#+begin_src emacs-lisp
  (setq system-time-locale en_US.utf-8)
#+end_src

Strange, but...

Best regards,
  Seb

-- 
Sébastien Vauban


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: export html - doc

2010-12-21 Thread Christian Moe

On 12/21/10 9:21 AM, Eric Abrahamsen wrote:

On Tue, Dec 21 2010, Christian Moe wrote:


On 12/21/10 3:04 AM, Eric Abrahamsen wrote:

#+BIND: org-export-html-xml-declaration ()

That did the trick! Thank you.

One small follow-up question: this produces iso-8859-1 encoded text by
default; how do I go about asking for utf-8?


With the same setup I still get utf-8. Though the XML declaration is
lost, it's still there in the line:

meta http-equiv=Content-Type content=text/html;charset=utf-8/

What values do you have for the following?

org-export-html-coding-system
buffer-file-coding-system
current-language-environment


Aha! It's that first one I was looking for (I must not be using apropos
correctly). I had:

org-export-html-coding-system  nil
buffer-file-coding-system  utf-8-with-signature-unix
current-language-environment  UTF-8

Setting org-export-html-coding-system to 'utf-8 resulted in a correct
coding system in the html export, but from the docs you'd think it would
have picked that up from buffer-file-coding-system to begin with…


Mine does pick it up. I have

 org-export-html-coding-system  nil
 buffer-file-coding-system  utf-8-unix

and get correct utf-8 html output in Org 7.4, GNU Emacs 23.2.1 on a Mac.

I don't have any further clues why it doesn't work for you.

Yours,
Christian

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Org Mode 7 Manual - printed edition now available

2010-12-21 Thread Carsten Dominik


On Dec 17, 2010, at 2:16 PM, Brian Gough wrote:


Hello,

For people who like printed documentation, the Org 7 mode manual has
now been published as a paperback book.  The details are

 The Org Mode 7 Reference Manual - Organize your life with GNU Emacs
  by Carsten Dominik and others
  Paperback (6x9), 282 pages.
  Retail Price: $14.95 (9.95 GBP), ISBN 9781906966089

For more information and links to bookstores where you can buy it see
http://www.network-theory.co.uk/org/manual/

I'm happy to say that for each copy sold $1 will be donated to the Org
project by Network Theory Ltd.



High everyone,

I do have my copy of the book, and all I can say is it looks great.
Thanks to Brian for Barry for publishing it.

- Carsten


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] XEmacs fix for small-temporary-file-directory

2010-12-21 Thread Dr. Volker Zell
Hi

Any chance we get this applied ?

Ciao
  Volker
  
 Volker Zell writes:

 Hi
 Can anyone please apply the following patch to ob-eval to make xemacs 
happy.
 This was be the last reference to small-temporary-file-directory by the 
way.

 --- ob-eval.el.orig 2010-11-01 13:58:45.0 +0100
 +++ ob-eval.el  2010-12-02 19:03:15.140625000 +0100
 @@ -138,9 +138,9 @@
  (if error-buffer
  (make-temp-file
   (expand-file-name scor
 -   (or (unless (featurep 'xemacs)
 - small-temporary-file-directory)
 -   temporary-file-directory)))
 +(if (featurep 'xemacs)
 +(temp-directory)
 +  temporary-file-directory)))
nil))
 exit-status)
  (if (or replace


 Thanks
   Volker
  

 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

-- 
DR. VOLKER ZELL | Principal Training Consultant | +49 211 74839 414
Oracle University

Oracle Deutschland GmbH | Hamborner Str. 51 | 40472 Düsseldorf

ORACLE Deutschland GmbH, Hauptverwaltung: Riesstraße 25, D-80992 München
Geschäftsführer: Jürgen Kunz, Registergericht: Amtsgericht München, HRB 82775

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: export html - doc

2010-12-21 Thread Eric Abrahamsen
On Tue, Dec 21 2010, Christian Moe wrote:

 On 12/21/10 9:21 AM, Eric Abrahamsen wrote:
 On Tue, Dec 21 2010, Christian Moe wrote:

 On 12/21/10 3:04 AM, Eric Abrahamsen wrote:
 #+BIND: org-export-html-xml-declaration ()
 That did the trick! Thank you.

 One small follow-up question: this produces iso-8859-1 encoded text by
 default; how do I go about asking for utf-8?

 With the same setup I still get utf-8. Though the XML declaration is
 lost, it's still there in the line:

 meta http-equiv=Content-Type content=text/html;charset=utf-8/

 What values do you have for the following?

 org-export-html-coding-system
 buffer-file-coding-system
 current-language-environment

 Aha! It's that first one I was looking for (I must not be using apropos
 correctly). I had:

 org-export-html-coding-system  nil
 buffer-file-coding-system  utf-8-with-signature-unix
 current-language-environment  UTF-8

 Setting org-export-html-coding-system to 'utf-8 resulted in a correct
 coding system in the html export, but from the docs you'd think it would
 have picked that up from buffer-file-coding-system to begin with…

 Mine does pick it up. I have

  org-export-html-coding-system  nil
  buffer-file-coding-system  utf-8-unix

 and get correct utf-8 html output in Org 7.4, GNU Emacs 23.2.1 on a Mac.

 I don't have any further clues why it doesn't work for you.

Thanks for getting me this far!

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [Babel] Unexpected behavior evaluating function source blocks defined in a list

2010-12-21 Thread Scott May
I noticed that when I evaluate a function whose definition is embedded in a 
list, the function does not evaluate if it is embedded in a list with no blank 
line preceding /and/ the function is indented. The function can be evaluated as 
expected with either a blank line preceding the definition or with no 
indentation of the source block. 

* Org snippet:

+ This works as I expect with a blank line preceding the source block:

  #+source: square(x)
  #+begin_src emacs-lisp
(* x x)
  #+end_src

  #+call: square(x=3)

  #+results: square(x=3)
  : 9

+ Or if the source block is not indented:
#+source: cube(x)
#+begin_src emacs-lisp
  (* x x x)
#+end_src

#+call: cube(x=3)

#+results: cube(x=3)
: 27

+ But if I don't have a blank line, and the source block is indented,
  the bullet text gets incorporated into a table along with the
  source block:
  #+source: quartic(x)
  #+begin_src emacs-lisp
(* x x x x)
  #+end_src

  #+call: quartic(x=3)

  #+results: quartic(x=3)
  | But if I don't have a blank line, and the source block is indented,\n  the 
bullet text gets incorporated into a table along with the\n  source block:\n 
 #+source: quartic(x)\n  #+begin_src emacs-lisp\n(* x x x x)\n  #+end_src |



  

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Patch for ob-sql.el SQL output

2010-12-21 Thread Charles Sebold
I use org-mode and babel under Windows with osql, and the line
separating the header from the rest of the rows in the output was
bothering me.

I don't know that this is a really good fix, but maybe it's a start
for one?  I've filled out paperwork with FSF for copyright assignment.
 It looks for the first output line of all dashes and replaces it
later with the 'hline when the table is lisp-ified.  I didn't test
this with mysql or postgresql.

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 5bb123d..13e9bd3 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -65,6 +65,7 @@ This function is called by `org-babel-execute-src-block'.
          (in-file (org-babel-temp-file sql-in-))
          (out-file (or (cdr (assoc :out-file params))
                        (org-babel-temp-file sql-out-)))
+         (header-delim )
          (command (case (intern engine)
                     ('msosql (format osql %s -s \\t\ -i %s -o %s
                                      (or cmdline )
@@ -84,9 +85,19 @@ This function is called by `org-babel-execute-src-block'.
     (message command)
     (shell-command command)
     (with-temp-buffer
+      ; need to figure out what the delimiter is for the header row
+      (with-temp-buffer
+        (insert-file-contents out-file)
+        (goto-char (point-min))
+        (when (re-search-forward ^\\(-+\\)$ nil t)
+          (setq header-delim (match-string-no-properties 1
       (org-table-import out-file '(16))
       (org-babel-reassemble-table
-       (org-table-to-lisp)
+       (mapcar (lambda (x)
+                 (if (string= (car x) header-delim)
+                     'hline
+                   x))
+               (org-table-to-lisp))
        (org-babel-pick-name (cdr (assoc :colname-names params))
                            (cdr (assoc :colnames params)))
        (org-babel-pick-name (cdr (assoc :rowname-names params))
--
Charles Sebold
Ego delendus sum

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Patch for ob-sql.el SQL output

2010-12-21 Thread Sébastien Vauban
Hi Charles,

Charles Sebold wrote:
 I use org-mode and babel under Windows with osql, and the line separating
 the header from the rest of the rows in the output was bothering me.

Excellent initiative!

 I don't know that this is a really good fix, but maybe it's a start for one?
 It looks for the first output line of all dashes and replaces it later with
 the 'hline when the table is lisp-ified.

It does not work correctly for me (with the osql engine). Look at the
situation before/after your patch:

1. Before

   #+srcname: top-10-dossiers-with-many-presta
   #+begin_src sql
   SET NOCOUNT ON

   SELECT TOP 10 prsAbcID, COUNT(*) AS '# Presta'
   FROM presta
   GROUP BY prsAbcID
   ORDER BY COUNT(*) DESC
   #+end_src

   #+results: top-10-dossiers-with-many-presta
   | prsAbcID |  # Presta |
   |  | - |
   |   73020050900111 |22 |
   |   52020030200047 |21 |
   |   6102006047 |21 |
   |   62020031200052 |20 |
   |   72020051100016 |20 |
   |   73020050800025 |20 |
   |   5602003112 |19 |
   |   63020060900056 |19 |
   |   61020030900049 |18 |
   |   72020030700040 |18 |
   |  |   |

   Another annoying thing is the empty line at the end. With the COUNT ON,
   there is one empty line followed by the count.

2. After

   #+results: top-10-dossiers-with-many-presta
   | prsAbcID |  # Presta |
   |  | - |
   |   73020050900111 |22 |
   |   52020030200047 |21 |
   |   6102006047 |21 |
   |   62020031200052 |20 |
   |   72020051100016 |20 |
   |   73020050800025 |20 |
   |   5602003112 |19 |
   |   63020060900056 |19 |
   |   61020030900049 |18 |
   |   72020030700040 |18 |
   |--+---|

   The hline is not applied on the second line, but at the end of the table.
   Perhaps the good condition is to work on the second line?

Best regards,
  Seb

-- 
Sébastien Vauban


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] how to filter CATEGORY entries in org-agenda-custom command (agenda)?

2010-12-21 Thread Rainer Stengele
Hi all!

how to filter CATEGORY entries in org-agenda-custom command (agenda)?

Sorry I cannot find it. I know how to filter such entries in tags-todo blocks:

tags-todo -CATEGORY=\PADUA\-CATEGORY=\PADUA-LH\-CATEGORY=\PADUA-PH\

but I cannot find an equivalent for the (agenda) part of my custom command.

- Rainer



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [PATCH] org-scan-tags: remove useless variable

2010-12-21 Thread Julien Danjou
* lisp/org.el (org-scan-tags): remove useless todo variable.

Signed-off-by: Julien Danjou jul...@danjou.info
---
 lisp/org.el |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 3cecca7..85898ab 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12198,7 +12198,7 @@ only lines with a TODO keyword are included in the 
output.
  lspos tags tags-list
 (tags-alist (list (cons 0 org-file-tags)))
 (llast 0) rtn rtn1 level category i txt
-todo marker entry priority)
+marker entry priority)
 (when (not (or (member action '(agenda sparse-tree)) (functionp action)))
   (setq action (list 'lambda nil action)))
 (save-excursion
@@ -12208,8 +12208,7 @@ only lines with a TODO keyword are included in the 
output.
(org-remove-occur-highlights))
   (while (re-search-forward re nil t)
(catch :skip
- (setq todo (if (match-end 1) (org-match-string-no-properties 2))
-   tags (if (match-end 4) (org-match-string-no-properties 4)))
+ (setq tags (if (match-end 4) (org-match-string-no-properties 4)))
  (goto-char (setq lspos (match-beginning 0)))
  (setq level (org-reduced-level (funcall outline-level))
category (org-get-category))
-- 
1.7.2.3


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [babel] New handling of file output

2010-12-21 Thread Dan Davison
Please note the following changes to the way that org-babel handles
file output. These may break existing org-babel files which use
the :file header argument.

:file filename should be understood as saying write the result
to filename and return a link to filename.

This works for all languages. For graphics languages (e.g. ditaa, dot,
gnuplot) there is no change in behavior: result in the above is the
graphics, and a link to the image is placed in the org buffer. For
general-purpose languages (e.g. emacs-lisp, python, R, ruby, shell),
the result written to file is the normal org-babel result (string,
number, table).

This is a backwards-incompatible change for R, which was previously
interpreting :file to mean send graphics to file. I will send a
separate email concerning R.

In order to return a file link from a src block without telling babel
to save any results to that file, use :results filename and do not
use :file. The code block can of course write arbitrary content to
filename.

Some examples:

Save the output of ls -l as a .csv file (recall that :results value is
the default):

#+begin_src sh :file dirlisting.csv :sep ,
 ls -l
#+end_src

Send the text output of ls -l directly to file:

#+begin_src sh :results output :file dirlisting.txt
 ls -l
#+end_src

Dan


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [PATCH] org-babel-confirm-evaluate when org-confirm-babel-evaluate is a function

2010-12-21 Thread Eric Schulte
Hi Vladimir,

Thanks very much for this patch, it is great to receive patches that
update the documentation as well as the code.  I've just applied a
slightly modified version of your patch.

Thanks -- Eric

Vladimir Alexiev vladi...@sirma.bg writes:

 I tried following http://orgmode.org/worg/org-contribute.php to the letter.
 But this is my first patch (and first time using git  magit), so please 
 kindly 
 give me feedback if something is not right.

 * doc/org.texi: org-confirm-babel-evaluate: add example for using a
   function
 * lisp/ob.el (org-babel-confirm-evaluate): Fix for the case when
   org-confirm-babel-evaluate is a function (used to always ask no matter
   what the function returns) 

 --- a/doc/org.texi
 +++ b/doc/org.texi
 @@ -12662,9 +12662,19 @@ Make sure you know what you are doing before 
 customizing the variables
  which take off the default security brakes.
  
  @defopt org-confirm-babel-evaluate
 -When set to t user is queried before code block evaluation
 +When t (the default), the user is asked before every code block evaluation.
 +When nil, the user is not asked.
 +When set to a function, it is called with two arguments (language and body 
 of 
 the code
 +block) and should return t to ask and nil not to ask.
  @end defopt
  
 +For example, here is how to execute ditaa code (which is considered safe) 
 without asking:
 +...@example
 +(defun my-org-confirm-babel-evaluate (lang body)
 +  (not (string= lang ditaa)))  ; don't ask for ditaa
 +(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
 +...@end example
 +

 --- a/lisp/ob.el
 +++ b/lisp/ob.el
 @@ -209,11 +209,11 @@ Note disabling confirmation may result in accidental 
 evaluation
  of potentially harmful code.
(let* ((eval (or (cdr (assoc :eval (nth 2 info)))
  (when (assoc :noeval (nth 2 info)) no)))
 -  (query (or (equal eval query)
 - (if (functionp org-confirm-babel-evaluate)
 - (funcall org-confirm-babel-evaluate
 -  (nth 0 info) (nth 1 info))
 -   org-confirm-babel-evaluate
 + (query (cond ((equal eval query))
 +  ((functionp org-confirm-babel-evaluate)
 +   (funcall org-confirm-babel-evaluate
 +(nth 0 info) (nth 1 info)))
 +  ((org-confirm-babel-evaluate)
  (if (or (equal eval never) (equal eval no)
   (and query
(not (yes-or-no-p

 TINYCHANGE



 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Disputed keys

2010-12-21 Thread Darlan Cavalcante Moreira

I use the function other-frame for that, which is bound to `C-x 5 o' as
Suvayu mentioned. To make this easier (since I use it frequently) I just
bind other-frame to C-c o with
(global-set-key \C-co'other-frame)

This works very well for me.

--
Darlan


At Sun, 19 Dec 2010 21:49:53 -0800,
Suvayu Ali fatkasuvayu+li...@gmail.com wrote:
 
 On Sunday 19 December 2010 11:20 AM, Eric S Fraga wrote:
  Andrea Crottiandrea.crott...@gmail.com  writes:
 
  I wanted finally to fix the following problem, I would like to use
  meta-left/right to switch frame, and that's one of the keys that orgmode
  uses.
 
  I added the two values here to the org-disputed-keys
 
  [(meta left)]
   Value: [(meta control left)]
  [(meta right)]
   Value: [(meta control right)]
 
  but still it doesn't work, in orgmode meta-left is always bound to the
  org action, not to other-frame as it is in other modes...
 
  Isn't switching to frame a function of your window manager and not
  emacs?  That is, shouldn't this be a case of telling your window manage,
  whatever that may be, to switch frames when these keys are pressed?
 
  Or am I missing something fundamental here?
 
 I think Andrea meant to say switching window. But none the less, Emacs 
 has the ability to switch frames, `C-x 5 o' or even your regular 
 `switch-buffer'. But I think it does it by talking to the window manager.
 
 This can be very useful when you have multiple emacs frames for one 
 instance of emacs on different desktops. If you have configured your 
 window manager appropriately simply switching to a buffer shown on 
 another desktop can switch you to that desktop and raise the Emacs frame 
 with the buffer. :)
 
 -- 
 Suvayu
 
 Open source is the future. It sets us free.
 
 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Patch for ob-sql.el SQL output

2010-12-21 Thread Charles Sebold
I feel silly.  I was just testing with one output column.

Change the $ in the regexp to [^-] or just reapply patch as follows:

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 5bb123d..32b7bf0 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -65,6 +65,7 @@ This function is called by `org-babel-execute-src-block'.
  (in-file (org-babel-temp-file sql-in-))
  (out-file (or (cdr (assoc :out-file params))
(org-babel-temp-file sql-out-)))
+ (header-delim )
  (command (case (intern engine)
 ('msosql (format osql %s -s \\t\ -i %s -o %s
  (or cmdline )
@@ -84,9 +85,19 @@ This function is called by `org-babel-execute-src-block'.
 (message command)
 (shell-command command)
 (with-temp-buffer
+  ; need to figure out what the delimiter is for the header row
+  (with-temp-buffer
+(insert-file-contents out-file)
+(goto-char (point-min))
+(when (re-search-forward ^\\(-+\\)[^-] nil t)
+  (setq header-delim (match-string-no-properties 1
   (org-table-import out-file '(16))
   (org-babel-reassemble-table
-   (org-table-to-lisp)
+   (mapcar (lambda (x)
+ (if (string= (car x) header-delim)
+ 'hline
+   x))
+   (org-table-to-lisp))
(org-babel-pick-name (cdr (assoc :colname-names params))
(cdr (assoc :colnames params)))
(org-babel-pick-name (cdr (assoc :rowname-names params))

2010/12/21 Sébastien Vauban wxhgmqzgw...@spammotel.com:
 Hi Charles,

 Charles Sebold wrote:
 I use org-mode and babel under Windows with osql, and the line separating
 the header from the rest of the rows in the output was bothering me.

 Excellent initiative!

 I don't know that this is a really good fix, but maybe it's a start for one?
 It looks for the first output line of all dashes and replaces it later with
 the 'hline when the table is lisp-ified.

 It does not work correctly for me (with the osql engine). Look at the
 situation before/after your patch:

 1. Before

   #+srcname: top-10-dossiers-with-many-presta
   #+begin_src sql
   SET NOCOUNT ON

   SELECT TOP 10 prsAbcID, COUNT(*) AS '# Presta'
   FROM presta
   GROUP BY prsAbcID
   ORDER BY COUNT(*) DESC
   #+end_src

   #+results: top-10-dossiers-with-many-presta
   |         prsAbcID |      # Presta |
   |  | - |
   |   73020050900111 |            22 |
   |   52020030200047 |            21 |
   |   6102006047 |            21 |
   |   62020031200052 |            20 |
   |   72020051100016 |            20 |
   |   73020050800025 |            20 |
   |   5602003112 |            19 |
   |   63020060900056 |            19 |
   |   61020030900049 |            18 |
   |   72020030700040 |            18 |
   |                  |               |

   Another annoying thing is the empty line at the end. With the COUNT ON,
   there is one empty line followed by the count.

 2. After

   #+results: top-10-dossiers-with-many-presta
   |         prsAbcID |      # Presta |
   |  | - |
   |   73020050900111 |            22 |
   |   52020030200047 |            21 |
   |   6102006047 |            21 |
   |   62020031200052 |            20 |
   |   72020051100016 |            20 |
   |   73020050800025 |            20 |
   |   5602003112 |            19 |
   |   63020060900056 |            19 |
   |   61020030900049 |            18 |
   |   72020030700040 |            18 |
   |--+---|

   The hline is not applied on the second line, but at the end of the table.
   Perhaps the good condition is to work on the second line?

 Best regards,
  Seb

 --
 Sébastien Vauban


 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode




-- 
Charles Sebold
Ego delendus sum

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [babel] R: New handling of file output

2010-12-21 Thread Dan Davison
Dan Davison dandavis...@gmail.com writes:

 Please note the following changes to the way that org-babel handles
 file output. These may break existing org-babel files which use
 the :file header argument.

 :file filename should be understood as saying write the result
 to filename and return a link to filename.

 This works for all languages. For graphics languages (e.g. ditaa, dot,
 gnuplot) there is no change in behavior: result in the above is the
 graphics, and a link to the image is placed in the org buffer. For
 general-purpose languages (e.g. emacs-lisp, python, R, ruby, shell),
 the result written to file is the normal org-babel result (string,
 number, table).

 This is a backwards-incompatible change for R, which was previously
 interpreting :file to mean send graphics to file. I will send a
 separate email concerning R.

Previously R understood :file filename to mean save graphics to
filename[1]; now R behaves like other languages and sends the normal
org-babel result to file (string, number, table). To tell R to save
graphics[1] to file, use :results graphics.

Some examples:

Wrong!

#+begin_src R :file img.png
hist(rnorm(100))
img.png is going to contain this string.
#+end_src

Use :results graphics save graphics:

#+begin_src R :file img.png :results graphics
hist(rnorm(100))
But now img.png is going to contain graphics.
#+end_src

You may want to use `org-babel-default-header-args:R' to make this
more convenient:

#+begin_src emacs-lisp
  (setq org-babel-default-header-args:R
'((:results . graphics)))
#+end_src

Alternatively the :results graphics header can be set in a property
drawer for the subtree, or a #+babel: line, as usual.

Now this will do what was intended
#+begin_src R :file img.png
hist(rnorm(100))
#+end_src

Here is an example of saving something other than base graphics to file,
and returning a link to the file. Note that :file is not used, and the
filename must be returned. This could be used to save images created by
non-base graphics libraries:

#+begin_src R :results file :var file=savefile
write.something.to.file - function(f) cat(hello, file=f)
write.something.to.file(f=file)
file
#+end_src


Dan


* Footnotes
[1] This only works for base graphics.




 In order to return a file link from a src block without telling babel
 to save any results to that file, use :results filename and do not
 use :file. The code block can of course write arbitrary content to
 filename.

 Some examples:

 Save the output of ls -l as a .csv file (recall that :results value is
 the default):

 #+begin_src sh :file dirlisting.csv :sep ,
  ls -l
 #+end_src

 Send the text output of ls -l directly to file:

 #+begin_src sh :results output :file dirlisting.txt
  ls -l
 #+end_src

 Dan


 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Patch for ob-sql.el SQL output

2010-12-21 Thread Charles Sebold
OK, another change: added a fix for the blank line at the end.

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 5bb123d..2ff85d9 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -65,6 +65,7 @@ This function is called by `org-babel-execute-src-block'.
  (in-file (org-babel-temp-file sql-in-))
  (out-file (or (cdr (assoc :out-file params))
(org-babel-temp-file sql-out-)))
+ (header-delim )
  (command (case (intern engine)
 ('msosql (format osql %s -s \\t\ -i %s -o %s
  (or cmdline )
@@ -84,9 +85,26 @@ This function is called by `org-babel-execute-src-block'.
 (message command)
 (shell-command command)
 (with-temp-buffer
+  ; need to figure out what the delimiter is for the header row
+  (with-temp-buffer
+(insert-file-contents out-file)
+(goto-char (point-min))
+(when (re-search-forward ^\\(-+\\)[^-] nil t)
+  (setq header-delim (match-string-no-properties 1)))
+(goto-char (point-max))
+(forward-char -1)
+(while (looking-at \n)
+  (delete-char 1)
+  (goto-char (point-max))
+  (forward-char -1))
+(write-file out-file))
   (org-table-import out-file '(16))
   (org-babel-reassemble-table
-   (org-table-to-lisp)
+   (mapcar (lambda (x)
+ (if (string= (car x) header-delim)
+ 'hline
+   x))
+   (org-table-to-lisp))
(org-babel-pick-name (cdr (assoc :colname-names params))
(cdr (assoc :colnames params)))
(org-babel-pick-name (cdr (assoc :rowname-names params))


2010/12/21 Charles Sebold cseb...@gmail.com:
 I feel silly.  I was just testing with one output column.

 Change the $ in the regexp to [^-] or just reapply patch as follows:

 diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
 index 5bb123d..32b7bf0 100644
 --- a/lisp/ob-sql.el
 +++ b/lisp/ob-sql.el
 @@ -65,6 +65,7 @@ This function is called by `org-babel-execute-src-block'.
          (in-file (org-babel-temp-file sql-in-))
          (out-file (or (cdr (assoc :out-file params))
                        (org-babel-temp-file sql-out-)))
 +         (header-delim )
          (command (case (intern engine)
                     ('msosql (format osql %s -s \\t\ -i %s -o %s
                                      (or cmdline )
 @@ -84,9 +85,19 @@ This function is called by `org-babel-execute-src-block'.
     (message command)
     (shell-command command)
     (with-temp-buffer
 +      ; need to figure out what the delimiter is for the header row
 +      (with-temp-buffer
 +        (insert-file-contents out-file)
 +        (goto-char (point-min))
 +        (when (re-search-forward ^\\(-+\\)[^-] nil t)
 +          (setq header-delim (match-string-no-properties 1
       (org-table-import out-file '(16))
       (org-babel-reassemble-table
 -       (org-table-to-lisp)
 +       (mapcar (lambda (x)
 +                 (if (string= (car x) header-delim)
 +                     'hline
 +                   x))
 +               (org-table-to-lisp))
        (org-babel-pick-name (cdr (assoc :colname-names params))
                            (cdr (assoc :colnames params)))
        (org-babel-pick-name (cdr (assoc :rowname-names params))

 2010/12/21 Sébastien Vauban wxhgmqzgw...@spammotel.com:
 Hi Charles,

 Charles Sebold wrote:
 I use org-mode and babel under Windows with osql, and the line separating
 the header from the rest of the rows in the output was bothering me.

 Excellent initiative!

 I don't know that this is a really good fix, but maybe it's a start for one?
 It looks for the first output line of all dashes and replaces it later with
 the 'hline when the table is lisp-ified.

 It does not work correctly for me (with the osql engine). Look at the
 situation before/after your patch:

 1. Before

   #+srcname: top-10-dossiers-with-many-presta
   #+begin_src sql
   SET NOCOUNT ON

   SELECT TOP 10 prsAbcID, COUNT(*) AS '# Presta'
   FROM presta
   GROUP BY prsAbcID
   ORDER BY COUNT(*) DESC
   #+end_src

   #+results: top-10-dossiers-with-many-presta
   |         prsAbcID |      # Presta |
   |  | - |
   |   73020050900111 |            22 |
   |   52020030200047 |            21 |
   |   6102006047 |            21 |
   |   62020031200052 |            20 |
   |   72020051100016 |            20 |
   |   73020050800025 |            20 |
   |   5602003112 |            19 |
   |   63020060900056 |            19 |
   |   61020030900049 |            18 |
   |   72020030700040 |            18 |
   |                  |               |

   Another annoying thing is the empty line at the end. With the COUNT ON,
   there is one empty line followed by the count.

 2. After

   #+results: top-10-dossiers-with-many-presta
   |         prsAbcID |      # Presta |
   |  | - |
   |   

Re: [Orgmode] Re: Patch for ob-sql.el SQL output

2010-12-21 Thread Eric Schulte
Hi Charles,

This looks great, I've just applied this most recent patch.

Thanks -- Eric

Charles Sebold cseb...@gmail.com writes:

 OK, another change: added a fix for the blank line at the end.

 diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
 index 5bb123d..2ff85d9 100644
 --- a/lisp/ob-sql.el
 +++ b/lisp/ob-sql.el
 @@ -65,6 +65,7 @@ This function is called by `org-babel-execute-src-block'.
   (in-file (org-babel-temp-file sql-in-))
   (out-file (or (cdr (assoc :out-file params))
 (org-babel-temp-file sql-out-)))
 + (header-delim )
   (command (case (intern engine)
  ('msosql (format osql %s -s \\t\ -i %s -o %s
   (or cmdline )
 @@ -84,9 +85,26 @@ This function is called by `org-babel-execute-src-block'.
  (message command)
  (shell-command command)
  (with-temp-buffer
 +  ; need to figure out what the delimiter is for the header row
 +  (with-temp-buffer
 +(insert-file-contents out-file)
 +(goto-char (point-min))
 +(when (re-search-forward ^\\(-+\\)[^-] nil t)
 +  (setq header-delim (match-string-no-properties 1)))
 +(goto-char (point-max))
 +(forward-char -1)
 +(while (looking-at \n)
 +  (delete-char 1)
 +  (goto-char (point-max))
 +  (forward-char -1))
 +(write-file out-file))
(org-table-import out-file '(16))
(org-babel-reassemble-table
 -   (org-table-to-lisp)
 +   (mapcar (lambda (x)
 + (if (string= (car x) header-delim)
 + 'hline
 +   x))
 +   (org-table-to-lisp))
 (org-babel-pick-name (cdr (assoc :colname-names params))
 (cdr (assoc :colnames params)))
 (org-babel-pick-name (cdr (assoc :rowname-names params))


 2010/12/21 Charles Sebold cseb...@gmail.com:
 I feel silly.  I was just testing with one output column.

 Change the $ in the regexp to [^-] or just reapply patch as follows:

 diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
 index 5bb123d..32b7bf0 100644
 --- a/lisp/ob-sql.el
 +++ b/lisp/ob-sql.el
 @@ -65,6 +65,7 @@ This function is called by `org-babel-execute-src-block'.
          (in-file (org-babel-temp-file sql-in-))
          (out-file (or (cdr (assoc :out-file params))
                        (org-babel-temp-file sql-out-)))
 +         (header-delim )
          (command (case (intern engine)
                     ('msosql (format osql %s -s \\t\ -i %s -o %s
                                      (or cmdline )
 @@ -84,9 +85,19 @@ This function is called by `org-babel-execute-src-block'.
     (message command)
     (shell-command command)
     (with-temp-buffer
 +      ; need to figure out what the delimiter is for the header row
 +      (with-temp-buffer
 +        (insert-file-contents out-file)
 +        (goto-char (point-min))
 +        (when (re-search-forward ^\\(-+\\)[^-] nil t)
 +          (setq header-delim (match-string-no-properties 1
       (org-table-import out-file '(16))
       (org-babel-reassemble-table
 -       (org-table-to-lisp)
 +       (mapcar (lambda (x)
 +                 (if (string= (car x) header-delim)
 +                     'hline
 +                   x))
 +               (org-table-to-lisp))
        (org-babel-pick-name (cdr (assoc :colname-names params))
                            (cdr (assoc :colnames params)))
        (org-babel-pick-name (cdr (assoc :rowname-names params))

 2010/12/21 Sébastien Vauban wxhgmqzgw...@spammotel.com:
 Hi Charles,

 Charles Sebold wrote:
 I use org-mode and babel under Windows with osql, and the line separating
 the header from the rest of the rows in the output was bothering me.

 Excellent initiative!

 I don't know that this is a really good fix, but maybe it's a start for 
 one?
 It looks for the first output line of all dashes and replaces it later with
 the 'hline when the table is lisp-ified.

 It does not work correctly for me (with the osql engine). Look at the
 situation before/after your patch:

 1. Before

   #+srcname: top-10-dossiers-with-many-presta
   #+begin_src sql
   SET NOCOUNT ON

   SELECT TOP 10 prsAbcID, COUNT(*) AS '# Presta'
   FROM presta
   GROUP BY prsAbcID
   ORDER BY COUNT(*) DESC
   #+end_src

   #+results: top-10-dossiers-with-many-presta
   |         prsAbcID |      # Presta |
   |  | - |
   |   73020050900111 |            22 |
   |   52020030200047 |            21 |
   |   6102006047 |            21 |
   |   62020031200052 |            20 |
   |   72020051100016 |            20 |
   |   73020050800025 |            20 |
   |   5602003112 |            19 |
   |   63020060900056 |            19 |
   |   61020030900049 |            18 |
   |   72020030700040 |            18 |
   |                  |               |

   Another annoying thing is the empty line at the end. With the COUNT ON,
   there is one empty 

[Orgmode] Bug: Agenda view switches back to week with g [7.4]

2010-12-21 Thread Joel J. Adamson


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


When I go into the weekly agenda, I use d (org-agenda-day-view) to get
the daily view, which brings up the first day of the week.  I then press
g (org-agenda-redo) which takes me back to week view.  Previously g
would refresh the day-view bringing me to the current day of the week.

Emacs  : GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.22.0)
 of 2010-12-20 on edna
Package: Org-mode version 7.4

current state:
==
(setq
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-default-priority 68
 org-speed-command-hook '(org-speed-command-default-hook
  org-babel-speed-command-hook)
 org-agenda-custom-commands '((c Agenda with Current Projects
   ((agenda ) (tags CURRENT nil)))
  )
 org-agenda-files '(~/Documents/org/inbox.org ~/Documents/org/appts.org
~/Documents/org/proj.org)
 org-clock-into-drawer t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-agenda-todo-ignore-scheduled t
 org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
 org-deadline-warning-days 7
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-tags-exclude-from-inheritance '(CURRENT)
 org-tab-first-hook '(org-hide-block-toggle-maybe
  org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-finalize-agenda-hook '(org-agenda-to-appt)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-use-tag-inheritance nil
 org-clock-persist t
 org-agenda-include-all-todo t
 org-clock-sound /usr/share/sounds/freedesktop/stereo/complete.oga
 org-todo-keywords '((sequence reminder(r) todo(t) wait(w!) |
  done(d!))
 )
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-preprocess-before-normalizing-links-hook 
'(org-remove-file-link-modifiers)
 org-agenda-window-frame-fractions '(1.0 . 1.0)
 org-mode-hook '(org-clock-load
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook org-show-block-all
append local]
   5]
 #[nil \300\301\302\303\304$\207
   [org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
  org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-clock-modeline-total 'today
 org-agenda-todo-ignore-with-date t
 org-export-interblocks '((lob org-babel-exp-lob-one-liners)
  (src org-babel-exp-inline-src-blocks))
 org-occur-hook '(org-first-headline-recenter)
 org-export-preprocess-before-selecting-backend-code-hook 
'(org-beamer-select-beamer-code)
 org-agenda-todo-ignore-deadlines t
 org-agenda-use-time-grid nil
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
   org-beamer-auto-fragile-frames
   org-beamer-place-default-actions-for-lists)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-idle-time 10
 org-export-blocks '((src org-babel-exp-src-blocks nil)
 (comment org-export-blocks-format-comment t)
 (ditaa org-export-blocks-format-ditaa nil)
 (dot org-export-blocks-format-dot nil))
 )
-- 
Joel J. Adamson -- http://www.unc.edu/~adamsonj
University of North Carolina at Chapel Hill
CB #3280, Coker Hall
Chapel Hill, NC 27599-3280


pgpeZQNWMBxPm.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Patch for ob-sql.el SQL output

2010-12-21 Thread Charles Sebold
Sébastien:

What do you think would be a good solution for the blank between the output
of a table and the row count if someone didn't run SET NOCOUNT ON?

I mean, should that be another hline, or no blank line, or what?

If somebody's trying to programatically use this table, it will mess up
their data, but I would think they wouldn't have NOCOUNT off in that case.

It seems to me like the right thing to do is another hline, but I'm not
convinced.  And it is even more of a hack, because I don't know how to test
for the rows affected line without an ugly search for some regexp like 
rows? affected), and in other language environments I would guess it
doesn't even say that.

In the intermediate output file the row count line is preceded by a blank
line, but if there is only one column being output how can you tell the
difference between that and a blank record?

Anyway, if somebody wants the row count line at the moment I don't know how
to work around the extra blank without a ton of logic for single-column or
multi-column responses, and this is probably just making this code more and
more osql-specific, which will not be helpful for people on free database
systems.  But if anybody has any ideas or suggestions, I may have a little
time to try to implement them.

On Tue, Dec 21, 2010 at 11:34 AM, Eric Schulte schulte.e...@gmail.comwrote:

 Hi Charles,

 This looks great, I've just applied this most recent patch.

 Thanks -- Eric

 Charles Sebold cseb...@gmail.com writes:

  OK, another change: added a fix for the blank line at the end.
 
  diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
  index 5bb123d..2ff85d9 100644
  --- a/lisp/ob-sql.el
  +++ b/lisp/ob-sql.el
  @@ -65,6 +65,7 @@ This function is called by
 `org-babel-execute-src-block'.
(in-file (org-babel-temp-file sql-in-))
(out-file (or (cdr (assoc :out-file params))
  (org-babel-temp-file sql-out-)))
  + (header-delim )
(command (case (intern engine)
   ('msosql (format osql %s -s \\t\ -i %s -o %s
(or cmdline )
  @@ -84,9 +85,26 @@ This function is called by
 `org-babel-execute-src-block'.
   (message command)
   (shell-command command)
   (with-temp-buffer
  +  ; need to figure out what the delimiter is for the header row
  +  (with-temp-buffer
  +(insert-file-contents out-file)
  +(goto-char (point-min))
  +(when (re-search-forward ^\\(-+\\)[^-] nil t)
  +  (setq header-delim (match-string-no-properties 1)))
  +(goto-char (point-max))
  +(forward-char -1)
  +(while (looking-at \n)
  +  (delete-char 1)
  +  (goto-char (point-max))
  +  (forward-char -1))
  +(write-file out-file))
 (org-table-import out-file '(16))
 (org-babel-reassemble-table
  -   (org-table-to-lisp)
  +   (mapcar (lambda (x)
  + (if (string= (car x) header-delim)
  + 'hline
  +   x))
  +   (org-table-to-lisp))
  (org-babel-pick-name (cdr (assoc :colname-names params))
  (cdr (assoc :colnames params)))
  (org-babel-pick-name (cdr (assoc :rowname-names params))
 
 
  2010/12/21 Charles Sebold cseb...@gmail.com:
  I feel silly.  I was just testing with one output column.
 
  Change the $ in the regexp to [^-] or just reapply patch as follows:
 
  diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
  index 5bb123d..32b7bf0 100644
  --- a/lisp/ob-sql.el
  +++ b/lisp/ob-sql.el
  @@ -65,6 +65,7 @@ This function is called by
 `org-babel-execute-src-block'.
   (in-file (org-babel-temp-file sql-in-))
   (out-file (or (cdr (assoc :out-file params))
 (org-babel-temp-file sql-out-)))
  + (header-delim )
   (command (case (intern engine)
  ('msosql (format osql %s -s \\t\ -i %s -o %s
   (or cmdline )
  @@ -84,9 +85,19 @@ This function is called by
 `org-babel-execute-src-block'.
  (message command)
  (shell-command command)
  (with-temp-buffer
  +  ; need to figure out what the delimiter is for the header row
  +  (with-temp-buffer
  +(insert-file-contents out-file)
  +(goto-char (point-min))
  +(when (re-search-forward ^\\(-+\\)[^-] nil t)
  +  (setq header-delim (match-string-no-properties 1
(org-table-import out-file '(16))
(org-babel-reassemble-table
  -   (org-table-to-lisp)
  +   (mapcar (lambda (x)
  + (if (string= (car x) header-delim)
  + 'hline
  +   x))
  +   (org-table-to-lisp))
 (org-babel-pick-name (cdr (assoc :colname-names params))
 (cdr (assoc :colnames params)))
 (org-babel-pick-name (cdr (assoc :rowname-names params))
 
  

[Orgmode] Minor bug: org-agenda-holidays

2010-12-21 Thread Paul Sexton
In org-agenda.el, the function org-agenda-holidays is coded as:

(defun org-agenda-holidays ()
  Display the holidays for the 3 months around the cursor date.
  (interactive)
  (org-agenda-execute-calendar-command 'list-calendar-holidays))

'list-calendar-holidays' does not exist. It should be 
'calendar-list-holidays'.

Paul



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Minor bug: org-agenda-holidays

2010-12-21 Thread Tassilo Horn
Paul Sexton psex...@xnet.co.nz writes:

 In org-agenda.el, the function org-agenda-holidays is coded as:

 (defun org-agenda-holidays ()
   Display the holidays for the 3 months around the cursor date.
   (interactive)
   (org-agenda-execute-calendar-command 'list-calendar-holidays))

 'list-calendar-holidays' does not exist. It should be
 'calendar-list-holidays'.

In my emacs version (24 from bzr), the former is an alias for the
latter, where the former is obsoleted as of emacs 23.1.  So I guess
older emacs version only have the former.

What emacs version are you using?

Bye,
Tassilo


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Page numbering in manual

2010-12-21 Thread Alan E. Davis
Is it possible to tweak page numbering in the manual, with each chapter
having it's separate sequence?

The manual is fairly extensive.  If a chapter has changed even in a minor
way, the numbering of subsequent chapters is also affected.  With
chapter-by-chapter page numbering, once could keep the manual in a binder,
and swap out chapters one by one, as needed.

Is there a way to do this with a simple latex tweak?  I can't remember this.

Alan Davis


 Pollution is nothing but the resources we are not harvesting. We allow
them to disperse because we've been ignorant of their value.

   --- R. Buckminster Fuller
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Sending org buffer as mail?

2010-12-21 Thread Niels Giesen
Eric Schulte schulte.e...@gmail.com writes:

 Niels Giesen niels.gie...@gmail.com writes:

 Eric Schulte schulte.e...@gmail.com writes:

 Thanks, I've just pushed up a new version of org-mime which makes use of
 this function.


Hi Eric, thanks for implementing this.

However, I see a problem in the solution for when html-ascii is
specified as the MAIL_FMT, being that the same hook will be run for both
parts of the message. I think it better not to have a html-ascii hook
and run the html hook for the html part and the ascii hook for the ascii
part. Otherwise the ascii hook may for instance delete a =BEGIN_SRC=
line and insert cut lines not needed by html.

Same goes for html (which is in fact html-org). Although I cannot really
think of any hooks I might want to run there.

I'll take a look at the link you gave for Org-mode block fontification
in gnus, although that seems like a solution for the receiving side, and
most of my peers do not run gnus and org, or emacs for that matter, but
many do want to receive mail in plain text.

On the subject of encouraging so-called code blocks brought to our
attention by Samuel, encouraging this was not my intention, I should
have thought better before posting and I will never in my life post such
immoral examples anymore.

Regards,

Niels

 [...]

 Hi Eric,

 I love the org-mime-subtree function! It makes writing good-looking
 mails very easy.

 Now for a proposal:

 For ascii export used for mail, it would be cool if SRC and EXAMPLE
 blocks be surrounded by cut here scissor lines. They look well in gnus
 for example:


 For even better looking code in gnus, I personally prefer to use org as
 my export target (rather than ascii), and with Org-mode code block
 fontification configuration from
 http://eschulte.github.com/emacs-starter-kit/starter-kit-gnus.html
 code blocks inside org-mode markup will be correctly fontified in gnus
 messages.


 code or example here

 Maybe the best way to achieve this is to define a hook before the string
 is sent to `org-export-string' with the FMT arg set to 'ascii, so that
 people can define their own functions. For instance, there are also
 people who prefer a block like


 good idea, I've just added a series of hooks to org-mime which will be
 called in a temporary buffer holding the text to be exported, so you
 could add a function here to add scissor lines around code blocks.  Like
 Sam I would discourage the use of boxquotes for anything that users may
 want to cut and paste.  For ascii use the `org-mime-pre-ascii-hook'.

 If you come up with useful hooks it may be nice to share them on worg at
 http://orgmode.org/worg/org-contrib/org-mime.php


 ,[ emacs-lisp ]
 | source here
 `

 What do you think?

 Regards,

 Niels.

 Thanks for the suggestion -- Eric



-- 
http://pft.github.com/

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] org-mac-protocol usage example

2010-12-21 Thread Urs Rau (UK)
Sorry, if this is soo obvious to all you regular emacs and org-mode users. But 
I am a newbie when it comes to emacs and especially org-mode, I just don't see 
the tree for the forrest.

I have installed the org-mac-protocol as per it's webpage at 

https://github.com/claviclaws/org-mac-protocol/blob/master/org-mac-protocol.org

I am running on Snow Leopard 10.6.5 under GNU Emacs 23.2.1 
(x86_64-apple-darwin, NS apple-appkit-1038.29) of 2010-05-09 on black.local 
and in the Install instructions o that page,  I made it all the way down to 

 and add org-mac-protocol to External packages
 
 Start emacsserver
  (server-start)
 
 Create *Remember* templates

And here is where I get stuck, the sample;e templates don't make sense to me, 
and besides I already have working ones in my .emacs anyway, one for todos and 
one for notes.

How do these templates relate to either org-capture or org-remember? And what 
are the default selectors? Is it t for todo and n for notes?

I have the following org-capture templates already working for me

 (setq org-capture-templates
  '((t Agenda Todo entry
(file+datetree ~/org/tasksnotes.org )
\n\n** TODO %?\n%T\n\n%i\n%a\n\n\n
:empty-lines 1)
 
   (n Agenda Notes entry
(file+datetree ~/org/tasksnotes.org )
\n\n** %?\n%T\n%i\n%a\n\n\n
:empty-lines 1)))



How or where do I now save or put the applescript? and how or where from do I 
call it up? What are the steps I have to do, leading up to a new todo or note 
being saved to the named buffers.

I have the *.scpt files in the ~/Library/Scripts/ folder (which I had to create 
btw) 

A very simple one or two sample in a step by step format would help e greatly. 
maybe one for iCal for creating a todo from an iCal event and one for a note 
for an apple mail item? 

step 1 open ical
step 2 highlight or mark event
step 3 
step 4 ???
step 5 switch to emacs and find new todo in .

Thanks for any help or pointers,

Regards,

-- 
Urs Rau


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] MobileOrg Android 0.5.0 - Now with native Dropbox support!

2010-12-21 Thread Matthew Jones
Merry Christmas to all MobileOrg Android users... I am pleased to announce
the 0.5.0 release of MobileOrg for Android.

This release includes support for Dropbox which is the single most requested
feature.  I actually finished writing the code for this a few weeks ago, but
it has taken a little while for the Dropbox folks to approve it for release.

This release also includes some bug fixes, although I have not yet managed
to get a handle on the SSL bug if the CA is not recognized by the Android
OS.   I'm planning this for the 0.5.1 release

Also included in this release is some basic scripting for calling the
Capture interface from outside of the application, see this URL:

https://github.com/matburt/mobileorg-android/wiki/Scripting

for an example of how to use this from the Android Scripting Interface (now
called SL4A)

You can either download directly from the market or find a direct download
link to the APK on the wiki (for those who don't have access to the Market):

https://github.com/matburt/mobileorg-android/wiki

There are some really great features coming in the near future, including
better support for capturing notes with TODO, Priority, and Tags and support
for editing the body of an Org entry.  I'm also working on a UI overhaul
that should make things more attractive and easier to use.

Merry Christmas and, as always, please report any bugs or features on
Github: https://github.com/matburt/mobileorg-android/issues

http://matburt.net
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] MobileOrg Android 0.5.0 - Now with native Dropbox support!

2010-12-21 Thread Erik Iverson

On 12/21/2010 06:25 PM, Matthew Jones wrote:

Merry Christmas to all MobileOrg Android users... I am pleased to announce the
0.5.0 release of MobileOrg for Android.


Great, looking forward to trying it out!



This release includes support for Dropbox which is the single most requested
feature.  I actually finished writing the code for this a few weeks ago, but it
has taken a little while for the Dropbox folks to approve it for release.


Can you briefly describe what this approval process it about?  As in, what
exactly are they approving of?  That you use their trademarked name in the
app perhaps?


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] MobileOrg Android 0.5.0 - Now with native Dropbox support!

2010-12-21 Thread Matthew Jones
The approval process is to ensure that the app meets their usage guidelines:

https://www.dropbox.com/developers/announcements/6

See the section Approval Process...

I think the most important thing is that they want to know that I will only
store the auth tokens instead of your actual username and password

http://matburt.net


On Tue, Dec 21, 2010 at 8:07 PM, Erik Iverson er...@ccbr.umn.edu wrote:

 On 12/21/2010 06:25 PM, Matthew Jones wrote:

 Merry Christmas to all MobileOrg Android users... I am pleased to announce
 the
 0.5.0 release of MobileOrg for Android.


 Great, looking forward to trying it out!



 This release includes support for Dropbox which is the single most
 requested
 feature.  I actually finished writing the code for this a few weeks ago,
 but it
 has taken a little while for the Dropbox folks to approve it for release.


 Can you briefly describe what this approval process it about?  As in, what
 exactly are they approving of?  That you use their trademarked name in the
 app perhaps?


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [PATCH] Add missing value to docstring for org-link-frame-setup

2010-12-21 Thread Bernt Hansen
* lisp/org.el: Document missing value for org-link-frame-setup
---
This patch is available at git://git.norang.ca/org-mode.git fix-doc

-Bernt

 lisp/org.el |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 3cecca7..c94cb5f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1482,6 +1482,7 @@ this link in another window or frame.  This variable can 
be used to
 set this up for the different types of links.
 For VM, use any of
 `vm-visit-folder'
+`vm-visit-folder-other-window'
 `vm-visit-folder-other-frame'
 For Gnus, use any of
 `gnus'
-- 
1.7.3.3.464.gf80b6


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Bug: Publishing with org-src-fontify-natively fails with Lisp error: (void-function -mode) [7.4 (release_7.4.79.g9c4b9)]

2010-12-21 Thread Bernt Hansen
Hi,

I have a patch for this problem which works for me but I'm not sure it's
the correct fix.  Will post the patch following this report.

When I attempt to publish the source for
http://doc.norang.ca/org-mode.html (a copy of which is at
http://doc.norang.ca/org-mode.org) with org-src-fontify-natively set to
t I get the error void-function -mode.

I start a fresh emacs, load the org file and call M-x
bh/save-then-publish.

--8---cut here---start-8---
(defun bh/save-then-publish (optional force)
  (interactive P)
  (save-buffer)
  (org-save-all-org-buffers)
  (org-publish-current-project force))

(setq org-publish-project-alist
  ;
  ; http://www.norang.ca/  (norang website)
  ; norang-org are the org-files that generate the content
  ; norang-extra are images and css files that need to be included
  ; norang is the top-level project that gets published
  (quote ((norang-org
   :base-directory ~/git/www.norang.ca
   :publishing-directory /ssh:www-d...@www:~/www.norang.ca/htdocs
   :recursive t
   :table-of-contents nil
   :base-extension org
   :publishing-function org-publish-org-to-html
   :style-include-default nil
   :section-numbers nil
   :table-of-contents nil
   :style link rel=\stylesheet\ href=\norang.css\ 
type=\text/css\ /
   :author-info nil
   :creator-info nil)
  (norang-extra
   :base-directory ~/git/www.norang.ca/
   :publishing-directory /ssh:www-d...@www:~/www.norang.ca/htdocs
   :base-extension css\\|pdf\\|png\\|jpg\\|gif
   :publishing-function org-publish-attachment
   :recursive t
   :author nil)
  (norang
   :components (norang-org norang-extra))
  ;
  ; http://doc.norang.ca/  (norang website)
  ; doc-org are the org-files that generate the content
  ; doc-extra are images and css files that need to be included
  ; doc is the top-level project that gets published
  (doc-org
   :base-directory ~/git/doc.norang.ca/
   :publishing-directory /ssh:www-d...@www:~/doc.norang.ca/htdocs
   :recursive t
   :section-numbers nil
   :table-of-contents nil
   :base-extension org
   :publishing-function (org-publish-org-to-html 
org-publish-org-to-org)
   :style-include-default nil
   :style link rel=\stylesheet\ href=\/org.css\ 
type=\text/css\ /
   :author-info nil
   :creator-info nil)
  (doc-extra
   :base-directory ~/git/doc.norang.ca/
   :publishing-directory /ssh:www-d...@www:~/doc.norang.ca/htdocs
   :base-extension css\\|pdf\\|png\\|jpg\\|gif
   :publishing-function org-publish-attachment
   :recursive t
   :author nil)
  (doc
   :components (doc-org doc-extra))
  ;
  ; Miscellaneous pages for other websites
  ; org are the org-files that generate the content
  (org-org
   :base-directory ~/git/org/
   :publishing-directory /ssh:www-d...@www:~/org
   :recursive t
   :section-numbers nil
   :table-of-contents nil
   :base-extension org
   :publishing-function org-publish-org-to-html
   :style-include-default nil
   :style link rel=\stylesheet\ href=\/org.css\ 
type=\text/css\ /
   :author-info nil
   :creator-info nil)
  ;
  ; http://doc.norang.ca/  (norang website)
  ; org-mode-doc-org this document
  ; org-mode-doc-extra are images and css files that need to be 
included
  ; org-mode-doc is the top-level project that gets published
  ; This uses the same target directory as the 'doc' project
  (org-mode-doc-org
   :base-directory ~/git/org-mode-doc/
   :publishing-directory /ssh:www-d...@www:~/doc.norang.ca/htdocs
   :recursive t
   :section-numbers nil
   :table-of-contents nil
   :base-extension org
   :publishing-function (org-publish-org-to-html 
org-publish-org-to-org)
   :plain-source t
   :htmlized-source t
   :style-include-default nil
   :style link rel=\stylesheet\ href=\/org.css\ 
type=\text/css\ /
   :author-info nil
   :creator-info nil)
  (org-mode-doc-extra
   :base-directory ~/git/org-mode-doc/
   :publishing-directory /ssh:www-d...@www:~/doc.norang.ca/htdocs
   :base-extension 

[Orgmode] [PATCH] Skip source block fontification when the language is not defined

2010-12-21 Thread Bernt Hansen
* lisp/org.el: Skip source block fontification during export when language
is not defined
---
This may not be the correct fix for this issue but it works for me.

This patch is available at git://git.norang.ca/org-mode.git fix-export

-Bernt

 lisp/org.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 3cecca7..006e7bf 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5142,7 +5142,7 @@ will be prompted for.
  (add-text-properties end1 (+ end 1) '(face org-meta-line))
; for end_src
  (cond
-  ((and lang org-src-fontify-natively)
+  ((and lang (not (string-equal lang )) org-src-fontify-natively)
(org-src-font-lock-fontify-block lang block-start block-end))
   (quoting
(add-text-properties beg1 (+ end1 1) '(face
-- 
1.7.3.3.464.gf80b6


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]

2010-12-21 Thread Bernt Hansen
Hi,

If you are viewing the agenda with a time span of a week (or anything
larger than a day) and then use 'J' to jump to a new date the span
changes back to day.

I think the span should remain unchanged when moving to a new date.

Regards,
Bernt

Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-11-03 on potassium, modified by Debian
Package: Org-mode version 7.4 (release_7.4.80.g0e5e5)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Bug: HTML export fails to close list [7.4 (release_7.4.80.g0e5e5)]

2010-12-21 Thread Bernt Hansen
Hi,

If you export the following org file to HTML the list is not terminated
properly.  There is a ORG-LIST-END tag in the source instead of the
/li /ul tags which results in invalid HTML.

,[ test.org ]
| * List ending on export
| 
| - Item 2 - last
`

Here is part of the HTML from the resulting export.  I first noticed
this when selecting a subtree for export to HTML where the subtree ends
in a list.

,[ Resulting HTML for C-c C-e H ]
| ...
| div id=outline-container-1 class=outline-2
| h2 id=sec-1span class=section-number-21/span List ending on export 
/h2
| div class=outline-text-2 id=text-1
| 
| 
| ul
| li
| Item 2 - lastORG-LIST-END
| /div
| /div
| ...
`

Regards,
Bernt

Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-11-03 on potassium, modified by Debian
Package: Org-mode version 7.4 (release_7.4.80.g0e5e5)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]

2010-12-21 Thread Noorul Islam K M
Bernt Hansen be...@norang.ca writes:

 Hi,

 If you are viewing the agenda with a time span of a week (or anything
 larger than a day) and then use 'J' to jump to a new date the span
 changes back to day.


For me, I have 'J' bound to (org-agenda-clock-goto) by default. I think
you are talking about 'j'.

 I think the span should remain unchanged when moving to a new date.

I think 'j' should not change the span. Or we can have 'C-u j' to keep
the span as it is.

Thanks and Regards 
Noorul

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Minor bug: org-agenda-holidays

2010-12-21 Thread Noorul Islam K M
Paul Sexton psex...@xnet.co.nz writes:

 In org-agenda.el, the function org-agenda-holidays is coded as:

 (defun org-agenda-holidays ()
   Display the holidays for the 3 months around the cursor date.
   (interactive)
   (org-agenda-execute-calendar-command 'list-calendar-holidays))

 'list-calendar-holidays' does not exist. It should be 
 'calendar-list-holidays'.


Did you  get any error when you executed this function?

Thanks and Regards
Noorul

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode