* Failure exporting with emacs --batch
@ 2011-11-15 16:32 Tom Prince
2011-11-15 20:09 ` Herbert Sitz
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Tom Prince @ 2011-11-15 16:32 UTC (permalink / raw
To: Org Mode List
With b43c1c621f52f4a51d8d79cb76c226dfed003998 running
emacs --no-init-file --load min.el --eval '(setq debug-on-error t)' --eval '(find-file "test.org")' -eval '(org-export-as-html 3)' --batch
with
------ min.el
(setq org-babel-load-languages '((emacs-lisp . t) (latex . t)))
(setq org-confirm-babel-evaluate nil)
(setq org-export-latex-packages-alist
`(("" "diagrams" t)))
(require 'org-install)
(require 'org)
------
and
------ test.org
#+TITLE: Notes for Higher Category Theory
#+MATHJAX: mathml:t
#+BABEL :exports results
* Notes for 2011-09-16
#+begin_src latex :file diag1.png
\begin{diagram}
Y\times \{0\} & \rTo & E \\
\dTo & \ruDotsto & \dTo \\
Y\times I & \rTo & B
\end{diagram}
#+end_src
------
gives me
------ output
OVERVIEW
Loading vc-git...
Exporting...
Position saved to mark ring, go back with C-c &.
executing Latex code block...
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p unspecified)
org-create-formula-image("\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{diagram}" "diag1.png" (:foreground default :background default :scale 1.0 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) t)
org-babel-execute:latex("\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{diagram}" ((:colname-names) (:rowname-names) (:result-params "replace" "file" "latex" "file" "replace" "latex") (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "results") (:results . "replace file latex") (:session . "none") (:rowname-names) (:result-type . value) (:result-params "file" "replace" "latex") (:padnewline . "yes") (:hlines . "no") (:file . "diag1.png") (:colname-names)))
org-babel-execute-src-block(nil ("latex" "\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{diagram}" ((:colname-names) (:rowname-names) (:result-params "replace" "file" "latex" "file" "replace" "latex") (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "results") (:results . "replace file latex") (:session . "none") (:rowname-names) (:result-type . value) (:result-params "file" "replace" "latex") (:padnewline . "yes") (:hlines . "no") (:file . "diag1.png") (:colname-names)) "" nil 0))
org-babel-exp-results(("latex" "\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{diagram}" ((:colname-names) (:rowname-names) (:result-params "replace" "file" "latex" "file" "replace" "latex") (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "results") (:results . "replace file latex") (:session . "none") (:rowname-names) (:result-type . value) (:result-params "file" "replace" "latex") (:padnewline . "yes") (:hlines . "no") (:file . "diag1.png") (:colname-names)) "" nil 0) block nil "e690bc66b5d1181e2751abbc36dc7def2f54c72a")
org-babel-exp-do-export(("latex" "\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{diagram}" ((:colname-names) (:rowname-names) (:result-params "replace" "file" "latex" "file" "replace" "latex") (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "results") (:results . "replace file latex") (:session . "none") (:rowname-names) (:result-type . value) (:result-params "file" "replace" "latex") (:padnewline . "yes") (:hlines . "no") (:file . "diag1.png") (:colname-names)) "" nil 0) block "e690bc66b5d1181e2751abbc36dc7def2f54c72a")
org-babel-exp-src-block("\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{diagram}" "latex" ":file" "diag1.png")
apply(org-babel-exp-src-block "\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{diagram}" ("latex" ":file" "diag1.png"))
byte-code("\306\307\211\211\211\211\211\211\211\211\211\211\x18\x19\x1a^[\x1c\x1d\x1e+\x1e,\x1e-\x1e.\x1e/\x1e0\310\311!\211\x1e1\205)\0\311K\x1e2\312\216\311\313M\210eb\210`\x15\314\x1e3\315\x0e3\307\306#\203X\x01\316\317\224!\x1e4\316\317\225!\x1e5\320\321!G\x1e-\322\323\324\320\325!\227!\"\x1e6\326\320\325!\227!\x1e,\327 \x1e7\330\216\331\320\332!\333\"*\x1a\321\x1e8\x0e9\206\200\0\334\n\235\x19\307\x1e:\335\x0e8!\204\255\0\315\x0e6\307\306#\203\255\0\320\321!\227\336\230\203\245\0\x0e8S\x168\202\204\0\x0e8T\x168\202\204\0\335\x0e8!\204\276\0\337\340\x0e,\x0e4`{#\210\316\317\225!\x16: \204\327\0\327 \x1e7\341\216\342\x0e5\317\224{!*\x13\x0e,\x0e/>\204\346\0\x0e,\x0e/B\x16/\327 \x1e7\343\216\311\r\x0e4\"\210*\344\x0e,\x0e;\"\211\x1e<A@)\211\x16+\203?\x01\327 \x1e7\345\216\x0e,\x0e=>\203\x17\x01\346\202\x1d\x01\347\x0e+\v\n#*\211\x1e>\203>\x01\x0e4\x0e:|\210\x0e4b\210\x0e>c\210 \204>\x01\350\x0e4`\x0e-#\210)\x0e4\307\211\223\210\x0e5\307\211\223\210\x0e:\307\211\223\210. `\x15\2029\0)\311\rd\"\210\351\352!.\x0f\207" [progress-marker preserve-indent headers body end start t nil fboundp interblock ((byte-code "\b\203\v\0\302 M\210\202\x0f\0\303\302!\210\302\207" [--cl-letf-bound-- --cl-letf-save-- interblock fmakunbound] 2)) #[(start end) "\301\302\b\"\207" [org-export-interblocks mapcar #[... "\b\211\x19A@)\n\v\"\207" [pair x start end] 4]] 3] "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\r\n]" re-search-forward copy-marker 0 match-string 1 format "[\r\n][ ]*#\\+\\(begin\\|end\\)_%s" regexp-quote 2 intern match-data ((byte-code "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-split-string 3 "[ ]+" "-i" zerop "end" error "unbalanced begin/end_%s blocks with %S" ((byte-code "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-remove-indentation ((byte-code "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) assoc ((byte-code "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) "" apply indent-code-rigidly run-hooks org-export-blocks-postblock-hook func type indentation matched types case-fold-search --cl-letf-bound-- ...] 13)
org-export-blocks-preprocess()
org-export-preprocess-string("#+TITLE: Notes for Higher Category Theory\n#+MATHJAX: mathml:t\n#+BABEL :exports results\n\n* Notes for 2011-09-16\n#+begin_src latex :file diag1.png\n\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{diagram}\n#+end_src\n\n" :emph-multiline t :for-backend html :skip-before-1st-heading nil :drawers nil :todo-keywords t :tasks t :tags not-in-toc :priority nil :footnotes t :timestamps t :archived-trees headline :select-tags ("export") :exclude-tags ("noexport") :add-text nil :LaTeX-fragments t)
org-export-as-html(3)
eval((org-export-as-html 3))
command-line-1(("--load" "min.el" "--eval" "(setq debug-on-error t)" "--eval" "(find-file \"test.org\")" "-eval" "(org-export-as-html 3)"))
command-line()
normal-top-level()
-------
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Failure exporting with emacs --batch
2011-11-15 16:32 Failure exporting with emacs --batch Tom Prince
@ 2011-11-15 20:09 ` Herbert Sitz
2011-11-15 20:18 ` Herbert Sitz
2011-11-15 20:21 ` Eric Schulte
2011-11-15 20:30 ` Nick Dokos
2 siblings, 1 reply; 10+ messages in thread
From: Herbert Sitz @ 2011-11-15 20:09 UTC (permalink / raw
To: emacs-orgmode
Tom Prince <tom.prince <at> ualberta.net> writes:
> With b43c1c621f52f4a51d8d79cb76c226dfed003998 running
>
> emacs --no-init-file --load min.el --eval '(setq debug-on-error t)' --eval
'(find-file "test.org")'
> -eval '(org-export-as-html 3)' --batch
>
Not sure, but I do something similar with a single --eval:
--eval '(progn (find-file "filename") (org-export-as-html-and-open 3) )'
-- Herb
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Failure exporting with emacs --batch
2011-11-15 20:09 ` Herbert Sitz
@ 2011-11-15 20:18 ` Herbert Sitz
2011-11-15 20:51 ` Nick Dokos
0 siblings, 1 reply; 10+ messages in thread
From: Herbert Sitz @ 2011-11-15 20:18 UTC (permalink / raw
To: emacs-orgmode
Herbert Sitz <hesitz <at> gmail.com> writes:
>
> Not sure, but I do something similar with a single --eval:
>
> --eval '(progn (find-file "filename") (org-export-as-html-and-open 3) )'
>
Except my version has double quotes for --eval argument and backslashes before
embedded quotes:
--eval "(progn (find-file \"filename\") (org-export-as-html-and-open 3) )"
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Failure exporting with emacs --batch
2011-11-15 16:32 Failure exporting with emacs --batch Tom Prince
2011-11-15 20:09 ` Herbert Sitz
@ 2011-11-15 20:21 ` Eric Schulte
2011-11-15 20:30 ` Nick Dokos
2 siblings, 0 replies; 10+ messages in thread
From: Eric Schulte @ 2011-11-15 20:21 UTC (permalink / raw
To: Tom Prince; +Cc: Org Mode List
Tom Prince <tom.prince@ualberta.net> writes:
> With b43c1c621f52f4a51d8d79cb76c226dfed003998 running
>
> emacs --no-init-file --load min.el --eval '(setq debug-on-error t)' --eval '(find-file "test.org")' -eval '(org-export-as-html 3)' --batch
>
> with
>
> ------ min.el
> (setq org-babel-load-languages '((emacs-lisp . t) (latex . t)))
> (setq org-confirm-babel-evaluate nil)
> (setq org-export-latex-packages-alist
> `(("" "diagrams" t)))
>
> (require 'org-install)
> (require 'org)
> ------
> and
> ------ test.org
> #+TITLE: Notes for Higher Category Theory
> #+MATHJAX: mathml:t
> #+BABEL :exports results
>
One item to note is that the #+BABEL: syntax is now deprecated, try
replacing the above line with the following.
#+PROPERTY: exports results
Best -- Eric
--
Eric Schulte
http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Failure exporting with emacs --batch
2011-11-15 16:32 Failure exporting with emacs --batch Tom Prince
2011-11-15 20:09 ` Herbert Sitz
2011-11-15 20:21 ` Eric Schulte
@ 2011-11-15 20:30 ` Nick Dokos
2011-11-16 0:36 ` Tom Prince
2 siblings, 1 reply; 10+ messages in thread
From: Nick Dokos @ 2011-11-15 20:30 UTC (permalink / raw
To: Tom Prince; +Cc: nicholas.dokos, Org Mode List
Tom Prince <tom.prince@ualberta.net> wrote:
> With b43c1c621f52f4a51d8d79cb76c226dfed003998 running
>
Please use C-u M-x org-version to insert version information in your
mail. It's not possible to see from the SHA1 whether it is a recent
version or an old version without doing git archaelogy.
> emacs --no-init-file --load min.el --eval '(setq debug-on-error t)' --eval=
> '(find-file "test.org")' -eval '(org-export-as-html 3)' --batch
>
> with
>
> ------ min.el
> (setq org-babel-load-languages '((emacs-lisp . t) (latex . t)))
> (setq org-confirm-babel-evaluate nil)
> (setq org-export-latex-packages-alist
> `(("" "diagrams" t)))
>
> (require 'org-install)
> (require 'org)
> ------
> and
> ------ test.org
> #+TITLE: Notes for Higher Category Theory
> #+MATHJAX: mathml:t
> #+BABEL :exports results
>
> * Notes for 2011-09-16
> #+begin_src latex :file diag1.png
> \begin{diagram}
> Y\times \{0\} & \rTo & E \\
> \dTo & \ruDotsto & \dTo \\
> Y\times I & \rTo & B
> \end{diagram}
> #+end_src
> ------
>
A couple of problems:
o #+BABEL is obsolete since release_7.7-405-g04a978f - use
#+PROPERTY: exports results
in its place with latest - I'm not sure what was current at
your release (release_7.7.541.gb43c)
o how do you set up the diagram environment? it's not there by default,
so you probably have done some configuration of your environment.
After struggling with it for a while, I can't get it to work to my
satisfaction, but in any case, I cannot reproduce the error, with or
without #+MATHJAX and with versions
Org-mode version 7.7 (release_7.7.563.gf8d8)
and
Org-mode version 7.7 (release_7.7.541.gb43c):
,----
| $ emacs --no-init-file --load ~/minimal.emacs.org --eval '(setq debug-on-error t)' --eval '(find-file "tom-prince.org")' -eval '(org-export-as-html 3)' --batch
| OVERVIEW
| Loading vc-git...
| Exporting...
| Exporting...
| Saving file /home/nick/src/emacs/org/Worg/tom-prince.html...
| Wrote /home/nick/src/emacs/org/Worg/tom-prince.html
| HTML export done, pushed to kill ring and clipboard
`----
Nick
PS As Herbert Sitz points out, you can combine all the evals, but I
don't think the multiple evals cause the problem.
> ------ output
> OVERVIEW
> Loading vc-git...
> Exporting...
> Position saved to mark ring, go back with C-c &.
> executing Latex code block...
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p unspe=
> cified)
> org-create-formula-image("\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & =
> E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{=
> diagram}" "diag1.png" (:foreground default :background default :scale 1.0 :=
> html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :mat=
> chers ("begin" "$1" "$" "$$" "\\(" "\\[")) t)
> org-babel-execute:latex("\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E=
> \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{d=
> iagram}" ((:colname-names) (:rowname-names) (:result-params "replace" "file=
> " "latex" "file" "replace" "latex") (:result-type . value) (:comments . "")=
> (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle .=
> "no") (:exports . "results") (:results . "replace file latex") (:session .=
> "none") (:rowname-names) (:result-type . value) (:result-params "file" "re=
> place" "latex") (:padnewline . "yes") (:hlines . "no") (:file . "diag1.png"=
> ) (:colname-names)))
> org-babel-execute-src-block(nil ("latex" "\\begin{diagram}\n Y\\times \\=
> {0\\} & \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \=
> \rTo & B\n\\end{diagram}" ((:colname-names) (:rowname-names) (:result-param=
> s "replace" "file" "latex" "file" "replace" "latex") (:result-type . value)=
> (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb .=
> "no") (:tangle . "no") (:exports . "results") (:results . "replace file la=
> tex") (:session . "none") (:rowname-names) (:result-type . value) (:result-=
> params "file" "replace" "latex") (:padnewline . "yes") (:hlines . "no") (:f=
> ile . "diag1.png") (:colname-names)) "" nil 0))
> org-babel-exp-results(("latex" "\\begin{diagram}\n Y\\times \\{0\\} & \\=
> rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n=
> \\end{diagram}" ((:colname-names) (:rowname-names) (:result-params "replace=
> " "file" "latex" "file" "replace" "latex") (:result-type . value) (:comment=
> s . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:t=
> angle . "no") (:exports . "results") (:results . "replace file latex") (:se=
> ssion . "none") (:rowname-names) (:result-type . value) (:result-params "fi=
> le" "replace" "latex") (:padnewline . "yes") (:hlines . "no") (:file . "dia=
> g1.png") (:colname-names)) "" nil 0) block nil "e690bc66b5d1181e2751abbc36d=
> c7def2f54c72a")
> org-babel-exp-do-export(("latex" "\\begin{diagram}\n Y\\times \\{0\\} & =
> \\rTo & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B=
> \n\\end{diagram}" ((:colname-names) (:rowname-names) (:result-params "repla=
> ce" "file" "latex" "file" "replace" "latex") (:result-type . value) (:comme=
> nts . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (=
> :tangle . "no") (:exports . "results") (:results . "replace file latex") (:=
> session . "none") (:rowname-names) (:result-type . value) (:result-params "=
> file" "replace" "latex") (:padnewline . "yes") (:hlines . "no") (:file . "d=
> iag1.png") (:colname-names)) "" nil 0) block "e690bc66b5d1181e2751abbc36dc7=
> def2f54c72a")
> org-babel-exp-src-block("\\begin{diagram}\n Y\\times \\{0\\} & \\rTo & E=
> \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\\end{d=
> iagram}" "latex" ":file" "diag1.png")
> apply(org-babel-exp-src-block "\\begin{diagram}\n Y\\times \\{0\\} & \\r=
> To & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\=
> \end{diagram}" ("latex" ":file" "diag1.png"))
> byte-code("\306\307\211\211\211\211\211\211\211\211\211\211=18=19=1A=1B=
> =1C=1D=1E+=1E,=1E-=1E.=1E/=1E0\310\311!\211=1E1\205)=00\311K=1E2\312\216\31=
> 1\313M\210eb\210`=15\314=1E3\315=0E3\307\306#\203X=01\316\317\224!=1E4\316\=
> 317\225!=1E5\320\321!G=1E-\322\323\324\320\325!\227!\"=1E6\326\320\325!\227=
> !=1E,\327 =1E7\330\216\331\320\332!\333\"*=1A\321=1E8=0E9\206\200=00\334\n\=
> 235=19\307=1E:\335=0E8!\204\255=00\315=0E6\307\306#\203\255=00\320\321!\227=
> \336\230\203\245=00=0E8S=168\202\204=00=0E8T=168\202\204=00\335=0E8!\204\27=
> 6=00\337\340=0E,=0E4`{#\210\316\317\225!=16: \204\327=00\327 =1E7\341\216\3=
> 42=0E5\317\224{!*=13=0E,=0E/>\204\346=00=0E,=0E/B=16/\327 =1E7\343\216\311=
> =0D=0E4\"\210*\344=0E,=0E;\"\211=1E<A@)\211=16+\203?=01\327 =1E7\345\216=0E=
> ,=0E=3D>\203=17=01\346\202=1D=01\347=0E+=0B\n#*\211=1E>\203>=01=0E4=0E:|\21=
> 0=0E4b\210=0E>c\210 \204>=01\350=0E4`=0E-#\210)=0E4\307\211\223\210=0E5\307=
> \211\223\210=0E:\307\211\223\210. `=15\2029=00)\311=0Dd\"\210\351\352!.=0F\=
> 207" [progress-marker preserve-indent headers body end start t nil fboundp =
> interblock ((byte-code "\b\203=0B=00\302 M\210\202=0F=00\303\302!\210\302\20=
> 7" [--cl-letf-bound-- --cl-letf-save-- interblock fmakunbound] 2)) #[(start=
> end) "\301\302\b\"\207" [org-export-interblocks mapcar #[... "\b\211=19A@)\n=
> =0B\"\207" [pair x start end] 4]] 3] "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]=
> *\\(.*\\)?[=0D\n]" re-search-forward copy-marker 0 match-string 1 format "[=
> =0D\n][ ]*#\\+\\(begin\\|end\\)_%s" regexp-quote 2 intern match-data ((byt=
> e-code "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate=
> ] 3)) org-split-string 3 "[ ]+" "-i" zerop "end" error "unbalanced begin/e=
> nd_%s blocks with %S" ((byte-code "\301\b\302\"\207" [save-match-data-intern=
> al set-match-data evaporate] 3)) org-remove-indentation ((byte-code "\301\b\=
> 302\"\207" [save-match-data-internal set-match-data evaporate] 3)) assoc ((=
> byte-code "\301\b\302\"\207" [save-match-data-internal set-match-data evapor=
> ate] 3)) "" apply indent-code-rigidly run-hooks org-export-blocks-postblock=
> -hook func type indentation matched types case-fold-search --cl-letf-bound-=
> - ...] 13)
> org-export-blocks-preprocess()
> org-export-preprocess-string("#+TITLE: Notes for Higher Category Theory\n=
> #+MATHJAX: mathml:t\n#+BABEL :exports results\n\n* Notes for 2011-09-16\n#+=
> begin_src latex :file diag1.png\n\\begin{diagram}\n Y\\times \\{0\\} & \\r=
> To & E \\\\\n \\dTo & \\ruDotsto & \\dTo \\\\\n Y\\times I & \\rTo & B\n\=
> \end{diagram}\n#+end_src\n\n" :emph-multiline t :for-backend html :skip-bef=
> ore-1st-heading nil :drawers nil :todo-keywords t :tasks t :tags not-in-toc=
> :priority nil :footnotes t :timestamps t :archived-trees headline :select-=
> tags ("export") :exclude-tags ("noexport") :add-text nil :LaTeX-fragments t)
> org-export-as-html(3)
> eval((org-export-as-html 3))
> command-line-1(("--load" "min.el" "--eval" "(setq debug-on-error t)" "--e=
> val" "(find-file \"test.org\")" "-eval" "(org-export-as-html 3)"))
> command-line()
> normal-top-level()
> -------
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Failure exporting with emacs --batch
2011-11-15 20:18 ` Herbert Sitz
@ 2011-11-15 20:51 ` Nick Dokos
2011-11-15 21:09 ` Herbert Sitz
0 siblings, 1 reply; 10+ messages in thread
From: Nick Dokos @ 2011-11-15 20:51 UTC (permalink / raw
To: Herbert Sitz; +Cc: nicholas.dokos, emacs-orgmode
Herbert Sitz <hesitz@gmail.com> wrote:
> Herbert Sitz <hesitz <at> gmail.com> writes:
> >
> > Not sure, but I do something similar with a single --eval:
> >
> > --eval '(progn (find-file "filename") (org-export-as-html-and-open 3) )'
> >
>
> Except my version has double quotes for --eval argument and backslashes before
> embedded quotes:
>
> --eval "(progn (find-file \"filename\") (org-export-as-html-and-open 3) )"
>
>
That doesn't matter here: both of the above should work fine in a bash
(or similar) shell environment. I prefer the single quote style in
general, since it allows me to leave everything else unchanged[fn:1].
But shell quoting is a minefield: when you have to quote *parts* of an
expression and leave other parts unquoted so that the shell can get to
them (e.g. to evaluate shell variables and `...` or $(...) constructs),
life starts to get difficult - and that's just the beginning[fn:2].
Nick
Footnotes:
[fn:1] ...unless there is a single quote in there. If I'm quoting lisp code
that has a single quote, I generally write (quote foo) instead of 'foo,
in order to avoid the quote mess. And often I'll just add a function
to my minimal .emacs, so I can just write
... --eval '(foo)' ...
on the command line: when writing foo, I don't have to worry about
shell quoting rules.
[fn:2] Kernighan and Pike, in their "The Unix Programming Environment",
have an example on p. 128 where they remark: "The remarkable
sequence of quote characters is required to capture the date in a
string in the middle of the awk program." Worth taking a look if
you have the book available nearby.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Failure exporting with emacs --batch
2011-11-15 20:51 ` Nick Dokos
@ 2011-11-15 21:09 ` Herbert Sitz
2011-11-15 21:48 ` Nick Dokos
0 siblings, 1 reply; 10+ messages in thread
From: Herbert Sitz @ 2011-11-15 21:09 UTC (permalink / raw
To: emacs-orgmode
Nick Dokos <nicholas.dokos <at> hp.com> writes:
>
> That doesn't matter here: both of the above should work fine in a bash
> (or similar) shell environment. I prefer the single quote style in
> general, since it allows me to leave everything else unchanged[fn:1].
>
> But shell quoting is a minefield: when you have to quote *parts* of an
> expression and leave other parts unquoted so that the shell can get to
> them (e.g. to evaluate shell variables and `...` or $(...) constructs),
> life starts to get difficult - and that's just the beginning[fn:2].
>
Nick -- Thanks for clarifying, I didn't read Tom's post closely enough or I
would have seen that the export was indeed getting called.
I've been working with getting the batch quoting working both for bash and for
windows command line (in VimOrganizer clone), trying to keep them as much alike
as possible. I think I have things working okay for now, but your tips may be
helpful if I end up with something more complex to send.
Regards,
Herb
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Failure exporting with emacs --batch
2011-11-15 21:09 ` Herbert Sitz
@ 2011-11-15 21:48 ` Nick Dokos
0 siblings, 0 replies; 10+ messages in thread
From: Nick Dokos @ 2011-11-15 21:48 UTC (permalink / raw
To: Herbert Sitz; +Cc: nicholas.dokos, emacs-orgmode
Herbert Sitz <hesitz@gmail.com> wrote:
> I've been working with getting the batch quoting working both for bash and for
> windows command line (in VimOrganizer clone), trying to keep them as much alike
> as possible. I think I have things working okay for now, but your tips may be
> helpful if I end up with something more complex to send.
>
Yes, I realize that you have that extra burden, hence my bash-or-similar
qualification. One can go mad with the bash-or-similar quoting rules
alone: having to deal with the command line interpreter on Windoze as
well more or less guarantees it :-)
Nick
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Failure exporting with emacs --batch
2011-11-15 20:30 ` Nick Dokos
@ 2011-11-16 0:36 ` Tom Prince
2011-11-16 3:33 ` Nick Dokos
0 siblings, 1 reply; 10+ messages in thread
From: Tom Prince @ 2011-11-16 0:36 UTC (permalink / raw
To: nicholas.dokos; +Cc: Org Mode List
On Tue, 15 Nov 2011 15:30:25 -0500, Nick Dokos <nicholas.dokos@hp.com> wrote:
> Tom Prince <tom.prince@ualberta.net> wrote:
>
> > With b43c1c621f52f4a51d8d79cb76c226dfed003998 running
> >
>
> Please use C-u M-x org-version to insert version information in your
> mail. It's not possible to see from the SHA1 whether it is a recent
> version or an old version without doing git archaelogy.
org-version doesn't display a sha1 hash, when run from an installed copy
of a git version.
Further simplified: (this time with a git clone)
emacs --no-site-file --no-init-file --load min.el --eval '(setq debug-on-error t)' --eval '(find-file "test.org")' --eval '(org-version)' -eval '(org-export-as-html 3)' --batch
------ min.el
(setq org-babel-load-languages '((emacs-lisp . t) (latex . t)))
(setq org-confirm-babel-evaluate nil)
(add-to-list 'load-path (expand-file-name "~/src/org-mode/lisp"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\ |org_archive\\|txt\\)$" . org-mode))
(require 'org-install)
------
------ test.org
* Notes for 2011-09-16
#+begin_src latex :file diag1.png
some latex source
#+end_src
------
------ output
OVERVIEW
Loading vc-git...
Org-mode version 7.7 (release_7.7.541.gb43c)
Exporting...
executing Latex code block...
...
(let* ((info ...) (lang ...) (raw-params ...) hash) (when info (when ... ... ...) (setf ... ...) (org-babel-exp-do-export info ... hash)))
(save-excursion (goto-char (match-beginning 0)) (let* (... ... ... hash) (when info ... ... ...)))
org-babel-exp-src-block("some latex source" "latex" ":file" "diag1.png")
apply(org-babel-exp-src-block "some latex source" ("latex" ":file" "diag1.png"))
(if (memq type org-export-blocks-witheld) "" (apply func body headers))
(progn (if (memq type org-export-blocks-witheld) "" (apply func body headers)))
(unwind-protect (progn (if ... "" ...)) (set-match-data save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-data-internal ...)))
(save-match-data (if (memq type org-export-blocks-witheld) "" (apply func body headers)))
(let ((replacement ...)) (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) (unless preserve-indent ...)))
(progn (let (...) (when replacement ... ... ... ...)))
(if (setq func (cadr ...)) (progn (let ... ...)))
(when (setq func (cadr ...)) (let (...) (when replacement ... ... ... ...)))
(let* ((match-start ...) (body-start ...) (indentation ...) (inner-re ...) (type ...) (headers ...) (balanced 1) (preserve-indent ...) match-end) (while (and ... ...) (if ... ... ...)) (when (not ...) (error "unbalanced begin/end_%s blocks with %S" type ...)) (setq match-end (copy-marker ...)) (unless preserve-indent (setq body ...)) (unless (memq type types) (setq types ...)) (save-match-data (interblock start match-start)) (when (setq func ...) (let ... ...)) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil))
(while (re-search-forward beg-re nil t) (let* (... ... ... ... ... ... ... ... match-end) (while ... ...) (when ... ...) (setq match-end ...) (unless preserve-indent ...) (unless ... ...) (save-match-data ...) (when ... ...) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))
(let ((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\r\n]")) (while (re-search-forward beg-re nil t) (let* ... ... ... ... ... ... ... ... ... ... ...) (setq start ...)))
(progn (fset (quote interblock) (function* ...)) (goto-char (point-min)) (setq start (point)) (let (...) (while ... ... ...)) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
(unwind-protect (progn (fset ... ...) (goto-char ...) (setq start ...) (let ... ...) (interblock start ...) (run-hooks ...)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...)))
(let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ... ... ... ... ...) (if --cl-letf-bound-- ... ...)))
(letf ((... ...)) (goto-char (point-min)) (setq start (point)) (let (...) (while ... ... ...)) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
(letf* ((... ...)) (goto-char (point-min)) (setq start (point)) (let (...) (while ... ... ...)) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
(flet ((interblock ... ...)) (goto-char (point-min)) (setq start (point)) (let (...) (while ... ... ...)) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
(let ((case-fold-search t) (types ...) matched indentation type func start end body headers preserve-indent progress-marker) (flet (...) (goto-char ...) (setq start ...) (let ... ...) (interblock start ...) (run-hooks ...)))
(save-window-excursion (let (... ... matched indentation type func start end body headers preserve-indent progress-marker) (flet ... ... ... ... ... ...)))
org-export-blocks-preprocess()
(progn (erase-buffer) (insert string) (setq case-fold-search t) (let (...) (remove-text-properties ... ... ...)) (org-export-kill-licensed-text) (let (...) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char ...) (when ... ... ... ...)) (when (plist-get parameters :add-text) (goto-char ...) (insert ... "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...)
(unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ... ...) (org-export-kill-licensed-text) (let ... ...) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks ...) (untabify ... ...) (org-export-handle-include-files-recurse) (run-hooks ...) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags ... ...) (run-hooks ...) (org-export-remove-tasks ...) (when ... ...) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks ...) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist ...) (run-hooks ...) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers ...) (when ... ... ...) (when ... ... ...) (org-export-remove-headline-metadata parameters) (setq target-alist ...) (run-hooks ...) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks ...) (unless ... ...) (setq target-alist ...) (org-export-mark-radio-links) (run-hooks ...) (org-export-concatenate-multiline-links) (run-hooks ...) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (and ... ...)))
(with-current-buffer temp-buffer (unwind-protect (progn ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (and ... ...)))
(let ((temp-buffer ...)) (with-current-buffer temp-buffer (unwind-protect ... ...)))
(with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let (...) (remove-text-properties ... ... ...)) (org-export-kill-licensed-text) (let (...) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char ...) (when ... ... ... ...)) (when (plist-get parameters :add-text) (goto-char ...) (insert ... "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...)
(let* ((org-export-current-backend ...) (archived-trees ...) (inhibit-read-only t) (drawers org-drawers) (source-buffer ...) target-alist rtn) (setq org-export-target-aliases nil org-export-preferred-target-alist nil org-export-id-target-alist nil org-export-code-refs nil) (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let ... ...) (org-export-kill-licensed-text) (let ... ...) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks ...) (untabify ... ...) (org-export-handle-include-files-recurse) (run-hooks ...) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags ... ...) (run-hooks ...) (org-export-remove-tasks ...) (when ... ...) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks ...) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist ...) (run-hooks ...) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers ...) (when ... ... ...) (when ... ... ...) (org-export-remove-headline-metadata parameters) (setq target-alist ...) (run-hooks ...) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks ...) (unless ... ...) (setq target-alist ...) (org-export-mark-radio-links) (run-hooks ...) (org-export-concatenate-multiline-links) (run-hooks ...) (org-export-normalize-links) ...) rtn)
org-export-preprocess-string("* Notes for 2011-09-16\n#+begin_src latex :file diag1.png\n some latex source\n#+end_src\n\n" :emph-multiline t :for-backend html :skip-before-1st-heading nil :drawers nil :todo-keywords t :tasks t :tags not-in-toc :priority nil :footnotes t :timestamps t :archived-trees headline :select-tags ("export") :exclude-tags ("noexport") :add-text nil :LaTeX-fragments t)
(org-split-string (org-export-preprocess-string region :emph-multiline t :for-backend (quote html) :skip-before-1st-heading (plist-get opt-plist :skip-before-1st-heading) :drawers (plist-get opt-plist :drawers) :todo-keywords (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-get opt-plist :footnotes) :timestamps (plist-get opt-plist :timestamps) :archived-trees (plist-get opt-plist :archived-trees) :select-tags (plist-get opt-plist :select-tags) :exclude-tags (plist-get opt-plist :exclude-tags) :add-text (plist-get opt-plist :text) :LaTeX-fragments (plist-get opt-plist :LaTeX-fragments)) "[\r\n]")
(let* ((opt-plist ...) (body-only ...) (style ...) (html-extension ...) valid thetoc have-headings first-heading-pos (odd org-odd-levels-only) (region-p ...) (rbeg ...) (rend ...) (subtree-p ...) (level-offset ...) (opt-plist ...) (org-current-export-dir ...) (org-current-export-file buffer-file-name) (level 0) (line "") (origline "") txt todo (umax nil) (umax-toc nil) (filename ...) (current-dir ...) (auto-insert nil) (buffer ...) (org-levels-open ...) (date ...) (author ...) (html-validation-link ...) (title ...) (link-up ...) (link-home ...) (dummy ...) (html-table-tag ...) (quote-re0 ...) (quote-re ...) (inquote nil) (infixed nil) (inverse nil) (email ...) (language ...) (keywords ...) (description ...) (num ...) (lang-words nil) (head-count 0) cnt ...) (let (...) (org-unmodified ...)) (message "Exporting...") (setq org-min-level (org-get-min-level lines level-offset)) (setq org-last-level org-min-level) (org-init-section-numbers) (cond (... ...) (date) (t ...)) (setq lang-words (or ... ...)) (set-buffer buffer) (let (...) (erase-buffer)) (fundamental-mode) (org-install-letbind) (and (fboundp ...) (set-buffer-file-coding-system coding-system-for-write)) (let (... ...) (mapc ... org-export-plist-vars) (setq umax ...) (setq umax-toc ...) (unless body-only ... ... ...) (if ... ...) (setq head-count 0) (org-init-section-numbers) (org-open-par) (while ... ...) (when inquote ... ...) (org-html-level-start 1 nil umax ... head-count opt-plist) (when ... ...) (save-excursion ... ...) (when footnotes ...) (let ... ...) (unless body-only ... ...) (if org-export-html-with-timestamp ...) (unless body-only ...) (unless ... ... ...) (goto-char ...) (when thetoc ... ... ...) (goto-char ...) (while ... ...) (goto-char ...) (goto-char ...) (let ... ...) (goto-char ...) (when ... ...) (remove-text-properties ... ... ...) (run-hooks ...) (or to-buffer ...) (goto-char ...) (or ... ...) (if ... ... ...)))
org-export-as-html(3)
eval((org-export-as-html 3))
command-line-1(("--load" "min.el" "--eval" "(setq debug-on-error t)" "--eval" "(find-file \"test.org\")" "--eval" "(org-version)" "-eval" "(org-export-as-html 3)"))
command-line()
normal-top-level()
------
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Failure exporting with emacs --batch
2011-11-16 0:36 ` Tom Prince
@ 2011-11-16 3:33 ` Nick Dokos
0 siblings, 0 replies; 10+ messages in thread
From: Nick Dokos @ 2011-11-16 3:33 UTC (permalink / raw
To: Tom Prince; +Cc: nicholas.dokos, Org Mode List
Tom Prince <tom.prince@ualberta.net> wrote:
> On Tue, 15 Nov 2011 15:30:25 -0500, Nick Dokos <nicholas.dokos@hp.com> wrot=
> e:
> > Tom Prince <tom.prince@ualberta.net> wrote:
> >=20
> > > With b43c1c621f52f4a51d8d79cb76c226dfed003998 running
> > >=20
> >=20
> > Please use C-u M-x org-version to insert version information in your
> > mail. It's not possible to see from the SHA1 whether it is a recent
> > version or an old version without doing git archaelogy.
>
> org-version doesn't display a sha1 hash, when run from an installed copy
> of a git version.
>
OK. ``git describe'' in your git tree will do the equivalent.
> Further simplified: (this time with a git clone)
>
> emacs --no-site-file --no-init-file --load min.el --eval '(setq debug-on-er=
> ror t)' --eval '(find-file "test.org")' --eval '(org-version)' -eval '(org-=
> export-as-html 3)' --batch
>
> ------ min.el
> (setq org-babel-load-languages '((emacs-lisp . t) (latex . t)))
> (setq org-confirm-babel-evaluate nil)
> (add-to-list 'load-path (expand-file-name "~/src/org-mode/lisp"))
> (add-to-list 'auto-mode-alist '("\\.\\(org\\ |org_archive\\|txt\\)$" . org=
> -mode))
>
> (require 'org-install)
> ------
>
> ------ test.org
> * Notes for 2011-09-16
> #+begin_src latex :file diag1.png
> some latex source
> #+end_src
> ------
>
Yes, I can reproduce this (Org-mode version 7.7
(release_7.7.563.gf8d8.dirty)). I goofed before in not enabling latex
as a babel language in my minimal emacs.
The thing is that the usual debugging techniques are useless, because it
only happens with --batch. So the only thing that works is princ :-(
It turns out that there is a bunch of places in org-create-formula-image
(which gets called to convert latex formulas to png) that ask for
properties of the default face: there is no such thing in batch, and
various things blow up - e.g.
$ emacs -Q --batch --eval '(princ (face-attribute (quote default) :foreground))'
unspecified$
This bug has existed for ever, but I guess this is the first time
anybody exercised the code path.
In particular, the font height and the fg and bg colors are calculated
this way. I stubbed out these things (line 16898ff in org.el) with more
or less arbitrary values:
(fnh (if (featurep 'xemacs)
(font-height (get-face-font 'default))
(face-attribute 'default :height nil)))
(fnh (if (numberp fnh) fnh 140.))
and
;; (if (eq fg 'default) (setq fg (org-dvipng-color :foreground)))
;; (if (eq bg 'default) (setq bg (org-dvipng-color :background)))
(setq fg "rgb 0 1 0")
(setq bg "rgb 0 0 0")
and the test passes. Of course, this is not a fix, but I'm sure one will
be forthcoming shortly.
There may of course be more such problems in other untested paths.
Thanks for an interesting bug,
Nick
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-11-16 3:33 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-15 16:32 Failure exporting with emacs --batch Tom Prince
2011-11-15 20:09 ` Herbert Sitz
2011-11-15 20:18 ` Herbert Sitz
2011-11-15 20:51 ` Nick Dokos
2011-11-15 21:09 ` Herbert Sitz
2011-11-15 21:48 ` Nick Dokos
2011-11-15 20:21 ` Eric Schulte
2011-11-15 20:30 ` Nick Dokos
2011-11-16 0:36 ` Tom Prince
2011-11-16 3:33 ` Nick Dokos
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.