From: Carsten Dominik Date: Fri, 20 Nov 2009 20:54:05 +0000 (+0000) Subject: 2009-11-20 Carsten Dominik X-Git-Tag: emacs-pretest-23.1.90~297 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5dec95551def9b6bf1891dd5e56505e9a1851f79;p=emacs.git 2009-11-20 Carsten Dominik * org-agenda.el (org-agenda-diary-entry-in-org-file): Rebuild agenda after adding new entry. * org-datetree.el (org-datetree-find-day-create): Fix regular expression. * org.el (org-display-outline-path): Use a format specifier for message, to avoid problems with heading containing `%'. * org-agenda.el (org-agenda-hide-tags-regexp): New option. (org-format-agenda-item): Call `org-agenda-fix-displayed-tags'. (org-agenda-fix-displayed-tags): New function. (org-agenda-do-context-action): Just call `org-display-outline-path', without piping the result through `message'. * org-latex.el (org-export-latex-preprocess): Protect secondary footnote references. * org-indent.el (org-indent-initialize): Avoid empty strings as line prefixes. * org-agenda.el (org-agenda-diary-entry-in-org-file): Make sure hat checking for the mark does not throw an error. (org-agenda-diary-entry-in-org-file): Catch the case that there is not `day' text property in the cursor line. * org.el (org-sort-entries-or-items): Make sure that the final entry has a newline before doing the sorting. * org-agenda.el (org-agenda-diary-entry-in-org-file): Get the text property at the beginning of the line. * org.el (org-make-link-string): Don't allow a description with only white space. * org-agenda.el (org-agenda-insert-diary-strategy): New variable. (org-agenda-insert-diary-as-top-level): New function. (org-agenda-add-entry-to-org-agenda-diary-file): Call `org-agenda-insert-diary-as-top-level'. * org.el (org-occur-in-agenda-files): Make sure none of the buffers is narrowed. (org-activate-plain-links): Add the face property here. (org-set-font-lock-defaults): Do not add the face to plain links, the activator function does this. * org-habit.el (org-is-habit-p): Add doc string. * org-archive.el (org-archive-subtree-default-with-confirmation): Autoload. * org-latex.el (org-export-latex-fontify): Fix regexp to make char after match optional (happens at the end of a line...). * org.el (org-fontify-meta-lines-and-blocks): Apply special faces for special blocks. * org-faces.el (org-copy-face): Set lisp indentation. (org-quote, org-verse): New faces. * org-agenda.el (org-agenda-remove-date): Remove variable. * org-freemind.el (org-freemind-escape-str-from-org): Fix encoding. * org-html.el (org-export-as-html): Move the home/up link into the content div. * org.el (org-export-latex-packages-alist): Option definition moved here from org-latex.el. * org-html.el (org-export-html-home/up-format): Add an ID to the up/home div. * org-wl.el (org-wl-store-link): Handle the case that `wl-use-petname' is set. * org.el (org-set-effort): Improve prompt. (org-get-outline-path): Widen to get full path. (org-compact-display-after-subtree-move): Function removed. 2009-11-20 Eric Schulte * org-exp-blocks.el (org-export-blocks-format-ditaa): Use sha1 hash keys to cache and re-use images generated by the org-exp-blocks interface to ditaa and dot. * org.el (org-format-latex): Latex images are now saved to files named by the sha1 hash of the latex source text avoiding regeneration of identical images. --- diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 3c0cfc16a73..7d7cb25a6f7 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,7 @@ +2009-11-20 Carsten Dominik + + * org.texi: (Column attributes): Fix documentaion of new operators. + 2009-11-20 Chong Yidong * sem-user.texi (Semanticdb Search Configuration): Rearrange nodes. diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog index 5ae2dc76ec1..7582e8364cf 100644 --- a/lisp/org/ChangeLog +++ b/lisp/org/ChangeLog @@ -1,3 +1,96 @@ +2009-11-20 Carsten Dominik + + * org-agenda.el (org-agenda-diary-entry-in-org-file): Rebuild + agenda after adding new entry. + + * org-datetree.el (org-datetree-find-day-create): Fix regular + expression. + + * org.el (org-display-outline-path): Use a format specifier for + message, to avoid problems with heading containing `%'. + + * org-agenda.el (org-agenda-hide-tags-regexp): New option. + (org-format-agenda-item): Call `org-agenda-fix-displayed-tags'. + (org-agenda-fix-displayed-tags): New function. + (org-agenda-do-context-action): Just call + `org-display-outline-path', without piping the result through + `message'. + + * org-latex.el (org-export-latex-preprocess): Protect secondary + footnote references. + + * org-indent.el (org-indent-initialize): Avoid empty strings as + line prefixes. + + * org-agenda.el (org-agenda-diary-entry-in-org-file): Make sure + hat checking for the mark does not throw an error. + (org-agenda-diary-entry-in-org-file): Catch the case that there is + not `day' text property in the cursor line. + + * org.el (org-sort-entries-or-items): Make sure that the final + entry has a newline before doing the sorting. + + * org-agenda.el (org-agenda-diary-entry-in-org-file): Get the text + property at the beginning of the line. + + * org.el (org-make-link-string): Don't allow a description with + only white space. + + * org-agenda.el (org-agenda-insert-diary-strategy): New variable. + (org-agenda-insert-diary-as-top-level): New function. + (org-agenda-add-entry-to-org-agenda-diary-file): Call + `org-agenda-insert-diary-as-top-level'. + + * org.el (org-occur-in-agenda-files): Make sure none of the + buffers is narrowed. + (org-activate-plain-links): Add the face property here. + (org-set-font-lock-defaults): Do not add the face to plain links, + the activator function does this. + + * org-habit.el (org-is-habit-p): Add doc string. + + * org-archive.el (org-archive-subtree-default-with-confirmation): + Autoload. + + * org-latex.el (org-export-latex-fontify): Fix regexp to make char + after match optional (happens at the end of a line...). + + * org.el (org-fontify-meta-lines-and-blocks): Apply special faces + for special blocks. + + * org-faces.el (org-copy-face): Set lisp indentation. + (org-quote, org-verse): New faces. + + * org-agenda.el (org-agenda-remove-date): Remove variable. + + * org-freemind.el (org-freemind-escape-str-from-org): Fix encoding. + + * org-html.el (org-export-as-html): Move the home/up link into + the content div. + + * org.el (org-export-latex-packages-alist): Option definition + moved here from org-latex.el. + + * org-html.el (org-export-html-home/up-format): Add an ID to the + up/home div. + + * org-wl.el (org-wl-store-link): Handle the case that + `wl-use-petname' is set. + + * org.el (org-set-effort): Improve prompt. + (org-get-outline-path): Widen to get full path. + (org-compact-display-after-subtree-move): Function removed. + +2009-11-20 Eric Schulte + + * org-exp-blocks.el (org-export-blocks-format-ditaa): Use sha1 + hash keys to cache and re-use images generated by the + org-exp-blocks interface to ditaa and dot. + + * org.el (org-format-latex): Latex images are now saved to files + named by the sha1 hash of the latex source text avoiding + regeneration of identical images. + 2009-11-15 Carsten Dominik * org-latex.el (org-export-as-latex): Add the :drawers property. diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 6bbdbe86306..e0698fb819e 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -1208,6 +1208,16 @@ When non-nil, this must be the number of minutes, e.g. 60 for one hour." :group 'org-agenda-line-format :type 'boolean) +(defcustom org-agenda-hide-tags-regexp nil + "Regular expression used to filter away specific tags in agenda views. +This means that these tags will be present, but not be shown in the agenda +line. Secondayt filltering will still work on the hidden tags. +Nil means don't hide any tags." + :group 'org-agenda-line-format + :type '(choice + (const :tag "Hide none" nil) + (string :tag "Regexp "))) + (defcustom org-agenda-remove-tags nil "Non-nil means, remove the tags from the headline copy in the agenda. When this is the symbol `prefix', only remove tags when @@ -2970,7 +2980,6 @@ When EMPTY is non-nil, also include days without any entries." (defvar org-starting-day nil) ; local variable in the agenda buffer (defvar org-agenda-span nil) ; local variable in the agenda buffer (defvar org-include-all-loc nil) ; local variable -(defvar org-agenda-remove-date nil) ; dynamically scoped FIXME: not used??? ;;;###autoload (defun org-agenda-list (&optional include-all start-day ndays) @@ -4513,9 +4522,12 @@ Any match of REMOVE-RE will be removed from TXT." (save-match-data ;; Diary entries sometimes have extra whitespace at the beginning (if (string-match "^ +" txt) (setq txt (replace-match "" nil nil txt))) - (when org-agenda-show-inherited-tags - ;; Fix the tags part in txt - (setq txt (org-agenda-add-inherited-tags txt tags))) + + ;; Fix the tags part in txt + (setq txt (org-agenda-fix-displayed-tags + txt tags + org-agenda-show-inherited-tags + org-agenda-hide-tags-regexp)) (let* ((category (or category org-category (if buffer-file-name @@ -4646,27 +4658,37 @@ Any match of REMOVE-RE will be removed from TXT." 'extra extra 'dotime dotime)))) -(defun org-agenda-add-inherited-tags (txt tags) - "Remove tags string from TXT, and add complete list of tags. -The new list includes inherited tags. If any inherited tags are present, -a double colon separates inherited tags from local tags." - (if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$") txt) - (setq txt (substring txt 0 (match-beginning 0)))) - (when tags - (let ((have-i (get-text-property 0 'inherited (car tags))) - i) - (setq txt (concat txt " :" - (mapconcat - (lambda (x) - (setq i (get-text-property 0 'inherited x)) - (if (and have-i (not i)) - (progn - (setq have-i nil) - (concat ":" x)) - x)) - tags ":") - (if have-i "::" ":"))))) - txt) +(defun org-agenda-fix-displayed-tags (txt tags add-inherited hide-re) + "Remove tags string from TXT, and add a modified list of tags. +The modified list may contain inherited tags, and tags matched by +`org-agenda-hide-tags-regexp' will be removed." + (when (or add-inherited hide-re) + (if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$") txt) + (setq txt (substring txt 0 (match-beginning 0)))) + (when tags + (setq tags + (delq nil + (mapcar (lambda (tg) + (if (or (and hide-re (string-match hide-re tg)) + (and (not add-inherited) + (get-text-property 0 'inherited tg))) + nil + tg)) + tags))) + (let ((have-i (get-text-property 0 'inherited (car tags))) + i) + (setq txt (concat txt " :" + (mapconcat + (lambda (x) + (setq i (get-text-property 0 'inherited x)) + (if (and have-i (not i)) + (progn + (setq have-i nil) + (concat ":" x)) + x)) + tags ":") + (if have-i "::" ":")))))) + txt) (defun org-downcase-keep-props (s) (let ((props (text-properties-at 0 s))) @@ -5693,8 +5715,8 @@ When called with a prefix argument, include all archive files as well." (if (and org-agenda-follow-mode m) (org-agenda-show)) (if (and m org-agenda-show-outline-path) - (message (org-with-point-at m - (org-display-outline-path t)))))) + (org-with-point-at m + (org-display-outline-path t))))) (defun org-agenda-show-priority () "Show the priority of the current item. @@ -6662,32 +6684,38 @@ The cursor may be at a date in the calendar, or in the Org agenda." (defun org-agenda-diary-entry-in-org-file () "Make a diary entry in the file `org-agenda-diary-file'." - (let (d1 d2 char (text "")) + (let (d1 d2 char (text "") dp1 dp2) (if (equal (buffer-name) "*Calendar*") (setq d1 (calendar-cursor-to-date t) d2 (car calendar-mark-ring)) - (setq d1 (calendar-gregorian-from-absolute - (get-text-property (point) 'day)) - d2 (and (mark) (get-text-property (mark) 'day) - (calendar-gregorian-from-absolute - (get-text-property (mark) 'day))))) + (setq dp1 (get-text-property (point-at-bol) 'day)) + (unless dp1 (error "No date defined in current line")) + (setq d1 (calendar-gregorian-from-absolute dp1) + d2 (and (ignore-errors (mark)) + (save-excursion + (goto-char (mark)) + (setq dp2 (get-text-property (point-at-bol) 'day))) + (calendar-gregorian-from-absolute dp2)))) (message "Diary entry: [d]ay [a]nniversary [b]lock [j]ump to date tree") (setq char (read-char-exclusive)) (cond ((equal char ?d) (setq text (read-string "Day entry: ")) - (org-agenda-add-entry-to-org-agenda-diary-file 'day text d1)) + (org-agenda-add-entry-to-org-agenda-diary-file 'day text d1) + (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char ?a) (setq d1 (list (car d1) (nth 1 d1) (read-number (format "Reference year [%d]: " (nth 2 d1)) (nth 2 d1)))) (setq text (read-string "Anniversary (use %d to show years): ")) - (org-agenda-add-entry-to-org-agenda-diary-file 'anniversary text d1)) + (org-agenda-add-entry-to-org-agenda-diary-file 'anniversary text d1) + (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char ?b) (setq text (read-string "Block entry: ")) (unless (and d1 d2 (not (equal d1 d2))) (error "No block of days selected")) - (org-agenda-add-entry-to-org-agenda-diary-file 'block text d1 d2)) + (org-agenda-add-entry-to-org-agenda-diary-file 'block text d1 d2) + (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char ?j) (org-switch-to-buffer-other-window (find-file-noselect org-agenda-diary-file)) @@ -6695,6 +6723,17 @@ The cursor may be at a date in the calendar, or in the Org agenda." (org-reveal t)) (t (error "Invalid selection character `%c'" char))))) +(defcustom org-agenda-insert-diary-strategy 'date-tree + "Where in `org-agenda-diary-file' should new entries be added? +Valid values: + +date-tree in the date tree, as child of the date +top-level as top-level entries at the end of the file." + :group 'org-agenda + :type '(choice + (const :tag "in a date tree" date-tree) + (const :tag "as top level at end of file" top-level))) + (defun org-agenda-add-entry-to-org-agenda-diary-file (type text &optional d1 d2) "Add a diary entry with TYPE to `org-agenda-diary-file'. If TEXT is not empty, it will become the headline of the new entry, and @@ -6729,9 +6768,11 @@ the resulting entry will not be shown. When TEXT is empty, switch to (insert (format "%%%%(diary-anniversary %s) %s" (calendar-date-string d1 nil t) text)))) ((eq type 'day) - (require 'org-datetree) - (org-datetree-find-date-create d1) - (org-agenda-insert-diary-make-new-entry text) + (if (eq org-agenda-insert-diary-strategy 'top-level) + (org-agenda-insert-diary-as-top-level text) + (require 'org-datetree) + (org-datetree-find-date-create d1) + (org-agenda-insert-diary-make-new-entry text)) (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-gregorian d1))) (end-of-line 0)) @@ -6739,9 +6780,11 @@ the resulting entry will not be shown. When TEXT is empty, switch to (if (> (calendar-absolute-from-gregorian d1) (calendar-absolute-from-gregorian d2)) (setq d1 (prog1 d2 (setq d2 d1)))) - (require 'org-datetree) - (org-datetree-find-date-create d1) - (org-agenda-insert-diary-make-new-entry text) + (if (eq org-agenda-insert-diary-strategy 'top-level) + (org-agenda-insert-diary-as-top-level text) + (require 'org-datetree) + (org-datetree-find-date-create d1) + (org-agenda-insert-diary-make-new-entry text)) (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-gregorian d1))) (insert "--") @@ -6757,6 +6800,16 @@ the resulting entry will not be shown. When TEXT is empty, switch to (org-reveal t) (message "Please finish entry here")))) +(defun org-agenda-insert-diary-as-top-level (text) + "Make new entry as a top-level entry at the end of the file. +Add TEXT as headline, and position the cursor in the second line so that +a timestamp can be added there." + (widen) + (goto-char (point-max)) + (or (bolp) (insert "\n")) + (insert "* " text "\n") + (if org-adapt-indentation (org-indent-to-column 2))) + (defun org-agenda-insert-diary-make-new-entry (text) "Make new entry as last child of current entry. Add TEXT as headline, and position the cursor in the second line so that diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el index 370554e6353..62ad4f86418 100644 --- a/lisp/org/org-archive.el +++ b/lisp/org/org-archive.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -443,6 +443,7 @@ This command is set with the variable `org-archive-default-command'." (interactive) (call-interactively org-archive-default-command)) +;;;###autoload (defun org-archive-subtree-default-with-confirmation () "Archive the current subtree with the default command. This command is set with the variable `org-archive-default-command'." diff --git a/lisp/org/org-ascii.el b/lisp/org/org-ascii.el index bf8d02ab4ba..dc8136a92f6 100644 --- a/lisp/org/org-ascii.el +++ b/lisp/org/org-ascii.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el index 34226b88a7e..95661b99d8d 100644 --- a/lisp/org/org-attach.el +++ b/lisp/org/org-attach.el @@ -4,7 +4,7 @@ ;; Author: John Wiegley ;; Keywords: org data task -;; Version: 6.33c +;; Version: 6.33x ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el index 851ac42ab99..3e19f749d7c 100644 --- a/lisp/org/org-bbdb.el +++ b/lisp/org/org-bbdb.el @@ -7,7 +7,7 @@ ;; Thomas Baumann ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el index 66442d162e0..38c1a732d79 100644 --- a/lisp/org/org-bibtex.el +++ b/lisp/org/org-bibtex.el @@ -5,7 +5,7 @@ ;; Author: Bastien Guerry ;; Carsten Dominik ;; Keywords: org, wp, remember -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index d25f68debeb..cb9da8ef402 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el index 8f0ea9054aa..868c30d1d6b 100644 --- a/lisp/org/org-colview.el +++ b/lisp/org/org-colview.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index b86b726481c..d8b7328267a 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el index 0e56ef71cf6..953bfea2b11 100644 --- a/lisp/org/org-crypt.el +++ b/lisp/org/org-crypt.el @@ -4,7 +4,7 @@ ;; Emacs Lisp Archive Entry ;; Filename: org-crypt.el -;; Version: 6.33c +;; Version: 6.33x ;; Keywords: org-mode ;; Author: John Wiegley ;; Maintainer: Peter Jones diff --git a/lisp/org/org-datetree.el b/lisp/org/org-datetree.el index 59cbcdfd23b..d76fd515c60 100644 --- a/lisp/org/org-datetree.el +++ b/lisp/org/org-datetree.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -101,7 +101,7 @@ tree can be found." (defun org-datetree-find-day-create (year month day) (org-narrow-to-subtree) - (let ((re (format "^\\*+[ \t]+%d-%02d-\\([01][0-9]\\)[ \t\n]" year month)) + (let ((re (format "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\)[ \t\n]" year month)) match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) diff --git a/lisp/org/org-docbook.el b/lisp/org/org-docbook.el index f1cd894daae..a0a2310143d 100644 --- a/lisp/org/org-docbook.el +++ b/lisp/org/org-docbook.el @@ -4,7 +4,7 @@ ;; ;; Emacs Lisp Archive Entry ;; Filename: org-docbook.el -;; Version: 6.33c +;; Version: 6.33x ;; Author: Baoqiu Cui ;; Maintainer: Baoqiu Cui ;; Keywords: org, wp, docbook diff --git a/lisp/org/org-exp-blocks.el b/lisp/org/org-exp-blocks.el index 71e1608f9bc..72fe6c492ad 100644 --- a/lisp/org/org-exp-blocks.el +++ b/lisp/org/org-exp-blocks.el @@ -217,9 +217,15 @@ Specify the path at which the image should be saved as the first element of headers, any additional elements of headers will be passed to the ditaa utility as command line arguments." (message "ditaa-formatting...") - (let ((out-file (if headers (car headers))) - (args (if (cdr headers) (mapconcat 'identity (cdr headers) " "))) - (data-file (make-temp-file "org-ditaa"))) + (let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers) " "))) + (data-file (make-temp-file "org-ditaa")) + (hash (sha1 (prin1-to-string (list body args)))) + (raw-out-file (if headers (car headers))) + (out-file-parts (if (string-match "\\(.+\\)\\.\\([^\\.]+\\)$" raw-out-file) + (cons (match-string 1 raw-out-file) + (match-string 2 raw-out-file)) + (cons raw-out-file "png"))) + (out-file (concat (car out-file-parts) "_" hash "." (cdr out-file-parts)))) (unless (file-exists-p org-ditaa-jar-path) (error (format "Could not find ditaa.jar at %s" org-ditaa-jar-path))) (setq body (if (string-match "^\\([^:\\|:[^ ]\\)" body) @@ -229,9 +235,21 @@ passed to the ditaa utility as command line arguments." "\n"))) (cond ((or htmlp latexp docbookp) - (with-temp-file data-file (insert body)) - (message (concat "java -jar " org-ditaa-jar-path " " args " " data-file " " out-file)) - (shell-command (concat "java -jar " org-ditaa-jar-path " " args " " data-file " " out-file)) + (unless (file-exists-p out-file) + (mapc ;; remove old hashed versions of this file + (lambda (file) + (when (and (string-match (concat (regexp-quote (car out-file-parts)) + "_\\([[:alnum:]]+\\)\\." + (regexp-quote (cdr out-file-parts))) + file) + (= (length (match-string 1 out-file)) 40)) + (delete-file (expand-file-name file + (file-name-directory out-file))))) + (directory-files (or (file-name-directory out-file) + default-directory))) + (with-temp-file data-file (insert body)) + (message (concat "java -jar " org-ditaa-jar-path " " args " " data-file " " out-file)) + (shell-command (concat "java -jar " org-ditaa-jar-path " " args " " data-file " " out-file))) (format "\n[[file:%s]]\n" out-file)) (t (concat "\n#+BEGIN_EXAMPLE\n" @@ -259,14 +277,32 @@ digraph data_relationships { } #+end_dot" (message "dot-formatting...") - (let ((out-file (if headers (car headers))) - (args (if (cdr headers) (mapconcat 'identity (cdr headers) " "))) - (data-file (make-temp-file "org-ditaa"))) + (let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers) " "))) + (data-file (make-temp-file "org-ditaa")) + (hash (sha1 (prin1-to-string (list body args)))) + (raw-out-file (if headers (car headers))) + (out-file-parts (if (string-match "\\(.+\\)\\.\\([^\\.]+\\)$" raw-out-file) + (cons (match-string 1 raw-out-file) + (match-string 2 raw-out-file)) + (cons raw-out-file "png"))) + (out-file (concat (car out-file-parts) "_" hash "." (cdr out-file-parts)))) (cond ((or htmlp latexp docbookp) - (with-temp-file data-file (insert body)) - (message (concat "dot " data-file " " args " -o " out-file)) - (shell-command (concat "dot " data-file " " args " -o " out-file)) + (unless (file-exists-p out-file) + (mapc ;; remove old hashed versions of this file + (lambda (file) + (when (and (string-match (concat (regexp-quote (car out-file-parts)) + "_\\([[:alnum:]]+\\)\\." + (regexp-quote (cdr out-file-parts))) + file) + (= (length (match-string 1 out-file)) 40)) + (delete-file (expand-file-name file + (file-name-directory out-file))))) + (directory-files (or (file-name-directory out-file) + default-directory))) + (with-temp-file data-file (insert body)) + (message (concat "dot " data-file " " args " -o " out-file)) + (shell-command (concat "dot " data-file " " args " -o " out-file))) (format "\n[[file:%s]]\n" out-file)) (t (concat "\n#+BEGIN_EXAMPLE\n" diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el index ca0f28a06f9..9dcc8bbed78 100644 --- a/lisp/org/org-exp.el +++ b/lisp/org/org-exp.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el index e5e779e11eb..d8524713340 100644 --- a/lisp/org/org-faces.el +++ b/lisp/org/org-faces.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -44,6 +44,7 @@ (copy-face old-face new-face) (if (fboundp 'set-face-doc-string) (set-face-doc-string new-face docstring))))) +(put 'org-copy-face 'lisp-indent-function 2) (defgroup org-faces nil "Faces in Org-mode." @@ -468,6 +469,11 @@ changes." :group 'org-faces :version "22.1") +(org-copy-face 'org-block 'org-quote + "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks.") +(org-copy-face 'org-block 'org-verse + "Face for #+BEGIN_VERSE ... #+END_VERSE blocks.") + (defface org-clock-overlay ;; copied from secondary-selection (org-compatible-face nil '((((class color) (min-colors 88) (background light)) diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el index 0af8f64b3f6..ee2f6746b6b 100644 --- a/lisp/org/org-feed.el +++ b/lisp/org/org-feed.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el index e3c2b1091b6..7d4f23ec99c 100644 --- a/lisp/org/org-footnote.el +++ b/lisp/org/org-footnote.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-freemind.el b/lisp/org/org-freemind.el index 79d6f02f4f7..24dda857c0e 100644 --- a/lisp/org/org-freemind.el +++ b/lisp/org/org-freemind.el @@ -5,7 +5,7 @@ ;; Author: Lennart Borgman (lennart O borgman A gmail O com) ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -240,7 +240,7 @@ The characters \"&<> will be escaped." ;; file is utf-8: ;; ;; (format "&#x%x;" (- cc ;; ?\x800)) - (char-to-string cc) + (format "&#x%x" (encode-char cc 'ucs)) )))) fm-str)) diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el index f41425e8fd6..3d366eb44df 100644 --- a/lisp/org/org-gnus.el +++ b/lisp/org/org-gnus.el @@ -7,7 +7,7 @@ ;; Tassilo Horn ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-habit.el b/lisp/org/org-habit.el index f77ccc09f29..eda2b89462d 100644 --- a/lisp/org/org-habit.el +++ b/lisp/org/org-habit.el @@ -5,7 +5,7 @@ ;; Author: John Wiegley ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -128,6 +128,7 @@ relative to the current effective date." (error "Invalid duration string: %s" ts))) (defun org-is-habit-p (&optional pom) + "Is the task at POM or point a habit?" (string= "habit" (org-entry-get (or pom (point)) "STYLE"))) (defun org-habit-parse-todo (&optional pom) diff --git a/lisp/org/org-html.el b/lisp/org/org-html.el index 2b83a8c1eeb..d59f16a0c7f 100644 --- a/lisp/org/org-html.el +++ b/lisp/org/org-html.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -229,7 +229,7 @@ CSS classes, then this prefic can be very useful." :type 'string) (defcustom org-export-html-home/up-format - "
+ "
UP | HOME @@ -753,7 +753,6 @@ PUB-DIR is set, use this as the publishing directory." -%s %s @@ -765,6 +764,7 @@ lang=\"%s\" xml:lang=\"%s\">
+%s " (format (or (and (stringp org-export-html-xml-declaration) @@ -775,17 +775,17 @@ lang=\"%s\" xml:lang=\"%s\"> "") (or charset "iso-8859-1")) language language + (org-html-expand title) + (or charset "iso-8859-1") + date author description keywords + style (if (or link-up link-home) (concat (format org-export-html-home/up-format (or link-up link-home) (or link-home link-up)) "\n") - "") - (org-html-expand title) - (or charset "iso-8859-1") - date author description keywords - style)) + ""))) (org-export-html-insert-plist-item opt-plist :preamble opt-plist) diff --git a/lisp/org/org-icalendar.el b/lisp/org/org-icalendar.el index e5a6a6b2634..ebfd288c8bb 100644 --- a/lisp/org/org-icalendar.el +++ b/lisp/org/org-icalendar.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el index b27259c7adf..86d40cf241e 100644 --- a/lisp/org/org-id.el +++ b/lisp/org/org-id.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el index 63b168afc96..eb3d388e1d3 100644 --- a/lisp/org/org-indent.el +++ b/lisp/org/org-indent.el @@ -4,7 +4,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -106,8 +106,8 @@ this variable can be set to nil to get rid of the timer." ;; Initialize the indentation and star vectors (setq org-indent-strings (make-vector (1+ org-indent-max) nil)) (setq org-indent-stars (make-vector (1+ org-indent-max) nil)) - (aset org-indent-strings 0 "") - (aset org-indent-stars 0 "") + (aset org-indent-strings 0 nil) + (aset org-indent-stars 0 nil) (loop for i from 1 to org-indent-max do (aset org-indent-strings i (org-add-props diff --git a/lisp/org/org-info.el b/lisp/org/org-info.el index cbe55af6676..b77c23bcf49 100644 --- a/lisp/org/org-info.el +++ b/lisp/org/org-info.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el index 9aa38e193c5..43c68cad0e2 100644 --- a/lisp/org/org-inlinetask.el +++ b/lisp/org/org-inlinetask.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; This file is part of GNU Emacs. diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el index 7c863f7ed39..4697d364ce3 100644 --- a/lisp/org/org-irc.el +++ b/lisp/org/org-irc.el @@ -4,7 +4,7 @@ ;; ;; Author: Philip Jackson ;; Keywords: erc, irc, link, org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-jsinfo.el b/lisp/org/org-jsinfo.el index 2196b737354..b7ab1b7aff7 100644 --- a/lisp/org/org-jsinfo.el +++ b/lisp/org/org-jsinfo.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-latex.el b/lisp/org/org-latex.el index b48fdb35ffa..5d4ac96877f 100644 --- a/lisp/org/org-latex.el +++ b/lisp/org/org-latex.el @@ -4,7 +4,7 @@ ;; ;; Emacs Lisp Archive Entry ;; Filename: org-latex.el -;; Version: 6.33c +;; Version: 6.33x ;; Author: Bastien Guerry ;; Maintainer: Carsten Dominik ;; Keywords: org, wp, tex @@ -256,15 +256,6 @@ When nil, grouping causes only separation lines between groups." :group 'org-export-latex :type 'boolean) -(defcustom org-export-latex-packages-alist nil - "Alist of packages to be inserted in the header. -Each cell is of the format \( \"option\" . \"package\" \)." - :group 'org-export-latex - :type '(repeat - (list - (string :tag "option") - (string :tag "package")))) - (defcustom org-export-latex-low-levels 'itemize "How to convert sections below the current level of sectioning. This is specified by the `org-export-headline-levels' option or the @@ -1465,7 +1456,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." "Convert fontification to LaTeX." (goto-char (point-min)) (while (re-search-forward org-emph-re nil t) - ;; The match goes one char after the *string* + ;; The match goes one char after the *string*, except at the end of a line (let ((emph (assoc (match-string 3) org-export-latex-emphasis-alist)) (beg (match-beginning 0)) @@ -1491,7 +1482,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (if (caddr emph) (setq rpl (org-export-latex-protect-string rpl)) (save-match-data - (if (string-match "\\`.\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).\\'" rpl) + (if (string-match "\\`.\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl) (progn (add-text-properties (match-beginning 1) (match-end 1) '(org-protected t) rpl) @@ -1824,7 +1815,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (save-excursion (if (not (re-search-forward (concat "^" (regexp-quote foot-prefix)) nil t)) - (replace-match "$^{\\1}$") + (replace-match (org-export-latex-protect-string + (concat "$^{" (match-string 1) "}$"))) (replace-match "") (let ((end (save-excursion (if (re-search-forward "^$\\|^#.*$\\|\\[[0-9]+\\]" nil t) diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el index d864ab008f6..2e152a01219 100644 --- a/lisp/org/org-list.el +++ b/lisp/org/org-list.el @@ -7,7 +7,7 @@ ;; Bastien Guerry ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-mac-message.el b/lisp/org/org-mac-message.el index 54978916d36..a9a00294783 100644 --- a/lisp/org/org-mac-message.el +++ b/lisp/org/org-mac-message.el @@ -5,7 +5,7 @@ ;; Author: John Wiegley ;; Christopher Suckling -;; Version: 6.33c +;; Version: 6.33x ;; Keywords: outlines, hypermedia, calendar, wp ;; This file is part of GNU Emacs. diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 1f4ec10bf59..876e0a10c92 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-mew.el b/lisp/org/org-mew.el index bd590e672d8..ef3fd5e1afd 100644 --- a/lisp/org/org-mew.el +++ b/lisp/org/org-mew.el @@ -5,7 +5,7 @@ ;; Author: Tokuya Kameshima ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; This file is part of GNU Emacs. diff --git a/lisp/org/org-mhe.el b/lisp/org/org-mhe.el index a9d66696bbe..933d1c35003 100644 --- a/lisp/org/org-mhe.el +++ b/lisp/org/org-mhe.el @@ -6,7 +6,7 @@ ;; Author: Thomas Baumann ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el index f482f7cd8d2..58e6a3c0cf0 100644 --- a/lisp/org/org-mobile.el +++ b/lisp/org/org-mobile.el @@ -4,7 +4,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el index 6fbd61539e3..61f07b0c420 100644 --- a/lisp/org/org-mouse.el +++ b/lisp/org/org-mouse.el @@ -4,7 +4,7 @@ ;; ;; Author: Piotr Zielinski ;; Maintainer: Carsten Dominik -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el index 55c0877ce21..b69b6d38d2b 100644 --- a/lisp/org/org-plot.el +++ b/lisp/org/org-plot.el @@ -5,7 +5,7 @@ ;; Author: Eric Schulte ;; Keywords: tables, plotting ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el index 0832bd1f59f..bb60d4ffec3 100644 --- a/lisp/org/org-protocol.el +++ b/lisp/org/org-protocol.el @@ -9,7 +9,7 @@ ;; Author: Ross Patterson ;; Maintainer: Sebastian Rose ;; Keywords: org, emacsclient, wp -;; Version: 6.33c +;; Version: 6.33x ;; This file is part of GNU Emacs. ;; @@ -185,6 +185,8 @@ Possible properties are: Last slash required. :working-directory - the local working directory. This is, what base-url will be replaced with. + :redirects - A list of cons cells, each of which maps a regular + expression to match to a path relative to :working-directory. Example: @@ -198,7 +200,12 @@ Example: :online-suffix \".html\" :working-suffix \".org\" :base-url \"http://localhost/org/\" - :working-directory \"/home/user/org/\"))) + :working-directory \"/home/user/org/\" + :rewrites ((\"org/?$\" . \"index.php\"))))) + + The last line tells `org-protocol-open-source' to open + /home/user/org/index.php, if the URL cannot be mapped to an existing + file, and ends with either \"org\" or \"org/\". Consider using the interactive functions `org-protocol-create' and `org-protocol-create-for-org' to help you filling this variable with valid contents." @@ -504,10 +511,35 @@ The location for a browser's bookmark should look like this: (let* ((wdir (plist-get (cdr prolist) :working-directory)) (strip-suffix (plist-get (cdr prolist) :online-suffix)) (add-suffix (plist-get (cdr prolist) :working-suffix)) - (start-pos (+ (string-match wsearch f) (length base-url))) + ;; Strip "[?#].*$" if `f' is a redirect with another + ;; ending than strip-suffix here: + (f1 (substring f 0 (string-match "\\([\\?#].*\\)?$" f))) + (start-pos (+ (string-match wsearch f1) (length base-url))) (end-pos (string-match - (concat (regexp-quote strip-suffix) "\\([?#].*\\)?$") f)) - (the-file (concat wdir (substring f start-pos end-pos) add-suffix))) + (regexp-quote strip-suffix) f1)) + ;; We have to compare redirects without suffix below: + (f2 (concat wdir (substring f1 start-pos end-pos))) + (the-file (concat f2 add-suffix))) + + ;; Note: the-file may still contain `%C3' et al here because browsers + ;; tend to encode `ä' in URLs to `%25C3' - `%25' being `%'. + ;; So the results may vary. + + ;; -- start redirects -- + (unless (file-exists-p the-file) + (message "File %s does not exist.\nTesting for rewritten URLs." the-file) + (let ((rewrites (plist-get (cdr prolist) :rewrites))) + (when rewrites + (message "Rewrites found: %S" rewrites) + (mapc + (lambda (rewrite) + "Try to match a rewritten URL and map it to a real file." + ;; Compare redirects without suffix: + (if (string-match (car rewrite) f2) + (throw 'result (concat wdir (cdr rewrite))))) + rewrites)))) + ;; -- end of redirects -- + (if (file-readable-p the-file) (throw 'result the-file)) (if (file-exists-p the-file) @@ -596,7 +628,7 @@ most of the work." "Create a new org-protocol project interactively. An org-protocol project is an entry in `org-protocol-project-alist' which is used by `org-protocol-open-source'. -Optionally use project-plist to initialize the defaults for this worglet. If +Optionally use project-plist to initialize the defaults for this project. If project-plist is the CDR of an element in `org-publish-project-alist', reuse :base-directory, :html-extension and :base-extension." (interactive) @@ -632,7 +664,7 @@ project-plist is the CDR of an element in `org-publish-project-alist', reuse (concat "Extension of editable files ("working-suffix"): ") working-suffix nil working-suffix t)) - (when (yes-or-no-p "Save the new worglet to your init file? ") + (when (yes-or-no-p "Save the new org-protocol-project to your init file? ") (setq org-protocol-project-alist (cons `(,base-url . (:base-url ,base-url :working-directory ,working-dir diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el index 6abaae9cdd0..913ef6f59d9 100644 --- a/lisp/org/org-publish.el +++ b/lisp/org/org-publish.el @@ -4,7 +4,7 @@ ;; Author: David O'Toole ;; Maintainer: Carsten Dominik ;; Keywords: hypermedia, outlines, wp -;; Version: 6.33c +;; Version: 6.33x ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el index d0ba6131c8f..b258668ebdc 100644 --- a/lisp/org/org-remember.el +++ b/lisp/org/org-remember.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-rmail.el b/lisp/org/org-rmail.el index 0ff5f143844..5b0a38cd1ae 100644 --- a/lisp/org/org-rmail.el +++ b/lisp/org/org-rmail.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el index 19494c10043..e56d77cb68d 100644 --- a/lisp/org/org-src.el +++ b/lisp/org/org-src.el @@ -8,7 +8,7 @@ ;; Dan Davison ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 087b30a5c91..0ebbff900cb 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el index 77c816413cc..00271ec0de9 100644 --- a/lisp/org/org-timer.el +++ b/lisp/org/org-timer.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-vm.el b/lisp/org/org-vm.el index a96cbbcbb51..8e7aca7b72a 100644 --- a/lisp/org/org-vm.el +++ b/lisp/org/org-vm.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-w3m.el b/lisp/org/org-w3m.el index 53a52d415c0..2c0f468c826 100644 --- a/lisp/org/org-w3m.el +++ b/lisp/org/org-w3m.el @@ -5,7 +5,7 @@ ;; Author: Andy Stewart ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org-wl.el b/lisp/org/org-wl.el index 3a284c60e34..689373bfcbc 100644 --- a/lisp/org/org-wl.el +++ b/lisp/org/org-wl.el @@ -6,7 +6,7 @@ ;; Author: Tokuya Kameshima ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -91,7 +91,11 @@ wl-summary-buffer-elmo-folder msgnum) (elmo-msgdb-overview-get-entity msgnum (wl-summary-buffer-msgdb)))) - (from (wl-summary-line-from)) + (from (let ((from-field (elmo-message-entity-field wl-message-entity + 'from))) + (if (listp from-field) + (car from-field) + from-field))) (to (let ((to-field (elmo-message-entity-field wl-message-entity 'to))) (if (listp to-field) diff --git a/lisp/org/org-xoxo.el b/lisp/org/org-xoxo.el index 45c25589ae7..e4e5293e20c 100644 --- a/lisp/org/org-xoxo.el +++ b/lisp/org/org-xoxo.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; diff --git a/lisp/org/org.el b/lisp/org/org.el index d5cb8bacc79..325a5248dc6 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 6.33c +;; Version: 6.33x ;; ;; This file is part of GNU Emacs. ;; @@ -95,7 +95,7 @@ ;;; Version -(defconst org-version "6.33c" +(defconst org-version "6.33x" "The version number of the file org.el.") (defun org-version (&optional here) @@ -2858,6 +2858,17 @@ appears on the page." :group 'org-latex :type 'string) +;; The following variable is defined here because is it also used +;; when formatting latex fragments. Originally it was part of the +;; LaTeX exporter, which is why the name includes "export". +(defcustom org-export-latex-packages-alist nil + "Alist of packages to be inserted in the header. +Each cell is of the format \( \"option\" . \"package\" \)." + :group 'org-export-latex + :type '(repeat + (list + (string :tag "option") + (string :tag "package")))) (defgroup org-font-lock nil "Font-lock settings for highlighting in Org-mode." @@ -3550,7 +3561,9 @@ collapsed state." (eval-and-compile (org-autoload "org-archive" '(org-add-archive-files org-archive-subtree - org-archive-to-archive-sibling org-toggle-archive-tag))) + org-archive-to-archive-sibling org-toggle-archive-tag + org-archive-subtree-default + org-archive-subtree-default-with-confirmation))) ;; Autoload Column View Code @@ -4507,6 +4520,7 @@ will be prompted for." nil (add-text-properties (match-beginning 0) (match-end 0) (list 'mouse-face 'highlight + 'face 'org-link 'keymap org-mouse-map)) (org-rear-nonsticky-at (match-end 0))) t))))) @@ -4529,7 +4543,7 @@ will be prompted for." (beg1 (line-beginning-position 2)) (dc1 (downcase (match-string 2))) (dc3 (downcase (match-string 3))) - end end1 quoting) + end end1 quoting block-type) (cond ((member dc1 '("html:" "ascii:" "latex:" "docbook:")) ;; a single line of backend-specific content @@ -4543,8 +4557,8 @@ will be prompted for." t) ((and (match-end 4) (equal dc3 "begin")) ;; Truely a block - (setq quoting (member (downcase (match-string 5)) - org-protecting-blocks)) + (setq block-type (downcase (match-string 5)) + quoting (member block-type org-protecting-blocks)) (when (re-search-forward (concat "^[ \t]*#\\+end" (match-string 4) "\\>.*") nil t) ;; on purpose, we look further than LIMIT @@ -4557,8 +4571,13 @@ will be prompted for." '(font-lock-fontified t font-lock-multiline t)) (add-text-properties beg beg1 '(face org-meta-line)) (add-text-properties end1 end '(face org-meta-line)) - (when quoting + (cond + (quoting (add-text-properties beg1 end1 '(face org-block))) + ((string= block-type "quote") + (add-text-properties beg1 end1 '(face org-quote))) + ((string= block-type "verse") + (add-text-properties beg1 end1 '(face org-verse)))) t)) ((not (member (char-after beg) '(?\ ?\t))) ;; just any other in-buffer setting, but not indented @@ -4887,7 +4906,7 @@ For plain list items, if they are matched by `outline-regexp', this returns ;; Links (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend))) (if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t))) - (if (memq 'plain lk) '(org-activate-plain-links (0 'org-link t))) + (if (memq 'plain lk) '(org-activate-plain-links)) (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t))) (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t))) (if (memq 'date lk) '(org-activate-dates (0 'org-date t))) @@ -5413,19 +5432,6 @@ This function is the default value of the hook `org-cycle-hook'." ((eq state 'children) (or (org-subtree-end-visible-p) (recenter 1))) ((eq state 'subtree) (or (org-subtree-end-visible-p) (recenter 1)))))) -;; FIXME: no longer in use -(defun org-compact-display-after-subtree-move () - "Show a compacter version of the tree of the entry's parent." - (save-excursion - (if (org-up-heading-safe) - (progn - (hide-subtree) - (show-entry) - (show-children) - (org-cycle-show-empty-lines 'children) - (org-cycle-hide-drawers 'children)) - (org-overview)))) - (defun org-remove-empty-overlays-at (pos) "Remove outline overlays that do not contain non-white stuff." (mapc @@ -6855,7 +6861,9 @@ WITH-CASE, the sorting considers case as well." ((org-at-item-p) ;; we will sort this plain list (org-beginning-of-item-list) (setq start (point)) - (org-end-of-item-list) (setq end (point)) + (org-end-of-item-list) + (or (bolp) (insert "\n")) + (setq end (point)) (goto-char start) (setq plain-list-p t what "plain list")) @@ -6865,6 +6873,7 @@ WITH-CASE, the sorting considers case as well." (org-back-to-heading) (setq start (point) end (progn (org-end-of-subtree t t) + (or (bolp) (insert "\n")) (org-back-over-empty-lines) (point)) what "children") @@ -6875,7 +6884,15 @@ WITH-CASE, the sorting considers case as well." ;; we will sort the top-level entries in this file (goto-char (point-min)) (or (org-on-heading-p) (outline-next-heading)) - (setq start (point) end (point-max) what "top-level") + (setq start (point)) + (goto-char (point-max)) + (beginning-of-line 1) + (when (looking-at ".*?\\S-") + ;; File ends in a non-white line + (end-of-line 1) + (insert "\n")) + (setq end (point-max)) + (setq what "top-level") (goto-char start) (show-all))) @@ -7703,6 +7720,10 @@ according to FMT (default from `org-email-link-description-format')." "Make a link with brackets, consisting of LINK and DESCRIPTION." (unless (string-match "\\S-" link) (error "Empty link")) + (when (and description + (stringp description) + (not (string-match "\\S-" description))) + (setq description nil)) (when (stringp description) ;; Remove brackets from the description, they are fatal. (while (string-match "\\[" description) @@ -9006,10 +9027,12 @@ avoiding backtracing." (aset org-olpa level heading))) (let (rtn) (save-excursion - (while (org-up-heading-safe) - (when (looking-at org-complex-heading-regexp) - (push (org-match-string-no-properties 4) rtn))) - rtn)))) + (save-restriction + (widen) + (while (org-up-heading-safe) + (when (looking-at org-complex-heading-regexp) + (push (org-match-string-no-properties 4) rtn))) + rtn))))) (defun org-format-outline-path (path &optional width prefix) "Format the outlie path PATH for display. @@ -9059,7 +9082,8 @@ such as the file name." (org-back-to-heading t) (if (looking-at org-complex-heading-regexp) (list (match-string 4))))))) - (message (org-format-outline-path + (message "%s" + (org-format-outline-path path (1- (frame-width)) (and file bfn (concat (file-name-nondirectory bfn) "/")))))) @@ -12219,11 +12243,11 @@ allowed value." (if (equal rpl 0) (setq rpl 10)) (if (and (> rpl 0) (<= rpl (length allowed))) (car (nth (1- rpl) allowed)) - (org-completing-read "Value: " allowed nil)))) + (org-completing-read "Effort: " allowed nil)))) (t (let (org-completion-use-ido org-completion-use-iswitchb) (org-completing-read - (concat "Value " (if (and cur (string-match "\\S-" cur)) + (concat "Effort " (if (and cur (string-match "\\S-" cur)) (concat "[" cur "]") "") ": ") existing nil nil "" nil cur)))))) @@ -13122,7 +13146,7 @@ user." deltadef (nth 2 delta))) ;; Check if there is an iso week date in there - ;; If yes, sore the info and postpone interpreting it until the rest + ;; If yes, store the info and postpone interpreting it until the rest ;; of the parsing is done (when (string-match "\\<\\(?:\\([0-9]+\\)-\\)?[wW]\\([0-9]\\{1,2\\}\\)\\(?:-\\([0-6]\\)\\)?\\([ \t]\\|$\\)" ans) (setq iso-year (if (match-end 1) (org-small-year-to-year (string-to-number (match-string 1 ans)))) @@ -14561,15 +14585,9 @@ Some of the options can be changed using the variable (opt org-format-latex-options) (matchers (plist-get opt :matchers)) (re-list org-latex-regexps) - (cnt 0) txt link beg end re e checkdir + (cnt 0) txt hash link beg end re e checkdir executables-checked m n block linkfile movefile ov) - ;; Check if there are old images files with this prefix, and remove them - (when (file-directory-p todir) - (mapc 'delete-file - (directory-files - todir 'full - (concat (regexp-quote prefixnodir) "_[0-9]+\\.png$")))) ;; Check the different regular expressions (while (setq e (pop re-list)) (setq m (car e) re (nth 1 e) n (nth 2 e) @@ -14587,9 +14605,15 @@ Some of the options can be changed using the variable (setq txt (match-string n) beg (match-beginning n) end (match-end n) cnt (1+ cnt) - linkfile (format "%s_%04d.png" prefix cnt) - movefile (format "%s_%04d.png" absprefix cnt) link (concat block "[[file:" linkfile "]]" block)) + (let (print-length print-level) ; make sure full list is printed + (setq hash (sha1 (prin1-to-string + (list org-format-latex-header + org-export-latex-packages-alist + org-format-latex-options + forbuffer txt))) + linkfile (format "%s_%s.png" prefix hash) + movefile (format "%s_%s.png" absprefix hash))) (if msg (message msg cnt)) (goto-char beg) (unless checkdir ; make sure the directory exists @@ -14603,8 +14627,9 @@ Some of the options can be changed using the variable "dvipng" "needed to convert LaTeX fragments to images") (setq executables-checked t)) - (org-create-formula-image - txt movefile opt forbuffer) + (unless (file-exists-p movefile) + (org-create-formula-image + txt movefile opt forbuffer)) (if overlays (progn (mapc (lambda (o) @@ -14628,7 +14653,6 @@ Some of the options can be changed using the variable (delete-region beg end) (insert link)))))))) -(defvar org-export-latex-packages-alist) ;; defined in org-latex.el ;; This function borrows from Ganesh Swami's latex2png.el (defun org-create-formula-image (string tofile options buffer) "This calls dvipng." @@ -14936,7 +14960,6 @@ Some of the options can be changed using the variable ("Agenda Views etc") ("v" . org-agenda) ("/" . org-sparse-tree) - ("/" . org-sparse-tree) ("Misc") ("o" . org-open-at-point) ("?" . org-speed-command-help) @@ -16656,7 +16679,12 @@ really on, so that the block visually is on the match." (add-to-list 'files f 'append) (add-to-list 'tnames (file-truename f) 'append))) (multi-occur - (mapcar (lambda (x) (or (get-file-buffer x) (find-file-noselect x))) files) + (mapcar (lambda (x) + (with-current-buffer + (or (get-file-buffer x) (find-file-noselect x)) + (widen) + (current-buffer))) + files) regexp))) (if (boundp 'occur-mode-find-occurrence-hook)