From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: [RFC] Standardized code block keywords Date: Fri, 28 Oct 2011 19:22:37 -0400 Message-ID: <2491.1319844157@alphaville.americas.hpqcorp.net> References: <87pqhrih3s.fsf@gmail.com> <201110261641.21161.DanielBausch@gmx.de> <6009.1319641493@alphaville.dokosmarshall.org> <201110270725.38634.DanielBausch@gmx.de> <87pqhhqcxr.fsf@gmail.com> <87hb2totly.fsf@gmail.com> <8934.1319827222@alphaville.americas.hpqcorp.net> <87d3dhosn3.fsf@gmail.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]:50750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJvl7-0007gw-KU for emacs-orgmode@gnu.org; Fri, 28 Oct 2011 19:22:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJvl2-0008B1-38 for emacs-orgmode@gnu.org; Fri, 28 Oct 2011 19:22:45 -0400 Received: from g1t0027.austin.hp.com ([15.216.28.34]:7700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJvl1-0008Am-CI for emacs-orgmode@gnu.org; Fri, 28 Oct 2011 19:22:39 -0400 In-Reply-To: Message from Eric Schulte of "Fri\, 28 Oct 2011 12\:52\:48 MDT." <87d3dhosn3.fsf@gmail.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: Eric Schulte Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain I'm trying to add a note to Worg hacks but before I push, I use my local org setup to publish Worg locally and take a look at it (not entirely reliable since my org version is usually different from the real Worg one, but a good indication of problems before they happen nevertheless). I ran into a couple of problems. The first one is expected: I'm running with Eric's patch, so when processing Worg/org-contrib/babel/examples/o18.org (Tom Dye's article on Archaelogy in Oceania), I ran into #+srcname vs #+name problems: when Eric's changes do go into org and the new org is used to publish Worg, there is going to be some breakage. Actually, o18.org is the extent of breakage that I saw, so it doesn't look too bad. But I also ran into a second (unrelated) issue. Here's a minimal example: --8<---------------cut here---------------start------------->8--- * Conclusion #+begin_src latex #+end_src --8<---------------cut here---------------end--------------->8--- Exporting to html gives me the attached backtrace. But the underlying reason is easy to demonstrate: if you C-c C-c on the empty source block, you get: ,---- | * Conclusion | | #+begin_src latex | | #+end_src | | #+results: | #+END_LaTeX | #+BEGIN_LaTeX `---- Nick Versions: Org-mode version 7.7 (release_7.7.485.gcfed6.dirty) GNU Emacs 24.0.90.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0) of 2011-10-27 --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=bt.txt Content-Transfer-Encoding: quoted-printable Content-Description: backtrace Debugger entered--Lisp error: (error "unbalanced begin/end_latex blocks wit= h \"#+BEGIN_LaTeX \"") signal(error ("unbalanced begin/end_latex blocks with \"#+BEGIN_LaTeX\n\"= ")) error("unbalanced begin/end_%s blocks with %S" latex "#+BEGIN_LaTeX\n") (progn (error "unbalanced begin/end_%s blocks with %S" type (buffer-subst= ring match-start (point)))) (if (not (zerop balanced)) (progn (error "unbalanced begin/end_%s blocks = with %S" type (buffer-substring match-start (point))))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with = %S" type (buffer-substring match-start (point)))) (let* ((match-start (copy-marker (match-beginning 0))) (body-start (copy-= marker (match-end 0))) (indentation (length (match-string 1))) (inner-re (f= ormat "[=0D\n]*[ ]*#\\+\\(begin\\|end\\)_%s" (regexp-quote (downcase (matc= h-string 2))))) (type (intern (downcase (match-string 2)))) (headers (save-= match-data (org-split-string (match-string 3) "[ ]+"))) (balanced 1) (pres= erve-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=3D (downcase (match-string 1)) "end") (decf balanced) (incf ba= lanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s bloc= ks 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-mat= ch-data (interblock start 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 repla= cement) (unless preserve-indent (indent-code-rigidly match-start (point) in= dentation))))) (set-marker match-start nil) (set-marker body-start nil) (se= t-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 "[=0D\n]*[ ]*#\\+\\(begin\\|= end\\)_%s" (regexp-quote (downcase (match-string 2))))) (type (intern (down= case (match-string 2)))) (headers (save-match-data (org-split-string (match= -string 3) "[ ]+"))) (balanced 1) (preserve-indent (or org-src-preserve-in= dentation (member "-i" headers))) match-end) (while (and (not (zerop balanc= ed)) (re-search-forward inner-re nil t)) (if (string=3D (downcase (match-st= ring 1)) "end") (decf balanced) (incf balanced))) (when (not (zerop balance= d)) (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 (buffe= r-substring body-start (match-beginning 0)))))) (unless (memq type types) (= setq types (cons type types))) (save-match-data (interblock start match-sta= rt)) (when (setq func (cadr (assoc type org-export-blocks))) (let ((replace= ment (save-match-data (if ... "" ...)))) (when replacement (delete-region m= atch-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-e= nd nil)) (setq start (point))) (let ((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[=0D\n]")) = (while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker (m= atch-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation (= length (match-string 1))) (inner-re (format "[=0D\n]*[ ]*#\\+\\(begin\\|en= d\\)_%s" (regexp-quote (downcase ...)))) (type (intern (downcase (match-str= ing 2)))) (headers (save-match-data (org-split-string (match-string 3) "[ = ]+"))) (balanced 1) (preserve-indent (or org-src-preserve-indentation (memb= er "-i" headers))) match-end) (while (and (not (zerop balanced)) (re-search= -forward inner-re nil t)) (if (string=3D (downcase (match-string 1)) "end")= (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unb= alanced begin/end_%s blocks with %S" type (buffer-substring match-start (po= int)))) (setq match-end (copy-marker (match-end 0))) (unless preserve-inden= t (setq body (save-match-data (org-remove-indentation (buffer-substring bod= y-start ...))))) (unless (memq type types) (setq types (cons type types))) = (save-match-data (interblock start match-start)) (when (setq func (cadr (as= soc type org-export-blocks))) (let ((replacement (save-match-data ...))) (w= hen replacement (delete-region match-start match-end) (goto-char match-star= t) (insert replacement) (unless preserve-indent (indent-code-rigidly match-= start ... indentation))))) (set-marker match-start nil) (set-marker body-st= art nil) (set-marker match-end nil)) (setq start (point)))) (progn (fset (quote interblock) (function* (lambda (start end) (block int= erblock (mapcar (lambda (pair) (funcall ... start end)) org-export-interblo= cks))))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ = ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[=0D\n]")) (while (re-search-forwa= rd beg-re nil t) (let* ((match-start (copy-marker (match-beginning 0))) (bo= dy-start (copy-marker (match-end 0))) (indentation (length (match-string 1)= )) (inner-re (format "[=0D\n]*[ ]*#\\+\\(begin\\|end\\)_%s" (regexp-quote = ...))) (type (intern (downcase ...))) (headers (save-match-data (org-split-= string ... "[ ]+"))) (balanced 1) (preserve-indent (or org-src-preserve-in= dentation (member "-i" headers))) match-end) (while (and (not (zerop balanc= ed)) (re-search-forward inner-re nil t)) (if (string=3D (downcase ...) "end= ") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "u= nbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (= point)))) (setq match-end (copy-marker (match-end 0))) (unless preserve-ind= ent (setq body (save-match-data (org-remove-indentation ...)))) (unless (me= mq 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 mat= ch-end) (goto-char match-start) (insert replacement) (unless preserve-inden= t ...)))) (set-marker match-start nil) (set-marker body-start nil) (set-mar= ker 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-+\\)[ ]*\\(.*\\)?[=0D\n]")) (while (re-search-forward beg-= re nil t) (let* ((match-start (copy-marker ...)) (body-start (copy-marker .= ..)) (indentation (length ...)) (inner-re (format "[=0D\n]*[ ]*#\\+\\(begi= n\\|end\\)_%s" ...)) (type (intern ...)) (headers (save-match-data ...)) (b= alanced 1) (preserve-indent (or org-src-preserve-indentation ...)) match-en= d) (while (and (not ...) (re-search-forward inner-re nil t)) (if (string=3D= ... "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) = (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring matc= h-start ...))) (setq match-end (copy-marker (match-end 0))) (unless preserv= e-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 mat= ch-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hoo= ks (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-pro= tect (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-+\\)[ ]*\= \(.*\\)?[=0D\n]")) (while (re-search-forward beg-re nil t) (let* ((match-st= art ...) (body-start ...) (indentation ...) (inner-re ...) (type ...) (head= ers ...) (balanced 1) (preserve-indent ...) match-end) (while (and ... ...)= (if ... ... ...)) (when (not ...) (error "unbalanced begin/end_%s blocks w= ith %S" type ...)) (setq match-end (copy-marker ...)) (unless preserve-inde= nt (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))) (if --cl-letf-bound-- (fset (quo= te interblock) --cl-letf-save--) (fmakunbound (quote interblock))))) (letf (((symbol-function (quote interblock)) (function* (lambda (start en= d) (block interblock (mapcar (lambda ... ...) org-export-interblocks)))))) = (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ ]*\\)#\\= +begin_\\(\\S-+\\)[ ]*\\(.*\\)?[=0D\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 "[=0D\n]*[ ]*#\\+\\(begin\\|end\\)_%s" (regexp-quote ...))) (t= ype (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=3D (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 t= ypes) (setq types (cons type types))) (save-match-data (interblock start ma= tch-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 e= nd) (block interblock (mapcar (lambda ... ...) org-export-interblocks))))))= (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ ]*\\)#\= \+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[=0D\n]")) (while (re-search-forward beg-r= e nil t) (let* ((match-start (copy-marker (match-beginning 0))) (body-start= (copy-marker (match-end 0))) (indentation (length (match-string 1))) (inne= r-re (format "[=0D\n]*[ ]*#\\+\\(begin\\|end\\)_%s" (regexp-quote ...))) (= type (intern (downcase ...))) (headers (save-match-data (org-split-string .= .. "[ ]+"))) (balanced 1) (preserve-indent (or org-src-preserve-indentatio= n (member "-i" headers))) match-end) (while (and (not (zerop balanced)) (re= -search-forward inner-re nil t)) (if (string=3D (downcase ...) "end") (decf= balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalance= d begin/end_%s blocks with %S" type (buffer-substring match-start (point)))= ) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (set= q body (save-match-data (org-remove-indentation ...)))) (unless (memq type = types) (setq types (cons type types))) (save-match-data (interblock start m= atch-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 matc= h-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hook= s (quote org-export-blocks-postblock-hook))) (flet ((interblock (start end) (mapcar (lambda (pair) (funcall (second pa= ir) start end)) org-export-interblocks))) (goto-char (point-min)) (setq sta= rt (point)) (let ((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[= =0D\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start (copy= -marker (match-beginning 0))) (body-start (copy-marker (match-end 0))) (ind= entation (length (match-string 1))) (inner-re (format "[=0D\n]*[ ]*#\\+\\(= begin\\|end\\)_%s" (regexp-quote ...))) (type (intern (downcase ...))) (hea= ders (save-match-data (org-split-string ... "[ ]+"))) (balanced 1) (preser= ve-indent (or org-src-preserve-indentation (member "-i" headers))) match-en= d) (while (and (not (zerop balanced)) (re-search-forward inner-re nil t)) (= if (string=3D (downcase ...) "end") (decf balanced) (incf balanced))) (when= (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" typ= e (buffer-substring match-start (point)))) (setq match-end (copy-marker (ma= tch-end 0))) (unless preserve-indent (setq body (save-match-data (org-remov= e-indentation ...)))) (unless (memq type types) (setq types (cons type type= s))) (save-match-data (interblock start match-start)) (when (setq func (cad= r (assoc type org-export-blocks))) (let ((replacement ...)) (when replaceme= nt (delete-region match-start match-end) (goto-char match-start) (insert re= placement) (unless preserve-indent ...)))) (set-marker match-start nil) (se= t-marker body-start nil) (set-marker match-end nil)) (setq start (point))))= (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblo= ck-hook))) (let ((case-fold-search t) (types (quote nil)) matched indentation type f= unc start end body headers preserve-indent progress-marker) (flet ((interbl= ock (start end) (mapcar (lambda (pair) (funcall (second pair) start end)) o= rg-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let = ((beg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[=0D\n]")) (while = (re-search-forward beg-re nil t) (let* ((match-start (copy-marker ...)) (bo= dy-start (copy-marker ...)) (indentation (length ...)) (inner-re (format "[= =0D\n]*[ ]*#\\+\\(begin\\|end\\)_%s" ...)) (type (intern ...)) (headers (s= ave-match-data ...)) (balanced 1) (preserve-indent (or org-src-preserve-ind= entation ...)) match-end) (while (and (not ...) (re-search-forward inner-re= nil t)) (if (string=3D ... "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-e= nd 0))) (unless preserve-indent (setq body (save-match-data ...))) (unless = (memq type types) (setq types (cons type types))) (save-match-data (interbl= ock start match-start)) (when (setq func (cadr ...)) (let (...) (when repla= cement ... ... ... ...))) (set-marker match-start nil) (set-marker body-sta= rt nil) (set-marker match-end nil)) (setq start (point)))) (interblock star= t (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 ((b= eg-re "^\\([ ]*\\)#\\+begin_\\(\\S-+\\)[ ]*\\(.*\\)?[=0D\n]")) (while (re= -search-forward beg-re nil t) (let* ((match-start ...) (body-start ...) (in= dentation ...) (inner-re ...) (type ...) (headers ...) (balanced 1) (preser= ve-indent ...) match-end) (while (and ... ...) (if ... ... ...)) (when (not= ...) (error "unbalanced begin/end_%s blocks with %S" type ...)) (setq matc= h-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-post= block-hook))))) (unwind-protect (progn (let ((case-fold-search t) (types (quote nil)) mat= ched 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-+\\)[ ]*\\(.*\\)?[=0D\n]")) (while (re-search= -forward beg-re nil t) (let* (... ... ... ... ... ... ... ... match-end) (w= hile ... ...) (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 s= tart (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 (l= et ((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-+\\)[ ]*\\= (.*\\)?[=0D\n]")) (while (re-search-forward beg-re nil t) (let* ... ... ...= ... ... ... ... ... ... ... ...) (setq start ...))) (interblock start (poi= nt-max)) (run-hooks (quote org-export-blocks-postblock-hook))))) (set-windo= w-configuration wconfig))) (save-window-excursion (let ((case-fold-search t) (types (quote nil)) mat= ched 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-+\\)[ ]*\\(.*\\)?[=0D\= n]")) (while (re-search-forward beg-re nil t) (let* ((match-start ...) (bod= y-start ...) (indentation ...) (inner-re ...) (type ...) (headers ...) (bal= anced 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 (interb= lock start match-start)) (when (setq func ...) (let ... ...)) (set-marker m= atch-start nil) (set-marker body-start nil) (set-marker match-end nil)) (se= tq start (point)))) (interblock start (point-max)) (run-hooks (quote org-ex= port-blocks-postblock-hook))))) org-export-blocks-preprocess() (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(#("* Conclusion\n\n#+begin_src latex \n\n#+e= nd_src\n" 0 2 (fontified t face org-level-1 mouse-face highlight keymap (ke= ymap (C-down-mouse-1 . org-mouse-move-tree-start) (C-drag-mouse-1 . org-mou= se-move-tree) (follow-link . mouse-face) (mouse-3) (mouse-2 . org-open-at-m= ouse))) 2 12 (fontified t face org-level-1) 12 13 (fontified t) 13 14 (font= ified t) 14 32 (fontified t font-lock-fontified t face org-block-begin-line= font-lock-multiline t) 32 33 (fontified t font-lock-fontified t font-lock-= multiline t face org-block-begin-line) 33 34 (fontified t font-lock-fontifi= ed t font-lock-multiline t face org-block) 34 43 (fontified t font-lock-fon= tified t face org-block-end-line font-lock-multiline t) 43 44 (fontified t = font-lock-fontified t face org-block-end-line)) :emph-multiline t :for-back= end html :skip-before-1st-heading nil :drawers nil :todo-keywords t :tasks = t :tags not-in-toc :priority nil :footnotes t :timestamps t :archived-trees= headline :select-tags ("export") :exclude-tags ("noexport") :add-text nil = :LaTeX-fragments t) (org-split-string (org-export-preprocess-string region :emph-multiline t = :for-backend (quote html) :skip-before-1st-heading (plist-get opt-plist :sk= ip-before-1st-heading) :drawers (plist-get opt-plist :drawers) :todo-keywor= ds (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks)= :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority= ) :footnotes (plist-get opt-plist :footnotes) :timestamps (plist-get opt-pl= ist :timestamps) :archived-trees (plist-get opt-plist :archived-trees) :sel= ect-tags (plist-get opt-plist :select-tags) :exclude-tags (plist-get opt-pl= ist :exclude-tags) :add-text (plist-get opt-plist :text) :LaTeX-fragments (= plist-get opt-plist :LaTeX-fragments)) "[=0D\n]") (let* ((opt-plist (org-export-process-option-filters (org-combine-plists = (org-default-export-plist) ext-plist (org-infile-export-plist)))) (body-onl= y (or body-only (plist-get opt-plist :body-only))) (style (concat (if (plis= t-get opt-plist :style-include-default) org-export-html-style-default) (pli= st-get opt-plist :style) (plist-get opt-plist :style-extra) "\n" (if (plist= -get opt-plist :style-include-scripts) org-export-html-scripts))) (html-ext= ension (plist-get opt-plist :html-extension)) valid thetoc have-headings fi= rst-heading-pos (odd org-odd-levels-only) (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) (>=3D ... rend))))= )) (level-offset (if subtree-p (save-excursion (goto-char rbeg) (+ (funcall= outline-level) (if org-odd-levels-only 1 0))) 0)) (opt-plist (setq org-exp= ort-opt-plist (if subtree-p (org-export-add-subtree-options opt-plist rbeg)= opt-plist))) (org-current-export-dir (or pub-dir (org-export-directory :ht= ml opt-plist))) (org-current-export-file buffer-file-name) (level 0) (line = "") (origline "") txt todo (umax nil) (umax-toc nil) (filename (if to-buffe= r nil (expand-file-name (concat (file-name-sans-extension (or ... ...)) "."= html-extension) (file-name-as-directory (or pub-dir (org-export-directory = :html opt-plist)))))) (current-dir (if buffer-file-name (file-name-director= y buffer-file-name) default-directory)) (auto-insert nil) (buffer (if to-bu= ffer (cond ((eq to-buffer (quote string)) (get-buffer-create "*Org HTML Exp= ort*")) (t (get-buffer-create to-buffer))) (find-file-noselect filename))) = (org-levels-open (make-vector org-level-max nil)) (date (plist-get opt-plis= t :date)) (author (plist-get opt-plist :author)) (html-validation-link (or = org-export-html-validation-link "")) (title (org-html-expand (or (and subtr= ee-p (org-export-get-title-from-subtree)) (plist-get opt-plist :title) (and= (not body-only) (not (plist-get opt-plist :skip-before-1st-heading)) (org-= export-grab-title-from-buffer)) (and buffer-file-name (file-name-sans-exten= sion (file-name-nondirectory buffer-file-name))) "UNTITLED"))) (link-up (an= d (plist-get opt-plist :link-up) (string-match "\\S-" (plist-get opt-plist = :link-up)) (plist-get opt-plist :link-up))) (link-home (and (plist-get opt-= plist :link-home) (string-match "\\S-" (plist-get opt-plist :link-home)) (p= list-get opt-plist :link-home))) (dummy (setq opt-plist (plist-put opt-plis= t :title title))) (html-table-tag (plist-get opt-plist :html-table-tag)) (q= uote-re0 (concat "^ *" org-quote-string "\\( +\\|[ ]*$\\)")) (quote-re (fo= rmat org-heading-keyword-regexp-format org-quote-string)) (inquote nil) (in= fixed nil) (inverse nil) (email (plist-get opt-plist :email)) (language (pl= ist-get opt-plist :language)) (keywords (plist-get opt-plist :keywords)) (d= escription (plist-get opt-plist :description)) (num (plist-get opt-plist :s= ection-numbers)) (lang-words nil) (head-count 0) cnt ...) (let ((inhibit-re= ad-only t)) (org-unmodified (remove-text-properties (point-min) (point-max)= (quote (:org-license-to-kill t))))) (message "Exporting...") (setq org-min= -level (org-get-min-level lines level-offset)) (setq org-last-level org-min= -level) (org-init-section-numbers) (cond ((and date (string-match "%" date)= ) (setq date (format-time-string date))) (date) (t (setq date (format-time-= string "%Y-%m-%d %T %Z")))) (setq lang-words (or (assoc language org-export= -language-setup) (assoc "en" org-export-language-setup))) (set-buffer buffe= r) (let ((inhibit-read-only t)) (erase-buffer)) (fundamental-mode) (org-ins= tall-letbind) (and (fboundp (quote set-buffer-file-coding-system)) (set-buf= fer-file-coding-system coding-system-for-write)) (let ((case-fold-search ni= l) (org-odd-levels-only odd)) (mapc (lambda (x) (set (make-local-variable (= nth 2 x)) (plist-get opt-plist (car x)))) org-export-plist-vars) (setq umax= (if arg (prefix-numeric-value arg) org-export-headline-levels)) (setq umax= -toc (if (integerp org-export-with-toc) (min org-export-with-toc umax) umax= )) (unless body-only (insert (format "%s\n\n\n\n%s\n\n\n\n\n\n\n\n%s\n%s\n\n\n%s\n" (f= ormat (or (and ... org-export-html-xml-declaration) (cdr ...) (cdr ...) "")= (or charset "iso-8859-1")) language language title (or charset "iso-8859-1= ") title date author description keywords style mathjax (if (or link-up lin= k-home) (concat (format org-export-html-home/up-format ... ...) "\n") "")))= (when (plist-get opt-plist :html-preamble) (let ((html-pre (plist-get opt-= plist :html-preamble))) (insert "
\n") (cond ((stringp html-pre) (insert ...)) ((functionp html-pre) (fu= ncall html-pre)) (t (insert ...))) (insert "\n
\n"))) (insert (format = "\n
" (or org-export-html-content-div (nth 1 org-export-htm= l-divs))) "\n

