[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Invalid read syntax "#"?
From: |
Nick Dokos |
Subject: |
Re: [O] Invalid read syntax "#"? |
Date: |
Fri, 27 Jan 2012 10:24:26 -0500 |
Alan Schmitt <address@hidden> wrote:
> Hello,
>
> I'm trying this example to export nicely formatted code in LaTeX:
> http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12-3
>
> Unfortunately it fails with an error 'Invalid read syntax "#"'. If I
> delete the second code block (the python one), it works.
>
> Is there something wrong in the example or in my setup (org-mode from
> yesterday's git, Aquamacs 3 from two days ago, Pygments easy-installed
> today)?
>
I got the same thing, so it's probably not a setup problem. Here's
a backtrace - looks like a babel problem.
Nick
Org-mode version 7.8.03 (release_7.8.03.241.g043d)
GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4) of
2012-01-24
Debugger entered--Lisp error: (invalid-read-syntax "#")
read("(progn #+end_src\n#+name: another-listing\n#+begin_src python :exports
code\n)")
(eval (read (format (if (member "output" (cdr (assoc :result-params params)))
"(with-output-to-string %s)" "(progn %s)") (org-babel-expand-body:emacs-lisp
body params))))
((lambda (result) (if (or (member "scalar" (cdr (assoc :result-params
params))) (member "verbatim" (cdr (assoc :result-params params)))) (let
((print-level nil) (print-length nil)) (format "%S" result))
(org-babel-reassemble-table result (org-babel-pick-name (cdr (assoc
:colname-names params)) (cdr (assoc :colnames params))) (org-babel-pick-name
(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))) (eval
(read (format (if (member "output" (cdr (assoc :result-params params)))
"(with-output-to-string %s)" "(progn %s)") (org-babel-expand-body:emacs-lisp
body params)))))
(progn ((lambda (result) (if (or (member "scalar" (cdr (assoc :result-params
params))) (member "verbatim" (cdr (assoc :result-params params)))) (let
((print-level nil) (print-length nil)) (format "%S" result))
(org-babel-reassemble-table result (org-babel-pick-name (cdr (assoc
:colname-names params)) (cdr (assoc :colnames params))) (org-babel-pick-name
(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))) (eval
(read (format (if (member "output" (cdr ...)) "(with-output-to-string %s)"
"(progn %s)") (org-babel-expand-body:emacs-lisp body params))))))
(unwind-protect (progn ((lambda (result) (if (or (member "scalar" (cdr ...))
(member "verbatim" (cdr ...))) (let ((print-level nil) (print-length nil))
(format "%S" result)) (org-babel-reassemble-table result (org-babel-pick-name
(cdr ...) (cdr ...)) (org-babel-pick-name (cdr ...) (cdr ...))))) (eval (read
(format (if (member "output" ...) "(with-output-to-string %s)" "(progn %s)")
(org-babel-expand-body:emacs-lisp body params)))))) (set-window-configuration
wconfig))
(let ((wconfig (current-window-configuration))) (unwind-protect (progn
((lambda (result) (if (or (member "scalar" ...) (member "verbatim" ...)) (let
(... ...) (format "%S" result)) (org-babel-reassemble-table result
(org-babel-pick-name ... ...) (org-babel-pick-name ... ...)))) (eval (read
(format (if ... "(with-output-to-string %s)" "(progn %s)")
(org-babel-expand-body:emacs-lisp body params)))))) (set-window-configuration
wconfig)))
(save-window-excursion ((lambda (result) (if (or (member "scalar" (cdr (assoc
:result-params params))) (member "verbatim" (cdr (assoc :result-params
params)))) (let ((print-level nil) (print-length nil)) (format "%S" result))
(org-babel-reassemble-table result (org-babel-pick-name (cdr (assoc
:colname-names params)) (cdr (assoc :colnames params))) (org-babel-pick-name
(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))) (eval
(read (format (if (member "output" (cdr ...)) "(with-output-to-string %s)"
"(progn %s)") (org-babel-expand-body:emacs-lisp body params))))))
org-babel-execute:emacs-lisp("#+end_src\n#+name: another-listing\n#+begin_src
python :exports code" ((:comments . "") (:shebang . "") (:cache . "no")
(:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "both") (:results
. "replace") (:colname-names) (:colnames . "no") (:hlines . "yes") (:padnewline
. "yes") (:result-params "silent") (:result-type . value) (:rowname-names)
(:session . "none")))
funcall(org-babel-execute:emacs-lisp "#+end_src\n#+name:
another-listing\n#+begin_src python :exports code" ((:comments . "") (:shebang
. "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no")
(:exports . "both") (:results . "replace") (:colname-names) (:colnames . "no")
(:hlines . "yes") (:padnewline . "yes") (:result-params "silent") (:result-type
. value) (:rowname-names) (:session . "none")))
((lambda (result) (if (and (eq (cdr (assoc :result-type params)) (quote
value)) (or (member "vector" result-params) (member "table" result-params))
(not (listp result))) (list (list result)) result)) (funcall cmd body params))
(setq result ((lambda (result) (if (and (eq (cdr (assoc :result-type params))
(quote value)) (or (member "vector" result-params) (member "table"
result-params)) (not (listp result))) (list (list result)) result)) (funcall
cmd body params)))
(if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion
(goto-char (org-babel-where-is-src-block-result nil info)) (end-of-line 1)
(forward-char 1) (setq result (org-babel-read-result)) (message
(replace-regexp-in-string "%" "%%" (format "%S" result))) result) (message
"executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format "
(%s)" (nth 4 info)) "")) (setq result ((lambda (result) (if (and (eq (cdr ...)
(quote value)) (or (member "vector" result-params) (member "table"
result-params)) (not (listp result))) (list (list result)) result)) (funcall
cmd body params))) (when (cdr (assoc :file params)) (when result
(with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-result
result (cdr (assoc :sep ...)))))) (setq result (cdr (assoc :file params))))
(org-babel-insert-result result result-params info new-hash indent lang)
(run-hooks (quote org-babel-after-execute-hook)) result)
(progn (fset (quote call-process-region) (function* (lambda (&rest args)
(block call-process-region (apply (quote
org-babel-tramp-handle-call-process-region) args))))) (flet ((lang-check (f)
(let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check lang)
(lang-check (symbol-name (cdr (assoc lang org-src-lang-modes)))) (error "No
org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (equal
new-hash old-hash)) (save-excursion (goto-char
(org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-char
1) (setq result (org-babel-read-result)) (message (replace-regexp-in-string "%"
"%%" (format "%S" result))) result) (message "executing %s code block%s..."
(capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (setq
result ((lambda (result) (if (and (eq ... ...) (or ... ...) (not ...)) (list
(list result)) result)) (funcall cmd body params))) (when (cdr (assoc :file
params)) (when result (with-temp-file (cdr (assoc :
file params)) (insert (org-babel-format-result result (cdr ...))))) (setq
result (cdr (assoc :file params)))) (org-babel-insert-result result
result-params info new-hash indent lang) (run-hooks (quote
org-babel-after-execute-hook)) result))
(unwind-protect (progn (fset (quote call-process-region) (function* (lambda
(&rest args) (block call-process-region (apply (quote
org-babel-tramp-handle-call-process-region) args))))) (flet ((lang-check (f)
(let ((f ...)) (when (fboundp f) f)))) (setq cmd (or (lang-check lang)
(lang-check (symbol-name (cdr ...))) (error "No org-babel-execute function for
%s!" lang)))) (if (and (not arg) new-hash (equal new-hash old-hash))
(save-excursion (goto-char (org-babel-where-is-src-block-result nil info))
(end-of-line 1) (forward-char 1) (setq result (org-babel-read-result)) (message
(replace-regexp-in-string "%" "%%" (format "%S" result))) result) (message
"executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format "
(%s)" (nth 4 info)) "")) (setq result ((lambda (result) (if (and ... ... ...)
(list ...) result)) (funcall cmd body params))) (when (cdr (assoc :file
params)) (when result (with-temp-file (cdr (assoc :file params)) (insert
(org-babel-format-result result .
..)))) (setq result (cdr (assoc :file params)))) (org-babel-insert-result
result result-params info new-hash indent lang) (run-hooks (quote
org-babel-after-execute-hook)) result)) (if --cl-letf-bound-- (fset (quote
call-process-region) --cl-letf-save--) (fmakunbound (quote
call-process-region))))
(let* ((--cl-letf-bound-- (fboundp (quote call-process-region)))
(--cl-letf-save-- (and --cl-letf-bound-- (symbol-function (quote
call-process-region))))) (unwind-protect (progn (fset (quote
call-process-region) (function* (lambda (&rest args) (block call-process-region
(apply ... args))))) (flet ((lang-check (f) (let (...) (when ... f)))) (setq
cmd (or (lang-check lang) (lang-check (symbol-name ...)) (error "No
org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (equal
new-hash old-hash)) (save-excursion (goto-char
(org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-char
1) (setq result (org-babel-read-result)) (message (replace-regexp-in-string "%"
"%%" (format "%S" result))) result) (message "executing %s code block%s..."
(capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (setq
result ((lambda (result) (if ... ... result)) (funcall cmd body params))) (when
(cdr (assoc :file params)) (when result (with-temp-file
(cdr ...) (insert ...))) (setq result (cdr (assoc :file params))))
(org-babel-insert-result result result-params info new-hash indent lang)
(run-hooks (quote org-babel-after-execute-hook)) result)) (if --cl-letf-bound--
(fset (quote call-process-region) --cl-letf-save--) (fmakunbound (quote
call-process-region)))))
(letf (((symbol-function (quote call-process-region)) (function* (lambda
(&rest args) (block call-process-region (apply (quote
org-babel-tramp-handle-call-process-region) args)))))) (flet ((lang-check (f)
(let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check lang)
(lang-check (symbol-name (cdr (assoc lang org-src-lang-modes)))) (error "No
org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (equal
new-hash old-hash)) (save-excursion (goto-char
(org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-char
1) (setq result (org-babel-read-result)) (message (replace-regexp-in-string "%"
"%%" (format "%S" result))) result) (message "executing %s code block%s..."
(capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (setq
result ((lambda (result) (if (and (eq ... ...) (or ... ...) (not ...)) (list
(list result)) result)) (funcall cmd body params))) (when (cdr (assoc :file
params)) (when result (with-temp-file
(cdr (assoc :file params)) (insert (org-babel-format-result result (cdr
...))))) (setq result (cdr (assoc :file params)))) (org-babel-insert-result
result result-params info new-hash indent lang) (run-hooks (quote
org-babel-after-execute-hook)) result))
(letf* (((symbol-function (quote call-process-region)) (function* (lambda
(&rest args) (block call-process-region (apply (quote
org-babel-tramp-handle-call-process-region) args)))))) (flet ((lang-check (f)
(let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check lang)
(lang-check (symbol-name (cdr (assoc lang org-src-lang-modes)))) (error "No
org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (equal
new-hash old-hash)) (save-excursion (goto-char
(org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-char
1) (setq result (org-babel-read-result)) (message (replace-regexp-in-string "%"
"%%" (format "%S" result))) result) (message "executing %s code block%s..."
(capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (setq
result ((lambda (result) (if (and (eq ... ...) (or ... ...) (not ...)) (list
(list result)) result)) (funcall cmd body params))) (when (cdr (assoc :file
params)) (when result (with-temp-fil
e (cdr (assoc :file params)) (insert (org-babel-format-result result (cdr
...))))) (setq result (cdr (assoc :file params)))) (org-babel-insert-result
result result-params info new-hash indent lang) (run-hooks (quote
org-babel-after-execute-hook)) result))
(flet ((call-process-region (&rest args) (apply (quote
org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) (let
((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check lang)
(lang-check (symbol-name (cdr (assoc lang org-src-lang-modes)))) (error "No
org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (equal
new-hash old-hash)) (save-excursion (goto-char
(org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-char
1) (setq result (org-babel-read-result)) (message (replace-regexp-in-string "%"
"%%" (format "%S" result))) result) (message "executing %s code block%s..."
(capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (setq
result ((lambda (result) (if (and (eq ... ...) (or ... ...) (not ...)) (list
(list result)) result)) (funcall cmd body params))) (when (cdr (assoc :file
params)) (when result (with-temp-file (cdr (assoc :file params)) (insert
(org-babel-format-result result (cdr ..
.))))) (setq result (cdr (assoc :file params)))) (org-babel-insert-result
result result-params info new-hash indent lang) (run-hooks (quote
org-babel-after-execute-hook)) result))
(unwind-protect (flet ((call-process-region (&rest args) (apply (quote
org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) (let
((f ...)) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) (lang-check
(symbol-name (cdr ...))) (error "No org-babel-execute function for %s!"
lang)))) (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion
(goto-char (org-babel-where-is-src-block-result nil info)) (end-of-line 1)
(forward-char 1) (setq result (org-babel-read-result)) (message
(replace-regexp-in-string "%" "%%" (format "%S" result))) result) (message
"executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format "
(%s)" (nth 4 info)) "")) (setq result ((lambda (result) (if (and ... ... ...)
(list ...) result)) (funcall cmd body params))) (when (cdr (assoc :file
params)) (when result (with-temp-file (cdr (assoc :file params)) (insert
(org-babel-format-result result ...)))) (setq result (cdr (assoc :file
params)))) (org-babel-i
nsert-result result result-params info new-hash indent lang) (run-hooks (quote
org-babel-after-execute-hook)) result)) (setq call-process-region (quote
org-babel-call-process-region-original)))
(let* ((lang (nth 0 info)) (params (if params (org-babel-process-params
(org-babel-merge-params (nth 2 info) params)) (nth 2 info))) (cache\? (and (not
arg) (cdr (assoc :cache params)) (string= "yes" (cdr (assoc :cache params)))))
(result-params (cdr (assoc :result-params params))) (new-hash (when cache\?
(org-babel-sha1-hash info))) (old-hash (when cache\?
(org-babel-current-result-hash))) (body (setf (nth 1 info) (if
(org-babel-noweb-p params :eval) (org-babel-expand-noweb-references info) (nth
1 info)))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir
(file-name-as-directory dir)) default-directory))
(org-babel-call-process-region-original (if (boundp (quote
org-babel-call-process-region-original)) org-babel-call-process-region-original
(symbol-function (quote call-process-region)))) (indent (car (last info)))
result cmd) (unwind-protect (flet ((call-process-region (&rest args) (apply
(quote org-babel-tramp-handle-call-process-region) args))) (flet ((lang
-check (f) (let (...) (when ... f)))) (setq cmd (or (lang-check lang)
(lang-check (symbol-name ...)) (error "No org-babel-execute function for %s!"
lang)))) (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion
(goto-char (org-babel-where-is-src-block-result nil info)) (end-of-line 1)
(forward-char 1) (setq result (org-babel-read-result)) (message
(replace-regexp-in-string "%" "%%" (format "%S" result))) result) (message
"executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format "
(%s)" (nth 4 info)) "")) (setq result ((lambda (result) (if ... ... result))
(funcall cmd body params))) (when (cdr (assoc :file params)) (when result
(with-temp-file (cdr ...) (insert ...))) (setq result (cdr (assoc :file
params)))) (org-babel-insert-result result result-params info new-hash indent
lang) (run-hooks (quote org-babel-after-execute-hook)) result)) (setq
call-process-region (quote org-babel-call-process-region-original))))
(progn (let* ((lang (nth 0 info)) (params (if params
(org-babel-process-params (org-babel-merge-params (nth 2 info) params)) (nth 2
info))) (cache\? (and (not arg) (cdr (assoc :cache params)) (string= "yes" (cdr
(assoc :cache params))))) (result-params (cdr (assoc :result-params params)))
(new-hash (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\?
(org-babel-current-result-hash))) (body (setf (nth 1 info) (if
(org-babel-noweb-p params :eval) (org-babel-expand-noweb-references info) (nth
1 info)))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir
(file-name-as-directory dir)) default-directory))
(org-babel-call-process-region-original (if (boundp (quote
org-babel-call-process-region-original)) org-babel-call-process-region-original
(symbol-function (quote call-process-region)))) (indent (car (last info)))
result cmd) (unwind-protect (flet ((call-process-region (&rest args) (apply
(quote org-babel-tramp-handle-call-process-region) args))) (flet
((lang-check (f) (let ... ...))) (setq cmd (or (lang-check lang) (lang-check
...) (error "No org-babel-execute function for %s!" lang)))) (if (and (not arg)
new-hash (equal new-hash old-hash)) (save-excursion (goto-char
(org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-char
1) (setq result (org-babel-read-result)) (message (replace-regexp-in-string "%"
"%%" ...)) result) (message "executing %s code block%s..." (capitalize lang)
(if (nth 4 info) (format " (%s)" ...) "")) (setq result ((lambda ... ...)
(funcall cmd body params))) (when (cdr (assoc :file params)) (when result
(with-temp-file ... ...)) (setq result (cdr ...))) (org-babel-insert-result
result result-params info new-hash indent lang) (run-hooks (quote
org-babel-after-execute-hook)) result)) (setq call-process-region (quote
org-babel-call-process-region-original)))))
(if (org-babel-confirm-evaluate (let ((i info)) (setf (nth 2 i)
(org-babel-merge-params (nth 2 info) params)) i)) (progn (let* ((lang (nth 0
info)) (params (if params (org-babel-process-params (org-babel-merge-params ...
params)) (nth 2 info))) (cache\? (and (not arg) (cdr (assoc :cache params))
(string= "yes" (cdr ...)))) (result-params (cdr (assoc :result-params params)))
(new-hash (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\?
(org-babel-current-result-hash))) (body (setf (nth 1 info) (if
(org-babel-noweb-p params :eval) (org-babel-expand-noweb-references info) (nth
1 info)))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir
(file-name-as-directory dir)) default-directory))
(org-babel-call-process-region-original (if (boundp (quote
org-babel-call-process-region-original)) org-babel-call-process-region-original
(symbol-function (quote call-process-region)))) (indent (car (last info)))
result cmd) (unwind-protect (flet ((call-process-regi
on (&rest args) (apply ... args))) (flet ((lang-check ... ...)) (setq cmd (or
... ... ...))) (if (and (not arg) new-hash (equal new-hash old-hash))
(save-excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq result
...) (message ...) result) (message "executing %s code block%s..." (capitalize
lang) (if ... ... "")) (setq result (... ...)) (when (cdr ...) (when result
...) (setq result ...)) (org-babel-insert-result result result-params info
new-hash indent lang) (run-hooks (quote org-babel-after-execute-hook)) result))
(setq call-process-region (quote org-babel-call-process-region-original))))))
(when (org-babel-confirm-evaluate (let ((i info)) (setf (nth 2 i)
(org-babel-merge-params (nth 2 info) params)) i)) (let* ((lang (nth 0 info))
(params (if params (org-babel-process-params (org-babel-merge-params (nth 2
info) params)) (nth 2 info))) (cache\? (and (not arg) (cdr (assoc :cache
params)) (string= "yes" (cdr (assoc :cache params))))) (result-params (cdr
(assoc :result-params params))) (new-hash (when cache\? (org-babel-sha1-hash
info))) (old-hash (when cache\? (org-babel-current-result-hash))) (body (setf
(nth 1 info) (if (org-babel-noweb-p params :eval)
(org-babel-expand-noweb-references info) (nth 1 info)))) (dir (cdr (assoc :dir
params))) (default-directory (or (and dir (file-name-as-directory dir))
default-directory)) (org-babel-call-process-region-original (if (boundp (quote
org-babel-call-process-region-original)) org-babel-call-process-region-original
(symbol-function (quote call-process-region)))) (indent (car (last info)))
result cmd) (unwind-protect (fl
et ((call-process-region (&rest args) (apply (quote
org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) (let
... ...))) (setq cmd (or (lang-check lang) (lang-check ...) (error "No
org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (equal
new-hash old-hash)) (save-excursion (goto-char
(org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-char
1) (setq result (org-babel-read-result)) (message (replace-regexp-in-string "%"
"%%" ...)) result) (message "executing %s code block%s..." (capitalize lang)
(if (nth 4 info) (format " (%s)" ...) "")) (setq result ((lambda ... ...)
(funcall cmd body params))) (when (cdr (assoc :file params)) (when result
(with-temp-file ... ...)) (setq result (cdr ...))) (org-babel-insert-result
result result-params info new-hash indent lang) (run-hooks (quote
org-babel-after-execute-hook)) result)) (setq call-process-region (quote
org-babel-call-process-region-original)))))
(let ((info (or info (org-babel-get-src-block-info)))) (when
(org-babel-confirm-evaluate (let ((i info)) (setf (nth 2 i)
(org-babel-merge-params (nth 2 info) params)) i)) (let* ((lang (nth 0 info))
(params (if params (org-babel-process-params (org-babel-merge-params ...
params)) (nth 2 info))) (cache\? (and (not arg) (cdr (assoc :cache params))
(string= "yes" (cdr ...)))) (result-params (cdr (assoc :result-params params)))
(new-hash (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\?
(org-babel-current-result-hash))) (body (setf (nth 1 info) (if
(org-babel-noweb-p params :eval) (org-babel-expand-noweb-references info) (nth
1 info)))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir
(file-name-as-directory dir)) default-directory))
(org-babel-call-process-region-original (if (boundp (quote
org-babel-call-process-region-original)) org-babel-call-process-region-original
(symbol-function (quote call-process-region)))) (indent (car (last info))) res
ult cmd) (unwind-protect (flet ((call-process-region (&rest args) (apply ...
args))) (flet ((lang-check ... ...)) (setq cmd (or ... ... ...))) (if (and (not
arg) new-hash (equal new-hash old-hash)) (save-excursion (goto-char ...)
(end-of-line 1) (forward-char 1) (setq result ...) (message ...) result)
(message "executing %s code block%s..." (capitalize lang) (if ... ... ""))
(setq result (... ...)) (when (cdr ...) (when result ...) (setq result ...))
(org-babel-insert-result result result-params info new-hash indent lang)
(run-hooks (quote org-babel-after-execute-hook)) result)) (setq
call-process-region (quote org-babel-call-process-region-original))))))
org-babel-execute-src-block(nil ("emacs-lisp" "#+end_src\n#+name:
another-listing\n#+begin_src python :exports code" ((:comments . "") (:shebang
. "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no")
(:exports . "both") (:results . "replace") (:colname-names) (:colnames . "no")
(:hlines . "yes") (:padnewline . "yes") (:result-params "silent") (:result-type
. value) (:rowname-names) (:session . "none")) "" "setup-minted" 0))
(cond ((equal type (quote block)) (org-babel-execute-src-block nil info))
((equal type (quote inline)) (re-search-backward "[ \f \n]" nil t)
(re-search-forward org-babel-inline-src-block-regexp nil t) (re-search-backward
"src_" nil t) (org-babel-execute-src-block nil info)) ((equal type (quote lob))
(save-excursion (re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block nil info))))
(prog1 nil (setf (nth 2 info) (org-babel-exp-in-export-file lang
(org-babel-process-params (org-babel-merge-params (nth 2 info) (\` ((:results
\, ...))))))) (cond ((equal type (quote block)) (org-babel-execute-src-block
nil info)) ((equal type (quote inline)) (re-search-backward "[ \f \n]" nil t)
(re-search-forward org-babel-inline-src-block-regexp nil t) (re-search-backward
"src_" nil t) (org-babel-execute-src-block nil info)) ((equal type (quote lob))
(save-excursion (re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block nil info)))))
(progn (org-babel-eval-wipe-error-buffer) (prog1 nil (setf (nth 2 info)
(org-babel-exp-in-export-file lang (org-babel-process-params
(org-babel-merge-params (nth 2 info) (\` (...)))))) (cond ((equal type (quote
block)) (org-babel-execute-src-block nil info)) ((equal type (quote inline))
(re-search-backward "[ \f \n]" nil t) (re-search-forward
org-babel-inline-src-block-regexp nil t) (re-search-backward "src_" nil t)
(org-babel-execute-src-block nil info)) ((equal type (quote lob))
(save-excursion (re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block nil info))))))
(if (fboundp (intern (concat "org-babel-execute:" lang))) (progn
(org-babel-eval-wipe-error-buffer) (prog1 nil (setf (nth 2 info)
(org-babel-exp-in-export-file lang (org-babel-process-params
(org-babel-merge-params (nth 2 info) (\` ...))))) (cond ((equal type (quote
block)) (org-babel-execute-src-block nil info)) ((equal type (quote inline))
(re-search-backward "[ \f \n]" nil t) (re-search-forward
org-babel-inline-src-block-regexp nil t) (re-search-backward "src_" nil t)
(org-babel-execute-src-block nil info)) ((equal type (quote lob))
(save-excursion (re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block nil info)))))))
(when (fboundp (intern (concat "org-babel-execute:" lang)))
(org-babel-eval-wipe-error-buffer) (prog1 nil (setf (nth 2 info)
(org-babel-exp-in-export-file lang (org-babel-process-params
(org-babel-merge-params (nth 2 info) (\` (...)))))) (cond ((equal type (quote
block)) (org-babel-execute-src-block nil info)) ((equal type (quote inline))
(re-search-backward "[ \f \n]" nil t) (re-search-forward
org-babel-inline-src-block-regexp nil t) (re-search-backward "src_" nil t)
(org-babel-execute-src-block nil info)) ((equal type (quote lob))
(save-excursion (re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block nil info))))))
(let ((lang (nth 0 info)) (body (nth 1 info)) (info (copy-sequence info)))
(when (fboundp (intern (concat "org-babel-execute:" lang)))
(org-babel-eval-wipe-error-buffer) (prog1 nil (setf (nth 2 info)
(org-babel-exp-in-export-file lang (org-babel-process-params
(org-babel-merge-params (nth 2 info) (\` ...))))) (cond ((equal type (quote
block)) (org-babel-execute-src-block nil info)) ((equal type (quote inline))
(re-search-backward "[ \f \n]" nil t) (re-search-forward
org-babel-inline-src-block-regexp nil t) (re-search-backward "src_" nil t)
(org-babel-execute-src-block nil info)) ((equal type (quote lob))
(save-excursion (re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block nil info)))))))
(progn (let ((lang (nth 0 info)) (body (nth 1 info)) (info (copy-sequence
info))) (when (fboundp (intern (concat "org-babel-execute:" lang)))
(org-babel-eval-wipe-error-buffer) (prog1 nil (setf (nth 2 info)
(org-babel-exp-in-export-file lang (org-babel-process-params
(org-babel-merge-params ... ...)))) (cond ((equal type (quote block))
(org-babel-execute-src-block nil info)) ((equal type (quote inline))
(re-search-backward "[ \f \n]" nil t) (re-search-forward
org-babel-inline-src-block-regexp nil t) (re-search-backward "src_" nil t)
(org-babel-execute-src-block nil info)) ((equal type (quote lob))
(save-excursion (re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block nil info))))))))
(if (and org-export-babel-evaluate (not (and hash (equal hash
(org-babel-current-result-hash))))) (progn (let ((lang (nth 0 info)) (body (nth
1 info)) (info (copy-sequence info))) (when (fboundp (intern (concat
"org-babel-execute:" lang))) (org-babel-eval-wipe-error-buffer) (prog1 nil
(setf (nth 2 info) (org-babel-exp-in-export-file lang (org-babel-process-params
...))) (cond ((equal type ...) (org-babel-execute-src-block nil info)) ((equal
type ...) (re-search-backward "[ \f \n]" nil t) (re-search-forward
org-babel-inline-src-block-regexp nil t) (re-search-backward "src_" nil t)
(org-babel-execute-src-block nil info)) ((equal type ...) (save-excursion ...
...))))))))
(when (and org-export-babel-evaluate (not (and hash (equal hash
(org-babel-current-result-hash))))) (let ((lang (nth 0 info)) (body (nth 1
info)) (info (copy-sequence info))) (when (fboundp (intern (concat
"org-babel-execute:" lang))) (org-babel-eval-wipe-error-buffer) (prog1 nil
(setf (nth 2 info) (org-babel-exp-in-export-file lang (org-babel-process-params
(org-babel-merge-params ... ...)))) (cond ((equal type (quote block))
(org-babel-execute-src-block nil info)) ((equal type (quote inline))
(re-search-backward "[ \f \n]" nil t) (re-search-forward
org-babel-inline-src-block-regexp nil t) (re-search-backward "src_" nil t)
(org-babel-execute-src-block nil info)) ((equal type (quote lob))
(save-excursion (re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block nil info))))))))
org-babel-exp-results(("emacs-lisp" "#+end_src\n#+name:
another-listing\n#+begin_src python :exports code" ((:cache . "no")
(:colname-names) (:colnames . "no") (:comments . "") (:exports . "both")
(:hlines . "yes") (:noweb . "no") (:padline . "") (:padnewline . "yes")
(:result-params "silent") (:result-type . value) (:results . "silent")
(:rowname-names) (:session . "none") (:shebang . "") (:tangle . "no")) ""
"setup-minted" 0) block nil "2a39b675a6bec8c15b0ed8928d030e836ddd17d5")
(cond ((member* --cl-var-- (quote (quote none))) (silently) (clean) "")
((member* --cl-var-- (quote (quote code))) (silently) (clean)
(org-babel-exp-code info)) ((member* --cl-var-- (quote (quote results)))
(org-babel-exp-results info type nil hash) "") ((member* --cl-var-- (quote
(quote both))) (org-babel-exp-results info type nil hash) (org-babel-exp-code
info)))
(let ((--cl-var-- (intern (or (cdr (assoc :exports (nth 2 info))) "code"))))
(cond ((member* --cl-var-- (quote (quote none))) (silently) (clean) "")
((member* --cl-var-- (quote (quote code))) (silently) (clean)
(org-babel-exp-code info)) ((member* --cl-var-- (quote (quote results)))
(org-babel-exp-results info type nil hash) "") ((member* --cl-var-- (quote
(quote both))) (org-babel-exp-results info type nil hash) (org-babel-exp-code
info))))
(case (intern (or (cdr (assoc :exports (nth 2 info))) "code")) ((quote none)
(silently) (clean) "") ((quote code) (silently) (clean) (org-babel-exp-code
info)) ((quote results) (org-babel-exp-results info type nil hash) "") ((quote
both) (org-babel-exp-results info type nil hash) (org-babel-exp-code info)))
(progn (fset (quote clean) (function* (lambda nil (block clean (unless (eq
type (quote inline)) (org-babel-remove-result info)))))) (case (intern (or (cdr
(assoc :exports (nth 2 info))) "code")) ((quote none) (silently) (clean) "")
((quote code) (silently) (clean) (org-babel-exp-code info)) ((quote results)
(org-babel-exp-results info type nil hash) "") ((quote both)
(org-babel-exp-results info type nil hash) (org-babel-exp-code info))))
(unwind-protect (progn (fset (quote clean) (function* (lambda nil (block
clean (unless (eq type ...) (org-babel-remove-result info)))))) (case (intern
(or (cdr (assoc :exports (nth 2 info))) "code")) ((quote none) (silently)
(clean) "") ((quote code) (silently) (clean) (org-babel-exp-code info)) ((quote
results) (org-babel-exp-results info type nil hash) "") ((quote both)
(org-babel-exp-results info type nil hash) (org-babel-exp-code info)))) (if
--cl-letf-bound-- (fset (quote clean) --cl-letf-save--) (fmakunbound (quote
clean))))
(let* ((--cl-letf-bound-- (fboundp (quote clean))) (--cl-letf-save-- (and
--cl-letf-bound-- (symbol-function (quote clean))))) (unwind-protect (progn
(fset (quote clean) (function* (lambda nil (block clean (unless ... ...)))))
(case (intern (or (cdr (assoc :exports ...)) "code")) ((quote none) (silently)
(clean) "") ((quote code) (silently) (clean) (org-babel-exp-code info)) ((quote
results) (org-babel-exp-results info type nil hash) "") ((quote both)
(org-babel-exp-results info type nil hash) (org-babel-exp-code info)))) (if
--cl-letf-bound-- (fset (quote clean) --cl-letf-save--) (fmakunbound (quote
clean)))))
(letf (((symbol-function (quote clean)) (function* (lambda nil (block clean
(unless (eq type ...) (org-babel-remove-result info))))))) (case (intern (or
(cdr (assoc :exports (nth 2 info))) "code")) ((quote none) (silently) (clean)
"") ((quote code) (silently) (clean) (org-babel-exp-code info)) ((quote
results) (org-babel-exp-results info type nil hash) "") ((quote both)
(org-babel-exp-results info type nil hash) (org-babel-exp-code info))))
(progn (fset (quote silently) (function* (lambda nil (block silently (let
((session ...)) (when (not ...) (org-babel-exp-results info type ...)))))))
(letf (((symbol-function (quote clean)) (function* (lambda nil (block clean
(unless ... ...)))))) (case (intern (or (cdr (assoc :exports (nth 2 info)))
"code")) ((quote none) (silently) (clean) "") ((quote code) (silently) (clean)
(org-babel-exp-code info)) ((quote results) (org-babel-exp-results info type
nil hash) "") ((quote both) (org-babel-exp-results info type nil hash)
(org-babel-exp-code info)))))
(unwind-protect (progn (fset (quote silently) (function* (lambda nil (block
silently (let (...) (when ... ...)))))) (letf (((symbol-function (quote clean))
(function* (lambda nil (block clean ...))))) (case (intern (or (cdr (assoc
:exports ...)) "code")) ((quote none) (silently) (clean) "") ((quote code)
(silently) (clean) (org-babel-exp-code info)) ((quote results)
(org-babel-exp-results info type nil hash) "") ((quote both)
(org-babel-exp-results info type nil hash) (org-babel-exp-code info))))) (if
--cl-letf-bound-- (fset (quote silently) --cl-letf-save--) (fmakunbound (quote
silently))))
(let* ((--cl-letf-bound-- (fboundp (quote silently))) (--cl-letf-save-- (and
--cl-letf-bound-- (symbol-function (quote silently))))) (unwind-protect (progn
(fset (quote silently) (function* (lambda nil (block silently (let ... ...)))))
(letf (((symbol-function (quote clean)) (function* (lambda nil ...)))) (case
(intern (or (cdr ...) "code")) ((quote none) (silently) (clean) "") ((quote
code) (silently) (clean) (org-babel-exp-code info)) ((quote results)
(org-babel-exp-results info type nil hash) "") ((quote both)
(org-babel-exp-results info type nil hash) (org-babel-exp-code info))))) (if
--cl-letf-bound-- (fset (quote silently) --cl-letf-save--) (fmakunbound (quote
silently)))))
(letf (((symbol-function (quote silently)) (function* (lambda nil (block
silently (let (...) (when ... ...))))))) (letf (((symbol-function (quote
clean)) (function* (lambda nil (block clean (unless ... ...)))))) (case (intern
(or (cdr (assoc :exports (nth 2 info))) "code")) ((quote none) (silently)
(clean) "") ((quote code) (silently) (clean) (org-babel-exp-code info)) ((quote
results) (org-babel-exp-results info type nil hash) "") ((quote both)
(org-babel-exp-results info type nil hash) (org-babel-exp-code info)))))
(letf* (((symbol-function (quote silently)) (function* (lambda nil (block
silently (let (...) (when ... ...)))))) ((symbol-function (quote clean))
(function* (lambda nil (block clean (unless (eq type ...)
(org-babel-remove-result info))))))) (case (intern (or (cdr (assoc :exports
(nth 2 info))) "code")) ((quote none) (silently) (clean) "") ((quote code)
(silently) (clean) (org-babel-exp-code info)) ((quote results)
(org-babel-exp-results info type nil hash) "") ((quote both)
(org-babel-exp-results info type nil hash) (org-babel-exp-code info))))
(flet ((silently nil (let ((session (cdr (assoc :session ...)))) (when (not
(and session (equal "none" session))) (org-babel-exp-results info type (quote
silent))))) (clean nil (unless (eq type (quote inline))
(org-babel-remove-result info)))) (case (intern (or (cdr (assoc :exports (nth 2
info))) "code")) ((quote none) (silently) (clean) "") ((quote code) (silently)
(clean) (org-babel-exp-code info)) ((quote results) (org-babel-exp-results info
type nil hash) "") ((quote both) (org-babel-exp-results info type nil hash)
(org-babel-exp-code info))))
org-babel-exp-do-export(("emacs-lisp" "#+end_src\n#+name:
another-listing\n#+begin_src python :exports code" ((:cache . "no")
(:colname-names) (:colnames . "no") (:comments . "") (:exports . "both")
(:hlines . "yes") (:noweb . "no") (:padline . "") (:padnewline . "yes")
(:result-params "silent") (:result-type . value) (:results . "silent")
(:rowname-names) (:session . "none") (:shebang . "") (:tangle . "no")) ""
"setup-minted" 0) block "2a39b675a6bec8c15b0ed8928d030e836ddd17d5")
(progn (when (member (cdr (assoc :exports (nth 2 info))) (quote ("both"
"results"))) (org-babel-exp-in-export-file lang (setf (nth 2 info)
(org-babel-process-params (org-babel-merge-params org-babel-default-header-args
(org-babel-params-from-properties lang) (if (boundp lang-headers) (eval
lang-headers) nil) raw-params)))) (setf hash (org-babel-sha1-hash info))) (setf
(nth 1 info) (if (org-babel-noweb-p (nth 2 info) :export)
(org-babel-expand-noweb-references info (get-file-buffer
org-current-export-file)) (nth 1 info))) (org-babel-exp-do-export info (quote
block) hash))
(if info (progn (when (member (cdr (assoc :exports (nth 2 info))) (quote
("both" "results"))) (org-babel-exp-in-export-file lang (setf (nth 2 info)
(org-babel-process-params (org-babel-merge-params org-babel-default-header-args
(org-babel-params-from-properties lang) (if ... ... nil) raw-params)))) (setf
hash (org-babel-sha1-hash info))) (setf (nth 1 info) (if (org-babel-noweb-p
(nth 2 info) :export) (org-babel-expand-noweb-references info (get-file-buffer
org-current-export-file)) (nth 1 info))) (org-babel-exp-do-export info (quote
block) hash)))
(when info (when (member (cdr (assoc :exports (nth 2 info))) (quote ("both"
"results"))) (org-babel-exp-in-export-file lang (setf (nth 2 info)
(org-babel-process-params (org-babel-merge-params org-babel-default-header-args
(org-babel-params-from-properties lang) (if (boundp lang-headers) (eval
lang-headers) nil) raw-params)))) (setf hash (org-babel-sha1-hash info))) (setf
(nth 1 info) (if (org-babel-noweb-p (nth 2 info) :export)
(org-babel-expand-noweb-references info (get-file-buffer
org-current-export-file)) (nth 1 info))) (org-babel-exp-do-export info (quote
block) hash))
(let* ((info (org-babel-get-src-block-info (quote light))) (lang (nth 0
info)) (raw-params (nth 2 info)) hash) (when info (when (member (cdr (assoc
:exports (nth 2 info))) (quote ("both" "results")))
(org-babel-exp-in-export-file lang (setf (nth 2 info) (org-babel-process-params
(org-babel-merge-params org-babel-default-header-args
(org-babel-params-from-properties lang) (if ... ... nil) raw-params)))) (setf
hash (org-babel-sha1-hash info))) (setf (nth 1 info) (if (org-babel-noweb-p
(nth 2 info) :export) (org-babel-expand-noweb-references info (get-file-buffer
org-current-export-file)) (nth 1 info))) (org-babel-exp-do-export info (quote
block) hash)))
(save-excursion (goto-char (match-beginning 0)) (let* ((info
(org-babel-get-src-block-info (quote light))) (lang (nth 0 info)) (raw-params
(nth 2 info)) hash) (when info (when (member (cdr (assoc :exports (nth 2
info))) (quote ("both" "results"))) (org-babel-exp-in-export-file lang (setf
(nth 2 info) (org-babel-process-params (org-babel-merge-params
org-babel-default-header-args ... ... raw-params)))) (setf hash
(org-babel-sha1-hash info))) (setf (nth 1 info) (if (org-babel-noweb-p (nth 2
info) :export) (org-babel-expand-noweb-references info (get-file-buffer
org-current-export-file)) (nth 1 info))) (org-babel-exp-do-export info (quote
block) hash))))
org-babel-exp-src-block("" #("emacs-lisp" 0 10 (font-lock-fontified t
fontified t)) #(":exports" 0 8 (font-lock-fontified t fontified t)) #("both" 0
4 (font-lock-fontified t fontified t)) #(":results" 0 8 (font-lock-fontified t
fontified t)) #("silent" 0 6 (font-lock-fontified t fontified t)))
apply(org-babel-exp-src-block "" (#("emacs-lisp" 0 10 (font-lock-fontified t
fontified t)) #(":exports" 0 8 (font-lock-fontified t fontified t)) #("both" 0
4 (font-lock-fontified t fontified t)) #(":results" 0 8 (font-lock-fontified t
fontified t)) #("silent" 0 6 (font-lock-fontified t fontified t))))
(if (memq type org-export-blocks-witheld) "" (apply func body headers))
(progn (if (memq type org-export-blocks-witheld) "" (apply func body
headers)))
(unwind-protect (progn (if (memq type org-export-blocks-witheld) "" (apply
func body headers))) (set-match-data save-match-data-internal (quote
evaporate)))
(let ((save-match-data-internal (match-data))) (unwind-protect (progn (if
(memq type org-export-blocks-witheld) "" (apply func body headers)))
(set-match-data save-match-data-internal (quote evaporate))))
(save-match-data (if (memq type org-export-blocks-witheld) "" (apply func
body headers)))
(let ((replacement (save-match-data (if (memq type org-export-blocks-witheld)
"" (apply func body headers))))) (when replacement (delete-region match-start
match-end) (goto-char match-start) (insert replacement) (unless preserve-indent
(indent-code-rigidly match-start (point) indentation))))
(progn (let ((replacement (save-match-data (if (memq type
org-export-blocks-witheld) "" (apply func body headers))))) (when replacement
(delete-region match-start match-end) (goto-char match-start) (insert
replacement) (unless preserve-indent (indent-code-rigidly match-start (point)
indentation)))))
(if (setq func (cadr (assoc type org-export-blocks))) (progn (let
((replacement (save-match-data (if (memq type org-export-blocks-witheld) ""
(apply func body headers))))) (when replacement (delete-region match-start
match-end) (goto-char match-start) (insert replacement) (unless preserve-indent
(indent-code-rigidly match-start (point) indentation))))))
(when (setq func (cadr (assoc type org-export-blocks))) (let ((replacement
(save-match-data (if (memq type org-export-blocks-witheld) "" (apply func body
headers))))) (when replacement (delete-region match-start match-end) (goto-char
match-start) (insert replacement) (unless preserve-indent (indent-code-rigidly
match-start (point) indentation)))))
(let* ((match-start (copy-marker (match-beginning 0))) (body-start
(copy-marker (match-end 0))) (indentation (length (match-string 1))) (inner-re
(format "^[ ]*#\\+\\(begin\\|end\\)_%s" (regexp-quote (downcase
(match-string 2))))) (type (intern (downcase (match-string 2)))) (headers
(save-match-data (org-split-string (match-string 3) "[ ]+"))) (balanced 1)
(preserve-indent (or org-src-preserve-indentation (member "-i" headers)))
match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil
t)) (if (string= (downcase (match-string 1)) "end") (decf balanced) (incf
balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks
with %S" type (buffer-substring match-start (point)))) (setq match-end
(copy-marker (match-end 0))) (unless preserve-indent (setq body
(save-match-data (org-remove-indentation (buffer-substring body-start
(match-beginning 0)))))) (unless (memq type types) (setq types (cons type
types))) (save-match-data (interblock star
t match-start)) (when (setq func (cadr (assoc type org-export-blocks))) (let
((replacement (save-match-data (if (memq type org-export-blocks-witheld) ""
(apply func body headers))))) (when replacement (delete-region match-start
match-end) (goto-char match-start) (insert replacement) (unless preserve-indent
(indent-code-rigidly match-start (point) indentation))))) (set-marker
match-start nil) (set-marker body-start nil) (set-marker match-end nil))
(while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker
(match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation
(length (match-string 1))) (inner-re (format "^[
]*#\\+\\(begin\\|end\\)_%s" (regexp-quote (downcase (match-string 2))))) (type
(intern (downcase (match-string 2)))) (headers (save-match-data
(org-split-string (match-string 3) "[ ]+"))) (balanced 1) (preserve-indent
(or org-src-preserve-indentation (member "-i" headers))) match-end) (while (and
(not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string=
(downcase (match-string 1)) "end") (decf balanced) (incf balanced))) (when (not
(zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type
(buffer-substring match-start (point)))) (setq match-end (copy-marker
(match-end 0))) (unless preserve-indent (setq body (save-match-data
(org-remove-indentation (buffer-substring body-start (match-beginning 0))))))
(unless (memq type types) (setq types (cons type ty
pes))) (save-match-data (interblock start match-start)) (when (setq func (cadr
(assoc type org-export-blocks))) (let ((replacement (save-match-data (if ... ""
...)))) (when replacement (delete-region match-start match-end) (goto-char
match-start) (insert replacement) (unless preserve-indent (indent-code-rigidly
match-start (point) indentation))))) (set-marker match-start nil) (set-marker
body-start nil) (set-marker match-end nil)) (setq start (point)))
(let ((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\n]"))
(while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker
(match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation
(length (match-string 1))) (inner-re (format "^[
]*#\\+\\(begin\\|end\\)_%s" (regexp-quote (downcase ...)))) (type (intern
(downcase (match-string 2)))) (headers (save-match-data (org-split-string
(match-string 3) "[ ]+"))) (balanced 1) (preserve-indent (or
org-src-preserve-indentation (member "-i" headers))) match-end) (while (and
(not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string=
(downcase (match-string 1)) "end") (decf balanced) (incf balanced))) (when (not
(zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type
(buffer-substring match-start (point)))) (setq match-end (copy-marker
(match-end 0))) (unless preserve-indent (setq body (save-match-data
(org-remove-indentation (buffer-substring body-start ...))))) (unless (
memq type types) (setq types (cons type types))) (save-match-data (interblock
start match-start)) (when (setq func (cadr (assoc type org-export-blocks)))
(let ((replacement (save-match-data ...))) (when replacement (delete-region
match-start match-end) (goto-char match-start) (insert replacement) (unless
preserve-indent (indent-code-rigidly match-start ... indentation)))))
(set-marker match-start nil) (set-marker body-start nil) (set-marker match-end
nil)) (setq start (point))))
(progn (fset (quote interblock) (function* (lambda (start end) (block
interblock (mapcar (lambda (pair) (funcall ... start end))
org-export-interblocks))))) (goto-char (point-min)) (setq start (point)) (let
((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\n]"))
(while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker
(match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation
(length (match-string 1))) (inner-re (format "^[
]*#\\+\\(begin\\|end\\)_%s" (regexp-quote ...))) (type (intern (downcase ...)))
(headers (save-match-data (org-split-string ... "[ ]+"))) (balanced 1)
(preserve-indent (or org-src-preserve-indentation (member "-i" headers)))
match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil
t)) (if (string= (downcase ...) "end") (decf balanced) (incf balanced))) (when
(not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type
(buffer-substring match-start (point)))) (setq match-end
(copy-marker (match-end 0))) (unless preserve-indent (setq body
(save-match-data (org-remove-indentation ...)))) (unless (memq type types)
(setq types (cons type types))) (save-match-data (interblock start
match-start)) (when (setq func (cadr (assoc type org-export-blocks))) (let
((replacement ...)) (when replacement (delete-region match-start match-end)
(goto-char match-start) (insert replacement) (unless preserve-indent ...))))
(set-marker match-start nil) (set-marker body-start nil) (set-marker match-end
nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook)))
(unwind-protect (progn (fset (quote interblock) (function* (lambda (start
end) (block interblock (mapcar (lambda ... ...) org-export-interblocks)))))
(goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([
]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\n]")) (while (re-search-forward
beg-re nil t) (let* ((match-start (copy-marker ...)) (body-start (copy-marker
...)) (indentation (length ...)) (inner-re (format "^[
]*#\\+\\(begin\\|end\\)_%s" ...)) (type (intern ...)) (headers (save-match-data
...)) (balanced 1) (preserve-indent (or org-src-preserve-indentation ...))
match-end) (while (and (not ...) (re-search-forward inner-re nil t)) (if
(string= ... "end") (decf balanced) (incf balanced))) (when (not (zerop
balanced)) (error "unbalanced begin/end_%s blocks with %S" type
(buffer-substring match-start ...))) (setq match-end (copy-marker (match-end
0))) (unless preserve-indent (setq body (save-match-data ...))) (unless (memq
type types) (setq types (cons type types)))
(save-match-data (interblock start match-start)) (when (setq func (cadr ...))
(let (...) (when replacement ... ... ... ...))) (set-marker match-start nil)
(set-marker body-start nil) (set-marker match-end nil)) (setq start (point))))
(interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook))) (if --cl-letf-bound-- (fset (quote
interblock) --cl-letf-save--) (fmakunbound (quote interblock))))
(let* ((--cl-letf-bound-- (fboundp (quote interblock))) (--cl-letf-save--
(and --cl-letf-bound-- (symbol-function (quote interblock))))) (unwind-protect
(progn (fset (quote interblock) (function* (lambda (start end) (block
interblock (mapcar ... org-export-interblocks))))) (goto-char (point-min))
(setq start (point)) (let ((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[
]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start
...) (body-start ...) (indentation ...) (inner-re ...) (type ...) (headers ...)
(balanced 1) (preserve-indent ...) match-end) (while (and ... ...) (if ... ...
...)) (when (not ...) (error "unbalanced begin/end_%s blocks with %S" type
...)) (setq match-end (copy-marker ...)) (unless preserve-indent (setq body
...)) (unless (memq type types) (setq types ...)) (save-match-data (interblock
start match-start)) (when (setq func ...) (let ... ...)) (set-marker
match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq s
tart (point)))) (interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook))) (if --cl-letf-bound-- (fset (quote
interblock) --cl-letf-save--) (fmakunbound (quote interblock)))))
(letf (((symbol-function (quote interblock)) (function* (lambda (start end)
(block interblock (mapcar (lambda ... ...) org-export-interblocks))))))
(goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([
]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\n]")) (while (re-search-forward
beg-re nil t) (let* ((match-start (copy-marker (match-beginning 0)))
(body-start (copy-marker (match-end 0))) (indentation (length (match-string
1))) (inner-re (format "^[ ]*#\\+\\(begin\\|end\\)_%s" (regexp-quote
...))) (type (intern (downcase ...))) (headers (save-match-data
(org-split-string ... "[ ]+"))) (balanced 1) (preserve-indent (or
org-src-preserve-indentation (member "-i" headers))) match-end) (while (and
(not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string=
(downcase ...) "end") (decf balanced) (incf balanced))) (when (not (zerop
balanced)) (error "unbalanced begin/end_%s blocks with %S" type
(buffer-substring match-start (point)))) (setq match-end (copy-mar
ker (match-end 0))) (unless preserve-indent (setq body (save-match-data
(org-remove-indentation ...)))) (unless (memq type types) (setq types (cons
type types))) (save-match-data (interblock start match-start)) (when (setq func
(cadr (assoc type org-export-blocks))) (let ((replacement ...)) (when
replacement (delete-region match-start match-end) (goto-char match-start)
(insert replacement) (unless preserve-indent ...)))) (set-marker match-start
nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start
(point)))) (interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook)))
(letf* (((symbol-function (quote interblock)) (function* (lambda (start end)
(block interblock (mapcar (lambda ... ...) org-export-interblocks))))))
(goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([
]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\n]")) (while (re-search-forward
beg-re nil t) (let* ((match-start (copy-marker (match-beginning 0)))
(body-start (copy-marker (match-end 0))) (indentation (length (match-string
1))) (inner-re (format "^[ ]*#\\+\\(begin\\|end\\)_%s" (regexp-quote
...))) (type (intern (downcase ...))) (headers (save-match-data
(org-split-string ... "[ ]+"))) (balanced 1) (preserve-indent (or
org-src-preserve-indentation (member "-i" headers))) match-end) (while (and
(not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string=
(downcase ...) "end") (decf balanced) (incf balanced))) (when (not (zerop
balanced)) (error "unbalanced begin/end_%s blocks with %S" type
(buffer-substring match-start (point)))) (setq match-end (copy-ma
rker (match-end 0))) (unless preserve-indent (setq body (save-match-data
(org-remove-indentation ...)))) (unless (memq type types) (setq types (cons
type types))) (save-match-data (interblock start match-start)) (when (setq func
(cadr (assoc type org-export-blocks))) (let ((replacement ...)) (when
replacement (delete-region match-start match-end) (goto-char match-start)
(insert replacement) (unless preserve-indent ...)))) (set-marker match-start
nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start
(point)))) (interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook)))
(flet ((interblock (start end) (mapcar (lambda (pair) (funcall (second pair)
start end)) org-export-interblocks))) (goto-char (point-min)) (setq start
(point)) (let ((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[
]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start
(copy-marker (match-beginning 0))) (body-start (copy-marker (match-end 0)))
(indentation (length (match-string 1))) (inner-re (format "^[
]*#\\+\\(begin\\|end\\)_%s" (regexp-quote ...))) (type (intern (downcase ...)))
(headers (save-match-data (org-split-string ... "[ ]+"))) (balanced 1)
(preserve-indent (or org-src-preserve-indentation (member "-i" headers)))
match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil
t)) (if (string= (downcase ...) "end") (decf balanced) (incf balanced))) (when
(not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type
(buffer-substring match-start (point)))) (setq match-end (copy-marker
(match-end 0))) (unless prese
rve-indent (setq body (save-match-data (org-remove-indentation ...)))) (unless
(memq type types) (setq types (cons type types))) (save-match-data (interblock
start match-start)) (when (setq func (cadr (assoc type org-export-blocks)))
(let ((replacement ...)) (when replacement (delete-region match-start
match-end) (goto-char match-start) (insert replacement) (unless preserve-indent
...)))) (set-marker match-start nil) (set-marker body-start nil) (set-marker
match-end nil)) (setq start (point)))) (interblock start (point-max))
(run-hooks (quote org-export-blocks-postblock-hook)))
(let ((case-fold-search t) (types (quote nil)) matched indentation type func
start end body headers preserve-indent progress-marker) (flet ((interblock
(start end) (mapcar (lambda (pair) (funcall (second pair) start end))
org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let
((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\n]")) (while
(re-search-forward beg-re nil t) (let* ((match-start (copy-marker ...))
(body-start (copy-marker ...)) (indentation (length ...)) (inner-re (format "^[
]*#\\+\\(begin\\|end\\)_%s" ...)) (type (intern ...)) (headers
(save-match-data ...)) (balanced 1) (preserve-indent (or
org-src-preserve-indentation ...)) match-end) (while (and (not ...)
(re-search-forward inner-re nil t)) (if (string= ... "end") (decf balanced)
(incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s
blocks with %S" type (buffer-substring match-start ...))) (setq match-end
(copy-marker (match-end 0))) (unless preserve-i
ndent (setq body (save-match-data ...))) (unless (memq type types) (setq types
(cons type types))) (save-match-data (interblock start match-start)) (when
(setq func (cadr ...)) (let (...) (when replacement ... ... ... ...)))
(set-marker match-start nil) (set-marker body-start nil) (set-marker match-end
nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook))))
(progn (let ((case-fold-search t) (types (quote nil)) matched indentation
type func start end body headers preserve-indent progress-marker) (flet
((interblock (start end) (mapcar (lambda (pair) (funcall ... start end))
org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let
((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\n]"))
(while (re-search-forward beg-re nil t) (let* ((match-start ...) (body-start
...) (indentation ...) (inner-re ...) (type ...) (headers ...) (balanced 1)
(preserve-indent ...) match-end) (while (and ... ...) (if ... ... ...)) (when
(not ...) (error "unbalanced begin/end_%s blocks with %S" type ...)) (setq
match-end (copy-marker ...)) (unless preserve-indent (setq body ...)) (unless
(memq type types) (setq types ...)) (save-match-data (interblock start
match-start)) (when (setq func ...) (let ... ...)) (set-marker match-start nil)
(set-marker body-start nil) (set-marker match-end nil)) (setq start (point))))
(interblock s
tart (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))))
(unwind-protect (progn (let ((case-fold-search t) (types (quote nil)) matched
indentation type func start end body headers preserve-indent progress-marker)
(flet ((interblock (start end) (mapcar (lambda ... ...)
org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let
((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\n]")) (while
(re-search-forward beg-re nil t) (let* (... ... ... ... ... ... ... ...
match-end) (while ... ...) (when ... ...) (setq match-end ...) (unless
preserve-indent ...) (unless ... ...) (save-match-data ...) (when ... ...)
(set-marker match-start nil) (set-marker body-start nil) (set-marker match-end
nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook))))) (set-window-configuration wconfig))
(let ((wconfig (current-window-configuration))) (unwind-protect (progn (let
((case-fold-search t) (types (quote nil)) matched indentation type func start
end body headers preserve-indent progress-marker) (flet ((interblock (start
end) (mapcar ... org-export-interblocks))) (goto-char (point-min)) (setq start
(point)) (let ((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[
]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ... ... ...
... ... ... ... ... ... ... ...) (setq start ...))) (interblock start
(point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))))
(set-window-configuration wconfig)))
(save-window-excursion (let ((case-fold-search t) (types (quote nil)) matched
indentation type func start end body headers preserve-indent progress-marker)
(flet ((interblock (start end) (mapcar (lambda (pair) (funcall ... start end))
org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let
((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[\n]"))
(while (re-search-forward beg-re nil t) (let* ((match-start ...) (body-start
...) (indentation ...) (inner-re ...) (type ...) (headers ...) (balanced 1)
(preserve-indent ...) match-end) (while (and ... ...) (if ... ... ...)) (when
(not ...) (error "unbalanced begin/end_%s blocks with %S" type ...)) (setq
match-end (copy-marker ...)) (unless preserve-indent (setq body ...)) (unless
(memq type types) (setq types ...)) (save-match-data (interblock start
match-start)) (when (setq func ...) (let ... ...)) (set-marker match-start nil)
(set-marker body-start nil) (set-marker match-end nil)) (setq start (point))
)) (interblock start (point-max)) (run-hooks (quote
org-export-blocks-postblock-hook)))))
org-export-blocks-preprocess()
(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-exp
ort-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-li
st-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-targe
ts 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 t
arget-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-g
et 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-remo
ve-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-en
d) (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 ta
rget-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-tre
es) (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-conca
tenate-multiline-links) (run-hooks (quote
org-export-preprocess-before-normalizing-links-hook))
(org-export-normalize-links) ...) rtn)
org-export-preprocess-string(#("#+LATEX_CLASS: article\n#+LaTeX_HEADER:
\\usepackage{minted}\n#+LaTeX_HEADER: \\usemintedstyle{emacs}\n#+LaTeX_HEADER:
\\newminted{common-lisp}{fontsize=\\footnotesize}\n\n#+name:
setup-minted\n#+begin_src emacs-lisp :exports both :results silent\n (setq
org-export-latex-listings 'minted)\n (setq
org-export-latex-custom-lang-environments\n '(\n
(emacs-lisp \"common-lispcode\")\n ))\n (setq
org-export-latex-minted-options\n '((\"frame\" \"lines\")\n
(\"fontsize\" \"\\\\scriptsize\")\n (\"linenos\" \"\")))\n
(setq org-latex-to-pdf-process\n '(\"pdflatex -shell-escape
-interaction nonstopmode -output-directory %o %f\"\n \"pdflatex
-shell-escape -interaction nonstopmode -output-directory %o %f\"\n
\"pdflatex -shell-escape -interaction nonstopmode -output-directory %o
%f\"))\n#+end_src\n\n#+name: another-listing\n#+begin_src python
:exports code\n x = str(y)\n#+end_src\n" 0 22 (fontified t
font-lock-fontified t face org-meta-line) 22 23 (fontified t
font-lock-fontified t face org-meta-line) 23 58 (fontified t
font-lock-fontified t face org-meta-line) 58 59 (fontified t
font-lock-fontified t face org-meta-line) 59 97 (fontified t
font-lock-fontified t face org-meta-line) 97 98 (fontified t
font-lock-fontified t face org-meta-line) 98 161 (fontified t
font-lock-fontified t face org-meta-line) 161 162 (fontified t
font-lock-fontified t face org-meta-line) 162 163 (fontified t
:org-license-to-kill t) 163 183 (fontified t font-lock-fontified t face
org-meta-line) 183 184 (fontified t font-lock-fontified t face org-meta-line)
184 236 (fontified t font-lock-fontified t face org-block-begin-line
font-lock-multiline t) 236 237 (fontified t font-lock-fontified t
font-lock-multiline t face org-block-begin-line) 237 524 (fontified t
font-lock-fontified t font-lock-multiline t face org-block :org-license-to-kill
t) 524 764 (fontified t font-lock-fontified t font-lock-multiline t face
org-block :org-license-to-kill t) 764 852 (fontified t font-lock-fontified t
font-lock-multiline t face org-block :org-license-to-kill t) 852 853 (fontified
t font-lock-fontified t font-lock-multiline t face org-block
:org-license-to-kill t) 853 862 (fontified t font-lock-fontified t face
org-block-end-line font-lock-multiline t) 862 863 (fontified t
font-lock-fontified t face org-block-end-line) 863 864 (fontified t
:org-license-to-kill t) 864 887 (fontified t font-lock-fontified t face
org-meta-line) 887 888 (fontified t font-lock-fontified t face org-meta-line)
888 920 (fontified t font-lock-fontified t face org-block-begin-line
font-lock-multiline t) 920 921 (fontified t font-lock-fontified t
font-lock-multiline t face org-block-begin-line) 921 934 (fontified t
font-lock-fontified t font-lock-multiline t face org-block :org-license-to-kill
t) 934 935 (fontified t font-lock-fontified t font-lock-mult
iline t face org-block :org-license-to-kill t) 935 944 (fontified t
font-lock-fontified t face org-block-end-line font-lock-multiline t) 944 945
(fontified t rear-nonsticky t face org-block-end-line)) :emph-multiline t
:for-backend latex :comments nil :tags t :priority nil :footnotes t :drawers t
: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))) (auto-insert nil)
(TeX-master t) (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 o
pt-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 nil nil nil nil nil)
(let* ((wconfig (current-window-configuration)) (lbuf (org-export-as-latex
arg hidden ext-plist to-buffer body-only pub-dir)) (file (buffer-file-name
lbuf)) (base (file-name-sans-extension (buffer-file-name lbuf))) (pdffile
(concat base ".pdf")) (cmds org-latex-to-pdf-process) (outbuf
(get-buffer-create "*Org PDF LaTeX Output*")) (bibtex-p (with-current-buffer
lbuf (save-excursion (goto-char (point-min)) (re-search-forward
"\\\\bibliography{" nil t)))) cmd output-dir errors) (with-current-buffer
outbuf (erase-buffer)) (message (concat "Processing LaTeX file " file "..."))
(setq output-dir (file-name-directory file)) (with-current-buffer lbuf
(save-excursion (if (and cmds (symbolp cmds)) (funcall cmds
(shell-quote-argument file)) (while cmds (setq cmd (pop cmds)) (while
(string-match "%b" cmd) (setq cmd (replace-match ... t t cmd))) (while
(string-match "%f" cmd) (setq cmd (replace-match ... t t cmd))) (while
(string-match "%o" cmd) (setq cmd (replace-match ... t t cmd))) (s
hell-command cmd outbuf))))) (message (concat "Processing LaTeX file " file
"...done")) (setq errors (org-export-latex-get-error outbuf)) (if (not
(file-exists-p pdffile)) (error (concat "PDF file " pdffile " was not produced"
(if errors (concat ":" errors "") ""))) (set-window-configuration wconfig)
(when org-export-pdf-remove-logfiles (dolist (ext org-export-pdf-logfiles)
(setq file (concat base "." ext)) (and (file-exists-p file) (delete-file
file)))) (message (concat "Exporting to PDF...done" (if errors (concat ", with
some errors:" errors) ""))) pdffile))
org-export-as-pdf(nil)
(let ((pdffile (org-export-as-pdf arg))) (if pdffile (progn (org-open-file
pdffile) (when org-export-kill-product-buffer-when-displayed (kill-buffer
(find-buffer-visiting (concat (file-name-sans-extension ...) ".tex"))))) (error
"PDF file was not produced")))
org-export-as-pdf-and-open(nil)
call-interactively(org-export-as-pdf-and-open)
(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 OpenDocument Text [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 Hardake
r'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 or
g-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) (setq bpos (point))
(message "Export subtree: ")))) (when (eq r1 32) (let ((case-fold-search t)
(end (save-excursion ... ...))) (outl
ine-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")))))) (if (fboundp (quote
redisplay)) (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)