org-lparse.el & co: Bring over few commits (contd.)

Bring over following commits:
- dfcb6fae
- 767f5188
- ca49e893
- 728611fa
- b2408c00
- 97d107d9
This commit is contained in:
Jambunathan K 2011-11-13 14:16:42 +05:30
parent b13b3e30d7
commit 7e31ecdb22
2 changed files with 29 additions and 17 deletions

View File

@ -563,6 +563,7 @@ and then converted to \"doc\" then org-lparse-backend is set to
(setq params (format "(%s)" params)))
(ignore-errors (read params)))))
(defvar org-heading-keyword-regexp-format) ; defined in org.el
(defvar org-lparse-special-blocks '("list-table" "annotation"))
(defun org-do-lparse (arg &optional hidden ext-plist
to-buffer body-only pub-dir)
@ -674,6 +675,7 @@ version."
(current-dir (if buffer-file-name
(file-name-directory buffer-file-name)
default-directory))
(auto-insert nil) ; Avoid any auto-insert stuff for the new file
(buffer (if to-buffer
(cond
((eq to-buffer 'string)
@ -684,6 +686,12 @@ version."
(and f (functionp f) (funcall f filename)))
filename))))
(org-levels-open (make-vector org-level-max nil))
(dummy (mapc
(lambda(p)
(let* ((val (plist-get opt-plist p))
(val (org-xml-encode-org-text-skip-links val)))
(setq opt-plist (plist-put opt-plist p val))))
'(:date :author :keywords :description)))
(date (plist-get opt-plist :date))
(date (cond
((and date (string-match "%" date))
@ -704,8 +712,9 @@ version."
"UNTITLED")))
(dummy (setq opt-plist (plist-put opt-plist :title title)))
(html-table-tag (plist-get opt-plist :html-table-tag))
(quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
(quote-re (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)"))
(quote-re0 (concat "^ *" org-quote-string "\\( +\\|[ \t]*$\\)"))
(quote-re (format org-heading-keyword-regexp-format
org-quote-string))
(org-lparse-dyn-current-environment nil)
;; Get the language-dependent settings
(lang-words (or (assoc (plist-get opt-plist :language)
@ -1038,7 +1047,7 @@ version."
t t line))))))
(cond
((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line)
((string-match "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" line)
;; This is a headline
(setq level (org-tr-level (- (match-end 1) (match-beginning 1)
level-offset))
@ -1450,7 +1459,9 @@ Possible conversions are set in `org-export-html-protect-char-alist'."
(defun org-xml-encode-org-text-skip-links (string)
"Prepare STRING for HTML export. Apply all active conversions.
If there are links in the string, don't modify these."
If there are links in the string, don't modify these. If STRING
is nil, return nil."
(when string
(let* ((re (concat org-bracket-link-regexp "\\|"
(org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
m s l res)
@ -1461,7 +1472,7 @@ If there are links in the string, don't modify these."
(push (org-xml-encode-org-text s) res)
(push l res))
(push (org-xml-encode-org-text string) res)
(apply 'concat (nreverse res))))
(apply 'concat (nreverse res)))))
(defun org-xml-encode-org-text (s)
"Apply all active conversions to translate special ASCII to HTML."

View File

@ -1274,11 +1274,11 @@ make any modifications to the exporter file. For example,
"%s
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\"
lang=\"%s\" xml:lang=\"%s\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\">
<head>
<title>%s</title>
<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"/>
<meta name=\"title\" content=\"%s\"/>
<meta name=\"generator\" content=\"Org-mode\"/>
<meta name=\"generated\" content=\"%s\"/>
<meta name=\"author\" content=\"%s\"/>
@ -1300,6 +1300,7 @@ lang=\"%s\" xml:lang=\"%s\">
language language
(plist-get opt-plist :title)
charset
(plist-get opt-plist :title)
(plist-get opt-plist :effective-date)
(plist-get opt-plist :author)
(plist-get opt-plist :description)