" title "

\n")) (if (and org-export-= with-toc (not body-only)) (progn (push (format "%s\n" org-export= -html-toplevel-hlevel (nth 3 lang-words) org-export-html-toplevel-hlevel) t= hetoc) (push "
\n" thetoc) (push "
    \= n
  • " thetoc) (setq lines (mapcar (function (lambda ... ... line)) lines))= (while (> org-last-level (1- org-min-level)) (setq org-last-level (1- org-= last-level)) (push "
  • \n
\n" thetoc)) (push "
\n" thetoc) (setq= thetoc (if have-headings (nreverse thetoc) nil)))) (setq head-count 0) (or= g-init-section-numbers) (org-open-par) (while (setq line (pop lines) origli= ne line) (catch (quote nextline) (when (and inquote (string-match org-outli= ne-regexp-bol line)) (insert "\n") (org-open-par) (setq inquote nil))= (when inquote (insert (org-html-protect line) "\n") (throw (quote nextline= ) nil)) (when (and org-export-with-fixed-width (string-match "^[ ]*:\\(\\(= [ ]\\|$\\)\\(.*\\)\\)" line)) (when (not infixed) (setq infixed t) (org-cl= ose-par-maybe) (insert "
\n")) (insert (org-html-pr=
otect (match-string 3 line)) "\n") (when (or (not lines) (not ...)) (setq i=
nfixed nil) (insert "
\n") (org-open-par)) (throw (quote nextline) nil= )) (when (and (get-text-property 0 (quote org-protected) line) (not (< ... = ...))) (let (par (ind ...)) (when (re-search-backward "\\(

\\)\\([ =0D\n= ]*\\)\\=3D" ... t) (setq par ...) (replace-match "\\2\n")) (insert line "\n= ") (while (and lines ... ...) (insert ... "\n")) (and par (insert "

\n"))= ) (throw (quote nextline) nil)) (when (equal "ORG-BLOCKQUOTE-START" line) (= org-close-par-maybe) (insert "

\n") (org-open-par) (throw (quote= nextline) nil)) (when (equal "ORG-BLOCKQUOTE-END" line) (org-close-par-may= be) (insert "\n
\n") (org-open-par) (throw (quote nextline) nil= )) (when (equal "ORG-VERSE-START" line) (org-close-par-maybe) (insert "\n\n") (setq org-par-open t) (setq inverse t) (throw (quot= e nextline) nil)) (when (equal "ORG-VERSE-END" line) (insert "

\n") (set= q org-par-open nil) (org-open-par) (setq inverse nil) (throw (quote nextlin= e) nil)) (when (equal "ORG-CENTER-START" line) (org-close-par-maybe) (inser= t "\n
") (org-open-par) (throw (quote ne= xtline) nil)) (when (equal "ORG-CENTER-END" line) (org-close-par-maybe) (in= sert "\n
") (org-open-par) (throw (quote nextline) nil)) (run-hooks (q= uote org-export-html-after-blockquotes-hook)) (when inverse (let ((i ...)) = (if (> i 0) (setq line ...)) (unless (string-match "\\\\\\\\[ ]*$" line) (= setq line ...)))) (setq start 0) (while (string-match "<<]*\\)>>>?= \\((INVISIBLE)\\)?[ ]*\n?" line start) (cond ((get-text-property ... ... l= ine) (setq start ...)) ((match-end 2) (setq line ...)) ((and org-export-wit= h-toc ...) (setq line ...)) (t (setq line ...)))) (setq line (org-html-hand= le-time-stamps line)) (or (string-match org-table-hline-regexp line) (strin= g-match "^[ ]*\\([+]-\\||[ ]\\)[-+ |]*[+|][ ]*$" line) (setq line (org-ht= ml-expand line))) (setq line (org-html-handle-links line opt-plist)) (if (a= nd org-todo-line-regexp (string-match org-todo-line-regexp line) (match-beg= inning 2)) (setq line (concat (substring line 0 ...) " " (org-export-html-get-t= odo-kwd-class-name ...) "" (substring line ...)))) (when org-export-= with-footnotes (setq start 0) (while (string-match "\\([^* ].*?\\)\\[\\([0= -9]+\\)\\]" line start) (if (or ... ...) (setq start ...) (let ... ... ...)= ))) (cond ((string-match "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ ]*$" line) (set= q level (org-tr-level ...) txt (match-string 2 line)) (if (string-match quo= te-re0 txt) (setq txt ...)) (if (<=3D level ...) (setq head-count ...)) (se= tq first-heading-pos (or first-heading-pos ...)) (org-html-level-start leve= l txt umax (and org-export-with-toc ...) head-count opt-plist) (when (strin= g-match quote-re line) (org-close-par-maybe) (insert "
") (setq inquote=
 t))) ((and org-export-with-tables (string-match "^\\([ 	]*\\)\\(|\\|\\+-+\=
\+\\)" line)) (when (not table-open) (setq table-open t table-buffer nil ta=
ble-orig-buffer nil)) (setq table-buffer (cons line table-buffer) table-ori=
g-buffer (cons origline table-orig-buffer)) (when (or ... ...) (setq table-=
open nil table-buffer ... table-orig-buffer ...) (org-close-par-maybe) (ins=
ert ...))) (t (when (get-text-property 0 ... line) (setq line ...)) (when (=
string-match "^[ 	]*-\\{5,\\}[ 	]*$" line) (if org-par-open ... ...) (throw=
 ... nil)) (if (string-match "^ [-+*]-\\|^[ 	]*$" line) (org-open-par)) (wh=
en org-export-with-footnotes (when ... ...) (when ... ... ...)) (cond (... =
...) (org-export-preserve-breaks ...)) (let (...) (while ... ... ...)) (ins=
ert line "\n"))))) (when inquote (insert "
\n") (org-open-par)) (org-h= tml-level-start 1 nil umax (and org-export-with-toc (<=3D level umax)) head= -count opt-plist) (when (and (> umax 0) first-heading-pos) (insert "
\= n")) (save-excursion (goto-char (point-min)) (while (re-search-forward "\\(= \\(

\\)[^=00]*?\\)\\(\\(\\2\\)\\|\\'\\)" nil t) (pus= h (match-string 1) footnotes) (replace-match "\\4" t nil) (goto-char (match= -beginning 0)))) (when footnotes (insert (format org-export-html-footnotes-= section (nth 4 lang-words) (mapconcat (quote identity) (nreverse footnotes)= "\n")) "\n")) (let ((bib (org-export-html-get-bibliography))) (when bib (i= nsert "\n" bib "\n"))) (unless body-only (insert "\n") (let ((html-po= st (plist-get opt-plist :html-postamble)) (email (mapconcat (lambda ... ...= ) (split-string email ",+ *") ", ")) (creator-info (concat "Org version " o= rg-version " with Emacs version " (number-to-string emacs-major-version))))= (when (plist-get opt-plist :html-postamble) (insert "\n

\n") (cond ((stringp html-post) (insert ...)) (= (functionp html-post) (funcall html-post)) ((eq html-post ...) (when ... ..= .) (when ... ...) (when ... ...) (when ... ...) (insert html-validation-lin= k "\n")) (t (insert ...))) (insert "\n
")))) (if org-export-html-with-= timestamp (insert org-export-html-html-helper-timestamp)) (unless body-only= (insert "\n\n\n")) (unless (plist-get opt-plist :buffer-will= -be-killed) (normal-mode) (if (eq major-mode (default-value (quote major-mo= de))) (html-mode))) (goto-char (point-min)) (when thetoc (if (or (re-search= -forward "

\\s-*\\[TABLE-OF-CONTENTS\\]\\s-*

" nil t) (re-search-forwa= rd "\\[TABLE-OF-CONTENTS\\]" nil t)) (progn (goto-char (match-beginning 0))= (replace-match "")) (goto-char first-heading-pos) (when (looking-at "\\s-*=

") (goto-char (match-end 0)) (insert "\n"))) (insert "
\n") (let ((beg (point))) (mapc (quote insert) thetoc) (inse= rt "
\n") (while (re-search-backward "
  • [ =0D\n ]*
  • \n?" beg t) (= replace-match "")))) (goto-char (point-min)) (while (re-search-forward "

    = [ =0D\n ]*

    " nil t) (replace-match "")) (goto-char (point-min)) (goto-ch= ar (point-min)) (let (beg end n) (while (setq beg (next-single-property-cha= nge (point) (quote org-whitespace))) (setq n (get-text-property beg (quote = org-whitespace)) end (next-single-property-change beg (quote org-whitespace= ))) (goto-char beg) (delete-region beg end) (insert (format "%s" (make-string n 120))))) (goto-char (point= -min)) (when (looking-at "\\s-+\n") (replace-match "")) (remove-text-proper= ties (point-min) (point-max) (quote (display t))) (run-hooks (quote org-exp= ort-html-final-hook)) (or to-buffer (save-buffer)) (goto-char (point-min)) = (or (org-export-push-to-kill-ring "HTML") (message "Exporting... done")) (i= f (eq to-buffer (quote string)) (prog1 (buffer-substring (point-min) (point= -max)) (kill-buffer (current-buffer))) (current-buffer)))) org-export-as-html(nil) call-interactively(org-export-as-html) (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) (setq bpos (poi= nt)) (message "Export subtree: ")))) (when (eq r1 32) (let ((case-fold-sear= ch t) (end (save-excursion ... ...))) (outline-next-heading) (if (re-search= -backward "^[ ]+\\(:latex_class:\\|:export_title:\\|:export_file_name:\\)[= ]+\\S-" end t) (progn (org-back-to-heading t) (setq subtree-p t) (setq bp= os ...) (message "Select command (for subtree): ") (setq r1 ...)) (error "N= o 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)) (er= ror "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-fi= le "--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-inter= actively (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) --=-=-=--