* [bug] in org-element cache (?)
@ 2014-07-16 15:01 Nicolas Berthier
2014-07-17 14:43 ` Nicolas Goaziou
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Berthier @ 2014-07-16 15:01 UTC (permalink / raw
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1340 bytes --]
Hello list,
I just hit a bug in org-element with the current development branch
(commit 9cf3c4e9712aba63be36eac7193e4ac85f491f8b), when exporting
a rather big Org file to LaTeX (HTML export works fine). It happens
during export, in function `org-element--cache-process-request', with
error "(wrong-type-argument number-or-marker-p nil)" (complete backtrace
attached).
I did not manage to obtain an ECM triggering this bug that I could
reasonably give here, so I dug into past commits: it turns out that it
seems to have been introduced by commit
093d455f7ff6ae8e2695f1fc8f149672700e9ac5 ("org-element: Better threshold
computation during synchronization"): reverting it on top of the current
master branch makes the bug disappear (yet this commit may not be the
root cause of the bug, of course).
FYI, on the org side, I did not experience the error as long as
I commented out one particular (among several occurrences of very
similar ones that did not trigger the bug) sequence of lines like the
following:
#+begin_src org
,#+name: foo
,#+header: :file (by-backend (latex "foo.tikz") (t "foo.png"))
,#+begin_src latex :results raw file
\begin{tikzpicture}
\node {Bla};
\end{tikzpicture}
,#+end_src
,#+caption: Foo
,#+attr_latex: :float t :width ""
,#+label: fig:foo
,#+results: foo
#+end_src
Regards,
[-- Attachment #2: backtrace --]
[-- Type: application/octet-stream, Size: 57826 bytes --]
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
+(nil -1706 -1047)
(let ((limit (+ (aref request 1) (aref request 3) extra))) (when (and threshold (< threshold limit)) (throw (quote interrupt) nil)) (let ((parent (org-element--parse-to limit t time-limit))) (aset request 5 parent) (aset request 6 2) (throw (quote end-phase) nil)))
(catch (quote end-phase) (when (equal (aref request 0) next) (throw (quote quit) t)) (let ((limit (+ (aref request 1) (aref request 3) extra))) (when (and threshold (< threshold limit)) (throw (quote interrupt) nil)) (let ((parent (org-element--parse-to limit t time-limit))) (aset request 5 parent) (aset request 6 2) (throw (quote end-phase) nil))))
(progn (catch (quote end-phase) (when (equal (aref request 0) next) (throw (quote quit) t)) (let ((limit (+ (aref request 1) (aref request 3) extra))) (when (and threshold (< threshold limit)) (throw (quote interrupt) nil)) (let ((parent (org-element--parse-to limit t time-limit))) (aset request 5 parent) (aset request 6 2) (throw (quote end-phase) nil)))))
(if (= (aref request 6) 1) (progn (catch (quote end-phase) (when (equal (aref request 0) next) (throw (quote quit) t)) (let ((limit (+ (aref request 1) (aref request 3) extra))) (when (and threshold (< threshold limit)) (throw (quote interrupt) nil)) (let ((parent (org-element--parse-to limit t time-limit))) (aset request 5 parent) (aset request 6 2) (throw (quote end-phase) nil))))))
(when (= (aref request 6) 1) (catch (quote end-phase) (when (equal (aref request 0) next) (throw (quote quit) t)) (let ((limit (+ (aref request 1) (aref request 3) extra))) (when (and threshold (< threshold limit)) (throw (quote interrupt) nil)) (let ((parent (org-element--parse-to limit t time-limit))) (aset request 5 parent) (aset request 6 2) (throw (quote end-phase) nil)))))
(catch (quote quit) (when (= (aref request 6) 0) (catch (quote end-phase) (let ((beg (aref request 0)) (end (aref request 2)) (outreach (aref request 4))) (while t (when (org-element--cache-interrupt-p time-limit) (throw (quote interrupt) nil)) (let ((node ...) data data-key) (while node (let* ... ...)) (if data (let ... ...) (throw ... t))))))) (when (= (aref request 6) 1) (catch (quote end-phase) (when (equal (aref request 0) next) (throw (quote quit) t)) (let ((limit (+ (aref request 1) (aref request 3) extra))) (when (and threshold (< threshold limit)) (throw (quote interrupt) nil)) (let ((parent (org-element--parse-to limit t time-limit))) (aset request 5 parent) (aset request 6 2) (throw (quote end-phase) nil))))) (let ((start (aref request 0)) (offset (aref request 3)) (parent (aref request 5)) (node (org-element--cache-root)) (stack (list nil)) (leftp t) exit-flag) (when (and (not parent) (zerop offset)) (throw (quote quit) t)) (while node (let* ((data (avl-tree--node-data node)) (key (org-element--cache-key data))) (if (and leftp (avl-tree--node-left node) (not (org-element--cache-key-less-p key start))) (progn (push node stack) (setq node (avl-tree--node-left node))) (unless (org-element--cache-key-less-p key start) (when (equal key next) (throw ... t)) (when (or exit-flag ...) (aset request 0 key) (aset request 5 parent) (throw ... nil)) (unless (zerop offset) (org-element--cache-shift-positions data offset) (dolist ... ...)) (let (...) (while ... ...) (cond ... ...) (when ... ...))) (setq node (if (setq leftp ...) (avl-tree--node-right node) (pop stack)))))) t))
org-element--cache-process-request([18434 nil 16625 -1706 nil nil 1] nil 16550 nil -1047)
(while org-element--cache-sync-requests (setq request (car org-element--cache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-element--cache-process-request request (and next (aref next 0)) threshold (and (not threshold) (time-add (current-time) org-element-cache-sync-duration)) (or extra 0)) (when next (incf (aref next 3) (aref request 3)) (aset next 2 (aref request 2)) (aset next 6 (aref request 6))) (setq org-element--cache-sync-requests (cdr org-element--cache-sync-requests)))
(catch (quote interrupt) (while org-element--cache-sync-requests (setq request (car org-element--cache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-element--cache-process-request request (and next (aref next 0)) threshold (and (not threshold) (time-add (current-time) org-element-cache-sync-duration)) (or extra 0)) (when next (incf (aref next 3) (aref request 3)) (aset next 2 (aref request 2)) (aset next 6 (aref request 6))) (setq org-element--cache-sync-requests (cdr org-element--cache-sync-requests))))
(let ((inhibit-quit t) request next) (when org-element--cache-sync-timer (cancel-timer org-element--cache-sync-timer)) (catch (quote interrupt) (while org-element--cache-sync-requests (setq request (car org-element--cache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-element--cache-process-request request (and next (aref next 0)) threshold (and (not threshold) (time-add (current-time) org-element-cache-sync-duration)) (or extra 0)) (when next (incf (aref next 3) (aref request 3)) (aset next 2 (aref request 2)) (aset next 6 (aref request 6))) (setq org-element--cache-sync-requests (cdr org-element--cache-sync-requests)))) (if org-element--cache-sync-requests (org-element--cache-set-timer buffer) (clrhash org-element--cache-sync-keys)))
(save-current-buffer (set-buffer buffer) (let ((inhibit-quit t) request next) (when org-element--cache-sync-timer (cancel-timer org-element--cache-sync-timer)) (catch (quote interrupt) (while org-element--cache-sync-requests (setq request (car org-element--cache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-element--cache-process-request request (and next (aref next 0)) threshold (and (not threshold) (time-add (current-time) org-element-cache-sync-duration)) (or extra 0)) (when next (incf (aref next 3) (aref request 3)) (aset next 2 (aref request 2)) (aset next 6 (aref request 6))) (setq org-element--cache-sync-requests (cdr org-element--cache-sync-requests)))) (if org-element--cache-sync-requests (org-element--cache-set-timer buffer) (clrhash org-element--cache-sync-keys))))
(with-current-buffer buffer (let ((inhibit-quit t) request next) (when org-element--cache-sync-timer (cancel-timer org-element--cache-sync-timer)) (catch (quote interrupt) (while org-element--cache-sync-requests (setq request (car org-element--cache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-element--cache-process-request request (and next (aref next 0)) threshold (and (not threshold) (time-add (current-time) org-element-cache-sync-duration)) (or extra 0)) (when next (incf (aref next 3) (aref request 3)) (aset next 2 (aref request 2)) (aset next 6 (aref request 6))) (setq org-element--cache-sync-requests (cdr org-element--cache-sync-requests)))) (if org-element--cache-sync-requests (org-element--cache-set-timer buffer) (clrhash org-element--cache-sync-keys))))
(progn (with-current-buffer buffer (let ((inhibit-quit t) request next) (when org-element--cache-sync-timer (cancel-timer org-element--cache-sync-timer)) (catch (quote interrupt) (while org-element--cache-sync-requests (setq request (car org-element--cache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-element--cache-process-request request (and next (aref next 0)) threshold (and (not threshold) (time-add ... org-element-cache-sync-duration)) (or extra 0)) (when next (incf (aref next 3) (aref request 3)) (aset next 2 (aref request 2)) (aset next 6 (aref request 6))) (setq org-element--cache-sync-requests (cdr org-element--cache-sync-requests)))) (if org-element--cache-sync-requests (org-element--cache-set-timer buffer) (clrhash org-element--cache-sync-keys)))))
(if (buffer-live-p buffer) (progn (with-current-buffer buffer (let ((inhibit-quit t) request next) (when org-element--cache-sync-timer (cancel-timer org-element--cache-sync-timer)) (catch (quote interrupt) (while org-element--cache-sync-requests (setq request (car org-element--cache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-element--cache-process-request request (and next ...) threshold (and ... ...) (or extra 0)) (when next (incf ... ...) (aset next 2 ...) (aset next 6 ...)) (setq org-element--cache-sync-requests (cdr org-element--cache-sync-requests)))) (if org-element--cache-sync-requests (org-element--cache-set-timer buffer) (clrhash org-element--cache-sync-keys))))))
(when (buffer-live-p buffer) (with-current-buffer buffer (let ((inhibit-quit t) request next) (when org-element--cache-sync-timer (cancel-timer org-element--cache-sync-timer)) (catch (quote interrupt) (while org-element--cache-sync-requests (setq request (car org-element--cache-sync-requests) next (nth 1 org-element--cache-sync-requests)) (org-element--cache-process-request request (and next (aref next 0)) threshold (and (not threshold) (time-add ... org-element-cache-sync-duration)) (or extra 0)) (when next (incf (aref next 3) (aref request 3)) (aset next 2 (aref request 2)) (aset next 6 (aref request 6))) (setq org-element--cache-sync-requests (cdr org-element--cache-sync-requests)))) (if org-element--cache-sync-requests (org-element--cache-set-timer buffer) (clrhash org-element--cache-sync-keys)))))
org-element--cache-sync(#<buffer user-manual.org<2>> 16550 -1047)
(progn (org-element--cache-sync (current-buffer) end offset))
(if next (progn (org-element--cache-sync (current-buffer) end offset)))
(when next (org-element--cache-sync (current-buffer) end offset))
(if (and next (zerop (aref next 6)) (> (setq delete-to (+ (aref next 2) (aref next 3))) end) (<= (setq delete-from (aref next 1)) end)) (progn (incf (aref next 3) offset) (if (> beg delete-from) (let ((up (aref next 5))) (while up (org-element--cache-shift-positions up offset (quote (:contents-end :end))) (setq up (org-element-property :parent up)))) (let ((first (org-element--cache-for-removal beg delete-to offset))) (when first (aset next 0 (org-element--cache-key first)) (aset next 1 (org-element-property :begin first)) (aset next 5 (org-element-property :parent first)))))) (when next (org-element--cache-sync (current-buffer) end offset)) (let ((first (org-element--cache-for-removal beg end offset))) (if first (push (let ((beg (org-element-property :begin first)) (key (org-element--cache-key first))) (cond ((> beg end) (vector key nil nil offset nil nil 2)) ((let ... ...)) (t (let* ... ... ...)))) org-element--cache-sync-requests) (when org-element--cache-sync-requests (incf (aref (car org-element--cache-sync-requests) 3) offset)))))
(let ((next (car org-element--cache-sync-requests)) delete-to delete-from) (if (and next (zerop (aref next 6)) (> (setq delete-to (+ (aref next 2) (aref next 3))) end) (<= (setq delete-from (aref next 1)) end)) (progn (incf (aref next 3) offset) (if (> beg delete-from) (let ((up (aref next 5))) (while up (org-element--cache-shift-positions up offset (quote ...)) (setq up (org-element-property :parent up)))) (let ((first (org-element--cache-for-removal beg delete-to offset))) (when first (aset next 0 (org-element--cache-key first)) (aset next 1 (org-element-property :begin first)) (aset next 5 (org-element-property :parent first)))))) (when next (org-element--cache-sync (current-buffer) end offset)) (let ((first (org-element--cache-for-removal beg end offset))) (if first (push (let ((beg ...) (key ...)) (cond (... ...) (...) (t ...))) org-element--cache-sync-requests) (when org-element--cache-sync-requests (incf (aref (car org-element--cache-sync-requests) 3) offset))))))
org-element--cache-submit-request(15435 16550 -1047)
(let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset))
(let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not (and (org-with-limited-levels (org-at-heading-p)) (= (line-end-position) bottom)))) (otherwise (let ((case-fold-search t)) (re-search-forward org-element--cache-sensitive-re bottom t)))) (org-with-limited-levels (setq top (progn (goto-char top) (when (outline-previous-heading) (forward-line)) (point))) (setq bottom (progn (goto-char bottom) (if (outline-next-heading) (1- (point)) (point)))))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset)))
(progn (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not (and (org-with-limited-levels ...) (= ... bottom)))) (otherwise (let ((case-fold-search t)) (re-search-forward org-element--cache-sensitive-re bottom t)))) (org-with-limited-levels (setq top (progn (goto-char top) (when (outline-previous-heading) (forward-line)) (point))) (setq bottom (progn (goto-char bottom) (if (outline-next-heading) (1- ...) (point)))))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset))))
(unwind-protect (progn (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not (and ... ...))) (otherwise (let (...) (re-search-forward org-element--cache-sensitive-re bottom t)))) (org-with-limited-levels (setq top (progn (goto-char top) (when ... ...) (point))) (setq bottom (progn (goto-char bottom) (if ... ... ...))))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset)))) (set-match-data save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal (match-data))) (unwind-protect (progn (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not ...)) (otherwise (let ... ...))) (org-with-limited-levels (setq top (progn ... ... ...)) (setq bottom (progn ... ...)))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset)))) (set-match-data save-match-data-internal (quote evaporate))))
(save-match-data (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not (and (org-with-limited-levels ...) (= ... bottom)))) (otherwise (let ((case-fold-search t)) (re-search-forward org-element--cache-sensitive-re bottom t)))) (org-with-limited-levels (setq top (progn (goto-char top) (when (outline-previous-heading) (forward-line)) (point))) (setq bottom (progn (goto-char bottom) (if (outline-next-heading) (1- ...) (point)))))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset))))
(save-restriction (widen) (goto-char beg) (beginning-of-line) (save-match-data (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not (and ... ...))) (otherwise (let (...) (re-search-forward org-element--cache-sensitive-re bottom t)))) (org-with-limited-levels (setq top (progn (goto-char top) (when ... ...) (point))) (setq bottom (progn (goto-char bottom) (if ... ... ...))))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset)))))
(save-excursion (save-restriction (widen) (goto-char beg) (beginning-of-line) (save-match-data (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not ...)) (otherwise (let ... ...))) (org-with-limited-levels (setq top (progn ... ... ...)) (setq bottom (progn ... ...)))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset))))))
(org-with-wide-buffer (goto-char beg) (beginning-of-line) (save-match-data (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not (and ... ...))) (otherwise (let (...) (re-search-forward org-element--cache-sensitive-re bottom t)))) (org-with-limited-levels (setq top (progn (goto-char top) (when ... ...) (point))) (setq bottom (progn (goto-char bottom) (if ... ... ...))))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset)))))
(progn (org-with-wide-buffer (goto-char beg) (beginning-of-line) (save-match-data (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not ...)) (otherwise (let ... ...))) (org-with-limited-levels (setq top (progn ... ... ...)) (setq bottom (progn ... ...)))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset))))) (org-element--cache-set-timer (current-buffer)))
(if (org-element--cache-active-p) (progn (org-with-wide-buffer (goto-char beg) (beginning-of-line) (save-match-data (let ((top (point)) (bottom (save-excursion ... ...))) (when (case org-element--cache-change-warning (... t) (headline ...) (otherwise ...)) (org-with-limited-levels (setq top ...) (setq bottom ...))) (let ((offset ...)) (org-element--cache-submit-request top (- bottom offset) offset))))) (org-element--cache-set-timer (current-buffer))))
(when (org-element--cache-active-p) (org-with-wide-buffer (goto-char beg) (beginning-of-line) (save-match-data (let ((top (point)) (bottom (save-excursion (goto-char end) (line-end-position)))) (when (case org-element--cache-change-warning ((t) t) (headline (not ...)) (otherwise (let ... ...))) (org-with-limited-levels (setq top (progn ... ... ...)) (setq bottom (progn ... ...)))) (let ((offset (- end beg pre))) (org-element--cache-submit-request top (- bottom offset) offset))))) (org-element--cache-set-timer (current-buffer)))
org-element--cache-after-change(15435 15435 1047)
delete-region(#<marker at 15435 in user-manual.org<2>> 16482)
(cond ((not replacement) (goto-char end)) ((equal replacement "") (goto-char end) (skip-chars-forward " \r \n") (beginning-of-line) (delete-region begin (point))) (t (goto-char match-start) (delete-region (point) (save-excursion (goto-char end) (line-end-position))) (insert replacement) (if (or org-src-preserve-indentation (org-element-property :preserve-indent element)) (save-excursion (skip-chars-backward " \r \n") (indent-line-to ind) (goto-char match-start) (indent-line-to ind)) (indent-rigidly match-start (point) ind))))
(let ((replacement (progn (goto-char match-start) (org-babel-exp-src-block headers)))) (cond ((not replacement) (goto-char end)) ((equal replacement "") (goto-char end) (skip-chars-forward " \r \n") (beginning-of-line) (delete-region begin (point))) (t (goto-char match-start) (delete-region (point) (save-excursion (goto-char end) (line-end-position))) (insert replacement) (if (or org-src-preserve-indentation (org-element-property :preserve-indent element)) (save-excursion (skip-chars-backward " \r \n") (indent-line-to ind) (goto-char match-start) (indent-line-to ind)) (indent-rigidly match-start (point) ind)))))
(let* ((match-start (copy-marker (match-beginning 0))) (ind (org-get-indentation)) (headers (cons (org-element-property :language element) (let ((params (org-element-property :parameters element))) (and params (org-split-string params "[ ]+")))))) (let ((replacement (progn (goto-char match-start) (org-babel-exp-src-block headers)))) (cond ((not replacement) (goto-char end)) ((equal replacement "") (goto-char end) (skip-chars-forward " \r \n") (beginning-of-line) (delete-region begin (point))) (t (goto-char match-start) (delete-region (point) (save-excursion (goto-char end) (line-end-position))) (insert replacement) (if (or org-src-preserve-indentation (org-element-property :preserve-indent element)) (save-excursion (skip-chars-backward " \r \n") (indent-line-to ind) (goto-char match-start) (indent-line-to ind)) (indent-rigidly match-start (point) ind))))) (set-marker match-start nil))
(cond ((eql type (quote inline-src-block)) (let* ((head (match-beginning 0)) (info (append (org-babel-parse-inline-src-block-match) (list nil nil head))) (params (nth 2 info))) (setf (nth 1 info) (if (and (cdr (assoc :noweb params)) (string= "yes" (cdr ...))) (org-babel-expand-noweb-references info org-babel-exp-reference-buffer) (nth 1 info))) (goto-char begin) (let ((replacement (org-babel-exp-do-export info (quote inline)))) (if (equal replacement "") (delete-region begin (progn (goto-char end) (skip-chars-forward " ") (point))) (delete-region begin end) (insert replacement))))) ((member* type (quote (babel-call inline-babel-call))) (let* ((lob-info (org-babel-lob-get-info)) (results (org-babel-exp-do-export (list "emacs-lisp" "results" (apply ... org-babel-default-header-args org-babel-default-lob-header-args ...) "" (nth 3 lob-info) (nth 2 lob-info)) (quote lob))) (rep (org-fill-template org-babel-exp-call-line-template (\` (...))))) (if (equal rep "") (delete-region begin (progn (goto-char end) (if (not ...) (progn ... ...) (skip-chars-forward " \r \n") (line-beginning-position)))) (goto-char begin) (delete-region begin end) (insert rep)))) ((eql type (quote src-block)) (let* ((match-start (copy-marker (match-beginning 0))) (ind (org-get-indentation)) (headers (cons (org-element-property :language element) (let (...) (and params ...))))) (let ((replacement (progn (goto-char match-start) (org-babel-exp-src-block headers)))) (cond ((not replacement) (goto-char end)) ((equal replacement "") (goto-char end) (skip-chars-forward " \r \n") (beginning-of-line) (delete-region begin (point))) (t (goto-char match-start) (delete-region (point) (save-excursion ... ...)) (insert replacement) (if (or org-src-preserve-indentation ...) (save-excursion ... ... ... ...) (indent-rigidly match-start ... ind))))) (set-marker match-start nil))))
(case type (inline-src-block (let* ((head (match-beginning 0)) (info (append (org-babel-parse-inline-src-block-match) (list nil nil head))) (params (nth 2 info))) (setf (nth 1 info) (if (and (cdr (assoc :noweb params)) (string= "yes" (cdr ...))) (org-babel-expand-noweb-references info org-babel-exp-reference-buffer) (nth 1 info))) (goto-char begin) (let ((replacement (org-babel-exp-do-export info (quote inline)))) (if (equal replacement "") (delete-region begin (progn (goto-char end) (skip-chars-forward " ") (point))) (delete-region begin end) (insert replacement))))) ((babel-call inline-babel-call) (let* ((lob-info (org-babel-lob-get-info)) (results (org-babel-exp-do-export (list "emacs-lisp" "results" (apply ... org-babel-default-header-args org-babel-default-lob-header-args ...) "" (nth 3 lob-info) (nth 2 lob-info)) (quote lob))) (rep (org-fill-template org-babel-exp-call-line-template (\` (...))))) (if (equal rep "") (delete-region begin (progn (goto-char end) (if (not ...) (progn ... ...) (skip-chars-forward " \r \n") (line-beginning-position)))) (goto-char begin) (delete-region begin end) (insert rep)))) (src-block (let* ((match-start (copy-marker (match-beginning 0))) (ind (org-get-indentation)) (headers (cons (org-element-property :language element) (let (...) (and params ...))))) (let ((replacement (progn (goto-char match-start) (org-babel-exp-src-block headers)))) (cond ((not replacement) (goto-char end)) ((equal replacement "") (goto-char end) (skip-chars-forward " \r \n") (beginning-of-line) (delete-region begin (point))) (t (goto-char match-start) (delete-region (point) (save-excursion ... ...)) (insert replacement) (if (or org-src-preserve-indentation ...) (save-excursion ... ... ... ...) (indent-rigidly match-start ... ind))))) (set-marker match-start nil))))
(let* ((element (save-excursion (backward-char) (save-match-data (org-element-context)))) (type (org-element-type element)) (begin (copy-marker (org-element-property :begin element))) (end (copy-marker (save-excursion (goto-char (org-element-property :end element)) (skip-chars-backward " \r \n") (point))))) (case type (inline-src-block (let* ((head (match-beginning 0)) (info (append (org-babel-parse-inline-src-block-match) (list nil nil head))) (params (nth 2 info))) (setf (nth 1 info) (if (and (cdr ...) (string= "yes" ...)) (org-babel-expand-noweb-references info org-babel-exp-reference-buffer) (nth 1 info))) (goto-char begin) (let ((replacement (org-babel-exp-do-export info ...))) (if (equal replacement "") (delete-region begin (progn ... ... ...)) (delete-region begin end) (insert replacement))))) ((babel-call inline-babel-call) (let* ((lob-info (org-babel-lob-get-info)) (results (org-babel-exp-do-export (list "emacs-lisp" "results" ... "" ... ...) (quote lob))) (rep (org-fill-template org-babel-exp-call-line-template (\` ...)))) (if (equal rep "") (delete-region begin (progn (goto-char end) (if ... ... ... ...))) (goto-char begin) (delete-region begin end) (insert rep)))) (src-block (let* ((match-start (copy-marker (match-beginning 0))) (ind (org-get-indentation)) (headers (cons (org-element-property :language element) (let ... ...)))) (let ((replacement (progn ... ...))) (cond ((not replacement) (goto-char end)) ((equal replacement "") (goto-char end) (skip-chars-forward " \r \n") (beginning-of-line) (delete-region begin ...)) (t (goto-char match-start) (delete-region ... ...) (insert replacement) (if ... ... ...)))) (set-marker match-start nil)))) (set-marker begin nil) (set-marker end nil))
(if (save-match-data (org-in-commented-heading-p)) nil (let* ((element (save-excursion (backward-char) (save-match-data (org-element-context)))) (type (org-element-type element)) (begin (copy-marker (org-element-property :begin element))) (end (copy-marker (save-excursion (goto-char (org-element-property :end element)) (skip-chars-backward " \r \n") (point))))) (case type (inline-src-block (let* ((head (match-beginning 0)) (info (append ... ...)) (params (nth 2 info))) (setf (nth 1 info) (if (and ... ...) (org-babel-expand-noweb-references info org-babel-exp-reference-buffer) (nth 1 info))) (goto-char begin) (let ((replacement ...)) (if (equal replacement "") (delete-region begin ...) (delete-region begin end) (insert replacement))))) ((babel-call inline-babel-call) (let* ((lob-info (org-babel-lob-get-info)) (results (org-babel-exp-do-export ... ...)) (rep (org-fill-template org-babel-exp-call-line-template ...))) (if (equal rep "") (delete-region begin (progn ... ...)) (goto-char begin) (delete-region begin end) (insert rep)))) (src-block (let* ((match-start (copy-marker ...)) (ind (org-get-indentation)) (headers (cons ... ...))) (let ((replacement ...)) (cond (... ...) (... ... ... ... ...) (t ... ... ... ...))) (set-marker match-start nil)))) (set-marker begin nil) (set-marker end nil)))
(unless (save-match-data (org-in-commented-heading-p)) (let* ((element (save-excursion (backward-char) (save-match-data (org-element-context)))) (type (org-element-type element)) (begin (copy-marker (org-element-property :begin element))) (end (copy-marker (save-excursion (goto-char (org-element-property :end element)) (skip-chars-backward " \r \n") (point))))) (case type (inline-src-block (let* ((head (match-beginning 0)) (info (append ... ...)) (params (nth 2 info))) (setf (nth 1 info) (if (and ... ...) (org-babel-expand-noweb-references info org-babel-exp-reference-buffer) (nth 1 info))) (goto-char begin) (let ((replacement ...)) (if (equal replacement "") (delete-region begin ...) (delete-region begin end) (insert replacement))))) ((babel-call inline-babel-call) (let* ((lob-info (org-babel-lob-get-info)) (results (org-babel-exp-do-export ... ...)) (rep (org-fill-template org-babel-exp-call-line-template ...))) (if (equal rep "") (delete-region begin (progn ... ...)) (goto-char begin) (delete-region begin end) (insert rep)))) (src-block (let* ((match-start (copy-marker ...)) (ind (org-get-indentation)) (headers (cons ... ...))) (let ((replacement ...)) (cond (... ...) (... ... ... ... ...) (t ... ... ... ...))) (set-marker match-start nil)))) (set-marker begin nil) (set-marker end nil)))
(while (re-search-forward regexp nil t) (unless (save-match-data (org-in-commented-heading-p)) (let* ((element (save-excursion (backward-char) (save-match-data (org-element-context)))) (type (org-element-type element)) (begin (copy-marker (org-element-property :begin element))) (end (copy-marker (save-excursion (goto-char ...) (skip-chars-backward " \r \n") (point))))) (case type (inline-src-block (let* ((head ...) (info ...) (params ...)) (setf (nth 1 info) (if ... ... ...)) (goto-char begin) (let (...) (if ... ... ... ...)))) ((babel-call inline-babel-call) (let* ((lob-info ...) (results ...) (rep ...)) (if (equal rep "") (delete-region begin ...) (goto-char begin) (delete-region begin end) (insert rep)))) (src-block (let* ((match-start ...) (ind ...) (headers ...)) (let (...) (cond ... ... ...)) (set-marker match-start nil)))) (set-marker begin nil) (set-marker end nil))))
(let ((case-fold-search t) (org-babel-exp-reference-buffer reference-buffer) (regexp (concat org-babel-inline-src-block-regexp "\\|" org-babel-lob-one-liner-regexp "\\|" "^[ ]*#\\+BEGIN_SRC"))) (goto-char (point-min)) (while (re-search-forward regexp nil t) (unless (save-match-data (org-in-commented-heading-p)) (let* ((element (save-excursion (backward-char) (save-match-data ...))) (type (org-element-type element)) (begin (copy-marker (org-element-property :begin element))) (end (copy-marker (save-excursion ... ... ...)))) (case type (inline-src-block (let* (... ... ...) (setf ... ...) (goto-char begin) (let ... ...))) ((babel-call inline-babel-call) (let* (... ... ...) (if ... ... ... ... ...))) (src-block (let* (... ... ...) (let ... ...) (set-marker match-start nil)))) (set-marker begin nil) (set-marker end nil)))))
(save-excursion (let ((case-fold-search t) (org-babel-exp-reference-buffer reference-buffer) (regexp (concat org-babel-inline-src-block-regexp "\\|" org-babel-lob-one-liner-regexp "\\|" "^[ ]*#\\+BEGIN_SRC"))) (goto-char (point-min)) (while (re-search-forward regexp nil t) (unless (save-match-data (org-in-commented-heading-p)) (let* ((element (save-excursion ... ...)) (type (org-element-type element)) (begin (copy-marker ...)) (end (copy-marker ...))) (case type (inline-src-block (let* ... ... ... ...)) ((babel-call inline-babel-call) (let* ... ...)) (src-block (let* ... ... ...))) (set-marker begin nil) (set-marker end nil))))))
(progn (save-excursion (let ((case-fold-search t) (org-babel-exp-reference-buffer reference-buffer) (regexp (concat org-babel-inline-src-block-regexp "\\|" org-babel-lob-one-liner-regexp "\\|" "^[ ]*#\\+BEGIN_SRC"))) (goto-char (point-min)) (while (re-search-forward regexp nil t) (unless (save-match-data (org-in-commented-heading-p)) (let* ((element ...) (type ...) (begin ...) (end ...)) (case type (inline-src-block ...) (... ...) (src-block ...)) (set-marker begin nil) (set-marker end nil)))))))
(unwind-protect (progn (save-excursion (let ((case-fold-search t) (org-babel-exp-reference-buffer reference-buffer) (regexp (concat org-babel-inline-src-block-regexp "\\|" org-babel-lob-one-liner-regexp "\\|" "^[ ]*#\\+BEGIN_SRC"))) (goto-char (point-min)) (while (re-search-forward regexp nil t) (unless (save-match-data (org-in-commented-heading-p)) (let* (... ... ... ...) (case type ... ... ...) (set-marker begin nil) (set-marker end nil))))))) (set-window-configuration wconfig))
(let ((wconfig (current-window-configuration))) (unwind-protect (progn (save-excursion (let ((case-fold-search t) (org-babel-exp-reference-buffer reference-buffer) (regexp (concat org-babel-inline-src-block-regexp "\\|" org-babel-lob-one-liner-regexp "\\|" "^[ ]*#\\+BEGIN_SRC"))) (goto-char (point-min)) (while (re-search-forward regexp nil t) (unless (save-match-data ...) (let* ... ... ... ...)))))) (set-window-configuration wconfig)))
(save-window-excursion (save-excursion (let ((case-fold-search t) (org-babel-exp-reference-buffer reference-buffer) (regexp (concat org-babel-inline-src-block-regexp "\\|" org-babel-lob-one-liner-regexp "\\|" "^[ ]*#\\+BEGIN_SRC"))) (goto-char (point-min)) (while (re-search-forward regexp nil t) (unless (save-match-data (org-in-commented-heading-p)) (let* ((element ...) (type ...) (begin ...) (end ...)) (case type (inline-src-block ...) (... ...) (src-block ...)) (set-marker begin nil) (set-marker end nil)))))))
org-babel-exp-process-buffer(#<buffer user-manual.org<2><2>>)
(unwind-protect (org-babel-exp-process-buffer reference) (kill-buffer reference))
(let ((reference (org-export-copy-buffer))) (unwind-protect (org-babel-exp-process-buffer reference) (kill-buffer reference)))
org-export-execute-babel-code()
(progn (run-hook-with-args (quote org-export-before-processing-hook) (org-export-backend-name backend)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (org-export-backend-name backend))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (unless (plist-get info :title) (plist-put info :title (let ((file (plist-get info :input-file))) (if file (file-name-sans-extension (file-name-nondirectory file)) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title))))) (setq tree (org-element-parse-buffer nil visible-only)) (org-export-remove-uninterpreted-data tree info) (let ((backend-name (org-export-backend-name backend))) (dolist (filter (plist-get info :filter-options)) (let ((result (funcall filter info backend-name))) (when result (setq info result))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or (org-export-data tree info) ""))) (inner-template (cdr (assq (quote inner-template) (plist-get info :translate-alist)))) (full-body (if (not (functionp inner-template)) body (funcall inner-template body info))) (template (cdr (assq (quote template) (plist-get info :translate-alist))))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not (functionp template)) body-only) full-body (funcall template full-body info)) info))))
(save-current-buffer (set-buffer --buf-copy) (goto-char (point-min)) (progn (run-hook-with-args (quote org-export-before-processing-hook) (org-export-backend-name backend)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (org-export-backend-name backend))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (unless (plist-get info :title) (plist-put info :title (let ((file (plist-get info :input-file))) (if file (file-name-sans-extension (file-name-nondirectory file)) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title))))) (setq tree (org-element-parse-buffer nil visible-only)) (org-export-remove-uninterpreted-data tree info) (let ((backend-name (org-export-backend-name backend))) (dolist (filter (plist-get info :filter-options)) (let ((result (funcall filter info backend-name))) (when result (setq info result))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or (org-export-data tree info) ""))) (inner-template (cdr (assq (quote inner-template) (plist-get info :translate-alist)))) (full-body (if (not (functionp inner-template)) body (funcall inner-template body info))) (template (cdr (assq (quote template) (plist-get info :translate-alist))))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not ...) body-only) full-body (funcall template full-body info)) info)))))
(with-current-buffer --buf-copy (goto-char (point-min)) (progn (run-hook-with-args (quote org-export-before-processing-hook) (org-export-backend-name backend)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (org-export-backend-name backend))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (unless (plist-get info :title) (plist-put info :title (let ((file (plist-get info :input-file))) (if file (file-name-sans-extension (file-name-nondirectory file)) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title))))) (setq tree (org-element-parse-buffer nil visible-only)) (org-export-remove-uninterpreted-data tree info) (let ((backend-name (org-export-backend-name backend))) (dolist (filter (plist-get info :filter-options)) (let ((result (funcall filter info backend-name))) (when result (setq info result))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or (org-export-data tree info) ""))) (inner-template (cdr (assq (quote inner-template) (plist-get info :translate-alist)))) (full-body (if (not (functionp inner-template)) body (funcall inner-template body info))) (template (cdr (assq (quote template) (plist-get info :translate-alist))))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not ...) body-only) full-body (funcall template full-body info)) info)))))
(unwind-protect (with-current-buffer --buf-copy (goto-char (point-min)) (progn (run-hook-with-args (quote org-export-before-processing-hook) (org-export-backend-name backend)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (org-export-backend-name backend))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (unless (plist-get info :title) (plist-put info :title (let ((file ...)) (if file (file-name-sans-extension ...) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title))))) (setq tree (org-element-parse-buffer nil visible-only)) (org-export-remove-uninterpreted-data tree info) (let ((backend-name (org-export-backend-name backend))) (dolist (filter (plist-get info :filter-options)) (let ((result ...)) (when result (setq info result))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or ... ""))) (inner-template (cdr (assq ... ...))) (full-body (if (not ...) body (funcall inner-template body info))) (template (cdr (assq ... ...)))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or ... body-only) full-body (funcall template full-body info)) info))))) (and (buffer-live-p --buf-copy) (progn (with-current-buffer --buf-copy (restore-buffer-modified-p nil)) (kill-buffer --buf-copy))))
(let ((--buf-copy (org-export-copy-buffer))) (unwind-protect (with-current-buffer --buf-copy (goto-char (point-min)) (progn (run-hook-with-args (quote org-export-before-processing-hook) (org-export-backend-name backend)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (org-export-backend-name backend))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (unless (plist-get info :title) (plist-put info :title (let (...) (if file ... ...)))) (org-macro-replace-all (list (cons "author" (org-element-interpret-data ...)) (cons "date" (org-element-interpret-data ...)) (cons "email" (or ... "")) (cons "title" (org-element-interpret-data ...)))) (setq tree (org-element-parse-buffer nil visible-only)) (org-export-remove-uninterpreted-data tree info) (let ((backend-name (org-export-backend-name backend))) (dolist (filter (plist-get info :filter-options)) (let (...) (when result ...)))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string ...)) (inner-template (cdr ...)) (full-body (if ... body ...)) (template (cdr ...))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if ... full-body ...) info))))) (and (buffer-live-p --buf-copy) (progn (with-current-buffer --buf-copy (restore-buffer-modified-p nil)) (kill-buffer --buf-copy)))))
(org-export-with-buffer-copy (run-hook-with-args (quote org-export-before-processing-hook) (org-export-backend-name backend)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (org-export-backend-name backend))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (unless (plist-get info :title) (plist-put info :title (let ((file (plist-get info :input-file))) (if file (file-name-sans-extension (file-name-nondirectory file)) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title))))) (setq tree (org-element-parse-buffer nil visible-only)) (org-export-remove-uninterpreted-data tree info) (let ((backend-name (org-export-backend-name backend))) (dolist (filter (plist-get info :filter-options)) (let ((result (funcall filter info backend-name))) (when result (setq info result))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or (org-export-data tree info) ""))) (inner-template (cdr (assq (quote inner-template) (plist-get info :translate-alist)))) (full-body (if (not (functionp inner-template)) body (funcall inner-template body info))) (template (cdr (assq (quote template) (plist-get info :translate-alist))))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not (functionp template)) body-only) full-body (funcall template full-body info)) info))))
(let* ((org-export-current-backend (org-export-backend-name backend)) (info (org-combine-plists (list :export-options (delq nil (list (and subtreep ...) (and visible-only ...) (and body-only ...)))) (org-export--get-buffer-attributes))) tree) (org-export-with-buffer-copy (run-hook-with-args (quote org-export-before-processing-hook) (org-export-backend-name backend)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (org-export-backend-name backend))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (unless (plist-get info :title) (plist-put info :title (let ((file (plist-get info :input-file))) (if file (file-name-sans-extension (file-name-nondirectory file)) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title))))) (setq tree (org-element-parse-buffer nil visible-only)) (org-export-remove-uninterpreted-data tree info) (let ((backend-name (org-export-backend-name backend))) (dolist (filter (plist-get info :filter-options)) (let ((result (funcall filter info backend-name))) (when result (setq info result))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or (org-export-data tree info) ""))) (inner-template (cdr (assq (quote inner-template) (plist-get info :translate-alist)))) (full-body (if (not (functionp inner-template)) body (funcall inner-template body info))) (template (cdr (assq (quote template) (plist-get info :translate-alist))))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not ...) body-only) full-body (funcall template full-body info)) info)))))
(save-restriction (cond ((org-region-active-p) (narrow-to-region (region-beginning) (region-end))) (subtreep (org-narrow-to-subtree) (goto-char (point-min)) (forward-line) (narrow-to-region (point) (point-max)))) (let* ((org-export-current-backend (org-export-backend-name backend)) (info (org-combine-plists (list :export-options (delq nil (list ... ... ...))) (org-export--get-buffer-attributes))) tree) (org-export-with-buffer-copy (run-hook-with-args (quote org-export-before-processing-hook) (org-export-backend-name backend)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (org-export-backend-name backend))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (unless (plist-get info :title) (plist-put info :title (let ((file ...)) (if file (file-name-sans-extension ...) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title))))) (setq tree (org-element-parse-buffer nil visible-only)) (org-export-remove-uninterpreted-data tree info) (let ((backend-name (org-export-backend-name backend))) (dolist (filter (plist-get info :filter-options)) (let ((result ...)) (when result (setq info result))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or ... ""))) (inner-template (cdr (assq ... ...))) (full-body (if (not ...) body (funcall inner-template body info))) (template (cdr (assq ... ...)))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or ... body-only) full-body (funcall template full-body info)) info))))))
(save-excursion (save-restriction (cond ((org-region-active-p) (narrow-to-region (region-beginning) (region-end))) (subtreep (org-narrow-to-subtree) (goto-char (point-min)) (forward-line) (narrow-to-region (point) (point-max)))) (let* ((org-export-current-backend (org-export-backend-name backend)) (info (org-combine-plists (list :export-options (delq nil ...)) (org-export--get-buffer-attributes))) tree) (org-export-with-buffer-copy (run-hook-with-args (quote org-export-before-processing-hook) (org-export-backend-name backend)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (org-export-backend-name backend))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (unless (plist-get info :title) (plist-put info :title (let (...) (if file ... ...)))) (org-macro-replace-all (list (cons "author" (org-element-interpret-data ...)) (cons "date" (org-element-interpret-data ...)) (cons "email" (or ... "")) (cons "title" (org-element-interpret-data ...)))) (setq tree (org-element-parse-buffer nil visible-only)) (org-export-remove-uninterpreted-data tree info) (let ((backend-name (org-export-backend-name backend))) (dolist (filter (plist-get info :filter-options)) (let (...) (when result ...)))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string ...)) (inner-template (cdr ...)) (full-body (if ... body ...)) (template (cdr ...))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if ... full-body ...) info)))))))
org-export-as(latex nil nil nil nil)
(let ((output (org-export-as backend subtreep visible-only body-only ext-plist))) (with-temp-buffer (insert output) (let ((coding-system-for-write encoding)) (write-file file))) (when (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (org-kill-new output)) (or (and (functionp post-process) (funcall post-process file)) file))
(if async (org-export-async-start (\` (lambda (file) (org-export-add-to-stack (expand-file-name file) (quote (\, backend))))) (\` (let ((output (org-export-as (quote ...) (\, subtreep) (\, visible-only) (\, body-only) (quote ...)))) (with-temp-buffer (insert output) (let ((coding-system-for-write ...)) (write-file (\, file)))) (or (ignore-errors (funcall (quote ...) (\, file))) (\, file))))) (let ((output (org-export-as backend subtreep visible-only body-only ext-plist))) (with-temp-buffer (insert output) (let ((coding-system-for-write encoding)) (write-file file))) (when (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (org-kill-new output)) (or (and (functionp post-process) (funcall post-process file)) file)))
(let ((encoding (or org-export-coding-system buffer-file-coding-system))) (if async (org-export-async-start (\` (lambda (file) (org-export-add-to-stack (expand-file-name file) (quote (\, backend))))) (\` (let ((output (org-export-as ... ... ... ... ...))) (with-temp-buffer (insert output) (let (...) (write-file ...))) (or (ignore-errors (funcall ... ...)) (\, file))))) (let ((output (org-export-as backend subtreep visible-only body-only ext-plist))) (with-temp-buffer (insert output) (let ((coding-system-for-write encoding)) (write-file file))) (when (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (org-kill-new output)) (or (and (functionp post-process) (funcall post-process file)) file))))
(if (not (file-writable-p file)) (error "Output file not writable") (let ((encoding (or org-export-coding-system buffer-file-coding-system))) (if async (org-export-async-start (\` (lambda (file) (org-export-add-to-stack (expand-file-name file) (quote ...)))) (\` (let ((output ...)) (with-temp-buffer (insert output) (let ... ...)) (or (ignore-errors ...) (\, file))))) (let ((output (org-export-as backend subtreep visible-only body-only ext-plist))) (with-temp-buffer (insert output) (let ((coding-system-for-write encoding)) (write-file file))) (when (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (org-kill-new output)) (or (and (functionp post-process) (funcall post-process file)) file)))))
org-export-to-file(latex "./user-manual.tex" nil nil nil nil nil)
(let ((outfile (org-export-output-file-name ".tex" subtreep))) (org-export-to-file (quote latex) outfile async subtreep visible-only body-only ext-plist))
org-latex-export-to-latex(nil nil nil nil)
funcall(org-latex-export-to-latex nil nil nil nil)
(save-excursion (when arg (if (eq (marker-buffer org-export-dispatch-last-position) (org-base-buffer (current-buffer))) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil))) (funcall action (and (memq (quote async) optns) t) (and (memq (quote subtree) optns) t) (and (memq (quote visible) optns) t) (and (memq (quote body) optns) t)))
(cond ((eql action (quote template)) (org-export-insert-default-template nil optns)) ((eql action (quote stack)) (org-export-stack)) ((eql action (quote publish-current-file)) (org-publish-current-file (memq (quote force) optns) (memq (quote async) optns))) ((eql action (quote publish-current-project)) (org-publish-current-project (memq (quote force) optns) (memq (quote async) optns))) ((eql action (quote publish-choose-project)) (org-publish (assoc (org-icompleting-read "Publish project: " org-publish-project-alist nil t) org-publish-project-alist) (memq (quote force) optns) (memq (quote async) optns))) ((eql action (quote publish-all)) (org-publish-all (memq (quote force) optns) (memq (quote async) optns))) (t (save-excursion (when arg (if (eq (marker-buffer org-export-dispatch-last-position) (org-base-buffer (current-buffer))) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil))) (funcall action (and (memq (quote async) optns) t) (and (memq (quote subtree) optns) t) (and (memq (quote visible) optns) t) (and (memq (quote body) optns) t)))))
(case action (template (org-export-insert-default-template nil optns)) (stack (org-export-stack)) (publish-current-file (org-publish-current-file (memq (quote force) optns) (memq (quote async) optns))) (publish-current-project (org-publish-current-project (memq (quote force) optns) (memq (quote async) optns))) (publish-choose-project (org-publish (assoc (org-icompleting-read "Publish project: " org-publish-project-alist nil t) org-publish-project-alist) (memq (quote force) optns) (memq (quote async) optns))) (publish-all (org-publish-all (memq (quote force) optns) (memq (quote async) optns))) (otherwise (save-excursion (when arg (if (eq (marker-buffer org-export-dispatch-last-position) (org-base-buffer (current-buffer))) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil))) (funcall action (and (memq (quote async) optns) t) (and (memq (quote subtree) optns) t) (and (memq (quote visible) optns) t) (and (memq (quote body) optns) t)))))
(let* ((input (cond ((equal arg (quote (16))) (quote (stack))) ((and arg org-export-dispatch-last-action)) (t (save-window-excursion (unwind-protect (progn ... ...) (and ... ...)))))) (action (car input)) (optns (cdr input))) (unless (memq (quote subtree) optns) (move-marker org-export-dispatch-last-position nil)) (case action (template (org-export-insert-default-template nil optns)) (stack (org-export-stack)) (publish-current-file (org-publish-current-file (memq (quote force) optns) (memq (quote async) optns))) (publish-current-project (org-publish-current-project (memq (quote force) optns) (memq (quote async) optns))) (publish-choose-project (org-publish (assoc (org-icompleting-read "Publish project: " org-publish-project-alist nil t) org-publish-project-alist) (memq (quote force) optns) (memq (quote async) optns))) (publish-all (org-publish-all (memq (quote force) optns) (memq (quote async) optns))) (otherwise (save-excursion (when arg (if (eq (marker-buffer org-export-dispatch-last-position) (org-base-buffer ...)) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil))) (funcall action (and (memq (quote async) optns) t) (and (memq (quote subtree) optns) t) (and (memq (quote visible) optns) t) (and (memq (quote body) optns) t))))))
org-export-dispatch(nil)
call-interactively(org-export-dispatch nil nil)
[-- Attachment #3: Type: text/plain, Size: 78 bytes --]
--
Nicolas Berthier FSF Member #7975
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug] in org-element cache (?)
2014-07-16 15:01 [bug] in org-element cache (?) Nicolas Berthier
@ 2014-07-17 14:43 ` Nicolas Goaziou
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2014-07-17 14:43 UTC (permalink / raw
To: Nicolas Berthier; +Cc: emacs-orgmode
Hello,
Nicolas Berthier <nberth@member.fsf.org> writes:
> I just hit a bug in org-element with the current development branch
> (commit 9cf3c4e9712aba63be36eac7193e4ac85f491f8b), when exporting
> a rather big Org file to LaTeX (HTML export works fine). It happens
> during export, in function `org-element--cache-process-request', with
> error "(wrong-type-argument number-or-marker-p nil)" (complete backtrace
> attached).
This should be fixed. Thank you for reporting it.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-17 14:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-16 15:01 [bug] in org-element cache (?) Nicolas Berthier
2014-07-17 14:43 ` Nicolas Goaziou
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.