emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: export failed when using footnotes inside src blocks [7.7]
@ 2011-07-30  8:22 Günter Kolousek
  2011-07-30  9:00 ` Nick Dokos
  2011-07-30 10:45 ` Nicolas Goaziou
  0 siblings, 2 replies; 12+ messages in thread
From: Günter Kolousek @ 2011-07-30  8:22 UTC (permalink / raw)
  To: emacs-orgmode


Hi, using footnotes i.e. [2] inside #+begin_src #+end_src causes errors
during export using orgmode 7.7 and tip.

Günter

#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation]
#+BEAMER_FRAME_LEVEL: 2
#+BEAMER_HEADER_EXTRA: 
\usetheme{boxes}\addheadbox{structure}{\tiny\quad\insertsection\qquad\insertsubsection\hfill\insertpagenumber\quad}\useinnertheme{rectangles}\usecolortheme[RGB={0,118,190}]{structure}\usefonttheme{structurebold}
#+COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Args) %4BEAMER_col(Col) %8BEAMER_extra(Ex)
#+LANGUAGE: de
#+OPTIONS:   H:1 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc

#+LATEX_HEADER: \setbeamertemplate{navigation symbols}{}
#+LATEX_HEADER: \usepackage{palatino}
#+LATEX_HEADER: \usepackage{xspace}
#+LATEX_HEADER: \usepackage[ngerman]{babel}

\shorthandoff{"}

* Test
   foo
   #+begin_src python
   lst = [-1, -2, 2, -3, -4]

   for x in lst[:]:
       if x < 0:
           lst.remove(x)

   print(lst) # [2] <- does not work!
   #+end_src

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

Emacs  : GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-30  8:22 Bug: export failed when using footnotes inside src blocks [7.7] Günter Kolousek
@ 2011-07-30  9:00 ` Nick Dokos
  2011-07-30  9:19   ` Jambunathan K
  2011-07-30 10:45 ` Nicolas Goaziou
  1 sibling, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2011-07-30  9:00 UTC (permalink / raw)
  To: =?UTF-8?B?R8O8bnRlciBLb2xvdXNlaw==?=; +Cc: nicholas.dokos, emacs-orgmode

Günter Kolousek <ko@htlwrn.ac.at> wrote:

> 
> Hi, using footnotes i.e. [2] inside #+begin_src #+end_src causes errors
> during export using orgmode 7.7 and tip.
> 
> Günter
> 
> ...
> 
> * Test
>   foo
>   #+begin_src python
>   lst = [-1, -2, 2, -3, -4]
> 
>   for x in lst[:]:
>       if x < 0:
>           lst.remove(x)
> 
>   print(lst) # [2] <- does not work!
>   #+end_src
> 

Are you saying that this worked in some earlier version
and is not working in 7.7 and tip? 

Or that you only tried it in 7.7 and tip, found that it
is not working and reported it as a bug?

If the former, which version was it working in? If the
latter, it might very well be the case that org-mode just
does not support this: whether that's a bug or a feature
is in the eye of the beholder.

Personally, I'd be surprised if this ever worked.[fn:1]
Whether it can be made to work is another matter - but
then it is not a bug report, it is a feature request.

It makes a difference because it would require different
methods of attacking the problem: in the first case, I'd
bisect the commits to find out who broke it; in the
second case, I would know it's new functionality and
would just try to implement it without breaking anything
else and I wouldn't go hunting for a culprit.[fn:2]

Nick

Footnotes:

[fn:1] ... but I could be wrong.

[fn:2] Note that the "I" in this paragraph is purely
rhetorical.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-30  9:00 ` Nick Dokos
@ 2011-07-30  9:19   ` Jambunathan K
  2011-07-30  9:58     ` Nick Dokos
  0 siblings, 1 reply; 12+ messages in thread
From: Jambunathan K @ 2011-07-30  9:19 UTC (permalink / raw)
  To: ko; +Cc: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

> Günter Kolousek <ko@htlwrn.ac.at> wrote:
>
>> 
>> Hi, using footnotes i.e. [2] inside #+begin_src #+end_src causes errors
>> during export using orgmode 7.7 and tip.
>> 
>> Günter
>> 
>> ...
>> 
>> * Test
>>   foo
>>   #+begin_src python
>>   lst = [-1, -2, 2, -3, -4]
>> 
>>   for x in lst[:]:
>>       if x < 0:
>>           lst.remove(x)
>> 
>>   print(lst) # [2] <- does not work!
>>   #+end_src
>> 

This should set the thing to rest.

,----[ C-h v org-footnote-forbidden-blocks RET ]
| org-footnote-forbidden-blocks is a variable defined in `org-footnote.el'.
| Its value is
| ("example" "verse" "src" "ascii" "beamer" "docbook" "html" "latex" "odt")
| 
| 
| Documentation:
| Names of blocks where footnotes are not allowed.
| 
| [back]
`----

OP can search for for alternative ways to reference code block lines in
the following section of the manual
http://orgmode.org/org.html#Literal-examples

(Hint: Search for ref:jump)


Jambunathan K.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-30  9:19   ` Jambunathan K
@ 2011-07-30  9:58     ` Nick Dokos
  2011-07-30 10:53       ` Jambunathan K
  0 siblings, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2011-07-30  9:58 UTC (permalink / raw)
  To: Jambunathan K; +Cc: ko, nicholas.dokos, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

Jambunathan K <kjambunathan@gmail.com> wrote:

> Nick Dokos <nicholas.dokos@hp.com> writes:
> 
> > Günter Kolousek <ko@htlwrn.ac.at> wrote:
> >
> >> 
> >> Hi, using footnotes i.e. [2] inside #+begin_src #+end_src causes errors
> >> during export using orgmode 7.7 and tip.
> >> 
> >> Günter
> >> 
> >> ...
> >> 
> >> * Test
> >>   foo
> >>   #+begin_src python
> >>   lst = [-1, -2, 2, -3, -4]
> >> 
> >>   for x in lst[:]:
> >>       if x < 0:
> >>           lst.remove(x)
> >> 
> >>   print(lst) # [2] <- does not work!
> >>   #+end_src
> >> 
> 
> This should set the thing to rest.
> 

Acctually, no: I took the OP's request (and I presume I misled you into
thinking that too) as a functionality request, but I didn't read it
carefully enough.  I think he is complaining about getting an error (see
the attached backtrace).

Nick


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: backtrace --]
[-- Type: text/x-lisp, Size: 39789 bytes --]

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("ORG-LIST-END-MARKER\\'" nil)
  (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " ")
  (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))
  (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " ")))
  (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc (string-to-number lbl) (mapcar (lambda (e) (cdr e)) org-export-footnotes-seen))))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if (member lbl org-export-latex-footmark-seen) (org-export-latex-protect-string (format "\\footnotemark[%s]" lbl)) (push lbl org-export-latex-footmark-seen) (concat (org-export-latex-protect-string "\\footnote{") def (org-export-latex-protect-string "}")))) (sep (org-export-latex-protect-string (if (save-excursion (goto-char ...) (let ... ...)) org-export-latex-footnote-separator "")))) (when (org-on-heading-p) (setq fnote (concat (org-export-latex-protect-string "\\protect") fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep))))
  (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc (string-to-number lbl) (mapcar (lambda ... ...) org-export-footnotes-seen))))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if (member lbl org-export-latex-footmark-seen) (org-export-latex-protect-string (format "\\footnotemark[%s]" lbl)) (push lbl org-export-latex-footmark-seen) (concat (org-export-latex-protect-string "\\footnote{") def (org-export-latex-protect-string "}")))) (sep (org-export-latex-protect-string (if (save-excursion ... ...) org-export-latex-footnote-separator "")))) (when (org-on-heading-p) (setq fnote (concat (org-export-latex-protect-string "\\protect") fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep)))))
  (let (ref) (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc (string-to-number lbl) (mapcar ... org-export-footnotes-seen))))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if (member lbl org-export-latex-footmark-seen) (org-export-latex-protect-string ...) (push lbl org-export-latex-footmark-seen) (concat ... def ...))) (sep (org-export-latex-protect-string (if ... org-export-latex-footnote-separator "")))) (when (org-on-heading-p) (setq fnote (concat (org-export-latex-protect-string "\\protect") fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep))))))
  (progn (goto-char (point-min)) (let (ref) (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc ... ...)))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if ... ... ... ...)) (sep (org-export-latex-protect-string ...))) (when (org-on-heading-p) (setq fnote (concat ... fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep)))))))
  (if (plist-get parameters :footnotes) (progn (goto-char (point-min)) (let (ref) (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 ...))) (setq def (concat def (if ... "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote ...) (sep ...)) (when (org-on-heading-p) (setq fnote ...)) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep))))))))
  (when (plist-get parameters :footnotes) (goto-char (point-min)) (let (ref) (while (setq ref (org-footnote-get-next-reference)) (let* ((beg (nth 1 ref)) (lbl (car ref)) (def (nth 1 (assoc ... ...)))) (setq def (concat def (if (string-match "ORG-LIST-END-MARKER\\'" def) "\n" " "))) (org-footnote-delete-definitions lbl) (let ((fnote (if ... ... ... ...)) (sep (org-export-latex-protect-string ...))) (when (org-on-heading-p) (setq fnote (concat ... fnote))) (put-text-property 0 (length fnote) (quote original-indentation) 1000 fnote) (goto-char beg) (delete-region beg (nth 2 ref)) (save-excursion (insert fnote sep)))))))
  org-export-latex-preprocess((:emph-multiline t :for-backend latex :comments nil :tags nil :priority nil :footnotes t :drawers nil :timestamps t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tags ("export") :exclude-tags ("noexport") :LaTeX-fragments nil))
  funcall(org-export-latex-preprocess (:emph-multiline t :for-backend latex :comments nil :tags nil :priority nil :footnotes t :drawers nil :timestamps t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tags ("export") :exclude-tags ("noexport") :LaTeX-fragments nil))
  (let* ((backend-name (symbol-name org-export-current-backend)) (f (intern (format "org-export-%s-preprocess" backend-name)))) (require (intern (concat "org-" backend-name)) nil) (funcall f parameters))
  (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (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 (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\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 ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (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 (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\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) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (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 (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\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) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (with-current-buffer temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (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 (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\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) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (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 (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\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) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (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 (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\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 (or (plist-get parameters :for-backend) org-export-current-backend)) (archived-trees (plist-get parameters :archived-trees)) (inhibit-read-only t) (drawers org-drawers) (source-buffer (current-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 ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (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 (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\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) ...) rtn)
  org-export-preprocess-string(#("#+LaTeX_CLASS: beamer\n#+LaTeX_CLASS_OPTIONS: [presentation]\n#+BEAMER_FRAME_LEVEL: 2\n#+BEAMER_HEADER_EXTRA:\n\\usetheme{boxes}\\addheadbox{structure}{\\tiny\\quad\\insertsection\\qquad\\insertsubsection\\hfill\\insertpagenumber\\quad}\\useinnertheme{rectangles}\\usecolortheme[RGB={0,118,190}]{structure}\\usefonttheme{structurebold}\n#+COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Args) %4BEAMER_col(Col) %8BEAMER_extra(Ex)\n#+LANGUAGE: de\n#+OPTIONS:   H:1 num:t toc:t \\n:nil @:t ::t |:t ^:t -:t f:t *:t <:t\n#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc\n\n#+LATEX_HEADER: \\setbeamertemplate{navigation symbols}{}\n#+LATEX_HEADER: \\usepackage{palatino}\n#+LATEX_HEADER: \\usepackage{xspace}\n#+LATEX_HEADER: \\usepackage[ngerman]{babel}\n\n\\shorthandoff{\"}\n\n* Test\n  foo\n\n#+begin_src python\n  lst = [-1, -2, 2, -3, -4]\n\n  for x in lst[:]:\n      if x < 0:\n          lst.remove(x)\n\n  print(lst) # [2]\n#+end_src\n" 0 21 (fontified nil font-lock-fontified t org-category "foo") 21 22 (fontified nil font-lock-fontified t org-category "foo") 22 59 (fontified nil font-lock-fontified t org-category "foo") 59 60 (fontified nil font-lock-fontified t org-category "foo") 60 83 (fontified nil font-lock-fontified t org-category "foo") 83 84 (fontified nil font-lock-fontified t org-category "foo") 84 106 (fontified nil font-lock-fontified t org-category "foo") 106 107 (fontified nil font-lock-fontified t org-category "foo") 107 319 (fontified nil org-category "foo" :org-license-to-kill t) 319 417 (fontified nil font-lock-fontified t org-category "foo") 417 418 (fontified nil font-lock-fontified t org-category "foo") 418 432 (fontified nil font-lock-fontified t org-category "foo") 432 433 (fontified nil font-lock-fontified t org-category "foo") 433 500 (fontified nil font-lock-fontified t org-category "foo") 500 501 (fontified nil font-lock-fontified t org-category "foo") 501 573 (fontified nil font-lock-fontified t org-category "foo") 573 574 (fontified nil font-lock-fontified t org-category "foo") 574 575 (fontified nil org-category "foo" :org-license-to-kill t) 575 631 (fontified nil font-lock-fontified t org-category "foo") 631 632 (fontified nil font-lock-fontified t org-category "foo") 632 669 (fontified nil font-lock-fontified t org-category "foo") 669 670 (fontified nil font-lock-fontified t org-category "foo") 670 705 (fontified nil font-lock-fontified t org-category "foo") 705 706 (fontified nil font-lock-fontified t org-category "foo") 706 749 (fontified nil font-lock-fontified t org-category "foo") 749 750 (fontified nil font-lock-fontified t org-category "foo") 750 768 (fontified nil org-category "foo" :org-license-to-kill t) 768 769 (fontified nil org-category "foo") 769 771 (fontified nil org-category "foo" org-props (("CATEGORY"))) 771 775 (fontified nil org-category "foo" org-props (("CATEGORY"))) 775 776 (fontified nil org-category "foo") 776 783 (fontified nil org-category "foo") 783 801 (fontified nil font-lock-fontified t org-category "foo") 801 802 (fontified nil font-lock-fontified t org-category "foo") 802 909 (fontified nil font-lock-fontified t org-category "foo") 909 910 (fontified nil font-lock-fontified t org-category "foo") 910 919 (fontified nil font-lock-fontified t org-category "foo") 919 920 (fontified nil rear-nonsticky t org-category "foo")) :emph-multiline t :for-backend latex :comments nil :tags nil :priority nil :footnotes t :drawers nil :timestamps t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tags ("export") :exclude-tags ("noexport") :LaTeX-fragments nil)
  (let* ((wcf (current-window-configuration)) (opt-plist (org-export-process-option-filters org-export-latex-options-plist)) (region-p (org-region-active-p)) (rbeg (and region-p (region-beginning))) (rend (and region-p (region-end))) (subtree-p (if (plist-get opt-plist :ignore-subtree-p) nil (when region-p (save-excursion (goto-char rbeg) (and (org-at-heading-p) (>= ... rend)))))) (opt-plist (setq org-export-opt-plist (if subtree-p (org-export-add-subtree-options opt-plist rbeg) opt-plist))) (org-export-latex-options-plist (setq org-export-opt-plist opt-plist)) (org-current-export-dir (or pub-dir (org-export-directory :html opt-plist))) (org-current-export-file buffer-file-name) (title (or (and subtree-p (org-export-get-title-from-subtree)) (plist-get opt-plist :title) (and (not (plist-get opt-plist :skip-before-1st-heading)) (org-export-grab-title-from-buffer)) (and buffer-file-name (file-name-sans-extension (file-name-nondirectory buffer-file-name))) "No Title")) (filename (and (not to-buffer) (concat (file-name-as-directory (or pub-dir (org-export-directory :LaTeX ext-plist))) (file-name-sans-extension (or (and subtree-p ...) (file-name-nondirectory ...))) ".tex"))) (filename (and filename (if (equal (file-truename filename) (file-truename (or buffer-file-name "dummy.org"))) (concat filename ".tex") filename))) (buffer (if to-buffer (cond ((eq to-buffer (quote string)) (get-buffer-create "*Org LaTeX Export*")) (t (get-buffer-create to-buffer))) (find-file-noselect filename))) (odd org-odd-levels-only) (header (org-export-latex-make-header title opt-plist)) (skip (cond (subtree-p nil) (region-p nil) (t (plist-get opt-plist :skip-before-1st-heading)))) (text (plist-get opt-plist :text)) (org-export-preprocess-hook (cons (\` (lambda nil (org-set-local (quote org-complex-heading-regexp) (\, org-export-latex-complex-heading-re)))) org-export-preprocess-hook)) (first-lines (if skip "" (org-export-latex-first-lines opt-plist (if subtree-p (save-excursion (goto-char rbeg) (point-at-bol 2)) rbeg) (if region-p rend)))) (coding-system (and (boundp (quote buffer-file-coding-system)) buffer-file-coding-system)) (coding-system-for-write (or org-export-latex-coding-system coding-system)) (save-buffer-coding-system (or org-export-latex-coding-system coding-system)) (region (buffer-substring (if region-p (region-beginning) (point-min)) (if region-p (region-end) (point-max)))) (text (and text (string-match "\\S-" text) (org-export-preprocess-string text :emph-multiline t :for-backend (quote latex) :comments nil :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-get opt-plist :footnotes) :drawers (plist-get opt-plist :drawers) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :add-text nil :skip-before-1st-heading skip :select-tags nil :exclude-tags nil :LaTeX-fragments nil))) (string-for-export (org-export-preprocess-string region :emph-multiline t :for-backend (quote latex) :comments nil :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-get opt-plist :footnotes) :drawers (plist-get opt-plist :drawers) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :add-text (if (eq to-buffer (quote string)) nil text) :skip-before-1st-heading skip :select-tags (plist-get opt-plist :select-tags) :exclude-tags (plist-get opt-plist :exclude-tags) :LaTeX-fragments nil))) (set-buffer buffer) (erase-buffer) (org-install-letbind) (and (fboundp (quote set-buffer-file-coding-system)) (set-buffer-file-coding-system coding-system-for-write)) (unless (or (eq to-buffer (quote string)) body-only) (insert header)) (when (and text (not (eq to-buffer (quote string)))) (insert (org-export-latex-content text (quote (lists tables fixed-width keywords))) "\n\n")) (unless (or skip (string-match "^\\*" first-lines)) (insert first-lines)) (org-export-latex-global (with-temp-buffer (insert string-for-export) (goto-char (point-min)) (when (re-search-forward "^\\(\\*+\\) " nil t) (let* ((asters (length ...)) (level (if odd ... ...))) (setq org-export-latex-add-level (if odd (1- ...) (1- asters))) (org-export-latex-parse-global level odd))))) (unless body-only (insert "\n\\end{document}")) (goto-char (point-min)) (while (re-search-forward "^[ 	]*\\\\item\\([ 	]+\\)\\[" nil t) (delete-region (match-beginning 1) (match-end 1))) (goto-char (point-min)) (when (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t) (goto-char (point-min)) (while (re-search-forward "\\\\tableofcontents\\>[ 	]*\n?" nil t) (replace-match "")) (goto-char (point-min)) (and (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t) (replace-match "\\tableofcontents" t t))) (goto-char (point-min)) (while (re-search-forward "^[ 	]*\\\\item\\>.*\\(\\\\\\\\\\)[ 	]*\\(\n\\\\label.*\\)*\n\\\\begin" nil t) (delete-region (match-beginning 1) (match-end 1))) (goto-char (point-min)) (while (re-search-forward "^[ 	]*\\\\item\\>.*\\(\\\\\\\\\\)[ 	]*\\(\n\\\\label.*\\)*" nil t) (if (looking-at "[\n 	]+") (replace-match "\n"))) (run-hooks (quote org-export-latex-final-hook)) (if to-buffer (unless (eq major-mode (quote latex-mode)) (latex-mode)) (save-buffer)) (org-export-latex-fix-inputenc) (run-hooks (quote org-export-latex-after-save-hook)) (goto-char (point-min)) (or (org-export-push-to-kill-ring "LaTeX") (message "Exporting to LaTeX...done")) (prog1 (if (eq to-buffer (quote string)) (prog1 (buffer-substring (point-min) (point-max)) (kill-buffer (current-buffer))) (current-buffer)) (set-window-configuration wcf)))
  org-export-as-latex(nil)
  call-interactively(org-export-as-latex)
  (if (and bg (nth 2 ass) (not (buffer-base-buffer)) (not (org-region-active-p))) (let ((p (start-process (concat "Exporting " (file-name-nondirectory (buffer-file-name))) "*Org Processes*" (expand-file-name invocation-name invocation-directory) "-batch" "-l" user-init-file "--eval" "(require 'org-exp)" "--eval" "(setq org-wait .2)" (buffer-file-name) "-f" (symbol-name (nth 1 ass))))) (set-process-sentinel p (quote org-export-process-sentinel)) (message "Background process \"%s\": started" p)) (if subtree-p (progn (org-mark-subtree) (org-activate-mark))) (call-interactively (nth 1 ass)) (when (and bpos (get-buffer-window cbuf)) (let ((cw (selected-window))) (select-window (get-buffer-window cbuf)) (goto-char cpos) (deactivate-mark) (select-window cw))))
  (let* ((bg (org-xor (equal arg (quote (16))) org-export-run-in-background)) (subtree-p (or (org-region-active-p) (eq org-export-initial-scope (quote subtree)))) (help "[t]   insert the export option template\n[v]   limit export to visible part of outline tree\n[1]   switch buffer/subtree export\n[SPC] publish enclosing subtree (with LaTeX_CLASS or EXPORT_FILE_NAME prop)\n\n[a/n/u] export as ASCII/Latin-1/UTF-8         [A/N/U] 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            [d] ... and open PDF file\n\n[D] export as DocBook   [V] export as DocBook, process to PDF, and open\n\n[o] export as OpenDocumentText                    [O] ... and open\n\n[j] export as TaskJuggler                         [J] ... and open\n\n[m] export as Freemind mind map\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   [c] ...as one combined file\n\n[F] publish current file          [P] publish current project\n[X] publish a project...          [E] publish every projects") (cmds (quote ((116 org-insert-export-options-template nil) (118 org-export-visible nil) (97 org-export-as-ascii t) (65 org-export-as-ascii-to-buffer t) (110 org-export-as-latin1 t) (78 org-export-as-latin1-to-buffer t) (117 org-export-as-utf8 t) (85 org-export-as-utf8-to-buffer t) (104 org-export-as-html t) (98 org-export-as-html-and-open t) (72 org-export-as-html-to-buffer nil) (82 org-export-region-as-html nil) (120 org-export-as-xoxo t) (103 org-export-generic t) (68 org-export-as-docbook t) (86 org-export-as-docbook-pdf-and-open t) (111 org-export-as-odt t) (79 org-export-as-odt-and-open t) (106 org-export-as-taskjuggler t) (74 org-export-as-taskjuggler-and-open t) (109 org-export-as-freemind t) (108 org-export-as-latex t) (112 org-export-as-pdf t) (100 org-export-as-pdf-and-open t) (76 org-export-as-latex-to-buffer nil) (105 org-export-icalendar-this-file t) (73 org-export-icalendar-all-agenda-files t) (99 org-export-icalendar-combine-agenda-files t) (70 org-publish-current-file t) (80 org-publish-current-project t) (88 org-publish t) (69 org-publish-all t)))) r1 r2 ass (cpos (point)) (cbuf (current-buffer)) bpos) (save-excursion (save-window-excursion (if subtree-p (message "Export subtree: ") (message "Export buffer: ")) (delete-other-windows) (with-output-to-temp-buffer "*Org Export/Publishing Help*" (princ help)) (org-fit-window-to-buffer (get-buffer-window "*Org Export/Publishing Help*")) (while (eq (setq r1 (read-char-exclusive)) 49) (cond (subtree-p (setq subtree-p nil) (message "Export buffer: ")) ((not subtree-p) (setq subtree-p t) (message "Export subtree: ")))) (when (eq r1 32) (let ((case-fold-search t) (end (save-excursion ... ...))) (outline-next-heading) (if (re-search-backward "^[ 	]+\\(:latex_class:\\|:export_title:\\|:export_file_name:\\)[ 	]+\\S-" end t) (progn (org-back-to-heading t) (setq subtree-p t) (setq bpos ...) (message "Select command (for subtree): ") (setq r1 ...)) (error "No enclosing node with LaTeX_CLASS or EXPORT_TITLE or EXPORT_FILE_NAME")))))) (redisplay) (and bpos (goto-char bpos)) (setq r2 (if (< r1 27) (+ r1 96) r1)) (unless (setq ass (assq r2 cmds)) (error "No command associated with key %c" r1)) (if (and bg (nth 2 ass) (not (buffer-base-buffer)) (not (org-region-active-p))) (let ((p (start-process (concat "Exporting " (file-name-nondirectory ...)) "*Org Processes*" (expand-file-name invocation-name invocation-directory) "-batch" "-l" user-init-file "--eval" "(require 'org-exp)" "--eval" "(setq org-wait .2)" (buffer-file-name) "-f" (symbol-name (nth 1 ass))))) (set-process-sentinel p (quote org-export-process-sentinel)) (message "Background process \"%s\": started" p)) (if subtree-p (progn (org-mark-subtree) (org-activate-mark))) (call-interactively (nth 1 ass)) (when (and bpos (get-buffer-window cbuf)) (let ((cw (selected-window))) (select-window (get-buffer-window cbuf)) (goto-char cpos) (deactivate-mark) (select-window cw)))))
  org-export(nil)
  call-interactively(org-export nil nil)

[-- Attachment #3: Type: text/plain, Size: 552 bytes --]


> ,----[ C-h v org-footnote-forbidden-blocks RET ]
> | org-footnote-forbidden-blocks is a variable defined in `org-footnote.el'.
> | Its value is
> | ("example" "verse" "src" "ascii" "beamer" "docbook" "html" "latex" "odt")
> | 
> | 
> | Documentation:
> | Names of blocks where footnotes are not allowed.
> | 
> | [back]
> `----
> 
> OP can search for for alternative ways to reference code block lines in
> the following section of the manual
> http://orgmode.org/org.html#Literal-examples
> 
> (Hint: Search for ref:jump)
> 
> 
> Jambunathan K.
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-30  8:22 Bug: export failed when using footnotes inside src blocks [7.7] Günter Kolousek
  2011-07-30  9:00 ` Nick Dokos
@ 2011-07-30 10:45 ` Nicolas Goaziou
  2011-07-30 14:34   ` Günter Kolousek
  2011-07-31 18:41   ` Achim Gratz
  1 sibling, 2 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2011-07-30 10:45 UTC (permalink / raw)
  To: Günter Kolousek; +Cc: emacs-orgmode

Hello,

Günter Kolousek <ko@htlwrn.ac.at> writes:

> Hi, using footnotes i.e. [2] inside #+begin_src #+end_src causes errors
> during export using orgmode 7.7 and tip.

This should be fixed now. Thank you for reporting this.

_Note to self_ : I really wish we can come up with an exporter that
exactly matches Org syntax. An element recognized/ignored in Org should
be identically recognized/ignored during the export process without
resorting to any trick (à la `org-protected' text property).

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-30  9:58     ` Nick Dokos
@ 2011-07-30 10:53       ` Jambunathan K
  0 siblings, 0 replies; 12+ messages in thread
From: Jambunathan K @ 2011-07-30 10:53 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: ko, emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

> Jambunathan K <kjambunathan@gmail.com> wrote:
>
>> Nick Dokos <nicholas.dokos@hp.com> writes:
>> 
>> > Günter Kolousek <ko@htlwrn.ac.at> wrote:
>> >
>> >> 
>> >> Hi, using footnotes i.e. [2] inside #+begin_src #+end_src causes errors
>> >> during export using orgmode 7.7 and tip.
>> >> 
>> >> Günter
>> >> 
>> >> ...
>> >> 
>> >> * Test
>> >>   foo
>> >>   #+begin_src python
>> >>   lst = [-1, -2, 2, -3, -4]
>> >> 
>> >>   for x in lst[:]:
>> >>       if x < 0:
>> >>           lst.remove(x)
>> >> 
>> >>   print(lst) # [2] <- does not work!
>> >>   #+end_src
>> >> 
>> 
>> This should set the thing to rest.
>> 
>
> Acctually, no: I took the OP's request (and I presume I misled you into
> thinking that too) as a functionality request, but I didn't read it
> carefully enough.  I think he is complaining about getting an error (see
> the attached backtrace).

Right, it shouldn't crash.

FWIW, The problem is (org-footnote-get-next-reference ...)  sees the
following text while looking for next reference.


\begin{verbatim}
lst = [-1, -2, 2, -3, -4]

for x in lst[:]:
    if x < 0:
        lst.remove(x)

        print(lst) # [2] <- does not work!
\end{verbatim}

AFAICS the above text has no text decorations as well.

Naturally org-footnote-get-next-reference is misled into believing that
it is in the "allowed" territory. 

Jambunathan K.

>
> Nick
>
>
>
>> ,----[ C-h v org-footnote-forbidden-blocks RET ]
>> | org-footnote-forbidden-blocks is a variable defined in `org-footnote.el'.
>> | Its value is
>> | ("example" "verse" "src" "ascii" "beamer" "docbook" "html" "latex" "odt")
>> | 
>> | 
>> | Documentation:
>> | Names of blocks where footnotes are not allowed.
>> | 
>> | [back]
>> `----
>> 
>> OP can search for for alternative ways to reference code block lines in
>> the following section of the manual
>> http://orgmode.org/org.html#Literal-examples
>> 
>> (Hint: Search for ref:jump)
>> 
>> 
>> Jambunathan K.
>> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-30 10:45 ` Nicolas Goaziou
@ 2011-07-30 14:34   ` Günter Kolousek
  2011-07-31 18:41   ` Achim Gratz
  1 sibling, 0 replies; 12+ messages in thread
From: Günter Kolousek @ 2011-07-30 14:34 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode


Thanks a lot!

Regards,
Günter

Am 2011-07-30 12:45, schrieb Nicolas Goaziou:
> Hello,
>
> Günter Kolousek<ko@htlwrn.ac.at>  writes:
>
>> Hi, using footnotes i.e. [2] inside #+begin_src #+end_src causes errors
>> during export using orgmode 7.7 and tip.
>
> This should be fixed now. Thank you for reporting this.
>
> _Note to self_ : I really wish we can come up with an exporter that
> exactly matches Org syntax. An element recognized/ignored in Org should
> be identically recognized/ignored during the export process without
> resorting to any trick (à la `org-protected' text property).
>
> Regards,
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-30 10:45 ` Nicolas Goaziou
  2011-07-30 14:34   ` Günter Kolousek
