Commit ed6d6760268 removed variables htmlp and latexp from `org-export-preprocess-string'. Nothing wrong with that, but I think it has broken export for those using org-special-blocks, which contains #+begin_src emacs-lisp (defvar htmlp) (defvar latexp) (defun org-special-blocks-make-special-cookies () "Adds special cookies when #+begin_foo and #+end_foo tokens are seen. This is run after a few special cases are taken care of." (when (or htmlp latexp) (goto-char (point-min)) ... #+end_src I think because those defvars lack a second argument, the variable is not actually defined, i.e. they're not equivalent to (defvar htmlp nil). IIuc htmlp and latexp occur occasionally in org code as somewhat unofficial ways to test "am I in the middle of export?". They also occur in org-exp-blocks, but in deprecated code, so not a priority to fix. Dan
On 2/15/11 11:23 PM, Dan Davison wrote:
> Commit ed6d6760268 removed variables htmlp and latexp from
> `org-export-preprocess-string'. Nothing wrong with that, but I think it
> has broken export for those using org-special-blocks
Confirmed. Exporting the following example stops with a void-variable
error in org-special-blocks-make-special-cookies.
--------------------
Some text.
#+begin_sidebar
Some details left out of the main text.
#+end_sidebar
--------------------
(Incidentally -- org-special-blocks.el still says it's "not currently
part of GNU Emacs", but as of Org-mode 7.4 it is, isn't it?)
CM
Hi Christian,
Christian Moe <mail@christianmoe.com> writes:
> (Incidentally -- org-special-blocks.el still says it's "not currently
> part of GNU Emacs", but as of Org-mode 7.4 it is, isn't it?)
It's not yet part of GNU Emacs but it will be soon.
See commit 57144fea1ea6277b6ba39facae05715eee5751d6.
--
Bastien
Hi Christian,
Christian Moe <mail@christianmoe.com> writes:
> (Incidentally -- org-special-blocks.el still says it's "not currently
> part of GNU Emacs", but as of Org-mode 7.4 it is, isn't it?)
It's not yet part of GNU Emacs but it will be soon.
See commit 57144fea1ea6277b6ba39facae05715eee5751d6.
--
Bastien
Hi Dan, Dan Davison <dandavison7@gmail.com> writes: > Commit ed6d6760268 removed variables htmlp and latexp from > `org-export-preprocess-string'. Nothing wrong with that, but I think it > has broken export for those using org-special-blocks, which contains > > #+begin_src emacs-lisp > (defvar htmlp) > (defvar latexp) > (defun org-special-blocks-make-special-cookies () > "Adds special cookies when #+begin_foo and #+end_foo tokens are > seen. This is run after a few special cases are taken care of." > (when (or htmlp latexp) > (goto-char (point-min)) > ... > #+end_src Fixed thanks. > IIuc htmlp and latexp occur occasionally in org code as somewhat > unofficial ways to test "am I in the middle of export?". Now there is a uniform and official (!) way of getting the backend the user is currently exporting to: (eq backend 'html) ... > They also occur in org-exp-blocks, but in deprecated code, so not a > priority to fix. I fixed them there too. Thanks for reporting this! -- Bastien
Christian Moe <mail@christianmoe.com> writes: > On 2/15/11 11:23 PM, Dan Davison wrote: >> Commit ed6d6760268 removed variables htmlp and latexp from >> `org-export-preprocess-string'. Nothing wrong with that, but I think it >> has broken export for those using org-special-blocks > > Confirmed. Exporting the following example stops with a void-variable > error in org-special-blocks-make-special-cookies. I was about to make a temporary fix but I see Bastien's just fixed it. Bastien -- should we give that `backend' variable a name within the org-* namespace (and maybe defvar it in org.el?) so that it is a more respectable way to test for "am I doing export now?"? (This issue just came up in a separate babel thread). Dan > > -------------------- > > Some text. > > #+begin_sidebar > Some details left out of the main text. > #+end_sidebar > > -------------------- > > (Incidentally -- org-special-blocks.el still says it's "not currently > part of GNU Emacs", but as of Org-mode 7.4 it is, isn't it?) > > CM > > > _______________________________________________ > 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
Hi Dan,
Dan Davison <dandavison7@gmail.com> writes:
> I was about to make a temporary fix but I see Bastien's just fixed
> it. Bastien -- should we give that `backend' variable a name within the
> org-* namespace (and maybe defvar it in org.el?) so that it is a more
> respectable way to test for "am I doing export now?"? (This issue just
> came up in a separate babel thread).
backend is dynamically scoped, so I think there is no need to defvar it
in org.el -- only in org-*-blocks.el, to avoid compilation warnings.
Let me know if you think otherwise.
But it's a good idea to rename it to org-export-backend. Can you do it?
--
Bastien
Bastien <bastien.guerry@wikimedia.fr> writes: > Hi Dan, > > Dan Davison <dandavison7@gmail.com> writes: > >> I was about to make a temporary fix but I see Bastien's just fixed >> it. Bastien -- should we give that `backend' variable a name within the >> org-* namespace (and maybe defvar it in org.el?) so that it is a more >> respectable way to test for "am I doing export now?"? (This issue just >> came up in a separate babel thread). > > backend is dynamically scoped, so I think there is no need to defvar it > in org.el -- only in org-*-blocks.el, to avoid compilation warnings. > > Let me know if you think otherwise. Hi Bastien, I was thinking that if it were defvard in org.el, say as (defvar org-export-current-backend nil) then any code could use (null org-export-current-backend) to test whether org is currently exporting or not. Otherwise, the code has to be certain that it has been called during export if it is going to access the variable. For example, babel code can get called both during interactive evaluation with C-c C-c, and also during export. It might be helpful for that code to be able to inspect the value of org-export-current-backend to see what the current context is. Dan > > But it's a good idea to rename it to org-export-backend. Can you do it?
[-- Attachment #1.1.1: Type: text/plain, Size: 1450 bytes --] Hi all, to make this explicit: I can not export to latex any more, but instead I get Exporting to LaTeX... when: Symbol's value as variable is void: htmlp Org HEAD GNU emacs 23.2.1 (debian squeeze) This is my failing org-file: * Test test - Andreas Am 16.02.2011 11:03, schrieb Bastien: > Hi Dan, > > Dan Davison <dandavison7@gmail.com> writes: > > >> Commit ed6d6760268 removed variables htmlp and latexp from >> `org-export-preprocess-string'. Nothing wrong with that, but I think it >> has broken export for those using org-special-blocks, which contains >> >> #+begin_src emacs-lisp >> (defvar htmlp) >> (defvar latexp) >> (defun org-special-blocks-make-special-cookies () >> "Adds special cookies when #+begin_foo and #+end_foo tokens are >> seen. This is run after a few special cases are taken care of." >> (when (or htmlp latexp) >> (goto-char (point-min)) >> ... >> #+end_src >> > Fixed thanks. > > >> IIuc htmlp and latexp occur occasionally in org code as somewhat >> unofficial ways to test "am I in the middle of export?". >> > Now there is a uniform and official (!) way of getting the backend the > user is currently exporting to: > > (eq backend 'html) > > ... > > >> They also occur in org-exp-blocks, but in deprecated code, so not a >> priority to fix. >> > I fixed them there too. > > Thanks for reporting this! > > [-- Attachment #1.1.2: andreas_leha.vcf --] [-- Type: text/x-vcard, Size: 377 bytes --] begin:vcard fn:Andreas Leha n:Leha;Andreas org;quoted-printable:University Medicine G=C3=B6ttingen;Biostatistics/Bioinformatics (Dept. Medical Statistics) adr;quoted-printable:;;Humboldallee 32;G=C3=B6ttingen;;37073;Germany email;internet:andreas.leha@med.uni-goettingen.de title:Dipl. Inf. tel;work:+49 551 39-10710 tel;cell:+49 163 7662824 version:2.1 end:vcard [-- Attachment #1.2: S/MIME Cryptographic Signature --] [-- Type: application/pkcs7-signature, Size: 6432 bytes --] [-- Attachment #2: Type: text/plain, Size: 201 bytes --] _______________________________________________ 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
Hi Andreas, Andreas Leha wrote: > to make this explicit: I can not export to latex any more, but instead > I get > Exporting to LaTeX... > when: Symbol's value as variable is void: htmlp I confirm you this has been fixed 1 or 2 days ago. Just git pull, and you're gone. Best regards, Seb -- Sébastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > Hi all, > > to make this explicit: I can not export to latex any more, but instead > I get > Exporting to LaTeX... > when: Symbol's value as variable is void: htmlp > > Org HEAD > GNU emacs 23.2.1 (debian squeeze) > > This is my failing org-file: > * Test > test > Have you tried recent head? Enable stacktrace: M-x toggle-debug-on-error Also include M-x org-version? Jambunathan K. > - Andreas > > > Am 16.02.2011 11:03, schrieb Bastien: >> Hi Dan, >> >> Dan Davison <dandavison7@gmail.com> writes: >> >> >>> Commit ed6d6760268 removed variables htmlp and latexp from >>> `org-export-preprocess-string'. Nothing wrong with that, but I think it >>> has broken export for those using org-special-blocks, which contains >>> >>> #+begin_src emacs-lisp >>> (defvar htmlp) >>> (defvar latexp) >>> (defun org-special-blocks-make-special-cookies () >>> "Adds special cookies when #+begin_foo and #+end_foo tokens are >>> seen. This is run after a few special cases are taken care of." >>> (when (or htmlp latexp) >>> (goto-char (point-min)) >>> ... >>> #+end_src >>> >> Fixed thanks. >> >> >>> IIuc htmlp and latexp occur occasionally in org code as somewhat >>> unofficial ways to test "am I in the middle of export?". >>> >> Now there is a uniform and official (!) way of getting the backend the >> user is currently exporting to: >> >> (eq backend 'html) >> >> ... >> >> >>> They also occur in org-exp-blocks, but in deprecated code, so not a >>> priority to fix. >>> >> I fixed them there too. >> >> Thanks for reporting this! >> >> > > > _______________________________________________ > 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
I'm still encountering this bug. Org-mode version 7.4 (release_7.4.418.g373c) This looks like an old release, which is odd. I'm using Eric Schulte's starter kit, and anyway just switched to the org master branch and pulled down the latest commits. 'make clean', 'make info', and 'make lisp/org-install.el' were my next steps. Is it right to take the last 6 chars and search for a commit through the web interface? It isn't turning up anything, and that string is starting look familiar to me. On Thu, Feb 17, 2011 at 5:50 AM, Jambunathan K <kjambunathan@gmail.com> wrote: > Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > >> Hi all, >> >> to make this explicit: I can not export to latex any more, but instead >> I get >> Exporting to LaTeX... >> when: Symbol's value as variable is void: htmlp >> >> Org HEAD >> GNU emacs 23.2.1 (debian squeeze) >> >> This is my failing org-file: >> * Test >> test >> > > Have you tried recent head? > Enable stacktrace: M-x toggle-debug-on-error > Also include M-x org-version? > > Jambunathan K. > > >> - Andreas >> >> >> Am 16.02.2011 11:03, schrieb Bastien: >>> Hi Dan, >>> >>> Dan Davison <dandavison7@gmail.com> writes: >>> >>> >>>> Commit ed6d6760268 removed variables htmlp and latexp from >>>> `org-export-preprocess-string'. Nothing wrong with that, but I think it >>>> has broken export for those using org-special-blocks, which contains >>>> >>>> #+begin_src emacs-lisp >>>> (defvar htmlp) >>>> (defvar latexp) >>>> (defun org-special-blocks-make-special-cookies () >>>> "Adds special cookies when #+begin_foo and #+end_foo tokens are >>>> seen. This is run after a few special cases are taken care of." >>>> (when (or htmlp latexp) >>>> (goto-char (point-min)) >>>> ... >>>> #+end_src >>>> >>> Fixed thanks. >>> >>> >>>> IIuc htmlp and latexp occur occasionally in org code as somewhat >>>> unofficial ways to test "am I in the middle of export?". >>>> >>> Now there is a uniform and official (!) way of getting the backend the >>> user is currently exporting to: >>> >>> (eq backend 'html) >>> >>> ... >>> >>> >>>> They also occur in org-exp-blocks, but in deprecated code, so not a >>>> priority to fix. >>>> >>> I fixed them there too. >>> >>> Thanks for reporting this! >>> >>> >> >> >> _______________________________________________ >> 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 > -- Jeffrey Horn http://www.failuretorefrain.com/jeff/
Jeff Horn <jrhorn424@gmail.com> wrote: > I'm still encountering this bug. Works fine here. > > Org-mode version 7.4 (release_7.4.418.g373c) > That's the latest (as of two minutes ago). > This looks like an old release, which is odd. I'm using Eric Schulte's > starter kit, and anyway just switched to the org master branch and > pulled down the latest commits. 'make clean', 'make info', and 'make > lisp/org-install.el' were my next steps. > What about M-x org-reload? Or restarting emacs? > Is it right to take the last 6 chars and search for a commit through > the web interface? It isn't turning up anything, and that string is > starting look familiar to me. > Don't include the "g": try ``git show 373c'' Nick
Hi Jeff,
Jeff Horn <jrhorn424@gmail.com> writes:
> Org-mode version 7.4 (release_7.4.418.g373c)
>
> This looks like an old release, which is odd. I'm using Eric Schulte's
> starter kit, and anyway just switched to the org master branch and
> pulled down the latest commits. 'make clean', 'make info', and 'make
> lisp/org-install.el' were my next steps.
M-x org-reload RET (or C-c C-x !)
There is no "htmlp" string in the code anymore, so any bug raising it
tells that there is "htmlp" somewhere in your own snippets.
Could you check that?
--
Bastien
Hi, Jeff,
Check if you've got an old version of org-special-blocks somewhere on
your loadpath. I did, and it kept me running in circles for a bit.
Yours,
Christian
On 2/18/11 12:14 AM, Jeff Horn wrote:
> I'm still encountering this bug.
>
> Org-mode version 7.4 (release_7.4.418.g373c)
>
> This looks like an old release, which is odd. I'm using Eric Schulte's
> starter kit, and anyway just switched to the org master branch and
> pulled down the latest commits. 'make clean', 'make info', and 'make
> lisp/org-install.el' were my next steps.
>
> Is it right to take the last 6 chars and search for a commit through
> the web interface? It isn't turning up anything, and that string is
> starting look familiar to me.
>
> On Thu, Feb 17, 2011 at 5:50 AM, Jambunathan K<kjambunathan@gmail.com> wrote:
>> Andreas Leha<andreas.leha@med.uni-goettingen.de> writes:
>>
>>> Hi all,
>>>
>>> to make this explicit: I can not export to latex any more, but instead
>>> I get
>>> Exporting to LaTeX...
>>> when: Symbol's value as variable is void: htmlp
>>>
>>> Org HEAD
>>> GNU emacs 23.2.1 (debian squeeze)
>>>
>>> This is my failing org-file:
>>> * Test
>>> test
>>>
>>
>> Have you tried recent head?
>> Enable stacktrace: M-x toggle-debug-on-error
>> Also include M-x org-version?
>>
>> Jambunathan K.
>>
>>
>>> - Andreas
>>>
>>>
>>> Am 16.02.2011 11:03, schrieb Bastien:
>>>> Hi Dan,
>>>>
>>>> Dan Davison<dandavison7@gmail.com> writes:
>>>>
>>>>
>>>>> Commit ed6d6760268 removed variables htmlp and latexp from
>>>>> `org-export-preprocess-string'. Nothing wrong with that, but I think it
>>>>> has broken export for those using org-special-blocks, which contains
>>>>>
>>>>> #+begin_src emacs-lisp
>>>>> (defvar htmlp)
>>>>> (defvar latexp)
>>>>> (defun org-special-blocks-make-special-cookies ()
>>>>> "Adds special cookies when #+begin_foo and #+end_foo tokens are
>>>>> seen. This is run after a few special cases are taken care of."
>>>>> (when (or htmlp latexp)
>>>>> (goto-char (point-min))
>>>>> ...
>>>>> #+end_src
>>>>>
>>>> Fixed thanks.
>>>>
>>>>
>>>>> IIuc htmlp and latexp occur occasionally in org code as somewhat
>>>>> unofficial ways to test "am I in the middle of export?".
>>>>>
>>>> Now there is a uniform and official (!) way of getting the backend the
>>>> user is currently exporting to:
>>>>
>>>> (eq backend 'html)
>>>>
>>>> ...
>>>>
>>>>
>>>>> They also occur in org-exp-blocks, but in deprecated code, so not a
>>>>> priority to fix.
>>>>>
>>>> I fixed them there too.
>>>>
>>>> Thanks for reporting this!
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>
>
>
[-- Attachment #1.1.1: Type: text/plain, Size: 5356 bytes --] Hi all, I did not send to the list, so I resend my last email below. But for me I found the issue: org-exp-bibtex.el is the problem. Regards, Andreas PS: Here my last email: Thanks for looking into this. But just pulled before asking. I am pulling from git://repo.or.cz/org-mode.git The latest commit there is commit c7700d7bbee4f7596feb199b1ec1bc7750d4fb48 Author: Bastien Guerry <bzg@altern.org> Date: Wed Feb 16 11:53:28 2011 +0100 * org-html.el (org-export-as-html): expand the HTML title. This fix is a modified version of a patch submitted by Pierre Téchoueyres. The problem is still there. M-x org-version : 7.4 The backtrace (after M-x toggle-debug-on-error) is: Debugger entered--Lisp error: (void-variable htmlp) (if htmlp (progn (org-exp-bibtex-docites ...) (org-exp-bibtex-docites ...))) (when htmlp (org-exp-bibtex-docites (lambda nil ...)) (org-exp-bibtex-docites (lambda nil ...))) (save-window-excursion (setq oebp-cite-plist (quote nil)) (goto-char (point-min)) (while (re-search-forward "^#\\+BIBLIOGRAPHY:[ ]+\\(\\S-+\\)[ ]+\\(\\S-+\\)\\([^^M\n]*\\)" nil t) (let ... ...)) (when htmlp (org-exp-bibtex-docites ...) (org-exp-bibtex-docites ...))) org-export-bibtex-preprocess() run-hooks(org-export-preprocess-hook) org-export-preprocess-string(#("\n\n" 0 1 (fontified nil) 1 2 (fontified nil)) :for-backend latex :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") :email "andreas@habakuk" :author "andreas" :html-postamble nil :html-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 :creator-info t :email-info nil ...) nil nil) org-export-as-latex(nil) call-interactively(org-export-as-latex) org-export(nil) call-interactively(org-export nil nil) Am 17.02.2011 11:50, schrieb Jambunathan K: > Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > > >> Hi all, >> >> to make this explicit: I can not export to latex any more, but instead >> I get >> Exporting to LaTeX... >> when: Symbol's value as variable is void: htmlp >> >> Org HEAD >> GNU emacs 23.2.1 (debian squeeze) >> >> This is my failing org-file: >> * Test >> test >> >> > Have you tried recent head? > Enable stacktrace: M-x toggle-debug-on-error > Also include M-x org-version? > > Jambunathan K. > > > >> - Andreas >> >> >> Am 16.02.2011 11:03, schrieb Bastien: >> >>> Hi Dan, >>> >>> Dan Davison <dandavison7@gmail.com> writes: >>> >>> >>> >>>> Commit ed6d6760268 removed variables htmlp and latexp from >>>> `org-export-preprocess-string'. Nothing wrong with that, but I think it >>>> has broken export for those using org-special-blocks, which contains >>>> >>>> #+begin_src emacs-lisp >>>> (defvar htmlp) >>>> (defvar latexp) >>>> (defun org-special-blocks-make-special-cookies () >>>> "Adds special cookies when #+begin_foo and #+end_foo tokens are >>>> seen. This is run after a few special cases are taken care of." >>>> (when (or htmlp latexp) >>>> (goto-char (point-min)) >>>> ... >>>> #+end_src >>>> >>>> >>> Fixed thanks. >>> >>> >>> >>>> IIuc htmlp and latexp occur occasionally in org code as somewhat >>>> unofficial ways to test "am I in the middle of export?". >>>> >>>> >>> Now there is a uniform and official (!) way of getting the backend the >>> user is currently exporting to: >>> >>> (eq backend 'html) >>> >>> ... >>> >>> >>> >>>> They also occur in org-exp-blocks, but in deprecated code, so not a >>>> priority to fix. >>>> >>>> >>> I fixed them there too. >>> >>> Thanks for reporting this! >>> >>> >>> >> >> _______________________________________________ >> 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 > -- Universitätsmedizin Göttingen Abteilung Medizinische Statistik Humboldtallee 32 37073 Göttingen Tel: +49 (0)551 39-10710 Fax: +49 (0)551 39-4995 http://www.ams.med.uni-goettingen.de/amsneu/leha.html University Medical Center Göttingen Department for Medical Statistics Humboldtallee 32 37073 Göttingen Germany Phone: +49 (0) 551 39-10710 Fax: +49 (0) 551 39-4995 http://www.ams.med.uni-goettingen.de/amsneu/leha-en.html [-- Attachment #1.1.2: andreas_leha.vcf --] [-- Type: text/x-vcard, Size: 377 bytes --] begin:vcard fn:Andreas Leha n:Leha;Andreas org;quoted-printable:University Medicine G=C3=B6ttingen;Biostatistics/Bioinformatics (Dept. Medical Statistics) adr;quoted-printable:;;Humboldallee 32;G=C3=B6ttingen;;37073;Germany email;internet:andreas.leha@med.uni-goettingen.de title:Dipl. Inf. tel;work:+49 551 39-10710 tel;cell:+49 163 7662824 version:2.1 end:vcard [-- Attachment #1.2: S/MIME Cryptographic Signature --] [-- Type: application/pkcs7-signature, Size: 6432 bytes --] [-- Attachment #2: Type: text/plain, Size: 201 bytes --] _______________________________________________ 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
Hi Andreas,
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> I did not send to the list, so I resend my last email below. But for me
> I found the issue: org-exp-bibtex.el is the problem.
Fixed, thanks.
--
Bastien
Hi Dan,
Dan Davison <dandavison7@gmail.com> writes:
> I was thinking that if it were defvard in org.el, say as
>
> (defvar org-export-current-backend nil)
>
> then any code could use (null org-export-current-backend) to test
> whether org is currently exporting or not. Otherwise, the code has to be
> certain that it has been called during export if it is going to access
> the variable.
I agree this would be a good idea. If you have time, please send a
patch. Otherwise, I just put it [somewhere] in my own todo list...
Thanks!
--
Bastien
Thanks to Andreas, Christian, Bastien, and Nick. I didn't know about org-reload, so that bit is handy. Faster than restarting emacs. This bug is gone now. My backtrace also indicated org-ex-bibtex.el was the culprit for me. On Fri, Feb 18, 2011 at 3:49 AM, Bastien <bastien.guerry@wikimedia.fr> wrote: > Hi Andreas, > > Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > >> I did not send to the list, so I resend my last email below. But for me >> I found the issue: org-exp-bibtex.el is the problem. > > Fixed, thanks. > > -- > Bastien > > _______________________________________________ > 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 > -- Jeffrey Horn http://www.failuretorefrain.com/jeff/
Bastien <bastien.guerry@wikimedia.fr> writes: > Hi Dan, > > Dan Davison <dandavison7@gmail.com> writes: > >> I was thinking that if it were defvard in org.el, say as >> >> (defvar org-export-current-backend nil) >> >> then any code could use (null org-export-current-backend) to test >> whether org is currently exporting or not. Otherwise, the code has to be >> certain that it has been called during export if it is going to access >> the variable. > > I agree this would be a good idea. If you have time, please send a > patch. Otherwise, I just put it [somewhere] in my own todo list... Here's a patch. I note that Eric S pointed out in a separate thread that org-current-export-file can be used for a similar purpose. Incidentally, I would suggest that org-current-export-file and org-current-export-dir are renamed so that they are within the org-export-* namespace. There are other areas of Org where I think the naming should be standardised, notably in org-src.el: the distinction between org-src-* and org-edit-src-* is unclear IMO. I think this is kind of important, because in learning emacs one does makes use of these namespace conventions, e.g. C-h v <initial-letters> TAB. How much change would there be if we demanded that *all* variables defined in org-foo.el are named within the org-foo-* namespace? Dan commit ac9baa44c7c0baeb8ed3133ed79bc22c4eb6acc7 Author: Dan Davison <dandavison7@gmail.com> Date: Sun Feb 20 08:55:39 2011 -0800 New variable storing current export backend symbol, or nil. * lisp/org-exp.el (org-export-current-backend): Variable to hold current export backend symbol when export is in progress. (org-export-preprocess-string): Bind `org-export-current-backend' to backend symbols during export. * lisp/org-exp-blocks.el (org-export-blocks-format-ditaa): Dynamically scoped variable `backend' renamed as `org-export-current-backend' (org-export-blocks-format-dot): Dynamically scoped variable `backend' renamed as `org-export-current-backend' (org-export-blocks-format-comment): Dynamically scoped variable `backend' renamed as `org-export-current-backend' * lisp/org-exp.el (org-export-convert-protected-spaces): Dynamically scoped variable `backend' renamed as `org-export-current-backend' * lisp/org-publish.el (org-publish-project-alist): Dynamically scoped variable `backend' renamed as `org-export-current-backend' (org-export-current-backend): Dynamically scoped variable `backend' renamed as `org-export-current-backend' (org-publish-aux-preprocess): Dynamically scoped variable `backend' renamed as `org-export-current-backend' * lisp/org-special-blocks.el (org-export-current-backend): Dynamically scoped variable `backend' renamed as `org-export-current-backend' (org-special-blocks-make-special-cookies): Dynamically scoped variable `backend' renamed as `org-export-current-backend' diff --git a/lisp/org-exp-blocks.el b/lisp/org-exp-blocks.el index 1fac3bf..15549b8 100644 --- a/lisp/org-exp-blocks.el +++ b/lisp/org-exp-blocks.el @@ -242,7 +242,7 @@ passed to the ditaa utility as command line arguments." "\n"))) (prog1 (cond - ((member backend '(html latex docbook)) + ((member org-export-current-backend '(html latex docbook)) (unless (file-exists-p out-file) (mapc ;; remove old hashed versions of this file (lambda (file) @@ -301,7 +301,7 @@ digraph data_relationships { (out-file (concat (car out-file-parts) "_" hash "." (cdr out-file-parts)))) (prog1 (cond - ((member backend '(html latex docbook)) + ((member org-export-current-backend '(html latex docbook)) (unless (file-exists-p out-file) (mapc ;; remove old hashed versions of this file (lambda (file) @@ -333,7 +333,7 @@ other backends, it converts the comment into an EXAMPLE segment." (let ((owner (if headers (car headers))) (title (if (cdr headers) (mapconcat 'identity (cdr headers) " ")))) (cond - ((eq backend 'html) ;; We are exporting to HTML + ((eq org-export-current-backend 'html) ;; We are exporting to HTML (concat "#+BEGIN_HTML\n" "<div class=\"org-comment\"" (if owner (format " id=\"org-comment-%s\" " owner)) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 9a35b00..e239c25 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -584,6 +584,14 @@ table.el tables." (defconst org-level-max 20) +(defvar org-export-current-backend nil + "During export, this will be bound to a symbol such as 'html, + 'latex, 'docbook, 'ascii, etc, indicating which of the export + backends is in use. Otherwise it has the value nil. Users + should not attempt to change the value of this variable + directly, but it can be used in code to test whether export is + in progress, and if so, what the backend is.") + (defvar org-current-export-file nil) ; dynamically scoped parameter (defvar org-current-export-dir nil) ; dynamically scoped parameter (defvar org-export-opt-plist nil @@ -1033,7 +1041,7 @@ to export. It then creates a temporary buffer where it does its job. The result is then again returned as a string, and the exporter works on this string to produce the exported version." (interactive) - (let* ((backend (plist-get parameters :for-backend)) + (let* ((org-export-current-backend (plist-get parameters :for-backend)) (archived-trees (plist-get parameters :archived-trees)) (inhibit-read-only t) (drawers org-drawers) @@ -1091,22 +1099,22 @@ on this string to produce the exported version." ;; Change lists ending. Other parts of export may insert blank ;; lines and lists' structure could be altered. - (org-export-mark-list-end backend) + (org-export-mark-list-end org-export-current-backend) ;; Export code blocks (org-export-blocks-preprocess) ;; Mark lists with properties - (org-export-mark-list-properties backend) + (org-export-mark-list-properties org-export-current-backend) ;; Handle source code snippets - (org-export-replace-src-segments-and-examples backend) + (org-export-replace-src-segments-and-examples org-export-current-backend) ;; Protect short examples marked by a leading colon (org-export-protect-colon-examples) ;; Protected spaces - (org-export-convert-protected-spaces backend) + (org-export-convert-protected-spaces org-export-current-backend) ;; Normalize footnotes (when (plist-get parameters :footnotes) @@ -1122,7 +1130,7 @@ on this string to produce the exported version." ;; Get rid of drawers (org-export-remove-or-extract-drawers - drawers (plist-get parameters :drawers) backend) + drawers (plist-get parameters :drawers) org-export-current-backend) ;; Get the correct stuff before the first headline (when (plist-get parameters :skip-before-1st-heading) @@ -1145,7 +1153,7 @@ on this string to produce the exported version." ;; Select and protect backend specific stuff, throw away stuff ;; that is specific for other backends (run-hooks 'org-export-preprocess-before-selecting-backend-code-hook) - (org-export-select-backend-specific-text backend) + (org-export-select-backend-specific-text org-export-current-backend) ;; Protect quoted subtrees (org-export-protect-quoted-subtrees) @@ -1166,7 +1174,7 @@ on this string to produce the exported version." ;; Attach captions to the correct object (setq target-alist (org-export-attach-captions-and-attributes - backend target-alist)) + org-export-current-backend target-alist)) ;; Find matches for radio targets and turn them into internal links (org-export-mark-radio-links) @@ -1198,20 +1206,20 @@ on this string to produce the exported version." (run-hooks 'org-export-preprocess-before-backend-specifics-hook) ;; LaTeX-specific preprocessing - (when (eq backend 'latex) + (when (eq org-export-current-backend 'latex) (require 'org-latex nil) (org-export-latex-preprocess parameters)) ;; ASCII-specific preprocessing - (when (eq backend 'ascii) + (when (eq org-export-current-backend 'ascii) (org-export-ascii-preprocess parameters)) ;; HTML-specific preprocessing - (when (eq backend 'html) + (when (eq org-export-current-backend 'html) (org-export-html-preprocess parameters)) ;; DocBook-specific preprocessing - (when (eq backend 'docbook) + (when (eq org-export-current-backend 'docbook) (require 'org-docbook nil) (org-export-docbook-preprocess parameters)) @@ -1567,13 +1575,13 @@ from the buffer." (replace-match (org-add-props (cond - ((eq backend 'latex) + ((eq org-export-current-backend 'latex) (format "\\hspace{%dex}" (- (match-end 0) (match-beginning 0)))) - ((eq backend 'html) + ((eq org-export-current-backend 'html) (org-add-props (match-string 0) nil 'org-whitespace (- (match-end 0) (match-beginning 0)))) - ;; ((eq backend 'docbook)) - ((eq backend 'ascii) + ;; ((eq org-export-current-backend 'docbook)) + ((eq org-export-current-backend 'ascii) (org-add-props (match-string 0) '(org-whitespace t))) (t (make-string (- (match-end 0) (match-beginning 0)) ?\ ))) '(org-protected t)) diff --git a/lisp/org-publish.el b/lisp/org-publish.el index 649e39a..5bc4f28 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -931,7 +931,7 @@ the project." ;;; Index generation -(defvar backend) ; dynamically scoped +(defvar org-export-current-backend) ; dynamically scoped (defun org-publish-aux-preprocess () "Find index entries and write them to an .orgx file." (let ((case-fold-search t) @@ -942,7 +942,7 @@ the project." (re-search-forward "^[ \t]*#\\+index:[ \t]*\\(.*?\\)[ \t]*$" nil t) (> (match-end 1) (match-beginning 1))) (setq entry (match-string 1)) - (when (eq backend 'latex) + (when (eq org-export-current-backend 'latex) (replace-match (format "\\index{%s}" entry) t t)) (save-excursion (ignore-errors (org-back-to-heading t)) diff --git a/lisp/org-special-blocks.el b/lisp/org-special-blocks.el index 54fb6cb..f253787 100644 --- a/lisp/org-special-blocks.el +++ b/lisp/org-special-blocks.el @@ -45,11 +45,12 @@ by org-special-blocks. These blocks will presumably be interpreted by other mechanisms.") -(defvar backend) ; dynamically scoped +(defvar org-export-current-backend) ; dynamically scoped (defun org-special-blocks-make-special-cookies () "Adds special cookies when #+begin_foo and #+end_foo tokens are seen. This is run after a few special cases are taken care of." - (when (or (eq backend 'html) (eq backend 'latex)) + (when (or (eq org-export-current-backend 'html) + (eq org-export-current-backend 'latex)) (goto-char (point-min)) (while (re-search-forward "^[ \t]*#\\+\\(begin\\|end\\)_\\(.*\\)$" nil t) (unless (org-string-match-p org-special-blocks-ignore-regexp (match-string 2)) > > Thanks!
Hi Dan,
Dan Davison <dandavison7@gmail.com> writes:
> Here's a patch. I note that Eric S pointed out in a separate thread that
> org-current-export-file can be used for a similar purpose.
Thanks a lot for the patch. I applied a generalized version of it,
using `org-export-current-backend' whenever possible - see last git
repository.
Now one can use `org-export-current-backend' anytime during export
to check the current export backend.
This also reduces the amount of variable we need to pass to the
function. I've been through the functions which had a "backend"
variable and I think it's safe to always dismiss such a variable
and use `org-export-current-backend'.
Best,
--
Bastien
Hi Dan, Dan Davison <dandavison7@gmail.com> writes: > Incidentally, I would suggest that org-current-export-file and > org-current-export-dir are renamed so that they are within the > org-export-* namespace. Agreed. Please provide a patch if you have time. > There are other areas of Org where I think the > naming should be standardised, notably in org-src.el: the distinction > between org-src-* and org-edit-src-* is unclear IMO. I leave this decision to Erik, this is *his* namespace :) > I think this is > kind of important, because in learning emacs one does makes use of these > namespace conventions, e.g. C-h v <initial-letters> TAB. I agree. > How much change > would there be if we demanded that *all* variables defined in org-foo.el > are named within the org-foo-* namespace? I don't know. Let's undertake this work progressively. -- Bastien
[-- Attachment #1.1: Type: text/plain, Size: 1630 bytes --] Bastien <bzg@altern.org> writes: > Hi Dan, > > Dan Davison <dandavison7@gmail.com> writes: > >> Incidentally, I would suggest that org-current-export-file and >> org-current-export-dir are renamed so that they are within the >> org-export-* namespace. > > Agreed. Please provide a patch if you have time. OK. > >> There are other areas of Org where I think the >> naming should be standardised, notably in org-src.el: the distinction >> between org-src-* and org-edit-src-* is unclear IMO. > > I leave this decision to Erik, this is *his* namespace :) I'm not sure this is Eric's task, git blame lisp/org-src.el | cut -d' ' -f 3 | sort | uniq -c 352 Davison 434 Dominik 3 Guerry 9 Rooke 9 Schulte 5 Sperber but Carsten may have a view. I also want to change the customize group of a lot of those variables: a lot of the org-src-* and org-edit-src-* variables are filed in Customize under Org Structure -> Org Edit Structure which has to be one of the least intuitive things in the whole of Org! There's a question of whether we have an Org Src customize group in addition to the Babel customize group, and how we keep them distinct. In fact, that may be what has prevented this from being sorted out thus far. Dan > >> I think this is >> kind of important, because in learning emacs one does makes use of these >> namespace conventions, e.g. C-h v <initial-letters> TAB. > > I agree. > >> How much change >> would there be if we demanded that *all* variables defined in org-foo.el >> are named within the org-foo-* namespace? > > I don't know. Let's undertake this work progressively. [-- Attachment #1.2: Type: text/html, Size: 2536 bytes --] [-- Attachment #2: Type: text/plain, Size: 201 bytes --] _______________________________________________ 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
Hi Dan,
Dan Davison <dandavison7@gmail.com> writes:
> I also want to change the customize group of a lot of those variables:
> a lot of the org-src-* and org-edit-src-* variables are filed in
> Customize under
>
> Org Structure -> Org Edit Structure
>
> which has to be one of the least intuitive things in the whole of Org!
>
> There's a question of whether we have an Org Src customize group in
> addition to the Babel customize group, and how we keep them distinct.
> In fact, that may be what has prevented this from being sorted out
> thus far.
Any work in this area would be great -- thanks for putting a stab on
this, if you have a chance!
Best,
--
Bastien