From c5081b8f14767b1c8d6d77e0ff67aa702560c286 Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Sun, 13 Nov 2011 11:45:24 +0530 Subject: [PATCH] org-lparse.el & co: Bring over few commits Bring over following commits: - 97538eb9 - 5c53026d - 3482284b - 58f1dbcc - 8b16fae4 - 106993d3 --- contrib/lisp/org-lparse.el | 40 ++++++++++++++++++++------------------ contrib/lisp/org-odt.el | 14 ++++++------- contrib/lisp/org-xhtml.el | 22 ++++++++++----------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/contrib/lisp/org-lparse.el b/contrib/lisp/org-lparse.el index 5c4b33413..a18f9b9a9 100755 --- a/contrib/lisp/org-lparse.el +++ b/contrib/lisp/org-lparse.el @@ -5,8 +5,7 @@ ;; Author: Jambunathan K ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 0.8 - +;; ;; This file is not (yet) part of GNU Emacs. ;; However, it is distributed under the same license. @@ -996,7 +995,8 @@ version." (setq line (org-lparse-format-org-link line opt-plist)) ;; TODO items - (if (and (string-match org-todo-line-regexp line) + (if (and org-todo-line-regexp + (string-match org-todo-line-regexp line) (match-beginning 2)) (setq line (concat (substring line 0 (match-beginning 2)) @@ -1409,24 +1409,26 @@ for further information." "Format time stamps in string S, or remove them." (catch 'exit (let (r b) - (while (string-match org-maybe-keyword-time-regexp s) - (or b (setq b (substring s 0 (match-beginning 0)))) - (setq r (concat - r (substring s 0 (match-beginning 0)) " " - (org-lparse-format - 'FONTIFY - (concat - (if (match-end 1) - (org-lparse-format - 'FONTIFY - (match-string 1 s) "timestamp-kwd")) - " " + (when org-maybe-keyword-time-regexp + (while (string-match org-maybe-keyword-time-regexp s) + (or b (setq b (substring s 0 (match-beginning 0)))) + (setq r (concat + r (substring s 0 (match-beginning 0)) " " (org-lparse-format 'FONTIFY - (substring (org-translate-time (match-string 3 s)) 1 -1) - "timestamp")) - "timestamp-wrapper")) - s (substring s (match-end 0)))) + (concat + (if (match-end 1) + (org-lparse-format + 'FONTIFY + (match-string 1 s) "timestamp-kwd")) + " " + (org-lparse-format + 'FONTIFY + (substring (org-translate-time (match-string 3 s)) 1 -1) + "timestamp")) + "timestamp-wrapper")) + s (substring s (match-end 0))))) + ;; Line break if line started and ended with time stamp stuff (if (not r) s diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el index 0d53efd71..65c50ea02 100644 --- a/contrib/lisp/org-odt.el +++ b/contrib/lisp/org-odt.el @@ -5,8 +5,7 @@ ;; Author: Jambunathan K ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 0.8 - +;; ;; This file is not (yet) part of GNU Emacs. ;; However, it is distributed under the same license. @@ -1338,14 +1337,13 @@ value of `org-export-odt-fontify-srcblocks." (defun org-odt-format-org-link (opt-plist type-1 path fragment desc attr descp) - "Make an HTML link. + "Make a OpenDocument link. OPT-PLIST is an options list. -TYPE is the device-type of the link (THIS://foo.html) -PATH is the path of the link (http://THIS#locationx) -FRAGMENT is the fragment part of the link, if any (foo.html#THIS) +TYPE-1 is the device-type of the link (THIS://foo.html). +PATH is the path of the link (http://THIS#location). +FRAGMENT is the fragment part of the link, if any (foo.html#THIS). DESC is the link description, if any. -ATTR is a string of other attributes of the a element. -MAY-INLINE-P allows inlining it as an image." +ATTR is a string of other attributes of the a element." (declare (special org-lparse-par-open)) (save-match-data (let* ((may-inline-p diff --git a/contrib/lisp/org-xhtml.el b/contrib/lisp/org-xhtml.el index 433001c17..7534f9b6c 100644 --- a/contrib/lisp/org-xhtml.el +++ b/contrib/lisp/org-xhtml.el @@ -5,11 +5,10 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 0.8 - +;; ;; This file is not (yet) part of GNU Emacs. ;; However, it is distributed under the same license. - +;; ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or @@ -36,6 +35,8 @@ (declare-function org-id-find-id-file "org-id" (id)) (declare-function htmlize-region "ext:htmlize" (beg end)) +(declare-function org-pop-to-buffer-same-window + "org-compat" (&optional buffer-or-name norecord label)) (defgroup org-export-xhtml nil "Options specific for HTML export of Org-mode files." @@ -579,6 +580,7 @@ a file." ("<" . "<") (">" . ">")) "Alist of characters to be converted by `org-html-protect'." + :group 'org-export-xhtml :type '(repeat (cons (string :tag "Character") (string :tag "HTML equivalent")))) @@ -713,17 +715,15 @@ See variable `org-export-xhtml-link-org-files-as-html'" "." (plist-get opt-plist :html-extension))))))) -;;; org-xhtml-format-org-link (defun org-xhtml-format-org-link (opt-plist type-1 path fragment desc attr descp) "Make an HTML link. OPT-PLIST is an options list. -TYPE is the device-type of the link (THIS://foo.html) -PATH is the path of the link (http://THIS#locationx) -FRAGMENT is the fragment part of the link, if any (foo.html#THIS) +TYPE is the device-type of the link (THIS://foo.html). +PATH is the path of the link (http://THIS#location). +FRAGMENT is the fragment part of the link, if any (foo.html#THIS). DESC is the link description, if any. -ATTR is a string of other attributes of the a element. -MAY-INLINE-P allows inlining it as an image." +ATTR is a string of other attributes of the \"a\" element." (declare (special org-lparse-par-open)) (save-match-data (when (string= type-1 "coderef") @@ -1751,7 +1751,7 @@ lang=\"%s\" xml:lang=\"%s\"> (format-spec html-pre `((?t . ,title) (?a . ,author) (?d . ,date) (?e . ,email))))) ((functionp html-pre) - (funcall html-pre opt-plist)) + (funcall html-pre)) (t (insert (format-spec @@ -1797,7 +1797,7 @@ lang=\"%s\" xml:lang=\"%s\"> (?v . ,html-validation-link)))) (insert "")) ((functionp html-post) - (funcall html-post opt-plist)) + (funcall html-post)) ((eq html-post 'auto) ;; fall back on default postamble (insert "
\n")