diff options
31 files changed, 818 insertions, 424 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 81b502df8fc..ec9a85a5974 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2008-11-23 Carsten Dominik <dominik@science.uva.nl> | ||
| 2 | |||
| 3 | * org.texi (Setting up Remember): Document `org-remember-mode'. | ||
| 4 | (External links): Document that bbdb links can use a regular | ||
| 5 | expression. | ||
| 6 | (External links): Document that elisp links can contain interactive | ||
| 7 | commands. | ||
| 8 | |||
| 1 | 2008-11-22 Michael Kifer <kifer@cs.stonybrook.edu> | 9 | 2008-11-22 Michael Kifer <kifer@cs.stonybrook.edu> |
| 2 | 10 | ||
| 3 | * viper.texi (viper-translate-all-ESC-keysequences): | 11 | * viper.texi (viper-translate-all-ESC-keysequences): |
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 4f7b87769b0..0988066eb68 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 6 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 7 | ;; Keywords: outlines, hypermedia, calendar, wp | 7 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 8 | ;; Homepage: http://orgmode.org | 8 | ;; Homepage: http://orgmode.org |
| 9 | ;; Version: 6.12a | 9 | ;; Version: 6.13 |
| 10 | ;; | 10 | ;; |
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | ;; | 12 | ;; |
| @@ -878,6 +878,20 @@ to occupy a fixed space in the agenda display." | |||
| 878 | :group 'org-agenda-line-format | 878 | :group 'org-agenda-line-format |
| 879 | :type 'string) | 879 | :type 'string) |
| 880 | 880 | ||
| 881 | (defcustom org-agenda-timerange-leaders '("" "(%d/%d): ") | ||
| 882 | "Text preceding timerange entries in the agenda view. | ||
| 883 | This is a list with two strings. The first applies when the range | ||
| 884 | is entirely on one day. The second applies if the range spans several days. | ||
| 885 | The strings may have two \"%d\" format specifiers which will be filled | ||
| 886 | with the sequence number of the days, and the total number of days in the | ||
| 887 | range, respectively." | ||
| 888 | :group 'org-agenda-line-format | ||
| 889 | :type '(list | ||
| 890 | (string :tag "Deadline today ") | ||
| 891 | (choice :tag "Deadline relative" | ||
| 892 | (string :tag "Format string") | ||
| 893 | (function)))) | ||
| 894 | |||
| 881 | (defcustom org-agenda-scheduled-leaders '("Scheduled: " "Sched.%2dx: ") | 895 | (defcustom org-agenda-scheduled-leaders '("Scheduled: " "Sched.%2dx: ") |
| 882 | "Text preceeding scheduled items in the agenda view. | 896 | "Text preceeding scheduled items in the agenda view. |
| 883 | This is a list with two strings. The first applies when the item is | 897 | This is a list with two strings. The first applies when the item is |
| @@ -2722,7 +2736,7 @@ for a keyword. A numeric prefix directly selects the Nth keyword in | |||
| 2722 | rtn rtnall files file pos) | 2736 | rtn rtnall files file pos) |
| 2723 | (when (equal arg '(4)) | 2737 | (when (equal arg '(4)) |
| 2724 | (setq org-select-this-todo-keyword | 2738 | (setq org-select-this-todo-keyword |
| 2725 | (completing-read "Keyword (or KWD1|K2D2|...): " | 2739 | (org-ido-completing-read "Keyword (or KWD1|K2D2|...): " |
| 2726 | (mapcar 'list kwds) nil nil))) | 2740 | (mapcar 'list kwds) nil nil))) |
| 2727 | (and (equal 0 arg) (setq org-select-this-todo-keyword nil)) | 2741 | (and (equal 0 arg) (setq org-select-this-todo-keyword nil)) |
| 2728 | (org-set-local 'org-last-arg arg) | 2742 | (org-set-local 'org-last-arg arg) |
| @@ -3384,7 +3398,7 @@ the documentation of `org-diary'." | |||
| 3384 | (push txt ee)))) | 3398 | (push txt ee)))) |
| 3385 | (nreverse ee))) | 3399 | (nreverse ee))) |
| 3386 | 3400 | ||
| 3387 | (defalias 'org-get-closed 'org-agenda-get-progress) | 3401 | (defalias 'org-get-closed 'org-get-progress) |
| 3388 | (defun org-agenda-get-progress () | 3402 | (defun org-agenda-get-progress () |
| 3389 | "Return the logged TODO entries for agenda display." | 3403 | "Return the logged TODO entries for agenda display." |
| 3390 | (let* ((props (list 'mouse-face 'highlight | 3404 | (let* ((props (list 'mouse-face 'highlight |
| @@ -3398,7 +3412,7 @@ the documentation of `org-diary'." | |||
| 3398 | (items (if (consp org-agenda-show-log) | 3412 | (items (if (consp org-agenda-show-log) |
| 3399 | org-agenda-show-log | 3413 | org-agenda-show-log |
| 3400 | org-agenda-log-mode-items)) | 3414 | org-agenda-log-mode-items)) |
| 3401 | (parts | 3415 | (parts |
| 3402 | (delq nil | 3416 | (delq nil |
| 3403 | (list | 3417 | (list |
| 3404 | (if (memq 'closed items) (concat "\\<" org-closed-string)) | 3418 | (if (memq 'closed items) (concat "\\<" org-closed-string)) |
| @@ -3677,8 +3691,10 @@ FRACTION is what fraction of the head-warning time has passed." | |||
| 3677 | (org-entry-is-done-p) | 3691 | (org-entry-is-done-p) |
| 3678 | (throw :skip t)) | 3692 | (throw :skip t)) |
| 3679 | (setq txt (org-format-agenda-item | 3693 | (setq txt (org-format-agenda-item |
| 3680 | (format (if (= d1 d2) "" "(%d/%d): ") | 3694 | (format |
| 3681 | (1+ (- d0 d1)) (1+ (- d2 d1))) | 3695 | (nth (if (= d1 d2) 0 1) |
| 3696 | org-agenda-timerange-leaders) | ||
| 3697 | (1+ (- d0 d1)) (1+ (- d2 d1))) | ||
| 3682 | head category tags | 3698 | head category tags |
| 3683 | (if (= d0 d1) timestr)))) | 3699 | (if (= d0 d1) timestr)))) |
| 3684 | (setq txt org-agenda-no-heading-message)) | 3700 | (setq txt org-agenda-no-heading-message)) |
| @@ -4255,7 +4271,7 @@ to switch to narrowing." | |||
| 4255 | (org-set-local 'org-global-tags-completion-table | 4271 | (org-set-local 'org-global-tags-completion-table |
| 4256 | (org-global-tags-completion-table))) | 4272 | (org-global-tags-completion-table))) |
| 4257 | (let ((completion-ignore-case t)) | 4273 | (let ((completion-ignore-case t)) |
| 4258 | (setq tag (completing-read | 4274 | (setq tag (org-ido-completing-read |
| 4259 | "Tag: " org-global-tags-completion-table)))) | 4275 | "Tag: " org-global-tags-completion-table)))) |
| 4260 | (cond | 4276 | (cond |
| 4261 | ((equal char ?/) (org-agenda-filter-by-tag-show-all)) | 4277 | ((equal char ?/) (org-agenda-filter-by-tag-show-all)) |
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el index d580db989fe..547fee259a9 100644 --- a/lisp/org/org-archive.el +++ b/lisp/org/org-archive.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el index feeb5f66a4d..539de7f5b12 100644 --- a/lisp/org/org-attach.el +++ b/lisp/org/org-attach.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@newartisans.com> | 5 | ;; Author: John Wiegley <johnw@newartisans.com> |
| 6 | ;; Keywords: org data task | 6 | ;; Keywords: org data task |
| 7 | ;; Version: 6.12a | 7 | ;; Version: 6.13 |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
| @@ -153,6 +153,9 @@ D Delete all of a task's attachments. A safer way is | |||
| 153 | "Return the directory associated with the current entry. | 153 | "Return the directory associated with the current entry. |
| 154 | If the directory does not exist and CREATE-IF-NOT-EXISTS-P is non-nil, | 154 | If the directory does not exist and CREATE-IF-NOT-EXISTS-P is non-nil, |
| 155 | the directory and the corresponding ID will be created." | 155 | the directory and the corresponding ID will be created." |
| 156 | (when (and (not (buffer-file-name (buffer-base-buffer))) | ||
| 157 | (not (file-name-absolute-p org-attach-directory))) | ||
| 158 | (error "Need absolute `org-attach-directory' to attach in buffers without filename.")) | ||
| 156 | (let ((uuid (org-id-get (point) create-if-not-exists-p))) | 159 | (let ((uuid (org-id-get (point) create-if-not-exists-p))) |
| 157 | (when (or uuid create-if-not-exists-p) | 160 | (when (or uuid create-if-not-exists-p) |
| 158 | (unless uuid | 161 | (unless uuid |
| @@ -245,7 +248,7 @@ The attachment is created as an Emacs buffer." | |||
| 245 | (let* ((attach-dir (org-attach-dir t)) | 248 | (let* ((attach-dir (org-attach-dir t)) |
| 246 | (files (org-attach-file-list attach-dir)) | 249 | (files (org-attach-file-list attach-dir)) |
| 247 | (file (or file | 250 | (file (or file |
| 248 | (completing-read | 251 | (org-ido-completing-read |
| 249 | "Delete attachment: " | 252 | "Delete attachment: " |
| 250 | (mapcar (lambda (f) | 253 | (mapcar (lambda (f) |
| 251 | (list (file-name-nondirectory f))) | 254 | (list (file-name-nondirectory f))) |
| @@ -320,7 +323,7 @@ If IN-EMACS is non-nil, force opening in Emacs." | |||
| 320 | (files (org-attach-file-list attach-dir)) | 323 | (files (org-attach-file-list attach-dir)) |
| 321 | (file (if (= (length files) 1) | 324 | (file (if (= (length files) 1) |
| 322 | (car files) | 325 | (car files) |
| 323 | (completing-read "Open attachment: " | 326 | (org-ido-completing-read "Open attachment: " |
| 324 | (mapcar 'list files) nil t)))) | 327 | (mapcar 'list files) nil t)))) |
| 325 | (org-open-file (expand-file-name file attach-dir) in-emacs))) | 328 | (org-open-file (expand-file-name file attach-dir) in-emacs))) |
| 326 | 329 | ||
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el index 13b3ff047df..ca2fe139344 100644 --- a/lisp/org/org-bbdb.el +++ b/lisp/org/org-bbdb.el | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | ;; Thomas Baumann <thomas dot baumann at ch dot tum dot de> | 6 | ;; Thomas Baumann <thomas dot baumann at ch dot tum dot de> |
| 7 | ;; Keywords: outlines, hypermedia, calendar, wp | 7 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 8 | ;; Homepage: http://orgmode.org | 8 | ;; Homepage: http://orgmode.org |
| 9 | ;; Version: 6.12a | 9 | ;; Version: 6.13 |
| 10 | ;; | 10 | ;; |
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | ;; | 12 | ;; |
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el index b457121e446..d2e975ed8c0 100644 --- a/lisp/org/org-bibtex.el +++ b/lisp/org/org-bibtex.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Bastien Guerry <bzg at altern dot org> | 5 | ;; Author: Bastien Guerry <bzg at altern dot org> |
| 6 | ;; Carsten Dominik <carsten dot dominik at gmail dot com> | 6 | ;; Carsten Dominik <carsten dot dominik at gmail dot com> |
| 7 | ;; Keywords: org, wp, remember | 7 | ;; Keywords: org, wp, remember |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index d54a4900476..82064e0cdb0 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -104,9 +104,19 @@ has not been closed, resume the clock from that point" | |||
| 104 | 104 | ||
| 105 | (defcustom org-clock-persist nil | 105 | (defcustom org-clock-persist nil |
| 106 | "When non-nil, save the running clock when emacs is closed, and | 106 | "When non-nil, save the running clock when emacs is closed, and |
| 107 | resume it next time emacs is started." | 107 | resume it next time emacs is started. |
| 108 | When this is t, both the running clock, and the entire clock | ||
| 109 | history are saved. When this is the symbol `clock', only the | ||
| 110 | running clock is saved. | ||
| 111 | |||
| 112 | When Emacs restarts with saved clock information, the file containing the | ||
| 113 | running clock as well as all files mentioned in the clock history will | ||
| 114 | be visited." | ||
| 108 | :group 'org-clock | 115 | :group 'org-clock |
| 109 | :type 'boolean) | 116 | :type '(choice |
| 117 | (const :tag "Just the running clock" clock) | ||
| 118 | (const :tag "Clock and history" t) | ||
| 119 | (const :tag "No persistence" nil))) | ||
| 110 | 120 | ||
| 111 | (defcustom org-clock-persist-file "~/.emacs.d/org-clock-save.el" | 121 | (defcustom org-clock-persist-file "~/.emacs.d/org-clock-save.el" |
| 112 | "File to save clock data to" | 122 | "File to save clock data to" |
| @@ -246,7 +256,7 @@ of a different task.") | |||
| 246 | 'help-echo (concat help-text ": " org-clock-heading)) | 256 | 'help-echo (concat help-text ": " org-clock-heading)) |
| 247 | (org-propertize clock-string 'help-echo help-text))) | 257 | (org-propertize clock-string 'help-echo help-text))) |
| 248 | 'local-map org-clock-mode-map | 258 | 'local-map org-clock-mode-map |
| 249 | 'mouse-face '(face mode-line-highlight))) | 259 | 'mouse-face (if (featurep 'xemacs) 'highlight 'mode-line-highlight))) |
| 250 | (force-mode-line-update))) | 260 | (force-mode-line-update))) |
| 251 | 261 | ||
| 252 | (defvar org-clock-mode-line-entry nil | 262 | (defvar org-clock-mode-line-entry nil |
| @@ -260,88 +270,102 @@ clock into. When SELECT is `C-u C-u', clock into the current task and mark | |||
| 260 | is as the default task, a special task that will always be offered in | 270 | is as the default task, a special task that will always be offered in |
| 261 | the clocking selection, associated with the letter `d'." | 271 | the clocking selection, associated with the letter `d'." |
| 262 | (interactive "P") | 272 | (interactive "P") |
| 263 | (let ((interrupting (marker-buffer org-clock-marker)) | 273 | (catch 'abort |
| 264 | ts selected-task target-pos) | 274 | (let ((interrupting (marker-buffer org-clock-marker)) |
| 265 | (when (equal select '(4)) | 275 | ts selected-task target-pos) |
| 266 | (setq selected-task (org-clock-select-task "Clock-in on task: ")) | 276 | (when (equal select '(4)) |
| 267 | (if selected-task | 277 | (setq selected-task (org-clock-select-task "Clock-in on task: ")) |
| 268 | (setq selected-task (copy-marker selected-task)) | 278 | (if selected-task |
| 269 | (error "Abort"))) | 279 | (setq selected-task (copy-marker selected-task)) |
| 270 | (when interrupting | 280 | (error "Abort"))) |
| 271 | ;; We are interrupting the clocking of a differnt task. | 281 | (when interrupting |
| 272 | ;; Save a marker to this task, so that we can go back. | 282 | ;; We are interrupting the clocking of a differnt task. |
| 273 | (move-marker org-clock-interrupted-task | 283 | ;; Save a marker to this task, so that we can go back. |
| 274 | (marker-position org-clock-marker) | 284 | (move-marker org-clock-interrupted-task |
| 275 | (marker-buffer org-clock-marker)) | 285 | (marker-position org-clock-marker) |
| 276 | (org-clock-out t)) | 286 | (marker-buffer org-clock-marker)) |
| 277 | 287 | (org-clock-out t)) | |
| 278 | (when (equal select '(16)) | 288 | |
| 279 | ;; Mark as default clocking task | 289 | (when (equal select '(16)) |
| 280 | (save-excursion | 290 | ;; Mark as default clocking task |
| 281 | (org-back-to-heading t) | 291 | (save-excursion |
| 282 | (move-marker org-clock-default-task (point)))) | ||
| 283 | |||
| 284 | (setq target-pos (point)) ;; we want to clock in at this location | ||
| 285 | (save-excursion | ||
| 286 | (when (and selected-task (marker-buffer selected-task)) | ||
| 287 | ;; There is a selected task, move to the correct buffer | ||
| 288 | ;; and set the new target position. | ||
| 289 | (set-buffer (org-base-buffer (marker-buffer selected-task))) | ||
| 290 | (setq target-pos (marker-position selected-task)) | ||
| 291 | (move-marker selected-task nil)) | ||
| 292 | (save-excursion | ||
| 293 | (save-restriction | ||
| 294 | (widen) | ||
| 295 | (goto-char target-pos) | ||
| 296 | (org-back-to-heading t) | 292 | (org-back-to-heading t) |
| 297 | (or interrupting (move-marker org-clock-interrupted-task nil)) | 293 | (move-marker org-clock-default-task (point)))) |
| 298 | (org-clock-history-push) | 294 | |
| 299 | (cond ((functionp org-clock-in-switch-to-state) | 295 | (setq target-pos (point)) ;; we want to clock in at this location |
| 300 | (looking-at org-complex-heading-regexp) | 296 | (save-excursion |
| 301 | (let ((newstate (funcall org-clock-in-switch-to-state (match-string 2)))) | 297 | (when (and selected-task (marker-buffer selected-task)) |
| 302 | (if newstate (org-todo newstate)))) | 298 | ;; There is a selected task, move to the correct buffer |
| 303 | ((and org-clock-in-switch-to-state | 299 | ;; and set the new target position. |
| 304 | (not (looking-at (concat outline-regexp "[ \t]*" | 300 | (set-buffer (org-base-buffer (marker-buffer selected-task))) |
| 305 | org-clock-in-switch-to-state | 301 | (setq target-pos (marker-position selected-task)) |
| 306 | "\\>")))) | 302 | (move-marker selected-task nil)) |
| 307 | (org-todo org-clock-in-switch-to-state))) | 303 | (save-excursion |
| 308 | (setq org-clock-heading-for-remember | 304 | (save-restriction |
| 309 | (and (looking-at org-complex-heading-regexp) | 305 | (widen) |
| 310 | (match-end 4) | 306 | (goto-char target-pos) |
| 311 | (org-trim (buffer-substring (match-end 1) (match-end 4))))) | 307 | (org-back-to-heading t) |
| 312 | (setq org-clock-heading | 308 | (or interrupting (move-marker org-clock-interrupted-task nil)) |
| 313 | (cond ((and org-clock-heading-function | 309 | (org-clock-history-push) |
| 314 | (functionp org-clock-heading-function)) | 310 | (cond ((functionp org-clock-in-switch-to-state) |
| 315 | (funcall org-clock-heading-function)) | 311 | (looking-at org-complex-heading-regexp) |
| 316 | ((looking-at org-complex-heading-regexp) | 312 | (let ((newstate (funcall org-clock-in-switch-to-state |
| 317 | (match-string 4)) | 313 | (match-string 2)))) |
| 318 | (t "???"))) | 314 | (if newstate (org-todo newstate)))) |
| 319 | (setq org-clock-heading (org-propertize org-clock-heading 'face nil)) | 315 | ((and org-clock-in-switch-to-state |
| 320 | (org-clock-find-position) | 316 | (not (looking-at (concat outline-regexp "[ \t]*" |
| 321 | (if (and org-clock-in-resume | 317 | org-clock-in-switch-to-state |
| 322 | (looking-at (concat "^[ \\t]* " org-clock-string | 318 | "\\>")))) |
| 323 | " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" | 319 | (org-todo org-clock-in-switch-to-state))) |
| 324 | " +\\sw+ +[012][0-9]:[0-5][0-9]\\)\\]$"))) | 320 | (setq org-clock-heading-for-remember |
| 325 | (progn (message "Matched %s" (match-string 1)) | 321 | (and (looking-at org-complex-heading-regexp) |
| 326 | (setq ts (concat "[" (match-string 1) "]")) | 322 | (match-end 4) |
| 327 | (goto-char (match-end 1)) | 323 | (org-trim (buffer-substring (match-end 1) |
| 328 | (setq org-clock-start-time | 324 | (match-end 4))))) |
| 329 | (apply 'encode-time (org-parse-time-string (match-string 1))))) | 325 | (setq org-clock-heading |
| 330 | (progn | 326 | (cond ((and org-clock-heading-function |
| 327 | (functionp org-clock-heading-function)) | ||
| 328 | (funcall org-clock-heading-function)) | ||
| 329 | ((looking-at org-complex-heading-regexp) | ||
| 330 | (match-string 4)) | ||
| 331 | (t "???"))) | ||
| 332 | (setq org-clock-heading (org-propertize org-clock-heading | ||
| 333 | 'face nil)) | ||
| 334 | (org-clock-find-position) | ||
| 335 | (cond | ||
| 336 | ((and org-clock-in-resume | ||
| 337 | (looking-at | ||
| 338 | (concat "^[ \\t]* " org-clock-string | ||
| 339 | " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" | ||
| 340 | " +\\sw+ +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$"))) | ||
| 341 | (message "Matched %s" (match-string 1)) | ||
| 342 | (setq ts (concat "[" (match-string 1) "]")) | ||
| 343 | (goto-char (match-end 1)) | ||
| 344 | (setq org-clock-start-time | ||
| 345 | (apply 'encode-time | ||
| 346 | (org-parse-time-string (match-string 1))))) | ||
| 347 | ((eq org-clock-in-resume 'auto-restart) | ||
| 348 | ;; called from org-clock-load during startup, | ||
| 349 | ;; do not interrupt, but warn! | ||
| 350 | (message "Cannot restart clock because task does not contain unfinished clock") | ||
| 351 | (ding) | ||
| 352 | (sit-for 2) | ||
| 353 | (throw 'abort nil)) | ||
| 354 | (t | ||
| 331 | (insert "\n") (backward-char 1) | 355 | (insert "\n") (backward-char 1) |
| 332 | (org-indent-line-function) | 356 | (org-indent-line-function) |
| 333 | (insert org-clock-string " ") | 357 | (insert org-clock-string " ") |
| 334 | (setq org-clock-start-time (current-time)) | 358 | (setq org-clock-start-time (current-time)) |
| 335 | (setq ts (org-insert-time-stamp org-clock-start-time 'with-hm 'inactive)))) | 359 | (setq ts (org-insert-time-stamp org-clock-start-time 'with-hm 'inactive)))) |
| 336 | (move-marker org-clock-marker (point) (buffer-base-buffer)) | 360 | (move-marker org-clock-marker (point) (buffer-base-buffer)) |
| 337 | (or global-mode-string (setq global-mode-string '(""))) | 361 | (or global-mode-string (setq global-mode-string '(""))) |
| 338 | (or (memq 'org-mode-line-string global-mode-string) | 362 | (or (memq 'org-mode-line-string global-mode-string) |
| 339 | (setq global-mode-string | 363 | (setq global-mode-string |
| 340 | (append global-mode-string '(org-mode-line-string)))) | 364 | (append global-mode-string '(org-mode-line-string)))) |
| 341 | (org-update-mode-line) | 365 | (org-update-mode-line) |
| 342 | (setq org-mode-line-timer | 366 | (setq org-mode-line-timer |
| 343 | (run-with-timer 60 60 'org-update-mode-line)) | 367 | (run-with-timer 60 60 'org-update-mode-line)) |
| 344 | (message "Clock started at %s" ts)))))) | 368 | (message "Clock started at %s" ts))))))) |
| 345 | 369 | ||
| 346 | (defun org-clock-find-position () | 370 | (defun org-clock-find-position () |
| 347 | "Find the location where the next clock line should be inserted." | 371 | "Find the location where the next clock line should be inserted." |
| @@ -820,7 +844,7 @@ the currently selected interval size." | |||
| 820 | (block (plist-get params :block)) | 844 | (block (plist-get params :block)) |
| 821 | (link (plist-get params :link)) | 845 | (link (plist-get params :link)) |
| 822 | ipos time p level hlc hdl content recalc formula pcol | 846 | ipos time p level hlc hdl content recalc formula pcol |
| 823 | cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list) | 847 | cc beg end pos tbl tbl1 range-text rm-file-column scope-is-list st) |
| 824 | (setq org-clock-file-total-minutes nil) | 848 | (setq org-clock-file-total-minutes nil) |
| 825 | (when step | 849 | (when step |
| 826 | (unless (or block (and ts te)) | 850 | (unless (or block (and ts te)) |
| @@ -902,7 +926,11 @@ the currently selected interval size." | |||
| 902 | (unless scope-is-list | 926 | (unless scope-is-list |
| 903 | (org-clock-sum ts te) | 927 | (org-clock-sum ts te) |
| 904 | (goto-char (point-min)) | 928 | (goto-char (point-min)) |
| 905 | (while (setq p (next-single-property-change (point) :org-clock-minutes)) | 929 | (setq st t) |
| 930 | (while (or (and (bobp) (prog1 st (setq st nil)) | ||
| 931 | (get-text-property (point) :org-clock-minutes) | ||
| 932 | (setq p (point-min))) | ||
| 933 | (setq p (next-single-property-change (point) :org-clock-minutes))) | ||
| 906 | (goto-char p) | 934 | (goto-char p) |
| 907 | (when (setq time (get-text-property p :org-clock-minutes)) | 935 | (when (setq time (get-text-property p :org-clock-minutes)) |
| 908 | (save-excursion | 936 | (save-excursion |
| @@ -1062,71 +1090,92 @@ This function is made for clock tables." | |||
| 1062 | 0)))) | 1090 | 0)))) |
| 1063 | 1091 | ||
| 1064 | (defun org-clock-save () | 1092 | (defun org-clock-save () |
| 1065 | "Persist various clock-related data to disk" | 1093 | "Persist various clock-related data to disk. |
| 1066 | (with-current-buffer (find-file (expand-file-name org-clock-persist-file)) | 1094 | The details of what will be saved are regulated by the variable |
| 1067 | (progn (delete-region (point-min) (point-max)) | 1095 | `org-clock-persist'." |
| 1068 | ;;Store clock | 1096 | (when org-clock-persist |
| 1069 | (insert (format ";; org-persist.el - %s at %s\n" | 1097 | (let (b) |
| 1070 | system-name (format-time-string | 1098 | (with-current-buffer (find-file (expand-file-name org-clock-persist-file)) |
| 1071 | (cdr org-time-stamp-formats)))) | 1099 | (progn |
| 1072 | (if (and org-clock-persist (marker-buffer org-clock-marker) | 1100 | (delete-region (point-min) (point-max)) |
| 1073 | (or (not org-clock-persist-query-save) | 1101 | ;;Store clock |
| 1074 | (y-or-n-p (concat "Save current clock (" | 1102 | (insert (format ";; org-persist.el - %s at %s\n" |
| 1075 | (substring-no-properties org-clock-heading) | 1103 | system-name (format-time-string |
| 1076 | ")")))) | 1104 | (cdr org-time-stamp-formats)))) |
| 1077 | (insert "(setq resume-clock '(\"" | 1105 | (if (and (setq b (marker-buffer org-clock-marker)) |
| 1078 | (buffer-file-name (marker-buffer org-clock-marker)) | 1106 | (setq b (or (buffer-base-buffer b) b)) |
| 1079 | "\" . " (int-to-string (marker-position org-clock-marker)) | 1107 | (buffer-live-p b) |
| 1080 | "))\n")) | 1108 | (buffer-file-name b) |
| 1081 | ;;Store clocked task history. Tasks are stored reversed to make | 1109 | (or (not org-clock-persist-query-save) |
| 1082 | ;;reading simpler | 1110 | (y-or-n-p (concat "Save current clock (" |
| 1083 | (if org-clock-history | 1111 | (substring-no-properties org-clock-heading) |
| 1084 | (insert "(setq stored-clock-history '(" | 1112 | ") ")))) |
| 1085 | (mapconcat | 1113 | (insert "(setq resume-clock '(\"" |
| 1086 | (lambda (m) | 1114 | (buffer-file-name (marker-buffer org-clock-marker)) |
| 1087 | (when (marker-buffer m) | 1115 | "\" . " (int-to-string (marker-position org-clock-marker)) |
| 1088 | (concat "(\"" (buffer-file-name (marker-buffer m)) | 1116 | "))\n")) |
| 1089 | "\" . " (int-to-string (marker-position m)) | 1117 | ;; Store clocked task history. Tasks are stored reversed to make |
| 1090 | ")"))) | 1118 | ;; reading simpler |
| 1091 | (reverse org-clock-history) " ") "))\n")) | 1119 | (when (and org-clock-history (eq org-clock-persist t)) |
| 1092 | (save-buffer) | 1120 | (insert |
| 1093 | (kill-buffer (current-buffer))))) | 1121 | "(setq stored-clock-history '(" |
| 1094 | 1122 | (mapconcat | |
| 1095 | (defvar org-clock-loaded nil) | 1123 | (lambda (m) |
| 1124 | (when (and (setq b (marker-buffer m)) | ||
| 1125 | (setq b (or (buffer-base-buffer b) b)) | ||
| 1126 | (buffer-live-p b) | ||
| 1127 | (buffer-file-name b)) | ||
| 1128 | (concat "(\"" (buffer-file-name b) | ||
| 1129 | "\" . " (int-to-string (marker-position m)) | ||
| 1130 | ")"))) | ||
| 1131 | (reverse org-clock-history) " ") "))\n")) | ||
| 1132 | (save-buffer) | ||
| 1133 | (kill-buffer (current-buffer))))))) | ||
| 1134 | |||
| 1135 | (defvar org-clock-loaded nil | ||
| 1136 | "Was the clock file loaded?") | ||
| 1096 | 1137 | ||
| 1097 | (defun org-clock-load () | 1138 | (defun org-clock-load () |
| 1098 | "Load various clock-related data from disk, optionally resuming | 1139 | "Load various clock-related data from disk, optionally resuming |
| 1099 | a stored clock" | 1140 | a stored clock" |
| 1100 | (if (not org-clock-loaded) | 1141 | (when (and org-clock-persist (not org-clock-loaded)) |
| 1101 | (let ((filename (expand-file-name org-clock-persist-file)) | 1142 | (let ((filename (expand-file-name org-clock-persist-file)) |
| 1102 | (org-clock-in-resume t)) | 1143 | (org-clock-in-resume 'auto-restart) |
| 1103 | (if (file-readable-p filename) | 1144 | resume-clock stored-clock-history) |
| 1104 | (progn | 1145 | (if (not (file-readable-p filename)) |
| 1105 | (message "%s" "Restoring clock data") | ||
| 1106 | (setq org-clock-loaded t) | ||
| 1107 | (load-file filename) | ||
| 1108 | ;; load history | ||
| 1109 | (if (boundp 'stored-clock-history) | ||
| 1110 | (save-window-excursion | ||
| 1111 | (mapc (lambda (task) | ||
| 1112 | (org-clock-history-push (cdr task) | ||
| 1113 | (find-file (car task)))) | ||
| 1114 | stored-clock-history))) | ||
| 1115 | ;; resume clock | ||
| 1116 | (if (and (boundp 'resume-clock) org-clock-persist | ||
| 1117 | (or (not org-clock-persist-query-resume) | ||
| 1118 | (y-or-n-p | ||
| 1119 | (concat | ||
| 1120 | "Resume clock (" | ||
| 1121 | (with-current-buffer (find-file (car resume-clock)) | ||
| 1122 | (progn (goto-char (cdr resume-clock)) | ||
| 1123 | (looking-at org-complex-heading-regexp) | ||
| 1124 | (match-string 4))) ")")))) | ||
| 1125 | (with-current-buffer (find-file (car resume-clock)) | ||
| 1126 | (progn (goto-char (cdr resume-clock)) | ||
| 1127 | (org-clock-in))))) | ||
| 1128 | (message "Not restoring clock data; %s not found" | 1146 | (message "Not restoring clock data; %s not found" |
| 1129 | org-clock-persist-file))))) | 1147 | org-clock-persist-file) |
| 1148 | (message "%s" "Restoring clock data") | ||
| 1149 | (setq org-clock-loaded t) | ||
| 1150 | (load-file filename) | ||
| 1151 | ;; load history | ||
| 1152 | (when stored-clock-history | ||
| 1153 | (save-window-excursion | ||
| 1154 | (mapc (lambda (task) | ||
| 1155 | (if (file-exists-p (car task)) | ||
| 1156 | (org-clock-history-push (cdr task) | ||
| 1157 | (find-file (car task))))) | ||
| 1158 | stored-clock-history))) | ||
| 1159 | ;; resume clock | ||
| 1160 | (when (and resume-clock org-clock-persist | ||
| 1161 | (file-exists-p (car resume-clock)) | ||
| 1162 | (or (not org-clock-persist-query-resume) | ||
| 1163 | (y-or-n-p | ||
| 1164 | (concat | ||
| 1165 | "Resume clock (" | ||
| 1166 | (with-current-buffer (find-file (car resume-clock)) | ||
| 1167 | (save-excursion | ||
| 1168 | (goto-char (cdr resume-clock)) | ||
| 1169 | (org-back-to-heading t) | ||
| 1170 | (and (looking-at org-complex-heading-regexp) | ||
| 1171 | (match-string 4)))) | ||
| 1172 | ") ")))) | ||
| 1173 | (when (file-exists-p (car resume-clock)) | ||
| 1174 | (with-current-buffer (find-file (car resume-clock)) | ||
| 1175 | (goto-char (cdr resume-clock)) | ||
| 1176 | (org-clock-in) | ||
| 1177 | (if (org-invisible-p) | ||
| 1178 | (org-show-context))))))))) | ||
| 1130 | 1179 | ||
| 1131 | ;;;###autoload | 1180 | ;;;###autoload |
| 1132 | (defun org-clock-persistence-insinuate () | 1181 | (defun org-clock-persistence-insinuate () |
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el index b3be9f28161..3daef2a0f2f 100644 --- a/lisp/org/org-colview.el +++ b/lisp/org/org-colview.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -130,7 +130,7 @@ This is the compiled version of the format.") | |||
| 130 | (push ov org-columns-overlays) | 130 | (push ov org-columns-overlays) |
| 131 | ov)) | 131 | ov)) |
| 132 | 132 | ||
| 133 | (defun org-columns-display-here (&optional props) | 133 | (defun org-columns-display-here (&optional props dateline) |
| 134 | "Overlay the current line with column display." | 134 | "Overlay the current line with column display." |
| 135 | (interactive) | 135 | (interactive) |
| 136 | (let* ((fmt org-columns-current-fmt-compiled) | 136 | (let* ((fmt org-columns-current-fmt-compiled) |
| @@ -145,6 +145,7 @@ This is the compiled version of the format.") | |||
| 145 | 'default)) | 145 | 'default)) |
| 146 | (color (list :foreground (face-attribute ref-face :foreground))) | 146 | (color (list :foreground (face-attribute ref-face :foreground))) |
| 147 | (face (list color 'org-column ref-face)) | 147 | (face (list color 'org-column ref-face)) |
| 148 | (face1 (list color 'org-agenda-column-dateline ref-face)) | ||
| 148 | (pl (or (get-text-property (point-at-bol) 'prefix-length) 0)) | 149 | (pl (or (get-text-property (point-at-bol) 'prefix-length) 0)) |
| 149 | (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp)) | 150 | (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp)) |
| 150 | pom property ass width f string ov column val modval s1 s2 title) | 151 | pom property ass width f string ov column val modval s1 s2 title) |
| @@ -189,7 +190,7 @@ This is the compiled version of the format.") | |||
| 189 | ;; Create the overlay | 190 | ;; Create the overlay |
| 190 | (org-unmodified | 191 | (org-unmodified |
| 191 | (setq ov (org-columns-new-overlay | 192 | (setq ov (org-columns-new-overlay |
| 192 | beg (setq beg (1+ beg)) string face)) | 193 | beg (setq beg (1+ beg)) string (if dateline face1 face))) |
| 193 | (org-overlay-put ov 'keymap org-columns-map) | 194 | (org-overlay-put ov 'keymap org-columns-map) |
| 194 | (org-overlay-put ov 'org-columns-key property) | 195 | (org-overlay-put ov 'org-columns-key property) |
| 195 | (org-overlay-put ov 'org-columns-value (cdr ass)) | 196 | (org-overlay-put ov 'org-columns-value (cdr ass)) |
| @@ -425,7 +426,7 @@ Where possible, use the standard interface for changing this line." | |||
| 425 | (t | 426 | (t |
| 426 | (setq allowed (org-property-get-allowed-values pom key 'table)) | 427 | (setq allowed (org-property-get-allowed-values pom key 'table)) |
| 427 | (if allowed | 428 | (if allowed |
| 428 | (setq nval (completing-read "Value: " allowed nil t)) | 429 | (setq nval (org-ido-completing-read "Value: " allowed nil t)) |
| 429 | (setq nval (read-string "Edit: " value))) | 430 | (setq nval (read-string "Edit: " value))) |
| 430 | (setq nval (org-trim nval)) | 431 | (setq nval (org-trim nval)) |
| 431 | (when (not (equal nval value)) | 432 | (when (not (equal nval value)) |
| @@ -675,7 +676,7 @@ around it." | |||
| 675 | (interactive) | 676 | (interactive) |
| 676 | (let ((editp (and prop (assoc prop org-columns-current-fmt-compiled))) | 677 | (let ((editp (and prop (assoc prop org-columns-current-fmt-compiled))) |
| 677 | cell) | 678 | cell) |
| 678 | (setq prop (completing-read | 679 | (setq prop (org-ido-completing-read |
| 679 | "Property: " (mapcar 'list (org-buffer-property-keys t nil t)) | 680 | "Property: " (mapcar 'list (org-buffer-property-keys t nil t)) |
| 680 | nil nil prop)) | 681 | nil nil prop)) |
| 681 | (setq title (read-string (concat "Column title [" prop "]: ") (or title prop))) | 682 | (setq title (read-string (concat "Column title [" prop "]: ") (or title prop))) |
| @@ -683,7 +684,7 @@ around it." | |||
| 683 | (if (string-match "\\S-" width) | 684 | (if (string-match "\\S-" width) |
| 684 | (setq width (string-to-number width)) | 685 | (setq width (string-to-number width)) |
| 685 | (setq width nil)) | 686 | (setq width nil)) |
| 686 | (setq fmt (completing-read "Summary [none]: " | 687 | (setq fmt (org-ido-completing-read "Summary [none]: " |
| 687 | '(("none") ("add_numbers") ("currency") ("add_times") ("checkbox") ("checkbox-n-of-m") ("checkbox-percent")) | 688 | '(("none") ("add_numbers") ("currency") ("add_times") ("checkbox") ("checkbox-n-of-m") ("checkbox-percent")) |
| 688 | nil t)) | 689 | nil t)) |
| 689 | (if (string-match "\\S-" fmt) | 690 | (if (string-match "\\S-" fmt) |
| @@ -1151,7 +1152,7 @@ and tailing newline characters." | |||
| 1151 | "Create a dynamic block capturing a column view table." | 1152 | "Create a dynamic block capturing a column view table." |
| 1152 | (interactive) | 1153 | (interactive) |
| 1153 | (let ((defaults '(:name "columnview" :hlines 1)) | 1154 | (let ((defaults '(:name "columnview" :hlines 1)) |
| 1154 | (id (completing-read | 1155 | (id (org-ido-completing-read |
| 1155 | "Capture columns (local, global, entry with :ID: property) [local]: " | 1156 | "Capture columns (local, global, entry with :ID: property) [local]: " |
| 1156 | (append '(("global") ("local")) | 1157 | (append '(("global") ("local")) |
| 1157 | (mapcar 'list (org-property-values "ID")))))) | 1158 | (mapcar 'list (org-property-values "ID")))))) |
| @@ -1282,7 +1283,7 @@ This will add overlays to the date lines, to show the summary for each day." | |||
| 1282 | 0 (length lsum) 'face 'bold lsum) | 1283 | 0 (length lsum) 'face 'bold lsum) |
| 1283 | (cons prop lsum)))) | 1284 | (cons prop lsum)))) |
| 1284 | fmt)) | 1285 | fmt)) |
| 1285 | (org-columns-display-here props) | 1286 | (org-columns-display-here props 'dateline) |
| 1286 | (org-set-local 'org-agenda-columns-active t))) | 1287 | (org-set-local 'org-agenda-columns-active t))) |
| 1287 | (if (bobp) (throw 'exit t)) | 1288 | (if (bobp) (throw 'exit t)) |
| 1288 | (beginning-of-line 0)))))) | 1289 | (beginning-of-line 0)))))) |
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index df0b187f472..f3707cdd4f8 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -277,9 +277,16 @@ that can be added." | |||
| 277 | 277 | ||
| 278 | (defun org-propertize (string &rest properties) | 278 | (defun org-propertize (string &rest properties) |
| 279 | (if (featurep 'xemacs) | 279 | (if (featurep 'xemacs) |
| 280 | (add-text-properties 0 (length string) properties string) | 280 | (progn |
| 281 | (add-text-properties 0 (length string) properties string) | ||
| 282 | string) | ||
| 281 | (apply 'propertize string properties))) | 283 | (apply 'propertize string properties))) |
| 282 | 284 | ||
| 285 | (defun org-substring-no-properties (string &optional from to) | ||
| 286 | (if (featurep 'xemacs) | ||
| 287 | (org-no-properties (substring string from to)) | ||
| 288 | (substring-no-properties string from to))) | ||
| 289 | |||
| 283 | (provide 'org-compat) | 290 | (provide 'org-compat) |
| 284 | 291 | ||
| 285 | ;; arch-tag: a0a0579f-e68c-4bdf-9e55-93768b846bbe | 292 | ;; arch-tag: a0a0579f-e68c-4bdf-9e55-93768b846bbe |
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el index 87023e74c07..dfe9f8a4f7c 100644 --- a/lisp/org/org-exp.el +++ b/lisp/org/org-exp.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -1415,6 +1415,9 @@ translations. There is currently no way for users to extend this.") | |||
| 1415 | 1415 | ||
| 1416 | ;;; General functions for all backends | 1416 | ;;; General functions for all backends |
| 1417 | 1417 | ||
| 1418 | (defvar org-export-target-aliases nil | ||
| 1419 | "Alist of targets with invisible aliases.") | ||
| 1420 | |||
| 1418 | (defun org-export-preprocess-string (string &rest parameters) | 1421 | (defun org-export-preprocess-string (string &rest parameters) |
| 1419 | "Cleanup STRING so that that the true exported has a more consistent source. | 1422 | "Cleanup STRING so that that the true exported has a more consistent source. |
| 1420 | This function takes STRING, which should be a buffer-string of an org-file | 1423 | This function takes STRING, which should be a buffer-string of an org-file |
| @@ -1431,6 +1434,8 @@ on this string to produce the exported version." | |||
| 1431 | (outline-regexp "\\*+ ") | 1434 | (outline-regexp "\\*+ ") |
| 1432 | target-alist rtn) | 1435 | target-alist rtn) |
| 1433 | 1436 | ||
| 1437 | (setq org-export-target-aliases nil) | ||
| 1438 | |||
| 1434 | (with-current-buffer (get-buffer-create " org-mode-tmp") | 1439 | (with-current-buffer (get-buffer-create " org-mode-tmp") |
| 1435 | (erase-buffer) | 1440 | (erase-buffer) |
| 1436 | (insert string) | 1441 | (insert string) |
| @@ -1464,7 +1469,7 @@ on this string to produce the exported version." | |||
| 1464 | ;; Get the correct stuff before the first headline | 1469 | ;; Get the correct stuff before the first headline |
| 1465 | (when (plist-get parameters :skip-before-1st-heading) | 1470 | (when (plist-get parameters :skip-before-1st-heading) |
| 1466 | (goto-char (point-min)) | 1471 | (goto-char (point-min)) |
| 1467 | (when (re-search-forward "^\\*+[ \t]" nil t) | 1472 | (when (re-search-forward "\\(^#.*\n\\)^\\*+[ \t]" nil t) |
| 1468 | (delete-region (point-min) (match-beginning 0)) | 1473 | (delete-region (point-min) (match-beginning 0)) |
| 1469 | (goto-char (point-min)) | 1474 | (goto-char (point-min)) |
| 1470 | (insert "\n"))) | 1475 | (insert "\n"))) |
| @@ -1576,7 +1581,7 @@ The new targets are added to TARGET-ALIST, which is also returned." | |||
| 1576 | (defun org-export-handle-invisible-targets (target-alist) | 1581 | (defun org-export-handle-invisible-targets (target-alist) |
| 1577 | "Find targets in comments and move them out of comments. | 1582 | "Find targets in comments and move them out of comments. |
| 1578 | Mark them as invisible targets." | 1583 | Mark them as invisible targets." |
| 1579 | (let (target tmp) | 1584 | (let (target tmp a) |
| 1580 | (goto-char (point-min)) | 1585 | (goto-char (point-min)) |
| 1581 | (while (re-search-forward "^#.*?\\(<<<?\\([^>\r\n]+\\)>>>?\\).*" nil t) | 1586 | (while (re-search-forward "^#.*?\\(<<<?\\([^>\r\n]+\\)>>>?\\).*" nil t) |
| 1582 | ;; Check if the line before or after is a headline with a target | 1587 | ;; Check if the line before or after is a headline with a target |
| @@ -1587,8 +1592,13 @@ Mark them as invisible targets." | |||
| 1587 | (setq tmp (match-string 2)) | 1592 | (setq tmp (match-string 2)) |
| 1588 | (replace-match "") | 1593 | (replace-match "") |
| 1589 | (and (looking-at "\n") (delete-char 1)) | 1594 | (and (looking-at "\n") (delete-char 1)) |
| 1590 | (push (cons (org-solidify-link-text tmp) target) | 1595 | (push (cons (setq tmp (org-solidify-link-text tmp)) target) |
| 1591 | target-alist)) | 1596 | target-alist) |
| 1597 | (setq a (or (assoc target org-export-target-aliases) | ||
| 1598 | (progn | ||
| 1599 | (push (list target) org-export-target-aliases) | ||
| 1600 | (car org-export-target-aliases)))) | ||
| 1601 | (push tmp (cdr a))) | ||
| 1592 | ;; Make an invisible target | 1602 | ;; Make an invisible target |
| 1593 | (replace-match "\\1(INVISIBLE)")))) | 1603 | (replace-match "\\1(INVISIBLE)")))) |
| 1594 | target-alist) | 1604 | target-alist) |
| @@ -1622,8 +1632,8 @@ let the link point to the corresponding section." | |||
| 1622 | (or (get-text-property (point) 'target) | 1632 | (or (get-text-property (point) 'target) |
| 1623 | (get-text-property | 1633 | (get-text-property |
| 1624 | (max (point-min) | 1634 | (max (point-min) |
| 1625 | (1- (previous-single-property-change | 1635 | (1- (or (previous-single-property-change |
| 1626 | (point) 'target))) | 1636 | (point) 'target) 0))) |
| 1627 | 'target)))))))) | 1637 | 'target)))))))) |
| 1628 | (when target | 1638 | (when target |
| 1629 | (set-match-data md) | 1639 | (set-match-data md) |
| @@ -1885,7 +1895,8 @@ When it is nil, all comments will be removed." | |||
| 1885 | (goto-char (1- (match-end 0))) | 1895 | (goto-char (1- (match-end 0))) |
| 1886 | (org-if-unprotected | 1896 | (org-if-unprotected |
| 1887 | (let* ((xx (save-match-data | 1897 | (let* ((xx (save-match-data |
| 1888 | (org-link-expand-abbrev (match-string 1)))) | 1898 | (org-translate-link |
| 1899 | (org-link-expand-abbrev (match-string 1))))) | ||
| 1889 | (s (concat | 1900 | (s (concat |
| 1890 | "[[" xx "]" | 1901 | "[[" xx "]" |
| 1891 | (if (match-end 3) | 1902 | (if (match-end 3) |
| @@ -2149,7 +2160,7 @@ backends, it converts the segment into an EXAMPLE segment." | |||
| 2149 | (cond | 2160 | (cond |
| 2150 | (htmlp | 2161 | (htmlp |
| 2151 | ;; We are exporting to HTML | 2162 | ;; We are exporting to HTML |
| 2152 | (condition-case nil (require 'htmlize) (nil t)) | 2163 | (require 'htmlize nil t) |
| 2153 | (if (not (fboundp 'htmlize-region-for-paste)) | 2164 | (if (not (fboundp 'htmlize-region-for-paste)) |
| 2154 | (progn | 2165 | (progn |
| 2155 | ;; we do not have htmlize.el, or an old version of it | 2166 | ;; we do not have htmlize.el, or an old version of it |
| @@ -2423,6 +2434,9 @@ underlined headlines. The default is 3." | |||
| 2423 | "\n") "\n"))) | 2434 | "\n") "\n"))) |
| 2424 | (t | 2435 | (t |
| 2425 | (setq line (org-fix-indentation line org-ascii-current-indentation)) | 2436 | (setq line (org-fix-indentation line org-ascii-current-indentation)) |
| 2437 | ;; Remove forced line breaks | ||
| 2438 | (if (string-match "\\\\\\\\[ \t]*$" line) | ||
| 2439 | (setq line (replace-match "" t t line))) | ||
| 2426 | (if (and org-export-with-fixed-width | 2440 | (if (and org-export-with-fixed-width |
| 2427 | (string-match "^\\([ \t]*\\)\\(:\\)" line)) | 2441 | (string-match "^\\([ \t]*\\)\\(:\\)" line)) |
| 2428 | (setq line (replace-match "\\1" nil nil line))) | 2442 | (setq line (replace-match "\\1" nil nil line))) |
| @@ -3183,9 +3197,10 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3183 | (cond | 3197 | (cond |
| 3184 | ((match-end 2) | 3198 | ((match-end 2) |
| 3185 | (setq line (replace-match | 3199 | (setq line (replace-match |
| 3186 | (concat "@<a name=\"" | 3200 | (format |
| 3187 | (org-solidify-link-text (match-string 1 line)) | 3201 | "@<a name=\"%s\" id=\"%s\">@</a>" |
| 3188 | "\">\\nbsp@</a>") | 3202 | (org-solidify-link-text (match-string 1 line)) |
| 3203 | (org-solidify-link-text (match-string 1 line))) | ||
| 3189 | t t line))) | 3204 | t t line))) |
| 3190 | ((and org-export-with-toc (equal (string-to-char line) ?*)) | 3205 | ((and org-export-with-toc (equal (string-to-char line) ?*)) |
| 3191 | ;; FIXME: NOT DEPENDENT on TOC????????????????????? | 3206 | ;; FIXME: NOT DEPENDENT on TOC????????????????????? |
| @@ -3233,7 +3248,9 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3233 | (save-match-data | 3248 | (save-match-data |
| 3234 | (if (string-match "^file:" desc) | 3249 | (if (string-match "^file:" desc) |
| 3235 | (setq desc (substring desc (match-end 0))))) | 3250 | (setq desc (substring desc (match-end 0))))) |
| 3236 | (setq desc (concat "<img src=\"" desc "\"/>"))) | 3251 | (setq desc (org-add-props |
| 3252 | (concat "<img src=\"" desc "\"/>") | ||
| 3253 | '(org-protected t)))) | ||
| 3237 | ;; FIXME: do we need to unescape here somewhere? | 3254 | ;; FIXME: do we need to unescape here somewhere? |
| 3238 | (cond | 3255 | (cond |
| 3239 | ((equal type "internal") | 3256 | ((equal type "internal") |
| @@ -3250,7 +3267,10 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3250 | (if (and (or (eq t org-export-html-inline-images) | 3267 | (if (and (or (eq t org-export-html-inline-images) |
| 3251 | (and org-export-html-inline-images (not descp))) | 3268 | (and org-export-html-inline-images (not descp))) |
| 3252 | (org-file-image-p path)) | 3269 | (org-file-image-p path)) |
| 3253 | (setq rpl (concat "<img src=\"" type ":" path "\"" attr "/>")) | 3270 | (setq rpl (concat "<img src=\"" type ":" path "\"" |
| 3271 | (if (string-match "\\<alt=" attr) | ||
| 3272 | attr (concat attr " alt=\"" path "\"")) | ||
| 3273 | "/>")) | ||
| 3254 | (setq link (concat type ":" path)) | 3274 | (setq link (concat type ":" path)) |
| 3255 | (setq rpl (concat "<a href=\"" | 3275 | (setq rpl (concat "<a href=\"" |
| 3256 | (org-export-html-format-href link) | 3276 | (org-export-html-format-href link) |
| @@ -3308,7 +3328,11 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3308 | (or (eq t org-export-html-inline-images) | 3328 | (or (eq t org-export-html-inline-images) |
| 3309 | (and org-export-html-inline-images | 3329 | (and org-export-html-inline-images |
| 3310 | (not descp)))) | 3330 | (not descp)))) |
| 3311 | (concat "<img src=\"" thefile "\"" attr "/>") | 3331 | (concat "<img src=\"" thefile "\"" |
| 3332 | (if (string-match "alt=" attr) | ||
| 3333 | attr | ||
| 3334 | (concat attr " alt=\"" | ||
| 3335 | thefile "\"")) "/>") | ||
| 3312 | (concat "<a href=\"" thefile "\"" attr ">" | 3336 | (concat "<a href=\"" thefile "\"" attr ">" |
| 3313 | (org-export-html-format-desc desc) | 3337 | (org-export-html-format-desc desc) |
| 3314 | "</a>"))) | 3338 | "</a>"))) |
| @@ -3503,7 +3527,7 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3503 | (and org-export-with-toc (<= level umax)) | 3527 | (and org-export-with-toc (<= level umax)) |
| 3504 | head-count) | 3528 | head-count) |
| 3505 | ;; the </div> to close the last text-... div. | 3529 | ;; the </div> to close the last text-... div. |
| 3506 | (insert "</div>\n") | 3530 | (when (and (> umax 0) first-heading-pos) (insert "</div>\n")) |
| 3507 | 3531 | ||
| 3508 | (save-excursion | 3532 | (save-excursion |
| 3509 | (goto-char (point-min)) | 3533 | (goto-char (point-min)) |
| @@ -3604,7 +3628,7 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3604 | 3628 | ||
| 3605 | (defun org-export-html-format-desc (s) | 3629 | (defun org-export-html-format-desc (s) |
| 3606 | "Make sure the S is valid as a description in a link." | 3630 | "Make sure the S is valid as a description in a link." |
| 3607 | (if s | 3631 | (if (and s (not (get-text-property 1 'org-protected s))) |
| 3608 | (save-match-data | 3632 | (save-match-data |
| 3609 | (org-html-do-expand s)) | 3633 | (org-html-do-expand s)) |
| 3610 | s)) | 3634 | s)) |
| @@ -4143,9 +4167,15 @@ stacked delimiters is N. Escaping delimiters is not possible." | |||
| 4143 | "Insert a new level in HTML export. | 4167 | "Insert a new level in HTML export. |
| 4144 | When TITLE is nil, just close all open levels." | 4168 | When TITLE is nil, just close all open levels." |
| 4145 | (org-close-par-maybe) | 4169 | (org-close-par-maybe) |
| 4146 | (let ((target (and title (org-get-text-property-any 0 'target title))) | 4170 | (let* ((target (and title (org-get-text-property-any 0 'target title))) |
| 4147 | (l org-level-max) | 4171 | (extra-targets |
| 4148 | snumber) | 4172 | (mapconcat (lambda (x) |
| 4173 | (format "<a name=\"%s\" id=\"%s\"></a>" | ||
| 4174 | x x)) | ||
| 4175 | (cdr (assoc target org-export-target-aliases)) | ||
| 4176 | "")) | ||
| 4177 | (l org-level-max) | ||
| 4178 | snumber) | ||
| 4149 | (while (>= l level) | 4179 | (while (>= l level) |
| 4150 | (if (aref org-levels-open (1- l)) | 4180 | (if (aref org-levels-open (1- l)) |
| 4151 | (progn | 4181 | (progn |
| @@ -4173,13 +4203,13 @@ When TITLE is nil, just close all open levels." | |||
| 4173 | (progn | 4203 | (progn |
| 4174 | (org-close-li) | 4204 | (org-close-li) |
| 4175 | (if target | 4205 | (if target |
| 4176 | (insert (format "<li id=\"%s\">" target) title "<br/>\n") | 4206 | (insert (format "<li id=\"%s\">" target) extra-targets title "<br/>\n") |
| 4177 | (insert "<li>" title "<br/>\n"))) | 4207 | (insert "<li>" title "<br/>\n"))) |
| 4178 | (aset org-levels-open (1- level) t) | 4208 | (aset org-levels-open (1- level) t) |
| 4179 | (org-close-par-maybe) | 4209 | (org-close-par-maybe) |
| 4180 | (if target | 4210 | (if target |
| 4181 | (insert (format "<ul>\n<li id=\"%s\">" target) | 4211 | (insert (format "<ul>\n<li id=\"%s\">" target) |
| 4182 | title "<br/>\n") | 4212 | extra-targets title "<br/>\n") |
| 4183 | (insert "<ul>\n<li>" title "<br/>\n")))) | 4213 | (insert "<ul>\n<li>" title "<br/>\n")))) |
| 4184 | (aset org-levels-open (1- level) t) | 4214 | (aset org-levels-open (1- level) t) |
| 4185 | (setq snumber (org-section-number level)) | 4215 | (setq snumber (org-section-number level)) |
| @@ -4187,8 +4217,8 @@ When TITLE is nil, just close all open levels." | |||
| 4187 | (setq title (concat snumber " " title))) | 4217 | (setq title (concat snumber " " title))) |
| 4188 | (setq level (+ level org-export-html-toplevel-hlevel -1)) | 4218 | (setq level (+ level org-export-html-toplevel-hlevel -1)) |
| 4189 | (unless (= head-count 1) (insert "\n</div>\n")) | 4219 | (unless (= head-count 1) (insert "\n</div>\n")) |
| 4190 | (insert (format "\n<div id=\"outline-container-%s\" class=\"outline-%d\">\n<h%d id=\"sec-%s\">%s</h%d>\n<div id=\"text-%s\">\n" | 4220 | (insert (format "\n<div id=\"outline-container-%s\" class=\"outline-%d\">\n<h%d id=\"sec-%s\">%s%s</h%d>\n<div id=\"text-%s\">\n" |
| 4191 | snumber level level snumber title level snumber)) | 4221 | snumber level level snumber extra-targets title level snumber)) |
| 4192 | (org-open-par))))) | 4222 | (org-open-par))))) |
| 4193 | 4223 | ||
| 4194 | (defun org-get-text-property-any (pos prop &optional object) | 4224 | (defun org-get-text-property-any (pos prop &optional object) |
| @@ -4523,10 +4553,10 @@ characters." | |||
| 4523 | (while (string-match "\\([,;]\\)" s start) | 4553 | (while (string-match "\\([,;]\\)" s start) |
| 4524 | (setq start (+ (match-beginning 0) 2) | 4554 | (setq start (+ (match-beginning 0) 2) |
| 4525 | s (replace-match "\\\\\\1" nil nil s)))) | 4555 | s (replace-match "\\\\\\1" nil nil s)))) |
| 4556 | (setq s (org-trim s)) | ||
| 4526 | (when is-body | 4557 | (when is-body |
| 4527 | (while (string-match "[ \t]*\n[ \t]*" s) | 4558 | (while (string-match "[ \t]*\n[ \t]*" s) |
| 4528 | (setq s (replace-match "\\n" t t s)))) | 4559 | (setq s (replace-match "\\n" t t s)))) |
| 4529 | (setq s (org-trim s)) | ||
| 4530 | (if is-body | 4560 | (if is-body |
| 4531 | (if maxlength | 4561 | (if maxlength |
| 4532 | (if (and (numberp maxlength) | 4562 | (if (and (numberp maxlength) |
| @@ -4534,6 +4564,32 @@ characters." | |||
| 4534 | (setq s (substring s 0 maxlength))))) | 4564 | (setq s (substring s 0 maxlength))))) |
| 4535 | s)) | 4565 | s)) |
| 4536 | 4566 | ||
| 4567 | (defun org-icalendar-cleanup-string-rfc2455 (s &optional is-body maxlength) | ||
| 4568 | "Take out stuff and quote what needs to be quoted. | ||
| 4569 | When IS-BODY is non-nil, assume that this is the body of an item, clean up | ||
| 4570 | whitespace, newlines, drawers, and timestamps, and cut it down to MAXLENGTH | ||
| 4571 | characters. | ||
| 4572 | This seems to be more like RFC 2455, but it causes problems, so it is | ||
| 4573 | not used right now." | ||
| 4574 | (if (not s) | ||
| 4575 | nil | ||
| 4576 | (if is-body | ||
| 4577 | (let ((re (concat "\\(" org-drawer-regexp "\\)[^\000]*?:END:.*\n?")) | ||
| 4578 | (re2 (concat "^[ \t]*" org-keyword-time-regexp ".*\n?"))) | ||
| 4579 | (while (string-match re s) (setq s (replace-match "" t t s))) | ||
| 4580 | (while (string-match re2 s) (setq s (replace-match "" t t s))) | ||
| 4581 | (setq s (org-trim s)) | ||
| 4582 | (while (string-match "[ \t]*\n[ \t]*" s) | ||
| 4583 | (setq s (replace-match "\\n" t t s))) | ||
| 4584 | (if maxlength | ||
| 4585 | (if (and (numberp maxlength) | ||
| 4586 | (> (length s) maxlength)) | ||
| 4587 | (setq s (substring s 0 maxlength))))) | ||
| 4588 | (setq s (org-trim s))) | ||
| 4589 | (while (string-match "\"" s) (setq s (replace-match "''" t t s))) | ||
| 4590 | (when (string-match "[;,:]" s) (setq s (concat "\"" s "\""))) | ||
| 4591 | s)) | ||
| 4592 | |||
| 4537 | (defun org-get-entry () | 4593 | (defun org-get-entry () |
| 4538 | "Clean-up description string." | 4594 | "Clean-up description string." |
| 4539 | (save-excursion | 4595 | (save-excursion |
diff --git a/lisp/org/org-export-latex.el b/lisp/org/org-export-latex.el index cf80dffa220..09ada3e451d 100644 --- a/lisp/org/org-export-latex.el +++ b/lisp/org/org-export-latex.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | ;; | 4 | ;; |
| 5 | ;; Emacs Lisp Archive Entry | 5 | ;; Emacs Lisp Archive Entry |
| 6 | ;; Filename: org-export-latex.el | 6 | ;; Filename: org-export-latex.el |
| 7 | ;; Version: 6.12a | 7 | ;; Version: 6.13 |
| 8 | ;; Author: Bastien Guerry <bzg AT altern DOT org> | 8 | ;; Author: Bastien Guerry <bzg AT altern DOT org> |
| 9 | ;; Maintainer: Bastien Guerry <bzg AT altern DOT org> | 9 | ;; Maintainer: Bastien Guerry <bzg AT altern DOT org> |
| 10 | ;; Keywords: org, wp, tex | 10 | ;; Keywords: org, wp, tex |
| @@ -613,7 +613,9 @@ If NUM, export sections as numerical sections." | |||
| 613 | (occur (number-to-string (cdr (assoc 'occur subcontent)))) | 613 | (occur (number-to-string (cdr (assoc 'occur subcontent)))) |
| 614 | (content (cdr (assoc 'content subcontent))) | 614 | (content (cdr (assoc 'content subcontent))) |
| 615 | (subcontent (cadr (assoc 'subcontent subcontent))) | 615 | (subcontent (cadr (assoc 'subcontent subcontent))) |
| 616 | (label (org-get-text-property-any 0 'target heading))) | 616 | (label (org-get-text-property-any 0 'target heading)) |
| 617 | (label-list (cons label (cdr (assoc label | ||
| 618 | org-export-target-aliases))))) | ||
| 617 | (cond | 619 | (cond |
| 618 | ;; Normal conversion | 620 | ;; Normal conversion |
| 619 | ((<= level org-export-latex-sectioning-depth) | 621 | ((<= level org-export-latex-sectioning-depth) |
| @@ -624,7 +626,9 @@ If NUM, export sections as numerical sections." | |||
| 624 | end (nth (if num 1 3) sec)) | 626 | end (nth (if num 1 3) sec)) |
| 625 | (setq start (if num (car sec) (cdr sec)))) | 627 | (setq start (if num (car sec) (cdr sec)))) |
| 626 | (insert (format start heading) "\n") | 628 | (insert (format start heading) "\n") |
| 627 | (when label (insert (format "\\label{%s}\n" label))) | 629 | (when label |
| 630 | (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) | ||
| 631 | label-list "\n") "\n")) | ||
| 628 | (insert (org-export-latex-content content)) | 632 | (insert (org-export-latex-content content)) |
| 629 | (cond ((stringp subcontent) (insert subcontent)) | 633 | (cond ((stringp subcontent) (insert subcontent)) |
| 630 | ((listp subcontent) (org-export-latex-sub subcontent))) | 634 | ((listp subcontent) (org-export-latex-sub subcontent))) |
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el index e24441135fa..6cf4db4df67 100644 --- a/lisp/org/org-faces.el +++ b/lisp/org/org-faces.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -203,6 +203,12 @@ column view defines special faces for each outline level. See the file | |||
| 203 | :height (face-attribute 'default :height) | 203 | :height (face-attribute 'default :height) |
| 204 | :family (face-attribute 'default :family))) | 204 | :family (face-attribute 'default :family))) |
| 205 | 205 | ||
| 206 | (defface org-agenda-column-dateline | ||
| 207 | (org-compatible-face 'org-column | ||
| 208 | '((t nil))) | ||
| 209 | "Face used in agenda column view for datelines with summaries." | ||
| 210 | :group 'org-faces) | ||
| 211 | |||
| 206 | (defface org-warning | 212 | (defface org-warning |
| 207 | (org-compatible-face 'font-lock-warning-face | 213 | (org-compatible-face 'font-lock-warning-face |
| 208 | '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t)) | 214 | '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t)) |
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el index 3f2781bbf36..1d707dc7b1f 100644 --- a/lisp/org/org-gnus.el +++ b/lisp/org/org-gnus.el | |||
| @@ -3,9 +3,10 @@ | |||
| 3 | ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Tassilo Horn <tassilo at member dot fsf dot org> | ||
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 7 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 8 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 9 | ;; Version: 6.13 |
| 9 | ;; | 10 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 12 | ;; |
| @@ -37,7 +38,11 @@ | |||
| 37 | 38 | ||
| 38 | ;; Customization variables | 39 | ;; Customization variables |
| 39 | 40 | ||
| 40 | (defcustom org-usenet-links-prefer-google nil | 41 | (when (fboundp 'defvaralias) |
| 42 | (defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links | ||
| 43 | "Deprecated name for `org-gnus-prefer-web-links'.")) | ||
| 44 | |||
| 45 | (defcustom org-gnus-prefer-web-links nil | ||
| 41 | "Non-nil means, `org-store-link' will create web links to Google groups. | 46 | "Non-nil means, `org-store-link' will create web links to Google groups. |
| 42 | When nil, Gnus will be used for such links. | 47 | When nil, Gnus will be used for such links. |
| 43 | Using a prefix arg to the command \\[org-store-link] (`org-store-link') | 48 | Using a prefix arg to the command \\[org-store-link] (`org-store-link') |
| @@ -57,50 +62,83 @@ negates this setting for the duration of the command." | |||
| 57 | (add-hook 'org-store-link-functions 'org-gnus-store-link) | 62 | (add-hook 'org-store-link-functions 'org-gnus-store-link) |
| 58 | 63 | ||
| 59 | ;; Implementation | 64 | ;; Implementation |
| 65 | |||
| 66 | (defun org-gnus-group-link (group) | ||
| 67 | "Create a link to the Gnus group GROUP. | ||
| 68 | If GROUP is a newsgroup and `org-gnus-prefer-web-links' is | ||
| 69 | non-nil, create a link to groups.google.com or gmane.org. | ||
| 70 | Otherwise create a link to the group inside Gnus. | ||
| 71 | |||
| 72 | If `org-store-link' was called with a prefix arg the meaning of | ||
| 73 | `org-gnus-prefer-web-links' is reversed." | ||
| 74 | (let ((unprefixed-group (replace-regexp-in-string "^[^:]+:" "" group))) | ||
| 75 | (if (and (string-match "^nntp" group) ;; Only for nntp groups | ||
| 76 | (org-xor current-prefix-arg | ||
| 77 | org-gnus-prefer-web-links)) | ||
| 78 | (concat (if (string-match "gmane" unprefixed-group) | ||
| 79 | "http://news.gmane.org/" | ||
| 80 | "http://groups.google.com/group/") | ||
| 81 | unprefixed-group) | ||
| 82 | (concat "gnus:" group)))) | ||
| 83 | |||
| 84 | (defun org-gnus-article-link (group newsgroups message-id x-no-archive) | ||
| 85 | "Create a link to a Gnus article. | ||
| 86 | The article is specified by its MESSAGE-ID. Additional | ||
| 87 | parameters are the Gnus GROUP, the NEWSGROUPS the article was | ||
| 88 | posted to and the X-NO-ARCHIVE header value of that article. | ||
| 89 | |||
| 90 | If GROUP is a newsgroup and `org-gnus-prefer-web-links' is | ||
| 91 | non-nil, create a link to groups.google.com or gmane.org. | ||
| 92 | Otherwise create a link to the article inside Gnus. | ||
| 93 | |||
| 94 | If `org-store-link' was called with a prefix arg the meaning of | ||
| 95 | `org-gnus-prefer-web-links' is reversed." | ||
| 96 | (if (and (org-xor current-prefix-arg org-gnus-prefer-web-links) | ||
| 97 | newsgroups ;; Make web links only for nntp groups | ||
| 98 | (not x-no-archive)) ;; and if X-No-Archive isn't set. | ||
| 99 | (format (if (string-match "gmane\\." newsgroups) | ||
| 100 | "http://mid.gmane.org/%s" | ||
| 101 | "http://groups.google.com/groups/search?as_umsgid=%s") | ||
| 102 | (org-fixup-message-id-for-http | ||
| 103 | (replace-regexp-in-string "[<>]" "" message-id))) | ||
| 104 | (org-make-link "gnus:" group "#" message-id))) | ||
| 105 | |||
| 60 | (defun org-gnus-store-link () | 106 | (defun org-gnus-store-link () |
| 61 | "Store a link to a Gnus folder or message." | 107 | "Store a link to a Gnus folder or message." |
| 62 | (cond | 108 | (cond |
| 63 | ((eq major-mode 'gnus-group-mode) | 109 | ((eq major-mode 'gnus-group-mode) |
| 64 | (let ((group (cond ((fboundp 'gnus-group-group-name) ; depending on Gnus | 110 | (let* ((group (cond ((fboundp 'gnus-group-group-name) ; depending on Gnus |
| 65 | (gnus-group-group-name)) ; version | 111 | (gnus-group-group-name)) ; version |
| 66 | ((fboundp 'gnus-group-name) | 112 | ((fboundp 'gnus-group-name) |
| 67 | (gnus-group-name)) | 113 | (gnus-group-name)) |
| 68 | (t "???"))) | 114 | (t "???"))) |
| 69 | desc link) | 115 | desc link) |
| 70 | (unless group (error "Not on a group")) | 116 | (unless group (error "Not on a group")) |
| 71 | (org-store-link-props :type "gnus" :group group) | 117 | (org-store-link-props :type "gnus" :group group) |
| 72 | (setq desc (concat | 118 | (setq desc (org-gnus-group-link group) |
| 73 | (if (org-xor current-prefix-arg | ||
| 74 | org-usenet-links-prefer-google) | ||
| 75 | "http://groups.google.com/groups?group=" | ||
| 76 | "gnus:") | ||
| 77 | group) | ||
| 78 | link (org-make-link desc)) | 119 | link (org-make-link desc)) |
| 79 | (org-add-link-props :link link :description desc) | 120 | (org-add-link-props :link link :description desc) |
| 80 | link)) | 121 | link)) |
| 81 | 122 | ||
| 82 | ((memq major-mode '(gnus-summary-mode gnus-article-mode)) | 123 | ((memq major-mode '(gnus-summary-mode gnus-article-mode)) |
| 83 | (and (eq major-mode 'gnus-article-mode) (gnus-article-show-summary)) | 124 | (and (eq major-mode 'gnus-summary-mode) (gnus-summary-show-article)) |
| 84 | (let* ((group gnus-newsgroup-name) | 125 | (let* ((group gnus-newsgroup-name) |
| 85 | (article (gnus-summary-article-number)) | 126 | (header (with-current-buffer gnus-article-buffer |
| 86 | (header (gnus-summary-article-header article)) | 127 | (gnus-summary-toggle-header 1) |
| 87 | (from (mail-header-from header)) | 128 | (goto-char (point-min)) |
| 88 | (message-id (mail-header-id header)) | 129 | (mail-header-extract-no-properties))) |
| 89 | (date (mail-header-date header)) | 130 | (from (mail-header 'from header)) |
| 90 | (extra (mail-header-extra header)) | 131 | (message-id (mail-header 'message-id header)) |
| 91 | (to (cdr (assoc 'To extra))) | 132 | (date (mail-header 'date header)) |
| 133 | (to (mail-header 'to header)) | ||
| 134 | (newsgroups (mail-header 'newsgroups header)) | ||
| 135 | (x-no-archive (mail-header 'x-no-archive header)) | ||
| 92 | (subject (gnus-summary-subject-string)) | 136 | (subject (gnus-summary-subject-string)) |
| 93 | desc link) | 137 | desc link) |
| 94 | (org-store-link-props :type "gnus" :from from :subject subject | 138 | (org-store-link-props :type "gnus" :from from :subject subject |
| 95 | :message-id message-id :group group :to to) | 139 | :message-id message-id :group group :to to) |
| 96 | (setq desc (org-email-link-description)) | 140 | (setq desc (org-email-link-description) |
| 97 | (if (org-xor current-prefix-arg org-usenet-links-prefer-google) | 141 | link (org-gnus-article-link group newsgroups message-id x-no-archive)) |
| 98 | (setq link | ||
| 99 | (format "http://groups.google.com/groups?as_umsgid=%s" | ||
| 100 | (org-fixup-message-id-for-http message-id))) | ||
| 101 | (setq link (org-make-link "gnus:" group "#" | ||
| 102 | (or message-id | ||
| 103 | (number-to-string article))))) | ||
| 104 | (org-add-link-props :link link :description desc) | 142 | (org-add-link-props :link link :description desc) |
| 105 | link)))) | 143 | link)))) |
| 106 | 144 | ||
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el index 764c0254e75..64f139c5f19 100644 --- a/lisp/org/org-id.el +++ b/lisp/org/org-id.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 4 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 5 | ;; Keywords: outlines, hypermedia, calendar, wp | 5 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 6 | ;; Homepage: http://orgmode.org | 6 | ;; Homepage: http://orgmode.org |
| 7 | ;; Version: 6.12a | 7 | ;; Version: 6.13 |
| 8 | ;; | 8 | ;; |
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
| @@ -376,15 +376,16 @@ Store the relation between files and corresponding ID's." | |||
| 376 | 376 | ||
| 377 | (defun org-id-add-location (id file) | 377 | (defun org-id-add-location (id file) |
| 378 | "Add the ID with location FILE to the database of ID loations." | 378 | "Add the ID with location FILE to the database of ID loations." |
| 379 | (unless org-id-locations (org-id-locations-load)) | 379 | (when (and id file) ; don't error when called from a buffer with no file |
| 380 | (catch 'exit | 380 | (unless org-id-locations (org-id-locations-load)) |
| 381 | (let ((locs org-id-locations) list) | 381 | (catch 'exit |
| 382 | (while (setq list (pop locs)) | 382 | (let ((locs org-id-locations) list) |
| 383 | (when (equal (file-truename file) (file-truename (car list))) | 383 | (while (setq list (pop locs)) |
| 384 | (setcdr list (cons id (cdr list))) | 384 | (when (equal (file-truename file) (file-truename (car list))) |
| 385 | (throw 'exit t)))) | 385 | (setcdr list (cons id (cdr list))) |
| 386 | (push (list file id) org-id-locations)) | 386 | (throw 'exit t)))) |
| 387 | (org-id-locations-save)) | 387 | (push (list file id) org-id-locations)) |
| 388 | (org-id-locations-save))) | ||
| 388 | 389 | ||
| 389 | ;; Finding entries with specified id | 390 | ;; Finding entries with specified id |
| 390 | 391 | ||
diff --git a/lisp/org/org-info.el b/lisp/org/org-info.el index 20127e4aca7..c040ba6f87f 100644 --- a/lisp/org/org-info.el +++ b/lisp/org/org-info.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el index acc99185822..4d35ef3dd98 100644 --- a/lisp/org/org-irc.el +++ b/lisp/org/org-irc.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | ;; | 4 | ;; |
| 5 | ;; Author: Philip Jackson <emacs@shellarchive.co.uk> | 5 | ;; Author: Philip Jackson <emacs@shellarchive.co.uk> |
| 6 | ;; Keywords: erc, irc, link, org | 6 | ;; Keywords: erc, irc, link, org |
| 7 | ;; Version: 6.12a | 7 | ;; Version: 6.13 |
| 8 | ;; | 8 | ;; |
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
| @@ -27,7 +27,7 @@ | |||
| 27 | ;; Org-mode loads this module by default - if this is not what you want, | 27 | ;; Org-mode loads this module by default - if this is not what you want, |
| 28 | ;; configure the variable `org-modules'. | 28 | ;; configure the variable `org-modules'. |
| 29 | ;; | 29 | ;; |
| 30 | ;; Please customize the variable `org-default-extensions' to select | 30 | ;; Please customize the variable `org-modules' to select |
| 31 | ;; extensions you would like to use, and to deselect those which you don't | 31 | ;; extensions you would like to use, and to deselect those which you don't |
| 32 | ;; want. | 32 | ;; want. |
| 33 | ;; | 33 | ;; |
diff --git a/lisp/org/org-jsinfo.el b/lisp/org/org-jsinfo.el index 93a57de6185..f1bb3ef7ed1 100644 --- a/lisp/org/org-jsinfo.el +++ b/lisp/org/org-jsinfo.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el index 0b3dd3d3601..a2990743a57 100644 --- a/lisp/org/org-list.el +++ b/lisp/org/org-list.el | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | ;; Bastien Guerry <bzg AT altern DOT org> | 6 | ;; Bastien Guerry <bzg AT altern DOT org> |
| 7 | ;; Keywords: outlines, hypermedia, calendar, wp | 7 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 8 | ;; Homepage: http://orgmode.org | 8 | ;; Homepage: http://orgmode.org |
| 9 | ;; Version: 6.12a | 9 | ;; Version: 6.13 |
| 10 | ;; | 10 | ;; |
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | ;; | 12 | ;; |
| @@ -72,6 +72,18 @@ the safe choice." | |||
| 72 | (const :tag "paren like in \"2)\"" ?\)) | 72 | (const :tag "paren like in \"2)\"" ?\)) |
| 73 | (const :tab "both" t))) | 73 | (const :tab "both" t))) |
| 74 | 74 | ||
| 75 | (defcustom org-list-two-spaces-after-bullet-regexp nil | ||
| 76 | "A regular expression matching bullets that should have 2 spaces after them. | ||
| 77 | When nil, no bullet will have two spaces after them. | ||
| 78 | When a string, it will be used as a regular expression. When the bullet | ||
| 79 | type of a list is changed, the new bullet type will be matched against this | ||
| 80 | regexp. If it matches, there will be two spaces instead of one after | ||
| 81 | the bullet in each item of he list." | ||
| 82 | :group 'org-plain-list | ||
| 83 | :type '(choice | ||
| 84 | (const :tag "never" nil) | ||
| 85 | (regexp))) | ||
| 86 | |||
| 75 | (defcustom org-empty-line-terminates-plain-lists nil | 87 | (defcustom org-empty-line-terminates-plain-lists nil |
| 76 | "Non-nil means, an empty line ends all plain list levels. | 88 | "Non-nil means, an empty line ends all plain list levels. |
| 77 | When nil, empty lines are part of the preceeding item." | 89 | When nil, empty lines are part of the preceeding item." |
| @@ -259,7 +271,7 @@ the whole buffer." | |||
| 259 | (save-excursion | 271 | (save-excursion |
| 260 | (let* ((buffer-invisibility-spec (org-inhibit-invisibility)) ; Emacs 21 | 272 | (let* ((buffer-invisibility-spec (org-inhibit-invisibility)) ; Emacs 21 |
| 261 | (beg (condition-case nil | 273 | (beg (condition-case nil |
| 262 | (progn (outline-back-to-heading) (point)) | 274 | (progn (org-back-to-heading) (point)) |
| 263 | (error (point-min)))) | 275 | (error (point-min)))) |
| 264 | (end (move-marker (make-marker) | 276 | (end (move-marker (make-marker) |
| 265 | (progn (outline-next-heading) (point)))) | 277 | (progn (outline-next-heading) (point)))) |
| @@ -589,7 +601,7 @@ If WHICH is a string, use that as the new bullet. If WHICH is an integer, | |||
| 589 | (beginning-of-line 1) | 601 | (beginning-of-line 1) |
| 590 | (let ((current (match-string 0)) | 602 | (let ((current (match-string 0)) |
| 591 | (prevp (eq which 'previous)) | 603 | (prevp (eq which 'previous)) |
| 592 | new) | 604 | new old) |
| 593 | (setq new (cond | 605 | (setq new (cond |
| 594 | ((and (numberp which) | 606 | ((and (numberp which) |
| 595 | (nth (1- which) '("-" "+" "*" "1." "1)")))) | 607 | (nth (1- which) '("-" "+" "*" "1." "1)")))) |
| @@ -597,10 +609,14 @@ If WHICH is a string, use that as the new bullet. If WHICH is an integer, | |||
| 597 | ((string-match "\\+" current) | 609 | ((string-match "\\+" current) |
| 598 | (if prevp "-" (if (looking-at "\\S-") "1." "*"))) | 610 | (if prevp "-" (if (looking-at "\\S-") "1." "*"))) |
| 599 | ((string-match "\\*" current) (if prevp "+" "1.")) | 611 | ((string-match "\\*" current) (if prevp "+" "1.")) |
| 600 | ((string-match "\\." current) (if prevp "*" "1)")) | 612 | ((string-match "\\." current) |
| 613 | (if prevp (if (looking-at "\\S-") "+" "*") "1)")) | ||
| 601 | ((string-match ")" current) (if prevp "1." "-")) | 614 | ((string-match ")" current) (if prevp "1." "-")) |
| 602 | (t (error "This should not happen")))) | 615 | (t (error "This should not happen")))) |
| 603 | (and (looking-at "\\([ \t]*\\)\\S-+") (replace-match (concat "\\1" new))) | 616 | (and (looking-at "\\([ \t]*\\)\\(\\S-+\\)") |
| 617 | (setq old (match-string 2)) | ||
| 618 | (replace-match (concat "\\1" new))) | ||
| 619 | (org-shift-item-indentation (- (length new) (length old))) | ||
| 604 | (org-fix-bullet-type) | 620 | (org-fix-bullet-type) |
| 605 | (org-maybe-renumber-ordered-list)))) | 621 | (org-maybe-renumber-ordered-list)))) |
| 606 | 622 | ||
| @@ -629,7 +645,7 @@ with something like \"1.\" or \"2)\"." | |||
| 629 | (buffer-substring (point-at-bol) (match-beginning 3)))) | 645 | (buffer-substring (point-at-bol) (match-beginning 3)))) |
| 630 | ;; (term (substring (match-string 3) -1)) | 646 | ;; (term (substring (match-string 3) -1)) |
| 631 | ind1 (n (1- arg)) | 647 | ind1 (n (1- arg)) |
| 632 | fmt bobp) | 648 | fmt bobp old new) |
| 633 | ;; find where this list begins | 649 | ;; find where this list begins |
| 634 | (org-beginning-of-item-list) | 650 | (org-beginning-of-item-list) |
| 635 | (setq bobp (bobp)) | 651 | (setq bobp (bobp)) |
| @@ -647,26 +663,32 @@ with something like \"1.\" or \"2)\"." | |||
| 647 | (if (> ind1 ind) (throw 'next t)) | 663 | (if (> ind1 ind) (throw 'next t)) |
| 648 | (if (< ind1 ind) (throw 'exit t)) | 664 | (if (< ind1 ind) (throw 'exit t)) |
| 649 | (if (not (org-at-item-p)) (throw 'exit nil)) | 665 | (if (not (org-at-item-p)) (throw 'exit nil)) |
| 666 | (setq old (match-string 2)) | ||
| 650 | (delete-region (match-beginning 2) (match-end 2)) | 667 | (delete-region (match-beginning 2) (match-end 2)) |
| 651 | (goto-char (match-beginning 2)) | 668 | (goto-char (match-beginning 2)) |
| 652 | (insert (format fmt (setq n (1+ n))))))) | 669 | (insert (setq new (format fmt (setq n (1+ n))))) |
| 670 | (org-shift-item-indentation (- (length new) (length old)))))) | ||
| 653 | (goto-line line) | 671 | (goto-line line) |
| 654 | (org-move-to-column col))) | 672 | (org-move-to-column col))) |
| 655 | 673 | ||
| 656 | (defun org-fix-bullet-type () | 674 | (defun org-fix-bullet-type () |
| 657 | "Make sure all items in this list have the same bullet as the firsst item." | 675 | "Make sure all items in this list have the same bullet as the first item. |
| 676 | Also, fix the indentation." | ||
| 658 | (interactive) | 677 | (interactive) |
| 659 | (unless (org-at-item-p) (error "This is not a list")) | 678 | (unless (org-at-item-p) (error "This is not a list")) |
| 660 | (let ((line (org-current-line)) | 679 | (let ((line (org-current-line)) |
| 661 | (col (current-column)) | 680 | (col (current-column)) |
| 662 | (ind (current-indentation)) | 681 | (ind (current-indentation)) |
| 663 | ind1 bullet) | 682 | ind1 bullet oldbullet) |
| 664 | ;; find where this list begins | 683 | ;; find where this list begins |
| 665 | (org-beginning-of-item-list) | 684 | (org-beginning-of-item-list) |
| 666 | (beginning-of-line 1) | 685 | (beginning-of-line 1) |
| 667 | ;; find out what the bullet type is | 686 | ;; find out what the bullet type is |
| 668 | (looking-at "[ \t]*\\(\\S-+\\)") | 687 | (looking-at "[ \t]*\\(\\S-+\\)") |
| 669 | (setq bullet (match-string 1)) | 688 | (setq bullet (concat (match-string 1) " ")) |
| 689 | (if (and org-list-two-spaces-after-bullet-regexp | ||
| 690 | (string-match org-list-two-spaces-after-bullet-regexp bullet)) | ||
| 691 | (setq bullet (concat bullet " "))) | ||
| 670 | ;; walk forward and replace these numbers | 692 | ;; walk forward and replace these numbers |
| 671 | (beginning-of-line 0) | 693 | (beginning-of-line 0) |
| 672 | (catch 'exit | 694 | (catch 'exit |
| @@ -680,13 +702,31 @@ with something like \"1.\" or \"2)\"." | |||
| 680 | (if (< ind1 ind) (throw 'exit t)) | 702 | (if (< ind1 ind) (throw 'exit t)) |
| 681 | (if (not (org-at-item-p)) (throw 'exit nil)) | 703 | (if (not (org-at-item-p)) (throw 'exit nil)) |
| 682 | (skip-chars-forward " \t") | 704 | (skip-chars-forward " \t") |
| 683 | (looking-at "\\S-+") | 705 | (looking-at "\\S-+ *") |
| 684 | (replace-match bullet)))) | 706 | (setq oldbullet (match-string 0)) |
| 707 | (replace-match bullet) | ||
| 708 | (org-shift-item-indentation (- (length bullet) (length oldbullet)))))) | ||
| 685 | (goto-line line) | 709 | (goto-line line) |
| 686 | (org-move-to-column col) | 710 | (org-move-to-column col) |
| 687 | (if (string-match "[0-9]" bullet) | 711 | (if (string-match "[0-9]" bullet) |
| 688 | (org-renumber-ordered-list 1)))) | 712 | (org-renumber-ordered-list 1)))) |
| 689 | 713 | ||
| 714 | (defun org-shift-item-indentation (delta) | ||
| 715 | "Shift the indentation in current item by DELTA." | ||
| 716 | (save-excursion | ||
| 717 | (let ((beg (point-at-bol)) | ||
| 718 | (end (progn (org-end-of-item) (point))) | ||
| 719 | i) | ||
| 720 | (goto-char end) | ||
| 721 | (beginning-of-line 0) | ||
| 722 | (while (> (point) beg) | ||
| 723 | (when (looking-at "[ \t]*\\S-") | ||
| 724 | ;; this is not an empty line | ||
| 725 | (setq i (org-get-indentation)) | ||
| 726 | (if (and (> i 0) (> (setq i (+ i delta)) 0)) | ||
| 727 | (indent-line-to i))) | ||
| 728 | (beginning-of-line 0))))) | ||
| 729 | |||
| 690 | (defun org-beginning-of-item-list () | 730 | (defun org-beginning-of-item-list () |
| 691 | "Go to the beginning of the current item list. | 731 | "Go to the beginning of the current item list. |
| 692 | I.e. to the first item in this list." | 732 | I.e. to the first item in this list." |
diff --git a/lisp/org/org-mac-message.el b/lisp/org/org-mac-message.el index 13fa6ddd759..2f9e63bed8a 100644 --- a/lisp/org/org-mac-message.el +++ b/lisp/org/org-mac-message.el | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | ;; Copyright (C) 2008 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2008 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: John Wiegley <johnw@gnu.org> | 5 | ;; Author: John Wiegley <johnw@gnu.org> |
| 6 | ;; Version: 6.12a | 6 | ;; Version: 6.13 |
| 7 | ;; Keywords: outlines, hypermedia, calendar, wp | 7 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 7f4f3d106fc..563f6c3e33d 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org-mew.el b/lisp/org/org-mew.el index f8c7f3f9167..fda6270016d 100644 --- a/lisp/org/org-mew.el +++ b/lisp/org/org-mew.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> | 5 | ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -34,21 +34,23 @@ | |||
| 34 | (require 'org) | 34 | (require 'org) |
| 35 | 35 | ||
| 36 | (defgroup org-mew nil | 36 | (defgroup org-mew nil |
| 37 | "Options concerning the Mew link." | 37 | "Options concerning the Mew link." |
| 38 | :tag "Org Startup" | 38 | :tag "Org Startup" |
| 39 | :group 'org-link) | 39 | :group 'org-link) |
| 40 | 40 | ||
| 41 | (defcustom org-mew-link-to-refile-destination t | 41 | (defcustom org-mew-link-to-refile-destination t |
| 42 | "Create a link to the refile destination if the message is marked as refile." | 42 | "Create a link to the refile destination if the message is marked as refile." |
| 43 | :group 'org-mew | 43 | :group 'org-mew |
| 44 | :type 'boolean) | 44 | :type 'boolean) |
| 45 | 45 | ||
| 46 | ;; Declare external functions and variables | 46 | ;; Declare external functions and variables |
| 47 | (declare-function mew-cache-hit "ext:mew-cache" (fld msg &optional must-hit)) | 47 | (declare-function mew-cache-hit "ext:mew-cache" (fld msg &optional must-hit)) |
| 48 | (declare-function mew-case-folder "ext:mew-func" (case folder)) | ||
| 48 | (declare-function mew-header-get-value "ext:mew-header" | 49 | (declare-function mew-header-get-value "ext:mew-header" |
| 49 | (field &optional as-list)) | 50 | (field &optional as-list)) |
| 50 | (declare-function mew-init "ext:mew" ()) | 51 | (declare-function mew-init "ext:mew" ()) |
| 51 | (declare-function mew-refile-get "ext:mew-refile" (msg)) | 52 | (declare-function mew-refile-get "ext:mew-refile" (msg)) |
| 53 | (declare-function mew-sinfo-get-case "ext:mew-summary" ()) | ||
| 52 | (declare-function mew-summary-display "ext:mew-summary2" (&optional redisplay)) | 54 | (declare-function mew-summary-display "ext:mew-summary2" (&optional redisplay)) |
| 53 | (declare-function mew-summary-folder-name "ext:mew-syntax" (&optional ext)) | 55 | (declare-function mew-summary-folder-name "ext:mew-syntax" (&optional ext)) |
| 54 | (declare-function mew-summary-get-mark "ext:mew-mark" ()) | 56 | (declare-function mew-summary-get-mark "ext:mew-mark" ()) |
| @@ -69,17 +71,18 @@ | |||
| 69 | 71 | ||
| 70 | ;; Implementation | 72 | ;; Implementation |
| 71 | (defun org-mew-store-link () | 73 | (defun org-mew-store-link () |
| 72 | "Store a link to a Mew folder or message." | 74 | "Store a link to a Mew folder or message." |
| 73 | (when (memq major-mode '(mew-summary-mode mew-virtual-mode)) | 75 | (when (memq major-mode '(mew-summary-mode mew-virtual-mode)) |
| 74 | (let* ((msgnum (mew-summary-message-number2)) | 76 | (let* ((msgnum (mew-summary-message-number2)) |
| 75 | (mark-info (mew-summary-get-mark)) | 77 | (mark-info (mew-summary-get-mark)) |
| 76 | (folder-name | 78 | (folder-name |
| 77 | (if (and org-mew-link-to-refile-destination | 79 | (if (and org-mew-link-to-refile-destination |
| 78 | (eq mark-info ?o)) ; marked as refile | 80 | (eq mark-info ?o)) ; marked as refile |
| 79 | (nth 1 (mew-refile-get msgnum)) | 81 | (mew-case-folder (mew-sinfo-get-case) |
| 82 | (nth 1 (mew-refile-get msgnum))) | ||
| 80 | (mew-summary-folder-name))) | 83 | (mew-summary-folder-name))) |
| 81 | message-id from to subject desc link) | 84 | message-id from to subject desc link) |
| 82 | (save-window-excursion | 85 | (save-window-excursion |
| 83 | (if (fboundp 'mew-summary-set-message-buffer) | 86 | (if (fboundp 'mew-summary-set-message-buffer) |
| 84 | (mew-summary-set-message-buffer folder-name msgnum) | 87 | (mew-summary-set-message-buffer folder-name msgnum) |
| 85 | (set-buffer (mew-cache-hit folder-name msgnum t))) | 88 | (set-buffer (mew-cache-hit folder-name msgnum t))) |
| @@ -87,35 +90,35 @@ | |||
| 87 | (setq from (mew-header-get-value "From:")) | 90 | (setq from (mew-header-get-value "From:")) |
| 88 | (setq to (mew-header-get-value "To:")) | 91 | (setq to (mew-header-get-value "To:")) |
| 89 | (setq subject (mew-header-get-value "Subject:"))) | 92 | (setq subject (mew-header-get-value "Subject:"))) |
| 90 | (org-store-link-props :type "mew" :from from :to to | 93 | (org-store-link-props :type "mew" :from from :to to |
| 91 | :subject subject :message-id message-id) | 94 | :subject subject :message-id message-id) |
| 92 | (setq message-id (org-remove-angle-brackets message-id)) | 95 | (setq message-id (org-remove-angle-brackets message-id)) |
| 93 | (setq desc (org-email-link-description)) | 96 | (setq desc (org-email-link-description)) |
| 94 | (setq link (org-make-link "mew:" folder-name | 97 | (setq link (org-make-link "mew:" folder-name |
| 95 | "#" message-id)) | 98 | "#" message-id)) |
| 96 | (org-add-link-props :link link :description desc) | 99 | (org-add-link-props :link link :description desc) |
| 97 | link))) | 100 | link))) |
| 98 | 101 | ||
| 99 | (defun org-mew-open (path) | 102 | (defun org-mew-open (path) |
| 100 | "Follow the Mew message link specified by PATH." | 103 | "Follow the Mew message link specified by PATH." |
| 101 | (let (folder msgnum) | 104 | (let (folder msgnum) |
| 102 | (cond ((string-match "\\`\\(+.*\\)+\\+\\([0-9]+\\)\\'" path) ; for Bastien's | 105 | (cond ((string-match "\\`\\(+.*\\)+\\+\\([0-9]+\\)\\'" path) ; for Bastien's |
| 103 | (setq folder (match-string 1 path)) | 106 | (setq folder (match-string 1 path)) |
| 104 | (setq msgnum (match-string 2 path))) | 107 | (setq msgnum (match-string 2 path))) |
| 105 | ((string-match "\\`\\(\\(%#\\)?[^#]+\\)\\(#\\(.*\\)\\)?" path) | 108 | ((string-match "\\`\\(\\(%#\\)?[^#]+\\)\\(#\\(.*\\)\\)?" path) |
| 106 | (setq folder (match-string 1 path)) | 109 | (setq folder (match-string 1 path)) |
| 107 | (setq msgnum (match-string 4 path))) | 110 | (setq msgnum (match-string 4 path))) |
| 108 | (t (error "Error in Mew link"))) | 111 | (t (error "Error in Mew link"))) |
| 109 | (require 'mew) | 112 | (require 'mew) |
| 110 | (mew-window-push) | 113 | (mew-window-push) |
| 111 | (unless mew-init-p (mew-init)) | 114 | (unless mew-init-p (mew-init)) |
| 112 | (mew-summary-visit-folder folder) | 115 | (mew-summary-visit-folder folder) |
| 113 | (when msgnum | 116 | (when msgnum |
| 114 | (if (not (string-match "\\`[0-9]+\\'" msgnum)) | 117 | (if (not (string-match "\\`[0-9]+\\'" msgnum)) |
| 115 | (let* ((pattern (concat "message-id=" msgnum)) | 118 | (let* ((pattern (concat "message-id=" msgnum)) |
| 116 | (msgs (mew-summary-pick-with-mewl pattern folder nil))) | 119 | (msgs (mew-summary-pick-with-mewl pattern folder nil))) |
| 117 | (setq msgnum (car msgs)))) | 120 | (setq msgnum (car msgs)))) |
| 118 | (if (mew-summary-search-msg msgnum) | 121 | (if (mew-summary-search-msg msgnum) |
| 119 | (if mew-summary-goto-line-then-display | 122 | (if mew-summary-goto-line-then-display |
| 120 | (mew-summary-display)) | 123 | (mew-summary-display)) |
| 121 | (error "Message not found"))))) | 124 | (error "Message not found"))))) |
diff --git a/lisp/org/org-mhe.el b/lisp/org/org-mhe.el index 19c7f5b1d30..ab9f797cb81 100644 --- a/lisp/org/org-mhe.el +++ b/lisp/org/org-mhe.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de> | 5 | ;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el index 7f3e322d1b6..0cb65058163 100644 --- a/lisp/org/org-mouse.el +++ b/lisp/org/org-mouse.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | ;; | 4 | ;; |
| 5 | ;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com> | 5 | ;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com> |
| 6 | ;; Maintainer: Carsten Dominik <carsten at orgmode dot org> | 6 | ;; Maintainer: Carsten Dominik <carsten at orgmode dot org> |
| 7 | ;; Version: 6.12a | 7 | ;; Version: 6.13 |
| 8 | ;; | 8 | ;; |
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
| @@ -144,7 +144,7 @@ | |||
| 144 | (defvar org-agenda-undo-list) | 144 | (defvar org-agenda-undo-list) |
| 145 | (defvar org-agenda-custom-commands) | 145 | (defvar org-agenda-custom-commands) |
| 146 | (declare-function org-agenda-change-all-lines "org-agenda" | 146 | (declare-function org-agenda-change-all-lines "org-agenda" |
| 147 | (newhead hdmarker &optional fixface just-this)) | 147 | (newhead hdmarker &optional fixface)) |
| 148 | (declare-function org-verify-change-for-undo "org-agenda" (l1 l2)) | 148 | (declare-function org-verify-change-for-undo "org-agenda" (l1 l2)) |
| 149 | 149 | ||
| 150 | (defvar org-mouse-plain-list-regexp "\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) " | 150 | (defvar org-mouse-plain-list-regexp "\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) " |
| @@ -584,7 +584,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:" | |||
| 584 | (beginning-of-line) | 584 | (beginning-of-line) |
| 585 | (looking-at "[ \t]*") | 585 | (looking-at "[ \t]*") |
| 586 | (open-line 1) | 586 | (open-line 1) |
| 587 | (indent-to (- (match-end 0) (match-beginning 0))) | 587 | (org-indent-to-column (- (match-end 0) (match-beginning 0))) |
| 588 | (insert "+ ")) | 588 | (insert "+ ")) |
| 589 | 589 | ||
| 590 | (:middle ; insert after | 590 | (:middle ; insert after |
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el index a469cf6168c..b2443ccd7e9 100644 --- a/lisp/org/org-plot.el +++ b/lisp/org/org-plot.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Eric Schulte <schulte dot eric at gmail dot com> | 5 | ;; Author: Eric Schulte <schulte dot eric at gmail dot com> |
| 6 | ;; Keywords: tables, plotting | 6 | ;; Keywords: tables, plotting |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el index bbd91805121..eafa8faab63 100644 --- a/lisp/org/org-publish.el +++ b/lisp/org/org-publish.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | ;; Author: David O'Toole <dto@gnu.org> | 4 | ;; Author: David O'Toole <dto@gnu.org> |
| 5 | ;; Maintainer: Bastien Guerry <bzg AT altern DOT org> | 5 | ;; Maintainer: Bastien Guerry <bzg AT altern DOT org> |
| 6 | ;; Keywords: hypermedia, outlines, wp | 6 | ;; Keywords: hypermedia, outlines, wp |
| 7 | ;; Version: 6.12a | 7 | ;; Version: 6.13 |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
| @@ -626,7 +626,7 @@ Default for INDEX-FILENAME is 'index.org'." | |||
| 626 | (if index-buffer | 626 | (if index-buffer |
| 627 | (kill-buffer index-buffer)) | 627 | (kill-buffer index-buffer)) |
| 628 | (with-temp-buffer | 628 | (with-temp-buffer |
| 629 | (insert (concat "* " index-title "\n\n")) | 629 | (insert (concat "#+TITLE: " index-title "\n\n")) |
| 630 | (while (setq file (pop files)) | 630 | (while (setq file (pop files)) |
| 631 | (let ((fn (file-name-nondirectory file)) | 631 | (let ((fn (file-name-nondirectory file)) |
| 632 | (link (file-relative-name file dir)) | 632 | (link (file-relative-name file dir)) |
| @@ -703,7 +703,7 @@ Default for INDEX-FILENAME is 'index.org'." | |||
| 703 | (if force nil org-publish-use-timestamps-flag))) | 703 | (if force nil org-publish-use-timestamps-flag))) |
| 704 | (org-publish-projects | 704 | (org-publish-projects |
| 705 | (list (or project | 705 | (list (or project |
| 706 | (assoc (completing-read | 706 | (assoc (org-ido-completing-read |
| 707 | "Publish project: " | 707 | "Publish project: " |
| 708 | org-publish-project-alist nil t) | 708 | org-publish-project-alist nil t) |
| 709 | org-publish-project-alist))))))) | 709 | org-publish-project-alist))))))) |
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el index 7968f0a8945..ce3f5479eaa 100644 --- a/lisp/org/org-remember.el +++ b/lisp/org/org-remember.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -54,7 +54,7 @@ | |||
| 54 | (defcustom org-remember-store-without-prompt t | 54 | (defcustom org-remember-store-without-prompt t |
| 55 | "Non-nil means, `C-c C-c' stores remember note without further prompts. | 55 | "Non-nil means, `C-c C-c' stores remember note without further prompts. |
| 56 | It then uses the file and headline specified by the template or (if the | 56 | It then uses the file and headline specified by the template or (if the |
| 57 | themplate does not specify them) by the variables `org-default-notes-file' | 57 | template does not specify them) by the variables `org-default-notes-file' |
| 58 | and `org-remember-default-headline'. To force prompting anyway, use | 58 | and `org-remember-default-headline'. To force prompting anyway, use |
| 59 | `C-u C-c C-c' to file the note. | 59 | `C-u C-c C-c' to file the note. |
| 60 | 60 | ||
| @@ -195,6 +195,26 @@ calendar | %:type %:date" | |||
| 195 | (symbol :tag "Major mode")) | 195 | (symbol :tag "Major mode")) |
| 196 | (function :tag "Perform a check against function"))))) | 196 | (function :tag "Perform a check against function"))))) |
| 197 | 197 | ||
| 198 | (defcustom org-remember-before-finalize-hook nil | ||
| 199 | "Hook that is run right before a remember process is finalized. | ||
| 200 | The remember buffer is still current when this hook runs." | ||
| 201 | :group 'org-remember | ||
| 202 | :type 'hook) | ||
| 203 | |||
| 204 | (defvar org-remember-mode-map (make-sparse-keymap) | ||
| 205 | "Keymap for org-remember-mode, a minor mode. | ||
| 206 | Use this map to set additional keybindings for when Org-mode is used | ||
| 207 | for a Remember buffer.") | ||
| 208 | (defvar org-remember-mode-hook nil | ||
| 209 | "Hook for the minor `org-remember-mode'.") | ||
| 210 | |||
| 211 | (define-minor-mode org-remember-mode | ||
| 212 | "Minor mode for special key bindings in a remember buffer." | ||
| 213 | nil " Rem" org-remember-mode-map | ||
| 214 | (run-hooks 'org-remember-mode-hook)) | ||
| 215 | (define-key org-remember-mode-map "\C-c\C-c" 'org-remember-finalize) | ||
| 216 | (define-key org-remember-mode-map "\C-c\C-k" 'org-remember-kill) | ||
| 217 | |||
| 198 | (defcustom org-remember-clock-out-on-exit 'query | 218 | (defcustom org-remember-clock-out-on-exit 'query |
| 199 | "Non-nil means, stop the clock when exiting a clocking remember buffer. | 219 | "Non-nil means, stop the clock when exiting a clocking remember buffer. |
| 200 | This only applies if the clock is running in the remember buffer. If the | 220 | This only applies if the clock is running in the remember buffer. If the |
| @@ -360,7 +380,7 @@ to be run from that hook to function properly." | |||
| 360 | v-a)) | 380 | v-a)) |
| 361 | (v-n user-full-name) | 381 | (v-n user-full-name) |
| 362 | (v-k (if (marker-buffer org-clock-marker) | 382 | (v-k (if (marker-buffer org-clock-marker) |
| 363 | (substring-no-properties org-clock-heading))) | 383 | (org-substring-no-properties org-clock-heading))) |
| 364 | (v-K (if (marker-buffer org-clock-marker) | 384 | (v-K (if (marker-buffer org-clock-marker) |
| 365 | (org-make-link-string | 385 | (org-make-link-string |
| 366 | (buffer-file-name (marker-buffer org-clock-marker)) | 386 | (buffer-file-name (marker-buffer org-clock-marker)) |
| @@ -446,8 +466,7 @@ to be run from that hook to function properly." | |||
| 446 | (replace-match x t t)))) | 466 | (replace-match x t t)))) |
| 447 | 467 | ||
| 448 | ;; Turn on org-mode in the remember buffer, set local variables | 468 | ;; Turn on org-mode in the remember buffer, set local variables |
| 449 | (let ((org-inhibit-startup t)) (org-mode)) | 469 | (let ((org-inhibit-startup t)) (org-mode) (org-remember-mode 1)) |
| 450 | (org-set-local 'org-finish-function 'org-remember-finalize) | ||
| 451 | (if (and file (string-match "\\S-" file) (not (file-directory-p file))) | 470 | (if (and file (string-match "\\S-" file) (not (file-directory-p file))) |
| 452 | (org-set-local 'org-default-notes-file file)) | 471 | (org-set-local 'org-default-notes-file file)) |
| 453 | (if headline | 472 | (if headline |
| @@ -474,7 +493,7 @@ to be run from that hook to function properly." | |||
| 474 | (org-global-tags-completion-table | 493 | (org-global-tags-completion-table |
| 475 | (if (equal char "G") (org-agenda-files) (and file (list file))))) | 494 | (if (equal char "G") (org-agenda-files) (and file (list file))))) |
| 476 | (org-add-colon-after-tag-completion t) | 495 | (org-add-colon-after-tag-completion t) |
| 477 | (ins (completing-read | 496 | (ins (org-ido-completing-read |
| 478 | (if prompt (concat prompt ": ") "Tags: ") | 497 | (if prompt (concat prompt ": ") "Tags: ") |
| 479 | 'org-tags-completion-function nil nil nil | 498 | 'org-tags-completion-function nil nil nil |
| 480 | 'org-tags-history))) | 499 | 'org-tags-history))) |
| @@ -501,17 +520,23 @@ to be run from that hook to function properly." | |||
| 501 | (car clipboards)))))) | 520 | (car clipboards)))))) |
| 502 | ((equal char "p") | 521 | ((equal char "p") |
| 503 | (let* | 522 | (let* |
| 504 | ((prop (substring-no-properties prompt)) | 523 | ((prop (org-substring-no-properties prompt)) |
| 505 | (allowed (with-current-buffer | 524 | (pall (concat prop "_ALL")) |
| 506 | (get-buffer (file-name-nondirectory file)) | 525 | (allowed |
| 507 | (org-property-get-allowed-values nil prop 'table))) | 526 | (with-current-buffer |
| 527 | (get-buffer (file-name-nondirectory file)) | ||
| 528 | (or (cdr (assoc pall org-file-properties)) | ||
| 529 | (cdr (assoc pall org-global-properties)) | ||
| 530 | (cdr (assoc pall org-global-properties-fixed))))) | ||
| 508 | (existing (with-current-buffer | 531 | (existing (with-current-buffer |
| 509 | (get-buffer (file-name-nondirectory file)) | 532 | (get-buffer (file-name-nondirectory file)) |
| 510 | (mapcar 'list (org-property-values prop)))) | 533 | (mapcar 'list (org-property-values prop)))) |
| 511 | (propprompt (concat "Value for " prop ": ")) | 534 | (propprompt (concat "Value for " prop ": ")) |
| 512 | (val (if allowed | 535 | (val (if allowed |
| 513 | (org-completing-read propprompt allowed nil | 536 | (org-completing-read |
| 514 | 'req-match) | 537 | propprompt |
| 538 | (mapcar 'list (org-split-string allowed "[ \t]+")) | ||
| 539 | nil 'req-match) | ||
| 515 | (org-completing-read propprompt existing nil nil | 540 | (org-completing-read propprompt existing nil nil |
| 516 | "" nil "")))) | 541 | "" nil "")))) |
| 517 | (org-set-property prop val))) | 542 | (org-set-property prop val))) |
| @@ -524,17 +549,17 @@ to be run from that hook to function properly." | |||
| 524 | (member char '("u" "U")) | 549 | (member char '("u" "U")) |
| 525 | nil nil (list org-end-time-was-given))) | 550 | nil nil (list org-end-time-was-given))) |
| 526 | (t | 551 | (t |
| 527 | (insert (org-completing-read | 552 | (let (org-completion-use-ido) |
| 528 | (concat (if prompt prompt "Enter string") | 553 | (insert (org-completing-read |
| 529 | (if default (concat " [" default "]")) | 554 | (concat (if prompt prompt "Enter string") |
| 530 | ": ") | 555 | (if default (concat " [" default "]")) |
| 531 | completions nil nil nil histvar default))))) | 556 | ": ") |
| 557 | completions nil nil nil histvar default)))))) | ||
| 532 | (goto-char (point-min)) | 558 | (goto-char (point-min)) |
| 533 | (if (re-search-forward "%\\?" nil t) | 559 | (if (re-search-forward "%\\?" nil t) |
| 534 | (replace-match "") | 560 | (replace-match "") |
| 535 | (and (re-search-forward "^[^#\n]" nil t) (backward-char 1)))) | 561 | (and (re-search-forward "^[^#\n]" nil t) (backward-char 1)))) |
| 536 | (let ((org-inhibit-startup t)) (org-mode)) | 562 | (let ((org-inhibit-startup t)) (org-mode) (org-remember-mode 1))) |
| 537 | (org-set-local 'org-finish-function 'org-remember-finalize)) | ||
| 538 | (when (save-excursion | 563 | (when (save-excursion |
| 539 | (goto-char (point-min)) | 564 | (goto-char (point-min)) |
| 540 | (re-search-forward "%&" nil t)) | 565 | (re-search-forward "%&" nil t)) |
| @@ -551,8 +576,7 @@ to be run from that hook to function properly." | |||
| 551 | This should be run in `post-command-hook' and will remove itself | 576 | This should be run in `post-command-hook' and will remove itself |
| 552 | from that hook." | 577 | from that hook." |
| 553 | (remove-hook 'post-command-hook 'org-remember-finish-immediately) | 578 | (remove-hook 'post-command-hook 'org-remember-finish-immediately) |
| 554 | (when org-finish-function | 579 | (org-remember-finalize)) |
| 555 | (funcall org-finish-function))) | ||
| 556 | 580 | ||
| 557 | (defun org-remember-visit-immediately () | 581 | (defun org-remember-visit-immediately () |
| 558 | "File remember note immediately. | 582 | "File remember note immediately. |
| @@ -572,6 +596,10 @@ from that hook." | |||
| 572 | (defvar org-clock-marker) ; Defined in org.el | 596 | (defvar org-clock-marker) ; Defined in org.el |
| 573 | (defun org-remember-finalize () | 597 | (defun org-remember-finalize () |
| 574 | "Finalize the remember process." | 598 | "Finalize the remember process." |
| 599 | (interactive) | ||
| 600 | (unless org-remember-mode | ||
| 601 | (error "This does not seem to be a remember buffer for Org-mode")) | ||
| 602 | (run-hooks 'org-remember-before-finalize-hook) | ||
| 575 | (unless (fboundp 'remember-finalize) | 603 | (unless (fboundp 'remember-finalize) |
| 576 | (defalias 'remember-finalize 'remember-buffer)) | 604 | (defalias 'remember-finalize 'remember-buffer)) |
| 577 | (when (and org-clock-marker | 605 | (when (and org-clock-marker |
| @@ -587,6 +615,12 @@ from that hook." | |||
| 587 | (setq buffer-file-name nil)) | 615 | (setq buffer-file-name nil)) |
| 588 | (remember-finalize)) | 616 | (remember-finalize)) |
| 589 | 617 | ||
| 618 | (defun org-remember-kill () | ||
| 619 | "Abort the current remember process." | ||
| 620 | (interactive) | ||
| 621 | (let ((org-note-abort t)) | ||
| 622 | (org-remember-finalize))) | ||
| 623 | |||
| 590 | ;;;###autoload | 624 | ;;;###autoload |
| 591 | (defun org-remember (&optional goto org-force-remember-template-char) | 625 | (defun org-remember (&optional goto org-force-remember-template-char) |
| 592 | "Call `remember'. If this is already a remember buffer, re-apply template. | 626 | "Call `remember'. If this is already a remember buffer, re-apply template. |
| @@ -610,7 +644,7 @@ associated with a template in `org-remember-templates'." | |||
| 610 | ;; `org-select-remember-template' | 644 | ;; `org-select-remember-template' |
| 611 | (setq org-select-template-temp-major-mode major-mode) | 645 | (setq org-select-template-temp-major-mode major-mode) |
| 612 | (setq org-select-template-original-buffer (current-buffer)) | 646 | (setq org-select-template-original-buffer (current-buffer)) |
| 613 | (if (eq org-finish-function 'org-remember-finalize) | 647 | (if org-remember-mode |
| 614 | (progn | 648 | (progn |
| 615 | (when (< (length org-remember-templates) 2) | 649 | (when (< (length org-remember-templates) 2) |
| 616 | (error "No other template available")) | 650 | (error "No other template available")) |
| @@ -769,6 +803,10 @@ See also the variable `org-reverse-note-order'." | |||
| 769 | (not fastp)) | 803 | (not fastp)) |
| 770 | (org-refile nil (or visiting (find-file-noselect file))) | 804 | (org-refile nil (or visiting (find-file-noselect file))) |
| 771 | (and visitp (run-with-idle-timer 0.01 nil 'org-remember-visit-immediately)) | 805 | (and visitp (run-with-idle-timer 0.01 nil 'org-remember-visit-immediately)) |
| 806 | (save-excursion | ||
| 807 | (bookmark-jump "org-refile-last-stored") | ||
| 808 | (bookmark-set "org-remember-last-stored") | ||
| 809 | (move-marker org-remember-last-stored-marker (point))) | ||
| 772 | (throw 'quit t)) | 810 | (throw 'quit t)) |
| 773 | ;; Find the file | 811 | ;; Find the file |
| 774 | (if (not visiting) (find-file-noselect file)) | 812 | (if (not visiting) (find-file-noselect file)) |
diff --git a/lisp/org/org-rmail.el b/lisp/org/org-rmail.el index 8754f2a8c6e..4782f50eace 100644 --- a/lisp/org/org-rmail.el +++ b/lisp/org/org-rmail.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 53942416546..0797d1b1324 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org-vm.el b/lisp/org/org-vm.el index 1195e1192f6..2394591ffd0 100644 --- a/lisp/org/org-vm.el +++ b/lisp/org/org-vm.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -111,6 +111,7 @@ | |||
| 111 | (funcall (cdr (assq 'vm org-link-frame-setup)) folder readonly) | 111 | (funcall (cdr (assq 'vm org-link-frame-setup)) folder readonly) |
| 112 | (sit-for 0.1) | 112 | (sit-for 0.1) |
| 113 | (when article | 113 | (when article |
| 114 | (require 'vm-search) | ||
| 114 | (vm-select-folder-buffer) | 115 | (vm-select-folder-buffer) |
| 115 | (widen) | 116 | (widen) |
| 116 | (let ((case-fold-search t)) | 117 | (let ((case-fold-search t)) |
diff --git a/lisp/org/org-wl.el b/lisp/org/org-wl.el index ac2be1f4092..e07bc82c063 100644 --- a/lisp/org/org-wl.el +++ b/lisp/org/org-wl.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> | 5 | ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
diff --git a/lisp/org/org.el b/lisp/org/org.el index caac01689fc..d25d9c5cf5e 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 | ;; Author: Carsten Dominik <carsten at orgmode dot org> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://orgmode.org | 7 | ;; Homepage: http://orgmode.org |
| 8 | ;; Version: 6.12a | 8 | ;; Version: 6.13 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -92,7 +92,7 @@ | |||
| 92 | 92 | ||
| 93 | ;;; Version | 93 | ;;; Version |
| 94 | 94 | ||
| 95 | (defconst org-version "6.12a" | 95 | (defconst org-version "6.13" |
| 96 | "The version number of the file org.el.") | 96 | "The version number of the file org.el.") |
| 97 | 97 | ||
| 98 | (defun org-version (&optional here) | 98 | (defun org-version (&optional here) |
| @@ -125,7 +125,7 @@ With prefix arg HERE, insert it at point." | |||
| 125 | "Have the modules been loaded already?") | 125 | "Have the modules been loaded already?") |
| 126 | 126 | ||
| 127 | (defun org-load-modules-maybe (&optional force) | 127 | (defun org-load-modules-maybe (&optional force) |
| 128 | "Load all extensions listed in `org-default-extensions'." | 128 | "Load all extensions listed in `org-modules'." |
| 129 | (when (or force (not org-modules-loaded)) | 129 | (when (or force (not org-modules-loaded)) |
| 130 | (mapc (lambda (ext) | 130 | (mapc (lambda (ext) |
| 131 | (condition-case nil (require ext) | 131 | (condition-case nil (require ext) |
| @@ -180,7 +180,9 @@ to add the symbol `xyz', and the package must have a call to | |||
| 180 | (const :tag "C depend: TODO dependencies for Org-mode" org-depend) | 180 | (const :tag "C depend: TODO dependencies for Org-mode" org-depend) |
| 181 | (const :tag "C elisp-symbol: Org links to emacs-lisp symbols" org-elisp-symbol) | 181 | (const :tag "C elisp-symbol: Org links to emacs-lisp symbols" org-elisp-symbol) |
| 182 | (const :tag "C eval: Include command output as text" org-eval) | 182 | (const :tag "C eval: Include command output as text" org-eval) |
| 183 | (const :tag "C eval-light: Evaluate inbuffer-code on demand" org-eval-light) | ||
| 183 | (const :tag "C expiry: Expiry mechanism for Org entries" org-expiry) | 184 | (const :tag "C expiry: Expiry mechanism for Org entries" org-expiry) |
| 185 | (const :tag "C exp-blocks: Pre-process blocks for export" org-exp-blocks) | ||
| 184 | (const :tag "C id: Global id's for identifying entries" org-id) | 186 | (const :tag "C id: Global id's for identifying entries" org-id) |
| 185 | (const :tag "C interactive-query: Interactive modification of tags query" org-interactive-query) | 187 | (const :tag "C interactive-query: Interactive modification of tags query" org-interactive-query) |
| 186 | (const :tag "C mairix: Hook mairix search into Org for different MUAs" org-mairix) | 188 | (const :tag "C mairix: Hook mairix search into Org for different MUAs" org-mairix) |
| @@ -843,7 +845,9 @@ links in Org-mode buffers can have an optional tag after a double colon, e.g. | |||
| 843 | [[linkkey:tag][description]] | 845 | [[linkkey:tag][description]] |
| 844 | 846 | ||
| 845 | If REPLACE is a string, the tag will simply be appended to create the link. | 847 | If REPLACE is a string, the tag will simply be appended to create the link. |
| 846 | If the string contains \"%s\", the tag will be inserted there. | 848 | If the string contains \"%s\", the tag will be inserted there. Alternatively, |
| 849 | the placeholder \"%h\" will cause a url-encoded version of the tag to | ||
| 850 | be inserted at that point (see the function `url-hexify-string'). | ||
| 847 | 851 | ||
| 848 | REPLACE may also be a function that will be called with the tag as the | 852 | REPLACE may also be a function that will be called with the tag as the |
| 849 | only argument to create the link, which should be returned as a string. | 853 | only argument to create the link, which should be returned as a string. |
| @@ -979,6 +983,20 @@ more efficient." | |||
| 979 | :tag "Org Follow Link" | 983 | :tag "Org Follow Link" |
| 980 | :group 'org-link) | 984 | :group 'org-link) |
| 981 | 985 | ||
| 986 | (defcustom org-link-translation-function nil | ||
| 987 | "Function to translate links with different syntax to Org syntax. | ||
| 988 | This can be used to translate links created for example by the Planner | ||
| 989 | or emacs-wiki packages to Org syntax. | ||
| 990 | The function must accept two parameters, a TYPE containing the link | ||
| 991 | protocol name like \"rmail\" or \"gnus\" as a string, and the linked path, | ||
| 992 | which is everything after the link protocol. It should return a cons | ||
| 993 | with possibly modifed values of type and path. | ||
| 994 | Org contains a function for this, so if you set this variable to | ||
| 995 | `org-translate-link-from-planner', you should be able follow many | ||
| 996 | links created by planner." | ||
| 997 | :group 'org-link-follow | ||
| 998 | :type 'function) | ||
| 999 | |||
| 982 | (defcustom org-follow-link-hook nil | 1000 | (defcustom org-follow-link-hook nil |
| 983 | "Hook that is run after a link has been followed." | 1001 | "Hook that is run after a link has been followed." |
| 984 | :group 'org-link-follow | 1002 | :group 'org-link-follow |
| @@ -1304,11 +1322,11 @@ are used, equivalent to the value `((nil . (:level . 1))'." | |||
| 1304 | (const :tag "Current buffer" nil) | 1322 | (const :tag "Current buffer" nil) |
| 1305 | (function) (variable) (file)) | 1323 | (function) (variable) (file)) |
| 1306 | (choice :tag "Identify target headline by" | 1324 | (choice :tag "Identify target headline by" |
| 1307 | (cons :tag "Specific tag" (const :tag) (string)) | 1325 | (cons :tag "Specific tag" (const :value :tag) (string)) |
| 1308 | (cons :tag "TODO keyword" (const :todo) (string)) | 1326 | (cons :tag "TODO keyword" (const :value :todo) (string)) |
| 1309 | (cons :tag "Regular expression" (const :regexp) (regexp)) | 1327 | (cons :tag "Regular expression" (const :value :regexp) (regexp)) |
| 1310 | (cons :tag "Level number" (const :level) (integer)) | 1328 | (cons :tag "Level number" (const :value :level) (integer)) |
| 1311 | (cons :tag "Max Level number" (const :maxlevel) (integer)))))) | 1329 | (cons :tag "Max Level number" (const :value :maxlevel) (integer)))))) |
| 1312 | 1330 | ||
| 1313 | (defcustom org-refile-use-outline-path nil | 1331 | (defcustom org-refile-use-outline-path nil |
| 1314 | "Non-nil means, provide refile targets as paths. | 1332 | "Non-nil means, provide refile targets as paths. |
| @@ -1699,7 +1717,7 @@ end of the second format." | |||
| 1699 | org-mode generates a time duration." | 1717 | org-mode generates a time duration." |
| 1700 | :group 'org-time | 1718 | :group 'org-time |
| 1701 | :type 'string) | 1719 | :type 'string) |
| 1702 | 1720 | ||
| 1703 | (defcustom org-deadline-warning-days 14 | 1721 | (defcustom org-deadline-warning-days 14 |
| 1704 | "No. of days before expiration during which a deadline becomes active. | 1722 | "No. of days before expiration during which a deadline becomes active. |
| 1705 | This variable governs the display in sparse trees and in the agenda. | 1723 | This variable governs the display in sparse trees and in the agenda. |
| @@ -1996,7 +2014,8 @@ These are fixed values, for the preset properties.") | |||
| 1996 | 2014 | ||
| 1997 | (defcustom org-global-properties nil | 2015 | (defcustom org-global-properties nil |
| 1998 | "List of property/value pairs that can be inherited by any entry. | 2016 | "List of property/value pairs that can be inherited by any entry. |
| 1999 | You can set buffer-local values for this by adding lines like | 2017 | You can set buffer-local values for the same purpose in the variable |
| 2018 | `org-file-properties' this by adding lines like | ||
| 2000 | 2019 | ||
| 2001 | #+PROPERTY: NAME VALUE" | 2020 | #+PROPERTY: NAME VALUE" |
| 2002 | :group 'org-properties | 2021 | :group 'org-properties |
| @@ -2319,6 +2338,11 @@ Use customize to modify this, or restart Emacs after changing it." | |||
| 2319 | :tag "Org Completion" | 2338 | :tag "Org Completion" |
| 2320 | :group 'org) | 2339 | :group 'org) |
| 2321 | 2340 | ||
| 2341 | (defcustom org-completion-use-ido nil | ||
| 2342 | "Non-ni means, use ido completion wherever possible." | ||
| 2343 | :group 'org-completion | ||
| 2344 | :type 'boolean) | ||
| 2345 | |||
| 2322 | (defcustom org-completion-fallback-command 'hippie-expand | 2346 | (defcustom org-completion-fallback-command 'hippie-expand |
| 2323 | "The expansion command called by \\[org-complete] in normal context. | 2347 | "The expansion command called by \\[org-complete] in normal context. |
| 2324 | Normal means, no org-mode-specific context." | 2348 | Normal means, no org-mode-specific context." |
| @@ -2357,11 +2381,12 @@ Normal means, no org-mode-specific context." | |||
| 2357 | (extra txt &optional category tags dotime noprefix remove-re)) | 2381 | (extra txt &optional category tags dotime noprefix remove-re)) |
| 2358 | (declare-function org-agenda-new-marker "org-agenda" (&optional pos)) | 2382 | (declare-function org-agenda-new-marker "org-agenda" (&optional pos)) |
| 2359 | (declare-function org-agenda-change-all-lines "org-agenda" | 2383 | (declare-function org-agenda-change-all-lines "org-agenda" |
| 2360 | (newhead hdmarker &optional fixface just-this)) | 2384 | (newhead hdmarker &optional fixface)) |
| 2361 | (declare-function org-agenda-set-restriction-lock "org-agenda" (&optional type)) | 2385 | (declare-function org-agenda-set-restriction-lock "org-agenda" (&optional type)) |
| 2362 | (declare-function org-agenda-maybe-redo "org-agenda" ()) | 2386 | (declare-function org-agenda-maybe-redo "org-agenda" ()) |
| 2363 | (declare-function org-agenda-save-markers-for-cut-and-paste "org-agenda" | 2387 | (declare-function org-agenda-save-markers-for-cut-and-paste "org-agenda" |
| 2364 | (beg end)) | 2388 | (beg end)) |
| 2389 | (declare-function org-agenda-copy-local-variable "org-agenda" (var)) | ||
| 2365 | (declare-function parse-time-string "parse-time" (string)) | 2390 | (declare-function parse-time-string "parse-time" (string)) |
| 2366 | (declare-function remember "remember" (&optional initial)) | 2391 | (declare-function remember "remember" (&optional initial)) |
| 2367 | (declare-function remember-buffer-desc "remember" ()) | 2392 | (declare-function remember-buffer-desc "remember" ()) |
| @@ -2565,7 +2590,7 @@ Otherwise, return nil." | |||
| 2565 | (<= org-clock-marker (point-at-eol))) | 2590 | (<= org-clock-marker (point-at-eol))) |
| 2566 | ;; The clock is running here | 2591 | ;; The clock is running here |
| 2567 | (setq org-clock-start-time | 2592 | (setq org-clock-start-time |
| 2568 | (apply 'encode-time | 2593 | (apply 'encode-time |
| 2569 | (org-parse-time-string (match-string 1)))) | 2594 | (org-parse-time-string (match-string 1)))) |
| 2570 | (org-update-mode-line))) | 2595 | (org-update-mode-line))) |
| 2571 | (t | 2596 | (t |
| @@ -2612,17 +2637,19 @@ If yes, offer to stop it and to save the buffer with the changes." | |||
| 2612 | (defcustom org-archive-location "%s_archive::" | 2637 | (defcustom org-archive-location "%s_archive::" |
| 2613 | "The location where subtrees should be archived. | 2638 | "The location where subtrees should be archived. |
| 2614 | 2639 | ||
| 2615 | Otherwise, the value of this variable is a string, consisting of two | 2640 | The value of this variable is a string, consisting of two parts, |
| 2616 | parts, separated by a double-colon. | 2641 | separated by a double-colon. The first part is a filename and |
| 2642 | the second part is a headline. | ||
| 2617 | 2643 | ||
| 2618 | The first part is a file name - when omitted, archiving happens in the same | 2644 | When the filename is omitted, archiving happens in the same file. |
| 2619 | file. %s will be replaced by the current file name (without directory part). | 2645 | %s in the filename will be replaced by the current file |
| 2620 | Archiving to a different file is useful to keep archived entries from | 2646 | name (without the directory part). Archiving to a different file |
| 2621 | contributing to the Org-mode Agenda. | 2647 | is useful to keep archived entries from contributing to the |
| 2648 | Org-mode Agenda. | ||
| 2622 | 2649 | ||
| 2623 | The part after the double colon is a headline. The archived entries will be | 2650 | The archived entries will be filed as subtrees of the specified |
| 2624 | filed under that headline. When omitted, the subtrees are simply filed away | 2651 | headline. When the headline is omitted, the subtrees are simply |
| 2625 | at the end of the file, as top-level entries. | 2652 | filed away at the end of the file, as top-level entries. |
| 2626 | 2653 | ||
| 2627 | Here are a few examples: | 2654 | Here are a few examples: |
| 2628 | \"%s_archive::\" | 2655 | \"%s_archive::\" |
| @@ -2738,8 +2765,8 @@ collapsed state." | |||
| 2738 | ;; Autoload ID code | 2765 | ;; Autoload ID code |
| 2739 | 2766 | ||
| 2740 | (org-autoload "org-id" | 2767 | (org-autoload "org-id" |
| 2741 | '(org-id-get-create org-id-new org-id-copy org-id-get | 2768 | '(org-id-get-create org-id-new org-id-copy org-id-get |
| 2742 | org-id-get-with-outline-path-completion | 2769 | org-id-get-with-outline-path-completion |
| 2743 | org-id-get-with-outline-drilling | 2770 | org-id-get-with-outline-drilling |
| 2744 | org-id-goto org-id-find)) | 2771 | org-id-goto org-id-find)) |
| 2745 | 2772 | ||
| @@ -3397,6 +3424,8 @@ The following commands are available: | |||
| 3397 | "Matches a link with spaces, optional angular brackets around it.") | 3424 | "Matches a link with spaces, optional angular brackets around it.") |
| 3398 | (defvar org-link-re-with-space2 nil | 3425 | (defvar org-link-re-with-space2 nil |
| 3399 | "Matches a link with spaces, optional angular brackets around it.") | 3426 | "Matches a link with spaces, optional angular brackets around it.") |
| 3427 | (defvar org-link-re-with-space3 nil | ||
| 3428 | "Matches a link with spaces, only for internal part in bracket links.") | ||
| 3400 | (defvar org-angle-link-re nil | 3429 | (defvar org-angle-link-re nil |
| 3401 | "Matches link with angular brackets, spaces are allowed.") | 3430 | "Matches link with angular brackets, spaces are allowed.") |
| 3402 | (defvar org-plain-link-re nil | 3431 | (defvar org-plain-link-re nil |
| @@ -3432,6 +3461,11 @@ This should be called after the variable `org-link-types' has changed." | |||
| 3432 | "\\([^" org-non-link-chars " ]" | 3461 | "\\([^" org-non-link-chars " ]" |
| 3433 | "[^\t\n\r]*" | 3462 | "[^\t\n\r]*" |
| 3434 | "[^" org-non-link-chars " ]\\)>?") | 3463 | "[^" org-non-link-chars " ]\\)>?") |
| 3464 | org-link-re-with-space3 | ||
| 3465 | (concat | ||
| 3466 | "<?\\(" (mapconcat 'identity org-link-types "\\|") "\\):" | ||
| 3467 | "\\([^" org-non-link-chars " ]" | ||
| 3468 | "[^\t\n\r]*\\)") | ||
| 3435 | org-angle-link-re | 3469 | org-angle-link-re |
| 3436 | (concat | 3470 | (concat |
| 3437 | "<\\(" (mapconcat 'identity org-link-types "\\|") "\\):" | 3471 | "<\\(" (mapconcat 'identity org-link-types "\\|") "\\):" |
| @@ -4915,7 +4949,7 @@ would end up with no indentation after the change, nothing at all is done." | |||
| 4915 | (goto-char (match-end 0)) | 4949 | (goto-char (match-end 0)) |
| 4916 | (setq col (current-column)) | 4950 | (setq col (current-column)) |
| 4917 | (if (< diff 0) (replace-match "")) | 4951 | (if (< diff 0) (replace-match "")) |
| 4918 | (indent-to (+ diff col)))) | 4952 | (org-indent-to-column (+ diff col)))) |
| 4919 | (move-marker end nil)))) | 4953 | (move-marker end nil)))) |
| 4920 | 4954 | ||
| 4921 | (defun org-convert-to-odd-levels () | 4955 | (defun org-convert-to-odd-levels () |
| @@ -5094,7 +5128,7 @@ useful if the caller implements cut-and-paste as copy-then-paste-then-cut." | |||
| 5094 | (defun org-paste-subtree (&optional level tree for-yank) | 5128 | (defun org-paste-subtree (&optional level tree for-yank) |
| 5095 | "Paste the clipboard as a subtree, with modification of headline level. | 5129 | "Paste the clipboard as a subtree, with modification of headline level. |
| 5096 | The entire subtree is promoted or demoted in order to match a new headline | 5130 | The entire subtree is promoted or demoted in order to match a new headline |
| 5097 | level. | 5131 | level. |
| 5098 | 5132 | ||
| 5099 | If the cursor is at the beginning of a headline, the same level as | 5133 | If the cursor is at the beginning of a headline, the same level as |
| 5100 | that headline is used to paste the tree | 5134 | that headline is used to paste the tree |
| @@ -5369,13 +5403,13 @@ WITH-CASE, the sorting considers case as well." | |||
| 5369 | 5403 | ||
| 5370 | (and (= (downcase sorting-type) ?f) | 5404 | (and (= (downcase sorting-type) ?f) |
| 5371 | (setq getkey-func | 5405 | (setq getkey-func |
| 5372 | (completing-read "Sort using function: " | 5406 | (org-ido-completing-read "Sort using function: " |
| 5373 | obarray 'fboundp t nil nil)) | 5407 | obarray 'fboundp t nil nil)) |
| 5374 | (setq getkey-func (intern getkey-func))) | 5408 | (setq getkey-func (intern getkey-func))) |
| 5375 | 5409 | ||
| 5376 | (and (= (downcase sorting-type) ?r) | 5410 | (and (= (downcase sorting-type) ?r) |
| 5377 | (setq property | 5411 | (setq property |
| 5378 | (completing-read "Property: " | 5412 | (org-ido-completing-read "Property: " |
| 5379 | (mapcar 'list (org-buffer-property-keys t)) | 5413 | (mapcar 'list (org-buffer-property-keys t)) |
| 5380 | nil t)))) | 5414 | nil t)))) |
| 5381 | 5415 | ||
| @@ -5585,8 +5619,8 @@ exit by killing the buffer with \\[org-edit-src-exit]." | |||
| 5585 | (beginning-of-line 1) | 5619 | (beginning-of-line 1) |
| 5586 | (if (looking-at "[ \t]*[^:\n \t]") | 5620 | (if (looking-at "[ \t]*[^:\n \t]") |
| 5587 | nil | 5621 | nil |
| 5588 | (if (looking-at "[ \t]*\\(\n\\|\\'\\)]") | 5622 | (if (looking-at "[ \t]*\\(\n\\|\\'\\)") |
| 5589 | (setq beg (point) end (match-end 0)) | 5623 | (setq beg (point) end beg) |
| 5590 | (save-excursion | 5624 | (save-excursion |
| 5591 | (if (re-search-backward "^[ \t]*[^:]" nil 'move) | 5625 | (if (re-search-backward "^[ \t]*[^:]" nil 'move) |
| 5592 | (setq beg (point-at-bol 2)) | 5626 | (setq beg (point-at-bol 2)) |
| @@ -5595,32 +5629,32 @@ exit by killing the buffer with \\[org-edit-src-exit]." | |||
| 5595 | (if (re-search-forward "^[ \t]*[^:]" nil 'move) | 5629 | (if (re-search-forward "^[ \t]*[^:]" nil 'move) |
| 5596 | (setq end (1- (match-beginning 0))) | 5630 | (setq end (1- (match-beginning 0))) |
| 5597 | (setq end (point)))) | 5631 | (setq end (point)))) |
| 5598 | (goto-line line) | 5632 | (goto-line line)) |
| 5599 | (if (get-buffer "*Org Edit Picture*") | 5633 | (if (get-buffer "*Org Edit Picture*") |
| 5600 | (kill-buffer "*Org Edit Picture*")) | 5634 | (kill-buffer "*Org Edit Picture*")) |
| 5601 | (switch-to-buffer (make-indirect-buffer (current-buffer) | 5635 | (switch-to-buffer (make-indirect-buffer (current-buffer) |
| 5602 | "*Org Edit Picture*")) | 5636 | "*Org Edit Picture*")) |
| 5603 | (narrow-to-region beg end) | 5637 | (narrow-to-region beg end) |
| 5604 | (remove-text-properties beg end '(display nil invisible nil | 5638 | (remove-text-properties beg end '(display nil invisible nil |
| 5605 | intangible nil)) | 5639 | intangible nil)) |
| 5606 | (when (fboundp 'font-lock-unfontify-region) | 5640 | (when (fboundp 'font-lock-unfontify-region) |
| 5607 | (font-lock-unfontify-region (point-min) (point-max))) | 5641 | (font-lock-unfontify-region (point-min) (point-max))) |
| 5608 | (cond | 5642 | (cond |
| 5609 | ((eq org-edit-fixed-width-region-mode 'artist-mode) | 5643 | ((eq org-edit-fixed-width-region-mode 'artist-mode) |
| 5610 | (fundamental-mode) | 5644 | (fundamental-mode) |
| 5611 | (artist-mode 1)) | 5645 | (artist-mode 1)) |
| 5612 | (t (funcall org-edit-fixed-width-region-mode))) | 5646 | (t (funcall org-edit-fixed-width-region-mode))) |
| 5613 | (set (make-local-variable 'org-edit-src-force-single-line) nil) | 5647 | (set (make-local-variable 'org-edit-src-force-single-line) nil) |
| 5614 | (set (make-local-variable 'org-edit-src-from-org-mode) org-mode-p) | 5648 | (set (make-local-variable 'org-edit-src-from-org-mode) org-mode-p) |
| 5615 | (set (make-local-variable 'org-edit-src-picture) t) | 5649 | (set (make-local-variable 'org-edit-src-picture) t) |
| 5616 | (goto-char (point-min)) | 5650 | (goto-char (point-min)) |
| 5617 | (while (re-search-forward "^[ \t]*: " nil t) | 5651 | (while (re-search-forward "^[ \t]*: ?" nil t) |
| 5618 | (replace-match "")) | 5652 | (replace-match "")) |
| 5619 | (goto-line line) | 5653 | (goto-line line) |
| 5620 | (org-exit-edit-mode) | 5654 | (org-exit-edit-mode) |
| 5621 | (org-set-local 'header-line-format msg) | 5655 | (org-set-local 'header-line-format msg) |
| 5622 | (message "%s" msg) | 5656 | (message "%s" msg) |
| 5623 | t)))) | 5657 | t))) |
| 5624 | 5658 | ||
| 5625 | 5659 | ||
| 5626 | (defun org-edit-src-find-region-and-lang () | 5660 | (defun org-edit-src-find-region-and-lang () |
| @@ -5684,7 +5718,7 @@ the language, a switch telling of the content should be in a single line." | |||
| 5684 | (string-match "\\<style=\"\\([^ \t\n\"]+\\)\"" m)) | 5718 | (string-match "\\<style=\"\\([^ \t\n\"]+\\)\"" m)) |
| 5685 | (match-string 1 m)) | 5719 | (match-string 1 m)) |
| 5686 | (t "fundamental")))) | 5720 | (t "fundamental")))) |
| 5687 | 5721 | ||
| 5688 | (defun org-edit-src-exit () | 5722 | (defun org-edit-src-exit () |
| 5689 | "Exit special edit and protect problematic lines." | 5723 | "Exit special edit and protect problematic lines." |
| 5690 | (interactive) | 5724 | (interactive) |
| @@ -5711,6 +5745,7 @@ the language, a switch telling of the content should be in a single line." | |||
| 5711 | (font-lock-unfontify-region (point-min) (point-max))) | 5745 | (font-lock-unfontify-region (point-min) (point-max))) |
| 5712 | (put-text-property (point-min) (point-max) 'font-lock-fontified t)) | 5746 | (put-text-property (point-min) (point-max) 'font-lock-fontified t)) |
| 5713 | (when (org-bound-and-true-p org-edit-src-picture) | 5747 | (when (org-bound-and-true-p org-edit-src-picture) |
| 5748 | (untabify (point-min) (point-max)) | ||
| 5714 | (goto-char (point-min)) | 5749 | (goto-char (point-min)) |
| 5715 | (while (re-search-forward "^" nil t) | 5750 | (while (re-search-forward "^" nil t) |
| 5716 | (replace-match ": ")) | 5751 | (replace-match ": ")) |
| @@ -5819,6 +5854,8 @@ off orgstruct-mode will *not* remove these additional settings." | |||
| 5819 | '([(meta shift right)] org-shiftmetaright) | 5854 | '([(meta shift right)] org-shiftmetaright) |
| 5820 | '([(shift up)] org-shiftup) | 5855 | '([(shift up)] org-shiftup) |
| 5821 | '([(shift down)] org-shiftdown) | 5856 | '([(shift down)] org-shiftdown) |
| 5857 | '([(shift left)] org-shiftleft) | ||
| 5858 | '([(shift right)] org-shiftright) | ||
| 5822 | '("\C-c\C-c" org-ctrl-c-ctrl-c) | 5859 | '("\C-c\C-c" org-ctrl-c-ctrl-c) |
| 5823 | '("\M-q" fill-paragraph) | 5860 | '("\M-q" fill-paragraph) |
| 5824 | '("\C-c^" org-sort) | 5861 | '("\C-c^" org-sort) |
| @@ -5975,6 +6012,8 @@ Possible values in the list of contexts are `table', `headline', and `item'." | |||
| 5975 | (cond | 6012 | (cond |
| 5976 | ((symbolp rpl) (funcall rpl tag)) | 6013 | ((symbolp rpl) (funcall rpl tag)) |
| 5977 | ((string-match "%s" rpl) (replace-match (or tag "") t t rpl)) | 6014 | ((string-match "%s" rpl) (replace-match (or tag "") t t rpl)) |
| 6015 | ((string-match "%h" rpl) | ||
| 6016 | (replace-match (url-hexify-string (or tag "")) t t rpl)) | ||
| 5978 | (t (concat rpl tag))))) | 6017 | (t (concat rpl tag))))) |
| 5979 | link)) | 6018 | link)) |
| 5980 | 6019 | ||
| @@ -6049,7 +6088,7 @@ This link is added to `org-stored-links' and can later be inserted | |||
| 6049 | into an org-buffer with \\[org-insert-link]. | 6088 | into an org-buffer with \\[org-insert-link]. |
| 6050 | 6089 | ||
| 6051 | For some link types, a prefix arg is interpreted: | 6090 | For some link types, a prefix arg is interpreted: |
| 6052 | For links to usenet articles, arg negates `org-usenet-links-prefer-google'. | 6091 | For links to usenet articles, arg negates `org-gnus-prefer-web-links'. |
| 6053 | For file links, arg negates `org-context-in-file-links'." | 6092 | For file links, arg negates `org-context-in-file-links'." |
| 6054 | (interactive "P") | 6093 | (interactive "P") |
| 6055 | (org-load-modules-maybe) | 6094 | (org-load-modules-maybe) |
| @@ -6287,7 +6326,7 @@ This is the list that is used for internal purposes.") | |||
| 6287 | This is the list that is used before handing over to the browser.") | 6326 | This is the list that is used before handing over to the browser.") |
| 6288 | 6327 | ||
| 6289 | (defun org-link-escape (text &optional table) | 6328 | (defun org-link-escape (text &optional table) |
| 6290 | "Escape characters in TEXT that are problematic for links." | 6329 | "Escape charaters in TEXT that are problematic for links." |
| 6291 | (setq table (or table org-link-escape-chars)) | 6330 | (setq table (or table org-link-escape-chars)) |
| 6292 | (when text | 6331 | (when text |
| 6293 | (let ((re (mapconcat (lambda (x) (regexp-quote | 6332 | (let ((re (mapconcat (lambda (x) (regexp-quote |
| @@ -6485,7 +6524,7 @@ used as the link location instead of reading one interactively." | |||
| 6485 | ;; Check if we are linking to the current file with a search option | 6524 | ;; Check if we are linking to the current file with a search option |
| 6486 | ;; If yes, simplify the link by using only the search option. | 6525 | ;; If yes, simplify the link by using only the search option. |
| 6487 | (when (and buffer-file-name | 6526 | (when (and buffer-file-name |
| 6488 | (string-match "\\<file:\\(.+?\\)::\\([^>]+\\)" link)) | 6527 | (string-match "^file:\\(.+?\\)::\\([^>]+\\)" link)) |
| 6489 | (let* ((path (match-string 1 link)) | 6528 | (let* ((path (match-string 1 link)) |
| 6490 | (case-fold-search nil) | 6529 | (case-fold-search nil) |
| 6491 | (search (match-string 2 link))) | 6530 | (search (match-string 2 link))) |
| @@ -6495,7 +6534,7 @@ used as the link location instead of reading one interactively." | |||
| 6495 | (setq link search))))) | 6534 | (setq link search))))) |
| 6496 | 6535 | ||
| 6497 | ;; Check if we can/should use a relative path. If yes, simplify the link | 6536 | ;; Check if we can/should use a relative path. If yes, simplify the link |
| 6498 | (when (string-match "\\<file:\\(.*\\)" link) | 6537 | (when (string-match "^file:\\(.*\\)" link) |
| 6499 | (let* ((path (match-string 1 link)) | 6538 | (let* ((path (match-string 1 link)) |
| 6500 | (origpath path) | 6539 | (origpath path) |
| 6501 | (case-fold-search nil)) | 6540 | (case-fold-search nil)) |
| @@ -6534,6 +6573,15 @@ used as the link location instead of reading one interactively." | |||
| 6534 | (let ((minibuffer-local-completion-map | 6573 | (let ((minibuffer-local-completion-map |
| 6535 | (copy-keymap minibuffer-local-completion-map))) | 6574 | (copy-keymap minibuffer-local-completion-map))) |
| 6536 | (org-defkey minibuffer-local-completion-map " " 'self-insert-command) | 6575 | (org-defkey minibuffer-local-completion-map " " 'self-insert-command) |
| 6576 | (apply 'org-ido-completing-read args))) | ||
| 6577 | |||
| 6578 | (defun org-ido-completing-read (&rest args) | ||
| 6579 | "Completing-read using `ido-mode' speedups if available" | ||
| 6580 | (if (and org-completion-use-ido | ||
| 6581 | (fboundp 'ido-completing-read) | ||
| 6582 | (boundp 'ido-mode) ido-mode | ||
| 6583 | (listp (second args))) | ||
| 6584 | (apply 'ido-completing-read (concat (car args)) (cdr args)) | ||
| 6537 | (apply 'completing-read args))) | 6585 | (apply 'completing-read args))) |
| 6538 | 6586 | ||
| 6539 | (defun org-extract-attributes (s) | 6587 | (defun org-extract-attributes (s) |
| @@ -6601,6 +6649,39 @@ If the link is in hidden text, expose it." | |||
| 6601 | (setq org-link-search-failed t) | 6649 | (setq org-link-search-failed t) |
| 6602 | (error "No further link found")))) | 6650 | (error "No further link found")))) |
| 6603 | 6651 | ||
| 6652 | (defun org-translate-link (s) | ||
| 6653 | "Translate a link string if a translation function has been defined." | ||
| 6654 | (if (and org-link-translation-function | ||
| 6655 | (fboundp org-link-translation-function) | ||
| 6656 | (string-match "\\([a-zA-Z0-9]+\\):\\(.*\\)" s)) | ||
| 6657 | (progn | ||
| 6658 | (setq s (funcall org-link-translation-function | ||
| 6659 | (match-string 1) (match-string 2))) | ||
| 6660 | (concat (car s) ":" (cdr s))) | ||
| 6661 | s)) | ||
| 6662 | |||
| 6663 | (defun org-translate-link-from-planner (type path) | ||
| 6664 | "Translate a link from Emacs Planner syntax so that Org can follow it. | ||
| 6665 | This is still an experimental function, your mileage may vary." | ||
| 6666 | (cond | ||
| 6667 | ((member type '("http" "https" "news" "ftp")) | ||
| 6668 | ;; standard Internet links are the same. | ||
| 6669 | nil) | ||
| 6670 | ((and (equal type "irc") (string-match "^//" path)) | ||
| 6671 | ;; Planner has two / at the beginning of an irc link, we have 1. | ||
| 6672 | ;; We should have zero, actually.... | ||
| 6673 | (setq path (substring path 1))) | ||
| 6674 | ((and (equal type "lisp") (string-match "^/" path)) | ||
| 6675 | ;; Planner has a slash, we do not. | ||
| 6676 | (setq type "elisp" path (substring path 1))) | ||
| 6677 | ((string-match "^//\\(.?*\\)/\\(<.*>\\)$" path) | ||
| 6678 | ;; A typical message link. Planner has the id after the fina slash, | ||
| 6679 | ;; we separate it with a hash mark | ||
| 6680 | (setq path (concat (match-string 1 path) "#" | ||
| 6681 | (org-remove-angle-brackets (match-string 2 path))))) | ||
| 6682 | ) | ||
| 6683 | (cons type path)) | ||
| 6684 | |||
| 6604 | (defun org-find-file-at-mouse (ev) | 6685 | (defun org-find-file-at-mouse (ev) |
| 6605 | "Open file link or URL at mouse." | 6686 | "Open file link or URL at mouse." |
| 6606 | (interactive "e") | 6687 | (interactive "e") |
| @@ -6611,6 +6692,8 @@ If the link is in hidden text, expose it." | |||
| 6611 | "Open file link or URL at mouse." | 6692 | "Open file link or URL at mouse." |
| 6612 | (interactive "e") | 6693 | (interactive "e") |
| 6613 | (mouse-set-point ev) | 6694 | (mouse-set-point ev) |
| 6695 | (if (eq major-mode 'org-agenda-mode) | ||
| 6696 | (org-agenda-copy-local-variable 'org-link-abbrev-alist-local)) | ||
| 6614 | (org-open-at-point)) | 6697 | (org-open-at-point)) |
| 6615 | 6698 | ||
| 6616 | (defvar org-window-config-before-follow-link nil | 6699 | (defvar org-window-config-before-follow-link nil |
| @@ -6668,7 +6751,7 @@ application the system uses for this file type." | |||
| 6668 | ((or (file-name-absolute-p link) | 6751 | ((or (file-name-absolute-p link) |
| 6669 | (string-match "^\\.\\.?/" link)) | 6752 | (string-match "^\\.\\.?/" link)) |
| 6670 | (setq type "file" path link)) | 6753 | (setq type "file" path link)) |
| 6671 | ((string-match org-link-re-with-space2 link) | 6754 | ((string-match org-link-re-with-space3 link) |
| 6672 | (setq type (match-string 1 link) path (match-string 2 link))) | 6755 | (setq type (match-string 1 link) path (match-string 2 link))) |
| 6673 | (t (setq type "thisfile" path link))) | 6756 | (t (setq type "thisfile" path link))) |
| 6674 | (throw 'match t))) | 6757 | (throw 'match t))) |
| @@ -6703,6 +6786,11 @@ application the system uses for this file type." | |||
| 6703 | ;; Remove any trailing spaces in path | 6786 | ;; Remove any trailing spaces in path |
| 6704 | (if (string-match " +\\'" path) | 6787 | (if (string-match " +\\'" path) |
| 6705 | (setq path (replace-match "" t t path))) | 6788 | (setq path (replace-match "" t t path))) |
| 6789 | (if (and org-link-translation-function | ||
| 6790 | (fboundp org-link-translation-function)) | ||
| 6791 | ;; Check if we need to translate the link | ||
| 6792 | (let ((tmp (funcall org-link-translation-function type path))) | ||
| 6793 | (setq type (car tmp) path (cdr tmp)))) | ||
| 6706 | 6794 | ||
| 6707 | (cond | 6795 | (cond |
| 6708 | 6796 | ||
| @@ -6787,7 +6875,10 @@ application the system uses for this file type." | |||
| 6787 | (format "Execute \"%s\" as elisp? " | 6875 | (format "Execute \"%s\" as elisp? " |
| 6788 | (org-add-props cmd nil | 6876 | (org-add-props cmd nil |
| 6789 | 'face 'org-warning)))) | 6877 | 'face 'org-warning)))) |
| 6790 | (message "%s => %s" cmd (eval (read cmd))) | 6878 | (message "%s => %s" cmd |
| 6879 | (if (equal (string-to-char cmd) ?\() | ||
| 6880 | (eval (read cmd)) | ||
| 6881 | (call-interactively (read cmd)))) | ||
| 6791 | (error "Abort")))) | 6882 | (error "Abort")))) |
| 6792 | 6883 | ||
| 6793 | (t | 6884 | (t |
| @@ -7311,7 +7402,7 @@ on the system \"/user@host:\"." | |||
| 7311 | (while (string-match "/" s) | 7402 | (while (string-match "/" s) |
| 7312 | (setq s (replace-match "\\" t t s))) | 7403 | (setq s (replace-match "\\" t t s))) |
| 7313 | s) | 7404 | s) |
| 7314 | 7405 | ||
| 7315 | (defun org-get-outline-path () | 7406 | (defun org-get-outline-path () |
| 7316 | "Return the outline path to the current entry, as a list." | 7407 | "Return the outline path to the current entry, as a list." |
| 7317 | (let (rtn) | 7408 | (let (rtn) |
| @@ -7415,7 +7506,7 @@ operation has put the subtree." | |||
| 7415 | (let* ((cbuf (current-buffer)) | 7506 | (let* ((cbuf (current-buffer)) |
| 7416 | (cfunc (if org-refile-use-outline-path | 7507 | (cfunc (if org-refile-use-outline-path |
| 7417 | 'org-olpath-completing-read | 7508 | 'org-olpath-completing-read |
| 7418 | 'completing-read)) | 7509 | 'org-ido-completing-read)) |
| 7419 | (extra (if org-refile-use-outline-path "/" "")) | 7510 | (extra (if org-refile-use-outline-path "/" "")) |
| 7420 | (filename (buffer-file-name (buffer-base-buffer cbuf))) | 7511 | (filename (buffer-file-name (buffer-base-buffer cbuf))) |
| 7421 | (fname (and filename (file-truename filename))) | 7512 | (fname (and filename (file-truename filename))) |
| @@ -7434,8 +7525,8 @@ operation has put the subtree." | |||
| 7434 | (defun org-olpath-completing-read (prompt collection &rest args) | 7525 | (defun org-olpath-completing-read (prompt collection &rest args) |
| 7435 | "Read an outline path like a file name." | 7526 | "Read an outline path like a file name." |
| 7436 | (let ((thetable collection)) | 7527 | (let ((thetable collection)) |
| 7437 | (apply | 7528 | (apply |
| 7438 | 'completing-read prompt | 7529 | 'org-ido-completing-read prompt |
| 7439 | (lambda (string predicate &optional flag) | 7530 | (lambda (string predicate &optional flag) |
| 7440 | (let (rtn r s f (l (length string))) | 7531 | (let (rtn r s f (l (length string))) |
| 7441 | (cond | 7532 | (cond |
| @@ -7591,7 +7682,7 @@ This function can be used in a hook." | |||
| 7591 | 7682 | ||
| 7592 | (defcustom org-structure-template-alist | 7683 | (defcustom org-structure-template-alist |
| 7593 | '( | 7684 | '( |
| 7594 | ("s" "#+begin_src ?\n\n#+end_src" | 7685 | ("s" "#+begin_src ?\n\n#+end_src" |
| 7595 | "<src lang=\"?\">\n\n</src>") | 7686 | "<src lang=\"?\">\n\n</src>") |
| 7596 | ("e" "#+begin_example\n?\n#+end_example" | 7687 | ("e" "#+begin_example\n?\n#+end_example" |
| 7597 | "<example>\n?\n</example>") | 7688 | "<example>\n?\n</example>") |
| @@ -7620,7 +7711,7 @@ for the file uning completion. | |||
| 7620 | There are two templates for each key, the first uses the original Org syntax, | 7711 | There are two templates for each key, the first uses the original Org syntax, |
| 7621 | the second uses Emacs Muse-like syntax tags. These Muse-like tags become | 7712 | the second uses Emacs Muse-like syntax tags. These Muse-like tags become |
| 7622 | the default when the /org-mtags.el/ module has been loaded. See also the | 7713 | the default when the /org-mtags.el/ module has been loaded. See also the |
| 7623 | variable `org-mtags-prefere-muse-templates'. | 7714 | variable `org-mtags-prefer-muse-templates'. |
| 7624 | This is an experimental feature, it is undecided if it is going to stay in." | 7715 | This is an experimental feature, it is undecided if it is going to stay in." |
| 7625 | :group 'org-completion | 7716 | :group 'org-completion |
| 7626 | :type '(repeat | 7717 | :type '(repeat |
| @@ -7643,7 +7734,7 @@ expands them." | |||
| 7643 | 7734 | ||
| 7644 | (defun org-complete-expand-structure-template (start cell) | 7735 | (defun org-complete-expand-structure-template (start cell) |
| 7645 | "Expand a structure template." | 7736 | "Expand a structure template." |
| 7646 | (let* ((musep (org-bound-and-true-p org-mtags-prefere-muse-templates)) | 7737 | (let* ((musep (org-bound-and-true-p org-mtags-prefer-muse-templates)) |
| 7647 | (rpl (nth (if musep 2 1) cell))) | 7738 | (rpl (nth (if musep 2 1) cell))) |
| 7648 | (delete-region start (point)) | 7739 | (delete-region start (point)) |
| 7649 | (when (string-match "\\`#\\+" rpl) | 7740 | (when (string-match "\\`#\\+" rpl) |
| @@ -7654,7 +7745,7 @@ expands them." | |||
| 7654 | (t (newline)))) | 7745 | (t (newline)))) |
| 7655 | (setq start (point)) | 7746 | (setq start (point)) |
| 7656 | (if (string-match "%file" rpl) | 7747 | (if (string-match "%file" rpl) |
| 7657 | (setq rpl (replace-match | 7748 | (setq rpl (replace-match |
| 7658 | (concat | 7749 | (concat |
| 7659 | "\"" | 7750 | "\"" |
| 7660 | (save-match-data | 7751 | (save-match-data |
| @@ -7663,7 +7754,7 @@ expands them." | |||
| 7663 | t t rpl))) | 7754 | t t rpl))) |
| 7664 | (insert rpl) | 7755 | (insert rpl) |
| 7665 | (if (re-search-backward "\\?" start t) (delete-char 1)))) | 7756 | (if (re-search-backward "\\?" start t) (delete-char 1)))) |
| 7666 | 7757 | ||
| 7667 | 7758 | ||
| 7668 | (defun org-complete (&optional arg) | 7759 | (defun org-complete (&optional arg) |
| 7669 | "Perform completion on word at point. | 7760 | "Perform completion on word at point. |
| @@ -7919,7 +8010,7 @@ For calling through lisp, arg is also interpreted in the following way: | |||
| 7919 | (or (not org-use-fast-todo-selection) | 8010 | (or (not org-use-fast-todo-selection) |
| 7920 | (not org-todo-key-trigger))) | 8011 | (not org-todo-key-trigger))) |
| 7921 | ;; Read a state with completion | 8012 | ;; Read a state with completion |
| 7922 | (completing-read "State: " (mapcar (lambda(x) (list x)) | 8013 | (org-ido-completing-read "State: " (mapcar (lambda(x) (list x)) |
| 7923 | org-todo-keywords-1) | 8014 | org-todo-keywords-1) |
| 7924 | nil t)) | 8015 | nil t)) |
| 7925 | ((eq arg 'right) | 8016 | ((eq arg 'right) |
| @@ -8069,7 +8160,7 @@ For calling through lisp, arg is also interpreted in the following way: | |||
| 8069 | (condition-case nil | 8160 | (condition-case nil |
| 8070 | (org-forward-same-level 1) | 8161 | (org-forward-same-level 1) |
| 8071 | (error (end-of-line 1))))) | 8162 | (error (end-of-line 1))))) |
| 8072 | (replace-match | 8163 | (replace-match |
| 8073 | (if is-percent | 8164 | (if is-percent |
| 8074 | (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all))) | 8165 | (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all))) |
| 8075 | (format "[%d/%d]" cnt-done cnt-all))) | 8166 | (format "[%d/%d]" cnt-done cnt-all))) |
| @@ -8106,7 +8197,7 @@ when there is a statistics cookie in the headline! | |||
| 8106 | (setq changes (append changes (cdr (assoc 'done l))))) | 8197 | (setq changes (append changes (cdr (assoc 'done l))))) |
| 8107 | (dolist (c changes) | 8198 | (dolist (c changes) |
| 8108 | (org-toggle-tag (car c) (if (cdr c) 'on 'off))))) | 8199 | (org-toggle-tag (car c) (if (cdr c) 'on 'off))))) |
| 8109 | 8200 | ||
| 8110 | (defun org-local-logging (value) | 8201 | (defun org-local-logging (value) |
| 8111 | "Get logging settings from a property VALUE." | 8202 | "Get logging settings from a property VALUE." |
| 8112 | (let* (words w a) | 8203 | (let* (words w a) |
| @@ -8329,7 +8420,7 @@ of `org-todo-keywords-1'." | |||
| 8329 | (kwd-re | 8420 | (kwd-re |
| 8330 | (cond ((null arg) org-not-done-regexp) | 8421 | (cond ((null arg) org-not-done-regexp) |
| 8331 | ((equal arg '(4)) | 8422 | ((equal arg '(4)) |
| 8332 | (let ((kwd (completing-read "Keyword (or KWD1|KWD2|...): " | 8423 | (let ((kwd (org-ido-completing-read "Keyword (or KWD1|KWD2|...): " |
| 8333 | (mapcar 'list org-todo-keywords-1)))) | 8424 | (mapcar 'list org-todo-keywords-1)))) |
| 8334 | (concat "\\(" | 8425 | (concat "\\(" |
| 8335 | (mapconcat 'identity (org-split-string kwd "|") "\\|") | 8426 | (mapconcat 'identity (org-split-string kwd "|") "\\|") |
| @@ -8507,7 +8598,7 @@ EXTRA is additional text that will be inserted into the notes buffer." | |||
| 8507 | (save-excursion | 8598 | (save-excursion |
| 8508 | (when findpos | 8599 | (when findpos |
| 8509 | (org-back-to-heading t) | 8600 | (org-back-to-heading t) |
| 8510 | (narrow-to-region (point) (save-excursion | 8601 | (narrow-to-region (point) (save-excursion |
| 8511 | (outline-next-heading) (point))) | 8602 | (outline-next-heading) (point))) |
| 8512 | (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*" | 8603 | (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*" |
| 8513 | "\\(\n[^\r\n]*?" org-keyword-time-not-clock-regexp | 8604 | "\\(\n[^\r\n]*?" org-keyword-time-not-clock-regexp |
| @@ -8641,9 +8732,9 @@ d Show deadlines due within `org-deadline-warning-days'." | |||
| 8641 | ((equal ans ?T) | 8732 | ((equal ans ?T) |
| 8642 | (call-interactively 'org-tags-sparse-tree)) | 8733 | (call-interactively 'org-tags-sparse-tree)) |
| 8643 | ((member ans '(?p ?P)) | 8734 | ((member ans '(?p ?P)) |
| 8644 | (setq kwd (completing-read "Property: " | 8735 | (setq kwd (org-ido-completing-read "Property: " |
| 8645 | (mapcar 'list (org-buffer-property-keys)))) | 8736 | (mapcar 'list (org-buffer-property-keys)))) |
| 8646 | (setq value (completing-read "Value: " | 8737 | (setq value (org-ido-completing-read "Value: " |
| 8647 | (mapcar 'list (org-property-values kwd)))) | 8738 | (mapcar 'list (org-property-values kwd)))) |
| 8648 | (unless (string-match "\\`{.*}\\'" value) | 8739 | (unless (string-match "\\`{.*}\\'" value) |
| 8649 | (setq value (concat "\"" value "\""))) | 8740 | (setq value (concat "\"" value "\""))) |
| @@ -8991,10 +9082,10 @@ only lines with a TODO keyword are included in the output." | |||
| 8991 | (defvar todo-only) ;; dynamically scoped | 9082 | (defvar todo-only) ;; dynamically scoped |
| 8992 | 9083 | ||
| 8993 | (defun org-tags-sparse-tree (&optional todo-only match) | 9084 | (defun org-tags-sparse-tree (&optional todo-only match) |
| 8994 | "Create a sparse tree according to tags string MATCH. | 9085 | "Create a sparse tree according to tags string MATCH. |
| 8995 | MATCH can contain positive and negative selection of tags, like | 9086 | MATCH can contain positive and negative selection of tags, like |
| 8996 | \"+WORK+URGENT-WITHBOSS\". | 9087 | \"+WORK+URGENT-WITHBOSS\". |
| 8997 | If optional argument TODO-ONLY is non-nil, only select lines that are | 9088 | If optional argument TODO_ONLY is non-nil, only select lines that are |
| 8998 | also TODO lines." | 9089 | also TODO lines." |
| 8999 | (interactive "P") | 9090 | (interactive "P") |
| 9000 | (org-prepare-agenda-buffers (list (current-buffer))) | 9091 | (org-prepare-agenda-buffers (list (current-buffer))) |
| @@ -9039,7 +9130,7 @@ also TODO lines." | |||
| 9039 | ;; Get a new match request, with completion | 9130 | ;; Get a new match request, with completion |
| 9040 | (let ((org-last-tags-completion-table | 9131 | (let ((org-last-tags-completion-table |
| 9041 | (org-global-tags-completion-table))) | 9132 | (org-global-tags-completion-table))) |
| 9042 | (setq match (completing-read | 9133 | (setq match (org-ido-completing-read |
| 9043 | "Match: " 'org-tags-completion-function nil nil nil | 9134 | "Match: " 'org-tags-completion-function nil nil nil |
| 9044 | 'org-tags-history)))) | 9135 | 'org-tags-history)))) |
| 9045 | 9136 | ||
| @@ -9187,11 +9278,19 @@ it as a time string and apply `float-time' to it. f S is nil, just return 0." | |||
| 9187 | (error 0.))) | 9278 | (error 0.))) |
| 9188 | (t 0.))) | 9279 | (t 0.))) |
| 9189 | 9280 | ||
| 9281 | (defun org-time-today () | ||
| 9282 | "Time in seconds today at 0:00. | ||
| 9283 | Returns the float number of seconds since the beginning of the | ||
| 9284 | epoch to the beginning of today (00:00)." | ||
| 9285 | (float-time (apply 'encode-time | ||
| 9286 | (append '(0 0 0) (nthcdr 3 (decode-time)))))) | ||
| 9287 | |||
| 9190 | (defun org-matcher-time (s) | 9288 | (defun org-matcher-time (s) |
| 9191 | (cond | 9289 | (cond |
| 9192 | ((equal s "<now>") (float-time)) | 9290 | ((string= s "<now>") (float-time)) |
| 9193 | ((equal s "<today>") | 9291 | ((string= s "<today>") (org-time-today)) |
| 9194 | (float-time (append '(0 0 0) (nthcdr 3 (decode-time))))) | 9292 | ((string= s "<tomorrow>") (+ 86400.0 (org-time-today))) |
| 9293 | ((string= s "<yesterday>") (- (org-time-today) 86400.0)) | ||
| 9195 | (t (org-2ft s)))) | 9294 | (t (org-2ft s)))) |
| 9196 | 9295 | ||
| 9197 | (defun org-match-any-p (re list) | 9296 | (defun org-match-any-p (re list) |
| @@ -9349,7 +9448,7 @@ With prefix ARG, realign all tags in headings in the current buffer." | |||
| 9349 | (let ((org-add-colon-after-tag-completion t)) | 9448 | (let ((org-add-colon-after-tag-completion t)) |
| 9350 | (org-trim | 9449 | (org-trim |
| 9351 | (org-without-partial-completion | 9450 | (org-without-partial-completion |
| 9352 | (completing-read "Tags: " 'org-tags-completion-function | 9451 | (org-ido-completing-read "Tags: " 'org-tags-completion-function |
| 9353 | nil nil current 'org-tags-history))))))) | 9452 | nil nil current 'org-tags-history))))))) |
| 9354 | (while (string-match "[-+&]+" tags) | 9453 | (while (string-match "[-+&]+" tags) |
| 9355 | ;; No boolean logic, just a list | 9454 | ;; No boolean logic, just a list |
| @@ -9392,7 +9491,7 @@ This works in the agenda, and also in an org-mode buffer." | |||
| 9392 | (if (org-mode-p) | 9491 | (if (org-mode-p) |
| 9393 | (org-get-buffer-tags) | 9492 | (org-get-buffer-tags) |
| 9394 | (org-global-tags-completion-table)))) | 9493 | (org-global-tags-completion-table)))) |
| 9395 | (completing-read | 9494 | (org-ido-completing-read |
| 9396 | "Tag: " 'org-tags-completion-function nil nil nil | 9495 | "Tag: " 'org-tags-completion-function nil nil nil |
| 9397 | 'org-tags-history)) | 9496 | 'org-tags-history)) |
| 9398 | (progn | 9497 | (progn |
| @@ -9603,7 +9702,7 @@ Returns the new tags string, or nil to not change the current settings." | |||
| 9603 | (if exit-after-next (setq exit-after-next 'now))) | 9702 | (if exit-after-next (setq exit-after-next 'now))) |
| 9604 | ((= c ?\t) | 9703 | ((= c ?\t) |
| 9605 | (condition-case nil | 9704 | (condition-case nil |
| 9606 | (setq tg (completing-read | 9705 | (setq tg (org-ido-completing-read |
| 9607 | "Tag: " | 9706 | "Tag: " |
| 9608 | (or buffer-tags | 9707 | (or buffer-tags |
| 9609 | (with-current-buffer buf | 9708 | (with-current-buffer buf |
| @@ -9738,12 +9837,12 @@ the scanner. The following items can be given here: | |||
| 9738 | ((eq match t) (setq matcher t)) | 9837 | ((eq match t) (setq matcher t)) |
| 9739 | ((eq match nil) (setq matcher t)) | 9838 | ((eq match nil) (setq matcher t)) |
| 9740 | (t (setq matcher (if match (org-make-tags-matcher match) t)))) | 9839 | (t (setq matcher (if match (org-make-tags-matcher match) t)))) |
| 9741 | 9840 | ||
| 9742 | (when (eq scope 'tree) | 9841 | (when (eq scope 'tree) |
| 9743 | (org-back-to-heading t) | 9842 | (org-back-to-heading t) |
| 9744 | (org-narrow-to-subtree) | 9843 | (org-narrow-to-subtree) |
| 9745 | (setq scope nil)) | 9844 | (setq scope nil)) |
| 9746 | 9845 | ||
| 9747 | (if (not scope) | 9846 | (if (not scope) |
| 9748 | (progn | 9847 | (progn |
| 9749 | (org-prepare-agenda-buffers | 9848 | (org-prepare-agenda-buffers |
| @@ -10078,7 +10177,7 @@ is set.") | |||
| 10078 | (move-marker org-entry-property-inherited-from (point)) | 10177 | (move-marker org-entry-property-inherited-from (point)) |
| 10079 | (throw 'ex tmp)) | 10178 | (throw 'ex tmp)) |
| 10080 | (or (org-up-heading-safe) (throw 'ex nil))))) | 10179 | (or (org-up-heading-safe) (throw 'ex nil))))) |
| 10081 | (or tmp | 10180 | (or tmp |
| 10082 | (cdr (assoc property org-file-properties)) | 10181 | (cdr (assoc property org-file-properties)) |
| 10083 | (cdr (assoc property org-global-properties)) | 10182 | (cdr (assoc property org-global-properties)) |
| 10084 | (cdr (assoc property org-global-properties-fixed)))))) | 10183 | (cdr (assoc property org-global-properties-fixed)))))) |
| @@ -10239,7 +10338,7 @@ in the current file." | |||
| 10239 | (interactive | 10338 | (interactive |
| 10240 | (let* ((completion-ignore-case t) | 10339 | (let* ((completion-ignore-case t) |
| 10241 | (keys (org-buffer-property-keys nil t t)) | 10340 | (keys (org-buffer-property-keys nil t t)) |
| 10242 | (prop0 (completing-read "Property: " (mapcar 'list keys))) | 10341 | (prop0 (org-ido-completing-read "Property: " (mapcar 'list keys))) |
| 10243 | (prop (if (member prop0 keys) | 10342 | (prop (if (member prop0 keys) |
| 10244 | prop0 | 10343 | prop0 |
| 10245 | (or (cdr (assoc (downcase prop0) | 10344 | (or (cdr (assoc (downcase prop0) |
| @@ -10264,7 +10363,7 @@ in the current file." | |||
| 10264 | "In the current entry, delete PROPERTY." | 10363 | "In the current entry, delete PROPERTY." |
| 10265 | (interactive | 10364 | (interactive |
| 10266 | (let* ((completion-ignore-case t) | 10365 | (let* ((completion-ignore-case t) |
| 10267 | (prop (completing-read | 10366 | (prop (org-ido-completing-read |
| 10268 | "Property: " (org-entry-properties nil 'standard)))) | 10367 | "Property: " (org-entry-properties nil 'standard)))) |
| 10269 | (list prop))) | 10368 | (list prop))) |
| 10270 | (message "Property %s %s" property | 10369 | (message "Property %s %s" property |
| @@ -10276,7 +10375,7 @@ in the current file." | |||
| 10276 | "Remove PROPERTY globally, from all entries." | 10375 | "Remove PROPERTY globally, from all entries." |
| 10277 | (interactive | 10376 | (interactive |
| 10278 | (let* ((completion-ignore-case t) | 10377 | (let* ((completion-ignore-case t) |
| 10279 | (prop (completing-read | 10378 | (prop (org-ido-completing-read |
| 10280 | "Globally remove property: " | 10379 | "Globally remove property: " |
| 10281 | (mapcar 'list (org-buffer-property-keys))))) | 10380 | (mapcar 'list (org-buffer-property-keys))))) |
| 10282 | (list prop))) | 10381 | (list prop))) |
| @@ -11129,7 +11228,7 @@ days in order to avoid rounding problems." | |||
| 11129 | "Convert a time stamp to an absolute day number. | 11228 | "Convert a time stamp to an absolute day number. |
| 11130 | If there is a specifyer for a cyclic time stamp, get the closest date to | 11229 | If there is a specifyer for a cyclic time stamp, get the closest date to |
| 11131 | DAYNR. | 11230 | DAYNR. |
| 11132 | PREFER and SHOW-ALL are passed through to `org-closest-date'." | 11231 | PREFER and SHOW_ALL are passed through to `org-closest-date'." |
| 11133 | (cond | 11232 | (cond |
| 11134 | ((and daynr (string-match "\\`%%\\((.*)\\)" s)) | 11233 | ((and daynr (string-match "\\`%%\\((.*)\\)" s)) |
| 11135 | (if (org-diary-sexp-entry (match-string 1 s) "" date) | 11234 | (if (org-diary-sexp-entry (match-string 1 s) "" date) |
| @@ -11149,8 +11248,8 @@ PREFER and SHOW-ALL are passed through to `org-closest-date'." | |||
| 11149 | (defun org-small-year-to-year (year) | 11248 | (defun org-small-year-to-year (year) |
| 11150 | "Convert 2-digit years into 4-digit years. | 11249 | "Convert 2-digit years into 4-digit years. |
| 11151 | 38-99 are mapped into 1938-1999. 1-37 are mapped into 2001-2007. | 11250 | 38-99 are mapped into 1938-1999. 1-37 are mapped into 2001-2007. |
| 11152 | The year 2000 cannot be abbreviated. Any year larger than 99 | 11251 | The year 2000 cannot be abbreviated. Any year lager than 99 |
| 11153 | is returned unchanged." | 11252 | is retrned unchanged." |
| 11154 | (if (< year 38) | 11253 | (if (< year 38) |
| 11155 | (setq year (+ 2000 year)) | 11254 | (setq year (+ 2000 year)) |
| 11156 | (if (< year 100) | 11255 | (if (< year 100) |
| @@ -11600,11 +11699,11 @@ If EXCLUDE-TMP is non-nil, ignore temporary buffers." | |||
| 11600 | (lambda (b) (string-match "\*Org .*Export" (buffer-name b)))) | 11699 | (lambda (b) (string-match "\*Org .*Export" (buffer-name b)))) |
| 11601 | ((eq predicate 'agenda) | 11700 | ((eq predicate 'agenda) |
| 11602 | (lambda (b) | 11701 | (lambda (b) |
| 11603 | (with-current-buffer b | 11702 | (with-current-buffer b |
| 11604 | (and (eq major-mode 'org-mode) | 11703 | (and (eq major-mode 'org-mode) |
| 11605 | (setq bfn (buffer-file-name b)) | 11704 | (setq bfn (buffer-file-name b)) |
| 11606 | (member (file-truename bfn) agenda-files))))) | 11705 | (member (file-truename bfn) agenda-files))))) |
| 11607 | (t (lambda (b) (with-current-buffer b | 11706 | (t (lambda (b) (with-current-buffer b |
| 11608 | (or (eq major-mode 'org-mode) | 11707 | (or (eq major-mode 'org-mode) |
| 11609 | (string-match "\*Org .*Export" | 11708 | (string-match "\*Org .*Export" |
| 11610 | (buffer-name b))))))))) | 11709 | (buffer-name b))))))))) |
| @@ -11822,7 +11921,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved | |||
| 11822 | (append org-done-keywords-for-agenda org-done-keywords)) | 11921 | (append org-done-keywords-for-agenda org-done-keywords)) |
| 11823 | (setq org-todo-keyword-alist-for-agenda | 11922 | (setq org-todo-keyword-alist-for-agenda |
| 11824 | (append org-todo-keyword-alist-for-agenda org-todo-key-alist)) | 11923 | (append org-todo-keyword-alist-for-agenda org-todo-key-alist)) |
| 11825 | (setq org-tag-alist-for-agenda | 11924 | (setq org-tag-alist-for-agenda |
| 11826 | (append org-tag-alist-for-agenda org-tag-alist)) | 11925 | (append org-tag-alist-for-agenda org-tag-alist)) |
| 11827 | 11926 | ||
| 11828 | (save-excursion | 11927 | (save-excursion |
| @@ -12574,7 +12673,14 @@ depending on context. See the individual commands for more information." | |||
| 12574 | (t (call-interactively 'org-next-item)))) | 12673 | (t (call-interactively 'org-next-item)))) |
| 12575 | 12674 | ||
| 12576 | (defun org-shiftright (&optional arg) | 12675 | (defun org-shiftright (&optional arg) |
| 12577 | "Next TODO keyword or timestamp one day later, depending on context." | 12676 | "Cycle the thing at point or in the current line, depending on context. |
| 12677 | Depending on context, this does one of the following: | ||
| 12678 | |||
| 12679 | - switch a timestamp at point one day into the future | ||
| 12680 | - on a headline, switch to the next TODO keyword. | ||
| 12681 | - on an item, switch entire list to the next bullet type | ||
| 12682 | - on a property line, switch to the next allowed value | ||
| 12683 | - on a clocktable definition line, move time block into the future" | ||
| 12578 | (interactive "P") | 12684 | (interactive "P") |
| 12579 | (cond | 12685 | (cond |
| 12580 | ((org-at-timestamp-p t) (call-interactively 'org-timestamp-up-day)) | 12686 | ((org-at-timestamp-p t) (call-interactively 'org-timestamp-up-day)) |
| @@ -12585,7 +12691,14 @@ depending on context. See the individual commands for more information." | |||
| 12585 | (t (org-shiftcursor-error)))) | 12691 | (t (org-shiftcursor-error)))) |
| 12586 | 12692 | ||
| 12587 | (defun org-shiftleft (&optional arg) | 12693 | (defun org-shiftleft (&optional arg) |
| 12588 | "Previous TODO keyword or timestamp one day earlier, depending on context." | 12694 | "Cycle the thing at point or in the current line, depending on context. |
| 12695 | Depending on context, this does one of the following: | ||
| 12696 | |||
| 12697 | - switch a timestamp at point one day into the past | ||
| 12698 | - on a headline, switch to the previous TODO keyword. | ||
| 12699 | - on an item, switch entire list to the previous bullet type | ||
| 12700 | - on a property line, switch to the previous allowed value | ||
| 12701 | - on a clocktable definition line, move time block into the past" | ||
| 12589 | (interactive "P") | 12702 | (interactive "P") |
| 12590 | (cond | 12703 | (cond |
| 12591 | ((org-at-timestamp-p t) (call-interactively 'org-timestamp-down-day)) | 12704 | ((org-at-timestamp-p t) (call-interactively 'org-timestamp-down-day)) |
| @@ -13845,7 +13958,7 @@ work correctly." | |||
| 13845 | (goto-char (+ (match-beginning 1) 5)) | 13958 | (goto-char (+ (match-beginning 1) 5)) |
| 13846 | (goto-char (match-end 0))) | 13959 | (goto-char (match-end 0))) |
| 13847 | (make-string (current-column) ?\ ))) | 13960 | (make-string (current-column) ?\ ))) |
| 13848 | ((looking-at "[ \t]*\\([-*+] \\|[0-9]+[.)] \\)?") | 13961 | ((looking-at "[ \t]*\\([-*+] \\|[0-9]+[.)] ?\\)?") |
| 13849 | (save-excursion | 13962 | (save-excursion |
| 13850 | (goto-char (match-end 0)) | 13963 | (goto-char (match-end 0)) |
| 13851 | (make-string (current-column) ?\ ))) | 13964 | (make-string (current-column) ?\ ))) |
| @@ -14011,13 +14124,14 @@ plainly yank the text as it is. | |||
| 14011 | \[1] Basically, the test checks if the first non-white line is a heading | 14124 | \[1] Basically, the test checks if the first non-white line is a heading |
| 14012 | and if there are no other headings with fewer stars." | 14125 | and if there are no other headings with fewer stars." |
| 14013 | (interactive "P") | 14126 | (interactive "P") |
| 14127 | (setq this-command 'yank) | ||
| 14014 | (if arg | 14128 | (if arg |
| 14015 | (call-interactively 'yank) | 14129 | (call-interactively 'yank) |
| 14016 | (let ((subtreep ; is kill a subtree, and the yank position appropriate? | 14130 | (let ((subtreep ; is kill a subtree, and the yank position appropriate? |
| 14017 | (and (org-kill-is-subtree-p) | 14131 | (and (org-kill-is-subtree-p) |
| 14018 | (or (bolp) | 14132 | (or (bolp) |
| 14019 | (and (looking-at "[ \t]*$") | 14133 | (and (looking-at "[ \t]*$") |
| 14020 | (string-match | 14134 | (string-match |
| 14021 | "\\`\\*+\\'" | 14135 | "\\`\\*+\\'" |
| 14022 | (buffer-substring (point-at-bol) (point))))))) | 14136 | (buffer-substring (point-at-bol) (point))))))) |
| 14023 | swallowp) | 14137 | swallowp) |
| @@ -14046,12 +14160,15 @@ plainly yank the text as it is. | |||
| 14046 | "Yanked text not folded because that would swallow text")) | 14160 | "Yanked text not folded because that would swallow text")) |
| 14047 | (goto-char end) | 14161 | (goto-char end) |
| 14048 | (skip-chars-forward " \t\n\r") | 14162 | (skip-chars-forward " \t\n\r") |
| 14049 | (beginning-of-line 1))) | 14163 | (beginning-of-line 1) |
| 14164 | (push-mark beg 'nomsg))) | ||
| 14050 | ((and subtreep org-yank-adjusted-subtrees) | 14165 | ((and subtreep org-yank-adjusted-subtrees) |
| 14051 | (org-paste-subtree nil nil 'for-yank)) | 14166 | (let ((beg (point-at-bol))) |
| 14167 | (org-paste-subtree nil nil 'for-yank) | ||
| 14168 | (push-mark beg 'nomsg))) | ||
| 14052 | (t | 14169 | (t |
| 14053 | (call-interactively 'yank)))))) | 14170 | (call-interactively 'yank)))))) |
| 14054 | 14171 | ||
| 14055 | (defun org-yank-folding-would-swallow-text (beg end) | 14172 | (defun org-yank-folding-would-swallow-text (beg end) |
| 14056 | "Would hide-subtree at BEG swallow any text after END?" | 14173 | "Would hide-subtree at BEG swallow any text after END?" |
| 14057 | (let (level) | 14174 | (let (level) |
| @@ -14086,7 +14203,13 @@ plainly yank the text as it is. | |||
| 14086 | (outline-invisible-p) | 14203 | (outline-invisible-p) |
| 14087 | (get-char-property (point) 'invisible)))) | 14204 | (get-char-property (point) 'invisible)))) |
| 14088 | 14205 | ||
| 14089 | (defalias 'org-back-to-heading 'outline-back-to-heading) | 14206 | (defun org-back-to-heading (&optional invisible-ok) |
| 14207 | "Call `outline-back-to-heading', but provide a better error message." | ||
| 14208 | (condition-case nil | ||
| 14209 | (outline-back-to-heading invisible-ok) | ||
| 14210 | (error (error "Before first headline at position %d in buffer %s" | ||
| 14211 | (point) (current-buffer))))) | ||
| 14212 | |||
| 14090 | (defalias 'org-on-heading-p 'outline-on-heading-p) | 14213 | (defalias 'org-on-heading-p 'outline-on-heading-p) |
| 14091 | (defalias 'org-at-heading-p 'outline-on-heading-p) | 14214 | (defalias 'org-at-heading-p 'outline-on-heading-p) |
| 14092 | (defun org-at-heading-or-item-p () | 14215 | (defun org-at-heading-or-item-p () |
| @@ -14111,7 +14234,7 @@ headline found, or nil if no higher level is found." | |||
| 14111 | (let ((pos (point)) start-level level | 14234 | (let ((pos (point)) start-level level |
| 14112 | (re (concat "^" outline-regexp))) | 14235 | (re (concat "^" outline-regexp))) |
| 14113 | (catch 'exit | 14236 | (catch 'exit |
| 14114 | (outline-back-to-heading t) | 14237 | (org-back-to-heading t) |
| 14115 | (setq start-level (funcall outline-level)) | 14238 | (setq start-level (funcall outline-level)) |
| 14116 | (if (equal start-level 1) (throw 'exit nil)) | 14239 | (if (equal start-level 1) (throw 'exit nil)) |
| 14117 | (while (re-search-backward re nil t) | 14240 | (while (re-search-backward re nil t) |
| @@ -14187,7 +14310,7 @@ When ENTRY is non-nil, show the entire entry." | |||
| 14187 | Stop at the first and last subheadings of a superior heading. | 14310 | Stop at the first and last subheadings of a superior heading. |
| 14188 | This is like outline-forward-same-level, but invisible headings are ok." | 14311 | This is like outline-forward-same-level, but invisible headings are ok." |
| 14189 | (interactive "p") | 14312 | (interactive "p") |
| 14190 | (outline-back-to-heading t) | 14313 | (org-back-to-heading t) |
| 14191 | (while (> arg 0) | 14314 | (while (> arg 0) |
| 14192 | (let ((point-to-move-to (save-excursion | 14315 | (let ((point-to-move-to (save-excursion |
| 14193 | (org-get-next-sibling)))) | 14316 | (org-get-next-sibling)))) |