@ 2011-07-31 18:41   ` Achim Gratz
  2011-07-31 19:12     ` Jambunathan K
  2011-08-14 16:25     ` Bastien
  1 sibling, 2 replies; 12+ messages in thread
From: Achim Gratz @ 2011-07-31 18:41 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:
> _Note to self_ : I really wish we can come up with an exporter that
> exactly matches Org syntax. An element recognized/ignored in Org should
> be identically recognized/ignored during the export process without
> resorting to any trick (à la `org-protected' text property).

Your remark reminded me that I should look at the generic exporter in
contrib.  It needs an eval-while-compile wrapped (require 'cl) to
compile and run cleanly.  It also doesn't appear to recognize tables (or
those are still copies from the ASCII export?).  It looks like it works
line-by-line, which seems a somewhat questionable choice, but then it
was written for Org6.25…

I think it boils down to the question of having a formal org syntax.  If
that existed, all exporters (and much of the org core, I guess) could
work on the parse tree (some list structure with lists as elements and
the actual text as their leaf nodes) of the org document.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-31 18:41   ` Achim Gratz
@ 2011-07-31 19:12     ` Jambunathan K
  2011-08-14 16:29       ` Bastien
  2011-08-14 16:25     ` Bastien
  1 sibling, 1 reply; 12+ messages in thread
From: Jambunathan K @ 2011-07-31 19:12 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode


> Your remark reminded me that I should look at the generic exporter in
> contrib.  It needs an eval-while-compile wrapped (require 'cl) to
> compile and run cleanly.  It also doesn't appear to recognize tables (or
> those are still copies from the ASCII export?).  It looks like it works
> line-by-line, which seems a somewhat questionable choice, but then it
> was written for Org6.25…
>
> I think it boils down to the question of having a formal org syntax.  If
> that existed, all exporters (and much of the org core, I guess) could
> work on the parse tree (some list structure with lists as elements and
> the actual text as their leaf nodes) of the org document.

I also invite you to take a look at org-lparse and org-xhtml and org-odt
that are built on top of it.

With some very minimal hackery it is possible to export a document to
lisp-format.

You seem to be behind tables for quite some time. One of the most
significant re-write is in the callbacks for tables.

When it comes to export, most of the magic happens in the pre-processing
stage and not in the export backends itself.

>
> Regards,
> Achim.

-- 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-31 18:41   ` Achim Gratz
  2011-07-31 19:12     ` Jambunathan K
@ 2011-08-14 16:25     ` Bastien
  2011-08-14 16:54       ` Achim Gratz
  1 sibling, 1 reply; 12+ messages in thread
