From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: [Bug] Export of including files with minlevel broken Date: Wed, 31 Aug 2011 16:59:18 -0400 Message-ID: <18466.1314824358@alphaville.dokosmarshall.org> References: <87bov59uex.fsf@googlemail.com> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qyrse-0001mq-Jp for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 16:59:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qyrsa-0005Wh-KJ for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 16:59:28 -0400 Received: from g4t0014.houston.hp.com ([15.201.24.17]:7696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qyrsa-0005WJ-27 for emacs-orgmode@gnu.org; Wed, 31 Aug 2011 16:59:24 -0400 In-Reply-To: Message from Michael Markert of "Wed\, 31 Aug 2011 22\:51\:18 +0200." <87bov59uex.fsf@googlemail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Markert Cc: nicholas.dokos@hp.com, Org-mode mailing list --=-=-= Content-Type: text/plain Michael Markert wrote: > > Hi, > > In the current head exporting a org that includes other org files with > `:minlevel' is broken and results in an infinite loop. > > This is a regression from release 7.7 -- don't have the time to track it > down any further right now :( > > Attached a minimal example with which I can reproduce. > > Michael > > > * bar > #+INCLUDE: "bar.org" org :minlevel 1 > * foo I can reproduce - I set debug-on-quit and got a backtrace (attached): it fingers org-fixup-indentation. Nick --=-=-= Content-Type: text/x-lisp Content-Disposition: attachment; filename=bt.txt Content-Transfer-Encoding: quoted-printable Content-Description: backtrace on quit Debugger entered--Lisp error: (quit) regexp-opt(nil) (concat "\\(" (regexp-opt org-all-time-keywords) "\\|" "^[ ]*" org-tsr-r= egexp-both "*$" "\\|" "^[ ]*:[a-zA-Z][a-zA-Z0-9_]*:.*$" "\\)") (re-search-forward (concat "\\(" (regexp-opt org-all-time-keywords) "\\|"= "^[ ]*" org-tsr-regexp-both "*$" "\\|" "^[ ]*:[a-zA-Z][a-zA-Z0-9_]*:.*$"= "\\)") (or drawer-end end) t) (while (re-search-forward (concat "\\(" (regexp-opt org-all-time-keywords= ) "\\|" "^[ ]*" org-tsr-regexp-both "*$" "\\|" "^[ ]*:[a-zA-Z][a-zA-Z0-9_= ]*:.*$" "\\)") (or drawer-end end) t) (beginning-of-line) (when (looking-at= "^[ ]+") (goto-char (match-end 0)) (setq col (current-column)) (if (< dif= f 0) (replace-match "")) (org-indent-to-column (+ diff col)) (if drawer-end= (setq drawer-end (+ diff drawer-end)))) (end-of-line)) (let* ((end (save-excursion (outline-next-heading) (point-marker))) (draw= er-end (save-excursion (and (re-search-forward org-property-end-re end t) (= match-end 0)))) (prohibit (if (> diff 0) "^\\S-" (concat "^ \\{0," (int-to-= string (- diff)) "\\}\\S-"))) col) (while (re-search-forward (concat "\\(" = (regexp-opt org-all-time-keywords) "\\|" "^[ ]*" org-tsr-regexp-both "*$" = "\\|" "^[ ]*:[a-zA-Z][a-zA-Z0-9_]*:.*$" "\\)") (or drawer-end end) t) (beg= inning-of-line) (when (looking-at "^[ ]+") (goto-char (match-end 0)) (setq= col (current-column)) (if (< diff 0) (replace-match "")) (org-indent-to-co= lumn (+ diff col)) (if drawer-end (setq drawer-end (+ diff drawer-end)))) (= end-of-line)) (unless (save-excursion (end-of-line 1) (re-search-forward pr= ohibit end t)) (while (and (< (point) end) (re-search-forward "^[ ]+" end = t)) (goto-char (match-end 0)) (setq col (current-column)) (if (< diff 0) (r= eplace-match "")) (org-indent-to-column (+ diff col)))) (move-marker end ni= l)) (save-excursion (let* ((end (save-excursion (outline-next-heading) (point= -marker))) (drawer-end (save-excursion (and (re-search-forward org-property= -end-re end t) (match-end 0)))) (prohibit (if (> diff 0) "^\\S-" (concat "^= \\{0," (int-to-string (- diff)) "\\}\\S-"))) col) (while (re-search-forwar= d (concat "\\(" (regexp-opt org-all-time-keywords) "\\|" "^[ ]*" org-tsr-r= egexp-both "*$" "\\|" "^[ ]*:[a-zA-Z][a-zA-Z0-9_]*:.*$" "\\)") (or drawer-= end end) t) (beginning-of-line) (when (looking-at "^[ ]+") (goto-char (mat= ch-end 0)) (setq col (current-column)) (if (< diff 0) (replace-match "")) (= org-indent-to-column (+ diff col)) (if drawer-end (setq drawer-end (+ diff = drawer-end)))) (end-of-line)) (unless (save-excursion (end-of-line 1) (re-s= earch-forward prohibit end t)) (while (and (< (point) end) (re-search-forwa= rd "^[ ]+" end t)) (goto-char (match-end 0)) (setq col (current-column)) (= if (< diff 0) (replace-match "")) (org-indent-to-column (+ diff col)))) (mo= ve-marker end nil))) org-fixup-indentation(1) (if org-adapt-indentation (org-fixup-indentation diff)) (let* ((level (save-match-data (funcall outline-level))) (after-change-fu= nctions (remove (quote flyspell-after-change-function) after-change-functio= ns)) (down-head (concat (make-string (org-get-valid-level level 1) 42) " ")= ) (diff (abs (- level (length down-head) -1)))) (replace-match down-head ni= l t) (and org-auto-align-tags (org-set-tags nil t)) (if org-adapt-indentati= on (org-fixup-indentation diff)) (run-hooks (quote org-after-demote-entry-h= ook))) org-demote() funcall(org-demote) (if (and (re-search-forward org-outline-regexp-bol nil t) (< (point) end)= ) (funcall fun)) (save-excursion (setq end (copy-marker end)) (goto-char beg) (if (and (re= -search-forward org-outline-regexp-bol nil t) (< (point) end)) (funcall fun= )) (while (and (progn (outline-next-heading) (< (point) end)) (not (eobp)))= (funcall fun))) (let ((org-ignore-region t)) (save-excursion (setq end (copy-marker end))= (goto-char beg) (if (and (re-search-forward org-outline-regexp-bol nil t) = (< (point) end)) (funcall fun)) (while (and (progn (outline-next-heading) (= < (point) end)) (not (eobp))) (funcall fun)))) org-map-region(org-demote 1 8) (while (< lvl --cl-dotimes-temp--) (org-map-region (quote org-demote) (po= int-min) (point-max)) (incf lvl)) (let ((--cl-dotimes-temp-- minlevel) (lvl 0)) (while (< lvl --cl-dotimes-= temp--) (org-map-region (quote org-demote) (point-min) (point-max)) (incf l= vl))) (catch (quote --cl-block-nil--) (let ((--cl-dotimes-temp-- minlevel) (lvl= 0)) (while (< lvl --cl-dotimes-temp--) (org-map-region (quote org-demote) = (point-min) (point-max)) (incf lvl)))) (cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dotimes-tem= p-- minlevel) (lvl 0)) (while (< lvl --cl-dotimes-temp--) (org-map-region (= quote org-demote) (point-min) (point-max)) (incf lvl))))) (block nil (let ((--cl-dotimes-temp-- minlevel) (lvl 0)) (while (< lvl --= cl-dotimes-temp--) (org-map-region (quote org-demote) (point-min) (point-ma= x)) (incf lvl)))) (dotimes (lvl minlevel) (org-map-region (quote org-demote) (point-min) (p= oint-max))) (progn (dotimes (lvl minlevel) (org-map-region (quote org-demote) (point-= min) (point-max)))) (if minlevel (progn (dotimes (lvl minlevel) (org-map-region (quote org-de= mote) (point-min) (point-max))))) (when minlevel (dotimes (lvl minlevel) (org-map-region (quote org-demote)= (point-min) (point-max)))) (progn (insert-file-contents file) (when lines (let* ((lines (split-strin= g lines "-")) (lbeg (string-to-number (car lines))) (lend (string-to-number= (cadr lines))) (beg (if (zerop lbeg) (point-min) (goto-char (point-min)) (= forward-line (1- lbeg)) (point))) (end (if (zerop lend) (point-max) (goto-c= har (point-min)) (forward-line (1- lend)) (point)))) (narrow-to-region beg = end))) (when (or prefix prefix1) (goto-char (point-min)) (while (not (eobp)= ) (insert (or prefix1 prefix)) (setq prefix1 "") (beginning-of-line 2))) (b= uffer-string) (when (member markup (quote ("src" "example"))) (goto-char (p= oint-min)) (while (re-search-forward "^\\([*#]\\|[ ]*#\\+\\)" nil t) (goto= -char (match-beginning 0)) (insert ",") (end-of-line 1))) (when minlevel (d= otimes (lvl minlevel) (org-map-region (quote org-demote) (point-min) (point= -max)))) (buffer-string)) (unwind-protect (progn (insert-file-contents file) (when lines (let* ((li= nes (split-string lines "-")) (lbeg (string-to-number (car lines))) (lend (= string-to-number (cadr lines))) (beg (if (zerop lbeg) (point-min) (goto-cha= r ...) (forward-line ...) (point))) (end (if (zerop lend) (point-max) (goto= -char ...) (forward-line ...) (point)))) (narrow-to-region beg end))) (when= (or prefix prefix1) (goto-char (point-min)) (while (not (eobp)) (insert (o= r prefix1 prefix)) (setq prefix1 "") (beginning-of-line 2))) (buffer-string= ) (when (member markup (quote ("src" "example"))) (goto-char (point-min)) (= while (re-search-forward "^\\([*#]\\|[ ]*#\\+\\)" nil t) (goto-char (match= -beginning 0)) (insert ",") (end-of-line 1))) (when minlevel (dotimes (lvl = minlevel) (org-map-region (quote org-demote) (point-min) (point-max)))) (bu= ffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (ins= ert-file-contents file) (when lines (let* ((lines (split-string lines "-"))= (lbeg (string-to-number ...)) (lend (string-to-number ...)) (beg (if ... .= .. ... ... ...)) (end (if ... ... ... ... ...))) (narrow-to-region beg end)= )) (when (or prefix prefix1) (goto-char (point-min)) (while (not (eobp)) (i= nsert (or prefix1 prefix)) (setq prefix1 "") (beginning-of-line 2))) (buffe= r-string) (when (member markup (quote ("src" "example"))) (goto-char (point= -min)) (while (re-search-forward "^\\([*#]\\|[ ]*#\\+\\)" nil t) (goto-cha= r (match-beginning 0)) (insert ",") (end-of-line 1))) (when minlevel (dotim= es (lvl minlevel) (org-map-region (quote org-demote) (point-min) (point-max= )))) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buff= er)))) (with-current-buffer temp-buffer (unwind-protect (progn (insert-file-cont= ents file) (when lines (let* ((lines (split-string lines "-")) (lbeg (strin= g-to-number ...)) (lend (string-to-number ...)) (beg (if ... ... ... ... ..= .)) (end (if ... ... ... ... ...))) (narrow-to-region beg end))) (when (or = prefix prefix1) (goto-char (point-min)) (while (not (eobp)) (insert (or pre= fix1 prefix)) (setq prefix1 "") (beginning-of-line 2))) (buffer-string) (wh= en (member markup (quote ("src" "example"))) (goto-char (point-min)) (while= (re-search-forward "^\\([*#]\\|[ ]*#\\+\\)" nil t) (goto-char (match-begi= nning 0)) (insert ",") (end-of-line 1))) (when minlevel (dotimes (lvl minle= vel) (org-map-region (quote org-demote) (point-min) (point-max)))) (buffer-= string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer= temp-buffer (unwind-protect (progn (insert-file-contents file) (when lines= (let* ((lines ...) (lbeg ...) (lend ...) (beg ...) (end ...)) (narrow-to-r= egion beg end))) (when (or prefix prefix1) (goto-char (point-min)) (while (= not (eobp)) (insert (or prefix1 prefix)) (setq prefix1 "") (beginning-of-li= ne 2))) (buffer-string) (when (member markup (quote ("src" "example"))) (go= to-char (point-min)) (while (re-search-forward "^\\([*#]\\|[ ]*#\\+\\)" ni= l t) (goto-char (match-beginning 0)) (insert ",") (end-of-line 1))) (when m= inlevel (dotimes (lvl minlevel) (org-map-region (quote org-demote) (point-m= in) (point-max)))) (buffer-string)) (and (buffer-name temp-buffer) (kill-bu= ffer temp-buffer))))) (with-temp-buffer (insert-file-contents file) (when lines (let* ((lines (= split-string lines "-")) (lbeg (string-to-number (car lines))) (lend (strin= g-to-number (cadr lines))) (beg (if (zerop lbeg) (point-min) (goto-char (po= int-min)) (forward-line (1- lbeg)) (point))) (end (if (zerop lend) (point-m= ax) (goto-char (point-min)) (forward-line (1- lend)) (point)))) (narrow-to-= region beg end))) (when (or prefix prefix1) (goto-char (point-min)) (while = (not (eobp)) (insert (or prefix1 prefix)) (setq prefix1 "") (beginning-of-l= ine 2))) (buffer-string) (when (member markup (quote ("src" "example"))) (g= oto-char (point-min)) (while (re-search-forward "^\\([*#]\\|[ ]*#\\+\\)" n= il t) (goto-char (match-beginning 0)) (insert ",") (end-of-line 1))) (when = minlevel (dotimes (lvl minlevel) (org-map-region (quote org-demote) (point-= min) (point-max)))) (buffer-string)) org-get-file-contents("/home/nick/src/org/export/include/bar.org" nil nil= "org" 1 nil) (insert (org-get-file-contents (expand-file-name file) prefix prefix1 mar= kup minlevel lines)) (if (or (not file) (not (file-exists-p file)) (not (file-readable-p file)= )) (insert (format "CANNOT INCLUDE FILE %s" file)) (setq all (cons file all= )) (when markup (if (equal (downcase markup) "src") (setq start (format "#+= begin_src %s %s\n" (or lang "fundamental") (or switches "")) end "#+end_src= ") (setq start (format "#+begin_%s %s\n" markup switches) end (format "#+en= d_%s" markup)))) (insert (or start "")) (insert (org-get-file-contents (exp= and-file-name file) prefix prefix1 markup minlevel lines)) (or (bolp) (newl= ine)) (insert (or end ""))) (while (re-search-forward "^#\\+INCLUDE:?[ ]+\\(.*\\)" nil t) (setq para= ms (read (concat "(" (match-string 1) ")")) prefix (org-get-and-remove-prop= erty (quote params) :prefix) prefix1 (org-get-and-remove-property (quote pa= rams) :prefix1) minlevel (org-get-and-remove-property (quote params) :minle= vel) lines (org-get-and-remove-property (quote params) :lines) file (org-sy= mname-or-string (pop params)) markup (org-symname-or-string (pop params)) l= ang (and (member markup (quote ("src" "SRC"))) (org-symname-or-string (pop = params))) switches (mapconcat (function (lambda (x) (format "%s" x))) param= s " ") start nil end nil) (delete-region (match-beginning 0) (match-end 0))= (if (or (not file) (not (file-exists-p file)) (not (file-readable-p file))= ) (insert (format "CANNOT INCLUDE FILE %s" file)) (setq all (cons file all)= ) (when markup (if (equal (downcase markup) "src") (setq start (format "#+b= egin_src %s %s\n" (or lang "fundamental") (or switches "")) end "#+end_src"= ) (setq start (format "#+begin_%s %s\n" markup switches) end (format "#+end= _%s" markup)))) (insert (or start "")) (insert (org-get-file-contents (expa= nd-file-name file) prefix prefix1 markup minlevel lines)) (or (bolp) (newli= ne)) (insert (or end "")))) (let ((case-fold-search t) params file markup lang start end prefix prefi= x1 switches all minlevel lines) (goto-char (point-min)) (while (re-search-f= orward "^#\\+INCLUDE:?[ ]+\\(.*\\)" nil t) (setq params (read (concat "(" = (match-string 1) ")")) prefix (org-get-and-remove-property (quote params) := prefix) prefix1 (org-get-and-remove-property (quote params) :prefix1) minle= vel (org-get-and-remove-property (quote params) :minlevel) lines (org-get-a= nd-remove-property (quote params) :lines) file (org-symname-or-string (pop = params)) markup (org-symname-or-string (pop params)) lang (and (member mark= up (quote ("src" "SRC"))) (org-symname-or-string (pop params))) switches (m= apconcat (function (lambda (x) (format "%s" x))) params " ") start nil end = nil) (delete-region (match-beginning 0) (match-end 0)) (if (or (not file) (= not (file-exists-p file)) (not (file-readable-p file))) (insert (format "CA= NNOT INCLUDE FILE %s" file)) (setq all (cons file all)) (when markup (if (e= qual (downcase markup) "src") (setq start (format "#+begin_src %s %s\n" (or= lang "fundamental") (or switches "")) end "#+end_src") (setq start (format= "#+begin_%s %s\n" markup switches) end (format "#+end_%s" markup)))) (inse= rt (or start "")) (insert (org-get-file-contents (expand-file-name file) pr= efix prefix1 markup minlevel lines)) (or (bolp) (newline)) (insert (or end = "")))) all) org-export-handle-include-files() (setq now (org-export-handle-include-files)) (while now (setq all (append now all)) (setq now (org-export-handle-inclu= de-files)) (let ((intersection (delq nil (mapcar (lambda (el) (when ... el)= ) now)))) (when intersection (error "Recursive #+INCLUDE: %S" intersection)= ))) (let ((now (list org-current-export-file)) all) (while now (setq all (app= end now all)) (setq now (org-export-handle-include-files)) (let ((intersect= ion (delq nil (mapcar (lambda ... ...) now)))) (when intersection (error "R= ecursive #+INCLUDE: %S" intersection))))) org-export-handle-include-files-recurse() (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((in= hibit-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 sourc= e-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote o= rg-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) (or= g-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-ex= port-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameter= s :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-lis= t-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-pr= eprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mar= k-list-properties) (org-export-replace-src-segments-and-examples) (org-expo= rt-protect-colon-examples) (org-export-convert-protected-spaces) (setq targ= et-alist (org-export-define-heading-targets target-alist)) (run-hooks (quot= e org-export-preprocess-after-headline-targets-hook)) (org-export-remember-= html-container-classes) (org-export-remove-or-extract-drawers drawers (plis= t-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-he= ading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[= ]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (poi= nt-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char = (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-re= move-headline-metadata parameters) (setq target-alist (org-export-handle-in= visible-targets target-alist)) (run-hooks (quote org-export-preprocess-befo= re-selecting-backend-code-hook)) (org-export-select-backend-specific-text) = (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-e= xport-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hook= s (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get p= arameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (= org-export-attach-captions-and-attributes target-alist)) (org-export-mark-r= adio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hoo= k)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-p= reprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-sea= rch t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (po= int-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) (ru= n-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-ma= x)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-= preprocess-after-include-files-hook)) (org-export-remove-archived-trees arc= hived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-ha= ndle-export-tags (plist-get parameters :select-tags) (plist-get parameters = :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selectio= n-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (pli= st-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org= -export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quo= te org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess)= (org-export-mark-list-properties) (org-export-replace-src-segments-and-exa= mples) (org-export-protect-colon-examples) (org-export-convert-protected-sp= aces) (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-drawe= rs drawers (plist-get parameters :drawers)) (when (plist-get parameters :sk= ip-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-t= ext) (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-clo= ck-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-c= enter) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unl= ess (plist-get parameters :timestamps) (org-export-remove-timestamps)) (set= q target-alist (org-export-attach-captions-and-attributes target-alist)) (o= rg-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-r= adio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (qu= ote org-export-preprocess-before-normalizing-links-hook)) (org-export-norma= lize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (era= se-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-on= ly t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)= ))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mod= e)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\= (org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-pre= process-hook)) (untabify (point-min) (point-max)) (org-export-handle-includ= e-files-recurse) (run-hooks (quote org-export-preprocess-after-include-file= s-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remo= ve-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get p= arameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (q= uote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-t= asks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes)= (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-e= xport-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-afte= r-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-proper= ties) (org-export-replace-src-segments-and-examples) (org-export-protect-co= lon-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-containe= r-classes) (org-export-remove-or-extract-drawers drawers (plist-get paramet= ers :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)) (ins= ert "\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-p= rotect-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 :ti= mestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-at= tach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (= run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-expo= rt-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-bef= ore-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) (i= nsert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remov= e-text-properties (point-min) (point-max) (quote (read-only t)))) (org-expo= rt-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq cas= e-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtb= l-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)= ) (untabify (point-min) (point-max)) (org-export-handle-include-files-recur= se) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org= -export-remove-archived-trees archived-trees) (org-export-remove-comment-bl= ocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :se= lect-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-expo= rt-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-g= et parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnot= e-normalize nil parameters)) (org-export-mark-list-end) (org-export-preproc= ess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook= )) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-ex= port-replace-src-segments-and-examples) (org-export-protect-colon-examples)= (org-export-convert-protected-spaces) (setq target-alist (org-export-defin= e-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-af= ter-headline-targets-hook)) (org-export-remember-html-container-classes) (o= rg-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)= ) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-m= in)) (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 (plis= t-get parameters :add-text) "\n")) (org-export-remove-headline-metadata par= ameters) (setq target-alist (org-export-handle-invisible-targets target-ali= st)) (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) (o= rg-export-mark-blockquote-verse-center) (run-hooks (quote org-export-prepro= cess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (or= g-export-remove-timestamps)) (setq target-alist (org-export-attach-captions= -and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (qu= ote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenat= e-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizi= ng-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-bu= ffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer= temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq ca= se-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (poi= nt-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-l= etbind) (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-archive= d-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (or= g-export-handle-export-tags (plist-get parameters :select-tags) (plist-get = parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tr= ee-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks))= (when (plist-get parameters :footnotes) (org-footnote-normalize nil parame= ters)) (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-segme= nts-and-examples) (org-export-protect-colon-examples) (org-export-convert-p= rotected-spaces) (setq target-alist (org-export-define-heading-targets targ= et-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-h= ook)) (org-export-remember-html-container-classes) (org-export-remove-or-ex= tract-drawers drawers (plist-get parameters :drawers)) (when (plist-get par= ameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-= forward "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-be= ginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parame= ters :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-sel= ect-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export= -remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockqu= ote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-= hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timest= amps)) (setq target-alist (org-export-attach-captions-and-attributes target= -alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preproc= ess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (ru= n-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-e= xport-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer tem= p-buffer))))) (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t= ) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-m= ax) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhi= bit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-vari= ables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hoo= ks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (= org-export-handle-include-files-recurse) (run-hooks (quote org-export-prepr= ocess-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 :excl= ude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hoo= k)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-ge= t parameters :footnotes) (org-footnote-normalize nil parameters)) (org-expo= rt-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote or= g-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-expor= t-remember-html-container-classes) (org-export-remove-or-extract-drawers dr= awers (plist-get parameters :drawers)) (when (plist-get parameters :skip-be= fore-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*= \n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginning 0)) (got= o-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) = (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (or= g-export-remove-headline-metadata parameters) (setq target-alist (org-expor= t-handle-invisible-targets target-alist)) (run-hooks (quote org-export-prep= rocess-before-selecting-backend-code-hook)) (org-export-select-backend-spec= ific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-li= nes) (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 tar= get-alist (org-export-attach-captions-and-attributes target-alist)) (org-ex= port-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-= targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote o= rg-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 :archi= ved-trees)) (inhibit-read-only t) (drawers org-drawers) (source-buffer (cur= rent-buffer)) target-alist rtn) (setq org-export-target-aliases nil org-exp= ort-preferred-target-alist nil org-export-id-target-alist nil org-export-co= de-refs nil) (with-temp-buffer (erase-buffer) (insert string) (setq case-fo= ld-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-mi= n) (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-letbin= d) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (po= int-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-e= xport-preprocess-after-include-files-hook)) (org-export-remove-archived-tre= es archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-exp= ort-handle-export-tags (plist-get parameters :select-tags) (plist-get param= eters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-se= lection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (whe= n (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)= ) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hook= s (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-prepr= ocess) (org-export-mark-list-properties) (org-export-replace-src-segments-a= nd-examples) (org-export-protect-colon-examples) (org-export-convert-protec= ted-spaces) (setq target-alist (org-export-define-heading-targets target-al= ist)) (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 paramete= rs :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forwa= rd "^\\(#.*\n\\)?\\*+[ ]" nil t) (delete-region (point-min) (match-beginni= ng 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-b= ackend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remo= ve-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-v= erse-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-alis= t)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-a= fter-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hoo= ks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export= -normalize-links) ...) rtn) org-export-preprocess-string(#("* bar\n#+INCLUDE: \"bar.org\" org :minlev= el 1\n" 0 2 (fontified nil) 2 5 (fontified nil) 5 6 (fontified nil) 6 42 (f= ont-lock-fontified t fontified nil) 42 43 (font-lock-fontified t fontified = nil rear-nonsticky t)) :emph-multiline t :for-backend latex :comments nil := tags not-in-toc :priority nil :footnotes t :drawers nil :timestamps t :todo= -keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tag= s ("export") :exclude-tags ("noexport") :LaTeX-fragments nil) (let* ((wcf (current-window-configuration)) (opt-plist (org-export-proces= s-option-filters org-export-latex-options-plist)) (region-p (org-region-act= ive-p)) (rbeg (and region-p (region-beginning))) (rend (and region-p (regio= n-end))) (subtree-p (if (plist-get opt-plist :ignore-subtree-p) nil (when r= egion-p (save-excursion (goto-char rbeg) (and (org-at-heading-p) (>=3D ... = 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 pu= b-dir (org-export-directory :html opt-plist))) (org-current-export-file buf= fer-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 Ti= tle")) (filename (and (not to-buffer) (concat (file-name-as-directory (or p= ub-dir (org-export-directory :LaTeX ext-plist))) (file-name-sans-extension = (or (and subtree-p ...) (file-name-nondirectory ...))) ".tex"))) (filename = (and filename (if (equal (file-truename filename) (file-truename (or buffer= -file-name "dummy.org"))) (concat filename ".tex") filename))) (buffer (if = to-buffer (cond ((eq to-buffer (quote string)) (get-buffer-create "*Org LaT= eX Export*")) (t (get-buffer-create to-buffer))) (find-file-noselect filena= me))) (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-p= list :skip-before-1st-heading)))) (text (plist-get opt-plist :text)) (org-e= xport-preprocess-hook (cons (\` (lambda nil (org-set-local (quote org-compl= ex-heading-regexp) (\, org-export-latex-complex-heading-re)))) org-export-p= reprocess-hook)) (first-lines (if skip "" (org-export-latex-first-lines opt= -plist (if subtree-p (save-excursion (goto-char rbeg) (point-at-bol 2)) rbe= g) (if region-p rend)))) (coding-system (and (boundp (quote buffer-file-cod= ing-system)) buffer-file-coding-system)) (coding-system-for-write (or org-e= xport-latex-coding-system coding-system)) (save-buffer-coding-system (or or= g-export-latex-coding-system coding-system)) (region (buffer-substring (if = region-p (region-beginning) (point-min)) (if region-p (region-end) (point-m= ax)))) (text (and text (string-match "\\S-" text) (org-export-preprocess-st= ring text :emph-multiline t :for-backend (quote latex) :comments nil :tags = (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :foot= notes (plist-get opt-plist :footnotes) :drawers (plist-get opt-plist :drawe= rs) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get= opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :add-text ni= l :skip-before-1st-heading skip :select-tags nil :exclude-tags nil :LaTeX-f= ragments nil))) (string-for-export (org-export-preprocess-string region :em= ph-multiline t :for-backend (quote latex) :comments nil :tags (plist-get op= t-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-= get opt-plist :footnotes) :drawers (plist-get opt-plist :drawers) :timestam= ps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :t= odo-keywords) :tasks (plist-get opt-plist :tasks) :add-text (if (eq to-buff= er (quote string)) nil text) :skip-before-1st-heading skip :select-tags (pl= ist-get opt-plist :select-tags) :exclude-tags (plist-get opt-plist :exclude= -tags) :LaTeX-fragments nil))) (set-buffer buffer) (erase-buffer) (org-inst= all-letbind) (and (fboundp (quote set-buffer-file-coding-system)) (set-buff= er-file-coding-system coding-system-for-write)) (unless (or (eq to-buffer (= quote string)) body-only) (insert header)) (when (and text (not (eq to-buff= er (quote string)))) (insert (org-export-latex-content text (quote (lists t= ables fixed-width keywords))) "\n\n")) (unless (or skip (string-match "^\\*= " first-lines)) (insert first-lines)) (org-export-latex-global (with-temp-b= uffer (insert string-for-export) (goto-char (point-min)) (when (re-search-f= orward "^\\(\\*+\\) " nil t) (let* ((asters (length ...)) (level (if odd ..= . ...))) (setq org-export-latex-add-level (if odd (1- ...) (1- asters))) (o= rg-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-CONTENT= S\\]" nil t) (goto-char (point-min)) (while (re-search-forward "\\\\tableof= contents\\>[ ]*\n?" nil t) (replace-match "")) (goto-char (point-min)) (an= d (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t) (replace-match "\\tab= leofcontents" 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\\\\l= abel.*\\)*" nil t) (if (looking-at "[\n ]+") (replace-match "\n"))) (run-h= ooks (quote org-export-latex-final-hook)) (if to-buffer (unless (eq major-m= ode (quote latex-mode)) (latex-mode)) (save-buffer)) (org-export-latex-fix-= inputenc) (run-hooks (quote org-export-latex-after-save-hook)) (goto-char (= point-min)) (or (org-export-push-to-kill-ring "LaTeX") (message "Exporting = to LaTeX...done")) (prog1 (if (eq to-buffer (quote string)) (prog1 (buffer-= substring (point-min) (point-max)) (kill-buffer (current-buffer))) (current= -buffer)) (set-window-configuration wcf))) org-export-as-latex(nil) call-interactively(org-export-as-latex) (if (and bg (nth 2 ass) (not (buffer-base-buffer)) (not (org-region-activ= e-p))) (let ((p (start-process (concat "Exporting " (file-name-nondirectory= (buffer-file-name))) "*Org Processes*" (expand-file-name invocation-name i= nvocation-directory) "-batch" "-l" user-init-file "--eval" "(require 'org-e= xp)" "--eval" "(setq org-wait .2)" (buffer-file-name) "-f" (symbol-name (nt= h 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-w= indow (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 ex= port 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 buffe= r\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 tem= porary buffer\n[p] export as LaTeX and process to PDF [d] ... an= d open PDF file\n\n[D] export as DocBook [V] export as DocBook, process t= o PDF, and open\n\n[o] export as OpenDocumentText [O] ..= . and open\n\n[j] export as TaskJuggler [J] ... and= open\n\n[m] export as Freemind mind map\n[x] export as XOXO\n[g] export us= ing Wes Hardaker's generic exporter\n\n[i] export current file as iCalendar= file\n[I] export all agenda files as iCalendar files [c] ...as one combi= ned 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-e= xport-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 o= rg-export-region-as-html nil) (120 org-export-as-xoxo t) (103 org-export-ge= neric t) (68 org-export-as-docbook t) (86 org-export-as-docbook-pdf-and-ope= n t) (111 org-export-as-odt t) (79 org-export-as-odt-and-open t) (106 org-e= xport-as-taskjuggler t) (74 org-export-as-taskjuggler-and-open t) (109 org-= export-as-freemind t) (108 org-export-as-latex t) (112 org-export-as-pdf t)= (100 org-export-as-pdf-and-open t) (76 org-export-as-latex-to-buffer nil) = (105 org-export-icalendar-this-file t) (73 org-export-icalendar-all-agenda-= files t) (99 org-export-icalendar-combine-agenda-files t) (70 org-publish-c= urrent-file t) (80 org-publish-current-project t) (88 org-publish t) (69 or= g-publish-all t)))) r1 r2 ass (cpos (point)) (cbuf (current-buffer)) bpos) = (save-excursion (save-window-excursion (if subtree-p (message "Export subtr= ee: ") (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 (set= q r1 (read-char-exclusive)) 49) (cond (subtree-p (setq subtree-p nil) (mess= age "Export buffer: ")) ((not subtree-p) (setq subtree-p t) (message "Expor= t subtree: ")))) (when (eq r1 32) (let ((case-fold-search t) (end (save-exc= ursion ... ...))) (outline-next-heading) (if (re-search-backward "^[ ]+\\(= :latex_class:\\|:export_title:\\|:export_file_name:\\)[ ]+\\S-" end t) (pr= ogn (org-back-to-heading t) (setq subtree-p t) (setq bpos ...) (message "Se= lect command (for subtree): ") (setq r1 ...)) (error "No enclosing node wit= h LaTeX_CLASS or EXPORT_TITLE or EXPORT_FILE_NAME")))))) (redisplay) (and b= pos (goto-char bpos)) (setq r2 (if (< r1 27) (+ r1 96) r1)) (unless (setq a= ss (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))) (le= t ((p (start-process (concat "Exporting " (file-name-nondirectory ...)) "*O= rg Processes*" (expand-file-name invocation-name invocation-directory) "-ba= tch" "-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 proce= ss \"%s\": started" p)) (if subtree-p (progn (org-mark-subtree) (org-activa= te-mark))) (call-interactively (nth 1 ass)) (when (and bpos (get-buffer-win= dow 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) recursive-edit() debug(error (void-variable *)) eval(* nil) eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp nil nil) --=-=-=--