Re: [Orgmode] Useful utility function: org-sort-multi
On Aug 29, 2009, at 3:38 AM, Ryan C. Thompson wrote: I found myself having to sort by multiple criteria, and I was doing it with multiple calls to org-sort-entries-or-items. Then I decided to abstract the repetition into a function. Here it is: (defun org-sort-multi (rest sort-types) Sort successively by a list of criteria, in descending order of importance. For example, sort first by TODO status, then by priority, then by date, then alphabetically, case-sensitive. Each criterion is either a character or a cons pair (BOOL . CHAR), where BOOL is whether or not to sort case-sensitively, and CHAR is one of the characters defined in ``org-sort-entries-or-items''. So, the example above could be accomplished with: (org-sort-multi ?o ?p ?t (t . ?a)) (interactive) (mapc #'(lambda (sort-type) (when (characterp sort-type) (setq sort-type (cons nil sort-type))) (org-sort-entries-or-items (car sort-type) (cdr sort- type))) (reverse sort-types))) Note the call to reverse. This makes it so that the first criterion you provide is the dominant criterion. Try it out to see how it works, and let me know if there's a better way to pass the arguments. Just as an example, the particular sorting function I wanted to write now becomes this: (defun org-sort-custom () Sort children of node by todo status and by priority and by date, so the * TODO [#A] items with latest dates go to the top. (interactive) (org-sort-multi ?o ?p ?T)) Hi Ryan, this looks interesting, but I am not sure I understand how it works. It looks to me that each sorting step will completely re-sort the entire list of items, so the final sorting will win in the end. Or am I missing something here? - Carsten ___ Emacs-orgmode mailing list Remember: 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 Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH] Open single link immediately
This will be in the next push, when our repository is online again. Thanks! - Carsten On Aug 28, 2009, at 7:23 PM, Bernt Hansen wrote: C-c C-o on a headline or in the agenda displays a menu of links to choose from. If there is only a single link then go there directly skipping the menu. --- This patch is available at git://git.norang.ca/org-mode.git for- carsten lisp/org.el | 31 --- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a5181ab..f3d8976 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8073,21 +8073,22 @@ needed for the interpretation of abbreviated links. (push (match-string 0) links)) (setq links (reverse links)) (unless links (error No links)) - - (unless (and (integerp nth) (= (length links) nth)) - (save-excursion - (save-window-excursion - (delete-other-windows) - (with-output-to-temp-buffer *Select Link* - (princ Select link\n\n) - (mapc (lambda (l) (princ (format [%d] %s\n (incf cnt) l))) - links)) - (org-fit-window-to-buffer (get-buffer-window *Select Link*)) - (message Select link to open:) - (setq c (read-char-exclusive)) - (and (get-buffer *Select Link*) (kill-buffer *Select Link* - (setq nth (- c ?0))) - + (if (eq 1 (length links)) + (setq c 1) + (unless (and (integerp nth) (= (length links) nth)) + (save-excursion + (save-window-excursion + (delete-other-windows) + (with-output-to-temp-buffer *Select Link* + (princ Select link\n\n) + (mapc (lambda (l) (princ (format [%d] %s\n (incf cnt) l))) + links)) + (org-fit-window-to-buffer (get-buffer-window *Select Link*)) + (message Select link to open:) + (setq c (read-char-exclusive)) + (and (get-buffer *Select Link*) (kill-buffer *Select Link*)) + (setq nth (- c ?0)) + (unless (and (integerp nth) (= (length links) nth)) (error Invalid link selection)) (setq link (nth (1- nth) links) -- 1.6.4.1.331.gda1d56 ___ Emacs-orgmode mailing list Remember: 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 Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Useful utility function: org-sort-multi
Hey Carsten, Carsten Dominik carsten.domi...@gmail.com writes: On Aug 29, 2009, at 3:38 AM, Ryan C. Thompson wrote: Hi Ryan, this looks interesting, but I am not sure I understand how it works. It looks to me that each sorting step will completely re-sort the entire list of items, so the final sorting will win in the end. Or am I missing something here? if you have the following list * Test Sorting ** TODO Charlie ** WAITING Beta ** TODO Alpha ** STARTED Beta ** STARTED Charlie ** TODO Beta ** STARTED Alpha ** WAITING Charlie ** WAITING Alpha calling org-multi-sort with ?o ?a will sort it like this * Test Sorting ** TODO Alpha ** TODO Beta ** TODO Charlie ** STARTED Alpha ** STARTED Beta ** STARTED Charlie ** WAITING Alpha ** WAITING Beta ** WAITING Charlie but just ?a would completely ignore the TODO, STARTED, WAITING order. Thanks Ryan, pretty useful. - Carsten br, benny ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Format for a note
Nick Bell m...@nickbell.org writes: I have just started to use 'z' to add a note from agenda. I'd like to change the format of the added note to [the_date] the_note (i.e. remove the \\newline after the date which currently appears. I've looked everywhere but can't find out how to do this. Is it possible? I believe you can change the content of the header line using the variable org-log-note-headings, but as far as I can tell the format - header \\ note is hardcoded into the function. The \\ ensures a line break during export. I appreciate this behavior because it guarantees a clean, consistent list of notes, regardless of whether they are created with z or via org's automatic logging functions. Best, Matt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] [PATCH] Open single link immediately
FWIW it should be back up on monday. http://article.gmane.org/gmane.comp.version-control.git/85019 Tim. 2009/8/30 Carsten Dominik carsten.domi...@gmail.com: This will be in the next push, when our repository is online again. Thanks! - Carsten On Aug 28, 2009, at 7:23 PM, Bernt Hansen wrote: C-c C-o on a headline or in the agenda displays a menu of links to choose from. If there is only a single link then go there directly skipping the menu. --- This patch is available at git://git.norang.ca/org-mode.git for-carsten lisp/org.el | 31 --- 1 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a5181ab..f3d8976 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8073,21 +8073,22 @@ needed for the interpretation of abbreviated links. (push (match-string 0) links)) (setq links (reverse links)) (unless links (error No links)) - - (unless (and (integerp nth) (= (length links) nth)) - (save-excursion - (save-window-excursion - (delete-other-windows) - (with-output-to-temp-buffer *Select Link* - (princ Select link\n\n) - (mapc (lambda (l) (princ (format [%d] %s\n (incf cnt) l))) - links)) - (org-fit-window-to-buffer (get-buffer-window *Select Link*)) - (message Select link to open:) - (setq c (read-char-exclusive)) - (and (get-buffer *Select Link*) (kill-buffer *Select Link* - (setq nth (- c ?0))) - + (if (eq 1 (length links)) + (setq c 1) + (unless (and (integerp nth) (= (length links) nth)) + (save-excursion + (save-window-excursion + (delete-other-windows) + (with-output-to-temp-buffer *Select Link* + (princ Select link\n\n) + (mapc (lambda (l) (princ (format [%d] %s\n (incf cnt) l))) + links)) + (org-fit-window-to-buffer (get-buffer-window *Select Link*)) + (message Select link to open:) + (setq c (read-char-exclusive)) + (and (get-buffer *Select Link*) (kill-buffer *Select Link*)) + (setq nth (- c ?0)) + (unless (and (integerp nth) (= (length links) nth)) (error Invalid link selection)) (setq link (nth (1- nth) links) -- 1.6.4.1.331.gda1d56 ___ Emacs-orgmode mailing list Remember: 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 Remember: 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 Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] export (as latex) a large number of org files in a directory
Hi, I am trying to export a bunch of .org files stored in a directory as latex files. I have tried two methods: (1) --- At the bash prompt (I am using OS X): bash$ emacs --batch --load=/Applications/Emacs.app/Contents/Resources/lisp/org/org.elc --visit=file.org --funcall org-export-as-latex-batch' and I get an error: Cannot open load file: subst-ksc If I can get this to work, then I can embed this system call in a shell script and call it iteratively on a list of .org files retrieved from, say, Python or Bash (changing 'file.org' appropriately each time). (2) --- I created the following function which is intended to take a filename argument, load it into a temporary buffer, and export that buffer as a latex file. I thought to apply (map) this function to a list of file names generated by the directory-files() function. (defun orgexpastex (filenm) (let (buffer-file-name) (with-temp-buffer (setq buffer-file-name test) (insert-file-contents filenm) (org-export-as-latex 3)) ;;or (org-export-as-latex-batch)) ) ) But, upon testing this function, (orgexpastex file.org) I get [-] = =*Backtrace*-- Debugger entered--Lisp error: (wrong-type-argument stringp nil) re-search-forward(nil nil t) org-export-remove-headline-metadata((:for-LaTeX t :emph-multiline t :add-text nil :comments nil :skip-before-1st-heading nil :LaTeX-fragments nil :timestamps t :footnotes t)) org-export-preprocess-string( :for-LaTeX t :emph-multiline t :add-text nil :comments nil :skip-before-1st-heading nil :LaTeX-fragments nil :timestamps t :footnotes t) org-export-latex-first-lines((:latex-image-options width=10em :exclude-tags (noexport) :select-tags (export) :auto-postamble t [...snip...] --- I wonder if it is obvious to anyone what I am doing wrong, or if there is a better way to go about exporting a bunch of org files with a program. Thanks much! Stephen ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] export (as latex) a large number of org files in a directory
Stephen Tucker brown_...@yahoo.com wrote: Hi, I am trying to export a bunch of .org files stored in a directory as latex files. I have tried two methods: (1) --- At the bash prompt (I am using OS X): bash$ emacs --batch --load=/Applications/Emacs.app/Contents/Resources/lisp/org/org.elc --visit=file.org --funcall org-export-as-latex-batch' and I get an error: Cannot open load file: subst-ksc If I can get this to work, then I can embed this system call in a shell script and call it iteratively on a list of .org files retrieved from, say, Python or Bash (changing 'file.org' appropriately each time). Did you escape the newlines? If you cut-n-pasted from the org-export-as-latex-batch help, you fell into the trap :-) Maybe the documentation of the function could be changed to add the backslashes? The following script (I call it org-to-latex) works fine on linux: --8---cut here---start-8--- #! /bin/bash orglib=$HOME/elisp/org-mode/lisp emacs --batch \ --load=$orglib/org.elc \ --eval (setq org-export-headline-levels 2) \ --visit=$1 --funcall org-export-as-latex-batch --8---cut here---end---8--- You can add a loop in it too - or do the loop by hand: --8---cut here---start-8--- for x in *.org do org-to-latex $x done --8---cut here---end---8--- HTH, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] org-agenda-custom-commands - what's wrong with my setup
hello org-mode users, for some reason, my agenda export isn't working as it used to in the past. (setq org-agenda-custom-commands '((x agenda export to html nil (~/agenda.html with this in my org configuration, i get 'x' as an accepted keystroke in the agenda command selection buffer. however, when i use it, it does not export my agenda. how should i troubleshoot, can someone point me to where do i start looking? this used to work in the past, but now that i use it after a gap, it doesn't seem to do its thing. i use emacs version 23.1.1 and org-mode version - 6.28trans thanks, -- ajd. ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: org-agenda-custom-commands - what's wrong with my setup
aldrin d'souza aldrindso...@gmail.com writes: hello org-mode users, for some reason, my agenda export isn't working as it used to in the past. (setq org-agenda-custom-commands '((x agenda export to html nil (~/agenda.html If you want the agenda to show up when you select x, then you need to use an empty string after agenda: --8---cut here---start-8--- (setq org-agenda-custom-commands '((x agenda nil (~/agenda.html --8---cut here---end---8--- If you want to name the agenda view, then you should use: --8---cut here---start-8--- (setq org-agenda-custom-commands '((x Export to html agenda nil (~/agenda.html --8---cut here---end---8--- with this in my org configuration, i get 'x' as an accepted keystroke in the agenda command selection buffer. however, when i use it, it does not export my agenda. how should i troubleshoot, can someone point me to where do i start looking? this used to work in the past, but now that i use it after a gap, it doesn't seem to do its thing. When you select x, it will only display the agenda in an emacs buffer. To export the agenda, you need to use: C-c a e (export agenda views) This command exports all agenda views for which you have defined an export target (in this case, ~/agenda.html). Best, Matt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Setting timestamp format to English
Hi, First of all I'd like to say that I find orgmode great. I'd been looking for a tool like this for years. I have a french version of windows so when I set a timestamp on an item with C-c , I get the timestamp in french. I'd like to get it in english. I've tried setting the language environment to english through the menu (options/mule/set language environment) but it makes no difference. In a previous mail of this mailing list ( http://www.mail-archive.com/emacs-orgmode@gnu.org/msg03064.html), it is mentioned that this depends on the variable system-time-locale. How can I set system-time-locale to english permanently in my emacs init file? ( I'm a newbie to emacs) I've tried the following, but it doesnt work: (set-locale-environment English) (system-time-locale English) Thanks very much. ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Can't export to LaTeX/PDF.
Hi, Apologies if this has been addressed earlier. I can't seem to export to PDF/LaTeX. When I try to do so, I get the following error: Loading org-latex...done Exporting to LaTeX... Loading latexenc...done Loading tex-mode...done org-export-as-latex: Wrong type argument: integer-or-marker-p, nil The file is a simple one: == #+TITLE: Sunday schedule #+OPTIONS: toc:nil A few points: - The lab be closed on both Sundays of the Thanksgiving Break (before and after). Hence, I've not put any OH there. - Both of you will need to get the key to room. Obtain one. - This schedule assumes that there will be a session every week. Perhaps stuff like exams will get in the way. It will be updated as needed. = I'm using 6.29c, and Emacs 22.3.1. I know it worked with 6.27a... Here's a backtrace (apologies for the line wraps): Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) goto-char(nil) (if (re-search-forward ^\\*+ end t) (goto-char (match-beginning 0)) (goto-char end)) (let* ((pt ...) (end ...)) (prog1 (org-export-latex-content ...) (org-unmodified ...))) (save-excursion (goto-char (or beg ...)) (let* (... ...) (prog1 ... ...))) org-export-latex-first-lines((:latex-image-options width=10em :exclude-tags (noexport) :select-tags (export) :email mu...@nawaz.org :author :auto-postamble t :auto-preamble t :postamble nil :preamble nil :publishing-directory nil :timestamp nil :expand-quoted-html t :html-table-tag table border=\2\ cellspacing=\0\ cellpadding=\6\ rules=\groups\ frame=\hsides\ :xml-declaration ((html . ?xml version=\1.0\ encoding=\%s\?) (php . ?php echo \?xml version=\\\1.0\\\ encoding=\\\%s\\\ ?\; ?)) :html-extension html :inline-images maybe :convert-org-links t :agenda-style :style-extra :style :style-include-scripts t :style-include-default t :table-auto-headline t :tables t :time-stamp-file t ...) nil nil) (if skip (org-export-latex-first-lines opt-plist (if subtree-p ... rbeg) (if region-p rend))) (let* ((wcf ...) (opt-plist org-export-latex-options-plist) (region-p ...) (rbeg ...) (rend ...) (subtree-p ...) (opt-plist ...) (org-export-latex-options-plist opt-plist) (title ...) (filename ...) (filename ...) (buffer ...) (odd org-odd-levels-only) (header ...) (skip ...) (text ...) (org-export-preprocess-hook ...) (first-lines ...) (coding-system ...) (coding-system-for-write ...) (save-buffer-coding-system ...) (region ...) (string-for-export ...)) (set-buffer buffer) (erase-buffer) (org-install-letbind) (and (fboundp ...) (set-buffer-file-coding-system coding-system-for-write)) (unless (or ... body-only) (insert header)) (when (and text ...) (insert ... \n\n)) (unless skip (insert first-lines)) (org-export-latex-global (with-temp-buffer ... ... ...)) (unless body-only (insert \n\\end{document})) (goto-char (point-min)) (when (re-search-forward \\[TABLE-OF-CONTENTS\\] nil t) (goto-char ...) (while ... ...) (goto-char ...) (and ... ...)) (or to-buffer (save-buffer)) (goto-char (point-min)) (or (org-export-push-to-kill-ring LaTeX) (message Exporting to LaTeX...done)) (prog1 (if ... ... ...) (set-window-configuration wcf))) org-export-as-latex(nil nil nil nil nil nil) (let* ((wconfig ...) (lbuf ...) (file ...) (base ...) (pdffile ...) (cmds org-latex-to-pdf-process) (outbuf ...) (bibtex-p ...) cmd) (with-current-buffer outbuf (erase-buffer)) (and (file-exists-p pdffile) (delete-file pdffile)) (message Processing LaTeX file...) (if (and cmds ...) (funcall cmds file) (while cmds ... ... ... ...)) (message Processing LaTeX file...done) (if (not ...) (error PDF file was not produced) (set-window-configuration wconfig) (when org-export-pdf-remove-logfiles ...) (message Exporting to PDF...done) pdffile)) org-export-as-pdf(nil) call-interactively(org-export-as-pdf) (if (and bg (nth 2 ass) (not ...) (not ...)) (let (...) (set-process-sentinel p ...) (message Background process \%s\: started p)) (call-interactively (nth 1 ass))) (let* ((bg ...) (help [t] insert the export option template\n[v] limit export to visible part of outline tree\n\n[a] export as ASCII [A] to temporary buffer\n\n[h] export as HTML[H] to temporary buffer [R] export region\n[b] export as HTML and open in browser\n\n[l] export as LaTeX [L] to temporary buffer\n[p] export as LaTeX and process to PDF\n[d] export as LaTeX, process to PDF, and open the resulting PDF document\n\n[D] export as DocBook\n[V] export as DocBook, process to PDF, and open the resulting PDF document\n\n[x] export as XOXO\n[g] export using Wes Hardaker's generic exporter\n\n[i] export current file as iCalendar file\n[I] export all agenda files as iCalendar files\n[c] export agenda files into combined iCalendar file\n\n[F] publish current file [P] publish current project\n[X] publish a project... [E] publish every projects) (cmds ...) r1 r2 ass)
[Orgmode] Re: Can't export to LaTeX/PDF.
Mueen Nawaz mu...@nawaz.org writes: Hi, Apologies if this has been addressed earlier. I can't seem to export to PDF/LaTeX. When I try to do so, I get the following error: snip org-export-as-latex: Wrong type argument: integer-or-marker-p, nil I can confirm this. It seems the latest version requires at least one headline while 6.29a did not. -Bernt ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Can't export to LaTeX/PDF.
On 08/30/09 15:33, Bernt Hansen wrote: I can confirm this. It seems the latest version requires at least one headline while 6.29a did not. Yep - that solved it. Would that be a bug or a requirement? Mueen ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Useful utility function: org-sort-multi
Benjamin Andresen wrote: if you have the following list * Test Sorting ** TODO Charlie ** WAITING Beta ** TODO Alpha ** STARTED Beta ** STARTED Charlie ** TODO Beta ** STARTED Alpha ** WAITING Charlie ** WAITING Alpha calling org-multi-sort with ?o ?a will sort it like this * Test Sorting ** TODO Alpha ** TODO Beta ** TODO Charlie ** STARTED Alpha ** STARTED Beta ** STARTED Charlie ** WAITING Alpha ** WAITING Beta ** WAITING Charlie but just ?a would completely ignore the TODO, STARTED, WAITING order. Thanks Ryan, pretty useful. br, benny ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode That's right, the function relies on the fact that org's sorting is stable. So the results of earlier sorts are preserved as much as possible in later sorts. Of course, this is really inefficient, but oh well. As another test case, try using (org-sort-multi ?o ?p) on this: * Multi-sort test ** DONE [#B] ** TODO [#C] ** STARTED [#C] ** STARTED [#A] ** DONE [#C] ** TODO [#B] ** TODO [#A] ** STARTED [#B] ** DONE [#A] Anyway, Carsten, if you think this would be useful, feel free to include some variant of this in org-mode itself. You'd probably want to implement it as a one-pass sort in which the set of sorting criteria function as a series of fallbacks for tiebreakers, rather than a series of sorts. Ryan ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] export (as latex) a large number of org files in a directory
Hi Nick, thanks for the response! Actually in the code that I had pasted, the emacs --batch call is all on one line (so no need to escape newlines there). I tried your code with both orglib=/Applications/Emacs.app/Contents/Resources/lisp/org and orglib=$HOME/elisp/org-mode/lisp but got Cannot open load file: org-macs in both cases I also added a line, --eval (load \/Applications/Emacs.app/Contents/Resources/lisp/org/org.elc\) \ to replace the --load option but same deal. I do in fact have org-macs in my 'orglib' directories so I tried loading them explicitly (with multiple --load specifications), but it still doesn't work (Still Cannot open load file pointing to some org file or subst-ksc, depending on how many or in what order org .el files are loaded). Any more ideas? Thanks...! Stephen - Original Message From: Nick Dokos nicholas.do...@hp.com To: Stephen Tucker brown_...@yahoo.com Cc: emacs-orgmode@gnu.org; nicholas.do...@hp.com Sent: Sunday, August 30, 2009 8:04:06 AM Subject: Re: [Orgmode] export (as latex) a large number of org files in a directory Stephen Tucker brown_...@yahoo.com wrote: Hi, I am trying to export a bunch of .org files stored in a directory as latex files. I have tried two methods: (1) --- At the bash prompt (I am using OS X): bash$ emacs --batch --load=/Applications/Emacs.app/Contents/Resources/lisp/org/org.elc --visit=file.org --funcall org-export-as-latex-batch' and I get an error: Cannot open load file: subst-ksc If I can get this to work, then I can embed this system call in a shell script and call it iteratively on a list of .org files retrieved from, say, Python or Bash (changing 'file.org' appropriately each time). Did you escape the newlines? If you cut-n-pasted from the org-export-as-latex-batch help, you fell into the trap :-) Maybe the documentation of the function could be changed to add the backslashes? The following script (I call it org-to-latex) works fine on linux: --8---cut here---start-8--- #! /bin/bash orglib=$HOME/elisp/org-mode/lisp emacs --batch \ --load=$orglib/org.elc \ --eval (setq org-export-headline-levels 2) \ --visit=$1 --funcall org-export-as-latex-batch --8---cut here---end---8--- You can add a loop in it too - or do the loop by hand: --8---cut here---start-8--- for x in *.org do org-to-latex $x done --8---cut here---end---8--- HTH, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] export (as latex) a large number of org files in a directory
Stephen Tucker brown_...@yahoo.com wrote: Hi Nick, thanks for the response! Actually in the code that I had pasted, the emacs --batch call is all on one line (so no need to escape newlines there). I tried your code with both orglib=/Applications/Emacs.app/Contents/Resources/lisp/org and orglib=$HOME/elisp/org-mode/lisp You need the former - the latter is where I keep my org.el[c] but got Cannot open load file: org-macs in both cases I also added a line, --eval (load \/Applications/Emacs.app/Contents/Resources/lisp/org/org.elc\) \ to replace the --load option but same deal. I do in fact have org-macs in my 'orglib' directories so I tried loading them explicitly (with multiple --load specifications), but it still doesn't work (Still Cannot open load file pointing to some org file or subst-ksc, depending on how many or in what order org .el files are loaded). Any more ideas? The problem is probably that --batch implies -q, so .emacs is *not* loaded and you don't get your load-path customizations. Maybe something like this will work (the quoting gets hairy, so pay close attention to all the details): --8---cut here---start-8--- #! /bin/bash orglib=/Applications/Emacs.app/Contents/Resources/lisp/org emacs --batch \ --eval (add-to-list 'load-path \$orglib\) --load=$orglib/org.elc \ --eval (setq org-export-headline-levels 2) \ --visit=$1 --funcall org-export-as-latex-batch --8---cut here---end---8--- HTH, Nick ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Can't export to LaTeX/PDF.
Mueen Nawaz mu...@nawaz.org writes: On 08/30/09 15:33, Bernt Hansen wrote: I can confirm this. It seems the latest version requires at least one headline while 6.29a did not. Yep - that solved it. Would that be a bug or a requirement? Definitely a bug. I've just pushed a fix for this in the git repo. -- Bastien, from Tahiti ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] export (as latex) a large number of org files in a directory
Thanks yet again! That makes sense... works now!! I tried your code with both orglib=/Applications/Emacs.app/Contents/Resources/lisp/org and orglib=$HOME/elisp/org-mode/lisp You need the former - the latter is where I keep my org.el[c] (sorry, forgot to mention that I created and copied my files to the latter directory to try it out) #! /bin/bash orglib=/Applications/Emacs.app/Contents/Resources/lisp/org emacs --batch \ --eval (add-to-list 'load-path \$orglib\) \ # need a backslash here. --load=$orglib/org.elc \ --eval (setq org-export-headline-levels 2) \ --visit=$1 --funcall org-export-as-latex-batch (yes, caught that!) Thanks again very much, Nick - this had been on my mind for a while. Stephen ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode