diff options
| author | Carsten Dominik | 2008-12-07 18:36:02 +0000 |
|---|---|---|
| committer | Carsten Dominik | 2008-12-07 18:36:02 +0000 |
| commit | ff4be292b376c5a753c2da6a33ea291464820fae (patch) | |
| tree | ade4a68dc60c3c899e9d3480de61b4087aad7f36 | |
| parent | 243de2b47c3f0f60696bc6ce5a04c2d0b9b9580a (diff) | |
| download | emacs-ff4be292b376c5a753c2da6a33ea291464820fae.tar.gz emacs-ff4be292b376c5a753c2da6a33ea291464820fae.zip | |
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-id.el (org-id-locations-file): Wrap file name with
`convert-standard-filename'.
(org-id-files): New variable.
(org-id-use-hash): New option.
(org-id-update-id-locations): Also search in all files current
listed in `org-id-files'. Convert the resulting alist to a hash
if the user customation says so.
(org-id-locations-save): Handle he case if `org-id-locations' is a
hash.
(org-id-locations-load): Convert the alist to a hash.
(org-id-add-location): Handle the hast case.
(kill-emacs-hook): Make sure id locations are saved when Emacs is
exited.
(org-id-hash-to-alist, org-id-alist-to-hash)
(org-id-paste-tracker): New functions.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-agenda.el (org-agenda-goto-calendar): Remove duplicate let
bindings of calendar variables.
* org-table.el (org-table-find-row-type): Renamed from
`org-find-row-type'.
(org-table-rewrite-old-row-references): Renamed from
`org-rewrite-old-row-references'.
(org-table-shift-refpart): Renamed from `org-shift-refpart'.
(org-table-cleanup-narrow-column-properties): Renamed from
`org-cleanup-narrow-column-properties'.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-table.el (org-find-row-type): New arguments DESC and CLINE,
for better error messages.
(org-table-get-descriptor-line): Supply the new arguments to
`org-find-row-type'.
(org-table-error-on-row-ref-crossing-hline): New option.
* org.el (org-target-link-regexp): Make buffer-local.
(org-move-subtree-down): Fix bug with trees at beginning of
buffer.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-faces.el (org-set-tag-faces): New function.
(org-tags-special-faces-re): New variable.
* org.el (org-font-lock-add-tag-faces, org-get-tag-face): New functions.
* org-faces.el (org-tag-faces): New option.
(org-tag): Mention `org-tag-faces' in the docstring.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-exp.el (org-export-html-style-default): Implement new
quoting.
* org-jsinfo.el (org-infojs-template): Implement new quoting.
* org-w3m.el (w3m-minor-mode-hook): Also add the special copy
command to the `w3m-minor-mode-map'.
* org-archive.el (org-archive-to-archive-sibling): Protect
`this-command' to avoid appending kills during archiving.
* org-exp.el (org-export-with-priority): New variable.
(org-export-add-options-to-plist): Use `org-export-plist-vars'
instead of internal list of strings and properties.
(org-print-icalendar-entries): Retrieve the location property with
inheritance.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-exp.el (org-export-with-todo-keywords): New option.
(org-export-plist-vars): Include also the keys for the #+OPTIONS
line.
(org-default-export-plist, org-export-add-options-to-plist)
(org-export-as-ascii, org-export-as-html): Use the new structure
of `org-export-plist-vars'.
* org.el (org-map-entries): Return all values.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-matcher-time): Recognize more special values.
* org-gnus.el (fboundp): Fix defvaralias for XEmacs.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-tags-exclude-from-inheritance): New option.
(org-tag-inherit-p, org-remove-uniherited-tags): Respect
`org-tags-exclude-from-inheritance'.
* org-agenda.el (org-agenda-show-inherited-tags): New option.
(org-format-agenda-item): Add inherited tags to the agenda line
string, and make sure that properties are kept when downcasing the
tags list.
(org-agenda-add-inherited-tags): New function.
(org-downcase-keep-props): New function.
* org.el (org-scan-tags): Mark inherited tags with a text
property.
(org-get-tags-at): Mark inherited tags with a text property.
(org-add-prop-inherited): New function.
* org-agenda.el (org-agenda-add-inherited-tags): New function.
(org-agenda-show-inherited-tags): New option.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-modules): Add org-w3m to the default modules.
* org-table.el (orgtbl-self-insert-command): Make S-SPC work in
orgtbl-mode.
(orgtabl-create-or-convert-from-region): New command.
* org-exp.el (org-export-as-ascii): Remove the handling of
targets.
(org-export-ascii-preprocess): Handle targets already in this
function.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-timer.el (org-timer-start-time): Define this variable.
(org-timer-item): Make argument optional.
* org-list.el (org-insert-item): Automatically insert a timer item
if the current list is a timer list.
* org-timer.el: New file.
* org-publish.el (org-publish-org-index): Only exclude the index
file in the main directory from being added to the site-map.
(org-publish-get-project-from-filename): If the current project is
a component, start publishing from the parent project.
2008-12-07 Carsten Dominik <carsten.dominik@gmail.com>
* org-table.el (orgtbl-ret): Fix RET at beginning-of-buffer.
* org-publish.el (org-publish-org-index): Improve removal of
temporary buffers.
30 files changed, 777 insertions, 352 deletions
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 743e38041bf..8e58fb6ac07 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.13a | 9 | ;; Version: 6.14 |
| 10 | ;; | 10 | ;; |
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | ;; | 12 | ;; |
| @@ -945,6 +945,10 @@ When non-nil, this must be the number of minutes, e.g. 60 for one hour." | |||
| 945 | (integer :tag "Minutes") | 945 | (integer :tag "Minutes") |
| 946 | (const :tag "No default duration"))) | 946 | (const :tag "No default duration"))) |
| 947 | 947 | ||
| 948 | (defcustom org-agenda-show-inherited-tags t | ||
| 949 | "Non-nil means, show inherited tags in each agenda line." | ||
| 950 | :group 'org-agenda-line-format | ||
| 951 | :type 'boolean) | ||
| 948 | 952 | ||
| 949 | (defcustom org-agenda-remove-tags nil | 953 | (defcustom org-agenda-remove-tags nil |
| 950 | "Non-nil means, remove the tags from the headline copy in the agenda. | 954 | "Non-nil means, remove the tags from the headline copy in the agenda. |
| @@ -1298,7 +1302,7 @@ The following commands are available: | |||
| 1298 | ["Show Logbook entries" org-agenda-log-mode | 1302 | ["Show Logbook entries" org-agenda-log-mode |
| 1299 | :style toggle :selected org-agenda-show-log | 1303 | :style toggle :selected org-agenda-show-log |
| 1300 | :active (org-agenda-check-type nil 'agenda 'timeline)] | 1304 | :active (org-agenda-check-type nil 'agenda 'timeline)] |
| 1301 | ["Include archived trees" org-agenda-archives-mode | 1305 | ["Include archived trees" org-agenda-archives-mode |
| 1302 | :style toggle :selected org-agenda-archives-mode :active t] | 1306 | :style toggle :selected org-agenda-archives-mode :active t] |
| 1303 | ["Include archive files" (org-agenda-archives-mode t) | 1307 | ["Include archive files" (org-agenda-archives-mode t) |
| 1304 | :style toggle :selected (eq org-agenda-archives-mode t) :active t | 1308 | :style toggle :selected (eq org-agenda-archives-mode t) :active t |
| @@ -1907,7 +1911,7 @@ higher priority settings." | |||
| 1907 | (cond | 1911 | (cond |
| 1908 | ((string-match "\\.html?\\'" file) | 1912 | ((string-match "\\.html?\\'" file) |
| 1909 | (set-buffer (htmlize-buffer (current-buffer))) | 1913 | (set-buffer (htmlize-buffer (current-buffer))) |
| 1910 | 1914 | ||
| 1911 | (when (and org-agenda-export-html-style | 1915 | (when (and org-agenda-export-html-style |
| 1912 | (string-match "<style>" org-agenda-export-html-style)) | 1916 | (string-match "<style>" org-agenda-export-html-style)) |
| 1913 | ;; replace <style> section with org-agenda-export-html-style | 1917 | ;; replace <style> section with org-agenda-export-html-style |
| @@ -2978,7 +2982,7 @@ MATCH is being ignored." | |||
| 2978 | "Get the (Emacs Calendar) diary entries for DATE." | 2982 | "Get the (Emacs Calendar) diary entries for DATE." |
| 2979 | (require 'diary-lib) | 2983 | (require 'diary-lib) |
| 2980 | (let* ((diary-fancy-buffer "*temporary-fancy-diary-buffer*") | 2984 | (let* ((diary-fancy-buffer "*temporary-fancy-diary-buffer*") |
| 2981 | (fancy-diary-buffer diary-fancy-buffer) | 2985 | (fancy-diary-buffer diary-fancy-buffer) |
| 2982 | (diary-display-hook '(fancy-diary-display)) | 2986 | (diary-display-hook '(fancy-diary-display)) |
| 2983 | (diary-display-function 'fancy-diary-display) | 2987 | (diary-display-function 'fancy-diary-display) |
| 2984 | (pop-up-frames nil) | 2988 | (pop-up-frames nil) |
| @@ -3412,7 +3416,7 @@ the documentation of `org-diary'." | |||
| 3412 | (items (if (consp org-agenda-show-log) | 3416 | (items (if (consp org-agenda-show-log) |
| 3413 | org-agenda-show-log | 3417 | org-agenda-show-log |
| 3414 | org-agenda-log-mode-items)) | 3418 | org-agenda-log-mode-items)) |
| 3415 | (parts | 3419 | (parts |
| 3416 | (delq nil | 3420 | (delq nil |
| 3417 | (list | 3421 | (list |
| 3418 | (if (memq 'closed items) (concat "\\<" org-closed-string)) | 3422 | (if (memq 'closed items) (concat "\\<" org-closed-string)) |
| @@ -3737,6 +3741,9 @@ Any match of REMOVE-RE will be removed from TXT." | |||
| 3737 | (save-match-data | 3741 | (save-match-data |
| 3738 | ;; Diary entries sometimes have extra whitespace at the beginning | 3742 | ;; Diary entries sometimes have extra whitespace at the beginning |
| 3739 | (if (string-match "^ +" txt) (setq txt (replace-match "" nil nil txt))) | 3743 | (if (string-match "^ +" txt) (setq txt (replace-match "" nil nil txt))) |
| 3744 | (when org-agenda-show-inherited-tags | ||
| 3745 | ;; Fix the tags part in txt | ||
| 3746 | (setq txt (org-agenda-add-inherited-tags txt tags))) | ||
| 3740 | (let* ((category (or category | 3747 | (let* ((category (or category |
| 3741 | org-category | 3748 | org-category |
| 3742 | (if buffer-file-name | 3749 | (if buffer-file-name |
| @@ -3836,7 +3843,8 @@ Any match of REMOVE-RE will be removed from TXT." | |||
| 3836 | 3843 | ||
| 3837 | ;; And finally add the text properties | 3844 | ;; And finally add the text properties |
| 3838 | (org-add-props rtn nil | 3845 | (org-add-props rtn nil |
| 3839 | 'org-category (downcase category) 'tags (mapcar 'downcase tags) | 3846 | 'org-category (downcase category) |
| 3847 | 'tags (mapcar 'org-downcase-keep-props tags) | ||
| 3840 | 'org-highest-priority org-highest-priority | 3848 | 'org-highest-priority org-highest-priority |
| 3841 | 'org-lowest-priority org-lowest-priority | 3849 | 'org-lowest-priority org-lowest-priority |
| 3842 | 'prefix-length (- (length rtn) (length txt)) | 3850 | 'prefix-length (- (length rtn) (length txt)) |
| @@ -3849,6 +3857,34 @@ Any match of REMOVE-RE will be removed from TXT." | |||
| 3849 | 'extra extra | 3857 | 'extra extra |
| 3850 | 'dotime dotime)))) | 3858 | 'dotime dotime)))) |
| 3851 | 3859 | ||
| 3860 | (defun org-agenda-add-inherited-tags (txt tags) | ||
| 3861 | "Remove tags string from TXT, and add complete list of tags. | ||
| 3862 | The new list includes inherited tags. If any inherited tags are present, | ||
| 3863 | a double colon separates inherited tags from local tags." | ||
| 3864 | (if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$") txt) | ||
| 3865 | (setq txt (substring txt 0 (match-beginning 0)))) | ||
| 3866 | (when tags | ||
| 3867 | (let ((have-i (get-text-property 0 'inherited (car tags))) | ||
| 3868 | i) | ||
| 3869 | (setq txt (concat txt " :" | ||
| 3870 | (mapconcat | ||
| 3871 | (lambda (x) | ||
| 3872 | (setq i (get-text-property 0 'inherited x)) | ||
| 3873 | (if (and have-i (not i)) | ||
| 3874 | (progn | ||
| 3875 | (setq have-i nil) | ||
| 3876 | (concat ":" x)) | ||
| 3877 | x)) | ||
| 3878 | tags ":") | ||
| 3879 | (if have-i "::" ":"))))) | ||
| 3880 | txt) | ||
| 3881 | |||
| 3882 | (defun org-downcase-keep-props (s) | ||
| 3883 | (let ((props (text-properties-at 0 s))) | ||
| 3884 | (setq s (downcase s)) | ||
| 3885 | (add-text-properties 0 (length s) props s) | ||
| 3886 | s)) | ||
| 3887 | |||
| 3852 | (defvar org-agenda-sorting-strategy) ;; because the def is in a let form | 3888 | (defvar org-agenda-sorting-strategy) ;; because the def is in a let form |
| 3853 | (defvar org-agenda-sorting-strategy-selected nil) | 3889 | (defvar org-agenda-sorting-strategy-selected nil) |
| 3854 | 3890 | ||
| @@ -4024,7 +4060,7 @@ HH:MM." | |||
| 4024 | (tb (or (get-text-property 1 'todo-state b) "")) | 4060 | (tb (or (get-text-property 1 'todo-state b) "")) |
| 4025 | (la (- (length (member ta org-todo-keywords-for-agenda)))) | 4061 | (la (- (length (member ta org-todo-keywords-for-agenda)))) |
| 4026 | (lb (- (length (member tb org-todo-keywords-for-agenda)))) | 4062 | (lb (- (length (member tb org-todo-keywords-for-agenda)))) |
| 4027 | (donepa (member ta org-done-keywords-for-agenda)) | 4063 | (donepa (member ta org-done-keywords-for-agenda)) |
| 4028 | (donepb (member tb org-done-keywords-for-agenda))) | 4064 | (donepb (member tb org-done-keywords-for-agenda))) |
| 4029 | (cond ((and donepa (not donepb)) -1) | 4065 | (cond ((and donepa (not donepb)) -1) |
| 4030 | ((and (not donepa) donepb) +1) | 4066 | ((and (not donepa) donepb) +1) |
| @@ -4228,7 +4264,7 @@ used to narrow the search - the interactive user can also press `-' or `+' | |||
| 4228 | to switch to narrowing." | 4264 | to switch to narrowing." |
| 4229 | (interactive "P") | 4265 | (interactive "P") |
| 4230 | (let* ((alist org-tag-alist-for-agenda) | 4266 | (let* ((alist org-tag-alist-for-agenda) |
| 4231 | (tag-chars (mapconcat | 4267 | (tag-chars (mapconcat |
| 4232 | (lambda (x) (if (cdr x) (char-to-string (cdr x)) "")) | 4268 | (lambda (x) (if (cdr x) (char-to-string (cdr x)) "")) |
| 4233 | alist "")) | 4269 | alist "")) |
| 4234 | (efforts (org-split-string | 4270 | (efforts (org-split-string |
| @@ -4241,7 +4277,7 @@ to switch to narrowing." | |||
| 4241 | (current org-agenda-filter) | 4277 | (current org-agenda-filter) |
| 4242 | char a n tag tags) | 4278 | char a n tag tags) |
| 4243 | (unless char | 4279 | (unless char |
| 4244 | (message | 4280 | (message |
| 4245 | "%s by tag [%s ], [TAB], [/]:off, [+-]:narrow, [>=<]:effort: " | 4281 | "%s by tag [%s ], [TAB], [/]:off, [+-]:narrow, [>=<]:effort: " |
| 4246 | (if narrow "Narrow" "Filter") tag-chars) | 4282 | (if narrow "Narrow" "Filter") tag-chars) |
| 4247 | (setq char (read-char))) | 4283 | (setq char (read-char))) |
| @@ -4249,7 +4285,7 @@ to switch to narrowing." | |||
| 4249 | ;; Narrowing down | 4285 | ;; Narrowing down |
| 4250 | (cond ((equal char ?-) (setq strip t narrow t)) | 4286 | (cond ((equal char ?-) (setq strip t narrow t)) |
| 4251 | ((equal char ?+) (setq strip nil narrow t))) | 4287 | ((equal char ?+) (setq strip nil narrow t))) |
| 4252 | (message | 4288 | (message |
| 4253 | "Narrow by tag [%s ], [TAB], [/]:off, [>=<]:effort: " tag-chars) | 4289 | "Narrow by tag [%s ], [TAB], [/]:off, [>=<]:effort: " tag-chars) |
| 4254 | (setq char (read-char))) | 4290 | (setq char (read-char))) |
| 4255 | (when (member char '(?< ?> ?=)) | 4291 | (when (member char '(?< ?> ?=)) |
| @@ -5101,7 +5137,9 @@ the new TODO state." | |||
| 5101 | (goto-char (match-beginning 1)) | 5137 | (goto-char (match-beginning 1)) |
| 5102 | (insert (org-add-props | 5138 | (insert (org-add-props |
| 5103 | (make-string (max 1 (- c (current-column))) ?\ ) | 5139 | (make-string (max 1 (- c (current-column))) ?\ ) |
| 5104 | (text-properties-at (point)))))))) | 5140 | (text-properties-at (point))))) |
| 5141 | (goto-char (point-min)) | ||
| 5142 | (org-font-lock-add-tag-faces (point-max))))) | ||
| 5105 | 5143 | ||
| 5106 | (defun org-agenda-priority-up () | 5144 | (defun org-agenda-priority-up () |
| 5107 | "Increase the priority of line at point, also in Org-mode file." | 5145 | "Increase the priority of line at point, also in Org-mode file." |
| @@ -5369,7 +5407,7 @@ The cursor may be at a date in the calendar, or in the Org agenda." | |||
| 5369 | (widen) | 5407 | (widen) |
| 5370 | (goto-char org-agenda-action-marker) | 5408 | (goto-char org-agenda-action-marker) |
| 5371 | (eval form)))))))) | 5409 | (eval form)))))))) |
| 5372 | 5410 | ||
| 5373 | (defun org-agenda-clock-in (&optional arg) | 5411 | (defun org-agenda-clock-in (&optional arg) |
| 5374 | "Start the clock on the currently selected item." | 5412 | "Start the clock on the currently selected item." |
| 5375 | (interactive "P") | 5413 | (interactive "P") |
| @@ -5512,8 +5550,6 @@ argument, latitude and longitude will be prompted for." | |||
| 5512 | (calendar-view-holidays-initially-flag nil) | 5550 | (calendar-view-holidays-initially-flag nil) |
| 5513 | (calendar-view-diary-initially-flag nil) | 5551 | (calendar-view-diary-initially-flag nil) |
| 5514 | (view-calendar-holidays-initially nil) | 5552 | (view-calendar-holidays-initially nil) |
| 5515 | (calendar-view-diary-initially-flag nil) | ||
| 5516 | (calendar-view-holidays-initially-flag nil) | ||
| 5517 | (view-diary-entries-initially nil)) | 5553 | (view-diary-entries-initially nil)) |
| 5518 | (calendar) | 5554 | (calendar) |
| 5519 | (calendar-goto-date date))) | 5555 | (calendar-goto-date date))) |
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el index aee8b5f795a..2f468818834 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.13a | 8 | ;; Version: 6.14 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -345,7 +345,7 @@ sibling does not exist, it will be created at the end of the subtree." | |||
| 345 | (org-end-of-subtree t t) | 345 | (org-end-of-subtree t t) |
| 346 | (save-excursion | 346 | (save-excursion |
| 347 | (goto-char pos) | 347 | (goto-char pos) |
| 348 | (org-cut-subtree)) | 348 | (let ((this-command this-command)) (org-cut-subtree))) |
| 349 | (org-paste-subtree (org-get-valid-level level 1)) | 349 | (org-paste-subtree (org-get-valid-level level 1)) |
| 350 | (org-set-property | 350 | (org-set-property |
| 351 | "ARCHIVE_TIME" | 351 | "ARCHIVE_TIME" |
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el index d48c0bde639..fdf8a4cd274 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.13a | 7 | ;; Version: 6.14 |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
| @@ -181,7 +181,7 @@ This checks for the existence of a \".git\" directory in that directory." | |||
| 181 | " git add .; " | 181 | " git add .; " |
| 182 | " git ls-files --deleted -z | xargs -0 git rm; " | 182 | " git ls-files --deleted -z | xargs -0 git rm; " |
| 183 | " git commit -m 'Synchronized attachments')"))))) | 183 | " git commit -m 'Synchronized attachments')"))))) |
| 184 | 184 | ||
| 185 | (defun org-attach-tag (&optional off) | 185 | (defun org-attach-tag (&optional off) |
| 186 | "Turn the autotag on or (if OFF is set) off." | 186 | "Turn the autotag on or (if OFF is set) off." |
| 187 | (when org-attach-auto-tag | 187 | (when org-attach-auto-tag |
| @@ -266,7 +266,7 @@ A safer way is to open the directory in dired and delete from there." | |||
| 266 | (when org-attach-file-list-property | 266 | (when org-attach-file-list-property |
| 267 | (org-entry-delete (point) org-attach-file-list-property)) | 267 | (org-entry-delete (point) org-attach-file-list-property)) |
| 268 | (let ((attach-dir (org-attach-dir))) | 268 | (let ((attach-dir (org-attach-dir))) |
| 269 | (when | 269 | (when |
| 270 | (and attach-dir | 270 | (and attach-dir |
| 271 | (or force | 271 | (or force |
| 272 | (y-or-n-p "Are you sure you want to remove all attachments of this entry? "))) | 272 | (y-or-n-p "Are you sure you want to remove all attachments of this entry? "))) |
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el index c675cc2f4be..1c32ce7c22d 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.13a | 9 | ;; Version: 6.14 |
| 10 | ;; | 10 | ;; |
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | ;; | 12 | ;; |
| @@ -259,8 +259,8 @@ The anniversaries are assumed to be stored `org-bbdb-anniversary-field'." | |||
| 259 | (multiple-value-bind (m d y) | 259 | (multiple-value-bind (m d y) |
| 260 | (funcall org-bbdb-extract-date-fun (car split)) | 260 | (funcall org-bbdb-extract-date-fun (car split)) |
| 261 | (setq tmp (gethash (list m d) org-bbdb-anniv-hash)) | 261 | (setq tmp (gethash (list m d) org-bbdb-anniv-hash)) |
| 262 | (puthash (list m d) (cons (list y | 262 | (puthash (list m d) (cons (list y |
| 263 | (bbdb-record-name rec) | 263 | (bbdb-record-name rec) |
| 264 | (cadr split)) | 264 | (cadr split)) |
| 265 | tmp) | 265 | tmp) |
| 266 | org-bbdb-anniv-hash)))))) | 266 | org-bbdb-anniv-hash)))))) |
| @@ -292,7 +292,7 @@ This is used by Org to re-create the anniversary hash table." | |||
| 292 | (annivs (gethash (list m d) org-bbdb-anniv-hash)) | 292 | (annivs (gethash (list m d) org-bbdb-anniv-hash)) |
| 293 | (text ()) | 293 | (text ()) |
| 294 | split class form rec recs) | 294 | split class form rec recs) |
| 295 | 295 | ||
| 296 | ;; we don't want to miss people born on Feb. 29th | 296 | ;; we don't want to miss people born on Feb. 29th |
| 297 | (when (and (= m 3) (= d 1) | 297 | (when (and (= m 3) (= d 1) |
| 298 | (not (null (gethash (list 2 29) org-bbdb-anniv-hash))) | 298 | (not (null (gethash (list 2 29) org-bbdb-anniv-hash))) |
| @@ -303,7 +303,7 @@ This is used by Org to re-create the anniversary hash table." | |||
| 303 | 303 | ||
| 304 | (when annivs | 304 | (when annivs |
| 305 | (while (setq rec (pop annivs)) | 305 | (while (setq rec (pop annivs)) |
| 306 | (when rec | 306 | (when rec |
| 307 | (let* ((class (or (nth 2 rec) | 307 | (let* ((class (or (nth 2 rec) |
| 308 | org-bbdb-default-anniversary-format)) | 308 | org-bbdb-default-anniversary-format)) |
| 309 | (form (or (cdr (assoc class | 309 | (form (or (cdr (assoc class |
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el index 215ba40ce66..5b0627e5015 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.13a | 8 | ;; Version: 6.14 |
| 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 3848fac7bf4..b6fc637509a 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.13a | 8 | ;; Version: 6.14 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -118,7 +118,8 @@ be visited." | |||
| 118 | (const :tag "Clock and history" t) | 118 | (const :tag "Clock and history" t) |
| 119 | (const :tag "No persistence" nil))) | 119 | (const :tag "No persistence" nil))) |
| 120 | 120 | ||
| 121 | (defcustom org-clock-persist-file "~/.emacs.d/org-clock-save.el" | 121 | (defcustom org-clock-persist-file (convert-standard-filename |
| 122 | "~/.emacs.d/org-clock-save.el") | ||
| 122 | "File to save clock data to" | 123 | "File to save clock data to" |
| 123 | :group 'org-clock | 124 | :group 'org-clock |
| 124 | :type 'string) | 125 | :type 'string) |
| @@ -187,7 +188,7 @@ of a different task.") | |||
| 187 | "Select a task that recently was associated with clocking." | 188 | "Select a task that recently was associated with clocking." |
| 188 | (interactive) | 189 | (interactive) |
| 189 | (let (sel-list rpl file task (i 0) s) | 190 | (let (sel-list rpl file task (i 0) s) |
| 190 | (save-window-excursion | 191 | (save-window-excursion |
| 191 | (org-switch-to-buffer-other-window | 192 | (org-switch-to-buffer-other-window |
| 192 | (get-buffer-create "*Clock Task Select*")) | 193 | (get-buffer-create "*Clock Task Select*")) |
| 193 | (erase-buffer) | 194 | (erase-buffer) |
| @@ -285,13 +286,13 @@ the clocking selection, associated with the letter `d'." | |||
| 285 | (marker-position org-clock-marker) | 286 | (marker-position org-clock-marker) |
| 286 | (marker-buffer org-clock-marker)) | 287 | (marker-buffer org-clock-marker)) |
| 287 | (org-clock-out t)) | 288 | (org-clock-out t)) |
| 288 | 289 | ||
| 289 | (when (equal select '(16)) | 290 | (when (equal select '(16)) |
| 290 | ;; Mark as default clocking task | 291 | ;; Mark as default clocking task |
| 291 | (save-excursion | 292 | (save-excursion |
| 292 | (org-back-to-heading t) | 293 | (org-back-to-heading t) |
| 293 | (move-marker org-clock-default-task (point)))) | 294 | (move-marker org-clock-default-task (point)))) |
| 294 | 295 | ||
| 295 | (setq target-pos (point)) ;; we want to clock in at this location | 296 | (setq target-pos (point)) ;; we want to clock in at this location |
| 296 | (save-excursion | 297 | (save-excursion |
| 297 | (when (and selected-task (marker-buffer selected-task)) | 298 | (when (and selected-task (marker-buffer selected-task)) |
| @@ -991,8 +992,8 @@ the currently selected interval size." | |||
| 991 | (cond | 992 | (cond |
| 992 | ((eq formula '%) | 993 | ((eq formula '%) |
| 993 | (setq pcol (+ (if scope-is-list 1 0) maxlevel 3)) | 994 | (setq pcol (+ (if scope-is-list 1 0) maxlevel 3)) |
| 994 | (insert | 995 | (insert |
| 995 | (format | 996 | (format |
| 996 | "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f" | 997 | "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f" |
| 997 | pcol | 998 | pcol |
| 998 | 2 | 999 | 2 |
| @@ -1160,7 +1161,7 @@ a stored clock" | |||
| 1160 | (when (and resume-clock org-clock-persist | 1161 | (when (and resume-clock org-clock-persist |
| 1161 | (file-exists-p (car resume-clock)) | 1162 | (file-exists-p (car resume-clock)) |
| 1162 | (or (not org-clock-persist-query-resume) | 1163 | (or (not org-clock-persist-query-resume) |
| 1163 | (y-or-n-p | 1164 | (y-or-n-p |
| 1164 | (concat | 1165 | (concat |
| 1165 | "Resume clock (" | 1166 | "Resume clock (" |
| 1166 | (with-current-buffer (find-file (car resume-clock)) | 1167 | (with-current-buffer (find-file (car resume-clock)) |
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el index 2072cebe532..08dc6565273 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.13a | 8 | ;; Version: 6.14 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -220,7 +220,7 @@ This is the compiled version of the format.") | |||
| 220 | 220 | ||
| 221 | (defun org-columns-add-ellipses (string width) | 221 | (defun org-columns-add-ellipses (string width) |
| 222 | "Truncate STRING with WIDTH characters, with ellipses." | 222 | "Truncate STRING with WIDTH characters, with ellipses." |
| 223 | (cond | 223 | (cond |
| 224 | ((<= (length string) width) string) | 224 | ((<= (length string) width) string) |
| 225 | ((<= width (length org-columns-ellipses)) | 225 | ((<= width (length org-columns-ellipses)) |
| 226 | (substring org-columns-ellipses 0 width)) | 226 | (substring org-columns-ellipses 0 width)) |
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index ebfa203188e..08f66fcb0dc 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.13a | 8 | ;; Version: 6.14 |
| 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-exp.el b/lisp/org/org-exp.el index 2a0e46deb11..8e64a31a47c 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.13a | 8 | ;; Version: 6.14 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -204,6 +204,18 @@ or \"toc:3\"." | |||
| 204 | :group 'org-export-general | 204 | :group 'org-export-general |
| 205 | :type 'boolean) | 205 | :type 'boolean) |
| 206 | 206 | ||
| 207 | (defcustom org-export-with-todo-keywords t | ||
| 208 | "Non-nil means, include TODO keywords in export. | ||
| 209 | When nil, remove all these keywords from the export." | ||
| 210 | :group 'org-export-general | ||
| 211 | :type 'boolean) | ||
| 212 | |||
| 213 | (defcustom org-export-with-priority nil | ||
| 214 | "Non-nil means, include priority cookies in export. | ||
| 215 | When nil, remove priority cookies for export." | ||
| 216 | :group 'org-export-general | ||
| 217 | :type 'boolean) | ||
| 218 | |||
| 207 | (defcustom org-export-preserve-breaks nil | 219 | (defcustom org-export-preserve-breaks nil |
| 208 | "Non-nil means, preserve all line breaks when exporting. | 220 | "Non-nil means, preserve all line breaks when exporting. |
| 209 | Normally, in HTML output paragraphs will be reformatted. In ASCII | 221 | Normally, in HTML output paragraphs will be reformatted. In ASCII |
| @@ -314,7 +326,7 @@ This option can also be set with the +OPTIONS line, e.g. \"f:nil\"." | |||
| 314 | <h2 class=\"footnotes\">%s: </h2> | 326 | <h2 class=\"footnotes\">%s: </h2> |
| 315 | <div id=\"footnotes-text\"> | 327 | <div id=\"footnotes-text\"> |
| 316 | %s | 328 | %s |
| 317 | </div> | 329 | </div> |
| 318 | </div>" | 330 | </div>" |
| 319 | "Format for the footnotes section. | 331 | "Format for the footnotes section. |
| 320 | Should contain a two instances of %s. The first will be replaced with the | 332 | Should contain a two instances of %s. The first will be replaced with the |
| @@ -512,7 +524,7 @@ Org-mode file." | |||
| 512 | 524 | ||
| 513 | (defconst org-export-html-style-default | 525 | (defconst org-export-html-style-default |
| 514 | "<style type=\"text/css\"> | 526 | "<style type=\"text/css\"> |
| 515 | <![CDATA[ | 527 | <!--/*--><![CDATA[/*><!--*/ |
| 516 | html { font-family: Times, serif; font-size: 12pt; } | 528 | html { font-family: Times, serif; font-size: 12pt; } |
| 517 | .title { text-align: center; } | 529 | .title { text-align: center; } |
| 518 | .todo { color: red; } | 530 | .todo { color: red; } |
| @@ -539,7 +551,7 @@ Org-mode file." | |||
| 539 | white-space:nowrap; } | 551 | white-space:nowrap; } |
| 540 | .org-info-js_search-highlight {background-color:#ffff00; color:#000000; | 552 | .org-info-js_search-highlight {background-color:#ffff00; color:#000000; |
| 541 | font-weight:bold; } | 553 | font-weight:bold; } |
| 542 | ]]> | 554 | /*]]>*/--> |
| 543 | </style>" | 555 | </style>" |
| 544 | "The default style specification for exported HTML files. | 556 | "The default style specification for exported HTML files. |
| 545 | Please use the variables `org-export-html-style' and | 557 | Please use the variables `org-export-html-style' and |
| @@ -821,57 +833,67 @@ or if they are only using it locally." | |||
| 821 | (defvar org-current-export-dir nil) ; dynamically scoped parameter | 833 | (defvar org-current-export-dir nil) ; dynamically scoped parameter |
| 822 | 834 | ||
| 823 | (defconst org-export-plist-vars | 835 | (defconst org-export-plist-vars |
| 824 | '((:link-up . org-export-html-link-up) | 836 | '((:link-up nil org-export-html-link-up) |
| 825 | (:link-home . org-export-html-link-home) | 837 | (:link-home nil org-export-html-link-home) |
| 826 | (:language . org-export-default-language) | 838 | (:language nil org-export-default-language) |
| 827 | (:customtime . org-display-custom-times) | 839 | (:customtime nil org-display-custom-times) |
| 828 | (:headline-levels . org-export-headline-levels) | 840 | (:headline-levels "H" org-export-headline-levels) |
| 829 | (:section-numbers . org-export-with-section-numbers) | 841 | (:section-numbers "num" org-export-with-section-numbers) |
| 830 | (:section-number-format . org-export-section-number-format) | 842 | (:section-number-format nil org-export-section-number-format) |
| 831 | (:table-of-contents . org-export-with-toc) | 843 | (:table-of-contents "toc" org-export-with-toc) |
| 832 | (:preserve-breaks . org-export-preserve-breaks) | 844 | (:preserve-breaks "\\n" org-export-preserve-breaks) |
| 833 | (:archived-trees . org-export-with-archived-trees) | 845 | (:archived-trees nil org-export-with-archived-trees) |
| 834 | (:emphasize . org-export-with-emphasize) | 846 | (:emphasize "*" org-export-with-emphasize) |
| 835 | (:sub-superscript . org-export-with-sub-superscripts) | 847 | (:sub-superscript "^" org-export-with-sub-superscripts) |
| 836 | (:special-strings . org-export-with-special-strings) | 848 | (:special-strings "-" org-export-with-special-strings) |
| 837 | (:footnotes . org-export-with-footnotes) | 849 | (:footnotes "f" org-export-with-footnotes) |
| 838 | (:drawers . org-export-with-drawers) | 850 | (:drawers "d" org-export-with-drawers) |
| 839 | (:tags . org-export-with-tags) | 851 | (:tags "tags" org-export-with-tags) |
| 840 | (:TeX-macros . org-export-with-TeX-macros) | 852 | (:todo-keywords "todo" org-export-with-todo-keywords) |
| 841 | (:LaTeX-fragments . org-export-with-LaTeX-fragments) | 853 | (:priority "pri" org-export-with-priority) |
| 842 | (:skip-before-1st-heading . org-export-skip-text-before-1st-heading) | 854 | (:TeX-macros "TeX" org-export-with-TeX-macros) |
| 843 | (:fixed-width . org-export-with-fixed-width) | 855 | (:LaTeX-fragments "LaTeX" org-export-with-LaTeX-fragments) |
| 844 | (:timestamps . org-export-with-timestamps) | 856 | (:skip-before-1st-heading "skip" org-export-skip-text-before-1st-heading) |
| 845 | (:author-info . org-export-author-info) | 857 | (:fixed-width ":" org-export-with-fixed-width) |
| 846 | (:creator-info . org-export-creator-info) | 858 | (:timestamps "<" org-export-with-timestamps) |
| 847 | (:time-stamp-file . org-export-time-stamp-file) | 859 | (:author-info "author" org-export-author-info) |
| 848 | (:tables . org-export-with-tables) | 860 | (:creator-info "creator" org-export-creator-info) |
| 849 | (:table-auto-headline . org-export-highlight-first-table-line) | 861 | (:time-stamp-file "timestamp" org-export-time-stamp-file) |
| 850 | (:style-include-default . org-export-html-style-include-default) | 862 | (:tables "|" org-export-with-tables) |
| 851 | (:style . org-export-html-style) | 863 | (:table-auto-headline nil org-export-highlight-first-table-line) |
| 852 | (:style-extra . org-export-html-style-extra) | 864 | (:style-include-default nil org-export-html-style-include-default) |
| 853 | (:agenda-style . org-agenda-export-html-style) | 865 | (:style nil org-export-html-style) |
| 854 | (:convert-org-links . org-export-html-link-org-files-as-html) | 866 | (:style-extra nil org-export-html-style-extra) |
| 855 | (:inline-images . org-export-html-inline-images) | 867 | (:agenda-style nil org-agenda-export-html-style) |
| 856 | (:html-extension . org-export-html-extension) | 868 | (:convert-org-links nil org-export-html-link-org-files-as-html) |
| 857 | (:html-table-tag . org-export-html-table-tag) | 869 | (:inline-images nil org-export-html-inline-images) |
| 858 | (:expand-quoted-html . org-export-html-expand) | 870 | (:html-extension nil org-export-html-extension) |
| 859 | (:timestamp . org-export-html-with-timestamp) | 871 | (:html-table-tag nil org-export-html-table-tag) |
| 860 | (:publishing-directory . org-export-publishing-directory) | 872 | (:expand-quoted-html "@" org-export-html-expand) |
| 861 | (:preamble . org-export-html-preamble) | 873 | (:timestamp nil org-export-html-with-timestamp) |
| 862 | (:postamble . org-export-html-postamble) | 874 | (:publishing-directory nil org-export-publishing-directory) |
| 863 | (:auto-preamble . org-export-html-auto-preamble) | 875 | (:preamble nil org-export-html-preamble) |
| 864 | (:auto-postamble . org-export-html-auto-postamble) | 876 | (:postamble nil org-export-html-postamble) |
| 865 | (:author . user-full-name) | 877 | (:auto-preamble nil org-export-html-auto-preamble) |
| 866 | (:email . user-mail-address) | 878 | (:auto-postamble nil org-export-html-auto-postamble) |
| 867 | (:select-tags . org-export-select-tags) | 879 | (:author nil user-full-name) |
| 868 | (:exclude-tags . org-export-exclude-tags))) | 880 | (:email nil user-mail-address) |
| 881 | (:select-tags nil org-export-select-tags) | ||
| 882 | (:exclude-tags nil org-export-exclude-tags)) | ||
| 883 | "List of properties that represent export/publishing variables. | ||
| 884 | Each element is a list of 3 items: | ||
| 885 | 1. The property that is used internally, and also for org-publish-project-alist | ||
| 886 | 2. The string that can be used in the OPTION lines to set this option, | ||
| 887 | or nil if this option cannot be changed in this way | ||
| 888 | 3. The customization variable that sets the default for this option." | ||
| 889 | |||
| 890 | ) | ||
| 869 | 891 | ||
| 870 | (defun org-default-export-plist () | 892 | (defun org-default-export-plist () |
| 871 | "Return the property list with default settings for the export variables." | 893 | "Return the property list with default settings for the export variables." |
| 872 | (let ((l org-export-plist-vars) rtn e) | 894 | (let ((l org-export-plist-vars) rtn e) |
| 873 | (while (setq e (pop l)) | 895 | (while (setq e (pop l)) |
| 874 | (setq rtn (cons (car e) (cons (symbol-value (cdr e)) rtn)))) | 896 | (setq rtn (cons (car e) (cons (symbol-value (nth 2 e)) rtn)))) |
| 875 | rtn)) | 897 | rtn)) |
| 876 | 898 | ||
| 877 | (defvar org-export-inbuffer-options-extra nil | 899 | (defvar org-export-inbuffer-options-extra nil |
| @@ -964,35 +986,17 @@ modified) list.") | |||
| 964 | "Parse an OPTONS line and set values in the property list P." | 986 | "Parse an OPTONS line and set values in the property list P." |
| 965 | (let (o) | 987 | (let (o) |
| 966 | (when options | 988 | (when options |
| 967 | (let ((op '(("H" . :headline-levels) | 989 | (let ((op org-export-plist-vars) a) |
| 968 | ("num" . :section-numbers) | ||
| 969 | ("toc" . :table-of-contents) | ||
| 970 | ("\\n" . :preserve-breaks) | ||
| 971 | ("@" . :expand-quoted-html) | ||
| 972 | (":" . :fixed-width) | ||
| 973 | ("|" . :tables) | ||
| 974 | ("^" . :sub-superscript) | ||
| 975 | ("-" . :special-strings) | ||
| 976 | ("f" . :footnotes) | ||
| 977 | ("d" . :drawers) | ||
| 978 | ("tags" . :tags) | ||
| 979 | ("*" . :emphasize) | ||
| 980 | ("TeX" . :TeX-macros) | ||
| 981 | ("LaTeX" . :LaTeX-fragments) | ||
| 982 | ("skip" . :skip-before-1st-heading) | ||
| 983 | ("author" . :author-info) | ||
| 984 | ("creator" . :creator-info) | ||
| 985 | ("timestamp" . :time-stamp-file))) | ||
| 986 | o) | ||
| 987 | (while (setq o (pop op)) | 990 | (while (setq o (pop op)) |
| 988 | (if (string-match (concat (regexp-quote (car o)) | 991 | (if (and (nth 1 o) |
| 989 | ":\\([^ \t\n\r;,.]*\\)") | 992 | (string-match (concat (regexp-quote (nth 1 o)) |
| 990 | options) | 993 | ":\\([^ \t\n\r;,.]*\\)") |
| 991 | (setq p (plist-put p (cdr o) | 994 | options)) |
| 995 | (setq p (plist-put p (car o) | ||
| 992 | (car (read-from-string | 996 | (car (read-from-string |
| 993 | (match-string 1 options)))))))))) | 997 | (match-string 1 options)))))))))) |
| 994 | p) | 998 | p) |
| 995 | 999 | ||
| 996 | (defun org-export-add-subtree-options (p pos) | 1000 | (defun org-export-add-subtree-options (p pos) |
| 997 | "Add options in subtree at position POS to property list P." | 1001 | "Add options in subtree at position POS to property list P." |
| 998 | (save-excursion | 1002 | (save-excursion |
| @@ -1447,14 +1451,14 @@ on this string to produce the exported version." | |||
| 1447 | ;; The caller markes some stuff fo killing, stuff that has been | 1451 | ;; The caller markes some stuff fo killing, stuff that has been |
| 1448 | ;; used to create the page title, for example. | 1452 | ;; used to create the page title, for example. |
| 1449 | (org-export-kill-licensed-text) | 1453 | (org-export-kill-licensed-text) |
| 1450 | 1454 | ||
| 1451 | (let ((org-inhibit-startup t)) (org-mode)) | 1455 | (let ((org-inhibit-startup t)) (org-mode)) |
| 1452 | (setq case-fold-search t) | 1456 | (setq case-fold-search t) |
| 1453 | (untabify (point-min) (point-max)) | 1457 | (untabify (point-min) (point-max)) |
| 1454 | 1458 | ||
| 1455 | ;; Handle include files | 1459 | ;; Handle include files |
| 1456 | (org-export-handle-include-files) | 1460 | (org-export-handle-include-files) |
| 1457 | 1461 | ||
| 1458 | ;; Get rid of excluded trees | 1462 | ;; Get rid of excluded trees |
| 1459 | (org-export-handle-export-tags (plist-get parameters :select-tags) | 1463 | (org-export-handle-export-tags (plist-get parameters :select-tags) |
| 1460 | (plist-get parameters :exclude-tags)) | 1464 | (plist-get parameters :exclude-tags)) |
| @@ -1462,10 +1466,13 @@ on this string to produce the exported version." | |||
| 1462 | ;; Handle source code snippets | 1466 | ;; Handle source code snippets |
| 1463 | (org-export-replace-src-segments) | 1467 | (org-export-replace-src-segments) |
| 1464 | 1468 | ||
| 1469 | ;; Find all headings and compute the targets for them | ||
| 1470 | (setq target-alist (org-export-define-heading-targets target-alist)) | ||
| 1471 | |||
| 1465 | ;; Get rid of drawers | 1472 | ;; Get rid of drawers |
| 1466 | (org-export-remove-or-extract-drawers drawers | 1473 | (org-export-remove-or-extract-drawers drawers |
| 1467 | (plist-get parameters :drawers)) | 1474 | (plist-get parameters :drawers)) |
| 1468 | 1475 | ||
| 1469 | ;; Get the correct stuff before the first headline | 1476 | ;; Get the correct stuff before the first headline |
| 1470 | (when (plist-get parameters :skip-before-1st-heading) | 1477 | (when (plist-get parameters :skip-before-1st-heading) |
| 1471 | (goto-char (point-min)) | 1478 | (goto-char (point-min)) |
| @@ -1476,12 +1483,12 @@ on this string to produce the exported version." | |||
| 1476 | (when (plist-get parameters :add-text) | 1483 | (when (plist-get parameters :add-text) |
| 1477 | (goto-char (point-min)) | 1484 | (goto-char (point-min)) |
| 1478 | (insert (plist-get parameters :add-text) "\n")) | 1485 | (insert (plist-get parameters :add-text) "\n")) |
| 1479 | 1486 | ||
| 1480 | ;; Get rid of archived trees | 1487 | ;; Get rid of archived trees |
| 1481 | (org-export-remove-archived-trees archived-trees) | 1488 | (org-export-remove-archived-trees archived-trees) |
| 1482 | 1489 | ||
| 1483 | ;; Find all headings and compute the targets for them | 1490 | ;; Remove todo-keywords before exporting, if the user has requested so |
| 1484 | (setq target-alist (org-export-define-heading-targets target-alist)) | 1491 | (org-export-remove-headline-metadata parameters) |
| 1485 | 1492 | ||
| 1486 | ;; Find targets in comments and move them out of comments, | 1493 | ;; Find targets in comments and move them out of comments, |
| 1487 | ;; but mark them as targets that should be invisible | 1494 | ;; but mark them as targets that should be invisible |
| @@ -1506,7 +1513,6 @@ on this string to produce the exported version." | |||
| 1506 | ;; Remove comment environment and comment subtrees | 1513 | ;; Remove comment environment and comment subtrees |
| 1507 | (org-export-remove-comment-blocks-and-subtrees) | 1514 | (org-export-remove-comment-blocks-and-subtrees) |
| 1508 | 1515 | ||
| 1509 | |||
| 1510 | ;; Find matches for radio targets and turn them into internal links | 1516 | ;; Find matches for radio targets and turn them into internal links |
| 1511 | (org-export-mark-radio-links) | 1517 | (org-export-mark-radio-links) |
| 1512 | 1518 | ||
| @@ -1564,18 +1570,22 @@ on this string to produce the exported version." | |||
| 1564 | The new targets are added to TARGET-ALIST, which is also returned." | 1570 | The new targets are added to TARGET-ALIST, which is also returned." |
| 1565 | (goto-char (point-min)) | 1571 | (goto-char (point-min)) |
| 1566 | (org-init-section-numbers) | 1572 | (org-init-section-numbers) |
| 1567 | (let ((re (concat "^" org-outline-regexp)) | 1573 | (let ((re (concat "^" org-outline-regexp |
| 1574 | "\\| [ \t]*:ID:[ \t]*\\([^ \t\r\n]+\\)")) | ||
| 1568 | level target) | 1575 | level target) |
| 1569 | (while (re-search-forward re nil t) | 1576 | (while (re-search-forward re nil t) |
| 1570 | (setq level (org-reduced-level | 1577 | (if (match-end 1) |
| 1571 | (save-excursion (goto-char (point-at-bol)) | 1578 | (push (cons (org-match-string-no-properties 1) |
| 1572 | (org-outline-level)))) | 1579 | target) target-alist) |
| 1573 | (setq target (org-solidify-link-text | 1580 | (setq level (org-reduced-level |
| 1574 | (format "sec-%s" (org-section-number level)))) | 1581 | (save-excursion (goto-char (point-at-bol)) |
| 1575 | (push (cons target target) target-alist) | 1582 | (org-outline-level)))) |
| 1576 | (add-text-properties | 1583 | (setq target (org-solidify-link-text |
| 1577 | (point-at-bol) (point-at-eol) | 1584 | (format "sec-%s" (org-section-number level)))) |
| 1578 | (list 'target target)))) | 1585 | (push (cons target target) target-alist) |
| 1586 | (add-text-properties | ||
| 1587 | (point-at-bol) (point-at-eol) | ||
| 1588 | (list 'target target))))) | ||
| 1579 | target-alist) | 1589 | target-alist) |
| 1580 | 1590 | ||
| 1581 | (defun org-export-handle-invisible-targets (target-alist) | 1591 | (defun org-export-handle-invisible-targets (target-alist) |
| @@ -1604,9 +1614,11 @@ Mark them as invisible targets." | |||
| 1604 | target-alist) | 1614 | target-alist) |
| 1605 | 1615 | ||
| 1606 | (defun org-export-target-internal-links (target-alist) | 1616 | (defun org-export-target-internal-links (target-alist) |
| 1607 | "Find all internal links and assign target to them. | 1617 | "Find all internal links and assign targets to them. |
| 1608 | If a link has a fuzzy match (i.e. not a *dedicated* target match), | 1618 | If a link has a fuzzy match (i.e. not a *dedicated* target match), |
| 1609 | let the link point to the corresponding section." | 1619 | let the link point to the corresponding section. |
| 1620 | This function also handles the id links, if they have a match in | ||
| 1621 | the current file." | ||
| 1610 | (goto-char (point-min)) | 1622 | (goto-char (point-min)) |
| 1611 | (while (re-search-forward org-bracket-link-regexp nil t) | 1623 | (while (re-search-forward org-bracket-link-regexp nil t) |
| 1612 | (org-if-unprotected | 1624 | (org-if-unprotected |
| @@ -1618,6 +1630,8 @@ let the link point to the corresponding section." | |||
| 1618 | (target | 1630 | (target |
| 1619 | (cond | 1631 | (cond |
| 1620 | ((cdr (assoc slink target-alist))) | 1632 | ((cdr (assoc slink target-alist))) |
| 1633 | ((and (string-match "^id:" link) | ||
| 1634 | (cdr (assoc (substring link 3) target-alist)))) | ||
| 1621 | ((string-match org-link-types-re link) nil) | 1635 | ((string-match org-link-types-re link) nil) |
| 1622 | ((or (file-name-absolute-p link) | 1636 | ((or (file-name-absolute-p link) |
| 1623 | (string-match "^\\." link)) | 1637 | (string-match "^\\." link)) |
| @@ -1735,6 +1749,24 @@ from the buffer." | |||
| 1735 | b (org-end-of-subtree t)) | 1749 | b (org-end-of-subtree t)) |
| 1736 | (if (> b a) (delete-region a b))))))) | 1750 | (if (> b a) (delete-region a b))))))) |
| 1737 | 1751 | ||
| 1752 | (defun org-export-remove-headline-metadata (opts) | ||
| 1753 | "Remove meta data from the headline, according to user options." | ||
| 1754 | (let ((re org-complex-heading-regexp) | ||
| 1755 | (todo (plist-get opts :todo-keywords)) | ||
| 1756 | (tags (plist-get opts :tags)) | ||
| 1757 | (pri (plist-get opts :priority)) | ||
| 1758 | rpl) | ||
| 1759 | (when (or (not todo) (not tags) (not pri)) | ||
| 1760 | ;; OK, something needs to be removed | ||
| 1761 | (setq rpl (concat "\\1" | ||
| 1762 | (if todo " \\2" "") | ||
| 1763 | (if pri " \\3" "") | ||
| 1764 | " \\4" | ||
| 1765 | (if tags " \\5" ""))) | ||
| 1766 | (goto-char (point-min)) | ||
| 1767 | (while (re-search-forward re nil t) | ||
| 1768 | (replace-match rpl t nil))))) | ||
| 1769 | |||
| 1738 | (defun org-export-protect-quoted-subtrees () | 1770 | (defun org-export-protect-quoted-subtrees () |
| 1739 | "Mark quoted subtrees with the protection property." | 1771 | "Mark quoted subtrees with the protection property." |
| 1740 | (let ((re-quote (concat "^\\*+[ \t]+" org-quote-string "\\>"))) | 1772 | (let ((re-quote (concat "^\\*+[ \t]+" org-quote-string "\\>"))) |
| @@ -1905,7 +1937,7 @@ When it is nil, all comments will be removed." | |||
| 1905 | "]"))) | 1937 | "]"))) |
| 1906 | (put-text-property 0 (length s) 'face 'org-link s) | 1938 | (put-text-property 0 (length s) 'face 'org-link s) |
| 1907 | (replace-match s t t)))))) | 1939 | (replace-match s t t)))))) |
| 1908 | 1940 | ||
| 1909 | (defun org-export-concatenate-multiline-links () | 1941 | (defun org-export-concatenate-multiline-links () |
| 1910 | "Find multi-line links and put it all into a single line. | 1942 | "Find multi-line links and put it all into a single line. |
| 1911 | This is to make sure that the line-processing export backends | 1943 | This is to make sure that the line-processing export backends |
| @@ -2071,7 +2103,7 @@ TYPE must be a string, any of: | |||
| 2071 | res))) | 2103 | res))) |
| 2072 | 2104 | ||
| 2073 | (org-number-to-roman 1961) | 2105 | (org-number-to-roman 1961) |
| 2074 | 2106 | ||
| 2075 | 2107 | ||
| 2076 | ;;; Include files | 2108 | ;;; Include files |
| 2077 | 2109 | ||
| @@ -2227,7 +2259,7 @@ underlined headlines. The default is 3." | |||
| 2227 | (goto-char rbeg) | 2259 | (goto-char rbeg) |
| 2228 | (and (org-at-heading-p) | 2260 | (and (org-at-heading-p) |
| 2229 | (>= (org-end-of-subtree t t) rend))))) | 2261 | (>= (org-end-of-subtree t t) rend))))) |
| 2230 | (opt-plist (if subtree-p | 2262 | (opt-plist (if subtree-p |
| 2231 | (org-export-add-subtree-options opt-plist rbeg) | 2263 | (org-export-add-subtree-options opt-plist rbeg) |
| 2232 | opt-plist)) | 2264 | opt-plist)) |
| 2233 | (custom-times org-display-custom-times) | 2265 | (custom-times org-display-custom-times) |
| @@ -2278,6 +2310,9 @@ underlined headlines. The default is 3." | |||
| 2278 | :skip-before-1st-heading | 2310 | :skip-before-1st-heading |
| 2279 | (plist-get opt-plist :skip-before-1st-heading) | 2311 | (plist-get opt-plist :skip-before-1st-heading) |
| 2280 | :drawers (plist-get opt-plist :drawers) | 2312 | :drawers (plist-get opt-plist :drawers) |
| 2313 | :tags (plist-get opt-plist :tags) | ||
| 2314 | :priority (plist-get opt-plist :priority) | ||
| 2315 | :todo-keywords (plist-get opt-plist :todo-keywords) | ||
| 2281 | :verbatim-multiline t | 2316 | :verbatim-multiline t |
| 2282 | :select-tags (plist-get opt-plist :select-tags) | 2317 | :select-tags (plist-get opt-plist :select-tags) |
| 2283 | :exclude-tags (plist-get opt-plist :exclude-tags) | 2318 | :exclude-tags (plist-get opt-plist :exclude-tags) |
| @@ -2307,7 +2342,7 @@ underlined headlines. The default is 3." | |||
| 2307 | ;; create local variables for all options, to make sure all called | 2342 | ;; create local variables for all options, to make sure all called |
| 2308 | ;; functions get the correct information | 2343 | ;; functions get the correct information |
| 2309 | (mapc (lambda (x) | 2344 | (mapc (lambda (x) |
| 2310 | (set (make-local-variable (cdr x)) | 2345 | (set (make-local-variable (nth 2 x)) |
| 2311 | (plist-get opt-plist (car x)))) | 2346 | (plist-get opt-plist (car x)))) |
| 2312 | org-export-plist-vars) | 2347 | org-export-plist-vars) |
| 2313 | (org-set-local 'org-odd-levels-only odd) | 2348 | (org-set-local 'org-odd-levels-only odd) |
| @@ -2397,10 +2432,7 @@ underlined headlines. The default is 3." | |||
| 2397 | (while (setq line (pop lines)) | 2432 | (while (setq line (pop lines)) |
| 2398 | ;; Remove the quoted HTML tags. | 2433 | ;; Remove the quoted HTML tags. |
| 2399 | (setq line (org-html-expand-for-ascii line)) | 2434 | (setq line (org-html-expand-for-ascii line)) |
| 2400 | ;; Remove targets | 2435 | ;; Replace links with the description when possible |
| 2401 | (while (string-match "<<<?[^<>]*>>>?[ \t]*\n?" line) | ||
| 2402 | (setq line (replace-match "" t t line))) | ||
| 2403 | ;; Replace internal links | ||
| 2404 | (while (string-match org-bracket-link-regexp line) | 2436 | (while (string-match org-bracket-link-regexp line) |
| 2405 | (setq line (replace-match | 2437 | (setq line (replace-match |
| 2406 | (if (match-end 3) "[\\3]" "[\\1]") | 2438 | (if (match-end 3) "[\\3]" "[\\1]") |
| @@ -2483,13 +2515,18 @@ underlined headlines. The default is 3." | |||
| 2483 | 2515 | ||
| 2484 | (defun org-export-ascii-preprocess () | 2516 | (defun org-export-ascii-preprocess () |
| 2485 | "Do extra work for ASCII export" | 2517 | "Do extra work for ASCII export" |
| 2518 | ;; Put quotes around verbatim text | ||
| 2486 | (goto-char (point-min)) | 2519 | (goto-char (point-min)) |
| 2487 | (while (re-search-forward org-verbatim-re nil t) | 2520 | (while (re-search-forward org-verbatim-re nil t) |
| 2488 | (goto-char (match-end 2)) | 2521 | (goto-char (match-end 2)) |
| 2489 | (backward-delete-char 1) (insert "'") | 2522 | (backward-delete-char 1) (insert "'") |
| 2490 | (goto-char (match-beginning 2)) | 2523 | (goto-char (match-beginning 2)) |
| 2491 | (delete-char 1) (insert "`") | 2524 | (delete-char 1) (insert "`") |
| 2492 | (goto-char (match-end 2)))) | 2525 | (goto-char (match-end 2))) |
| 2526 | (goto-char (point-min)) | ||
| 2527 | ;; Remove target markers | ||
| 2528 | (while (re-search-forward "<<<?\\([^<>]*\\)>>>?\\([ \t]*\\)" nil t) | ||
| 2529 | (replace-match "\\1\\2"))) | ||
| 2493 | 2530 | ||
| 2494 | (defun org-search-todo-below (line lines level) | 2531 | (defun org-search-todo-below (line lines level) |
| 2495 | "Search the subtree below LINE for any TODO entries." | 2532 | "Search the subtree below LINE for any TODO entries." |
| @@ -2643,7 +2680,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff." | |||
| 2643 | #+EMAIL: %s | 2680 | #+EMAIL: %s |
| 2644 | #+DATE: %s | 2681 | #+DATE: %s |
| 2645 | #+LANGUAGE: %s | 2682 | #+LANGUAGE: %s |
| 2646 | #+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s -:%s f:%s *:%s TeX:%s LaTeX:%s skip:%s d:%s tags:%s | 2683 | #+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s -:%s f:%s *:%s TeX:%s LaTeX:%s skip:%s d:%s todo:%s pri:%s tags:%s |
| 2647 | %s | 2684 | %s |
| 2648 | #+EXPORT_SELECT_TAGS: %s | 2685 | #+EXPORT_SELECT_TAGS: %s |
| 2649 | #+EXPORT_EXCLUDE_TAGS: %s | 2686 | #+EXPORT_EXCLUDE_TAGS: %s |
| @@ -2678,6 +2715,8 @@ Does include HTML export options as well as TODO and CATEGORY stuff." | |||
| 2678 | org-export-with-LaTeX-fragments | 2715 | org-export-with-LaTeX-fragments |
| 2679 | org-export-skip-text-before-1st-heading | 2716 | org-export-skip-text-before-1st-heading |
| 2680 | org-export-with-drawers | 2717 | org-export-with-drawers |
| 2718 | org-export-with-todo-keywords | ||
| 2719 | org-export-with-priority | ||
| 2681 | org-export-with-tags | 2720 | org-export-with-tags |
| 2682 | (if (featurep 'org-jsinfo) (org-infojs-options-inbuffer-template) "") | 2721 | (if (featurep 'org-jsinfo) (org-infojs-options-inbuffer-template) "") |
| 2683 | (mapconcat 'identity org-export-select-tags " ") | 2722 | (mapconcat 'identity org-export-select-tags " ") |
| @@ -2871,7 +2910,7 @@ PUB-DIR is set, use this as the publishing directory." | |||
| 2871 | (goto-char rbeg) | 2910 | (goto-char rbeg) |
| 2872 | (and (org-at-heading-p) | 2911 | (and (org-at-heading-p) |
| 2873 | (>= (org-end-of-subtree t t) rend)))))) | 2912 | (>= (org-end-of-subtree t t) rend)))))) |
| 2874 | (opt-plist (if subtree-p | 2913 | (opt-plist (if subtree-p |
| 2875 | (org-export-add-subtree-options opt-plist rbeg) | 2914 | (org-export-add-subtree-options opt-plist rbeg) |
| 2876 | opt-plist)) | 2915 | opt-plist)) |
| 2877 | ;; The following two are dynamically scoped into other | 2916 | ;; The following two are dynamically scoped into other |
| @@ -2951,6 +2990,9 @@ PUB-DIR is set, use this as the publishing directory." | |||
| 2951 | :skip-before-1st-heading | 2990 | :skip-before-1st-heading |
| 2952 | (plist-get opt-plist :skip-before-1st-heading) | 2991 | (plist-get opt-plist :skip-before-1st-heading) |
| 2953 | :drawers (plist-get opt-plist :drawers) | 2992 | :drawers (plist-get opt-plist :drawers) |
| 2993 | :todo-keywords (plist-get opt-plist :todo-keywords) | ||
| 2994 | :tags (plist-get opt-plist :tags) | ||
| 2995 | :priority (plist-get opt-plist :priority) | ||
| 2954 | :archived-trees | 2996 | :archived-trees |
| 2955 | (plist-get opt-plist :archived-trees) | 2997 | (plist-get opt-plist :archived-trees) |
| 2956 | :select-tags (plist-get opt-plist :select-tags) | 2998 | :select-tags (plist-get opt-plist :select-tags) |
| @@ -3002,7 +3044,7 @@ PUB-DIR is set, use this as the publishing directory." | |||
| 3002 | ;; create local variables for all options, to make sure all called | 3044 | ;; create local variables for all options, to make sure all called |
| 3003 | ;; functions get the correct information | 3045 | ;; functions get the correct information |
| 3004 | (mapc (lambda (x) | 3046 | (mapc (lambda (x) |
| 3005 | (set (make-local-variable (cdr x)) | 3047 | (set (make-local-variable (nth 2 x)) |
| 3006 | (plist-get opt-plist (car x)))) | 3048 | (plist-get opt-plist (car x)))) |
| 3007 | org-export-plist-vars) | 3049 | org-export-plist-vars) |
| 3008 | (setq umax (if arg (prefix-numeric-value arg) | 3050 | (setq umax (if arg (prefix-numeric-value arg) |
| @@ -3259,7 +3301,7 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3259 | "<a href=\"#" | 3301 | "<a href=\"#" |
| 3260 | (org-solidify-link-text | 3302 | (org-solidify-link-text |
| 3261 | (save-match-data (org-link-unescape path)) nil) | 3303 | (save-match-data (org-link-unescape path)) nil) |
| 3262 | "\"" attr ">" | 3304 | "\"" attr ">" |
| 3263 | (org-export-html-format-desc desc) | 3305 | (org-export-html-format-desc desc) |
| 3264 | "</a>"))) | 3306 | "</a>"))) |
| 3265 | ((member type '("http" "https")) | 3307 | ((member type '("http" "https")) |
| @@ -3272,7 +3314,7 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3272 | attr (concat attr " alt=\"" path "\"")) | 3314 | attr (concat attr " alt=\"" path "\"")) |
| 3273 | "/>")) | 3315 | "/>")) |
| 3274 | (setq link (concat type ":" path)) | 3316 | (setq link (concat type ":" path)) |
| 3275 | (setq rpl (concat "<a href=\"" | 3317 | (setq rpl (concat "<a href=\"" |
| 3276 | (org-export-html-format-href link) | 3318 | (org-export-html-format-href link) |
| 3277 | "\"" attr ">" | 3319 | "\"" attr ">" |
| 3278 | (org-export-html-format-desc desc) | 3320 | (org-export-html-format-desc desc) |
| @@ -3282,7 +3324,7 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3282 | (setq link (concat type ":" path)) | 3324 | (setq link (concat type ":" path)) |
| 3283 | (setq rpl (concat "<a href=\"" | 3325 | (setq rpl (concat "<a href=\"" |
| 3284 | (org-export-html-format-href link) | 3326 | (org-export-html-format-href link) |
| 3285 | "\"" attr ">" | 3327 | "\"" attr ">" |
| 3286 | (org-export-html-format-desc desc) | 3328 | (org-export-html-format-desc desc) |
| 3287 | "</a>"))) | 3329 | "</a>"))) |
| 3288 | 3330 | ||
| @@ -3460,7 +3502,7 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 3460 | (insert (cond | 3502 | (insert (cond |
| 3461 | ((equal item-type "u") "<ul>\n<li>\n") | 3503 | ((equal item-type "u") "<ul>\n<li>\n") |
| 3462 | ((equal item-type "o") "<ol>\n<li>\n") | 3504 | ((equal item-type "o") "<ol>\n<li>\n") |
| 3463 | ((equal item-type "d") | 3505 | ((equal item-type "d") |
| 3464 | (format "<dl>\n<dt>%s</dt><dd>\n" item-tag)))) | 3506 | (format "<dl>\n<dt>%s</dt><dd>\n" item-tag)))) |
| 3465 | (push item-type local-list-type) | 3507 | (push item-type local-list-type) |
| 3466 | (push ind local-list-indent) | 3508 | (push ind local-list-indent) |
| @@ -4356,7 +4398,7 @@ When COMBINE is non nil, add the category to each line." | |||
| 4356 | (and org-icalendar-include-body (org-get-entry))) | 4398 | (and org-icalendar-include-body (org-get-entry))) |
| 4357 | t org-icalendar-include-body) | 4399 | t org-icalendar-include-body) |
| 4358 | location (org-icalendar-cleanup-string | 4400 | location (org-icalendar-cleanup-string |
| 4359 | (org-entry-get nil "LOCATION")) | 4401 | (org-entry-get nil "LOCATION" 'selective)) |
| 4360 | uid (if org-icalendar-store-UID | 4402 | uid (if org-icalendar-store-UID |
| 4361 | (org-id-get-create) | 4403 | (org-id-get-create) |
| 4362 | (or (org-id-get) (org-id-new))) | 4404 | (or (org-id-get) (org-id-new))) |
| @@ -4450,7 +4492,7 @@ END:VEVENT\n" | |||
| 4450 | (insert sexp "\n")))) | 4492 | (insert sexp "\n")))) |
| 4451 | (princ (org-diary-to-ical-string sexp-buffer)) | 4493 | (princ (org-diary-to-ical-string sexp-buffer)) |
| 4452 | (kill-buffer sexp-buffer)) | 4494 | (kill-buffer sexp-buffer)) |
| 4453 | 4495 | ||
| 4454 | (when org-icalendar-include-todo | 4496 | (when org-icalendar-include-todo |
| 4455 | (setq prefix "TODO-") | 4497 | (setq prefix "TODO-") |
| 4456 | (goto-char (point-min)) | 4498 | (goto-char (point-min)) |
| @@ -4478,7 +4520,7 @@ END:VEVENT\n" | |||
| 4478 | (and org-icalendar-include-body (org-get-entry))) | 4520 | (and org-icalendar-include-body (org-get-entry))) |
| 4479 | t org-icalendar-include-body) | 4521 | t org-icalendar-include-body) |
| 4480 | location (org-icalendar-cleanup-string | 4522 | location (org-icalendar-cleanup-string |
| 4481 | (org-entry-get nil "LOCATION")) | 4523 | (org-entry-get nil "LOCATION" 'selective)) |
| 4482 | due (and (member 'todo-due org-icalendar-use-deadline) | 4524 | due (and (member 'todo-due org-icalendar-use-deadline) |
| 4483 | (org-entry-get nil "DEADLINE")) | 4525 | (org-entry-get nil "DEADLINE")) |
| 4484 | start (and (member 'todo-start org-icalendar-use-scheduled) | 4526 | start (and (member 'todo-start org-icalendar-use-scheduled) |
| @@ -4501,7 +4543,7 @@ END:VEVENT\n" | |||
| 4501 | (setq pri org-default-priority)) | 4543 | (setq pri org-default-priority)) |
| 4502 | (setq pri (floor (- 9 (* 8. (/ (float (- org-lowest-priority pri)) | 4544 | (setq pri (floor (- 9 (* 8. (/ (float (- org-lowest-priority pri)) |
| 4503 | (- org-lowest-priority org-highest-priority)))))) | 4545 | (- org-lowest-priority org-highest-priority)))))) |
| 4504 | 4546 | ||
| 4505 | (princ (format "BEGIN:VTODO | 4547 | (princ (format "BEGIN:VTODO |
| 4506 | UID: %s | 4548 | UID: %s |
| 4507 | %s | 4549 | %s |
diff --git a/lisp/org/org-export-latex.el b/lisp/org/org-export-latex.el index be7d5e44ed4..12565cc33ff 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.13a | 7 | ;; Version: 6.14 |
| 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 |
| @@ -144,7 +144,7 @@ providing opening and closing strings for an environment that should | |||
| 144 | represent the document section. The opening clause should have a %s | 144 | represent the document section. The opening clause should have a %s |
| 145 | to represent the section title." | 145 | to represent the section title." |
| 146 | :group 'org-export-latex | 146 | :group 'org-export-latex |
| 147 | :type '(repeat | 147 | :type '(repeat |
| 148 | (list (string :tag "LaTeX class") | 148 | (list (string :tag "LaTeX class") |
| 149 | (string :tag "LaTeX header") | 149 | (string :tag "LaTeX header") |
| 150 | (repeat :tag "Levels" :inline t | 150 | (repeat :tag "Levels" :inline t |
| @@ -423,6 +423,9 @@ when PUB-DIR is set, use this as the publishing directory." | |||
| 423 | region :emph-multiline t | 423 | region :emph-multiline t |
| 424 | :for-LaTeX t | 424 | :for-LaTeX t |
| 425 | :comments nil | 425 | :comments nil |
| 426 | :tags (plist-get opt-plist :tags) | ||
| 427 | :priority (plist-get opt-plist :priority) | ||
| 428 | :todo-keywords (plist-get opt-plist :todo-keywords) | ||
| 426 | :add-text (if (eq to-buffer 'string) nil text) | 429 | :add-text (if (eq to-buffer 'string) nil text) |
| 427 | :skip-before-1st-heading skip | 430 | :skip-before-1st-heading skip |
| 428 | :select-tags (plist-get opt-plist :select-tags) | 431 | :select-tags (plist-get opt-plist :select-tags) |
| @@ -1175,7 +1178,7 @@ If TIMESTAMPS, convert timestamps, otherwise delete them." | |||
| 1175 | (goto-char (point-min)) | 1178 | (goto-char (point-min)) |
| 1176 | (while (re-search-forward "^[ \t]*\\begin{\\([a-zA-Z]+\\)}" nil t) | 1179 | (while (re-search-forward "^[ \t]*\\begin{\\([a-zA-Z]+\\)}" nil t) |
| 1177 | (let* ((start (progn (beginning-of-line) (point))) | 1180 | (let* ((start (progn (beginning-of-line) (point))) |
| 1178 | (end (or (and (re-search-forward | 1181 | (end (or (and (re-search-forward |
| 1179 | (concat "^[ \t]*\\end{" (match-string 1) "}" nil t) | 1182 | (concat "^[ \t]*\\end{" (match-string 1) "}" nil t) |
| 1180 | (point-at-eol))) | 1183 | (point-at-eol))) |
| 1181 | (point-max)))) | 1184 | (point-max)))) |
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el index 2ddcb9ee416..b6b7894b334 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.13a | 8 | ;; Version: 6.14 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -163,7 +163,7 @@ This is actually only part of the face definition for the text in column view. | |||
| 163 | The following faces apply, with this priority. | 163 | The following faces apply, with this priority. |
| 164 | 164 | ||
| 165 | 1. The color of the reference face. This is normally the level fact that | 165 | 1. The color of the reference face. This is normally the level fact that |
| 166 | is used in the outline. In agenda-mode, it will be the face of the | 166 | is used in the outline. In agenda-mode, it will be the face of the |
| 167 | first character in the line. The color is explicitly retained to | 167 | first character in the line. The color is explicitly retained to |
| 168 | make sure that the column line still looks a bit like the structure | 168 | make sure that the column line still looks a bit like the structure |
| 169 | line it is masking. | 169 | line it is masking. |
| @@ -269,7 +269,9 @@ column view defines special faces for each outline level. See the file | |||
| 269 | 269 | ||
| 270 | (defface org-tag | 270 | (defface org-tag |
| 271 | '((t (:bold t))) | 271 | '((t (:bold t))) |
| 272 | "Face for tags." | 272 | "Default face for tags. |
| 273 | Note that the variable `org-tag-faces' can be used to overrule this face for | ||
| 274 | specific tags." | ||
| 273 | :group 'org-faces) | 275 | :group 'org-faces) |
| 274 | 276 | ||
| 275 | (defface org-todo ; font-lock-warning-face | 277 | (defface org-todo ; font-lock-warning-face |
| @@ -313,6 +315,31 @@ list of attributes, like (:foreground \"blue\" :weight bold :underline t)." | |||
| 313 | (string :tag "keyword") | 315 | (string :tag "keyword") |
| 314 | (sexp :tag "face")))) | 316 | (sexp :tag "face")))) |
| 315 | 317 | ||
| 318 | (defvar org-tags-special-faces-re nil) | ||
| 319 | (defun org-set-tag-faces (var value) | ||
| 320 | (set var value) | ||
| 321 | (if (not value) | ||
| 322 | (setq org-tags-special-faces-re nil) | ||
| 323 | (setq org-tags-special-faces-re | ||
| 324 | (concat ":\\(" (mapconcat 'car value "\\|") "\\):")))) | ||
| 325 | |||
| 326 | (defcustom org-tag-faces nil | ||
| 327 | "Faces for specific tags. | ||
| 328 | This is a list of cons cells, with tags in the car and faces in the cdr. | ||
| 329 | The face can be a symbol, or a property list of attributes, | ||
| 330 | like (:foreground \"blue\" :weight bold :underline t). | ||
| 331 | If you set this variable through customize, it will immediately be effective | ||
| 332 | in new buffers and in modified lines. | ||
| 333 | If you set it with Lisp, a restart of Emacs is required to activate the | ||
| 334 | changes." | ||
| 335 | :group 'org-faces | ||
| 336 | :group 'org-tags | ||
| 337 | :set 'org-set-tag-faces | ||
| 338 | :type '(repeat | ||
| 339 | (cons | ||
| 340 | (string :tag "Tag") | ||
| 341 | (sexp :tag "Face")))) | ||
| 342 | |||
| 316 | (defface org-table ;; originally copied from font-lock-function-name-face | 343 | (defface org-table ;; originally copied from font-lock-function-name-face |
| 317 | (org-compatible-face nil | 344 | (org-compatible-face nil |
| 318 | '((((class color) (min-colors 88) (background light)) (:foreground "Blue1")) | 345 | '((((class color) (min-colors 88) (background light)) (:foreground "Blue1")) |
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el index 8cc11f1eefa..1058b0d988c 100644 --- a/lisp/org/org-gnus.el +++ b/lisp/org/org-gnus.el | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | ;; Tassilo Horn <tassilo at member dot fsf dot org> | 6 | ;; Tassilo Horn <tassilo at member dot fsf 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.13a | 9 | ;; Version: 6.14 |
| 10 | ;; | 10 | ;; |
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | ;; | 12 | ;; |
| @@ -39,8 +39,7 @@ | |||
| 39 | ;; Customization variables | 39 | ;; Customization variables |
| 40 | 40 | ||
| 41 | (when (fboundp 'defvaralias) | 41 | (when (fboundp 'defvaralias) |
| 42 | (defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links | 42 | (defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links)) |
| 43 | "Deprecated name for `org-gnus-prefer-web-links'.")) | ||
| 44 | 43 | ||
| 45 | (defcustom org-gnus-prefer-web-links nil | 44 | (defcustom org-gnus-prefer-web-links nil |
| 46 | "Non-nil means, `org-store-link' will create web links to Google groups. | 45 | "Non-nil means, `org-store-link' will create web links to Google groups. |
| @@ -140,6 +139,7 @@ If `org-store-link' was called with a prefix arg the meaning of | |||
| 140 | (setq desc (org-email-link-description) | 139 | (setq desc (org-email-link-description) |
| 141 | link (org-gnus-article-link group newsgroups message-id x-no-archive)) | 140 | link (org-gnus-article-link group newsgroups message-id x-no-archive)) |
| 142 | (org-add-link-props :link link :description desc) | 141 | (org-add-link-props :link link :description desc) |
| 142 | (gnus-summary-toggle-header -1) | ||
| 143 | link)))) | 143 | link)))) |
| 144 | 144 | ||
| 145 | (defun org-gnus-open (path) | 145 | (defun org-gnus-open (path) |
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el index 8fa5ff15ea5..143e0ee0c1e 100644 --- a/lisp/org/org-id.el +++ b/lisp/org/org-id.el | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | ;;; org-id.el --- Global identifier for Org-mode entries | 1 | ;;; org-id.el --- Global identifiers for Org-mode entries |
| 2 | ;; Copyright (C) 2008 Free Software Foundation, Inc. | 2 | ;; Copyright (C) 2008 Free Software Foundation, Inc. |
| 3 | ;; | 3 | ;; |
| 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.13a | 7 | ;; Version: 6.14 |
| 8 | ;; | 8 | ;; |
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
| @@ -116,17 +116,42 @@ be added." | |||
| 116 | :group 'org-id | 116 | :group 'org-id |
| 117 | :type 'boolean) | 117 | :type 'boolean) |
| 118 | 118 | ||
| 119 | (defcustom org-id-track-globally t | ||
| 120 | "Non-nil means, track ID's trhough files, so that links work globally. | ||
| 121 | This work by maintaining a hash table for ID's and writing this table | ||
| 122 | to disk when exiting Emacs. Because of this, it works best if you use | ||
| 123 | a single Emacs process, not many. | ||
| 124 | |||
| 125 | When nil, ID's are not tracked. Links to ID's will still work within | ||
| 126 | a buffer, but not if the entry is located in another file. | ||
| 127 | ID's can still be used if the entry with the id is in the same file as | ||
| 128 | the link." | ||
| 129 | :group 'org-id | ||
| 130 | :type 'boolean) | ||
| 131 | |||
| 119 | (defcustom org-id-locations-file (convert-standard-filename | 132 | (defcustom org-id-locations-file (convert-standard-filename |
| 120 | "~/.org-id-locations") | 133 | "~/.emacs.d/.org-id-locations") |
| 121 | "The file for remembering the last ID number generated." | 134 | "The file for remembering in which file an ID was defined. |
| 135 | This variable is only relevant when `org-id-track-globally' is set." | ||
| 122 | :group 'org-id | 136 | :group 'org-id |
| 123 | :type 'file) | 137 | :type 'file) |
| 124 | 138 | ||
| 125 | (defvar org-id-locations nil | 139 | (defvar org-id-locations nil |
| 126 | "List of files with ID's in those files.") | 140 | "List of files with ID's in those files. |
| 141 | Depending on `org-id-use-hash' this can also be a hash table mapping ID's | ||
| 142 | to files.") | ||
| 143 | |||
| 144 | (defvar org-id-files nil | ||
| 145 | "List of files that contain ID's.") | ||
| 127 | 146 | ||
| 128 | (defcustom org-id-extra-files 'org-agenda-text-search-extra-files | 147 | (defcustom org-id-extra-files 'org-agenda-text-search-extra-files |
| 129 | "Files to be searched for ID's, besides the agenda files." | 148 | "Files to be searched for ID's, besides the agenda files. |
| 149 | When Org reparses files to remake the list of files and ID's it is tracking, | ||
| 150 | it will normally scan the agenda files, the archives related to agenda files, | ||
| 151 | any files that are listed as ID containing in the current register, and | ||
| 152 | any Org-mode files currently visited by Emacs. | ||
| 153 | You can list additional files here. | ||
| 154 | This variable is only relevant when `org-id-track-globally' is set." | ||
| 130 | :group 'org-id | 155 | :group 'org-id |
| 131 | :type | 156 | :type |
| 132 | '(choice | 157 | '(choice |
| @@ -134,6 +159,14 @@ be added." | |||
| 134 | (repeat :tag "List of files" | 159 | (repeat :tag "List of files" |
| 135 | (file)))) | 160 | (file)))) |
| 136 | 161 | ||
| 162 | (defcustom org-id-search-archives t | ||
| 163 | "Non-nil means, search also the archive files of agenda files for entries. | ||
| 164 | This is a possibility to reduce overhead, but it measn that entries moved | ||
| 165 | to the archives can no longer be found by ID. | ||
| 166 | This variable is only relevant when `org-id-track-globally' is set." | ||
| 167 | :group 'org-id | ||
| 168 | :type 'boolean) | ||
| 169 | |||
| 137 | ;;; The API functions | 170 | ;;; The API functions |
| 138 | 171 | ||
| 139 | ;;;###autoload | 172 | ;;;###autoload |
| @@ -145,13 +178,13 @@ With optional argument FORCE, force the creation of a new ID." | |||
| 145 | (when force | 178 | (when force |
| 146 | (org-entry-put (point) "ID" nil)) | 179 | (org-entry-put (point) "ID" nil)) |
| 147 | (org-id-get (point) 'create)) | 180 | (org-id-get (point) 'create)) |
| 148 | 181 | ||
| 149 | ;;;###autoload | 182 | ;;;###autoload |
| 150 | (defun org-id-copy () | 183 | (defun org-id-copy () |
| 151 | "Copy the ID of the entry at point to the kill ring. | 184 | "Copy the ID of the entry at point to the kill ring. |
| 152 | Create an ID if necessary." | 185 | Create an ID if necessary." |
| 153 | (interactive) | 186 | (interactive) |
| 154 | (kill-new (org-id-get nil 'create))) | 187 | (kill-new (org-id-get nil 'create))) |
| 155 | 188 | ||
| 156 | ;;;###autoload | 189 | ;;;###autoload |
| 157 | (defun org-id-get (&optional pom create prefix) | 190 | (defun org-id-get (&optional pom create prefix) |
| @@ -180,10 +213,10 @@ headlines. When omitted, all headlines in all agenda files are | |||
| 180 | eligible. | 213 | eligible. |
| 181 | It returns the ID of the entry. If necessary, the ID is created." | 214 | It returns the ID of the entry. If necessary, the ID is created." |
| 182 | (let* ((org-refile-targets (or targets '((nil . (:maxlevel . 10))))) | 215 | (let* ((org-refile-targets (or targets '((nil . (:maxlevel . 10))))) |
| 183 | (org-refile-use-outline-path | 216 | (org-refile-use-outline-path |
| 184 | (if (caar org-refile-targets) 'file t)) | 217 | (if (caar org-refile-targets) 'file t)) |
| 185 | (spos (org-refile-get-location "Entry: ")) | 218 | (spos (org-refile-get-location "Entry: ")) |
| 186 | (pom (and spos (move-marker (make-marker) (nth 3 spos) | 219 | (pom (and spos (move-marker (make-marker) (nth 3 spos) |
| 187 | (get-file-buffer (nth 1 spos)))))) | 220 | (get-file-buffer (nth 1 spos)))))) |
| 188 | (prog1 (org-id-get pom 'create) | 221 | (prog1 (org-id-get pom 'create) |
| 189 | (move-marker pom nil)))) | 222 | (move-marker pom nil)))) |
| @@ -202,14 +235,14 @@ It returns the ID of the entry. If necessary, the ID is created." | |||
| 202 | (defun org-id-goto (id) | 235 | (defun org-id-goto (id) |
| 203 | "Switch to the buffer containing the entry with id ID. | 236 | "Switch to the buffer containing the entry with id ID. |
| 204 | Move the cursor to that entry in that buffer." | 237 | Move the cursor to that entry in that buffer." |
| 205 | (interactive) | 238 | (interactive "sID: ") |
| 206 | (let ((m (org-id-find id 'marker))) | 239 | (let ((m (org-id-find id 'marker))) |
| 207 | (unless m | 240 | (unless m |
| 208 | (error "Cannot find entry with ID \"%s\"" id)) | 241 | (error "Cannot find entry with ID \"%s\"" id)) |
| 209 | (switch-to-buffer (marker-buffer m)) | 242 | (switch-to-buffer (marker-buffer m)) |
| 210 | (goto-char m) | 243 | (goto-char m) |
| 211 | (move-marker m nil) | 244 | (move-marker m nil) |
| 212 | (org-show-context))) | 245 | (org-show-context))) |
| 213 | 246 | ||
| 214 | ;;;###autoload | 247 | ;;;###autoload |
| 215 | (defun org-id-find (id &optional markerp) | 248 | (defun org-id-find (id &optional markerp) |
| @@ -326,77 +359,153 @@ and time is the usual three-integer representation of time." | |||
| 326 | 359 | ||
| 327 | ;; Storing ID locations (files) | 360 | ;; Storing ID locations (files) |
| 328 | 361 | ||
| 329 | (defun org-id-update-id-locations () | 362 | (defun org-id-update-id-locations (&optional files check) |
| 330 | "Scan relevant files for ID's. | 363 | "Scan relevant files for ID's. |
| 331 | Store the relation between files and corresponding ID's." | 364 | Store the relation between files and corresponding ID's. |
| 365 | This will scan all agenda files, all associated archives, and all | ||
| 366 | files currently mentioned in `org-id-locations'. | ||
| 367 | When FILES is given, scan these files instead." | ||
| 332 | (interactive) | 368 | (interactive) |
| 333 | (let ((files (append (org-agenda-files) | 369 | (if (not org-id-track-globally) |
| 334 | (if (symbolp org-id-extra-files) | 370 | (error "Please turn on `org-id-track-globally' if you want to track id's.") |
| 335 | (symbol-value org-id-extra-files) | 371 | (let ((files |
| 336 | org-id-extra-files))) | 372 | (or files |
| 337 | org-agenda-new-buffers | 373 | (append |
| 338 | file ids reg found id) | 374 | ;; Agenda files and all associated archives |
| 339 | (while (setq file (pop files)) | 375 | (org-agenda-files t org-id-search-archives) |
| 340 | (setq ids nil) | 376 | ;; Explicit extra files |
| 341 | (with-current-buffer (org-get-agenda-file-buffer file) | 377 | (if (symbolp org-id-extra-files) |
| 342 | (save-excursion | 378 | (symbol-value org-id-extra-files) |
| 343 | (save-restriction | 379 | org-id-extra-files) |
| 344 | (widen) | 380 | ;; Files associated with live org-mode buffers |
| 345 | (goto-char (point-min)) | 381 | (delq nil |
| 346 | (while (re-search-forward "^[ \t]*:ID:[ \t]+\\(\\S-+\\)[ \t]*$" | 382 | (mapcar (lambda (b) |
| 347 | nil t) | 383 | (with-current-buffer b |
| 348 | (setq id (org-match-string-no-properties 1)) | 384 | (and (org-mode-p) (buffer-file-name)))) |
| 349 | (if (member id found) | 385 | (buffer-list))) |
| 350 | (error "Duplicate ID \"%s\"" id)) | 386 | ;; All files known to have id's |
| 351 | (push id found) | 387 | org-id-files))) |
| 352 | (push id ids)) | 388 | org-agenda-new-buffers |
| 353 | (push (cons file ids) reg))))) | 389 | file nfiles tfile ids reg found id seen (ndup 0)) |
| 354 | (org-release-buffers org-agenda-new-buffers) | 390 | (setq nfiles (length files)) |
| 355 | (setq org-agenda-new-buffers nil) | 391 | (while (setq file (pop files)) |
| 356 | (setq org-id-locations reg) | 392 | (message "Finding ID locations (%d/%d files): %s" |
| 357 | (org-id-locations-save))) | 393 | (- nfiles (length files)) nfiles file) |
| 394 | (setq tfile (file-truename file)) | ||
| 395 | (when (and (file-exists-p file) (not (member tfile seen))) | ||
| 396 | (push tfile seen) | ||
| 397 | (setq ids nil) | ||
| 398 | (with-current-buffer (org-get-agenda-file-buffer file) | ||
| 399 | (save-excursion | ||
| 400 | (save-restriction | ||
| 401 | (widen) | ||
| 402 | (goto-char (point-min)) | ||
| 403 | (while (re-search-forward "^[ \t]*:ID:[ \t]+\\(\\S-+\\)[ \t]*$" | ||
| 404 | nil t) | ||
| 405 | (setq id (org-match-string-no-properties 1)) | ||
| 406 | (if (member id found) | ||
| 407 | (progn | ||
| 408 | (message "Duplicate ID \"%s\"" id) | ||
| 409 | (setq ndup (1+ ndup))) | ||
| 410 | (push id found) | ||
| 411 | (push id ids))) | ||
| 412 | (push (cons (abbreviate-file-name file) ids) reg)))))) | ||
| 413 | (org-release-buffers org-agenda-new-buffers) | ||
| 414 | (setq org-agenda-new-buffers nil) | ||
| 415 | (setq org-id-locations reg) | ||
| 416 | (setq org-id-files (mapcar 'car org-id-locations)) | ||
| 417 | (org-id-locations-save) ;; this function can also handle the alist form | ||
| 418 | ;; now convert to a hash | ||
| 419 | (setq org-id-locations (org-id-alist-to-hash org-id-locations)) | ||
| 420 | (if (> ndup 0) | ||
| 421 | (message "WARNING: %d duplicate ID's found, check *Messages* buffer" ndup) | ||
| 422 | (message "%d unique files scanned for ID's" (length org-id-files))) | ||
| 423 | org-id-locations))) | ||
| 358 | 424 | ||
| 359 | (defun org-id-locations-save () | 425 | (defun org-id-locations-save () |
| 360 | "Save `org-id-locations' in `org-id-locations-file'." | 426 | "Save `org-id-locations' in `org-id-locations-file'." |
| 361 | (with-temp-file org-id-locations-file | 427 | (when org-id-track-globally |
| 362 | (print org-id-locations (current-buffer)))) | 428 | (let ((out (if (hash-table-p org-id-locations) |
| 429 | (org-id-hash-to-alist org-id-locations) | ||
| 430 | org-id-locations))) | ||
| 431 | (with-temp-file org-id-locations-file | ||
| 432 | (print out (current-buffer)))))) | ||
| 363 | 433 | ||
| 364 | (defun org-id-locations-load () | 434 | (defun org-id-locations-load () |
| 365 | "Read the data from `org-id-locations-file'." | 435 | "Read the data from `org-id-locations-file'." |
| 366 | (setq org-id-locations nil) | 436 | (setq org-id-locations nil) |
| 367 | (with-temp-buffer | 437 | (when org-id-track-globally |
| 368 | (condition-case nil | 438 | (with-temp-buffer |
| 369 | (progn | 439 | (condition-case nil |
| 370 | (insert-file-contents-literally org-id-locations-file) | 440 | (progn |
| 371 | (goto-char (point-min)) | 441 | (insert-file-contents-literally org-id-locations-file) |
| 372 | (setq org-id-locations (read (current-buffer)))) | 442 | (goto-char (point-min)) |
| 373 | (error | 443 | (setq org-id-locations (read (current-buffer)))) |
| 374 | (message "Could not read org-id-values from %s. Setting it to nil." | 444 | (error |
| 375 | org-id-locations-file))))) | 445 | (message "Could not read org-id-values from %s. Setting it to nil." |
| 446 | org-id-locations-file)))) | ||
| 447 | (setq org-id-files (mapcar 'car org-id-locations)) | ||
| 448 | (setq org-id-locations (org-id-alist-to-hash org-id-locations)))) | ||
| 376 | 449 | ||
| 377 | (defun org-id-add-location (id file) | 450 | (defun org-id-add-location (id file) |
| 378 | "Add the ID with location FILE to the database of ID loations." | 451 | "Add the ID with location FILE to the database of ID loations." |
| 379 | (when (and id file) ; don't error when called from a buffer with no file | 452 | ;; Only if global tracking is on, and when the buffer has a file |
| 453 | (when (and org-id-track-globally id file) | ||
| 380 | (unless org-id-locations (org-id-locations-load)) | 454 | (unless org-id-locations (org-id-locations-load)) |
| 381 | (catch 'exit | 455 | (puthash id (abbreviate-file-name file) org-id-locations) |
| 382 | (let ((locs org-id-locations) list) | 456 | (add-to-list 'org-id-files (abbreviate-file-name file)))) |
| 383 | (while (setq list (pop locs)) | 457 | |
| 384 | (when (equal (file-truename file) (file-truename (car list))) | 458 | (add-hook 'kill-emacs-hook 'org-id-locations-save) |
| 385 | (setcdr list (cons id (cdr list))) | 459 | |
| 386 | (throw 'exit t)))) | 460 | (defun org-id-hash-to-alist (hash) |
| 387 | (push (list file id) org-id-locations)) | 461 | "Turn an org-id hash into an alist, so that it can be written to a file." |
| 388 | (org-id-locations-save))) | 462 | (let (res x) |
| 463 | (maphash | ||
| 464 | (lambda (k v) | ||
| 465 | (if (setq x (member v res)) | ||
| 466 | (push k (cdr x)) | ||
| 467 | (push (list v k) res))) | ||
| 468 | hash) | ||
| 469 | res)) | ||
| 470 | |||
| 471 | (defun org-id-alist-to-hash (list) | ||
| 472 | "Turn an org-id location list into a hash table." | ||
| 473 | (let ((res (make-hash-table | ||
| 474 | :test 'equal | ||
| 475 | :size (apply '+ (mapcar 'length list)))) | ||
| 476 | f i) | ||
| 477 | (mapc | ||
| 478 | (lambda (x) | ||
| 479 | (setq f (car x)) | ||
| 480 | (mapc (lambda (i) (puthash i f res)) (cdr x))) | ||
| 481 | list) | ||
| 482 | res)) | ||
| 483 | |||
| 484 | (defun org-id-paste-tracker (txt &optional buffer-or-file) | ||
| 485 | "Update any ID's in TXT and assign BUFFER-OR-FILE to them." | ||
| 486 | (when org-id-track-globally | ||
| 487 | (save-match-data | ||
| 488 | (setq buffer-or-file (or buffer-or-file (current-buffer))) | ||
| 489 | (when (bufferp buffer-or-file) | ||
| 490 | (setq buffer-or-file (or (buffer-base-buffer buffer-or-file) | ||
| 491 | buffer-or-file)) | ||
| 492 | (setq buffer-or-file (buffer-file-name buffer-or-file))) | ||
| 493 | (when buffer-or-file | ||
| 494 | (let ((fname (abbreviate-file-name buffer-or-file)) | ||
| 495 | (s 0)) | ||
| 496 | (while (string-match "^[ \t]*:ID:[ \t]+\\([^ \t\n\r]+\\)" txt s) | ||
| 497 | (setq s (match-end 0)) | ||
| 498 | (org-id-add-location (match-string 1 txt) fname))))))) | ||
| 389 | 499 | ||
| 390 | ;; Finding entries with specified id | 500 | ;; Finding entries with specified id |
| 391 | 501 | ||
| 392 | (defun org-id-find-id-file (id) | 502 | (defun org-id-find-id-file (id) |
| 393 | "Query the id database for the file in which this ID is located." | 503 | "Query the id database for the file in which this ID is located." |
| 394 | (unless org-id-locations (org-id-locations-load)) | 504 | (unless org-id-locations (org-id-locations-load)) |
| 395 | (catch 'found | 505 | (or (gethash id org-id-locations) |
| 396 | (mapc (lambda (x) (if (member id (cdr x)) | 506 | ;; ball back on current buffer |
| 397 | (throw 'found (car x)))) | 507 | (buffer-file-name (or (buffer-base-buffer (current-buffer)) |
| 398 | org-id-locations) | 508 | (current-buffer))))) |
| 399 | nil)) | ||
| 400 | 509 | ||
| 401 | (defun org-id-find-id-in-file (id file &optional markerp) | 510 | (defun org-id-find-id-in-file (id file &optional markerp) |
| 402 | "Return the position of the entry ID in FILE. | 511 | "Return the position of the entry ID in FILE. |
| @@ -415,8 +524,35 @@ optional argument MARKERP, return the position as a new marker." | |||
| 415 | (move-marker (make-marker) pos buf) | 524 | (move-marker (make-marker) pos buf) |
| 416 | (cons file pos)))))))) | 525 | (cons file pos)))))))) |
| 417 | 526 | ||
| 527 | ;; id link type | ||
| 528 | |||
| 529 | ;; Calling the following function is hard-coded into `org-store-link', | ||
| 530 | ;; so we do have to add it to `org-store-link-functions'. | ||
| 531 | |||
| 532 | (defun org-id-store-link () | ||
| 533 | "Store a link to the current entry, using it's ID." | ||
| 534 | (interactive) | ||
| 535 | (let* ((link (org-make-link "id:" (org-id-get-create))) | ||
| 536 | (desc (save-excursion | ||
| 537 | (org-back-to-heading t) | ||
| 538 | (or (and (looking-at org-complex-heading-regexp) | ||
| 539 | (if (match-end 4) (match-string 4) (match-string 0))) | ||
| 540 | link)))) | ||
| 541 | (org-store-link-props :link link :description desc :type "id") | ||
| 542 | link)) | ||
| 543 | |||
| 544 | (defun org-id-open (id) | ||
| 545 | "Go to the entry with id ID." | ||
| 546 | (org-mark-ring-push) | ||
| 547 | (switch-to-buffer-other-window (current-buffer)) | ||
| 548 | (org-id-goto id)) | ||
| 549 | |||
| 550 | (org-add-link-type "id" 'org-id-open) | ||
| 551 | |||
| 418 | (provide 'org-id) | 552 | (provide 'org-id) |
| 419 | 553 | ||
| 420 | ;;; org-id.el ends here | 554 | ;;; org-id.el ends here |
| 421 | 555 | ||
| 422 | ;; arch-tag: e5abaca4-e16f-4b25-832a-540cfb63a712 | 556 | ;; arch-tag: e5abaca4-e16f-4b25-832a-540cfb63a712 |
| 557 | |||
| 558 | |||
diff --git a/lisp/org/org-info.el b/lisp/org/org-info.el index 5891d70b122..bbd8fbb77a4 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.13a | 8 | ;; Version: 6.14 |
| 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 8527d4a0a88..897f0c93ff8 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.13a | 7 | ;; Version: 6.14 |
| 8 | ;; | 8 | ;; |
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
diff --git a/lisp/org/org-jsinfo.el b/lisp/org/org-jsinfo.el index e8221f7fed3..5f5c0b06733 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.13a | 8 | ;; Version: 6.14 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -106,10 +106,10 @@ means to use the maximum value consistent with other options." | |||
| 106 | (defcustom org-infojs-template | 106 | (defcustom org-infojs-template |
| 107 | "<script type=\"text/javascript\" src=\"%SCRIPT_PATH\"></script> | 107 | "<script type=\"text/javascript\" src=\"%SCRIPT_PATH\"></script> |
| 108 | <script type=\"text/javascript\" > | 108 | <script type=\"text/javascript\" > |
| 109 | /* <![CDATA[ */ | 109 | <!--/*--><![CDATA[/*><!--*/ |
| 110 | %MANAGER_OPTIONS | 110 | %MANAGER_OPTIONS |
| 111 | org_html_manager.setup(); // activate after the parameterd are set | 111 | org_html_manager.setup(); // activate after the parameterd are set |
| 112 | /* ]]> */ | 112 | /*]]>*/--> |
| 113 | </script>" | 113 | </script>" |
| 114 | "The template for the export style additions when org-info.js is used. | 114 | "The template for the export style additions when org-info.js is used. |
| 115 | Option settings will replace the %MANAGER-OPTIONS cookie." | 115 | Option settings will replace the %MANAGER-OPTIONS cookie." |
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el index d554cb12562..324d56cae72 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.13a | 9 | ;; Version: 6.14 |
| 10 | ;; | 10 | ;; |
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | ;; | 12 | ;; |
| @@ -45,6 +45,7 @@ | |||
| 45 | (declare-function org-skip-whitespace "org" ()) | 45 | (declare-function org-skip-whitespace "org" ()) |
| 46 | (declare-function org-trim "org" (s)) | 46 | (declare-function org-trim "org" (s)) |
| 47 | (declare-function org-get-indentation "org" (&optional line)) | 47 | (declare-function org-get-indentation "org" (&optional line)) |
| 48 | (declare-function org-timer-item "org-timer" (&optional arg)) | ||
| 48 | 49 | ||
| 49 | (defgroup org-plain-lists nil | 50 | (defgroup org-plain-lists nil |
| 50 | "Options concerning plain lists in Org-mode." | 51 | "Options concerning plain lists in Org-mode." |
| @@ -185,35 +186,42 @@ Return t when things worked, nil when we are not in an item." | |||
| 185 | (descp (save-excursion (goto-char (match-beginning 0)) | 186 | (descp (save-excursion (goto-char (match-beginning 0)) |
| 186 | (beginning-of-line 1) | 187 | (beginning-of-line 1) |
| 187 | (save-match-data | 188 | (save-match-data |
| 188 | (looking-at "[ \t]*.*? ::")))) | 189 | (and (looking-at "[ \t]*\\(.*?\\) ::") |
| 190 | (match-string 1))))) | ||
| 191 | (timerp (and descp | ||
| 192 | (save-match-data | ||
| 193 | (string-match "^[-+*][ \t]+[0-9]+:[0-9]+:[0-9]+$" | ||
| 194 | descp)))) | ||
| 189 | (eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*") | 195 | (eow (save-excursion (beginning-of-line 1) (looking-at "[ \t]*") |
| 190 | (match-end 0))) | 196 | (match-end 0))) |
| 191 | (blank (cdr (assq 'plain-list-item org-blank-before-new-entry))) | 197 | (blank (cdr (assq 'plain-list-item org-blank-before-new-entry))) |
| 192 | pos) | 198 | pos) |
| 193 | (if descp (setq checkbox nil)) | 199 | (if descp (setq checkbox nil)) |
| 194 | (cond | 200 | (if timerp |
| 195 | ((and (org-at-item-p) (<= (point) eow)) | 201 | (progn (org-timer-item) t) |
| 196 | ;; before the bullet | 202 | (cond |
| 197 | (beginning-of-line 1) | 203 | ((and (org-at-item-p) (<= (point) eow)) |
| 198 | (open-line (if blank 2 1))) | 204 | ;; before the bullet |
| 199 | ((<= (point) eow) | 205 | (beginning-of-line 1) |
| 200 | (beginning-of-line 1)) | 206 | (open-line (if blank 2 1))) |
| 201 | (t | 207 | ((<= (point) eow) |
| 202 | (unless (org-get-alist-option org-M-RET-may-split-line 'item) | 208 | (beginning-of-line 1)) |
| 203 | (end-of-line 1) | 209 | (t |
| 204 | (delete-horizontal-space)) | 210 | (unless (org-get-alist-option org-M-RET-may-split-line 'item) |
| 205 | (newline (if blank 2 1)))) | 211 | (end-of-line 1) |
| 206 | (insert bul | 212 | (delete-horizontal-space)) |
| 207 | (if checkbox "[ ]" "") | 213 | (newline (if blank 2 1)))) |
| 208 | (if descp (concat (if checkbox " " "") | 214 | (insert bul |
| 209 | (read-string "Term: ") " :: ") "")) | 215 | (if checkbox "[ ]" "") |
| 210 | (just-one-space) | 216 | (if descp (concat (if checkbox " " "") |
| 211 | (setq pos (point)) | 217 | (read-string "Term: ") " :: ") "")) |
| 212 | (end-of-line 1) | 218 | (just-one-space) |
| 213 | (unless (= (point) pos) (just-one-space) (backward-delete-char 1))) | 219 | (setq pos (point)) |
| 214 | (org-maybe-renumber-ordered-list) | 220 | (end-of-line 1) |
| 215 | (and checkbox (org-update-checkbox-count-maybe)) | 221 | (unless (= (point) pos) (just-one-space) (backward-delete-char 1))) |
| 216 | t)) | 222 | (org-maybe-renumber-ordered-list) |
| 223 | (and checkbox (org-update-checkbox-count-maybe)) | ||
| 224 | t))) | ||
| 217 | 225 | ||
| 218 | ;;; Checkboxes | 226 | ;;; Checkboxes |
| 219 | 227 | ||
diff --git a/lisp/org/org-mac-message.el b/lisp/org/org-mac-message.el index f0d6229e7bd..5b9d3c355c5 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.13a | 6 | ;; Version: 6.14 |
| 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 0950b6d63a8..db18eff00f0 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.13a | 8 | ;; Version: 6.14 |
| 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 61bfc2fc5c5..e5e226d68a9 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.13a | 8 | ;; Version: 6.14 |
| 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-mhe.el b/lisp/org/org-mhe.el index c51b60e6a26..9938f52c980 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.13a | 8 | ;; Version: 6.14 |
| 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 7ec3bbe7afa..1e622ef0fd4 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.13a | 7 | ;; Version: 6.14 |
| 8 | ;; | 8 | ;; |
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
| @@ -177,7 +177,7 @@ Changing this variable requires a restart of Emacs to get activated." | |||
| 177 | (const :tag "S-mouse-2 and drag-mouse-3 yank link" yank-link) | 177 | (const :tag "S-mouse-2 and drag-mouse-3 yank link" yank-link) |
| 178 | (const :tag "Activate headline stars" activate-stars) | 178 | (const :tag "Activate headline stars" activate-stars) |
| 179 | (const :tag "Activate item bullets" activate-bullets) | 179 | (const :tag "Activate item bullets" activate-bullets) |
| 180 | (const :tag "Activate checkboxes" activate-checkboxes))) | 180 | (const :tag "Activate checkboxes" activate-checkboxes))) |
| 181 | 181 | ||
| 182 | (defun org-mouse-re-search-line (regexp) | 182 | (defun org-mouse-re-search-line (regexp) |
| 183 | "Search the current line for a given regular expression." | 183 | "Search the current line for a given regular expression." |
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el index 491035b7900..0fc781053b0 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.13a | 8 | ;; Version: 6.14 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -119,7 +119,7 @@ will be added. Returns the resulting property list." | |||
| 119 | "Export TABLE to DATA-FILE in a format readable by gnuplot. | 119 | "Export TABLE to DATA-FILE in a format readable by gnuplot. |
| 120 | Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE." | 120 | Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE." |
| 121 | (with-temp-file | 121 | (with-temp-file |
| 122 | data-file | 122 | data-file |
| 123 | (make-local-variable 'org-plot-timestamp-fmt) | 123 | (make-local-variable 'org-plot-timestamp-fmt) |
| 124 | (setq org-plot-timestamp-fmt (or | 124 | (setq org-plot-timestamp-fmt (or |
| 125 | (plist-get params :timefmt) | 125 | (plist-get params :timefmt) |
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el index 6e3d1af85dc..1bb96ed822d 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.13a | 7 | ;; Version: 6.14 |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | ;; | 10 | ;; |
| @@ -263,7 +263,7 @@ index of files or summary page for a given project. | |||
| 263 | generates a plain list of links to all files | 263 | generates a plain list of links to all files |
| 264 | in the project. | 264 | in the project. |
| 265 | :index-style Can be `list' (index is just an itemized list | 265 | :index-style Can be `list' (index is just an itemized list |
| 266 | of the titles of the files involved) or | 266 | of the titles of the files involved) or |
| 267 | `tree' (the directory structure of the source | 267 | `tree' (the directory structure of the source |
| 268 | files is reflected in the index). Defaults to | 268 | files is reflected in the index). Defaults to |
| 269 | `tree'." | 269 | `tree'." |
| @@ -276,7 +276,7 @@ When nil, do no timestamp checking and always publish all files." | |||
| 276 | :group 'org-publish | 276 | :group 'org-publish |
| 277 | :type 'boolean) | 277 | :type 'boolean) |
| 278 | 278 | ||
| 279 | (defcustom org-publish-timestamp-directory (convert-standard-filename | 279 | (defcustom org-publish-timestamp-directory (convert-standard-filename |
| 280 | "~/.org-timestamps/") | 280 | "~/.org-timestamps/") |
| 281 | "Name of directory in which to store publishing timestamps." | 281 | "Name of directory in which to store publishing timestamps." |
| 282 | :group 'org-publish | 282 | :group 'org-publish |
| @@ -422,7 +422,7 @@ This splices all the components into the list." | |||
| 422 | rest)) | 422 | rest)) |
| 423 | (push p rtn))) | 423 | (push p rtn))) |
| 424 | (nreverse (org-publish-delete-dups (delq nil rtn))))) | 424 | (nreverse (org-publish-delete-dups (delq nil rtn))))) |
| 425 | 425 | ||
| 426 | (defun org-publish-get-base-files-1 (base-dir &optional recurse match skip-file skip-dir) | 426 | (defun org-publish-get-base-files-1 (base-dir &optional recurse match skip-file skip-dir) |
| 427 | "Set `org-publish-temp-files' with files from BASE-DIR directory. | 427 | "Set `org-publish-temp-files' with files from BASE-DIR directory. |
| 428 | If RECURSE is non-nil, check BASE-DIR recursively. If MATCH is | 428 | If RECURSE is non-nil, check BASE-DIR recursively. If MATCH is |
| @@ -461,7 +461,7 @@ matching filenames." | |||
| 461 | ;; for skip-file and skip-dir? | 461 | ;; for skip-file and skip-dir? |
| 462 | exclude-regexp exclude-regexp) | 462 | exclude-regexp exclude-regexp) |
| 463 | (mapc (lambda (f) | 463 | (mapc (lambda (f) |
| 464 | (pushnew | 464 | (pushnew |
| 465 | (expand-file-name (concat base-dir f)) | 465 | (expand-file-name (concat base-dir f)) |
| 466 | org-publish-temp-files)) | 466 | org-publish-temp-files)) |
| 467 | include-list) | 467 | include-list) |
| @@ -470,7 +470,10 @@ matching filenames." | |||
| 470 | (defun org-publish-get-project-from-filename (filename) | 470 | (defun org-publish-get-project-from-filename (filename) |
| 471 | "Return the project FILENAME belongs." | 471 | "Return the project FILENAME belongs." |
| 472 | (let* ((project-name (cdr (assoc (expand-file-name filename) | 472 | (let* ((project-name (cdr (assoc (expand-file-name filename) |
| 473 | org-publish-files-alist)))) | 473 | org-publish-files-alist)))) |
| 474 | (dolist (prj org-publish-project-alist) | ||
| 475 | (if (member project-name (plist-get (cdr prj) :components)) | ||
| 476 | (setq project-name (car prj)))) | ||
| 474 | (assoc project-name org-publish-project-alist))) | 477 | (assoc project-name org-publish-project-alist))) |
| 475 | 478 | ||
| 476 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 479 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -619,20 +622,20 @@ Default for INDEX-FILENAME is 'index.org'." | |||
| 619 | (concat "Index for project " (car project)))) | 622 | (concat "Index for project " (car project)))) |
| 620 | (index-style (or (plist-get project-plist :index-style) | 623 | (index-style (or (plist-get project-plist :index-style) |
| 621 | 'tree)) | 624 | 'tree)) |
| 622 | (index-buffer (find-buffer-visiting index-filename)) | 625 | (visiting (find-buffer-visiting index-filename)) |
| 623 | (ifn (file-name-nondirectory index-filename)) | 626 | (ifn (file-name-nondirectory index-filename)) |
| 624 | file) | 627 | file index-buffer) |
| 625 | ;; if buffer is already open, kill it to prevent error message | 628 | (with-current-buffer (setq index-buffer |
| 626 | (if index-buffer | 629 | (or visiting (find-file index-filename))) |
| 627 | (kill-buffer index-buffer)) | 630 | (erase-buffer) |
| 628 | (with-temp-buffer | ||
| 629 | (insert (concat "#+TITLE: " index-title "\n\n")) | 631 | (insert (concat "#+TITLE: " index-title "\n\n")) |
| 630 | (while (setq file (pop files)) | 632 | (while (setq file (pop files)) |
| 631 | (let ((fn (file-name-nondirectory file)) | 633 | (let ((fn (file-name-nondirectory file)) |
| 632 | (link (file-relative-name file dir)) | 634 | (link (file-relative-name file dir)) |
| 633 | (oldlocal localdir)) | 635 | (oldlocal localdir)) |
| 634 | ;; index shouldn't index itself | 636 | ;; index shouldn't index itself |
| 635 | (unless (string= fn ifn) | 637 | (unless (equal (file-truename index-filename) |
| 638 | (file-truename file)) | ||
| 636 | (if (eq index-style 'list) | 639 | (if (eq index-style 'list) |
| 637 | (message "Generating list-style index for %s" index-title) | 640 | (message "Generating list-style index for %s" index-title) |
| 638 | (message "Generating tree-style index for %s" index-title) | 641 | (message "Generating tree-style index for %s" index-title) |
| @@ -662,10 +665,9 @@ Default for INDEX-FILENAME is 'index.org'." | |||
| 662 | ;; This is common to 'flat and 'tree | 665 | ;; This is common to 'flat and 'tree |
| 663 | (insert (concat indent-str " + [[file:" link "][" | 666 | (insert (concat indent-str " + [[file:" link "][" |
| 664 | (org-publish-find-title file) | 667 | (org-publish-find-title file) |
| 665 | "]]\n")) | 668 | "]]\n"))))) |
| 666 | ))) | 669 | (save-buffer)) |
| 667 | (write-file index-filename) | 670 | (or visiting (kill-buffer index-buffer)))) |
| 668 | (kill-buffer (current-buffer))))) | ||
| 669 | 671 | ||
| 670 | (defun org-publish-find-title (file) | 672 | (defun org-publish-find-title (file) |
| 671 | "Find the title of file in project." | 673 | "Find the title of file in project." |
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el index d9c2dd4cadf..54037736482 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.13a | 8 | ;; Version: 6.14 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -55,7 +55,7 @@ | |||
| 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 | template 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 | ||
| 61 | When this variable is nil, `C-c C-c' gives you the prompts, and | 61 | When this variable is nil, `C-c C-c' gives you the prompts, and |
| @@ -349,7 +349,7 @@ to be run from that hook to function properly." | |||
| 349 | ct)) | 349 | ct)) |
| 350 | (tpl (car entry)) | 350 | (tpl (car entry)) |
| 351 | (plist-p (if org-store-link-plist t nil)) | 351 | (plist-p (if org-store-link-plist t nil)) |
| 352 | (file (if (and (nth 1 entry) | 352 | (file (if (and (nth 1 entry) |
| 353 | (or (and (stringp (nth 1 entry)) | 353 | (or (and (stringp (nth 1 entry)) |
| 354 | (string-match "\\S-" (nth 1 entry))) | 354 | (string-match "\\S-" (nth 1 entry))) |
| 355 | (functionp (nth 1 entry)))) | 355 | (functionp (nth 1 entry)))) |
| @@ -589,7 +589,7 @@ from that hook." | |||
| 589 | (point))) | 589 | (point))) |
| 590 | (message "%s" | 590 | (message "%s" |
| 591 | (format | 591 | (format |
| 592 | (substitute-command-keys | 592 | (substitute-command-keys |
| 593 | "Restore window configuration with \\[jump-to-register] %c") | 593 | "Restore window configuration with \\[jump-to-register] %c") |
| 594 | remember-register))) | 594 | remember-register))) |
| 595 | 595 | ||
diff --git a/lisp/org/org-rmail.el b/lisp/org/org-rmail.el index f6f9e791c03..ebdb1dd990a 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.13a | 8 | ;; Version: 6.14 |
| 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 5e8442cc224..8a223bc0d9b 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.13a | 8 | ;; Version: 6.14 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -244,6 +244,14 @@ Automatically means, when TAB or RET or C-c C-c are pressed in the line." | |||
| 244 | :group 'org-table-calculation | 244 | :group 'org-table-calculation |
| 245 | :type 'boolean) | 245 | :type 'boolean) |
| 246 | 246 | ||
| 247 | (defcustom org-table-error-on-row-ref-crossing-hline t | ||
| 248 | "Non-nil means, a relative row reference that tries to cross a hline errors. | ||
| 249 | When nil, the reference will silently be to the field just next to the hline. | ||
| 250 | Coming from below, it will be the field below the hline, coming from | ||
| 251 | above, it will be the field above the hline." | ||
| 252 | :group 'org-table | ||
| 253 | :type 'boolean) | ||
| 254 | |||
| 247 | (defgroup org-table-import-export nil | 255 | (defgroup org-table-import-export nil |
| 248 | "Options concerning table import and export in Org-mode." | 256 | "Options concerning table import and export in Org-mode." |
| 249 | :tag "Org Table Import Export" | 257 | :tag "Org Table Import Export" |
| @@ -2114,7 +2122,7 @@ not overwrite the stored one." | |||
| 2114 | lispp (and (> (length form) 2)(equal (substring form 0 2) "'("))) | 2122 | lispp (and (> (length form) 2)(equal (substring form 0 2) "'("))) |
| 2115 | (if (and lispp literal) (setq lispp 'literal)) | 2123 | (if (and lispp literal) (setq lispp 'literal)) |
| 2116 | ;; Check for old vertical references | 2124 | ;; Check for old vertical references |
| 2117 | (setq form (org-rewrite-old-row-references form)) | 2125 | (setq form (org-table-rewrite-old-row-references form)) |
| 2118 | ;; Insert complex ranges | 2126 | ;; Insert complex ranges |
| 2119 | (while (and (string-match org-table-range-regexp form) | 2127 | (while (and (string-match org-table-range-regexp form) |
| 2120 | (> (length (match-string 0 form)) 1)) | 2128 | (> (length (match-string 0 form)) 1)) |
| @@ -2288,26 +2296,32 @@ and TABLE is a vector with line types." | |||
| 2288 | (if (and (not hn) on (not odir)) | 2296 | (if (and (not hn) on (not odir)) |
| 2289 | (error "should never happen");;(aref org-table-dlines on) | 2297 | (error "should never happen");;(aref org-table-dlines on) |
| 2290 | (if (and hn (> hn 0)) | 2298 | (if (and hn (> hn 0)) |
| 2291 | (setq i (org-find-row-type table i 'hline (equal hdir "-") nil hn))) | 2299 | (setq i (org-table-find-row-type table i 'hline (equal hdir "-") |
| 2300 | nil hn cline desc))) | ||
| 2292 | (if on | 2301 | (if on |
| 2293 | (setq i (org-find-row-type table i 'dline (equal odir "-") rel on))) | 2302 | (setq i (org-table-find-row-type table i 'dline (equal odir "-") |
| 2303 | rel on cline desc))) | ||
| 2294 | (+ bline i))))) | 2304 | (+ bline i))))) |
| 2295 | 2305 | ||
| 2296 | (defun org-find-row-type (table i type backwards relative n) | 2306 | (defun org-table-find-row-type (table i type backwards relative n cline desc) |
| 2307 | "FIXME: Needs more documentation." | ||
| 2297 | (let ((l (length table))) | 2308 | (let ((l (length table))) |
| 2298 | (while (> n 0) | 2309 | (while (> n 0) |
| 2299 | (while (and (setq i (+ i (if backwards -1 1))) | 2310 | (while (and (setq i (+ i (if backwards -1 1))) |
| 2300 | (>= i 0) (< i l) | 2311 | (>= i 0) (< i l) |
| 2301 | (not (eq (aref table i) type)) | 2312 | (not (eq (aref table i) type)) |
| 2302 | (if (and relative (eq (aref table i) 'hline)) | 2313 | (if (and relative (eq (aref table i) 'hline)) |
| 2303 | (progn (setq i (- i (if backwards -1 1)) n 1) nil) | 2314 | (if org-table-error-on-row-ref-crossing-hline |
| 2315 | (error "Row descriptor %s used in line %d crosses hline" desc cline) | ||
| 2316 | (progn (setq i (- i (if backwards -1 1)) n 1) nil)) | ||
| 2304 | t))) | 2317 | t))) |
| 2305 | (setq n (1- n))) | 2318 | (setq n (1- n))) |
| 2306 | (if (or (< i 0) (>= i l)) | 2319 | (if (or (< i 0) (>= i l)) |
| 2307 | (error "Row descriptor leads outside table") | 2320 | (error "Row descriptor %s used in line %d leads outside table" |
| 2321 | desc cline) | ||
| 2308 | i))) | 2322 | i))) |
| 2309 | 2323 | ||
| 2310 | (defun org-rewrite-old-row-references (s) | 2324 | (defun org-table-rewrite-old-row-references (s) |
| 2311 | (if (string-match "&[-+0-9I]" s) | 2325 | (if (string-match "&[-+0-9I]" s) |
| 2312 | (error "Formula contains old &row reference, please rewrite using @-syntax") | 2326 | (error "Formula contains old &row reference, please rewrite using @-syntax") |
| 2313 | s)) | 2327 | s)) |
| @@ -2746,10 +2760,10 @@ For example: 28 -> AB." | |||
| 2746 | (or (match-end n) (error "Cannot shift reference in this direction")) | 2760 | (or (match-end n) (error "Cannot shift reference in this direction")) |
| 2747 | (goto-char (match-beginning n)) | 2761 | (goto-char (match-beginning n)) |
| 2748 | (and (looking-at (regexp-quote (match-string n))) | 2762 | (and (looking-at (regexp-quote (match-string n))) |
| 2749 | (replace-match (org-shift-refpart (match-string 0) decr hline) | 2763 | (replace-match (org-table-shift-refpart (match-string 0) decr hline) |
| 2750 | t t))) | 2764 | t t))) |
| 2751 | 2765 | ||
| 2752 | (defun org-shift-refpart (ref &optional decr hline) | 2766 | (defun org-table-shift-refpart (ref &optional decr hline) |
| 2753 | "Shift a refrence part REF. | 2767 | "Shift a refrence part REF. |
| 2754 | If DECR is set, decrease the references row/column, else increase. | 2768 | If DECR is set, decrease the references row/column, else increase. |
| 2755 | If HLINE is set, this may be a hline reference, it certainly is not | 2769 | If HLINE is set, this may be a hline reference, it certainly is not |
| @@ -3238,7 +3252,7 @@ table editor in arbitrary modes.") | |||
| 3238 | (easy-menu-add orgtbl-mode-menu) | 3252 | (easy-menu-add orgtbl-mode-menu) |
| 3239 | (run-hooks 'orgtbl-mode-hook)) | 3253 | (run-hooks 'orgtbl-mode-hook)) |
| 3240 | (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp) | 3254 | (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp) |
| 3241 | (org-cleanup-narrow-column-properties) | 3255 | (org-table-cleanup-narrow-column-properties) |
| 3242 | (org-remove-from-invisibility-spec '(org-cwidth)) | 3256 | (org-remove-from-invisibility-spec '(org-cwidth)) |
| 3243 | (remove-hook 'before-change-functions 'org-before-change-function t) | 3257 | (remove-hook 'before-change-functions 'org-before-change-function t) |
| 3244 | (when (fboundp 'font-lock-remove-keywords) | 3258 | (when (fboundp 'font-lock-remove-keywords) |
| @@ -3247,7 +3261,7 @@ table editor in arbitrary modes.") | |||
| 3247 | (easy-menu-remove orgtbl-mode-menu) | 3261 | (easy-menu-remove orgtbl-mode-menu) |
| 3248 | (force-mode-line-update 'all)))) | 3262 | (force-mode-line-update 'all)))) |
| 3249 | 3263 | ||
| 3250 | (defun org-cleanup-narrow-column-properties () | 3264 | (defun org-table-cleanup-narrow-column-properties () |
| 3251 | "Remove all properties related to narrow-column invisibility." | 3265 | "Remove all properties related to narrow-column invisibility." |
| 3252 | (let ((s 1)) | 3266 | (let ((s 1)) |
| 3253 | (while (setq s (text-property-any s (point-max) | 3267 | (while (setq s (text-property-any s (point-max) |
| @@ -3323,7 +3337,6 @@ to execute outside of tables." | |||
| 3323 | '("\C-c'" org-table-edit-formulas) | 3337 | '("\C-c'" org-table-edit-formulas) |
| 3324 | '("\C-c`" org-table-edit-field) | 3338 | '("\C-c`" org-table-edit-field) |
| 3325 | '("\C-c*" org-table-recalculate) | 3339 | '("\C-c*" org-table-recalculate) |
| 3326 | '("\C-c|" org-table-create-or-convert-from-region) | ||
| 3327 | '("\C-c^" org-table-sort-lines) | 3340 | '("\C-c^" org-table-sort-lines) |
| 3328 | '([(control ?#)] org-table-rotate-recalc-marks))) | 3341 | '([(control ?#)] org-table-rotate-recalc-marks))) |
| 3329 | elt key fun cmd) | 3342 | elt key fun cmd) |
| @@ -3357,6 +3370,8 @@ to execute outside of tables." | |||
| 3357 | [(meta return)] "\M-\C-m")) | 3370 | [(meta return)] "\M-\C-m")) |
| 3358 | 3371 | ||
| 3359 | (org-defkey orgtbl-mode-map "\C-c\C-c" 'orgtbl-ctrl-c-ctrl-c) | 3372 | (org-defkey orgtbl-mode-map "\C-c\C-c" 'orgtbl-ctrl-c-ctrl-c) |
| 3373 | (org-defkey orgtbl-mode-map "\C-c|" 'orgtbl-create-or-convert-from-region) | ||
| 3374 | |||
| 3360 | (when orgtbl-optimized | 3375 | (when orgtbl-optimized |
| 3361 | ;; If the user wants maximum table support, we need to hijack | 3376 | ;; If the user wants maximum table support, we need to hijack |
| 3362 | ;; some standard editing functions | 3377 | ;; some standard editing functions |
| @@ -3367,6 +3382,9 @@ to execute outside of tables." | |||
| 3367 | (org-defkey orgtbl-mode-map "|" 'org-force-self-insert)) | 3382 | (org-defkey orgtbl-mode-map "|" 'org-force-self-insert)) |
| 3368 | (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu" | 3383 | (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu" |
| 3369 | '("OrgTbl" | 3384 | '("OrgTbl" |
| 3385 | ["Create or convert" org-table-create-or-convert-from-region | ||
| 3386 | :active (not (org-at-table-p)) :keys "C-c |" ] | ||
| 3387 | "--" | ||
| 3370 | ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"] | 3388 | ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"] |
| 3371 | ["Next Field" org-cycle :active (org-at-table-p) :keys "TAB"] | 3389 | ["Next Field" org-cycle :active (org-at-table-p) :keys "TAB"] |
| 3372 | ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"] | 3390 | ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"] |
| @@ -3451,6 +3469,16 @@ With prefix arg, also recompute table." | |||
| 3451 | (t (let (orgtbl-mode) | 3469 | (t (let (orgtbl-mode) |
| 3452 | (call-interactively (key-binding "\C-c\C-c"))))))) | 3470 | (call-interactively (key-binding "\C-c\C-c"))))))) |
| 3453 | 3471 | ||
| 3472 | (defun orgtbl-create-or-convert-from-region (arg) | ||
| 3473 | "Create table or convert region to table, if no conflicting binding. | ||
| 3474 | This installs the table binding `C-c |', but only if there is no | ||
| 3475 | conflicting binding to this key outside orgtbl-mode." | ||
| 3476 | (interactive "P") | ||
| 3477 | (let* (orgtbl-mode (cmd (key-binding "\C-c|"))) | ||
| 3478 | (if cmd | ||
| 3479 | (call-interactively cmd) | ||
| 3480 | (call-interactively 'org-table-create-or-convert-from-region)))) | ||
| 3481 | |||
| 3454 | (defun orgtbl-tab (arg) | 3482 | (defun orgtbl-tab (arg) |
| 3455 | "Justification and field motion for `orgtbl-mode'." | 3483 | "Justification and field motion for `orgtbl-mode'." |
| 3456 | (interactive "P") | 3484 | (interactive "P") |
| @@ -3461,8 +3489,10 @@ With prefix arg, also recompute table." | |||
| 3461 | (defun orgtbl-ret () | 3489 | (defun orgtbl-ret () |
| 3462 | "Justification and field motion for `orgtbl-mode'." | 3490 | "Justification and field motion for `orgtbl-mode'." |
| 3463 | (interactive) | 3491 | (interactive) |
| 3464 | (org-table-justify-field-maybe) | 3492 | (if (bobp) |
| 3465 | (org-table-next-row)) | 3493 | (newline) |
| 3494 | (org-table-justify-field-maybe) | ||
| 3495 | (org-table-next-row))) | ||
| 3466 | 3496 | ||
| 3467 | (defun orgtbl-self-insert-command (N) | 3497 | (defun orgtbl-self-insert-command (N) |
| 3468 | "Like `self-insert-command', use overwrite-mode for whitespace in tables. | 3498 | "Like `self-insert-command', use overwrite-mode for whitespace in tables. |
| @@ -3490,12 +3520,13 @@ overwritten, and the table is not marked as requiring realignment." | |||
| 3490 | (self-insert-command N)) | 3520 | (self-insert-command N)) |
| 3491 | (setq org-table-may-need-update t) | 3521 | (setq org-table-may-need-update t) |
| 3492 | (let (orgtbl-mode a) | 3522 | (let (orgtbl-mode a) |
| 3493 | (call-interactively | 3523 | (call-interactively |
| 3494 | (key-binding | 3524 | (or (key-binding |
| 3495 | (or (and (listp function-key-map) | 3525 | (or (and (listp function-key-map) |
| 3496 | (setq a (assoc last-input-event function-key-map)) | 3526 | (setq a (assoc last-input-event function-key-map)) |
| 3497 | (cdr a)) | 3527 | (cdr a)) |
| 3498 | (vector last-input-event))))))) | 3528 | (vector last-input-event))) |
| 3529 | 'self-insert-command))))) | ||
| 3499 | 3530 | ||
| 3500 | (defvar orgtbl-exp-regexp "^\\([-+]?[0-9][0-9.]*\\)[eE]\\([-+]?[0-9]+\\)$" | 3531 | (defvar orgtbl-exp-regexp "^\\([-+]?[0-9][0-9.]*\\)[eE]\\([-+]?[0-9]+\\)$" |
| 3501 | "Regular expression matching exponentials as produced by calc.") | 3532 | "Regular expression matching exponentials as produced by calc.") |
| @@ -3569,7 +3600,7 @@ The table is taken from the parameter TXT, or from the buffer at point." | |||
| 3569 | (unless txt | 3600 | (unless txt |
| 3570 | (unless (org-at-table-p) | 3601 | (unless (org-at-table-p) |
| 3571 | (error "No table at point"))) | 3602 | (error "No table at point"))) |
| 3572 | (let* ((txt (or txt | 3603 | (let* ((txt (or txt |
| 3573 | (buffer-substring-no-properties (org-table-begin) | 3604 | (buffer-substring-no-properties (org-table-begin) |
| 3574 | (org-table-end)))) | 3605 | (org-table-end)))) |
| 3575 | (lines (org-split-string txt "[ \t]*\n[ \t]*"))) | 3606 | (lines (org-split-string txt "[ \t]*\n[ \t]*"))) |
diff --git a/lisp/org/org-vm.el b/lisp/org/org-vm.el index fb82ee46960..a152b0395ba 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.13a | 8 | ;; Version: 6.14 |
| 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-wl.el b/lisp/org/org-wl.el index 0483e3c0d38..6fdf26960f6 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.13a | 8 | ;; Version: 6.14 |
| 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 340737be939..8171a0271f6 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.13a | 8 | ;; Version: 6.14 |
| 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.13a" | 95 | (defconst org-version "6.14" |
| 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) |
| @@ -143,7 +143,7 @@ With prefix arg HERE, insert it at point." | |||
| 143 | (let ((a (member 'org-infojs org-modules))) | 143 | (let ((a (member 'org-infojs org-modules))) |
| 144 | (and a (setcar a 'org-jsinfo)))) | 144 | (and a (setcar a 'org-jsinfo)))) |
| 145 | 145 | ||
| 146 | (defcustom org-modules '(org-bbdb org-bibtex org-gnus org-info org-jsinfo org-irc org-mew org-mhe org-rmail org-vm org-wl) | 146 | (defcustom org-modules '(org-bbdb org-bibtex org-gnus org-info org-jsinfo org-irc org-mew org-mhe org-rmail org-vm org-w3m org-wl) |
| 147 | "Modules that should always be loaded together with org.el. | 147 | "Modules that should always be loaded together with org.el. |
| 148 | If a description starts with <C>, the file is not part of Emacs | 148 | If a description starts with <C>, the file is not part of Emacs |
| 149 | and loading it will require that you have downloaded and properly installed | 149 | and loading it will require that you have downloaded and properly installed |
| @@ -172,6 +172,7 @@ to add the symbol `xyz', and the package must have a call to | |||
| 172 | (const :tag " rmail: Links to RMAIL folders/messages" org-rmail) | 172 | (const :tag " rmail: Links to RMAIL folders/messages" org-rmail) |
| 173 | (const :tag " vm: Links to VM folders/messages" org-vm) | 173 | (const :tag " vm: Links to VM folders/messages" org-vm) |
| 174 | (const :tag " wl: Links to Wanderlust folders/messages" org-wl) | 174 | (const :tag " wl: Links to Wanderlust folders/messages" org-wl) |
| 175 | (const :tag " w3m: Special cut/past from w3m to Org." org-w3m) | ||
| 175 | (const :tag " mouse: Additional mouse support" org-mouse) | 176 | (const :tag " mouse: Additional mouse support" org-mouse) |
| 176 | 177 | ||
| 177 | (const :tag "C annotate-file: Annotate a file with org syntax" org-annotate-file) | 178 | (const :tag "C annotate-file: Annotate a file with org syntax" org-annotate-file) |
| @@ -955,6 +956,40 @@ It should match if the message is from the user him/herself." | |||
| 955 | :group 'org-link-store | 956 | :group 'org-link-store |
| 956 | :type 'regexp) | 957 | :type 'regexp) |
| 957 | 958 | ||
| 959 | (defcustom org-link-to-org-use-id 'create-if-interactive | ||
| 960 | "Non-nil means, storing a link to an Org file will use entry ID's. | ||
| 961 | |||
| 962 | Note that before this variable is even considered, org-id must be loaded, | ||
| 963 | to please customize `org-modules' and turn it on. | ||
| 964 | |||
| 965 | The variable can have the following values: | ||
| 966 | |||
| 967 | t Create an ID if needed to make a link to the current entry. | ||
| 968 | |||
| 969 | create-if-interactive | ||
| 970 | If `org-store-link' is called directly (interactively, as a user | ||
| 971 | command), do create an ID to support the link. But when doing the | ||
| 972 | job for remember, only use the ID if it already exists. The | ||
| 973 | purpose of this setting is to avoid proliferation of unwanted | ||
| 974 | ID's, just because you happen to be in an Org file when you | ||
| 975 | call `org-remember' that automatically and preemptively | ||
| 976 | creates a link. If you do want to get an ID link in a remember | ||
| 977 | template to an entry not having an ID, create it first by | ||
| 978 | explicitly creating a link to it, using `C-c C-l' first. | ||
| 979 | |||
| 980 | use-existing | ||
| 981 | Use existing ID, do not create one. | ||
| 982 | |||
| 983 | nil Never use an ID to make a link, instead link using a text search for | ||
| 984 | the headline text." | ||
| 985 | :group 'org-link-store | ||
| 986 | :type '(choice | ||
| 987 | (const :tag "Create ID to make link" t) | ||
| 988 | (const :tag "Create if string link interactively" | ||
| 989 | 'create-if-interactive) | ||
| 990 | (const :tag "Only use existing" 'use-existing) | ||
| 991 | (const :tag "Do not use ID to create link" nil))) | ||
| 992 | |||
| 958 | (defcustom org-context-in-file-links t | 993 | (defcustom org-context-in-file-links t |
| 959 | "Non-nil means, file links from `org-store-link' contain context. | 994 | "Non-nil means, file links from `org-store-link' contain context. |
| 960 | A search string will be added to the file name with :: as separator and | 995 | A search string will be added to the file name with :: as separator and |
| @@ -1881,13 +1916,16 @@ the tags are again aligned to `org-tags-column'." | |||
| 1881 | (defcustom org-use-tag-inheritance t | 1916 | (defcustom org-use-tag-inheritance t |
| 1882 | "Non-nil means, tags in levels apply also for sublevels. | 1917 | "Non-nil means, tags in levels apply also for sublevels. |
| 1883 | When nil, only the tags directly given in a specific line apply there. | 1918 | When nil, only the tags directly given in a specific line apply there. |
| 1884 | If this option is t, a match early-on in a tree can lead to a large | ||
| 1885 | number of matches in the subtree. If you only want to see the first | ||
| 1886 | match in a tree during a search, check out the variable | ||
| 1887 | `org-tags-match-list-sublevels'. | ||
| 1888 | |||
| 1889 | This may also be a list of tags that should be inherited, or a regexp that | 1919 | This may also be a list of tags that should be inherited, or a regexp that |
| 1890 | matches tags that should be inherited." | 1920 | matches tags that should be inherited. Additional control is possible |
| 1921 | with the variable `org-tags-exclude-from-inheritance' which gives an | ||
| 1922 | explicit list of tags to be excluded from inheritance., even if the value of | ||
| 1923 | `org-use-tag-inheritance' would select it for inheritance. | ||
| 1924 | |||
| 1925 | If this option is t, a match early-on in a tree can lead to a large | ||
| 1926 | number of matches in the subtree when constructing the agenda or creating | ||
| 1927 | a sparse tree. If you only want to see the first match in a tree during | ||
| 1928 | a search, check out the variable `org-tags-match-list-sublevels'." | ||
| 1891 | :group 'org-tags | 1929 | :group 'org-tags |
| 1892 | :type '(choice | 1930 | :type '(choice |
| 1893 | (const :tag "Not" nil) | 1931 | (const :tag "Not" nil) |
| @@ -1895,9 +1933,18 @@ matches tags that should be inherited." | |||
| 1895 | (repeat :tag "Specific tags" (string :tag "Tag")) | 1933 | (repeat :tag "Specific tags" (string :tag "Tag")) |
| 1896 | (regexp :tag "Tags matched by regexp"))) | 1934 | (regexp :tag "Tags matched by regexp"))) |
| 1897 | 1935 | ||
| 1936 | (defcustom org-tags-exclude-from-inheritance nil | ||
| 1937 | "List of tags that should never be inherited. | ||
| 1938 | This is a way to exclude a few tags from inheritance. For way to do | ||
| 1939 | the opposite, to actively allow inheritance for selected tags, | ||
| 1940 | see the variable `org-use-tag-inheritance'." | ||
| 1941 | :group 'org-tags | ||
| 1942 | :type '(repeat (string :tag "Tag"))) | ||
| 1943 | |||
| 1898 | (defun org-tag-inherit-p (tag) | 1944 | (defun org-tag-inherit-p (tag) |
| 1899 | "Check if TAG is one that should be inherited." | 1945 | "Check if TAG is one that should be inherited." |
| 1900 | (cond | 1946 | (cond |
| 1947 | ((member tag org-tags-exclude-from-inheritance) nil) | ||
| 1901 | ((eq org-use-tag-inheritance t) t) | 1948 | ((eq org-use-tag-inheritance t) t) |
| 1902 | ((not org-use-tag-inheritance) nil) | 1949 | ((not org-use-tag-inheritance) nil) |
| 1903 | ((stringp org-use-tag-inheritance) | 1950 | ((stringp org-use-tag-inheritance) |
| @@ -1917,7 +1964,11 @@ inheritance off, you very likely want to turn this option on. | |||
| 1917 | 1964 | ||
| 1918 | As a special case, if the tag search is restricted to TODO items, the | 1965 | As a special case, if the tag search is restricted to TODO items, the |
| 1919 | value of this variable is ignored and sublevels are always checked, to | 1966 | value of this variable is ignored and sublevels are always checked, to |
| 1920 | make sure all corresponding TODO items find their way into the list." | 1967 | make sure all corresponding TODO items find their way into the list. |
| 1968 | |||
| 1969 | This variable is semi-obsolete and probably should always be true. It | ||
| 1970 | is better to limit inheritance to certain tags using the variables | ||
| 1971 | `org-use-tag-inheritanc'e and `org-tags-exclude-from-inheritance'." | ||
| 1921 | :group 'org-tags | 1972 | :group 'org-tags |
| 1922 | :type 'boolean) | 1973 | :type 'boolean) |
| 1923 | 1974 | ||
| @@ -2353,9 +2404,9 @@ Use customize to modify this, or restart Emacs after changing it." | |||
| 2353 | :group 'org) | 2404 | :group 'org) |
| 2354 | 2405 | ||
| 2355 | (defcustom org-completion-use-ido nil | 2406 | (defcustom org-completion-use-ido nil |
| 2356 | "Non-ni means, use ido completion wherever possible." | 2407 | "Non-nil means, use ido completion wherever possible." |
| 2357 | :group 'org-completion | 2408 | :group 'org-completion |
| 2358 | :type 'boolean) | 2409 | :type 'boolean) |
| 2359 | 2410 | ||
| 2360 | (defcustom org-completion-fallback-command 'hippie-expand | 2411 | (defcustom org-completion-fallback-command 'hippie-expand |
| 2361 | "The expansion command called by \\[org-complete] in normal context. | 2412 | "The expansion command called by \\[org-complete] in normal context. |
| @@ -2640,6 +2691,17 @@ If yes, offer to stop it and to save the buffer with the changes." | |||
| 2640 | (when (org-match-line "#\\+BEGIN: clocktable\\>") | 2691 | (when (org-match-line "#\\+BEGIN: clocktable\\>") |
| 2641 | (org-clocktable-shift dir n))) | 2692 | (org-clocktable-shift dir n))) |
| 2642 | 2693 | ||
| 2694 | ;; Autoload org-timer.el | ||
| 2695 | |||
| 2696 | ;(declare-function org-timer "org-timer") | ||
| 2697 | |||
| 2698 | (eval-and-compile | ||
| 2699 | (org-autoload | ||
| 2700 | "org-timer" | ||
| 2701 | '(org-timer-start org-timer org-timer-item | ||
| 2702 | org-timer-change-times-in-region))) | ||
| 2703 | |||
| 2704 | |||
| 2643 | ;; Autoload archiving code | 2705 | ;; Autoload archiving code |
| 2644 | ;; The stuff that is needed for cycling and tags has to be defined here. | 2706 | ;; The stuff that is needed for cycling and tags has to be defined here. |
| 2645 | 2707 | ||
| @@ -2778,11 +2840,12 @@ collapsed state." | |||
| 2778 | 2840 | ||
| 2779 | ;; Autoload ID code | 2841 | ;; Autoload ID code |
| 2780 | 2842 | ||
| 2843 | (declare-function org-id-store-link "org-id") | ||
| 2781 | (org-autoload "org-id" | 2844 | (org-autoload "org-id" |
| 2782 | '(org-id-get-create org-id-new org-id-copy org-id-get | 2845 | '(org-id-get-create org-id-new org-id-copy org-id-get |
| 2783 | org-id-get-with-outline-path-completion | 2846 | org-id-get-with-outline-path-completion |
| 2784 | org-id-get-with-outline-drilling | 2847 | org-id-get-with-outline-drilling |
| 2785 | org-id-goto org-id-find)) | 2848 | org-id-goto org-id-find org-id-store-link)) |
| 2786 | 2849 | ||
| 2787 | ;;; Variables for pre-computed regular expressions, all buffer local | 2850 | ;;; Variables for pre-computed regular expressions, all buffer local |
| 2788 | 2851 | ||
| @@ -3693,6 +3756,7 @@ will be prompted for." | |||
| 3693 | 3756 | ||
| 3694 | (defvar org-target-link-regexp nil | 3757 | (defvar org-target-link-regexp nil |
| 3695 | "Regular expression matching radio targets in plain text.") | 3758 | "Regular expression matching radio targets in plain text.") |
| 3759 | (make-variable-buffer-local 'org-target-link-regexp) | ||
| 3696 | (defvar org-target-regexp "<<\\([^<>\n\r]+\\)>>" | 3760 | (defvar org-target-regexp "<<\\([^<>\n\r]+\\)>>" |
| 3697 | "Regular expression matching a link target.") | 3761 | "Regular expression matching a link target.") |
| 3698 | (defvar org-radio-target-regexp "<<<\\([^<>\n\r]+\\)>>>" | 3762 | (defvar org-radio-target-regexp "<<<\\([^<>\n\r]+\\)>>>" |
| @@ -3915,6 +3979,8 @@ between words." | |||
| 3915 | nil) | 3979 | nil) |
| 3916 | ;; Priorities | 3980 | ;; Priorities |
| 3917 | (list (concat "\\[#[A-Z0-9]\\]") '(0 'org-special-keyword t)) | 3981 | (list (concat "\\[#[A-Z0-9]\\]") '(0 'org-special-keyword t)) |
| 3982 | ;; Tags | ||
| 3983 | '(org-font-lock-add-tag-faces) | ||
| 3918 | ;; Special keywords | 3984 | ;; Special keywords |
| 3919 | (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t)) | 3985 | (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t)) |
| 3920 | (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t)) | 3986 | (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t)) |
| @@ -3974,6 +4040,22 @@ If KWD is a number, get the corresponding match group." | |||
| 3974 | (and (member kwd org-done-keywords) 'org-done) | 4040 | (and (member kwd org-done-keywords) 'org-done) |
| 3975 | 'org-todo)) | 4041 | 'org-todo)) |
| 3976 | 4042 | ||
| 4043 | (defun org-font-lock-add-tag-faces (limit) | ||
| 4044 | "Add the special tag faces." | ||
| 4045 | (when (and org-tag-faces org-tags-special-faces-re) | ||
| 4046 | (while (re-search-forward org-tags-special-faces-re limit t) | ||
| 4047 | (add-text-properties (match-beginning 1) (match-end 1) | ||
| 4048 | (list 'face (org-get-tag-face 1) | ||
| 4049 | 'font-lock-fontified t)) | ||
| 4050 | (backward-char 1)))) | ||
| 4051 | |||
| 4052 | (defun org-get-tag-face (kwd) | ||
| 4053 | "Get the right face for a TODO keyword KWD. | ||
| 4054 | If KWD is a number, get the corresponding match group." | ||
| 4055 | (if (numberp kwd) (setq kwd (match-string kwd))) | ||
| 4056 | (or (cdr (assoc kwd org-tag-faces)) | ||
| 4057 | 'org-tag)) | ||
| 4058 | |||
| 3977 | (defun org-unfontify-region (beg end &optional maybe_loudly) | 4059 | (defun org-unfontify-region (beg end &optional maybe_loudly) |
| 3978 | "Remove fontification and activation overlays from links." | 4060 | "Remove fontification and activation overlays from links." |
| 3979 | (font-lock-default-unfontify-region beg end) | 4061 | (font-lock-default-unfontify-region beg end) |
| @@ -5060,8 +5142,8 @@ is signaled in this case." | |||
| 5060 | (setq txt (buffer-substring beg end)) | 5142 | (setq txt (buffer-substring beg end)) |
| 5061 | (org-save-markers-in-region beg end) | 5143 | (org-save-markers-in-region beg end) |
| 5062 | (delete-region beg end) | 5144 | (delete-region beg end) |
| 5063 | (outline-flag-region (1- beg) beg nil) | 5145 | (or (= beg (point-min)) (outline-flag-region (1- beg) beg nil)) |
| 5064 | (outline-flag-region (1- (point)) (point) nil) | 5146 | (or (bobp) (outline-flag-region (1- (point)) (point) nil)) |
| 5065 | (let ((bbb (point))) | 5147 | (let ((bbb (point))) |
| 5066 | (insert-before-markers txt) | 5148 | (insert-before-markers txt) |
| 5067 | (org-reinstall-markers-in-region bbb) | 5149 | (org-reinstall-markers-in-region bbb) |
| @@ -5221,6 +5303,7 @@ the inserted text when done." | |||
| 5221 | (beginning-of-line 1) | 5303 | (beginning-of-line 1) |
| 5222 | (unless for-yank (org-back-over-empty-lines)) | 5304 | (unless for-yank (org-back-over-empty-lines)) |
| 5223 | (setq beg (point)) | 5305 | (setq beg (point)) |
| 5306 | (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt)) | ||
| 5224 | (insert-before-markers txt) | 5307 | (insert-before-markers txt) |
| 5225 | (unless (string-match "\n\\'" txt) (insert "\n")) | 5308 | (unless (string-match "\n\\'" txt) (insert "\n")) |
| 5226 | (setq newend (point)) | 5309 | (setq newend (point)) |
| @@ -6094,7 +6177,6 @@ type. For a simple example of an export function, see `org-bbdb.el'." | |||
| 6094 | (setcdr (assoc type org-link-protocols) (list follow export)) | 6177 | (setcdr (assoc type org-link-protocols) (list follow export)) |
| 6095 | (push (list type follow export) org-link-protocols))) | 6178 | (push (list type follow export) org-link-protocols))) |
| 6096 | 6179 | ||
| 6097 | |||
| 6098 | ;;;###autoload | 6180 | ;;;###autoload |
| 6099 | (defun org-store-link (arg) | 6181 | (defun org-store-link (arg) |
| 6100 | "\\<org-mode-map>Store an org-link to the current location. | 6182 | "\\<org-mode-map>Store an org-link to the current location. |
| @@ -6155,14 +6237,34 @@ For file links, arg negates `org-context-in-file-links'." | |||
| 6155 | link (org-make-link cpltxt))) | 6237 | link (org-make-link cpltxt))) |
| 6156 | 6238 | ||
| 6157 | ((and buffer-file-name (org-mode-p)) | 6239 | ((and buffer-file-name (org-mode-p)) |
| 6158 | ;; Just link to current headline | 6240 | (cond |
| 6159 | (setq cpltxt (concat "file:" | 6241 | ((org-in-regexp "<<\\(.*?\\)>>") |
| 6160 | (abbreviate-file-name buffer-file-name))) | 6242 | (setq cpltxt |
| 6161 | ;; Add a context search string | 6243 | (concat "file:" |
| 6162 | (when (org-xor org-context-in-file-links arg) | 6244 | (abbreviate-file-name buffer-file-name) |
| 6163 | ;; Check if we are on a target | 6245 | "::" (match-string 1)) |
| 6164 | (if (org-in-regexp "<<\\(.*?\\)>>") | 6246 | link (org-make-link cpltxt))) |
| 6165 | (setq cpltxt (concat cpltxt "::" (match-string 1))) | 6247 | ((and (featurep 'org-id) |
| 6248 | (or (eq org-link-to-org-use-id t) | ||
| 6249 | (and (eq org-link-to-org-use-id 'create-if-interactive) | ||
| 6250 | (interactive-p)) | ||
| 6251 | (and org-link-to-org-use-id | ||
| 6252 | (condition-case nil | ||
| 6253 | (org-entry-get nil "ID") | ||
| 6254 | (error nil))))) | ||
| 6255 | ;; We can make a link using the ID. | ||
| 6256 | (setq link (condition-case nil | ||
| 6257 | (org-id-store-link) | ||
| 6258 | (error | ||
| 6259 | ;; probably before first headling, link to file only | ||
| 6260 | (concat "file:" | ||
| 6261 | (abbreviate-file-name buffer-file-name)))))) | ||
| 6262 | (t | ||
| 6263 | ;; Just link to current headline | ||
| 6264 | (setq cpltxt (concat "file:" | ||
| 6265 | (abbreviate-file-name buffer-file-name))) | ||
| 6266 | ;; Add a context search string | ||
| 6267 | (when (org-xor org-context-in-file-links arg) | ||
| 6166 | (setq txt (cond | 6268 | (setq txt (cond |
| 6167 | ((org-on-heading-p) nil) | 6269 | ((org-on-heading-p) nil) |
| 6168 | ((org-region-active-p) | 6270 | ((org-region-active-p) |
| @@ -6174,10 +6276,10 @@ For file links, arg negates `org-context-in-file-links'." | |||
| 6174 | (condition-case nil | 6276 | (condition-case nil |
| 6175 | (org-make-org-heading-search-string txt) | 6277 | (org-make-org-heading-search-string txt) |
| 6176 | (error ""))) | 6278 | (error ""))) |
| 6177 | desc "NONE")))) | 6279 | desc "NONE"))) |
| 6178 | (if (string-match "::\\'" cpltxt) | 6280 | (if (string-match "::\\'" cpltxt) |
| 6179 | (setq cpltxt (substring cpltxt 0 -2))) | 6281 | (setq cpltxt (substring cpltxt 0 -2))) |
| 6180 | (setq link (org-make-link cpltxt))) | 6282 | (setq link (org-make-link cpltxt))))) |
| 6181 | 6283 | ||
| 6182 | ((buffer-file-name (buffer-base-buffer)) | 6284 | ((buffer-file-name (buffer-base-buffer)) |
| 6183 | ;; Just link to this file here. | 6285 | ;; Just link to this file here. |
| @@ -6889,7 +6991,7 @@ application the system uses for this file type." | |||
| 6889 | (format "Execute \"%s\" as elisp? " | 6991 | (format "Execute \"%s\" as elisp? " |
| 6890 | (org-add-props cmd nil | 6992 | (org-add-props cmd nil |
| 6891 | 'face 'org-warning)))) | 6993 | 'face 'org-warning)))) |
| 6892 | (message "%s => %s" cmd | 6994 | (message "%s => %s" cmd |
| 6893 | (if (equal (string-to-char cmd) ?\() | 6995 | (if (equal (string-to-char cmd) ?\() |
| 6894 | (eval (read cmd)) | 6996 | (eval (read cmd)) |
| 6895 | (call-interactively (read cmd)))) | 6997 | (call-interactively (read cmd)))) |
| @@ -9026,8 +9128,14 @@ only lines with a TODO keyword are included in the output." | |||
| 9026 | ;; compile tags for current headline | 9128 | ;; compile tags for current headline |
| 9027 | (setq tags-list | 9129 | (setq tags-list |
| 9028 | (if org-use-tag-inheritance | 9130 | (if org-use-tag-inheritance |
| 9029 | (apply 'append (mapcar 'cdr tags-alist)) | 9131 | (apply 'append (mapcar 'cdr (reverse tags-alist))) |
| 9030 | tags)) | 9132 | tags)) |
| 9133 | (when org-use-tag-inheritance | ||
| 9134 | (setcdr (car tags-alist) | ||
| 9135 | (mapcar (lambda (x) | ||
| 9136 | (setq x (copy-sequence x)) | ||
| 9137 | (org-add-prop-inherited x)) | ||
| 9138 | (cdar tags-alist)))) | ||
| 9031 | (when (and tags org-use-tag-inheritance | 9139 | (when (and tags org-use-tag-inheritance |
| 9032 | (not (eq t org-use-tag-inheritance))) | 9140 | (not (eq t org-use-tag-inheritance))) |
| 9033 | ;; selective inheritance, remove uninherited ones | 9141 | ;; selective inheritance, remove uninherited ones |
| @@ -9083,15 +9191,22 @@ only lines with a TODO keyword are included in the output." | |||
| 9083 | (defun org-remove-uniherited-tags (tags) | 9191 | (defun org-remove-uniherited-tags (tags) |
| 9084 | "Remove all tags that are not inherited from the list TAGS." | 9192 | "Remove all tags that are not inherited from the list TAGS." |
| 9085 | (cond | 9193 | (cond |
| 9086 | ((eq org-use-tag-inheritance t) tags) | 9194 | ((eq org-use-tag-inheritance t) |
| 9195 | (if org-tags-exclude-from-inheritance | ||
| 9196 | (org-delete-all org-tags-exclude-from-inheritance tags) | ||
| 9197 | tags)) | ||
| 9087 | ((not org-use-tag-inheritance) nil) | 9198 | ((not org-use-tag-inheritance) nil) |
| 9088 | ((stringp org-use-tag-inheritance) | 9199 | ((stringp org-use-tag-inheritance) |
| 9089 | (delq nil (mapcar | 9200 | (delq nil (mapcar |
| 9090 | (lambda (x) (if (string-match org-use-tag-inheritance x) x nil)) | 9201 | (lambda (x) |
| 9202 | (if (and (string-match org-use-tag-inheritance x) | ||
| 9203 | (not (member x org-tags-exclude-from-inheritance))) | ||
| 9204 | x nil)) | ||
| 9091 | tags))) | 9205 | tags))) |
| 9092 | ((listp org-use-tag-inheritance) | 9206 | ((listp org-use-tag-inheritance) |
| 9093 | (delq nil (mapcar | 9207 | (delq nil (mapcar |
| 9094 | (lambda (x) (if (member x org-use-tag-inheritance) x nil)) | 9208 | (lambda (x) |
| 9209 | (if (member x org-use-tag-inheritance) x nil)) | ||
| 9095 | tags))))) | 9210 | tags))))) |
| 9096 | 9211 | ||
| 9097 | (defvar todo-only) ;; dynamically scoped | 9212 | (defvar todo-only) ;; dynamically scoped |
| @@ -9301,12 +9416,20 @@ epoch to the beginning of today (00:00)." | |||
| 9301 | (append '(0 0 0) (nthcdr 3 (decode-time)))))) | 9416 | (append '(0 0 0) (nthcdr 3 (decode-time)))))) |
| 9302 | 9417 | ||
| 9303 | (defun org-matcher-time (s) | 9418 | (defun org-matcher-time (s) |
| 9304 | (cond | 9419 | "Interprete a time comparison value." |
| 9305 | ((string= s "<now>") (float-time)) | 9420 | (save-match-data |
| 9306 | ((string= s "<today>") (org-time-today)) | 9421 | (cond |
| 9307 | ((string= s "<tomorrow>") (+ 86400.0 (org-time-today))) | 9422 | ((string= s "<now>") (float-time)) |
| 9308 | ((string= s "<yesterday>") (- (org-time-today) 86400.0)) | 9423 | ((string= s "<today>") (org-time-today)) |
| 9309 | (t (org-2ft s)))) | 9424 | ((string= s "<tomorrow>") (+ 86400.0 (org-time-today))) |
| 9425 | ((string= s "<yesterday>") (- (org-time-today) 86400.0)) | ||
| 9426 | ((string-match "^<\\([-+][0-9]+\\)\\([dwmy]\\)>$" s) | ||
| 9427 | (+ (org-time-today) | ||
| 9428 | (* (string-to-number (match-string 1 s)) | ||
| 9429 | (cdr (assoc (match-string 2 s) | ||
| 9430 | '(("d" . 86400.0) ("w" . 604800.0) | ||
| 9431 | ("m" . 2678400.0) ("y" . 31557600.0))))))) | ||
| 9432 | (t (org-2ft s))))) | ||
| 9310 | 9433 | ||
| 9311 | (defun org-match-any-p (re list) | 9434 | (defun org-match-any-p (re list) |
| 9312 | "Does re match any element of list?" | 9435 | "Does re match any element of list?" |
| @@ -9348,6 +9471,8 @@ ignore inherited ones." | |||
| 9348 | (when (looking-at (org-re "[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*$")) | 9471 | (when (looking-at (org-re "[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*$")) |
| 9349 | (setq ltags (org-split-string | 9472 | (setq ltags (org-split-string |
| 9350 | (org-match-string-no-properties 1) ":")) | 9473 | (org-match-string-no-properties 1) ":")) |
| 9474 | (when parent | ||
| 9475 | (setq ltags (mapcar 'org-add-prop-inherited ltags))) | ||
| 9351 | (setq tags (append | 9476 | (setq tags (append |
| 9352 | (if parent | 9477 | (if parent |
| 9353 | (org-remove-uniherited-tags ltags) | 9478 | (org-remove-uniherited-tags ltags) |
| @@ -9360,6 +9485,10 @@ ignore inherited ones." | |||
| 9360 | (error nil))))) | 9485 | (error nil))))) |
| 9361 | (append (org-remove-uniherited-tags org-file-tags) tags)))) | 9486 | (append (org-remove-uniherited-tags org-file-tags) tags)))) |
| 9362 | 9487 | ||
| 9488 | (defun org-add-prop-inherited (s) | ||
| 9489 | (add-text-properties 0 (length s) '(inherited t) s) | ||
| 9490 | s) | ||
| 9491 | |||
| 9363 | (defun org-toggle-tag (tag &optional onoff) | 9492 | (defun org-toggle-tag (tag &optional onoff) |
| 9364 | "Toggle the tag TAG for the current line. | 9493 | "Toggle the tag TAG for the current line. |
| 9365 | If ONOFF is `on' or `off', don't toggle but set to this state." | 9494 | If ONOFF is `on' or `off', don't toggle but set to this state." |
| @@ -9842,7 +9971,7 @@ the scanner. The following items can be given here: | |||
| 9842 | (org-agenda-skip-function | 9971 | (org-agenda-skip-function |
| 9843 | (car (org-delete-all '(comment archive) skip))) | 9972 | (car (org-delete-all '(comment archive) skip))) |
| 9844 | (org-tags-match-list-sublevels t) | 9973 | (org-tags-match-list-sublevels t) |
| 9845 | matcher pos file | 9974 | matcher pos file res |
| 9846 | org-todo-keywords-for-agenda | 9975 | org-todo-keywords-for-agenda |
| 9847 | org-done-keywords-for-agenda | 9976 | org-done-keywords-for-agenda |
| 9848 | org-todo-keyword-alist-for-agenda | 9977 | org-todo-keyword-alist-for-agenda |
| @@ -9851,7 +9980,7 @@ the scanner. The following items can be given here: | |||
| 9851 | (cond | 9980 | (cond |
| 9852 | ((eq match t) (setq matcher t)) | 9981 | ((eq match t) (setq matcher t)) |
| 9853 | ((eq match nil) (setq matcher t)) | 9982 | ((eq match nil) (setq matcher t)) |
| 9854 | (t (setq matcher (if match (org-make-tags-matcher match) t)))) | 9983 | (t (setq matcher (if match (cdr (org-make-tags-matcher match)) t)))) |
| 9855 | 9984 | ||
| 9856 | (when (eq scope 'tree) | 9985 | (when (eq scope 'tree) |
| 9857 | (org-back-to-heading t) | 9986 | (org-back-to-heading t) |
| @@ -9884,7 +10013,8 @@ the scanner. The following items can be given here: | |||
| 9884 | (save-restriction | 10013 | (save-restriction |
| 9885 | (widen) | 10014 | (widen) |
| 9886 | (goto-char (point-min)) | 10015 | (goto-char (point-min)) |
| 9887 | (org-scan-tags func matcher)))))))) | 10016 | (setq res (append res (org-scan-tags func matcher))))))) |
| 10017 | res))) | ||
| 9888 | 10018 | ||
| 9889 | ;;;; Properties | 10019 | ;;;; Properties |
| 9890 | 10020 | ||
| @@ -10484,6 +10614,7 @@ completion." | |||
| 10484 | IDENT can be a string, a symbol or a number, this function will search for | 10614 | IDENT can be a string, a symbol or a number, this function will search for |
| 10485 | the string representation of it. | 10615 | the string representation of it. |
| 10486 | Return the position where this entry starts, or nil if there is no such entry." | 10616 | Return the position where this entry starts, or nil if there is no such entry." |
| 10617 | (interactive "sID: ") | ||
| 10487 | (let ((id (cond | 10618 | (let ((id (cond |
| 10488 | ((stringp ident) ident) | 10619 | ((stringp ident) ident) |
| 10489 | ((symbol-name ident) (symbol-name ident)) | 10620 | ((symbol-name ident) (symbol-name ident)) |
| @@ -12418,6 +12549,10 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]." | |||
| 12418 | (org-defkey org-mode-map "\C-c\C-xp" 'org-set-property) | 12549 | (org-defkey org-mode-map "\C-c\C-xp" 'org-set-property) |
| 12419 | (org-defkey org-mode-map "\C-c\C-xi" 'org-insert-columns-dblock) | 12550 | (org-defkey org-mode-map "\C-c\C-xi" 'org-insert-columns-dblock) |
| 12420 | 12551 | ||
| 12552 | (org-defkey org-mode-map "\C-c\C-x." 'org-timer) | ||
| 12553 | (org-defkey org-mode-map "\C-c\C-x-" 'org-timer-item) | ||
| 12554 | (org-defkey org-mode-map "\C-c\C-x0" 'org-timer-start) | ||
| 12555 | |||
| 12421 | (define-key org-mode-map "\C-c\C-x\C-c" 'org-columns) | 12556 | (define-key org-mode-map "\C-c\C-x\C-c" 'org-columns) |
| 12422 | 12557 | ||
| 12423 | (when (featurep 'xemacs) | 12558 | (when (featurep 'xemacs) |
| @@ -13191,7 +13326,11 @@ See the individual commands for more information." | |||
| 13191 | :style radio :selected org-display-custom-times] | 13326 | :style radio :selected org-display-custom-times] |
| 13192 | "--" | 13327 | "--" |
| 13193 | ["Goto Calendar" org-goto-calendar t] | 13328 | ["Goto Calendar" org-goto-calendar t] |
| 13194 | ["Date from Calendar" org-date-from-calendar t]) | 13329 | ["Date from Calendar" org-date-from-calendar t] |
| 13330 | "--" | ||
| 13331 | ["Start/restart timer" org-timer-start t] | ||
| 13332 | ["Insert timer string" org-timer t] | ||
| 13333 | ["Insert timer item" org-timer-item t]) | ||
| 13195 | ("Logging work" | 13334 | ("Logging work" |
| 13196 | ["Clock in" org-clock-in t] | 13335 | ["Clock in" org-clock-in t] |
| 13197 | ["Clock out" org-clock-out t] | 13336 | ["Clock out" org-clock-out t] |