From: Bastien @ 2011-08-14 16:25 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Hi Achim,

Achim Gratz <Stromeko@nexgo.de> writes:

> Your remark reminded me that I should look at the generic exporter in
> contrib.  It needs an eval-while-compile wrapped (require 'cl) to
> compile and run cleanly.  It also doesn't appear to recognize tables (or
> those are still copies from the ASCII export?).  It looks like it works
> line-by-line, which seems a somewhat questionable choice, but then it
> was written for Org6.25…

I suggest you look at EXPERIMENTAL/org-export.el.

It parses an Org buffer and store it as a structured list.  It's not 
yet completely syntax aware, but it is a move in the right direction.

I'm willing to work on this now and will move forward.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-07-31 19:12     ` Jambunathan K
@ 2011-08-14 16:29       ` Bastien
  0 siblings, 0 replies; 12+ messages in thread
From: Bastien @ 2011-08-14 16:29 UTC (permalink / raw)
  To: Jambunathan K; +Cc: Achim Gratz, emacs-orgmode

Hi Jambunathan,

Jambunathan K <kjambunathan@gmail.com> writes:

> I also invite you to take a look at org-lparse and org-xhtml and org-odt
> that are built on top of it.

As far as I'm aware org-lparse also works line by line.  

I don't think this is the right direction for a generic exporter, but
maybe I overlooked some machinery in the files you mention.  If that's
the case, please point me to relevant part of the code!

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Bug: export failed when using footnotes inside src blocks [7.7]
  2011-08-14 16:25     ` Bastien
