[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH][ANN] org-html/org-odt
From: |
Matt Lundin |
Subject: |
Re: [O] [PATCH][ANN] org-html/org-odt |
Date: |
Sun, 01 May 2011 08:52:24 -0400 |
User-agent: |
Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux) |
Hi Jambunathan,
Jambunathan K <address@hidden> writes:
[...]
>
> I am not sure if (and when) my changes would get formally integrated.
>
> I can commit non-trivial effort cycles for bug fixing & integration for
> maybe next 3 weeks. Further down the road, as a maintainer of
> org-odt.el, I am willing to entertain bug and feature requests. However
> it is quite possible that I might turn quirky and less-responsive.
Thanks again for all the work you've done on this exporter! Both the odt
and html output look very good. I plan to throw some more complex
documents at the backends soon.
I've been doing a bit of testing and have found that html export fails
on the following headline:
--8<---------------cut here---------------start------------->8---
* STARTED Alembert, Preliminary Discourse to the Encyclopedia of Diderot
:read:BIB:NEXT:
:LOGBOOK:
CLOCK: [2011-04-24 Sun 17:28]--[2011-04-24 Sun 17:54] => 0:26
CLOCK: [2011-04-23 Sat 15:33]--[2011-04-23 Sat 16:00] => 0:27
CLOCK: [2011-04-21 Thu 21:01]--[2011-04-21 Thu 21:37] => 0:36
:END:
[2011-04-21 Thu 21:01]
--8<---------------cut here---------------end--------------->8---
I've attached the backtrace.
Another comment. The warning about MathJax seemed a bit dire:
"MathJax not supported. Falling back to dvipng"
I assume this means that the odt exporter does not support MathJax. The
way it is currently worded might make the user think that his/her system
is lacking something.
Best,
Matt
Debugger entered--Lisp error: (args-out-of-range #("Alembert, Preliminary
Discourse to the Encyclopedia of Diderot" 0 62 (target "sec-1" fontified t
org-category "test")) 64 77)
match-string(1 #("Alembert, Preliminary Discourse to the Encyclopedia of
Diderot" 0 62 (target "sec-1" fontified t org-category "test")))
(setq txt (replace-match "" t nil txt) tags (match-string 1 txt))
(progn (setq txt (replace-match "" t nil txt) tags (match-string 1 txt)))
(if (string-match (org-re "[ ]+:\\([[:alnum:]_@:]+\\):[ ]*$") txt)
(progn (setq txt (replace-match "" t nil txt) tags (match-string 1 txt))))
(when (string-match (org-re "[ ]+:\\([[:alnum:]_@:]+\\):[ ]*$")
txt) (setq txt (replace-match "" t nil txt) tags (match-string 1 txt)))
(let ((txt (save-match-data (org-html-expand (org-export-cleanup-toc-line
(match-string 3 line))))) (todo (and org-export-mark-todo-in-toc (or (and
(match-beginning 2) (not (member ... org-done-keywords))) (and (= level
umax-toc) (org-search-todo-below line lines level))))) tags) (while
(string-match org-any-target-regexp line) (setq line (replace-match (let
((org-html-protect t)) (org-parse-format (quote FONTIFY) (match-string 1 line)
"target")) t t line))) (when (string-match (org-re "[
]+:\\([[:alnum:]_@:]+\\):[ ]*$") txt) (setq txt (replace-match "" t nil
txt) tags (match-string 1 txt))) (when (string-match quote-re0 txt) (setq txt
(replace-match "" t t txt))) (while (string-match
"<\\(<\\)+\\|>\\(>\\)+" txt) (setq txt (replace-match "" t t txt)))
(org-parse-format (quote TOC-ITEM) (let* ((snumber (org-section-number level))
(href (replace-regexp-in-string "\\." "_" (format "sec-%s" snumber))) (href (or
(cdr (assoc href org-export-preferred-target-alist)) href)) (href
(org-solidify-link-text href))) (org-parse-format (quote TOC-ENTRY) snumber
todo txt tags href)) level org-last-level) (setq org-last-level level))
(progn (let ((txt (save-match-data (org-html-expand
(org-export-cleanup-toc-line (match-string 3 line))))) (todo (and
org-export-mark-todo-in-toc (or (and (match-beginning 2) (not ...)) (and (=
level umax-toc) (org-search-todo-below line lines level))))) tags) (while
(string-match org-any-target-regexp line) (setq line (replace-match (let
((org-html-protect t)) (org-parse-format (quote FONTIFY) (match-string 1 line)
"target")) t t line))) (when (string-match (org-re "[
]+:\\([[:alnum:]_@:]+\\):[ ]*$") txt) (setq txt (replace-match "" t nil
txt) tags (match-string 1 txt))) (when (string-match quote-re0 txt) (setq txt
(replace-match "" t t txt))) (while (string-match
"<\\(<\\)+\\|>\\(>\\)+" txt) (setq txt (replace-match "" t t txt)))
(org-parse-format (quote TOC-ITEM) (let* ((snumber (org-section-number level))
(href (replace-regexp-in-string "\\." "_" (format "sec-%s" snumber))) (href (or
(cdr ...) href)) (href (org-solidify-link-text href))) (org-parse-format (quote
TOC-ENTRY) snumber todo txt tags href)) level org-last-level) (setq
org-last-level level)))
(if (and (string-match org-todo-line-regexp line) (not (get-text-property 0
(quote org-protected) line)) (<= (setq level (org-tr-level (- (match-end 1)
(match-beginning 1) level-offset))) umax-toc)) (progn (let ((txt
(save-match-data (org-html-expand (org-export-cleanup-toc-line ...)))) (todo
(and org-export-mark-todo-in-toc (or (and ... ...) (and ... ...)))) tags)
(while (string-match org-any-target-regexp line) (setq line (replace-match (let
(...) (org-parse-format ... ... "target")) t t line))) (when (string-match
(org-re "[ ]+:\\([[:alnum:]_@:]+\\):[ ]*$") txt) (setq txt
(replace-match "" t nil txt) tags (match-string 1 txt))) (when (string-match
quote-re0 txt) (setq txt (replace-match "" t t txt))) (while (string-match
"<\\(<\\)+\\|>\\(>\\)+" txt) (setq txt (replace-match "" t t txt)))
(org-parse-format (quote TOC-ITEM) (let* ((snumber (org-section-number level))
(href (replace-regexp-in-string "\\." "_" ...)) (href (or ... href)) (href
(org-solidify-link-text href))) (org-parse-format (quote TOC-ENTRY) snumber
todo txt tags href)) level org-last-level) (setq org-last-level level))))
(when (and (string-match org-todo-line-regexp line) (not (get-text-property 0
(quote org-protected) line)) (<= (setq level (org-tr-level (- (match-end 1)
(match-beginning 1) level-offset))) umax-toc)) (let ((txt (save-match-data
(org-html-expand (org-export-cleanup-toc-line (match-string 3 line))))) (todo
(and org-export-mark-todo-in-toc (or (and (match-beginning 2) (not ...)) (and
(= level umax-toc) (org-search-todo-below line lines level))))) tags) (while
(string-match org-any-target-regexp line) (setq line (replace-match (let
((org-html-protect t)) (org-parse-format (quote FONTIFY) (match-string 1 line)
"target")) t t line))) (when (string-match (org-re "[
]+:\\([[:alnum:]_@:]+\\):[ ]*$") txt) (setq txt (replace-match "" t nil
txt) tags (match-string 1 txt))) (when (string-match quote-re0 txt) (setq txt
(replace-match "" t t txt))) (while (string-match
"<\\(<\\)+\\|>\\(>\\)+" txt) (setq txt (replace-match "" t t txt)))
(org-parse-format (quote TOC-ITEM) (let* ((snumber (org-section-number level))
(href (replace-regexp-in-string "\\." "_" (format "sec-%s" snumber))) (href (or
(cdr ...) href)) (href (org-solidify-link-text href))) (org-parse-format (quote
TOC-ENTRY) snumber todo txt tags href)) level org-last-level) (setq
org-last-level level)))
(lambda (line) (when (and (string-match org-todo-line-regexp line) (not
(get-text-property 0 (quote org-protected) line)) (<= (setq level (org-tr-level
(- (match-end 1) (match-beginning 1) level-offset))) umax-toc)) (let ((txt
(save-match-data (org-html-expand (org-export-cleanup-toc-line ...)))) (todo
(and org-export-mark-todo-in-toc (or (and ... ...) (and ... ...)))) tags)
(while (string-match org-any-target-regexp line) (setq line (replace-match (let
(...) (org-parse-format ... ... "target")) t t line))) (when (string-match
(org-re "[ ]+:\\([[:alnum:]_@:]+\\):[ ]*$") txt) (setq txt
(replace-match "" t nil txt) tags (match-string 1 txt))) (when (string-match
quote-re0 txt) (setq txt (replace-match "" t t txt))) (while (string-match
"<\\(<\\)+\\|>\\(>\\)+" txt) (setq txt (replace-match "" t t txt)))
(org-parse-format (quote TOC-ITEM) (let* ((snumber (org-section-number level))
(href (replace-regexp-in-string "\\." "_" ...)) (href (or ... href)) (href
(org-solidify-link-text href))) (org-parse-format (quote TOC-ENTRY) snumber
todo txt tags href)) level org-last-level) (setq org-last-level level)))
line)(#("* STARTED Alembert, Preliminary Discourse to the Encyclopedia of
Diderot :read:[[BIB:NEXT][BIB:NEXT]]:" 0 1 (org-category "test" fontified t
target "sec-1") 2 9 (org-category "test" fontified t target "sec-1") 10 72
(org-category "test" fontified t target "sec-1") 73 78 (org-category "test"
fontified t target "sec-1") 78 79 (face org-link target "sec-1" fontified t
org-category "test") 79 81 (face org-link) 81 84 (face org-link target "sec-1"
fontified t org-category "test" org-protected t org-no-description nil) 84 85
(face org-link org-protected t org-no-description nil) 85 89 (face org-link
target "sec-1" fontified t org-category "test" font-lock-fontified t
org-protected t org-no-description nil) 89 90 (face org-link) 90 91 (face
org-link) 91 94 (org-category "test" fontified t target "sec-1" face org-link)
94 95 (face org-link) 95 97 (font-lock-fontified t org-category "test"
fontified t target "sec-1" face org-link) 97 99 (font-lock-fontified t
org-category "test" fontified t target "sec-1" face org-link) 99 100 (face
org-link) 100 101 (face org-link) 101 102 (rear-nonsticky (mouse-face highlight
keymap invisible intangible help-echo org-linked-text) org-category "test"
fontified t target "sec-1")))
mapcar((lambda (line) (when (and (string-match org-todo-line-regexp line)
(not (get-text-property 0 (quote org-protected) line)) (<= (setq level
(org-tr-level (- (match-end 1) (match-beginning 1) level-offset))) umax-toc))
(let ((txt (save-match-data (org-html-expand (org-export-cleanup-toc-line
...)))) (todo (and org-export-mark-todo-in-toc (or (and ... ...) (and ...
...)))) tags) (while (string-match org-any-target-regexp line) (setq line
(replace-match (let (...) (org-parse-format ... ... "target")) t t line)))
(when (string-match (org-re "[ ]+:\\([[:alnum:]_@:]+\\):[ ]*$")
txt) (setq txt (replace-match "" t nil txt) tags (match-string 1 txt))) (when
(string-match quote-re0 txt) (setq txt (replace-match "" t t txt))) (while
(string-match "<\\(<\\)+\\|>\\(>\\)+" txt) (setq txt (replace-match
"" t t txt))) (org-parse-format (quote TOC-ITEM) (let* ((snumber
(org-section-number level)) (href (replace-regexp-in-string "\\." "_" ...))
(href (or ... href)) (href (org-solidify-link-text href))) (org-parse-format
(quote TOC-ENTRY) snumber todo txt tags href)) level org-last-level) (setq
org-last-level level))) line) (#("* STARTED Alembert, Preliminary Discourse to
the Encyclopedia of Diderot :read:[[BIB:NEXT][BIB:NEXT]]:" 0 1 (org-category
"test" fontified t target "sec-1") 2 9 (org-category "test" fontified t target
"sec-1") 10 72 (org-category "test" fontified t target "sec-1") 73 78
(org-category "test" fontified t target "sec-1") 78 79 (face org-link target
"sec-1" fontified t org-category "test") 79 81 (face org-link) 81 84 (face
org-link target "sec-1" fontified t org-category "test" org-protected t
org-no-description nil) 84 85 (face org-link org-protected t org-no-description
nil) 85 89 (face org-link target "sec-1" fontified t org-category "test"
font-lock-fontified t org-protected t org-no-description nil) 89 90 (face
org-link) 90 91 (face org-link) 91 94 (org-category "test" fontified t target
"sec-1" face org-link) 94 95 (face org-link) 95 97 (font-lock-fontified t
org-category "test" fontified t target "sec-1" face org-link) 97 99
(font-lock-fontified t org-category "test" fontified t target "sec-1" face
org-link) 99 100 (face org-link) 100 101 (face org-link) 101 102
(rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo
org-linked-text) org-category "test" fontified t target "sec-1")) #("
[2011-04-21 Thu 21:01]" 0 1 (fontified t org-category "test") 1 22 (fontified t
org-category "test") 22 23 (fontified t org-category "test" rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo org-linked-text)))
"" ""))
(setq lines (mapcar (quote (lambda (line) (when (and (string-match
org-todo-line-regexp line) (not (get-text-property 0 ... line)) (<= (setq level
...) umax-toc)) (let ((txt ...) (todo ...) tags) (while (string-match
org-any-target-regexp line) (setq line ...)) (when (string-match ... txt) (setq
txt ... tags ...)) (when (string-match quote-re0 txt) (setq txt ...)) (while
(string-match "<\\(<\\)+\\|>\\(>\\)+" txt) (setq txt ...))
(org-parse-format (quote TOC-ITEM) (let* ... ...) level org-last-level) (setq
org-last-level level))) line)) lines))
(progn (org-html-bind-local-variables opt-plist) (erase-buffer)
(org-parse-begin (quote TOC) (nth 3 (plist-get opt-plist :lang-words))) (setq
lines (mapcar (quote (lambda (line) (when (and (string-match
org-todo-line-regexp line) (not ...) (<= ... umax-toc)) (let (... ... tags)
(while ... ...) (when ... ...) (when ... ...) (while ... ...) (org-parse-format
... ... level org-last-level) (setq org-last-level level))) line)) lines))
(org-parse-end (quote TOC)) (setq org-parse-table-of-contents (buffer-string)))
(unwind-protect (progn (org-html-bind-local-variables opt-plist)
(erase-buffer) (org-parse-begin (quote TOC) (nth 3 (plist-get opt-plist
:lang-words))) (setq lines (mapcar (quote (lambda (line) (when (and ... ...
...) (let ... ... ... ... ... ... ...)) line)) lines)) (org-parse-end (quote
TOC)) (setq org-parse-table-of-contents (buffer-string))) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(org-html-bind-local-variables opt-plist) (erase-buffer) (org-parse-begin
(quote TOC) (nth 3 (plist-get opt-plist :lang-words))) (setq lines (mapcar
(quote (lambda (line) (when ... ...) line)) lines)) (org-parse-end (quote TOC))
(setq org-parse-table-of-contents (buffer-string))) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer))))
(with-current-buffer temp-buffer (unwind-protect (progn
(org-html-bind-local-variables opt-plist) (erase-buffer) (org-parse-begin
(quote TOC) (nth 3 (plist-get opt-plist :lang-words))) (setq lines (mapcar
(quote (lambda (line) (when ... ...) line)) lines)) (org-parse-end (quote TOC))
(setq org-parse-table-of-contents (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 (org-html-bind-local-variables opt-plist)
(erase-buffer) (org-parse-begin (quote TOC) (nth 3 (plist-get opt-plist
:lang-words))) (setq lines (mapcar (quote (lambda ... ... line)) lines))
(org-parse-end (quote TOC)) (setq org-parse-table-of-contents (buffer-string)))
(and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
(with-temp-buffer (org-html-bind-local-variables opt-plist) (erase-buffer)
(org-parse-begin (quote TOC) (nth 3 (plist-get opt-plist :lang-words))) (setq
lines (mapcar (quote (lambda (line) (when (and (string-match
org-todo-line-regexp line) (not ...) (<= ... umax-toc)) (let (... ... tags)
(while ... ...) (when ... ...) (when ... ...) (while ... ...) (org-parse-format
... ... level org-last-level) (setq org-last-level level))) line)) lines))
(org-parse-end (quote TOC)) (setq org-parse-table-of-contents (buffer-string)))
(let* ((quote-re0 (concat "^[ ]*" org-quote-string "\\>"))
(org-min-level (org-get-min-level lines level-offset)) (org-last-level
org-min-level) level) (with-temp-buffer (org-html-bind-local-variables
opt-plist) (erase-buffer) (org-parse-begin (quote TOC) (nth 3 (plist-get
opt-plist :lang-words))) (setq lines (mapcar (quote (lambda (line) (when (and
... ... ...) (let ... ... ... ... ... ... ...)) line)) lines)) (org-parse-end
(quote TOC)) (setq org-parse-table-of-contents (buffer-string))))
org-parse-prepare-toc((#("* STARTED Alembert, Preliminary Discourse to the
Encyclopedia of Diderot :read:[[BIB:NEXT][BIB:NEXT]]:" 0 1 (org-category "test"
fontified t target "sec-1") 2 9 (org-category "test" fontified t target
"sec-1") 10 72 (org-category "test" fontified t target "sec-1") 73 78
(org-category "test" fontified t target "sec-1") 78 79 (face org-link target
"sec-1" fontified t org-category "test") 79 81 (face org-link) 81 84 (face
org-link target "sec-1" fontified t org-category "test" org-protected t
org-no-description nil) 84 85 (face org-link org-protected t org-no-description
nil) 85 89 (face org-link target "sec-1" fontified t org-category "test"
font-lock-fontified t org-protected t org-no-description nil) 89 90 (face
org-link) 90 91 (face org-link) 91 94 (org-category "test" fontified t target
"sec-1" face org-link) 94 95 (face org-link) 95 97 (font-lock-fontified t
org-category "test" fontified t target "sec-1" face org-link) 97 99
(font-lock-fontified t org-category "test" fontified t target "sec-1" face
org-link) 99 100 (face org-link) 100 101 (face org-link) 101 102
(rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo
org-linked-text) org-category "test" fontified t target "sec-1")) #("
[2011-04-21 Thu 21:01]" 0 1 (fontified t org-category "test") 1 22 (fontified t
org-category "test") 22 23 (fontified t org-category "test" rear-nonsticky
(mouse-face highlight keymap invisible intangible help-echo org-linked-text)))
"" "") 0 (:latex-image-options nil :exclude-tags ("noexport") :select-tags
("export") :publishing-directory nil :timestamp nil :expand-quoted-html t
:html-table-tag "<table border=\"2\" cellspacing=\"0\" cellpadding=\"6\"
rules=\"groups\" frame=\"hsides\">" :xml-declaration (("html" . "<?xml
version=\"1.0\" encoding=\"%s\"?>") ("php" . "<?php echo \"<?xml
version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>")) :html-postamble auto
:html-preamble t :html-extension "html" :inline-images maybe :convert-org-links
t :agenda-style "" :style-extra "" :style "" :style-include-scripts t
:style-include-default t :table-auto-headline t :tables t :time-stamp-file t
:creator-info t :email-info nil :author-info t :email "address@hidden" ...) 3)
(setq lines (org-parse-prepare-toc lines level-offset opt-plist umax-toc))
(progn (setq lines (org-parse-prepare-toc lines level-offset opt-plist
umax-toc)))
(if (and org-export-with-toc (not body-only)) (progn (setq lines
(org-parse-prepare-toc lines level-offset opt-plist umax-toc))))
(when (and org-export-with-toc (not body-only)) (setq lines
(org-parse-prepare-toc lines level-offset opt-plist umax-toc)))
(let ((case-fold-search nil) (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)) (when (and org-export-with-toc (not
body-only)) (setq lines (org-parse-prepare-toc lines level-offset opt-plist
umax-toc))) (unless body-only (org-parse-begin (quote DOCUMENT-CONTENT)
opt-plist) (org-parse-begin (quote DOCUMENT-BODY) opt-plist)) (setq head-count
0) (org-init-section-numbers) (org-parse-begin-paragraph) (while (setq line
(pop lines) origline line) (catch (quote nextline) (when (and
(org-parse-current-environment-p (quote quote)) (string-match "^\\*+ " line))
(org-parse-end-environment (quote quote))) (when
(org-parse-current-environment-p (quote quote)) (insert (org-parse-format
(quote PLAIN) line)) (throw (quote nextline) nil)) (when (and
org-export-with-fixed-width (string-match "^[ ]*:\\(\\([
]\\|$\\)\\(.*\\)\\)" line)) (when (not (org-parse-current-environment-p (quote
fixedwidth))) (org-parse-begin-environment (quote fixedwidth))) (insert
(org-parse-format (quote PLAIN) (match-string 3 line))) (when (or (not lines)
(not (string-match "^[ ]*:\\(\\([ ]\\|$\\)\\(.*\\)\\)" ...)))
(org-parse-end-environment (quote fixedwidth))) (throw (quote nextline) nil))
(when (and (get-text-property 0 (quote org-native-text) line) (not (< (or ...
10000) (length line)))) (let ((ind (get-text-property 0 ... line)))
(org-parse-begin-environment (quote native)) (insert (org-parse-format (quote
PLAIN) line)) (while (and lines (or ... ... ...) (or ... ...)) (insert
(org-parse-format ... ...))) (org-parse-end-environment (quote native))) (throw
(quote nextline) nil)) (when (and (get-text-property 0 (quote org-protected)
line) (not (< (or ... 10000) (length line)))) (let ((ind (get-text-property 0
... line))) (insert (org-parse-format (quote PLAIN) line)) (while (and lines
(or ... ... ...) (or ... ...)) (insert (org-parse-format ... ...)))) (throw
(quote nextline) nil)) (when (string-match "^ORG-\\(.+\\)-\\(START\\|END\\)$"
line) (let* ((style (intern ...)) (f (cdr ...))) (when (memq style (quote ...))
(funcall f style) (throw (quote nextline) nil)))) (run-hooks (quote
org-export-html-after-blockquotes-hook)) (when (org-parse-current-environment-p
(quote verse)) (let ((i (org-get-string-indentation line))) (if (> i 0) (setq
line (concat ... " " ...))) (unless (string-match "\\\\\\\\[ ]*$" line)
(setq line (concat line "\\\\"))))) (setq start 0) (while (string-match
"<<<?\\([^<>]*\\)>>>?\\((INVISIBLE)\\)?[ ]*\n?" line start) (cond
((get-text-property (match-beginning 1) (quote org-protected) line) (setq start
(match-end 1))) ((match-end 2) (setq line (replace-match ... t t line))) ((and
org-export-with-toc (equal ... 42)) (setq line (replace-match ... t t line)))
(t (setq line (replace-match ... t t line))))) (let ((org-html-protect t))
(setq line (org-html-handle-time-stamps line))) (or (string-match
org-table-hline-regexp line) (string-match "^[ ]*\\([+]-\\||[ ]\\)[-+
|]*[+|][ ]*$" line) (setq line (org-html-expand line))) (setq line
(org-parse-format-org-link line opt-plist)) (if (and (string-match
org-todo-line-regexp line) (match-beginning 2)) (setq line (concat (substring
line 0 (match-beginning 2)) (org-parse-format (quote TODO) (match-string 2
line)) (substring line (match-end 2))))) (when org-export-with-footnotes (setq
start 0) (while (string-match "\\([^* ].*?\\)[
]*\\[\\([0-9]+\\)\\]" line start) (if (get-text-property (match-beginning 2)
(quote org-protected) line) (setq start (match-end 2)) (let (... refcnt a) (if
... ... ... ...) (setq line ...))))) (cond ((string-match "^\\(\\*+\\)[
]+\\(.*\\)" line) (setq level (org-tr-level (- ... ... level-offset)) txt
(match-string 2 line)) (if (string-match quote-re0 txt) (setq txt
(replace-match "" t t txt))) (if (<= level (max umax umax-toc)) (setq
head-count (+ head-count 1))) (unless org-html-dyn-first-heading-pos (setq
org-html-dyn-first-heading-pos (point))) (org-parse-begin (quote LEVEL) level
txt umax head-count) (when (string-match quote-re line)
(org-parse-begin-environment (quote quote)))) ((and org-export-with-tables
(string-match "^\\([ ]*\\)\\(|\\|\\+-+\\+\\)" line)) (when (not
table-open) (setq table-open t table-buffer nil table-orig-buffer nil)) (setq
table-buffer (cons line table-buffer) table-orig-buffer (cons origline
table-orig-buffer)) (when (or (not lines) (not ...)) (setq table-open nil
table-buffer (nreverse table-buffer) table-orig-buffer (nreverse
table-orig-buffer)) (org-parse-end-paragraph) (insert (org-parse-format ...
table-buffer table-orig-buffer)))) (t (when (get-text-property 0 (quote
list-item) line) (setq line (org-html-export-list-line line ... ... ...)))
(when (string-match "^[ ]*-\\{5,\\}[ ]*$" line)
(with-org-parse-preserve-paragraph-state (insert ...)) (throw (quote nextline)
nil)) (when (string-match "^ [-+*]-\\|^[ ]*$" line) (when
org-html-footnote-number (org-parse-end-footnote-definition
org-html-footnote-number) (setq org-html-footnote-number nil))
(org-parse-begin-paragraph)) (when org-export-with-footnotes (when (and ...
...) (throw ... nil)) (when (string-match "^[ ]*\\[\\([0-9]+\\)\\]" line)
(org-parse-end-paragraph) (setq org-html-footnote-number ...) (setq line ...)
(org-parse-begin-footnote-definition org-html-footnote-number))) (cond
((string-match "\\\\\\\\[ ]*$" line) (setq line ...))
(org-export-preserve-breaks (setq line ...))) (let ((start 0)) (while (and
org-par-open ...) (error "FIXME") (if ... ...) (setq start ...))) (insert
(org-parse-format (quote PLAIN) line)))))) (when
(org-parse-current-environment-p (quote quote)) (org-parse-end-environment
(quote quote))) (org-parse-end (quote LEVEL) 1 umax) (when (and (> umax 0)
org-html-dyn-first-heading-pos) (org-parse-end (quote SECTION))) (org-parse-end
(quote DOCUMENT-BODY) opt-plist) (unless body-only (org-parse-end (quote
DOCUMENT-CONTENT))) (unless (plist-get opt-plist :buffer-will-be-killed)
(set-auto-mode t)) (org-parse-end (quote EXPORT)) (goto-char (point-min)) (or
(org-export-push-to-kill-ring (upcase (symbol-name org-parse-backend)))
(message "Exporting... done")) (cond ((not to-buffer) (let ((f (org-parse-get
(quote SAVE-METHOD)))) (or (and f (functionp f) (funcall f filename opt-plist))
(save-buffer))) (current-buffer)) ((eq to-buffer (quote string)) (prog1
(buffer-substring (point-min) (point-max)) (kill-buffer (current-buffer)))) (t
(current-buffer))))
(let* (org-html-protect org-par-open (org-html-insert-tag-with-newlines
(quote both)) (org-parse-to-buffer to-buffer) (org-parse-body-only body-only)
(org-export-html-special-string-regexps (org-parse-get (quote
SPECIAL-STRING-REGEXPS))) (org-parse-entity-control-callbacks-alist
(org-parse-get (quote ENTITY-CONTROL)))
(org-parse-entity-format-callbacks-alist (org-parse-get (quote ENTITY-FORMAT)))
(opt-plist (org-export-process-option-filters (org-combine-plists
(org-default-export-plist) ext-plist (org-infile-export-plist)))) (body-only
(or body-only (plist-get opt-plist :body-only))) valid
org-html-dyn-first-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) (>=
... 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-export-opt-plist (if subtree-p (org-export-add-subtree-options opt-plist
rbeg) opt-plist))) (org-current-export-dir (or pub-dir (org-parse-get (quote
EXPORT-DIR) opt-plist))) (org-current-export-file buffer-file-name) (level 0)
(line "") (origline "") txt todo (umax nil) (umax-toc nil) (filename (if
to-buffer nil (expand-file-name (concat (file-name-sans-extension (or ... ...))
"." (org-parse-get (quote FILE-NAME-EXTENSION) opt-plist))
(file-name-as-directory (or pub-dir (org-parse-get ... opt-plist))))))
(current-dir (if buffer-file-name (file-name-directory buffer-file-name)
default-directory)) (buffer (if to-buffer (cond ((eq to-buffer (quote string))
(get-buffer-create (org-parse-get ...))) (t (get-buffer-create to-buffer)))
(find-file-noselect (or (let (...) (and f ... ...)) filename))))
(org-levels-open (make-vector org-level-max nil)) (date (plist-get opt-plist
:date)) (date (cond ((and date (string-match "%" date)) (format-time-string
date)) (date date) (t (format-time-string "%Y-%m-%d %T %Z")))) (dummy (setq
opt-plist (plist-put opt-plist :effective-date date))) (title (org-html-expand
(or (and subtree-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-extension (file-name-nondirectory
buffer-file-name))) "UNTITLED"))) (dummy (setq opt-plist (plist-put opt-plist
:title title))) (html-table-tag (plist-get opt-plist :html-table-tag))
(quote-re0 (concat "^[ ]*" org-quote-string "\\>")) (quote-re (concat
"^\\(\\*+\\)\\([ ]+" org-quote-string "\\>\\)"))
(org-parse-dyn-current-environment nil) (lang-words (or (assoc (plist-get
opt-plist :language) org-export-language-setup) (assoc "en"
org-export-language-setup))) (dummy (setq opt-plist (plist-put opt-plist
:lang-words lang-words))) (head-count 0) cnt (start 0) (coding-system-for-write
(org-html-get-coding-system-for-write)) (save-buffer-coding-system
(org-html-get-coding-system-for-save)) (region (buffer-substring (if region-p
(region-beginning) (point-min)) (if region-p (region-end) (point-max))))
(org-export-have-math nil) ...) (let ((inhibit-read-only t)) (org-unmodified
(remove-text-properties (point-min) (point-max) (quote (:org-license-to-kill
t))))) (message "Exporting...") (org-init-section-numbers) (setq
org-html-output-buffer buffer) (set-buffer org-html-output-buffer) (let
((inhibit-read-only t)) (erase-buffer)) (fundamental-mode)
(org-install-letbind) (and (fboundp (quote set-buffer-file-coding-system))
(set-buffer-file-coding-system coding-system-for-write)) (let
((case-fold-search nil) (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)) (when (and org-export-with-toc (not
body-only)) (setq lines (org-parse-prepare-toc lines level-offset opt-plist
umax-toc))) (unless body-only (org-parse-begin (quote DOCUMENT-CONTENT)
opt-plist) (org-parse-begin (quote DOCUMENT-BODY) opt-plist)) (setq head-count
0) (org-init-section-numbers) (org-parse-begin-paragraph) (while (setq line
(pop lines) origline line) (catch (quote nextline) (when (and
(org-parse-current-environment-p (quote quote)) (string-match "^\\*+ " line))
(org-parse-end-environment (quote quote))) (when
(org-parse-current-environment-p (quote quote)) (insert (org-parse-format
(quote PLAIN) line)) (throw (quote nextline) nil)) (when (and
org-export-with-fixed-width (string-match "^[ ]*:\\(\\([
]\\|$\\)\\(.*\\)\\)" line)) (when (not (org-parse-current-environment-p ...))
(org-parse-begin-environment (quote fixedwidth))) (insert (org-parse-format
(quote PLAIN) (match-string 3 line))) (when (or (not lines) (not ...))
(org-parse-end-environment (quote fixedwidth))) (throw (quote nextline) nil))
(when (and (get-text-property 0 (quote org-native-text) line) (not (< ...
...))) (let ((ind ...)) (org-parse-begin-environment (quote native)) (insert
(org-parse-format ... line)) (while (and lines ... ...) (insert ...))
(org-parse-end-environment (quote native))) (throw (quote nextline) nil)) (when
(and (get-text-property 0 (quote org-protected) line) (not (< ... ...))) (let
((ind ...)) (insert (org-parse-format ... line)) (while (and lines ... ...)
(insert ...))) (throw (quote nextline) nil)) (when (string-match
"^ORG-\\(.+\\)-\\(START\\|END\\)$" line) (let* ((style ...) (f ...)) (when
(memq style ...) (funcall f style) (throw ... nil)))) (run-hooks (quote
org-export-html-after-blockquotes-hook)) (when (org-parse-current-environment-p
(quote verse)) (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 ... ... line) (setq start ...)) ((match-end 2) (setq
line ...)) ((and org-export-with-toc ...) (setq line ...)) (t (setq line
...)))) (let ((org-html-protect t)) (setq line (org-html-handle-time-stamps
line))) (or (string-match org-table-hline-regexp line) (string-match "^[
]*\\([+]-\\||[ ]\\)[-+ |]*[+|][ ]*$" line) (setq line (org-html-expand
line))) (setq line (org-parse-format-org-link line opt-plist)) (if (and
(string-match org-todo-line-regexp line) (match-beginning 2)) (setq line
(concat (substring line 0 ...) (org-parse-format ... ...) (substring line
...)))) (when org-export-with-footnotes (setq start 0) (while (string-match
"\\([^* ].*?\\)[ ]*\\[\\([0-9]+\\)\\]" line start) (if
(get-text-property ... ... line) (setq start ...) (let ... ... ...)))) (cond
((string-match "^\\(\\*+\\)[ ]+\\(.*\\)" line) (setq level
(org-tr-level ...) txt (match-string 2 line)) (if (string-match quote-re0 txt)
(setq txt ...)) (if (<= level ...) (setq head-count ...)) (unless
org-html-dyn-first-heading-pos (setq org-html-dyn-first-heading-pos ...))
(org-parse-begin (quote LEVEL) level txt umax head-count) (when (string-match
quote-re line) (org-parse-begin-environment ...))) ((and org-export-with-tables
(string-match "^\\([ ]*\\)\\(|\\|\\+-+\\+\\)" line)) (when (not table-open)
(setq table-open t table-buffer nil table-orig-buffer nil)) (setq table-buffer
(cons line table-buffer) table-orig-buffer (cons origline table-orig-buffer))
(when (or ... ...) (setq table-open nil table-buffer ... table-orig-buffer ...)
(org-parse-end-paragraph) (insert ...))) (t (when (get-text-property 0 ...
line) (setq line ...)) (when (string-match "^[ ]*-\\{5,\\}[ ]*$" line)
(with-org-parse-preserve-paragraph-state ...) (throw ... nil)) (when
(string-match "^ [-+*]-\\|^[ ]*$" line) (when org-html-footnote-number ...
...) (org-parse-begin-paragraph)) (when org-export-with-footnotes (when ...
...) (when ... ... ... ... ...)) (cond (... ...) (org-export-preserve-breaks
...)) (let (...) (while ... ... ... ...)) (insert (org-parse-format ...
line)))))) (when (org-parse-current-environment-p (quote quote))
(org-parse-end-environment (quote quote))) (org-parse-end (quote LEVEL) 1 umax)
(when (and (> umax 0) org-html-dyn-first-heading-pos) (org-parse-end (quote
SECTION))) (org-parse-end (quote DOCUMENT-BODY) opt-plist) (unless body-only
(org-parse-end (quote DOCUMENT-CONTENT))) (unless (plist-get opt-plist
:buffer-will-be-killed) (set-auto-mode t)) (org-parse-end (quote EXPORT))
(goto-char (point-min)) (or (org-export-push-to-kill-ring (upcase (symbol-name
org-parse-backend))) (message "Exporting... done")) (cond ((not to-buffer) (let
((f (org-parse-get ...))) (or (and f (functionp f) (funcall f filename
opt-plist)) (save-buffer))) (current-buffer)) ((eq to-buffer (quote string))
(prog1 (buffer-substring (point-min) (point-max)) (kill-buffer
(current-buffer)))) (t (current-buffer)))))
org-do-export(nil nil nil "*Org HTML Export*" nil nil)
(let* ((org-parse-get-callback backend-get)) (org-do-export arg hidden
ext-plist to-buffer body-only pub-dir))
(let* ((backend-desc (assoc-string backend org-export-backends-alist t))
(backend-get (cdr backend-desc)) (backend-get (and (functionp backend-get)
backend-get))) (unless backend-get (error "Don't know how to export to backend
%s" backend)) (run-hooks (quote org-export-first-hook)) (let*
((org-parse-get-callback backend-get)) (org-do-export arg hidden ext-plist
to-buffer body-only pub-dir)))
org-export-as("html" nil nil nil "*Org HTML Export*")
(let ((tempbuf (format "*Org %s Export*" (upcase backend)))) (org-export-as
backend arg nil nil tempbuf) (when org-export-show-temporary-export-buffer
(switch-to-buffer-other-window tempbuf)))
org-export-as-to-buffer("html" nil)
org-export-as-html-to-buffer(nil)
call-interactively(org-export-as-html-to-buffer)
(if (and bg (nth 2 ass) (not (buffer-base-buffer)) (not
(org-region-active-p))) (let ((p (start-process (concat "Exporting "
(file-name-nondirectory (buffer-file-name))) "*Org Processes*"
(expand-file-name invocation-name invocation-directory) "-batch" "-l"
user-init-file "--eval" "(require 'org-exp)" "--eval" "(setq org-wait .2)"
(buffer-file-name) "-f" (symbol-name (nth 1 ass))))) (set-process-sentinel p
(quote org-export-process-sentinel)) (message "Background process \"%s\":
started" p)) (if subtree-p (progn (org-mark-subtree) (activate-mark)))
(call-interactively (nth 1 ass)) (when (and bpos (get-buffer-window cbuf)) (let
((cw (selected-window))) (select-window (get-buffer-window cbuf)) (goto-char
cpos) (deactivate-mark) (select-window cw))))
(let* ((bg (org-xor (equal arg (quote (16))) org-export-run-in-background))
(subtree-p (or (org-region-active-p) (eq org-export-initial-scope (quote
subtree)))) (help "[t] insert the export option template\n[v] limit export
to visible part of outline tree\n[1] switch buffer/subtree export\n[SPC]
publish enclosing subtree (with LaTeX_CLASS or EXPORT_FILE_NAME
prop)\n\n[a/n/u] export as ASCII/Latin-1/UTF-8 [A/N/U] to temporary
buffer\n\n[h] export as HTML [H] to temporary buffer [R] export
region\n[b] export as HTML and open in browser\n\n[l] export as LaTeX [L]
to temporary buffer\n[p] export as LaTeX and process to PDF [d] ...
and open PDF file\n\n[D] export as DocBook [V] export as DocBook, process to
PDF, and open\n\n[o] export as ODT [O] export as ODT and open\n\n[j] export
as TaskJuggler [J] ... and open\n\n[m] export as
Freemind mind map\n[x] export as XOXO\n[g] export using Wes Hardaker's generic
exporter\n\n[i] export current file as iCalendar file\n[I] export all agenda
files as iCalendar files [c] ...as one combined file\n\n[F] publish current
file [P] publish current project\n[X] publish a project...
[E] publish every projects") (cmds (quote ((116
org-insert-export-options-template nil) (118 org-export-visible nil) (97
org-export-as-ascii t) (65 org-export-as-ascii-to-buffer t) (110
org-export-as-latin1 t) (78 org-export-as-latin1-to-buffer t) (117
org-export-as-utf8 t) (85 org-export-as-utf8-to-buffer t) (104
org-export-as-html t) (98 org-export-as-html-and-open t) (72
org-export-as-html-to-buffer nil) (82 org-export-region-as-html nil) (120
org-export-as-xoxo t) (103 org-export-generic t) (68 org-export-as-docbook t)
(86 org-export-as-docbook-pdf-and-open t) (111 org-export-as-odt t) (79
org-export-as-odt-and-open nil) (106 org-export-as-taskjuggler t) (74
org-export-as-taskjuggler-and-open t) (109 org-export-as-freemind t) (108
org-export-as-latex t) (112 org-export-as-pdf t) (100
org-export-as-pdf-and-open t) (76 org-export-as-latex-to-buffer nil) (105
org-export-icalendar-this-file t) (73 org-export-icalendar-all-agenda-files t)
(99 org-export-icalendar-combine-agenda-files t) (70 org-publish-current-file
t) (80 org-publish-current-project t) (88 org-publish t) (69 org-publish-all
t)))) r1 r2 ass (cpos (point)) (cbuf (current-buffer)) bpos) (save-excursion
(save-window-excursion (if subtree-p (message "Export subtree: ") (message
"Export buffer: ")) (delete-other-windows) (with-output-to-temp-buffer "*Org
Export/Publishing Help*" (princ help)) (org-fit-window-to-buffer
(get-buffer-window "*Org Export/Publishing Help*")) (while (eq (setq r1
(read-char-exclusive)) 49) (cond (subtree-p (setq subtree-p nil) (message
"Export buffer: ")) ((not subtree-p) (setq subtree-p t) (message "Export
subtree: ")))) (when (eq r1 32) (let ((case-fold-search t)) (if
(re-search-backward "^[ ]+\\(:latex_class:\\|:export_title:\\)[
]+\\S-" nil t) (progn (org-back-to-heading t) (setq subtree-p t) (setq bpos
...) (message "Select command (for subtree): ") (setq r1 ...)) (error "No
enclosing node with LaTeX_CLASS or EXPORT_FILE_NAME")))))) (redisplay) (and
bpos (goto-char bpos)) (setq r2 (if (< r1 27) (+ r1 96) r1)) (unless (setq ass
(assq r2 cmds)) (error "No command associated with key %c" r1)) (if (and bg
(nth 2 ass) (not (buffer-base-buffer)) (not (org-region-active-p))) (let ((p
(start-process (concat "Exporting " (file-name-nondirectory ...)) "*Org
Processes*" (expand-file-name invocation-name invocation-directory) "-batch"
"-l" user-init-file "--eval" "(require 'org-exp)" "--eval" "(setq org-wait .2)"
(buffer-file-name) "-f" (symbol-name (nth 1 ass))))) (set-process-sentinel p
(quote org-export-process-sentinel)) (message "Background process \"%s\":
started" p)) (if subtree-p (progn (org-mark-subtree) (activate-mark)))
(call-interactively (nth 1 ass)) (when (and bpos (get-buffer-window cbuf)) (let
((cw (selected-window))) (select-window (get-buffer-window cbuf)) (goto-char
cpos) (deactivate-mark) (select-window cw)))))
org-export(nil)
call-interactively(org-export nil nil)
- Re: [O] [PATCH][ANN] org-html/org-odt,
Matt Lundin <=