@ 2011-08-14 16:54       ` Achim Gratz
  0 siblings, 0 replies; 12+ messages in thread
From: Achim Gratz @ 2011-08-14 16:54 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@altern.org> writes:
> I suggest you look at EXPERIMENTAL/org-export.el.

I see.

> It parses an Org buffer and store it as a structured list.  It's not 
> yet completely syntax aware, but it is a move in the right direction.

That looks like a much cleaner approach, but it is as you say, quite in
its infancy.  It looks like you expect the export backends to deal with
the resulting structure by themselves.  I could see an alternative
approach using callbacks into the export backend or making the structure
itself executable and have the export backend provide the function
definitions.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-08-14 16:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-30  8:22 Bug: export failed when using footnotes inside src blocks [7.7] Günter Kolousek
2011-07-30  9:00 ` Nick Dokos
2011-07-30  9:19   ` Jambunathan K
2011-07-30  9:58     ` Nick Dokos
2011-07-30 10:53       ` Jambunathan K
2011-07-30 10:45 ` Nicolas Goaziou
2011-07-30 14:34   ` Günter Kolousek
2011-07-31 18:41   ` Achim Gratz
2011-07-31 19:12     ` Jambunathan K
2011-08-14 16:29       ` Bastien
2011-08-14 16:25     ` Bastien
2011-08-14 16:54       ` Achim Gratz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).