aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Dominik2009-10-01 07:59:53 +0000
committerCarsten Dominik2009-10-01 07:59:53 +0000
commit8d64207425f5345576b77dc9308943ec56ad9327 (patch)
treeca4942096dc2d499b7739d934235b4bf88a5ddf5
parent9bf6c65c2f7d6faed57f689787254f33b50d9b33 (diff)
downloademacs-8d64207425f5345576b77dc9308943ec56ad9327.tar.gz
emacs-8d64207425f5345576b77dc9308943ec56ad9327.zip
2009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-set-tags-to): New command. * org-latex.el (org-export-latex-set-initial-vars): Also check in the plist. * org.el (org-additional-option-like-keywords): Add LATEX_CLASS keyword. * org-exp.el (org-infile-export-plist): Add LATEX_CLASS keyword. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-inlinetask.el (org-inlinetask-export): Option removed. (org-inlinetask-export-handler): Better export. * org-xoxo.el (org-export-xoxo-final-hook): New hook. (org-export-as-xoxo): Run the new hook. * org-html.el (org-export-html-final-hook): New hook. (org-export-as-html): Run the new hook. * org-docbook.el (org-export-docbook-final-hook): New hook. (org-export-as-docbook): Run the new hook. * org-ascii.el (org-export-ascii-final-hook): New hook. (org-export-as-ascii): Run the new hook. * org-latex.el (org-export-latex-treat-sub-super-char): Allow a space character as the character before the ^/_. (org-export-latex-final-hook): New hook. (org-export-as-latex): Run `org-export-latex-final-hook'. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-macs.el (org-if-unprotected-at): Fix docstring. * org-agenda.el (org-agenda-change-all-lines): Handle invisible text in the prefix (if category is a link). * org-latex.el (org-export-latex-preprocess): Deal properly with empty lines in verse environments. * org.el (org-format-latex-header): Inline fullpage.sty. * org-footnote.el (org-footnote-create-definition): Reveal context to add a new footnote definition. * org.el (org-ctrl-c-ctrl-c): Pass prefix arg to org-table-recalculate when cursor is in TBLFM line. * org-list.el (org-renumber-ordered-list): Fix cursor position when bullet length has changed. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-format-latex): Mention `org-format-latex-options' in the docstring. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-agenda-get): New function. * org-agenda.el (org-agenda-post-command-hook): No longer move point away from end of line. (org-agenda-add-entry-text, org-agenda-collect-markers) (org-finalize-agenda, org-agenda-mark-clocking-task) (org-agenda-dim-blocked-tasks, org-agenda-entry-text-show-here) (org-agenda-entry-text-show, org-agenda-highlight-todo) (org-agenda-compare-effort, org-agenda-filter-apply) (org-agenda-later, org-agenda-change-time-span) (org-agenda-post-command-hook, org-agenda-show-priority) (org-agenda-show-tags, org-agenda-goto, org-agenda-kill) (org-agenda-archive, org-agenda-archive-to-archive-sibling) (org-remove-subtree-entries-from-agenda, org-agenda-refile) (org-agenda-open-link, org-agenda-copy-local-variable) (org-agenda-switch-to, org-agenda-check-no-diary) (org-agenda-tree-to-indirect-buffer, org-agenda-todo) (org-agenda-add-note, org-agenda-change-all-lines) (org-agenda-priority, org-agenda-set-tags) (org-agenda-set-property, org-agenda-set-effort) (org-agenda-toggle-archive-tag, org-agenda-date-later) (org-agenda-show-new-time, org-agenda-date-prompt) (org-agenda-schedule, org-agenda-deadline, org-agenda-action) (org-agenda-clock-in, org-agenda-bulk-mark) (org-agenda-bulk-unmark, org-agenda-show-the-flagging-note): Use `org-get-at-bol'. * org-colview.el (org-columns-display-here) (org-columns-edit-allowed, org-agenda-columns): Use `org-get-at-bol'. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-special-ctrl-a/e): Improve documentation and customize type. (org-end-of-line): Don't jump to after the ellipsis. (org-mode-map): Bind <home> and <end> as well. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-fontify-meta-lines-and-blocks): Treat lines with a space after #+ as comments. (org-open-at-point): Run `org-follow-link-hook' always. * org-latex.el (org-export-latex-emph-format): Use better commands to insert special characters in verbatim snippets. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-faces.el (org-copy-face): New function. Use it to create various faces formerly created by using `copy-face'. * org-agenda.el (org-prepare-agenda): Don't officially mark this window dedicated. (org-agenda-quit): Kill the frame containing the agenda window if that frame was created for the agenda. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-date-prompt): Mark the changed time stamp in the agenda. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-prepare-agenda): Reset `org-drawers-for-agenda'. (org-prepare-agenda): Uniquify list of drawers. * org.el (org-complex-heading-regexp-format): New variable. (org-set-regexps-and-options): Define `org-complex-heading-regexp-format'. (org-drawers-for-agenda): New variable. (org-map-entries): Bind `org-drawers-for-agenda'. (org-prepare-agenda-buffers): Add to `org-drawers-for-agenda'. * org-remember.el (org-go-to-remember-target) (org-remember-handler): Use `org-complex-heading-regexp-format'. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-highlight-todo): Fix text property problem. * org.el (org-on-heading-p, org-at-heading-p): Make sure these are always with `invisible-ok'. (org-store-link): No error when there is nothing to link to in the agenda. * org-list.el (org-update-checkbox-count): Insert changed cookie before the old, to avoid problems with invisibility at the end of the line. (org-update-checkbox-count): Insert changed cookie before the old, to avoid problems with invisibility at the end of the line. * org.el (org-sort-entries-or-items): Include the final newline. (org-fontify-meta-lines-and-blocks): Add indented dynamic block lines for fontification. (org-dblock-start-re, org-dblock-end-re): Allow indentation. (org-prepare-dblock): Store the current indentation of the BEGIN line. (org-update-dblock): Apply the indentation of the begin line to the rest of the block. (org-ctrl-c-ctrl-c): Also find indented dblock lines. (org-startup-folded): New allowed value `showeverything'. (org-startup-options): Add STARTUP keyword `showeverything'. (org-set-startup-visibility): Respect value `showeverything' in org-startup-folded. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-closest-date): Fix issue with past preference. * org-archive.el (org-archive-set-tag) (org-archive-subtree-default): New commands. * org-clock.el (org-clock-clocktable-default-properties): New option. (org-clock-report): Use `org-clock-clocktable-default-properties'. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-iswitchb-completing-read): Fix typo. * org-crypt.el: New file. * org.el: Add an entry for org-crypt. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-menu): Reorganize the menu for more consistency. (org-batch-store-agenda-views): New function. (org-agenda-title-append): Define variable. (org-write-agenda): New export to Org files. (org-agenda-get-some-entry-text): New arguments INDENT and KEEP. (org-agenda): Allow to keep the restricted file list if a special variable is bound to t. (org-agenda): Define a special agenda view for working on flagged entries. (org-agenda-get-restriction-and-command): List the new agenda view. (org-agenda-show-the-flagging-note): New command. (org-agenda-mode-map): New key `?' for looking at the flagging note. * org.el (org-autoload): Autoload org-mobile.el. (org-org-menu): Add menu commands for MobileOrg in the Org menu. * org-mobile.el: New file. * org-id.el (org-id-get): Fix bug with forcing ID on an item. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-table.el (orgtbl-line-start-regexp): Match also TBLNAME statements. (org-table-get-remote-range): Match indented #+TBLNAME statements. * org.el (org-convert-to-odd-levels) (org-convert-to-oddeven-levels): Work also correctly if the file is in outline-mode. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org.el (org-store-link): When in agenda buffer, link to referenced entry. (org-add-planning-info): Remove spaces at eol. * org-macs.el (org-with-point-at): Add a `lisp-indent-function' property. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-first-lines): Fix problem with LaTeX export of first line and selected subtree. * org.el (org-shifttab): Interpret arg differently when using only odd levels. 2009-10-01 Bastien Guerry <bzg@altern.org> * org.el (org-check-agenda-file): Use a more explicit message 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-exp.el (org-export-remove-special-table-lines): Don't remove normal lines. 2009-10-01 Bastien Guerry <bzg@altern.org> * org.el (org-offer-links-in-entry): Don't use "Select link" as a prompt in the temporary window. * org-agenda.el (org-agenda-bulk-mark): Use a slightly soberer prefix for marked entries in the agenda view. 2009-10-01 Andreas Burtzlaff <andy13@gmx.net> (tiny change) * org.el (outline-end-of-subtree): Bugfix: advise this function in a way that prevents any trailing character from being displayed. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-menu): Fix bugs in the bulk action menu. * org-exp.el (org-export-remove-special-table-lines): Remove bad slow regexp match. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-latex.el (org-export-latex-preprocess): Do not protect in the LaTeX header. * org-src.el (org-edit-src-save): Save window setup while saving. (org-edit-src-code): Use new buffer name construction scheme. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-entry-text-exclude-regexps): New variable. (org-agenda-entry-text-cleanup-hook): New hook. (org-agenda-get-some-entry-text): Remove matches of `org-agenda-entry-text-exclude-regexps' and run the hook `org-agenda-entry-text-cleanup-hook'. * org.el (org-offer-links-in-entry): New argument ZERO to implement a link with index zero. (org-cycle-show-empty-lines): Not keep empty line under header hidden. (org-iswitchb-completing-read): Bind `switchb-use-virtual-buffers' to nil for special completion. (org-store-link): Don't error before the first heading. * org-agenda.el (org-agenda-open-link): Pass the prefix to `org-offer-links-in-entry'. 2009-10-01 Carsten Dominik <carsten.dominik@gmail.com> * org-agenda.el (org-agenda-quit): Provide the window argument for `window-dedicated-p', Emacs 22 needs it. (org-format-agenda-item): If the category is a link, arrange for invisible text to replaced with spaces. (org-compile-prefix-format): Add the extra space. (org-prefix-category-length): New variable. * org-exp.el (org-export-cleanup-toc-line): Remove footnote references from TOC lines. * org.el (org-selected-window): New variable. * org-table.el (org-table-edit-formulas): Remember the selected window. (org-table-fedit-finish, org-table-fedit-abort): Select the window that was originally selected. * org-exp.el (org-export-preprocess-apply-macros): Scan the expansion of a macro for more macro definitions. * org-agenda.el (org-agenda-dim-blocked-tasks): Make sure the invisibility overlay starts on the newline.
-rw-r--r--lisp/org/ChangeLog326
-rw-r--r--lisp/org/org-agenda.el568
-rw-r--r--lisp/org/org-archive.el23
-rw-r--r--lisp/org/org-ascii.el11
-rw-r--r--lisp/org/org-attach.el2
-rw-r--r--lisp/org/org-bbdb.el2
-rw-r--r--lisp/org/org-bibtex.el2
-rw-r--r--lisp/org/org-clock.el12
-rw-r--r--lisp/org/org-colview.el16
-rw-r--r--lisp/org/org-compat.el4
-rw-r--r--lisp/org/org-crypt.el178
-rw-r--r--lisp/org/org-docbook.el8
-rw-r--r--lisp/org/org-exp.el92
-rw-r--r--lisp/org/org-faces.el65
-rw-r--r--lisp/org/org-feed.el2
-rw-r--r--lisp/org/org-footnote.el5
-rw-r--r--lisp/org/org-gnus.el13
-rw-r--r--lisp/org/org-html.el6
-rw-r--r--lisp/org/org-icalendar.el2
-rw-r--r--lisp/org/org-id.el23
-rw-r--r--lisp/org/org-indent.el4
-rw-r--r--lisp/org/org-info.el2
-rw-r--r--lisp/org/org-inlinetask.el53
-rw-r--r--lisp/org/org-irc.el2
-rw-r--r--lisp/org/org-jsinfo.el2
-rw-r--r--lisp/org/org-latex.el48
-rw-r--r--lisp/org/org-list.el20
-rw-r--r--lisp/org/org-mac-message.el2
-rw-r--r--lisp/org/org-macs.el5
-rw-r--r--lisp/org/org-mew.el2
-rw-r--r--lisp/org/org-mhe.el2
-rw-r--r--lisp/org/org-mobile.el511
-rw-r--r--lisp/org/org-mouse.el2
-rw-r--r--lisp/org/org-plot.el2
-rw-r--r--lisp/org/org-protocol.el2
-rw-r--r--lisp/org/org-publish.el2
-rw-r--r--lisp/org/org-remember.el9
-rw-r--r--lisp/org/org-rmail.el85
-rw-r--r--lisp/org/org-src.el34
-rw-r--r--lisp/org/org-table.el18
-rw-r--r--lisp/org/org-timer.el2
-rw-r--r--lisp/org/org-vm.el2
-rw-r--r--lisp/org/org-w3m.el2
-rw-r--r--lisp/org/org-wl.el4
-rw-r--r--lisp/org/org-xoxo.el6
-rw-r--r--lisp/org/org.el310
46 files changed, 1976 insertions, 517 deletions
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 1cd25682169..a7e480ce33a 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,329 @@
12009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
2
3 * org.el (org-set-tags-to): New command.
4
5 * org-latex.el (org-export-latex-set-initial-vars): Also check in
6 the plist.
7
8 * org.el (org-additional-option-like-keywords): Add LATEX_CLASS
9 keyword.
10
11 * org-exp.el (org-infile-export-plist): Add LATEX_CLASS keyword.
12
132009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
14
15 * org-inlinetask.el (org-inlinetask-export): Option removed.
16 (org-inlinetask-export-handler): Better export.
17
18 * org-xoxo.el (org-export-xoxo-final-hook): New hook.
19 (org-export-as-xoxo): Run the new hook.
20
21 * org-html.el (org-export-html-final-hook): New hook.
22 (org-export-as-html): Run the new hook.
23
24 * org-docbook.el (org-export-docbook-final-hook): New hook.
25 (org-export-as-docbook): Run the new hook.
26
27 * org-ascii.el (org-export-ascii-final-hook): New hook.
28 (org-export-as-ascii): Run the new hook.
29
30 * org-latex.el (org-export-latex-treat-sub-super-char): Allow a
31 space character as the character before the ^/_.
32 (org-export-latex-final-hook): New hook.
33 (org-export-as-latex): Run `org-export-latex-final-hook'.
34
352009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
36
37 * org-macs.el (org-if-unprotected-at): Fix docstring.
38
39 * org-agenda.el (org-agenda-change-all-lines): Handle invisible
40 text in the prefix (if category is a link).
41
42 * org-latex.el (org-export-latex-preprocess): Deal properly with
43 empty lines in verse environments.
44
45 * org.el (org-format-latex-header): Inline fullpage.sty.
46
47 * org-footnote.el (org-footnote-create-definition): Reveal context
48 to add a new footnote definition.
49
50 * org.el (org-ctrl-c-ctrl-c): Pass prefix arg to
51 org-table-recalculate when cursor is in TBLFM line.
52
53 * org-list.el (org-renumber-ordered-list): Fix cursor position
54 when bullet length has changed.
55
562009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
57
58 * org.el (org-format-latex): Mention `org-format-latex-options' in
59 the docstring.
60
612009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
62
63 * org.el (org-agenda-get): New function.
64
65 * org-agenda.el (org-agenda-post-command-hook): No longer move
66 point away from end of line.
67 (org-agenda-add-entry-text, org-agenda-collect-markers)
68 (org-finalize-agenda, org-agenda-mark-clocking-task)
69 (org-agenda-dim-blocked-tasks, org-agenda-entry-text-show-here)
70 (org-agenda-entry-text-show, org-agenda-highlight-todo)
71 (org-agenda-compare-effort, org-agenda-filter-apply)
72 (org-agenda-later, org-agenda-change-time-span)
73 (org-agenda-post-command-hook, org-agenda-show-priority)
74 (org-agenda-show-tags, org-agenda-goto, org-agenda-kill)
75 (org-agenda-archive, org-agenda-archive-to-archive-sibling)
76 (org-remove-subtree-entries-from-agenda, org-agenda-refile)
77 (org-agenda-open-link, org-agenda-copy-local-variable)
78 (org-agenda-switch-to, org-agenda-check-no-diary)
79 (org-agenda-tree-to-indirect-buffer, org-agenda-todo)
80 (org-agenda-add-note, org-agenda-change-all-lines)
81 (org-agenda-priority, org-agenda-set-tags)
82 (org-agenda-set-property, org-agenda-set-effort)
83 (org-agenda-toggle-archive-tag, org-agenda-date-later)
84 (org-agenda-show-new-time, org-agenda-date-prompt)
85 (org-agenda-schedule, org-agenda-deadline, org-agenda-action)
86 (org-agenda-clock-in, org-agenda-bulk-mark)
87 (org-agenda-bulk-unmark, org-agenda-show-the-flagging-note): Use
88 `org-get-at-bol'.
89
90 * org-colview.el (org-columns-display-here)
91 (org-columns-edit-allowed, org-agenda-columns): Use
92 `org-get-at-bol'.
93
942009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
95
96 * org.el (org-special-ctrl-a/e): Improve documentation and
97 customize type.
98 (org-end-of-line): Don't jump to after the ellipsis.
99 (org-mode-map): Bind <home> and <end> as well.
100
1012009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
102
103 * org.el (org-fontify-meta-lines-and-blocks): Treat lines with a
104 space after #+ as comments.
105 (org-open-at-point): Run `org-follow-link-hook' always.
106
107 * org-latex.el (org-export-latex-emph-format): Use better commands
108 to insert special characters in verbatim snippets.
109
1102009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
111
112 * org-faces.el (org-copy-face): New function. Use it to create
113 various faces formerly created by using `copy-face'.
114
115 * org-agenda.el (org-prepare-agenda): Don't officially mark this
116 window dedicated.
117 (org-agenda-quit): Kill the frame containing the agenda window if
118 that frame was created for the agenda.
119
1202009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
121
122 * org-agenda.el (org-agenda-date-prompt): Mark the changed time
123 stamp in the agenda.
124
1252009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
126
127 * org-agenda.el (org-prepare-agenda): Reset
128 `org-drawers-for-agenda'.
129 (org-prepare-agenda): Uniquify list of drawers.
130
131 * org.el (org-complex-heading-regexp-format): New variable.
132 (org-set-regexps-and-options): Define
133 `org-complex-heading-regexp-format'.
134 (org-drawers-for-agenda): New variable.
135 (org-map-entries): Bind `org-drawers-for-agenda'.
136 (org-prepare-agenda-buffers): Add to `org-drawers-for-agenda'.
137
138 * org-remember.el (org-go-to-remember-target)
139 (org-remember-handler): Use `org-complex-heading-regexp-format'.
140
1412009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
142
143 * org-agenda.el (org-agenda-highlight-todo): Fix text property
144 problem.
145
146 * org.el (org-on-heading-p, org-at-heading-p): Make sure these are
147 always with `invisible-ok'.
148 (org-store-link): No error when there is nothing to link to in the
149 agenda.
150
151 * org-list.el (org-update-checkbox-count): Insert changed cookie
152 before the old, to avoid problems with invisibility at the end of
153 the line.
154 (org-update-checkbox-count): Insert changed cookie before the old,
155 to avoid problems with invisibility at the end of the line.
156
157 * org.el (org-sort-entries-or-items): Include the final newline.
158 (org-fontify-meta-lines-and-blocks): Add indented dynamic block
159 lines for fontification.
160 (org-dblock-start-re, org-dblock-end-re): Allow indentation.
161 (org-prepare-dblock): Store the current indentation of the BEGIN
162 line.
163 (org-update-dblock): Apply the indentation of the begin line to
164 the rest of the block.
165 (org-ctrl-c-ctrl-c): Also find indented dblock lines.
166 (org-startup-folded): New allowed value `showeverything'.
167 (org-startup-options): Add STARTUP keyword `showeverything'.
168 (org-set-startup-visibility): Respect value `showeverything' in
169 org-startup-folded.
170
1712009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
172
173 * org.el (org-closest-date): Fix issue with past preference.
174
175 * org-archive.el (org-archive-set-tag)
176 (org-archive-subtree-default): New commands.
177
178 * org-clock.el (org-clock-clocktable-default-properties): New
179 option.
180 (org-clock-report): Use
181 `org-clock-clocktable-default-properties'.
182
1832009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
184
185 * org.el (org-iswitchb-completing-read): Fix typo.
186
187 * org-crypt.el: New file.
188
189 * org.el: Add an entry for org-crypt.
190
1912009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
192
193 * org-agenda.el (org-agenda-menu): Reorganize the menu for more
194 consistency.
195 (org-batch-store-agenda-views): New function.
196 (org-agenda-title-append): Define variable.
197 (org-write-agenda): New export to Org files.
198 (org-agenda-get-some-entry-text): New arguments INDENT and KEEP.
199 (org-agenda): Allow to keep the restricted file list if a special
200 variable is bound to t.
201 (org-agenda): Define a special agenda view for working on flagged
202 entries.
203 (org-agenda-get-restriction-and-command): List the new agenda
204 view.
205 (org-agenda-show-the-flagging-note): New command.
206 (org-agenda-mode-map): New key `?' for looking at the flagging
207 note.
208
209 * org.el (org-autoload): Autoload org-mobile.el.
210 (org-org-menu): Add menu commands for MobileOrg in the Org menu.
211
212 * org-mobile.el: New file.
213
214 * org-id.el (org-id-get): Fix bug with forcing ID on an item.
215
2162009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
217
218 * org-table.el (orgtbl-line-start-regexp): Match also TBLNAME
219 statements.
220 (org-table-get-remote-range): Match indented #+TBLNAME
221 statements.
222
223 * org.el (org-convert-to-odd-levels)
224 (org-convert-to-oddeven-levels): Work also correctly if the file
225 is in outline-mode.
226
2272009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
228
229 * org.el (org-store-link): When in agenda buffer, link to
230 referenced entry.
231 (org-add-planning-info): Remove spaces at eol.
232
233 * org-macs.el (org-with-point-at): Add a `lisp-indent-function'
234 property.
235
2362009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
237
238 * org-latex.el (org-export-latex-first-lines): Fix problem with
239 LaTeX export of first line and selected subtree.
240
241 * org.el (org-shifttab): Interpret arg differently when using only
242 odd levels.
243
2442009-10-01 Bastien Guerry <bzg@altern.org>
245
246 * org.el (org-check-agenda-file): Use a more explicit message
247
2482009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
249
250 * org-exp.el (org-export-remove-special-table-lines): Don't remove
251 normal lines.
252
2532009-10-01 Bastien Guerry <bzg@altern.org>
254
255 * org.el (org-offer-links-in-entry): Don't use "Select link" as a
256 prompt in the temporary window.
257
258 * org-agenda.el (org-agenda-bulk-mark): Use a slightly soberer
259 prefix for marked entries in the agenda view.
260
2612009-10-01 Andreas Burtzlaff <andy13@gmx.net> (tiny change)
262
263 * org.el (outline-end-of-subtree): Bugfix: advise this function in
264 a way that prevents any trailing character from being displayed.
265
2662009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
267
268 * org-agenda.el (org-agenda-menu): Fix bugs in the bulk action
269 menu.
270
271 * org-exp.el (org-export-remove-special-table-lines): Remove bad
272 slow regexp match.
273
2742009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
275
276 * org-latex.el (org-export-latex-preprocess): Do not protect in
277 the LaTeX header.
278
279 * org-src.el (org-edit-src-save): Save window setup while saving.
280 (org-edit-src-code): Use new buffer name construction scheme.
281
2822009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
283
284 * org-agenda.el (org-agenda-entry-text-exclude-regexps): New
285 variable.
286 (org-agenda-entry-text-cleanup-hook): New hook.
287 (org-agenda-get-some-entry-text): Remove matches of
288 `org-agenda-entry-text-exclude-regexps' and run the hook
289 `org-agenda-entry-text-cleanup-hook'.
290
291 * org.el (org-offer-links-in-entry): New argument ZERO to
292 implement a link with index zero.
293 (org-cycle-show-empty-lines): Not keep empty line under header
294 hidden.
295 (org-iswitchb-completing-read): Bind `switchb-use-virtual-buffers'
296 to nil for special completion.
297 (org-store-link): Don't error before the first heading.
298
299 * org-agenda.el (org-agenda-open-link): Pass the prefix to
300 `org-offer-links-in-entry'.
301
3022009-10-01 Carsten Dominik <carsten.dominik@gmail.com>
303
304 * org-agenda.el (org-agenda-quit): Provide the window argument for
305 `window-dedicated-p', Emacs 22 needs it.
306 (org-format-agenda-item): If the category is a link, arrange for
307 invisible text to replaced with spaces.
308 (org-compile-prefix-format): Add the extra space.
309 (org-prefix-category-length): New variable.
310
311 * org-exp.el (org-export-cleanup-toc-line): Remove footnote
312 references from TOC lines.
313
314 * org.el (org-selected-window): New variable.
315
316 * org-table.el (org-table-edit-formulas): Remember the selected
317 window.
318 (org-table-fedit-finish, org-table-fedit-abort): Select the window
319 that was originally selected.
320
321 * org-exp.el (org-export-preprocess-apply-macros): Scan the
322 expansion of a macro for more macro definitions.
323
324 * org-agenda.el (org-agenda-dim-blocked-tasks): Make sure the
325 invisibility overlay starts on the newline.
326
12009-10-01 Glenn Morris <rgm@gnu.org> 3272009-10-01 Glenn Morris <rgm@gnu.org>
2 328
3 * org-agenda.el (calendar-check-holidays): 329 * org-agenda.el (calendar-check-holidays):
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index a285795eba7..d7d5b8778e9 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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -54,10 +54,12 @@
54(declare-function calendar-persian-date-string "cal-persia" (&optional date)) 54(declare-function calendar-persian-date-string "cal-persia" (&optional date))
55(declare-function org-columns-quit "org-colview" ()) 55(declare-function org-columns-quit "org-colview" ())
56(defvar calendar-mode-map) 56(defvar calendar-mode-map)
57(defvar org-mobile-force-id-on-agenda-items) ; defined in org-mobile.el
57 58
58;; Defined somewhere in this file, but used before definition. 59;; Defined somewhere in this file, but used before definition.
59(defvar org-agenda-buffer-name) 60(defvar org-agenda-buffer-name)
60(defvar org-agenda-overriding-header) 61(defvar org-agenda-overriding-header)
62(defvar org-agenda-title-append nil)
61(defvar entry) 63(defvar entry)
62(defvar date) 64(defvar date)
63(defvar org-agenda-undo-list) 65(defvar org-agenda-undo-list)
@@ -668,6 +670,21 @@ when exporting the agenda, configure the variable
668 :group 'org-agenda 670 :group 'org-agenda
669 :type 'integer) 671 :type 'integer)
670 672
673(defcustom org-agenda-entry-text-exclude-regexps nil
674 "List of regular expressions to clean up entry text.
675The complete matches of all regular expressions in this list will be
676removed from entry text before it is shown in the agenda."
677 :group 'org-agenda
678 :type '(repeat (regexp)))
679
680(defvar org-agenda-entry-text-cleanup-hook nil
681 "Hook that is run after basic cleanup of entry text to be shown in agenda.
682This cleanup is done in a temporary buffer, so the function may inspect and
683change the entire buffer.
684Some default stuff like drawers and scheduling/deadline dates will already
685have been removed when this is called, as will any matches for regular
686expressions listed in `org-agenda-entry-text-exclude-regexps'.")
687
671(defvar org-agenda-include-inactive-timestamps nil 688(defvar org-agenda-include-inactive-timestamps nil
672 "Non-nil means, include inactive time stamps in agenda and timeline.") 689 "Non-nil means, include inactive time stamps in agenda and timeline.")
673 690
@@ -681,10 +698,11 @@ when exporting the agenda, configure the variable
681Possible values for this option are: 698Possible values for this option are:
682 699
683current-window Show agenda in the current window, keeping all other windows. 700current-window Show agenda in the current window, keeping all other windows.
684other-frame Use `switch-to-buffer-other-frame' to display agenda.
685other-window Use `switch-to-buffer-other-window' to display agenda. 701other-window Use `switch-to-buffer-other-window' to display agenda.
686reorganize-frame Show only two windows on the current frame, the current 702reorganize-frame Show only two windows on the current frame, the current
687 window and the agenda. 703 window and the agenda.
704other-frame Use `switch-to-buffer-other-frame' to display agenda.
705 Also, when exiting the agenda, kill that frame.
688See also the variable `org-agenda-restore-windows-after-quit'." 706See also the variable `org-agenda-restore-windows-after-quit'."
689 :group 'org-agenda-windows 707 :group 'org-agenda-windows
690 :type '(choice 708 :type '(choice
@@ -1433,6 +1451,9 @@ The following commands are available:
1433(org-defkey org-agenda-mode-map "/" 'org-agenda-filter-by-tag) 1451(org-defkey org-agenda-mode-map "/" 'org-agenda-filter-by-tag)
1434(org-defkey org-agenda-mode-map "\\" 'org-agenda-filter-by-tag-refine) 1452(org-defkey org-agenda-mode-map "\\" 'org-agenda-filter-by-tag-refine)
1435(org-defkey org-agenda-mode-map ";" 'org-timer-set-timer) 1453(org-defkey org-agenda-mode-map ";" 'org-timer-set-timer)
1454(define-key org-agenda-mode-map "?" 'org-agenda-show-the-flagging-note)
1455(org-defkey org-agenda-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull)
1456(org-defkey org-agenda-mode-map "\C-c\C-x\C-mp" 'org-mobile-push)
1436 1457
1437(defvar org-agenda-keymap (copy-keymap org-agenda-mode-map) 1458(defvar org-agenda-keymap (copy-keymap org-agenda-mode-map)
1438 "Local keymap for agenda entries from Org-mode.") 1459 "Local keymap for agenda entries from Org-mode.")
@@ -1447,39 +1468,93 @@ The following commands are available:
1447 '("Agenda" 1468 '("Agenda"
1448 ("Agenda Files") 1469 ("Agenda Files")
1449 "--" 1470 "--"
1450 ["Show" org-agenda-show t] 1471 ("Agenda Dates"
1472 ["Goto Today" org-agenda-goto-today (org-agenda-check-type nil 'agenda 'timeline)]
1473 ["Next Dates" org-agenda-later (org-agenda-check-type nil 'agenda)]
1474 ["Previous Dates" org-agenda-earlier (org-agenda-check-type nil 'agenda)]
1475 ["Jump to date" org-agenda-goto-date (org-agenda-check-type nil 'agenda)])
1476 "--"
1477 ("View"
1478 ["Day View" org-agenda-day-view
1479 :active (org-agenda-check-type nil 'agenda)
1480 :style radio :selected (equal org-agenda-ndays 1)
1481 :keys "v d (or just d)"]
1482 ["Week View" org-agenda-week-view
1483 :active (org-agenda-check-type nil 'agenda)
1484 :style radio :selected (equal org-agenda-ndays 7)
1485 :keys "v w (or just w)"]
1486 ["Month View" org-agenda-month-view
1487 :active (org-agenda-check-type nil 'agenda)
1488 :style radio :selected (member org-agenda-ndays '(28 29 30 31))
1489 :keys "v m"]
1490 ["Year View" org-agenda-year-view
1491 :active (org-agenda-check-type nil 'agenda)
1492 :style radio :selected (member org-agenda-ndays '(365 366))
1493 :keys "v y"]
1494 "--"
1495 ["Include Diary" org-agenda-toggle-diary
1496 :style toggle :selected org-agenda-include-diary
1497 :active (org-agenda-check-type nil 'agenda)]
1498 ["Use Time Grid" org-agenda-toggle-time-grid
1499 :style toggle :selected org-agenda-use-time-grid
1500 :active (org-agenda-check-type nil 'agenda)]
1501 "--"
1502 ["Show clock report" org-agenda-clockreport-mode
1503 :style toggle :selected org-agenda-clockreport-mode
1504 :active (org-agenda-check-type nil 'agenda)]
1505 ["Show some entry text" org-agenda-entry-text-mode
1506 :style toggle :selected org-agenda-entry-text-mode
1507 :active t]
1508 "--"
1509 ["Show Logbook entries" org-agenda-log-mode
1510 :style toggle :selected org-agenda-show-log
1511 :active (org-agenda-check-type nil 'agenda 'timeline)
1512 :keys "v l (or just l)"]
1513 ["Include archived trees" org-agenda-archives-mode
1514 :style toggle :selected org-agenda-archives-mode :active t
1515 :keys "v a"]
1516 ["Include archive files" (org-agenda-archives-mode t)
1517 :style toggle :selected (eq org-agenda-archives-mode t) :active t
1518 :keys "v A"]
1519 "--"
1520 ["Remove Restriction" org-agenda-remove-restriction-lock org-agenda-restrict])
1521 ["Write view to file" org-write-agenda t]
1522 ["Rebuild buffer" org-agenda-redo t]
1523 ["Save all Org-mode Buffers" org-save-all-org-buffers t]
1524 "--"
1525 ["Show original entry" org-agenda-show t]
1451 ["Go To (other window)" org-agenda-goto t] 1526 ["Go To (other window)" org-agenda-goto t]
1452 ["Go To (this window)" org-agenda-switch-to t] 1527 ["Go To (this window)" org-agenda-switch-to t]
1453 ["Follow Mode" org-agenda-follow-mode 1528 ["Follow Mode" org-agenda-follow-mode
1454 :style toggle :selected org-agenda-follow-mode :active t] 1529 :style toggle :selected org-agenda-follow-mode :active t]
1455 ["Tree to indirect frame" org-agenda-tree-to-indirect-buffer t] 1530; ["Tree to indirect frame" org-agenda-tree-to-indirect-buffer t]
1456 "--" 1531 "--"
1457 ["Cycle TODO" org-agenda-todo t] 1532 ("TODO"
1458 ("Archive and Refile" 1533 ["Cycle TODO" org-agenda-todo t]
1534 ["Next TODO set" org-agenda-todo-nextset t]
1535 ["Previous TODO set" org-agenda-todo-previousset t]
1536 ["Add note" org-agenda-add-note t])
1537 ("Archive/Refile/Delete"
1459 ["Toggle ARCHIVE tag" org-agenda-toggle-archive-tag t] 1538 ["Toggle ARCHIVE tag" org-agenda-toggle-archive-tag t]
1460 ["Move to archive sibling" org-agenda-archive-to-archive-sibling t] 1539 ["Move to archive sibling" org-agenda-archive-to-archive-sibling t]
1461 ["Archive subtree" org-agenda-archive t] 1540 ["Archive subtree" org-agenda-archive t]
1462 ["Refile" org-agenda-refile t]) 1541 "--"
1463 ["Delete subtree" org-agenda-kill t] 1542 ["Refile" org-agenda-refile t]
1543 "--"
1544 ["Delete subtree" org-agenda-kill t])
1464 ("Bulk action" 1545 ("Bulk action"
1465 ["Toggle mark entry" org-agenda-bulk-mark t] 1546 ["Mark entry" org-agenda-bulk-mark t]
1547 ["Unmark entry" org-agenda-bulk-unmark t]
1466 ["Act on all marked" org-agenda-bulk-action t] 1548 ["Act on all marked" org-agenda-bulk-action t]
1467 ["Unmark all entries" org-agenda-bulk-remove-all-marks :active t :keys "C-u s"]) 1549 ["Unmark all entries" org-agenda-bulk-remove-all-marks :active t :keys "C-u s"])
1468 "--" 1550 "--"
1469 ["Add note" org-agenda-add-note t]
1470 "--"
1471 ["Goto Today" org-agenda-goto-today (org-agenda-check-type nil 'agenda 'timeline)]
1472 ["Next Dates" org-agenda-later (org-agenda-check-type nil 'agenda)]
1473 ["Previous Dates" org-agenda-earlier (org-agenda-check-type nil 'agenda)]
1474 ["Jump to date" org-agenda-goto-date (org-agenda-check-type nil 'agenda)]
1475 "--"
1476 ("Tags and Properties" 1551 ("Tags and Properties"
1477 ["Show all Tags" org-agenda-show-tags t] 1552 ["Show all Tags" org-agenda-show-tags t]
1478 ["Set Tags current line" org-agenda-set-tags (not (org-region-active-p))] 1553 ["Set Tags current line" org-agenda-set-tags (not (org-region-active-p))]
1479 ["Change tag in region" org-agenda-set-tags (org-region-active-p)] 1554 ["Change tag in region" org-agenda-set-tags (org-region-active-p)]
1480 "--" 1555 "--"
1481 ["Column View" org-columns t]) 1556 ["Column View" org-columns t])
1482 ("Date/Schedule" 1557 ("Deadline/Schedule"
1483 ["Schedule" org-agenda-schedule t] 1558 ["Schedule" org-agenda-schedule t]
1484 ["Set Deadline" org-agenda-deadline t] 1559 ["Set Deadline" org-agenda-deadline t]
1485 "--" 1560 "--"
@@ -1517,57 +1592,17 @@ The following commands are available:
1517 ["Holidays" org-agenda-holidays (org-agenda-check-type nil 'agenda 'timeline)] 1592 ["Holidays" org-agenda-holidays (org-agenda-check-type nil 'agenda 'timeline)]
1518 ["Convert" org-agenda-convert-date (org-agenda-check-type nil 'agenda 'timeline)] 1593 ["Convert" org-agenda-convert-date (org-agenda-check-type nil 'agenda 'timeline)]
1519 "--" 1594 "--"
1520 ["Create iCalendar file" org-export-icalendar-combine-agenda-files t]) 1595 ["Create iCalendar File" org-export-icalendar-combine-agenda-files t])
1521 "--" 1596 "--"
1522 ("View" 1597 ["Undo Remote Editing" org-agenda-undo org-agenda-undo-list]
1523 ["Day View" org-agenda-day-view
1524 :active (org-agenda-check-type nil 'agenda)
1525 :style radio :selected (equal org-agenda-ndays 1)
1526 :keys "v d (or just d)"]
1527 ["Week View" org-agenda-week-view
1528 :active (org-agenda-check-type nil 'agenda)
1529 :style radio :selected (equal org-agenda-ndays 7)
1530 :keys "v w (or just w)"]
1531 ["Month View" org-agenda-month-view
1532 :active (org-agenda-check-type nil 'agenda)
1533 :style radio :selected (member org-agenda-ndays '(28 29 30 31))
1534 :keys "v m"]
1535 ["Year View" org-agenda-year-view
1536 :active (org-agenda-check-type nil 'agenda)
1537 :style radio :selected (member org-agenda-ndays '(365 366))
1538 :keys "v y"]
1539 "--"
1540 ["Include Diary" org-agenda-toggle-diary
1541 :style toggle :selected org-agenda-include-diary
1542 :active (org-agenda-check-type nil 'agenda)]
1543 ["Use Time Grid" org-agenda-toggle-time-grid
1544 :style toggle :selected org-agenda-use-time-grid
1545 :active (org-agenda-check-type nil 'agenda)]
1546 "--"
1547 ["Show clock report" org-agenda-clockreport-mode
1548 :style toggle :selected org-agenda-clockreport-mode
1549 :active (org-agenda-check-type nil 'agenda)]
1550 ["Show some entry text" org-agenda-entry-text-mode
1551 :style toggle :selected org-agenda-entry-text-mode
1552 :active t]
1553 "--" 1598 "--"
1554 ["Show Logbook entries" org-agenda-log-mode 1599 ("MobileOrg"
1555 :style toggle :selected org-agenda-show-log 1600 ["Push Files and Views" org-mobile-push t]
1556 :active (org-agenda-check-type nil 'agenda 'timeline) 1601 ["Get Captured and Flagged" org-mobile-pull t]
1557 :keys "v l (or just l)"] 1602 ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "C-c a ?"]
1558 ["Include archived trees" org-agenda-archives-mode 1603 ["Show note / unflag" org-agenda-show-the-flagging-note t]
1559 :style toggle :selected org-agenda-archives-mode :active t
1560 :keys "v a"]
1561 ["Include archive files" (org-agenda-archives-mode t)
1562 :style toggle :selected (eq org-agenda-archives-mode t) :active t
1563 :keys "v A"]
1564 "--" 1604 "--"
1565 ["Remove Restriction" org-agenda-remove-restriction-lock org-agenda-restrict]) 1605 ["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
1566 ["Write view to file" org-write-agenda t]
1567 ["Rebuild buffer" org-agenda-redo t]
1568 ["Save all Org-mode Buffers" org-save-all-org-buffers t]
1569 "--"
1570 ["Undo Remote Editing" org-agenda-undo org-agenda-undo-list]
1571 "--" 1606 "--"
1572 ["Quit" org-agenda-quit t] 1607 ["Quit" org-agenda-quit t]
1573 ["Exit and Release Buffers" org-agenda-exit t] 1608 ["Exit and Release Buffers" org-agenda-exit t]
@@ -1690,9 +1725,11 @@ Pressing `<' twice means to restrict to the current subtree or region
1690 (buf (current-buffer)) 1725 (buf (current-buffer))
1691 (bfn (buffer-file-name (buffer-base-buffer))) 1726 (bfn (buffer-file-name (buffer-base-buffer)))
1692 entry key type match lprops ans) 1727 entry key type match lprops ans)
1693 ;; Turn off restriction unless there is an overriding one 1728 ;; Turn off restriction unless there is an overriding one,
1694 (unless org-agenda-overriding-restriction 1729 (unless org-agenda-overriding-restriction
1695 (put 'org-agenda-files 'org-restrict nil) 1730 (unless (org-bound-and-true-p org-agenda-keep-restriced-file-list)
1731 ;; There is a request to keep the file list in place
1732 (put 'org-agenda-files 'org-restrict nil))
1696 (setq org-agenda-restrict nil) 1733 (setq org-agenda-restrict nil)
1697 (move-marker org-agenda-restrict-begin nil) 1734 (move-marker org-agenda-restrict-begin nil)
1698 (move-marker org-agenda-restrict-end nil)) 1735 (move-marker org-agenda-restrict-end nil))
@@ -1771,6 +1808,22 @@ Pressing `<' twice means to restrict to the current subtree or region
1771 ((equal keys "m") (call-interactively 'org-tags-view)) 1808 ((equal keys "m") (call-interactively 'org-tags-view))
1772 ((equal keys "M") (org-call-with-arg 'org-tags-view (or arg '(4)))) 1809 ((equal keys "M") (org-call-with-arg 'org-tags-view (or arg '(4))))
1773 ((equal keys "e") (call-interactively 'org-store-agenda-views)) 1810 ((equal keys "e") (call-interactively 'org-store-agenda-views))
1811 ((equal keys "?") (org-tags-view nil "+FLAGGED")
1812 (org-add-hook
1813 'post-command-hook
1814 (lambda ()
1815 (unless (current-message)
1816 (let* ((m (org-agenda-get-any-marker))
1817 (note (and m (org-entry-get m "THEFLAGGINGNOTE"))))
1818 (when note
1819 (message (concat
1820 "FLAGGING-NOTE ([?] for more info): "
1821 (org-add-props
1822 (replace-regexp-in-string
1823 "\\\\n" "//"
1824 (copy-sequence note))
1825 nil 'face 'org-warning)))))))
1826 t t))
1774 ((equal keys "L") 1827 ((equal keys "L")
1775 (unless (org-mode-p) 1828 (unless (org-mode-p)
1776 (error "This is not an Org-mode file")) 1829 (error "This is not an Org-mode file"))
@@ -1816,7 +1869,7 @@ t List of all TODO entries T Entries with special TODO kwd
1816m Match a TAGS/PROP/TODO query M Like m, but only TODO entries 1869m Match a TAGS/PROP/TODO query M Like m, but only TODO entries
1817L Timeline for current buffer # List stuck projects (!=configure) 1870L Timeline for current buffer # List stuck projects (!=configure)
1818s Search for keywords C Configure custom agenda commands 1871s Search for keywords C Configure custom agenda commands
1819/ Multi-occur 1872/ Multi-occur ? Find :FLAGGED: entries
1820") 1873")
1821 (start 0)) 1874 (start 0))
1822 (while (string-match 1875 (while (string-match
@@ -1935,7 +1988,7 @@ s Search for keywords C Configure custom agenda commands
1935 ((eq c ?>) 1988 ((eq c ?>)
1936 (org-agenda-remove-restriction-lock 'noupdate) 1989 (org-agenda-remove-restriction-lock 'noupdate)
1937 (setq restriction nil)) 1990 (setq restriction nil))
1938 ((and (equal selstring "") (memq c '(?s ?a ?t ?m ?L ?C ?e ?T ?M ?# ?! ?/))) 1991 ((and (equal selstring "") (memq c '(?s ?a ?t ?m ?L ?C ?e ?T ?M ?# ?! ?/ ??)))
1939 (throw 'exit (cons (setq selstring (char-to-string c)) restriction))) 1992 (throw 'exit (cons (setq selstring (char-to-string c)) restriction)))
1940 ((and (> (length selstring) 0) (eq c ?\d)) 1993 ((and (> (length selstring) 0) (eq c ?\d))
1941 (delete-window) 1994 (delete-window)
@@ -2149,6 +2202,17 @@ so the export commands can easily use it."
2149 (and (get-buffer org-agenda-buffer-name) 2202 (and (get-buffer org-agenda-buffer-name)
2150 (kill-buffer org-agenda-buffer-name))))))) 2203 (kill-buffer org-agenda-buffer-name)))))))
2151 2204
2205(defun org-agenda-mark-header-line (pos)
2206 "Mark the line at POS as an agenda structure header."
2207 (save-excursion
2208 (goto-char pos)
2209 (put-text-property (point-at-bol) (point-at-eol)
2210 'org-agenda-structural-header t)
2211 (when org-agenda-title-append
2212 (put-text-property (point-at-bol) (point-at-eol)
2213 'org-agenda-title-append org-agenda-title-append))))
2214
2215
2152(defun org-write-agenda (file &optional open nosettings) 2216(defun org-write-agenda (file &optional open nosettings)
2153 "Write the current buffer (an agenda view) as a file. 2217 "Write the current buffer (an agenda view) as a file.
2154Depending on the extension of the file name, plain text (.txt), 2218Depending on the extension of the file name, plain text (.txt),
@@ -2171,7 +2235,7 @@ higher priority settings."
2171 '(save-excursion 2235 '(save-excursion
2172 (save-window-excursion 2236 (save-window-excursion
2173 (org-agenda-mark-filtered-text) 2237 (org-agenda-mark-filtered-text)
2174 (let ((bs (copy-sequence (buffer-string))) beg) 2238 (let ((bs (copy-sequence (buffer-string))) beg app)
2175 (org-agenda-unmark-filtered-text) 2239 (org-agenda-unmark-filtered-text)
2176 (with-temp-buffer 2240 (with-temp-buffer
2177 (insert bs) 2241 (insert bs)
@@ -2211,6 +2275,63 @@ higher priority settings."
2211 (concat (file-name-sans-extension file) ".ps")) 2275 (concat (file-name-sans-extension file) ".ps"))
2212 (expand-file-name file)) 2276 (expand-file-name file))
2213 (message "PDF written to %s" file)) 2277 (message "PDF written to %s" file))
2278 ((string-match "\\.org\\'" file)
2279 (let ((all (buffer-string)) in-date id pl prefix line)
2280 (with-temp-file file
2281 (org-mode)
2282 (insert all)
2283 (goto-char (point-min))
2284 (while (not (eobp))
2285 (cond
2286 ((looking-at "[ \t]*$")) ; keep empty lines
2287 ((looking-at "=+$")
2288 ;; remove underlining
2289 (delete-region (point) (point-at-eol)))
2290 ((get-text-property (point) 'org-agenda-structural-header)
2291 (setq in-date nil)
2292 (setq app (get-text-property (point)
2293 'org-agenda-title-append))
2294 (setq short (get-text-property (point)
2295 'short-heading))
2296 (when (and short (looking-at ".+"))
2297 (replace-match short)
2298 (beginning-of-line 1))
2299 (when app
2300 (end-of-line 1)
2301 (insert app)
2302 (beginning-of-line 1))
2303 (insert "* "))
2304 ((get-text-property (point) 'org-agenda-date-header)
2305 (setq in-date t)
2306 (insert "** "))
2307 ((setq m (or (get-text-property (point) 'org-hd-marker)
2308 (get-text-property (point) 'org-marker)))
2309 (if (setq pl (get-text-property (point) 'prefix-length))
2310 (progn
2311 (setq prefix (org-trim (buffer-substring
2312 (point) (+ (point) pl)))
2313 line (org-trim (buffer-substring
2314 (+ (point) pl)
2315 (point-at-eol))))
2316 (delete-region (point-at-bol) (point-at-eol))
2317 (insert line "<break>" prefix)
2318 (beginning-of-line 1))
2319 (and (looking-at "[ \t]+") (replace-match "")))
2320 (insert (if in-date "*** " "** "))
2321 (end-of-line 1)
2322 (insert "\n")
2323 (insert (org-agenda-get-some-entry-text
2324 m 10 " " 'planning)
2325 "\n")
2326 (when (setq id
2327 (if (org-bound-and-true-p
2328 org-mobile-force-id-on-agenda-items)
2329 (org-id-get m 'create)
2330 (org-entry-get m "ID")))
2331 (insert " :PROPERTIES:\n :ORIGINAL_ID: " id
2332 "\n :END:\n"))))
2333 (beginning-of-line 2)))
2334 (message "Agenda written to Org file %s" file)))
2214 ((string-match "\\.ics\\'" file) 2335 ((string-match "\\.ics\\'" file)
2215 (require 'org-icalendar) 2336 (require 'org-icalendar)
2216 (let ((org-agenda-marker-table 2337 (let ((org-agenda-marker-table
@@ -2269,16 +2390,20 @@ Drawers will be excluded, also the line with scheduling/deadline info."
2269 (let (m txt) 2390 (let (m txt)
2270 (goto-char (point-min)) 2391 (goto-char (point-min))
2271 (while (not (eobp)) 2392 (while (not (eobp))
2272 (if (not (setq m (get-text-property (point) 'org-hd-marker))) 2393 (if (not (setq m (org-get-at-bol 'org-hd-marker)))
2273 (beginning-of-line 2) 2394 (beginning-of-line 2)
2274 (setq txt (org-agenda-get-some-entry-text 2395 (setq txt (org-agenda-get-some-entry-text
2275 m org-agenda-add-entry-text-maxlines)) 2396 m org-agenda-add-entry-text-maxlines " > "))
2276 (end-of-line 1) 2397 (end-of-line 1)
2277 (if (string-match "\\S-" txt) (insert "\n" txt))))))) 2398 (if (string-match "\\S-" txt) (insert "\n" txt)))))))
2278 2399
2279(defun org-agenda-get-some-entry-text (marker n-lines) 2400(defun org-agenda-get-some-entry-text (marker n-lines &optional indent
2401 &rest keep)
2280 "Extract entry text from MARKER, at most N-LINES lines. 2402 "Extract entry text from MARKER, at most N-LINES lines.
2281This will ignore drawers etc, just get the text." 2403This will ignore drawers etc, just get the text.
2404If INDENT is given, prefix every line with this string. If KEEP is
2405given, it is a list of symbols, defining stuff that hould not be
2406removed from the entry content. Currently only `planning' is allowed here."
2282 (let (txt drawer-re kwd-time-re ind) 2407 (let (txt drawer-re kwd-time-re ind)
2283 (save-excursion 2408 (save-excursion
2284 (with-current-buffer (marker-buffer marker) 2409 (with-current-buffer (marker-buffer marker)
@@ -2288,9 +2413,9 @@ This will ignore drawers etc, just get the text."
2288 (save-restriction 2413 (save-restriction
2289 (widen) 2414 (widen)
2290 (goto-char marker) 2415 (goto-char marker)
2291 (beginning-of-line 2) 2416 (end-of-line 1)
2292 (setq txt (buffer-substring 2417 (setq txt (buffer-substring
2293 (point) 2418 (min (1+ (point)) (point-max))
2294 (progn (outline-next-heading) (point))) 2419 (progn (outline-next-heading) (point)))
2295 drawer-re org-drawer-regexp 2420 drawer-re org-drawer-regexp
2296 kwd-time-re (concat "^[ \t]*" org-keyword-time-regexp 2421 kwd-time-re (concat "^[ \t]*" org-keyword-time-regexp
@@ -2313,13 +2438,22 @@ This will ignore drawers etc, just get the text."
2313 (progn (re-search-forward 2438 (progn (re-search-forward
2314 "^[ \t]*:END:.*\n?" nil 'move) 2439 "^[ \t]*:END:.*\n?" nil 'move)
2315 (point)))) 2440 (point))))
2441 (unless (member 'planning keep)
2442 (goto-char (point-min))
2443 (while (re-search-forward kwd-time-re nil t)
2444 (replace-match "")))
2316 (goto-char (point-min)) 2445 (goto-char (point-min))
2317 (while (re-search-forward kwd-time-re nil t) 2446 (when org-agenda-entry-text-exclude-regexps
2318 (replace-match "")) 2447 (let ((re-list org-agenda-entry-text-exclude-regexps) re)
2319 (if (re-search-forward "[ \t\n]+\\'" nil t) 2448 (while (setq re (pop re-list))
2320 (replace-match "")) 2449 (goto-char (point-min))
2321 (goto-char (point-min)) 2450 (while (re-search-forward re nil t)
2322 ;; find min indentation 2451 (replace-match "")))))
2452 (goto-char (point-max))
2453 (skip-chars-backward " \t\n")
2454 (if (looking-at "[ \t\n]+\\'") (replace-match ""))
2455
2456 ;; find and remove min common indentation
2323 (goto-char (point-min)) 2457 (goto-char (point-min))
2324 (untabify (point-min) (point-max)) 2458 (untabify (point-min) (point-max))
2325 (setq ind (org-get-indentation)) 2459 (setq ind (org-get-indentation))
@@ -2333,9 +2467,13 @@ This will ignore drawers etc, just get the text."
2333 (move-to-column ind) 2467 (move-to-column ind)
2334 (delete-region (point-at-bol) (point))) 2468 (delete-region (point-at-bol) (point)))
2335 (beginning-of-line 2)) 2469 (beginning-of-line 2))
2470
2471 (run-hooks 'org-agenda-entry-text-cleanup-hook)
2472
2336 (goto-char (point-min)) 2473 (goto-char (point-min))
2337 (while (and (not (eobp)) (re-search-forward "^" nil t)) 2474 (when indent
2338 (replace-match " > ")) 2475 (while (and (not (eobp)) (re-search-forward "^" nil t))
2476 (replace-match indent t t)))
2339 (goto-char (point-min)) 2477 (goto-char (point-min))
2340 (while (looking-at "[ \t]*\n") (replace-match "")) 2478 (while (looking-at "[ \t]*\n") (replace-match ""))
2341 (goto-char (point-max)) 2479 (goto-char (point-max))
@@ -2352,8 +2490,8 @@ This will ignore drawers etc, just get the text."
2352 (save-excursion 2490 (save-excursion
2353 (goto-char (point-min)) 2491 (goto-char (point-min))
2354 (while (not (eobp)) 2492 (while (not (eobp))
2355 (when (setq m (or (get-text-property (point) 'org-hd-marker) 2493 (when (setq m (or (org-get-at-bol 'org-hd-marker)
2356 (get-text-property (point) 'org-marker))) 2494 (org-get-at-bol 'org-marker)))
2357 (push m markers)) 2495 (push m markers))
2358 (beginning-of-line 2))) 2496 (beginning-of-line 2)))
2359 (nreverse markers))) 2497 (nreverse markers)))
@@ -2416,6 +2554,7 @@ bind it in the options section.")
2416(defun org-prepare-agenda (&optional name) 2554(defun org-prepare-agenda (&optional name)
2417 (setq org-todo-keywords-for-agenda nil) 2555 (setq org-todo-keywords-for-agenda nil)
2418 (setq org-done-keywords-for-agenda nil) 2556 (setq org-done-keywords-for-agenda nil)
2557 (setq org-drawers-for-agenda nil)
2419 (setq org-agenda-filter nil) 2558 (setq org-agenda-filter nil)
2420 (put 'org-agenda-filter :preset-filter org-agenda-filter-preset) 2559 (put 'org-agenda-filter :preset-filter org-agenda-filter-preset)
2421 (if org-agenda-multi 2560 (if org-agenda-multi
@@ -2437,6 +2576,7 @@ bind it in the options section.")
2437 (org-uniquify org-todo-keywords-for-agenda)) 2576 (org-uniquify org-todo-keywords-for-agenda))
2438 (setq org-done-keywords-for-agenda 2577 (setq org-done-keywords-for-agenda
2439 (org-uniquify org-done-keywords-for-agenda)) 2578 (org-uniquify org-done-keywords-for-agenda))
2579 (setq org-drawers-for-agenda (org-uniquify org-drawers-for-agenda))
2440 (let* ((abuf (get-buffer-create org-agenda-buffer-name)) 2580 (let* ((abuf (get-buffer-create org-agenda-buffer-name))
2441 (awin (get-buffer-window abuf))) 2581 (awin (get-buffer-window abuf)))
2442 (cond 2582 (cond
@@ -2448,8 +2588,7 @@ bind it in the options section.")
2448 ((equal org-agenda-window-setup 'other-window) 2588 ((equal org-agenda-window-setup 'other-window)
2449 (org-switch-to-buffer-other-window abuf)) 2589 (org-switch-to-buffer-other-window abuf))
2450 ((equal org-agenda-window-setup 'other-frame) 2590 ((equal org-agenda-window-setup 'other-frame)
2451 (switch-to-buffer-other-frame abuf) 2591 (switch-to-buffer-other-frame abuf))
2452 (set-window-dedicated-p (selected-window) t))
2453 ((equal org-agenda-window-setup 'reorganize-frame) 2592 ((equal org-agenda-window-setup 'reorganize-frame)
2454 (delete-other-windows) 2593 (delete-other-windows)
2455 (org-switch-to-buffer-other-window abuf)))) 2594 (org-switch-to-buffer-other-window abuf))))
@@ -2488,7 +2627,7 @@ bind it in the options section.")
2488 (org-agenda-entry-text-hide) 2627 (org-agenda-entry-text-hide)
2489 (org-agenda-entry-text-show)) 2628 (org-agenda-entry-text-show))
2490 (run-hooks 'org-finalize-agenda-hook) 2629 (run-hooks 'org-finalize-agenda-hook)
2491 (setq org-agenda-type (get-text-property (point) 'org-agenda-type)) 2630 (setq org-agenda-type (org-get-at-bol 'org-agenda-type))
2492 (when (get 'org-agenda-filter :preset-filter) 2631 (when (get 'org-agenda-filter :preset-filter)
2493 (org-agenda-filter-apply org-agenda-filter)) 2632 (org-agenda-filter-apply org-agenda-filter))
2494 ))) 2633 )))
@@ -2505,7 +2644,7 @@ bind it in the options section.")
2505 (let (s ov) 2644 (let (s ov)
2506 (while (setq s (next-single-property-change (point) 'org-hd-marker)) 2645 (while (setq s (next-single-property-change (point) 'org-hd-marker))
2507 (goto-char s) 2646 (goto-char s)
2508 (when (equal (get-text-property (point) 'org-hd-marker) 2647 (when (equal (org-get-at-bol 'org-hd-marker)
2509 org-clock-hd-marker) 2648 org-clock-hd-marker)
2510 (setq ov (org-make-overlay (point-at-bol) (1+ (point-at-eol)))) 2649 (setq ov (org-make-overlay (point-at-bol) (1+ (point-at-eol))))
2511 (org-overlay-put ov 'type 'org-agenda-clocking) 2650 (org-overlay-put ov 'type 'org-agenda-clocking)
@@ -2558,7 +2697,7 @@ bind it in the options section.")
2558 (while (let ((pos (next-single-property-change (point) 'todo-state))) 2697 (while (let ((pos (next-single-property-change (point) 'todo-state)))
2559 (and pos (goto-char (1+ pos)))) 2698 (and pos (goto-char (1+ pos))))
2560 (setq org-blocked-by-checkboxes nil invis1 invis) 2699 (setq org-blocked-by-checkboxes nil invis1 invis)
2561 (let ((marker (get-text-property (point) 'org-hd-marker))) 2700 (let ((marker (org-get-at-bol 'org-hd-marker)))
2562 (when (and marker 2701 (when (and marker
2563 (not (with-current-buffer (marker-buffer marker) 2702 (not (with-current-buffer (marker-buffer marker)
2564 (save-excursion 2703 (save-excursion
@@ -2646,12 +2785,12 @@ no longer in use."
2646(defun org-agenda-entry-text-show-here () 2785(defun org-agenda-entry-text-show-here ()
2647 "Add some text from te entry as context to the current line." 2786 "Add some text from te entry as context to the current line."
2648 (let (m txt o) 2787 (let (m txt o)
2649 (setq m (get-text-property (point) 'org-hd-marker)) 2788 (setq m (org-get-at-bol 'org-hd-marker))
2650 (unless (marker-buffer m) 2789 (unless (marker-buffer m)
2651 (error "No marker points to an entry here")) 2790 (error "No marker points to an entry here"))
2652 (setq txt (concat "\n" (org-no-properties 2791 (setq txt (concat "\n" (org-no-properties
2653 (org-agenda-get-some-entry-text 2792 (org-agenda-get-some-entry-text
2654 m org-agenda-entry-text-maxlines)))) 2793 m org-agenda-entry-text-maxlines " > "))))
2655 (when (string-match "\\S-" txt) 2794 (when (string-match "\\S-" txt)
2656 (setq o (org-make-overlay (point-at-bol) (point-at-eol))) 2795 (setq o (org-make-overlay (point-at-bol) (point-at-eol)))
2657 (org-overlay-put o 'evaporate t) 2796 (org-overlay-put o 'evaporate t)
@@ -2665,7 +2804,7 @@ no longer in use."
2665 (goto-char (point-max)) 2804 (goto-char (point-max))
2666 (beginning-of-line 1) 2805 (beginning-of-line 1)
2667 (while (not (bobp)) 2806 (while (not (bobp))
2668 (when (get-text-property (point) 'org-hd-marker) 2807 (when (org-get-at-bol 'org-hd-marker)
2669 (org-agenda-entry-text-show-here)) 2808 (org-agenda-entry-text-show-here))
2670 (beginning-of-line 0)))) 2809 (beginning-of-line 0))))
2671 2810
@@ -2726,6 +2865,10 @@ dates."
2726 (push :scheduled args) 2865 (push :scheduled args)
2727 (push :sexp args) 2866 (push :sexp args)
2728 (if dotodo (push :todo args)) 2867 (if dotodo (push :todo args))
2868 (insert "Timeline of file " entry "\n")
2869 (add-text-properties (point-min) (point)
2870 (list 'face 'org-agenda-structure))
2871 (org-agenda-mark-header-line (point-min))
2729 (while (setq d (pop day-numbers)) 2872 (while (setq d (pop day-numbers))
2730 (if (and (listp d) (eq (car d) :omitted)) 2873 (if (and (listp d) (eq (car d) :omitted))
2731 (progn 2874 (progn
@@ -2758,6 +2901,7 @@ dates."
2758 'org-agenda-date-weekend 2901 'org-agenda-date-weekend
2759 'org-agenda-date)) 2902 'org-agenda-date))
2760 (put-text-property s (1- (point)) 'org-date-line t) 2903 (put-text-property s (1- (point)) 'org-date-line t)
2904 (put-text-property s (1- (point)) 'org-agenda-date-header t)
2761 (if (equal d today) 2905 (if (equal d today)
2762 (put-text-property s (1- (point)) 'org-today t)) 2906 (put-text-property s (1- (point)) 'org-today t))
2763 (and rtn (insert (org-finalize-agenda-entries rtn) "\n")) 2907 (and rtn (insert (org-finalize-agenda-entries rtn) "\n"))
@@ -2906,9 +3050,10 @@ given in `org-agenda-start-on-weekday'."
2906 file date :todo)) 3050 file date :todo))
2907 (setq rtnall (append rtnall rtn)))) 3051 (setq rtnall (append rtnall rtn))))
2908 (when rtnall 3052 (when rtnall
2909 (insert "ALL CURRENTLY OPEN TODO ITEMS:\n") 3053 (insert "All currently open TODO items:\n")
2910 (add-text-properties (point-min) (1- (point)) 3054 (add-text-properties (point-min) (1- (point))
2911 (list 'face 'org-agenda-structure)) 3055 (list 'face 'org-agenda-structure
3056 'short-heading "All TODO items"))
2912 (insert (org-finalize-agenda-entries rtnall) "\n"))) 3057 (insert (org-finalize-agenda-entries rtnall) "\n")))
2913 (unless org-agenda-compact-blocks 3058 (unless org-agenda-compact-blocks
2914 (let* ((d1 (car day-numbers)) 3059 (let* ((d1 (car day-numbers))
@@ -2928,7 +3073,8 @@ given in `org-agenda-start-on-weekday'."
2928 "") 3073 "")
2929 ":\n"))) 3074 ":\n")))
2930 (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure 3075 (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure
2931 'org-date-line t))) 3076 'org-date-line t))
3077 (org-agenda-mark-header-line s))
2932 (while (setq d (pop day-numbers)) 3078 (while (setq d (pop day-numbers))
2933 (setq date (calendar-gregorian-from-absolute d) 3079 (setq date (calendar-gregorian-from-absolute d)
2934 wd (calendar-day-of-week date) 3080 wd (calendar-day-of-week date)
@@ -2975,6 +3121,7 @@ given in `org-agenda-start-on-weekday'."
2975 'org-agenda-date-weekend 3121 'org-agenda-date-weekend
2976 'org-agenda-date)) 3122 'org-agenda-date))
2977 (put-text-property s (1- (point)) 'org-date-line t) 3123 (put-text-property s (1- (point)) 'org-date-line t)
3124 (put-text-property s (1- (point)) 'org-agenda-date-header t)
2978 (put-text-property s (1- (point)) 'org-day-cnt day-cnt) 3125 (put-text-property s (1- (point)) 'org-day-cnt day-cnt)
2979 (when todayp 3126 (when todayp
2980 (put-text-property s (1- (point)) 'org-today t) 3127 (put-text-property s (1- (point)) 'org-today t)
@@ -3205,6 +3352,7 @@ in `org-agenda-text-search-extra-files'."
3205 (insert "Press `[', `]' to add/sub word, `{', `}' to add/sub regexp, `C-u r' to edit\n") 3352 (insert "Press `[', `]' to add/sub word, `{', `}' to add/sub regexp, `C-u r' to edit\n")
3206 (add-text-properties pos (1- (point)) 3353 (add-text-properties pos (1- (point))
3207 (list 'face 'org-agenda-structure)))) 3354 (list 'face 'org-agenda-structure))))
3355 (org-agenda-mark-header-line (point-min))
3208 (when rtnall 3356 (when rtnall
3209 (insert (org-finalize-agenda-entries rtnall) "\n")) 3357 (insert (org-finalize-agenda-entries rtnall) "\n"))
3210 (goto-char (point-min)) 3358 (goto-char (point-min))
@@ -3259,7 +3407,11 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
3259 nil 'face 'org-agenda-structure) "\n") 3407 nil 'face 'org-agenda-structure) "\n")
3260 (insert "Global list of TODO items of type: ") 3408 (insert "Global list of TODO items of type: ")
3261 (add-text-properties (point-min) (1- (point)) 3409 (add-text-properties (point-min) (1- (point))
3262 (list 'face 'org-agenda-structure)) 3410 (list 'face 'org-agenda-structure
3411 'short-heading
3412 (concat "ToDo: "
3413 (or org-select-this-todo-keyword "ALL"))))
3414 (org-agenda-mark-header-line (point-min))
3263 (setq pos (point)) 3415 (setq pos (point))
3264 (insert (or org-select-this-todo-keyword "ALL") "\n") 3416 (insert (or org-select-this-todo-keyword "ALL") "\n")
3265 (add-text-properties pos (1- (point)) (list 'face 'org-warning)) 3417 (add-text-properties pos (1- (point)) (list 'face 'org-warning))
@@ -3275,6 +3427,7 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
3275 kwds)) 3427 kwds))
3276 (insert "\n")) 3428 (insert "\n"))
3277 (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure))) 3429 (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure)))
3430 (org-agenda-mark-header-line (point-min))
3278 (when rtnall 3431 (when rtnall
3279 (insert (org-finalize-agenda-entries rtnall) "\n")) 3432 (insert (org-finalize-agenda-entries rtnall) "\n"))
3280 (goto-char (point-min)) 3433 (goto-char (point-min))
@@ -3334,7 +3487,9 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
3334 nil 'face 'org-agenda-structure) "\n") 3487 nil 'face 'org-agenda-structure) "\n")
3335 (insert "Headlines with TAGS match: ") 3488 (insert "Headlines with TAGS match: ")
3336 (add-text-properties (point-min) (1- (point)) 3489 (add-text-properties (point-min) (1- (point))
3337 (list 'face 'org-agenda-structure)) 3490 (list 'face 'org-agenda-structure
3491 'short-heading
3492 (concat "Match: " match)))
3338 (setq pos (point)) 3493 (setq pos (point))
3339 (insert match "\n") 3494 (insert match "\n")
3340 (add-text-properties pos (1- (point)) (list 'face 'org-warning)) 3495 (add-text-properties pos (1- (point)) (list 'face 'org-warning))
@@ -3342,6 +3497,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
3342 (unless org-agenda-multi 3497 (unless org-agenda-multi
3343 (insert "Press `C-u r' to search again with new search string\n")) 3498 (insert "Press `C-u r' to search again with new search string\n"))
3344 (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure))) 3499 (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure)))
3500 (org-agenda-mark-header-line (point-min))
3345 (when rtnall 3501 (when rtnall
3346 (insert (org-finalize-agenda-entries rtnall) "\n")) 3502 (insert (org-finalize-agenda-entries rtnall) "\n"))
3347 (goto-char (point-min)) 3503 (goto-char (point-min))
@@ -4310,6 +4466,8 @@ The flag is set if the currently compiled format contains a `%T'.")
4310(defvar org-prefix-has-effort nil 4466(defvar org-prefix-has-effort nil
4311 "A flag, set by `org-compile-prefix-format'. 4467 "A flag, set by `org-compile-prefix-format'.
4312The flag is set if the currently compiled format contains a `%e'.") 4468The flag is set if the currently compiled format contains a `%e'.")
4469(defvar org-prefix-category-length nil
4470 "Used by `org-compile-prefix-format' to remember the category field widh.")
4313 4471
4314(defun org-format-agenda-item (extra txt &optional category tags dotime 4472(defun org-format-agenda-item (extra txt &optional category tags dotime
4315 noprefix remove-re) 4473 noprefix remove-re)
@@ -4344,7 +4502,7 @@ Any match of REMOVE-RE will be removed from TXT."
4344 (if (stringp dotime) dotime "") 4502 (if (stringp dotime) dotime "")
4345 (and org-agenda-search-headline-for-time txt)))) 4503 (and org-agenda-search-headline-for-time txt))))
4346 (time-of-day (and dotime (org-get-time-of-day ts))) 4504 (time-of-day (and dotime (org-get-time-of-day ts)))
4347 stamp plain s0 s1 s2 t1 t2 rtn srp 4505 stamp plain s0 s1 s2 t1 t2 rtn srp l
4348 duration) 4506 duration)
4349 (and (org-mode-p) buffer-file-name 4507 (and (org-mode-p) buffer-file-name
4350 (add-to-list 'org-agenda-contributing-files buffer-file-name)) 4508 (add-to-list 'org-agenda-contributing-files buffer-file-name))
@@ -4427,6 +4585,15 @@ Any match of REMOVE-RE will be removed from TXT."
4427 (t "")) 4585 (t ""))
4428 extra (or extra "") 4586 extra (or extra "")
4429 category (if (symbolp category) (symbol-name category) category)) 4587 category (if (symbolp category) (symbol-name category) category))
4588 (when (string-match org-bracket-link-regexp category)
4589 (setq l (if (match-end 3)
4590 (- (match-end 3) (match-beginning 3))
4591 (- (match-end 1) (match-beginning 1))))
4592 (when (< l (or org-prefix-category-length 0))
4593 (setq category (copy-sequence category))
4594 (org-add-props category nil
4595 'extra-space (make-string
4596 (- org-prefix-category-length l 1) ?\ ))))
4430 ;; Evaluate the compiled format 4597 ;; Evaluate the compiled format
4431 (setq rtn (concat (eval org-prefix-format-compiled) txt))) 4598 (setq rtn (concat (eval org-prefix-format-compiled) txt)))
4432 4599
@@ -4514,7 +4681,7 @@ a double colon separates inherited tags from local tags."
4514The resulting form is returned and stored in the variable 4681The resulting form is returned and stored in the variable
4515`org-prefix-format-compiled'." 4682`org-prefix-format-compiled'."
4516 (setq org-prefix-has-time nil org-prefix-has-tag nil 4683 (setq org-prefix-has-time nil org-prefix-has-tag nil
4517 org-prefix-has-effort nil) 4684 org-prefix-category-length nil org-prefix-has-effort nil)
4518 (let ((s (cond 4685 (let ((s (cond
4519 ((stringp org-agenda-prefix-format) 4686 ((stringp org-agenda-prefix-format)
4520 org-agenda-prefix-format) 4687 org-agenda-prefix-format)
@@ -4534,13 +4701,16 @@ The resulting form is returned and stored in the variable
4534 (if (equal var 'time) (setq org-prefix-has-time t)) 4701 (if (equal var 'time) (setq org-prefix-has-time t))
4535 (if (equal var 'tag) (setq org-prefix-has-tag t)) 4702 (if (equal var 'tag) (setq org-prefix-has-tag t))
4536 (if (equal var 'effort) (setq org-prefix-has-effort t)) 4703 (if (equal var 'effort) (setq org-prefix-has-effort t))
4704 (if (equal var 'category)
4705 (setq org-prefix-category-length
4706 (abs (string-to-number (match-string 2 s)))))
4537 (setq f (concat "%" (match-string 2 s) "s")) 4707 (setq f (concat "%" (match-string 2 s) "s"))
4538 (if opt 4708 (if opt
4539 (setq varform 4709 (setq varform
4540 `(if (equal "" ,var) 4710 `(if (equal "" ,var)
4541 "" 4711 ""
4542 (format ,f (if (equal "" ,var) "" (concat ,var ,c))))) 4712 (format ,f (if (equal "" ,var) "" (concat ,var ,c)))))
4543 (setq varform `(format ,f (if (equal ,var "") "" (concat ,var ,c))))) 4713 (setq varform `(format ,f (if (equal ,var "") "" (concat ,var ,c (get-text-property 0 'extra-space ,var))))))
4544 (setq s (replace-match "%s" t nil s)) 4714 (setq s (replace-match "%s" t nil s))
4545 (push varform vars)) 4715 (push varform vars))
4546 (setq vars (nreverse vars)) 4716 (setq vars (nreverse vars))
@@ -4594,8 +4764,8 @@ HH:MM."
4594 (if (eq x 'line) 4764 (if (eq x 'line)
4595 (save-excursion 4765 (save-excursion
4596 (beginning-of-line 1) 4766 (beginning-of-line 1)
4597 (setq re (get-text-property (point) 'org-todo-regexp)) 4767 (setq re (org-get-at-bol 'org-todo-regexp))
4598 (goto-char (+ (point) (or (get-text-property (point) 'prefix-length) 0))) 4768 (goto-char (+ (point) (or (org-get-at-bol 'prefix-length) 0)))
4599 (when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +")) 4769 (when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +"))
4600 (add-text-properties (match-beginning 0) (match-end 1) 4770 (add-text-properties (match-beginning 0) (match-end 1)
4601 (list 'face (org-get-todo-face 1))) 4771 (list 'face (org-get-todo-face 1)))
@@ -4615,7 +4785,7 @@ HH:MM."
4615 (setq x (concat (substring x 0 (match-end 1)) 4785 (setq x (concat (substring x 0 (match-end 1))
4616 (format org-agenda-todo-keyword-format 4786 (format org-agenda-todo-keyword-format
4617 (match-string 2 x)) 4787 (match-string 2 x))
4618 " " 4788 (org-add-props " " (text-properties-at 0 x))
4619 (substring x (match-end 3))))) 4789 (substring x (match-end 3)))))
4620 x))) 4790 x)))
4621 4791
@@ -4801,15 +4971,21 @@ If ERROR is non-nil, throw an error, otherwise just return nil."
4801 (interactive) 4971 (interactive)
4802 (if org-agenda-columns-active 4972 (if org-agenda-columns-active
4803 (org-columns-quit) 4973 (org-columns-quit)
4804 (if (window-dedicated-p) (delete-other-windows))
4805 (let ((buf (current-buffer))) 4974 (let ((buf (current-buffer)))
4806 (and (not (eq org-agenda-window-setup 'current-window)) 4975 (if (eq org-agenda-window-setup 'other-frame)
4807 (not (one-window-p)) 4976 (progn
4808 (delete-window)) 4977 (kill-buffer buf)
4809 (kill-buffer buf) 4978 (org-agenda-reset-markers)
4810 (org-agenda-reset-markers) 4979 (org-columns-remove-overlays)
4811 (org-columns-remove-overlays) 4980 (setq org-agenda-archives-mode nil)
4812 (setq org-agenda-archives-mode nil)) 4981 (delete-frame))
4982 (and (not (eq org-agenda-window-setup 'current-window))
4983 (not (one-window-p))
4984 (delete-window))
4985 (kill-buffer buf)
4986 (org-agenda-reset-markers)
4987 (org-columns-remove-overlays)
4988 (setq org-agenda-archives-mode nil)))
4813 ;; Maybe restore the pre-agenda window configuration. 4989 ;; Maybe restore the pre-agenda window configuration.
4814 (and org-agenda-restore-windows-after-quit 4990 (and org-agenda-restore-windows-after-quit
4815 (not (eq org-agenda-window-setup 'other-frame)) 4991 (not (eq org-agenda-window-setup 'other-frame))
@@ -4973,7 +5149,7 @@ E looks line \"+<2:25\"."
4973(defun org-agenda-compare-effort (op value) 5149(defun org-agenda-compare-effort (op value)
4974 "Compare the effort of the current line with VALUE, using OP. 5150 "Compare the effort of the current line with VALUE, using OP.
4975If the line does not have an effort defined, return nil." 5151If the line does not have an effort defined, return nil."
4976 (let ((eff (get-text-property (point) 'effort-minutes))) 5152 (let ((eff (org-get-at-bol 'effort-minutes)))
4977 (if (equal op ??) 5153 (if (equal op ??)
4978 (not eff) 5154 (not eff)
4979 (funcall op (or eff (if org-sort-agenda-noeffort-is-high 32767 0)) 5155 (funcall op (or eff (if org-sort-agenda-noeffort-is-high 32767 0))
@@ -4988,9 +5164,9 @@ If the line does not have an effort defined, return nil."
4988 (save-excursion 5164 (save-excursion
4989 (goto-char (point-min)) 5165 (goto-char (point-min))
4990 (while (not (eobp)) 5166 (while (not (eobp))
4991 (if (get-text-property (point) 'org-marker) 5167 (if (org-get-at-bol 'org-marker)
4992 (progn 5168 (progn
4993 (setq tags (get-text-property (point) 'tags)) ; used in eval 5169 (setq tags (org-get-at-bol 'tags)) ; used in eval
4994 (if (not (eval org-agenda-filter-form)) 5170 (if (not (eval org-agenda-filter-form))
4995 (org-agenda-filter-by-tag-hide-line)) 5171 (org-agenda-filter-by-tag-hide-line))
4996 (beginning-of-line 2)) 5172 (beginning-of-line 2))
@@ -5106,7 +5282,7 @@ With prefix ARG, go forward that many times the current span."
5106 (let* ((span org-agenda-span) 5282 (let* ((span org-agenda-span)
5107 (sd org-starting-day) 5283 (sd org-starting-day)
5108 (greg (calendar-gregorian-from-absolute sd)) 5284 (greg (calendar-gregorian-from-absolute sd))
5109 (cnt (get-text-property (point) 'org-day-cnt)) 5285 (cnt (org-get-at-bol 'org-day-cnt))
5110 greg2 nd) 5286 greg2 nd)
5111 (cond 5287 (cond
5112 ((eq span 'day) 5288 ((eq span 'day)
@@ -5201,7 +5377,7 @@ SPAN may be `day', `week', `month', `year'."
5201 (org-agenda-check-type t 'agenda) 5377 (org-agenda-check-type t 'agenda)
5202 (if (and (not n) (equal org-agenda-span span)) 5378 (if (and (not n) (equal org-agenda-span span))
5203 (error "Viewing span is already \"%s\"" span)) 5379 (error "Viewing span is already \"%s\"" span))
5204 (let* ((sd (or (get-text-property (point) 'day) 5380 (let* ((sd (or (org-get-at-bol 'day)
5205 org-starting-day)) 5381 org-starting-day))
5206 (computed (org-agenda-compute-time-span sd span n)) 5382 (computed (org-agenda-compute-time-span sd span n))
5207 (org-agenda-overriding-arguments 5383 (org-agenda-overriding-arguments
@@ -5427,13 +5603,12 @@ When called with a prefix argument, include all archive files as well."
5427 (force-mode-line-update)) 5603 (force-mode-line-update))
5428 5604
5429(defun org-agenda-post-command-hook () 5605(defun org-agenda-post-command-hook ()
5430 (and (eolp) (not (bolp)) (backward-char 1))
5431 (setq org-agenda-type 5606 (setq org-agenda-type
5432 (or (get-text-property (point) 'org-agenda-type) 5607 (or (get-text-property (point) 'org-agenda-type)
5433 (get-text-property (max (point-min) (1- (point))) 5608 (get-text-property (max (point-min) (1- (point)))
5434 'org-agenda-type))) 5609 'org-agenda-type)))
5435 (if (and org-agenda-follow-mode 5610 (if (and org-agenda-follow-mode
5436 (get-text-property (point) 'org-marker)) 5611 (org-get-at-bol 'org-marker))
5437 (org-agenda-show))) 5612 (org-agenda-show)))
5438 5613
5439(defun org-agenda-show-priority () 5614(defun org-agenda-show-priority ()
@@ -5441,13 +5616,13 @@ When called with a prefix argument, include all archive files as well."
5441This priority is composed of the main priority given with the [#A] cookies, 5616This priority is composed of the main priority given with the [#A] cookies,
5442and by additional input from the age of a schedules or deadline entry." 5617and by additional input from the age of a schedules or deadline entry."
5443 (interactive) 5618 (interactive)
5444 (let* ((pri (get-text-property (point-at-bol) 'priority))) 5619 (let* ((pri (org-get-at-bol 'priority)))
5445 (message "Priority is %d" (if pri pri -1000)))) 5620 (message "Priority is %d" (if pri pri -1000))))
5446 5621
5447(defun org-agenda-show-tags () 5622(defun org-agenda-show-tags ()
5448 "Show the tags applicable to the current item." 5623 "Show the tags applicable to the current item."
5449 (interactive) 5624 (interactive)
5450 (let* ((tags (get-text-property (point-at-bol) 'tags))) 5625 (let* ((tags (org-get-at-bol 'tags)))
5451 (if tags 5626 (if tags
5452 (message "Tags are :%s:" 5627 (message "Tags are :%s:"
5453 (org-no-properties (mapconcat 'identity tags ":"))) 5628 (org-no-properties (mapconcat 'identity tags ":")))
@@ -5456,7 +5631,7 @@ and by additional input from the age of a schedules or deadline entry."
5456(defun org-agenda-goto (&optional highlight) 5631(defun org-agenda-goto (&optional highlight)
5457 "Go to the Org-mode file which contains the item at point." 5632 "Go to the Org-mode file which contains the item at point."
5458 (interactive) 5633 (interactive)
5459 (let* ((marker (or (get-text-property (point) 'org-marker) 5634 (let* ((marker (or (org-get-at-bol 'org-marker)
5460 (org-agenda-error))) 5635 (org-agenda-error)))
5461 (buffer (marker-buffer marker)) 5636 (buffer (marker-buffer marker))
5462 (pos (marker-position marker))) 5637 (pos (marker-position marker)))
@@ -5480,11 +5655,11 @@ Point is in the buffer where the item originated.")
5480 "Kill the entry or subtree belonging to the current agenda entry." 5655 "Kill the entry or subtree belonging to the current agenda entry."
5481 (interactive) 5656 (interactive)
5482 (or (eq major-mode 'org-agenda-mode) (error "Not in agenda")) 5657 (or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
5483 (let* ((marker (or (get-text-property (point) 'org-marker) 5658 (let* ((marker (or (org-get-at-bol 'org-marker)
5484 (org-agenda-error))) 5659 (org-agenda-error)))
5485 (buffer (marker-buffer marker)) 5660 (buffer (marker-buffer marker))
5486 (pos (marker-position marker)) 5661 (pos (marker-position marker))
5487 (type (get-text-property (point) 'type)) 5662 (type (org-get-at-bol 'type))
5488 dbeg dend (n 0) conf) 5663 dbeg dend (n 0) conf)
5489 (org-with-remote-undo buffer 5664 (org-with-remote-undo buffer
5490 (with-current-buffer buffer 5665 (with-current-buffer buffer
@@ -5513,7 +5688,7 @@ Point is in the buffer where the item originated.")
5513 "Archive the entry or subtree belonging to the current agenda entry." 5688 "Archive the entry or subtree belonging to the current agenda entry."
5514 (interactive) 5689 (interactive)
5515 (or (eq major-mode 'org-agenda-mode) (error "Not in agenda")) 5690 (or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
5516 (let* ((marker (or (get-text-property (point) 'org-marker) 5691 (let* ((marker (or (org-get-at-bol 'org-marker)
5517 (org-agenda-error))) 5692 (org-agenda-error)))
5518 (buffer (marker-buffer marker)) 5693 (buffer (marker-buffer marker))
5519 (pos (marker-position marker))) 5694 (pos (marker-position marker)))
@@ -5531,7 +5706,7 @@ Point is in the buffer where the item originated.")
5531 "Move the entry to the archive sibling." 5706 "Move the entry to the archive sibling."
5532 (interactive) 5707 (interactive)
5533 (or (eq major-mode 'org-agenda-mode) (error "Not in agenda")) 5708 (or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
5534 (let* ((marker (or (get-text-property (point) 'org-marker) 5709 (let* ((marker (or (org-get-at-bol 'org-marker)
5535 (org-agenda-error))) 5710 (org-agenda-error)))
5536 (buffer (marker-buffer marker)) 5711 (buffer (marker-buffer marker))
5537 (pos (marker-position marker))) 5712 (pos (marker-position marker)))
@@ -5561,7 +5736,7 @@ If this information is not given, the function uses the tree at point."
5561 (goto-char (point-max)) 5736 (goto-char (point-max))
5562 (beginning-of-line 1) 5737 (beginning-of-line 1)
5563 (while (not (bobp)) 5738 (while (not (bobp))
5564 (when (and (setq m (get-text-property (point) 'org-marker)) 5739 (when (and (setq m (org-get-at-bol 'org-marker))
5565 (equal buf (marker-buffer m)) 5740 (equal buf (marker-buffer m))
5566 (setq p (marker-position m)) 5741 (setq p (marker-position m))
5567 (>= p beg) 5742 (>= p beg)
@@ -5575,7 +5750,7 @@ If this information is not given, the function uses the tree at point."
5575 (interactive "P") 5750 (interactive "P")
5576 (if (equal goto '(16)) 5751 (if (equal goto '(16))
5577 (org-refile-goto-last-stored) 5752 (org-refile-goto-last-stored)
5578 (let* ((marker (or (get-text-property (point) 'org-hd-marker) 5753 (let* ((marker (or (org-get-at-bol 'org-hd-marker)
5579 (org-agenda-error))) 5754 (org-agenda-error)))
5580 (buffer (marker-buffer marker)) 5755 (buffer (marker-buffer marker))
5581 (pos (marker-position marker)) 5756 (pos (marker-position marker))
@@ -5596,20 +5771,24 @@ If this information is not given, the function uses the tree at point."
5596This looks for a link in the displayed lin in the agenda. It also looks 5771This looks for a link in the displayed lin in the agenda. It also looks
5597at the text of the entry itself." 5772at the text of the entry itself."
5598 (interactive "P") 5773 (interactive "P")
5599 (let* ((marker (or (get-text-property (point) 'org-hd-marker) 5774 (let* ((marker (or (org-get-at-bol 'org-hd-marker)
5600 (get-text-property (point) 'org-marker))) 5775 (org-get-at-bol 'org-marker)))
5601 (buffer (and marker (marker-buffer marker)))) 5776 (buffer (and marker (marker-buffer marker)))
5777 (prefix (buffer-substring
5778 (point-at-bol)
5779 (+ (point-at-bol)
5780 (org-get-at-bol 'prefix-length)))))
5602 (unless buffer (error "Don't know where to look for links")) 5781 (unless buffer (error "Don't know where to look for links"))
5603 (with-current-buffer buffer 5782 (with-current-buffer buffer
5604 (save-excursion 5783 (save-excursion
5605 (save-restriction 5784 (save-restriction
5606 (widen) 5785 (widen)
5607 (goto-char marker) 5786 (goto-char marker)
5608 (org-offer-links-in-entry arg)))))) 5787 (org-offer-links-in-entry arg prefix))))))
5609 5788
5610(defun org-agenda-copy-local-variable (var) 5789(defun org-agenda-copy-local-variable (var)
5611 "Get a variable from a referenced buffer and install it here." 5790 "Get a variable from a referenced buffer and install it here."
5612 (let ((m (get-text-property (point) 'org-marker))) 5791 (let ((m (org-get-at-bol 'org-marker)))
5613 (when (and m (buffer-live-p (marker-buffer m))) 5792 (when (and m (buffer-live-p (marker-buffer m)))
5614 (org-set-local var (with-current-buffer (marker-buffer m) 5793 (org-set-local var (with-current-buffer (marker-buffer m)
5615 (symbol-value var)))))) 5794 (symbol-value var))))))
@@ -5617,7 +5796,7 @@ at the text of the entry itself."
5617(defun org-agenda-switch-to (&optional delete-other-windows) 5796(defun org-agenda-switch-to (&optional delete-other-windows)
5618 "Go to the Org-mode file which contains the item at point." 5797 "Go to the Org-mode file which contains the item at point."
5619 (interactive) 5798 (interactive)
5620 (let* ((marker (or (get-text-property (point) 'org-marker) 5799 (let* ((marker (or (org-get-at-bol 'org-marker)
5621 (org-agenda-error))) 5800 (org-agenda-error)))
5622 (buffer (marker-buffer marker)) 5801 (buffer (marker-buffer marker))
5623 (pos (marker-position marker))) 5802 (pos (marker-position marker)))
@@ -5748,7 +5927,7 @@ docstring of `org-agenda-show-1'."
5748 5927
5749(defun org-agenda-check-no-diary () 5928(defun org-agenda-check-no-diary ()
5750 "Check if the entry is a diary link and abort if yes." 5929 "Check if the entry is a diary link and abort if yes."
5751 (if (get-text-property (point) 'org-agenda-diary-link) 5930 (if (org-get-at-bol 'org-agenda-diary-link)
5752 (org-agenda-error))) 5931 (org-agenda-error)))
5753 5932
5754(defun org-agenda-error () 5933(defun org-agenda-error ()
@@ -5763,7 +5942,7 @@ With a C-u prefix, make a separate frame for this tree (i.e. don't use the
5763dedicated frame)." 5942dedicated frame)."
5764 (interactive) 5943 (interactive)
5765 (org-agenda-check-no-diary) 5944 (org-agenda-check-no-diary)
5766 (let* ((marker (or (get-text-property (point) 'org-marker) 5945 (let* ((marker (or (org-get-at-bol 'org-marker)
5767 (org-agenda-error))) 5946 (org-agenda-error)))
5768 (buffer (marker-buffer marker)) 5947 (buffer (marker-buffer marker))
5769 (pos (marker-position marker))) 5948 (pos (marker-position marker)))
@@ -5793,12 +5972,12 @@ the same tree node, and the headline of the tree node in the Org-mode file."
5793 (interactive "P") 5972 (interactive "P")
5794 (org-agenda-check-no-diary) 5973 (org-agenda-check-no-diary)
5795 (let* ((col (current-column)) 5974 (let* ((col (current-column))
5796 (marker (or (get-text-property (point) 'org-marker) 5975 (marker (or (org-get-at-bol 'org-marker)
5797 (org-agenda-error))) 5976 (org-agenda-error)))
5798 (buffer (marker-buffer marker)) 5977 (buffer (marker-buffer marker))
5799 (pos (marker-position marker)) 5978 (pos (marker-position marker))
5800 (hdmarker (get-text-property (point) 'org-hd-marker)) 5979 (hdmarker (org-get-at-bol 'org-hd-marker))
5801 (todayp (equal (get-text-property (point) 'day) 5980 (todayp (equal (org-get-at-bol 'day)
5802 (time-to-days (current-time)))) 5981 (time-to-days (current-time))))
5803 (inhibit-read-only t) 5982 (inhibit-read-only t)
5804 org-agenda-headline-snapshot-before-repeat newhead just-one) 5983 org-agenda-headline-snapshot-before-repeat newhead just-one)
@@ -5833,11 +6012,11 @@ the same tree node, and the headline of the tree node in the Org-mode file."
5833 "Add a time-stamped note to the entry at point." 6012 "Add a time-stamped note to the entry at point."
5834 (interactive "P") 6013 (interactive "P")
5835 (org-agenda-check-no-diary) 6014 (org-agenda-check-no-diary)
5836 (let* ((marker (or (get-text-property (point) 'org-marker) 6015 (let* ((marker (or (org-get-at-bol 'org-marker)
5837 (org-agenda-error))) 6016 (org-agenda-error)))
5838 (buffer (marker-buffer marker)) 6017 (buffer (marker-buffer marker))
5839 (pos (marker-position marker)) 6018 (pos (marker-position marker))
5840 (hdmarker (get-text-property (point) 'org-hd-marker)) 6019 (hdmarker (org-get-at-bol 'org-hd-marker))
5841 (inhibit-read-only t)) 6020 (inhibit-read-only t))
5842 (with-current-buffer buffer 6021 (with-current-buffer buffer
5843 (widen) 6022 (widen)
@@ -5870,18 +6049,19 @@ If FORCE-TAGS is non nil, the car of it returns the new tags."
5870 (beginning-of-line 1) 6049 (beginning-of-line 1)
5871 (while (not finish) 6050 (while (not finish)
5872 (setq finish (bobp)) 6051 (setq finish (bobp))
5873 (when (and (setq m (get-text-property (point) 'org-hd-marker)) 6052 (when (and (setq m (org-get-at-bol 'org-hd-marker))
5874 (or (not just-this) (= (org-current-line) line)) 6053 (or (not just-this) (= (org-current-line) line))
5875 (equal m hdmarker)) 6054 (equal m hdmarker))
5876 (setq props (text-properties-at (point)) 6055 (setq props (text-properties-at (point))
5877 dotime (get-text-property (point) 'dotime) 6056 dotime (org-get-at-bol 'dotime)
5878 cat (get-text-property (point) 'org-category) 6057 cat (org-get-at-bol 'org-category)
5879 tags thetags 6058 tags thetags
5880 new (org-format-agenda-item "x" newhead cat tags dotime 'noprefix) 6059 new (org-format-agenda-item "x" newhead cat tags dotime 'noprefix)
5881 pl (get-text-property (point) 'prefix-length) 6060 pl (org-get-at-bol 'prefix-length)
5882 undone-face (get-text-property (point) 'undone-face) 6061 undone-face (org-get-at-bol 'undone-face)
5883 done-face (get-text-property (point) 'done-face)) 6062 done-face (org-get-at-bol 'done-face))
5884 (org-move-to-column pl) 6063 (goto-char (+ (point) pl))
6064 ;; (org-move-to-column pl) FIXME: does the above line work correctly?
5885 (cond 6065 (cond
5886 ((equal new "") 6066 ((equal new "")
5887 (beginning-of-line 1) 6067 (beginning-of-line 1)
@@ -5947,9 +6127,9 @@ the same tree node, and the headline of the tree node in the Org-mode file."
5947 (unless org-enable-priority-commands 6127 (unless org-enable-priority-commands
5948 (error "Priority commands are disabled")) 6128 (error "Priority commands are disabled"))
5949 (org-agenda-check-no-diary) 6129 (org-agenda-check-no-diary)
5950 (let* ((marker (or (get-text-property (point) 'org-marker) 6130 (let* ((marker (or (org-get-at-bol 'org-marker)
5951 (org-agenda-error))) 6131 (org-agenda-error)))
5952 (hdmarker (get-text-property (point) 'org-hd-marker)) 6132 (hdmarker (org-get-at-bol 'org-hd-marker))
5953 (buffer (marker-buffer hdmarker)) 6133 (buffer (marker-buffer hdmarker))
5954 (pos (marker-position hdmarker)) 6134 (pos (marker-position hdmarker))
5955 (inhibit-read-only t) 6135 (inhibit-read-only t)
@@ -5976,7 +6156,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
5976 (if (and (org-region-active-p) (interactive-p)) 6156 (if (and (org-region-active-p) (interactive-p))
5977 (call-interactively 'org-change-tag-in-region) 6157 (call-interactively 'org-change-tag-in-region)
5978 (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed 6158 (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed
5979 (let* ((hdmarker (or (get-text-property (point) 'org-hd-marker) 6159 (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
5980 (org-agenda-error))) 6160 (org-agenda-error)))
5981 (buffer (marker-buffer hdmarker)) 6161 (buffer (marker-buffer hdmarker))
5982 (pos (marker-position hdmarker)) 6162 (pos (marker-position hdmarker))
@@ -6005,7 +6185,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
6005 (interactive) 6185 (interactive)
6006 (org-agenda-check-no-diary) 6186 (org-agenda-check-no-diary)
6007 (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed 6187 (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed
6008 (let* ((hdmarker (or (get-text-property (point) 'org-hd-marker) 6188 (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
6009 (org-agenda-error))) 6189 (org-agenda-error)))
6010 (buffer (marker-buffer hdmarker)) 6190 (buffer (marker-buffer hdmarker))
6011 (pos (marker-position hdmarker)) 6191 (pos (marker-position hdmarker))
@@ -6028,7 +6208,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
6028 (interactive) 6208 (interactive)
6029 (org-agenda-check-no-diary) 6209 (org-agenda-check-no-diary)
6030 (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed 6210 (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed
6031 (let* ((hdmarker (or (get-text-property (point) 'org-hd-marker) 6211 (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
6032 (org-agenda-error))) 6212 (org-agenda-error)))
6033 (buffer (marker-buffer hdmarker)) 6213 (buffer (marker-buffer hdmarker))
6034 (pos (marker-position hdmarker)) 6214 (pos (marker-position hdmarker))
@@ -6052,7 +6232,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
6052 (interactive) 6232 (interactive)
6053 (org-agenda-check-no-diary) 6233 (org-agenda-check-no-diary)
6054 (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed 6234 (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed
6055 (let* ((hdmarker (or (get-text-property (point) 'org-hd-marker) 6235 (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
6056 (org-agenda-error))) 6236 (org-agenda-error)))
6057 (buffer (marker-buffer hdmarker)) 6237 (buffer (marker-buffer hdmarker))
6058 (pos (marker-position hdmarker)) 6238 (pos (marker-position hdmarker))
@@ -6109,7 +6289,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
6109 (interactive "p") 6289 (interactive "p")
6110 (org-agenda-check-type t 'agenda 'timeline) 6290 (org-agenda-check-type t 'agenda 'timeline)
6111 (org-agenda-check-no-diary) 6291 (org-agenda-check-no-diary)
6112 (let* ((marker (or (get-text-property (point) 'org-marker) 6292 (let* ((marker (or (org-get-at-bol 'org-marker)
6113 (org-agenda-error))) 6293 (org-agenda-error)))
6114 (buffer (marker-buffer marker)) 6294 (buffer (marker-buffer marker))
6115 (pos (marker-position marker))) 6295 (pos (marker-position marker)))
@@ -6159,7 +6339,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
6159 (save-excursion 6339 (save-excursion
6160 (goto-char (point-max)) 6340 (goto-char (point-max))
6161 (while (not (bobp)) 6341 (while (not (bobp))
6162 (when (equal marker (get-text-property (point) 'org-marker)) 6342 (when (equal marker (org-get-at-bol 'org-marker))
6163 (org-move-to-column (- (window-width) (length stamp)) t) 6343 (org-move-to-column (- (window-width) (length stamp)) t)
6164 (org-agenda-fix-tags-filter-overlays-at (point)) 6344 (org-agenda-fix-tags-filter-overlays-at (point))
6165 (if (featurep 'xemacs) 6345 (if (featurep 'xemacs)
@@ -6184,7 +6364,7 @@ be used to request time specification in the time stamp."
6184 (interactive "P") 6364 (interactive "P")
6185 (org-agenda-check-type t 'agenda 'timeline) 6365 (org-agenda-check-type t 'agenda 'timeline)
6186 (org-agenda-check-no-diary) 6366 (org-agenda-check-no-diary)
6187 (let* ((marker (or (get-text-property (point) 'org-marker) 6367 (let* ((marker (or (org-get-at-bol 'org-marker)
6188 (org-agenda-error))) 6368 (org-agenda-error)))
6189 (buffer (marker-buffer marker)) 6369 (buffer (marker-buffer marker))
6190 (pos (marker-position marker))) 6370 (pos (marker-position marker)))
@@ -6194,15 +6374,16 @@ be used to request time specification in the time stamp."
6194 (goto-char pos) 6374 (goto-char pos)
6195 (if (not (org-at-timestamp-p)) 6375 (if (not (org-at-timestamp-p))
6196 (error "Cannot find time stamp")) 6376 (error "Cannot find time stamp"))
6197 (org-time-stamp arg) 6377 (org-time-stamp arg))
6198 (message "Time stamp changed to %s" org-last-changed-timestamp))))) 6378 (org-agenda-show-new-time marker org-last-changed-timestamp))
6379 (message "Time stamp changed to %s" org-last-changed-timestamp)))
6199 6380
6200(defun org-agenda-schedule (arg) 6381(defun org-agenda-schedule (arg)
6201 "Schedule the item at point." 6382 "Schedule the item at point."
6202 (interactive "P") 6383 (interactive "P")
6203 (org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search) 6384 (org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search)
6204 (org-agenda-check-no-diary) 6385 (org-agenda-check-no-diary)
6205 (let* ((marker (or (get-text-property (point) 'org-marker) 6386 (let* ((marker (or (org-get-at-bol 'org-marker)
6206 (org-agenda-error))) 6387 (org-agenda-error)))
6207 (type (marker-insertion-type marker)) 6388 (type (marker-insertion-type marker))
6208 (buffer (marker-buffer marker)) 6389 (buffer (marker-buffer marker))
@@ -6223,7 +6404,7 @@ be used to request time specification in the time stamp."
6223 (interactive "P") 6404 (interactive "P")
6224 (org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search) 6405 (org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search)
6225 (org-agenda-check-no-diary) 6406 (org-agenda-check-no-diary)
6226 (let* ((marker (or (get-text-property (point) 'org-marker) 6407 (let* ((marker (or (org-get-at-bol 'org-marker)
6227 (org-agenda-error))) 6408 (org-agenda-error)))
6228 (buffer (marker-buffer marker)) 6409 (buffer (marker-buffer marker))
6229 (pos (marker-position marker)) 6410 (pos (marker-position marker))
@@ -6234,7 +6415,7 @@ be used to request time specification in the time stamp."
6234 (widen) 6415 (widen)
6235 (goto-char pos) 6416 (goto-char pos)
6236 (setq ts (org-deadline arg))) 6417 (setq ts (org-deadline arg)))
6237 (org-agenda-show-new-time marker ts "S")) 6418 (org-agenda-show-new-time marker ts "D"))
6238 (message "Deadline for this item set to %s" ts))) 6419 (message "Deadline for this item set to %s" ts)))
6239 6420
6240(defun org-agenda-action () 6421(defun org-agenda-action ()
@@ -6257,8 +6438,8 @@ The cursor may be at a date in the calendar, or in the Org agenda."
6257 ((equal ans ?m) 6438 ((equal ans ?m)
6258 ;; Mark this entry 6439 ;; Mark this entry
6259 (if (eq major-mode 'org-agenda-mode) 6440 (if (eq major-mode 'org-agenda-mode)
6260 (let ((m (or (get-text-property (point) 'org-hd-marker) 6441 (let ((m (or (org-get-at-bol 'org-hd-marker)
6261 (get-text-property (point) 'org-marker)))) 6442 (org-get-at-bol 'org-marker))))
6262 (if m 6443 (if m
6263 (progn 6444 (progn
6264 (move-marker org-agenda-action-marker 6445 (move-marker org-agenda-action-marker
@@ -6306,9 +6487,9 @@ The cursor may be at a date in the calendar, or in the Org agenda."
6306 (org-agenda-check-no-diary) 6487 (org-agenda-check-no-diary)
6307 (if (equal arg '(4)) 6488 (if (equal arg '(4))
6308 (org-clock-in arg) 6489 (org-clock-in arg)
6309 (let* ((marker (or (get-text-property (point) 'org-marker) 6490 (let* ((marker (or (org-get-at-bol 'org-marker)
6310 (org-agenda-error))) 6491 (org-agenda-error)))
6311 (hdmarker (or (get-text-property (point) 'org-hd-marker) 6492 (hdmarker (or (org-get-at-bol 'org-hd-marker)
6312 marker)) 6493 marker))
6313 (pos (marker-position marker)) 6494 (pos (marker-position marker))
6314 newhead) 6495 newhead)
@@ -6507,13 +6688,13 @@ This is a command that has to be installed in `calendar-mode-map'."
6507 "Mark the entry at point for future bulk action." 6688 "Mark the entry at point for future bulk action."
6508 (interactive) 6689 (interactive)
6509 (org-agenda-check-no-diary) 6690 (org-agenda-check-no-diary)
6510 (let* ((m (get-text-property (point) 'org-hd-marker)) 6691 (let* ((m (org-get-at-bol 'org-hd-marker))
6511 ov) 6692 ov)
6512 (unless (org-agenda-bulk-marked-p) 6693 (unless (org-agenda-bulk-marked-p)
6513 (unless m (error "Nothing to mark at point")) 6694 (unless m (error "Nothing to mark at point"))
6514 (push m org-agenda-bulk-marked-entries) 6695 (push m org-agenda-bulk-marked-entries)
6515 (setq ov (org-make-overlay (point-at-bol) (+ 2 (point-at-bol)))) 6696 (setq ov (org-make-overlay (point-at-bol) (+ 2 (point-at-bol))))
6516 (org-overlay-display ov ">>" 6697 (org-overlay-display ov "> "
6517 (org-get-todo-face "TODO") 6698 (org-get-todo-face "TODO")
6518 'evaporate) 6699 'evaporate)
6519 (org-overlay-put ov 'type 'org-marked-entry-overlay)) 6700 (org-overlay-put ov 'type 'org-marked-entry-overlay))
@@ -6528,7 +6709,7 @@ This is a command that has to be installed in `calendar-mode-map'."
6528 (org-agenda-bulk-remove-overlays 6709 (org-agenda-bulk-remove-overlays
6529 (point-at-bol) (+ 2 (point-at-bol))) 6710 (point-at-bol) (+ 2 (point-at-bol)))
6530 (setq org-agenda-bulk-marked-entries 6711 (setq org-agenda-bulk-marked-entries
6531 (delete (get-text-property (point-at-bol) 'org-hd-marker) 6712 (delete (org-get-at-bol 'org-hd-marker)
6532 org-agenda-bulk-marked-entries))) 6713 org-agenda-bulk-marked-entries)))
6533 (beginning-of-line 2) 6714 (beginning-of-line 2)
6534 (message "%d entries marked for bulk action" 6715 (message "%d entries marked for bulk action"
@@ -6655,6 +6836,53 @@ This will remove the markers, and the overlays."
6655 (format ", skipped %d (disappeared before their turn)" 6836 (format ", skipped %d (disappeared before their turn)"
6656 cntskip))))) 6837 cntskip)))))
6657 6838
6839;;; Flagging notes
6840
6841(defun org-agenda-show-the-flagging-note ()
6842 "Display the flagging note in the other window.
6843When called a second time in direct sequence, offer to remove the FLAGGING
6844tag and (if present) the flagging note."
6845 (interactive)
6846 (let ((hdmarker (org-get-at-bol 'org-hd-marker))
6847 (win (selected-window))
6848 note heading newhead)
6849 (unless hdmarker
6850 (error "No linked entry at point"))
6851 (if (and (eq this-command last-command)
6852 (y-or-n-p "Unflag and remove any flagging note? "))
6853 (progn
6854 (org-agenda-remove-flag hdmarker)
6855 (let ((win (get-buffer-window "*Flagging Note*")))
6856 (and win (delete-window win)))
6857 (message "Entry unflaged"))
6858 (setq note (org-entry-get hdmarker "THEFLAGGINGNOTE"))
6859 (unless note
6860 (error "No flagging note"))
6861 (org-kill-new note)
6862 (org-switch-to-buffer-other-window "*Flagging Note*")
6863 (erase-buffer)
6864 (insert note)
6865 (goto-char (point-min))
6866 (while (re-search-forward "\\\\n" nil t)
6867 (replace-match "\n" t t))
6868 (goto-char (point-min))
6869 (select-window win)
6870 (message "Flagging note pushed to kill ring. Press [?] again to remove tag and note"))))
6871
6872(defun org-agenda-remove-flag (marker)
6873 "Remove the FLAGGED tag and any flaging note in the entry."
6874 (let (newhead)
6875 (org-with-point-at marker
6876 (org-toggle-tag "FLAGGED" 'off)
6877 (org-entry-delete nil "THEFLAGGINGNOTE")
6878 (setq newhead (org-get-heading)))
6879 (org-agenda-change-all-lines newhead marker)
6880 (message "Entry unflaged")))
6881
6882(defun org-agenda-get-any-marker (&optional pos)
6883 (or (get-text-property (or pos (point-at-bol)) 'org-hd-marker)
6884 (get-text-property (or pos (point-at-bol)) 'org-marker)))
6885
6658;;; Appointment reminders 6886;;; Appointment reminders
6659 6887
6660(defvar appt-time-msg-list) 6888(defvar appt-time-msg-list)
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index 7a5692480ef..88bc82f158d 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -34,6 +34,15 @@
34 34
35(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ()) 35(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
36 36
37(defcustom org-archive-default-command 'org-archive-subtree
38 "The default archiving command.
39Currently this is only used by org-mobile.el."
40 :group 'org-archive
41 :type '(choice
42 (const org-archive-subtree)
43 (const org-archive-to-archive-sibling)
44 (const org-archive-set-tag)))
45
37(defcustom org-archive-sibling-heading "Archive" 46(defcustom org-archive-sibling-heading "Archive"
38 "Name of the local archive sibling that is used to archive entries locally. 47 "Name of the local archive sibling that is used to archive entries locally.
39Locally means: in the tree, under a sibling. 48Locally means: in the tree, under a sibling.
@@ -428,6 +437,18 @@ the children that do not contain any open TODO items."
428 (and set (beginning-of-line 1)) 437 (and set (beginning-of-line 1))
429 (message "Subtree %s" (if set "archived" "unarchived"))))) 438 (message "Subtree %s" (if set "archived" "unarchived")))))
430 439
440(defun org-archive-set-tag ()
441 "Set the ARCHIVE tag."
442 (interactive)
443 (org-toggle-tag org-archive-tag 'on))
444
445;;;###autoload
446(defun org-archive-subtree-default ()
447 "Archive the current subtree with the default command.
448This command is set with the variable `org-archive-default-command'."
449 (interactive)
450 (call-interactively 'org-archive-default-command))
451
431(provide 'org-archive) 452(provide 'org-archive)
432 453
433;; arch-tag: 0837f601-9699-43c3-8b90-631572ae6c85 454;; arch-tag: 0837f601-9699-43c3-8b90-631572ae6c85
diff --git a/lisp/org/org-ascii.el b/lisp/org/org-ascii.el
index 253066375dc..f66f441d010 100644
--- a/lisp/org/org-ascii.el
+++ b/lisp/org/org-ascii.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -27,7 +27,8 @@
27;;; Commentary: 27;;; Commentary:
28 28
29(require 'org-exp) 29(require 'org-exp)
30(eval-when-compile (require 'cl)) 30(eval-when-compile
31 (require 'cl))
31 32
32(defgroup org-export-ascii nil 33(defgroup org-export-ascii nil
33 "Options specific for ASCII export of Org-mode files." 34 "Options specific for ASCII export of Org-mode files."
@@ -57,6 +58,11 @@ in this way, it will be wrapped."
57 :group 'org-export-ascii 58 :group 'org-export-ascii
58 :type 'boolean) 59 :type 'boolean)
59 60
61;;; Hooks
62
63(defvar org-export-ascii-final-hook nil
64 "Hook run at the end of ASCII export, in the new buffer.")
65
60;;; ASCII export 66;;; ASCII export
61 67
62(defvar org-ascii-current-indentation nil) ; For communication 68(defvar org-ascii-current-indentation nil) ; For communication
@@ -456,6 +462,7 @@ publishing directory."
456 (setq end (next-single-property-change beg 'org-cwidth)) 462 (setq end (next-single-property-change beg 'org-cwidth))
457 (delete-region beg end) 463 (delete-region beg end)
458 (goto-char beg))) 464 (goto-char beg)))
465 (run-hooks 'org-export-ascii-final-hook)
459 (or to-buffer (save-buffer)) 466 (or to-buffer (save-buffer))
460 (goto-char (point-min)) 467 (goto-char (point-min))
461 (or (org-export-push-to-kill-ring "ASCII") 468 (or (org-export-push-to-kill-ring "ASCII")
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el
index 33a740b227a..a51a097fd31 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.30c 7;; Version: 6.31a
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-bbdb.el b/lisp/org/org-bbdb.el
index 2c2e9ce81a9..47d1eed6fd7 100644
--- a/lisp/org/org-bbdb.el
+++ b/lisp/org/org-bbdb.el
@@ -7,7 +7,7 @@
7;; Thomas Baumann <thomas dot baumann at ch dot tum dot de> 7;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
8;; Keywords: outlines, hypermedia, calendar, wp 8;; Keywords: outlines, hypermedia, calendar, wp
9;; Homepage: http://orgmode.org 9;; Homepage: http://orgmode.org
10;; Version: 6.30c 10;; Version: 6.31a
11;; 11;;
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13;; 13;;
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el
index 5e9fbe3cf76..74462b35f1f 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.30c 8;; Version: 6.31a
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 064d5269523..a72d3568f84 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -201,6 +201,12 @@ string as argument."
201 (string :tag "Program") 201 (string :tag "Program")
202 (function :tag "Function"))) 202 (function :tag "Function")))
203 203
204(defcustom org-clock-clocktable-default-properties '(:maxlevel 2 :scope file)
205 "Default properties for new clocktables."
206 :group 'org-clock
207 :type 'plist)
208
209
204(defvar org-clock-in-prepare-hook nil 210(defvar org-clock-in-prepare-hook nil
205 "Hook run when preparing the clock. 211 "Hook run when preparing the clock.
206This hook is run before anything happens to the task that 212This hook is run before anything happens to the task that
@@ -1035,8 +1041,8 @@ buffer and update it."
1035 (org-show-entry)) 1041 (org-show-entry))
1036 (if (org-in-clocktable-p) 1042 (if (org-in-clocktable-p)
1037 (goto-char (org-in-clocktable-p)) 1043 (goto-char (org-in-clocktable-p))
1038 (org-create-dblock (list :name "clocktable" 1044 (org-create-dblock (append (list :name "clocktable")
1039 :maxlevel 2 :scope 'file))) 1045 org-clock-clocktable-default-properties)))
1040 (org-update-dblock)) 1046 (org-update-dblock))
1041 1047
1042(defun org-in-clocktable-p () 1048(defun org-in-clocktable-p ()
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 42863b68b38..3dbb9140d0e 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -169,8 +169,8 @@ This is the compiled version of the format.")
169 ;; Check if the entry is in another buffer. 169 ;; Check if the entry is in another buffer.
170 (unless props 170 (unless props
171 (if (eq major-mode 'org-agenda-mode) 171 (if (eq major-mode 'org-agenda-mode)
172 (setq pom (or (get-text-property (point) 'org-hd-marker) 172 (setq pom (or (org-get-at-bol 'org-hd-marker)
173 (get-text-property (point) 'org-marker)) 173 (org-get-at-bol 'org-marker))
174 props (if pom (org-entry-properties pom) nil)) 174 props (if pom (org-entry-properties pom) nil))
175 (setq props (org-entry-properties nil)))) 175 (setq props (org-entry-properties nil))))
176 ;; Walk the format 176 ;; Walk the format
@@ -503,8 +503,8 @@ Where possible, use the standard interface for changing this line."
503(defun org-columns-edit-allowed () 503(defun org-columns-edit-allowed ()
504 "Edit the list of allowed values for the current property." 504 "Edit the list of allowed values for the current property."
505 (interactive) 505 (interactive)
506 (let* ((pom (or (get-text-property (point-at-bol) 'org-marker) 506 (let* ((pom (or (org-get-at-bol 'org-marker)
507 (get-text-property (point-at-bol) 'org-hd-marker) 507 (org-get-at-bol 'org-hd-marker)
508 (point))) 508 (point)))
509 (key (get-char-property (point) 'org-columns-key)) 509 (key (get-char-property (point) 'org-columns-key))
510 (key1 (concat key "_ALL")) 510 (key1 (concat key "_ALL"))
@@ -1259,7 +1259,7 @@ and tailing newline characters."
1259 org-agenda-overriding-columns-format) 1259 org-agenda-overriding-columns-format)
1260 (setq fmt org-agenda-overriding-columns-format) 1260 (setq fmt org-agenda-overriding-columns-format)
1261 (org-set-local 'org-agenda-overriding-columns-format fmt)) 1261 (org-set-local 'org-agenda-overriding-columns-format fmt))
1262 ((setq m (get-text-property (point-at-bol) 'org-hd-marker)) 1262 ((setq m (org-get-at-bol 'org-hd-marker))
1263 (setq fmt (or (org-entry-get m "COLUMNS" t) 1263 (setq fmt (or (org-entry-get m "COLUMNS" t)
1264 (with-current-buffer (marker-buffer m) 1264 (with-current-buffer (marker-buffer m)
1265 org-columns-default-format)))) 1265 org-columns-default-format))))
@@ -1281,8 +1281,8 @@ and tailing newline characters."
1281 ;; Get and cache the properties 1281 ;; Get and cache the properties
1282 (goto-char (point-min)) 1282 (goto-char (point-min))
1283 (while (not (eobp)) 1283 (while (not (eobp))
1284 (when (setq m (or (get-text-property (point) 'org-hd-marker) 1284 (when (setq m (or (org-get-at-bol 'org-hd-marker)
1285 (get-text-property (point) 'org-marker))) 1285 (org-get-at-bol 'org-marker)))
1286 (setq p (org-entry-properties m)) 1286 (setq p (org-entry-properties m))
1287 1287
1288 (when (or (not (setq a (assoc org-effort-property p))) 1288 (when (or (not (setq a (assoc org-effort-property p)))
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 876844ee7bc..1f6d3e9e5a4 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -36,7 +36,7 @@
36 36
37(require 'org-macs) 37(require 'org-macs)
38 38
39(declare-function find-library-name "find-func" (library)) 39(declare-function find-library-name "find-func" (library))
40(declare-function w32-focus-frame "term/w32-win" (frame)) 40(declare-function w32-focus-frame "term/w32-win" (frame))
41 41
42(defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself 42(defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself
diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el
new file mode 100644
index 00000000000..6dfa2ee15e1
--- /dev/null
+++ b/lisp/org/org-crypt.el
@@ -0,0 +1,178 @@
1;;; org-crypt.el --- Public key encryption for org-mode entries
2
3;; Copyright (C) 2009 Peter Jones <pjones@pmade.com>
4;; Copyright (C) 2007 John Wiegley <johnw@gnu.org>
5
6;; Emacs Lisp Archive Entry
7;; Filename: org-crypt.el
8;; Version: 6.31a
9;; Keywords: org-mode
10;; Author: John Wiegley <johnw@gnu.org>
11;; Maintainer: Peter Jones <pjones@pmade.com>
12;; Description: Adds public key encryption to org-mode buffers
13;; URL: http://www.newartisans.com/software/emacs.html
14;; Compatibility: Emacs22
15
16;; This file is part of GNU Emacs.
17;;
18;; GNU Emacs is free software: you can redistribute it and/or modify
19;; it under the terms of the GNU General Public License as published by
20;; the Free Software Foundation, either version 3 of the License, or
21;; (at your option) any later version.
22
23;; GNU Emacs is distributed in the hope that it will be useful,
24;; but WITHOUT ANY WARRANTY; without even the implied warranty of
25;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26;; GNU General Public License for more details.
27
28;; You should have received a copy of the GNU General Public License
29;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
30
31;;; Commentary:
32
33;; Right now this is just a set of functions to play with. It depends
34;; on the epg library. Here's how you would use it:
35;;
36;; 1. To mark an entry for encryption, tag the heading with "crypt".
37;; You can change the tag to any complex tag matching string by
38;; setting the `org-crypt-tag-matcher' variable.
39;;
40;; 2. Set the encryption key to use in the `org-crypt-key' variable,
41;; or use `M-x org-set-property' to set the property CRYPTKEY to
42;; any address in your public keyring. The text of the entry (but
43;; not its properties or headline) will be encrypted for this user.
44;; For them to read it, the corresponding secret key must be
45;; located in the secret key ring of the account where you try to
46;; decrypt it. This makes it possible to leave secure notes that
47;; only the intended recipient can read in a shared-org-mode-files
48;; scenario.
49;;
50;; 3. To later decrypt an entry, use `org-decrypt-entries' or
51;; `org-decrypt-entry'. It might be useful to bind this to a key,
52;; like C-c C-/. I hope that in the future, C-c C-r can be might
53;; overloaded to also decrypt an entry if it's encrypted, since
54;; that fits nicely with the meaning of "reveal".
55;;
56;; 4. To automatically encrypt all necessary entries when saving a
57;; file, call `org-crypt-use-before-save-magic' after loading
58;; org-crypt.el.
59;;
60;; TODO:
61;; - Allow symmetric encryption as well
62
63;;; Thanks:
64
65;; - Carsten Dominik
66;; - Vitaly Ostanin
67
68(require 'org)
69
70(declare-function epg-decrypt-string "epg" (context cipher))
71(declare-function epg-list-keys "epg" (context &optional name mode))
72(declare-function epg-make-context "epg"
73 (&optional protocol armor textmode include-certs
74 cipher-algorithm digest-algorithm
75 compress-algorithm))
76(declare-function epg-encrypt-string "epg"
77 (context plain recipients &optional sign always-trust))
78
79(defgroup org-crypt nil
80 "Org Crypt"
81 :tag "Org Crypt" :group 'org)
82
83(defcustom org-crypt-tag-matcher "crypt"
84 "The tag matcher used to find headings whose contents should be
85encrypted. See the \"Match syntax\" section of the org manual
86for more details."
87 :type 'string :group 'org-crypt)
88
89(defcustom org-crypt-key nil
90 "The default key to use when encrypting the contents of a
91heading. This can also be overridden in the CRYPTKEY property."
92 :type 'string :group 'org-crypt)
93
94(defun org-crypt-key-for-heading ()
95 "Returns the encryption key for the current heading."
96 (save-excursion
97 (org-back-to-heading t)
98 (or (org-entry-get nil "CRYPTKEY" 'selective)
99 org-crypt-key
100 (and (boundp 'epa-file-encrypt-to) epa-file-encrypt-to)
101 (error "No crypt key set"))))
102
103(defun org-encrypt-entry ()
104 "Encrypt the content of the current headline."
105 (interactive)
106 (require 'epg)
107 (save-excursion
108 (org-back-to-heading t)
109 (forward-line)
110 (when (not (looking-at "-----BEGIN PGP MESSAGE-----"))
111 (let ((folded (org-invisible-p))
112 (epg-context (epg-make-context nil t t))
113 (crypt-key (org-crypt-key-for-heading))
114 (beg (point))
115 end encrypted-text)
116 (org-end-of-subtree t t)
117 (org-back-over-empty-lines)
118 (setq end (point)
119 encrypted-text
120 (epg-encrypt-string
121 epg-context
122 (buffer-substring-no-properties beg end)
123 (epg-list-keys epg-context crypt-key)))
124 (delete-region beg end)
125 (insert encrypted-text)
126 (when folded
127 (save-excursion
128 (org-back-to-heading t)
129 (hide-subtree)))
130 nil))))
131
132(defun org-decrypt-entry ()
133 (interactive)
134 (require 'epg)
135 (save-excursion
136 (org-back-to-heading t)
137 (forward-line)
138 (when (looking-at "-----BEGIN PGP MESSAGE-----")
139 (let* ((beg (point))
140 (end (save-excursion
141 (search-forward "-----END PGP MESSAGE-----")
142 (forward-line)
143 (point)))
144 (epg-context (epg-make-context nil t t))
145 (decrypted-text
146 (decode-coding-string
147 (epg-decrypt-string
148 epg-context
149 (buffer-substring-no-properties beg end))
150 'utf-8)))
151 (delete-region beg end)
152 (insert decrypted-text)
153 nil))))
154
155(defun org-encrypt-entries ()
156 (interactive)
157 (org-scan-tags
158 'org-encrypt-entry
159 (cdr (org-make-tags-matcher org-crypt-tag-matcher))))
160
161(defun org-decrypt-entries ()
162 (interactive)
163 (org-scan-tags
164 'org-decrypt-entry
165 (cdr (org-make-tags-matcher org-crypt-tag-matcher))))
166
167(defun org-crypt-use-before-save-magic ()
168 "Adds a hook that will automatically encrypt entries before a
169file is saved to disk."
170 (add-hook
171 'org-mode-hook
172 (lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t))))
173
174(provide 'org-crypt)
175
176;; arch-tag: 8202ed2c-221e-4001-9e4b-54674a7e846e
177
178;;; org-crypt.el ends here
diff --git a/lisp/org/org-docbook.el b/lisp/org/org-docbook.el
index 6d6e67528a0..37d13cfe1d6 100644
--- a/lisp/org/org-docbook.el
+++ b/lisp/org/org-docbook.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Emacs Lisp Archive Entry 5;; Emacs Lisp Archive Entry
6;; Filename: org-docbook.el 6;; Filename: org-docbook.el
7;; Version: 6.30c 7;; Version: 6.31a
8;; Author: Baoqiu Cui <cbaoqiu AT yahoo DOT com> 8;; Author: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
9;; Maintainer: Baoqiu Cui <cbaoqiu AT yahoo DOT com> 9;; Maintainer: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
10;; Keywords: org, wp, docbook 10;; Keywords: org, wp, docbook
@@ -242,6 +242,11 @@ the variable to
242 :group 'org-export-docbook 242 :group 'org-export-docbook
243 :type 'string) 243 :type 'string)
244 244
245;;; Hooks
246
247(defvar org-export-docbook-final-hook nil
248 "Hook run at the end of DocBook export, in the new buffer.")
249
245;;; Autoload functions: 250;;; Autoload functions:
246 251
247;;;###autoload 252;;;###autoload
@@ -1123,6 +1128,7 @@ publishing directory."
1123 (goto-char (point-max)) 1128 (goto-char (point-max))
1124 (unless body-only 1129 (unless body-only
1125 (insert "</article>")) 1130 (insert "</article>"))
1131 (run-hooks 'org-export-docbook-final-hook)
1126 (or to-buffer (save-buffer)) 1132 (or to-buffer (save-buffer))
1127 (goto-char (point-min)) 1133 (goto-char (point-min))
1128 (or (org-export-push-to-kill-ring "DocBook") 1134 (or (org-export-push-to-kill-ring "DocBook")
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el
index 53b1a3d1171..04b973d6913 100644
--- a/lisp/org/org-exp.el
+++ b/lisp/org/org-exp.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -27,6 +27,7 @@
27;;; Commentary: 27;;; Commentary:
28 28
29(require 'org) 29(require 'org)
30(require 'org-macs)
30(require 'org-agenda) 31(require 'org-agenda)
31(require 'org-exp-blocks) 32(require 'org-exp-blocks)
32(eval-when-compile 33(eval-when-compile
@@ -655,12 +656,13 @@ modified) list.")
655 (let ((re (org-make-options-regexp 656 (let ((re (org-make-options-regexp
656 (append 657 (append
657 '("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE" 658 '("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE"
658 "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE" "LATEX_HEADER" 659 "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE"
660 "LATEX_HEADER" "LATEX_CLASS"
659 "EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS" 661 "EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS"
660 "KEYWORDS" "DESCRIPTION" "MACRO" "BIND") 662 "KEYWORDS" "DESCRIPTION" "MACRO" "BIND")
661 (mapcar 'car org-export-inbuffer-options-extra)))) 663 (mapcar 'car org-export-inbuffer-options-extra))))
662 p key val text options a pr style 664 p key val text options a pr style
663 latex-header macros letbind 665 latex-header latex-class macros letbind
664 ext-setup-or-nil setup-contents (start 0)) 666 ext-setup-or-nil setup-contents (start 0))
665 (while (or (and ext-setup-or-nil 667 (while (or (and ext-setup-or-nil
666 (string-match re ext-setup-or-nil start) 668 (string-match re ext-setup-or-nil start)
@@ -685,6 +687,8 @@ modified) list.")
685 (setq style (concat style "\n" val))) 687 (setq style (concat style "\n" val)))
686 ((string-equal key "LATEX_HEADER") 688 ((string-equal key "LATEX_HEADER")
687 (setq latex-header (concat latex-header "\n" val))) 689 (setq latex-header (concat latex-header "\n" val)))
690 ((string-equal key "LATEX_CLASS")
691 (setq latex-class val))
688 ((string-equal key "TEXT") 692 ((string-equal key "TEXT")
689 (setq text (if text (concat text "\n" val) val))) 693 (setq text (if text (concat text "\n" val) val)))
690 ((string-equal key "OPTIONS") 694 ((string-equal key "OPTIONS")
@@ -719,6 +723,8 @@ modified) list.")
719 (when style (setq p (plist-put p :style-extra style))) 723 (when style (setq p (plist-put p :style-extra style)))
720 (when latex-header 724 (when latex-header
721 (setq p (plist-put p :latex-header-extra (substring latex-header 1)))) 725 (setq p (plist-put p :latex-header-extra (substring latex-header 1))))
726 (when latex-class
727 (setq p (plist-put p :latex-class latex-class)))
722 (when options 728 (when options
723 (setq p (org-export-add-options-to-plist p options))) 729 (setq p (org-export-add-options-to-plist p options)))
724 ;; Add macro definitions 730 ;; Add macro definitions
@@ -1840,8 +1846,17 @@ When it is nil, all comments will be removed."
1840 (while (re-search-forward "^[ \t]*|" nil t) 1846 (while (re-search-forward "^[ \t]*|" nil t)
1841 (beginning-of-line 1) 1847 (beginning-of-line 1)
1842 (if (or (looking-at "[ \t]*| *[!_^] *|") 1848 (if (or (looking-at "[ \t]*| *[!_^] *|")
1843 (and (looking-at "[ \t]*|\\( *\\(<[0-9]+>\\|<[rl]>\\|<[rl][0-9]+>\\)? *|\\)+[ \t]*$") 1849 (not
1844 (not (looking-at ".*?| *[^ <|\n]")))) 1850 (memq
1851 nil
1852 (mapcar
1853 (lambda (f)
1854 (or (= (length f) 0)
1855 (string-match
1856 "\\`<\\([0-9]\\|[rl]\\|[rl][0-9]+\\)>\\'" f)))
1857 (org-split-string ;; FIXME, can't we do this without splitting???
1858 (buffer-substring (point-at-bol) (point-at-eol))
1859 "[ \t]*|[ \t]*")))))
1845 (delete-region (max (point-min) (1- (point-at-bol))) 1860 (delete-region (max (point-min) (1- (point-at-bol)))
1846 (point-at-eol)) 1861 (point-at-eol))
1847 (end-of-line 1)))) 1862 (end-of-line 1))))
@@ -2076,36 +2091,41 @@ TYPE must be a string, any of:
2076 (while (re-search-forward 2091 (while (re-search-forward
2077 "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\(([ \t\n]*\\([^\000]*?\\))\\)?}}}" 2092 "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\(([ \t\n]*\\([^\000]*?\\))\\)?}}}"
2078 nil t) 2093 nil t)
2079 (setq key (downcase (match-string 1)) 2094 (unless (save-match-data
2080 args (match-string 3)) 2095 (save-excursion
2081 (when (setq val (or (plist-get org-export-opt-plist 2096 (goto-char (point-at-bol))
2082 (intern (concat ":macro-" key))) 2097 (looking-at "[ \t]*#\\+macro")))
2083 (plist-get org-export-opt-plist 2098 (setq key (downcase (match-string 1))
2084 (intern (concat ":" key))))) 2099 args (match-string 3))
2085 (save-match-data 2100 (when (setq val (or (plist-get org-export-opt-plist
2086 (when args 2101 (intern (concat ":macro-" key)))
2087 (setq args (org-split-string args ",[ \t\n]*") args2 nil) 2102 (plist-get org-export-opt-plist
2088 (setq args (mapcar 'org-trim args)) 2103 (intern (concat ":" key)))))
2089 (while args 2104 (save-match-data
2090 (while (string-match "\\\\\\'" (car args)) 2105 (when args
2091 ;; repair bad splits 2106 (setq args (org-split-string args ",[ \t\n]*") args2 nil)
2092 (setcar (cdr args) (concat (substring (car args) 0 -1) 2107 (setq args (mapcar 'org-trim args))
2093 ";" (nth 1 args))) 2108 (while args
2094 (pop args)) 2109 (while (string-match "\\\\\\'" (car args))
2095 (push (pop args) args2)) 2110 ;; repair bad splits
2096 (setq args (nreverse args2)) 2111 (setcar (cdr args) (concat (substring (car args) 0 -1)
2097 (setq s 0) 2112 ";" (nth 1 args)))
2098 (while (string-match "\\$\\([0-9]+\\)" val s) 2113 (pop args))
2099 (setq s (1+ (match-beginning 0)) 2114 (push (pop args) args2))
2100 n (string-to-number (match-string 1 val))) 2115 (setq args (nreverse args2))
2101 (and (>= (length args) n) 2116 (setq s 0)
2102 (setq val (replace-match (nth (1- n) args) t t val))))) 2117 (while (string-match "\\$\\([0-9]+\\)" val s)
2103 (when (string-match "\\`(eval\\>" val) 2118 (setq s (1+ (match-beginning 0))
2104 (setq val (eval (read val)))) 2119 n (string-to-number (match-string 1 val)))
2105 (if (and val (not (stringp val))) 2120 (and (>= (length args) n)
2106 (setq val (format "%s" val)))) 2121 (setq val (replace-match (nth (1- n) args) t t val)))))
2107 (and (stringp val) 2122 (when (string-match "\\`(eval\\>" val)
2108 (replace-match val t t)))))) 2123 (setq val (eval (read val))))
2124 (if (and val (not (stringp val)))
2125 (setq val (format "%s" val))))
2126 (and (stringp val)
2127 (prog1 (replace-match val t t)
2128 (goto-char (match-beginning 0)))))))))
2109 2129
2110(defun org-export-apply-macros-in-string (s) 2130(defun org-export-apply-macros-in-string (s)
2111 "Apply the macros in string S." 2131 "Apply the macros in string S."
@@ -2801,6 +2821,8 @@ If yes remove the column and the special lines."
2801 (while (string-match org-bracket-link-regexp s) 2821 (while (string-match org-bracket-link-regexp s)
2802 (setq s (replace-match (match-string (if (match-end 3) 3 1) s) 2822 (setq s (replace-match (match-string (if (match-end 3) 3 1) s)
2803 t t s))) 2823 t t s)))
2824 (while (string-match "\\[\\([0-9]\\|fn:[^]]*\\)\\]" s)
2825 (setq s (replace-match "" t t s)))
2804 s) 2826 s)
2805 2827
2806(defun org-create-multibrace-regexp (left right n) 2828(defun org-create-multibrace-regexp (left right n)
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index d529348d4d4..adf04644b40 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -33,6 +33,18 @@
33(require 'org-macs) 33(require 'org-macs)
34(require 'org-compat) 34(require 'org-compat)
35 35
36(defun org-copy-face (old-face new-face docstring &rest attributes)
37 (unless (facep new-face)
38 (if (fboundp 'set-face-attribute)
39 (progn
40 (make-face new-face)
41 (set-face-attribute new-face nil :inherit old-face)
42 (apply 'set-face-attribute new-face nil attributes)
43 (set-face-doc-string new-face docstring))
44 (copy-face old-face new-face)
45 (if (fboundp 'set-face-doc-string)
46 (set-face-doc-string new-face docstring)))))
47
36(defgroup org-faces nil 48(defgroup org-faces nil
37 "Faces in Org-mode." 49 "Faces in Org-mode."
38 :tag "Org Faces" 50 :tag "Org Faces"
@@ -363,15 +375,12 @@ list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
363 "Face for checkboxes" 375 "Face for checkboxes"
364 :group 'org-faces) 376 :group 'org-faces)
365 377
366(unless (facep 'org-checkbox-statistics-todo)
367 (copy-face 'org-todo 'org-checkbox-statistics-todo)
368 (set-face-doc-string 'org-checkbox-statistics-todo
369 "Face used for unfinished checkbox statistics."))
370 378
371(unless (facep 'org-checkbox-statistics-done) 379(org-copy-face 'org-todo 'org-checkbox-statistics-todo
372 (copy-face 'org-done 'org-checkbox-statistics-done) 380 "Face used for unfinished checkbox statistics.")
373 (set-face-doc-string 'org-checkbox-statistics-done 381
374 "Face used for finished checkbox statistics.")) 382(org-copy-face 'org-done 'org-checkbox-statistics-done
383 "Face used for finished checkbox statistics.")
375 384
376(defcustom org-tag-faces nil 385(defcustom org-tag-faces nil
377 "Faces for specific tags. 386 "Faces for specific tags.
@@ -486,31 +495,21 @@ changes."
486 "Face used in agenda for captions and dates." 495 "Face used in agenda for captions and dates."
487 :group 'org-faces) 496 :group 'org-faces)
488 497
489(unless (facep 'org-agenda-date) 498(org-copy-face 'org-agenda-structure 'org-agenda-date
490 (copy-face 'org-agenda-structure 'org-agenda-date) 499 "Face used in agenda for normal days.")
491 (set-face-doc-string 'org-agenda-date
492 "Face used in agenda for normal days."))
493 500
494(unless (facep 'org-agenda-date-today) 501(org-copy-face 'org-agenda-date 'org-agenda-date-today
495 (copy-face 'org-agenda-date 'org-agenda-date-today) 502 "Face used in agenda for today."
496 (set-face-doc-string 'org-agenda-date-today 503 :weight 'bold :italic 't)
497 "Face used in agenda for today.")
498 (when (fboundp 'set-face-attribute)
499 (set-face-attribute 'org-agenda-date-today nil :weight 'bold :italic 't)))
500 504
501(unless (facep 'org-agenda-clocking) 505(org-copy-face 'secondary-selection 'org-agenda-clocking
502 (copy-face 'secondary-selection 'org-agenda-clocking) 506 "Face marking the current clock item in the agenda.")
503 (set-face-doc-string 'org-agenda-clocking
504 "Face marking the current clock item in the agenda."))
505 507
506(unless (facep 'org-agenda-date-weekend) 508(org-copy-face 'org-agenda-date 'org-agenda-date-weekend
507 (copy-face 'org-agenda-date 'org-agenda-date-weekend) 509 "Face used in agenda for weekend days.
508 (set-face-doc-string 'org-agenda-date-weekend
509 "Face used in agenda for weekend days.
510See the variable `org-agenda-weekend-days' for a definition of which days 510See the variable `org-agenda-weekend-days' for a definition of which days
511belong to the weekend.") 511belong to the weekend."
512 (when (fboundp 'set-face-attribute) 512 :weight 'bold)
513 (set-face-attribute 'org-agenda-date-weekend nil :weight 'bold)))
514 513
515(defface org-scheduled 514(defface org-scheduled
516 (org-compatible-face nil 515 (org-compatible-face nil
@@ -628,10 +627,8 @@ If it is less than 8, the level-1 face gets re-used for level N+1 etc."
628 "Face used to highlight math latex and other special exporter stuff." 627 "Face used to highlight math latex and other special exporter stuff."
629 :group 'org-faces) 628 :group 'org-faces)
630 629
631(unless (facep 'org-mode-line-clock) 630(org-copy-face 'modeline 'org-mode-line-clock
632 (copy-face 'modeline 'org-mode-line-clock) 631 "Face used for clock display in mode line.")
633 (set-face-doc-string 'org-agenda-date
634 "Face used for clock display in mode line."))
635 632
636(provide 'org-faces) 633(provide 'org-faces)
637 634
diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el
index bef0a533358..d8cf2e00d93 100644
--- a/lisp/org/org-feed.el
+++ b/lisp/org/org-feed.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.30c 8;; Version: 6.31a
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-footnote.el b/lisp/org/org-footnote.el
index 416eaaf45ec..6e520a418a0 100644
--- a/lisp/org/org-footnote.el
+++ b/lisp/org/org-footnote.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.30c 8;; Version: 6.31a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -290,7 +290,8 @@ or new, let the user edit the definition of the footnote."
290 (goto-char (point-max)) 290 (goto-char (point-max))
291 (insert "\n\n* " org-footnote-section "\n"))) 291 (insert "\n\n* " org-footnote-section "\n")))
292 ;; Now go to the end of this entry and insert there. 292 ;; Now go to the end of this entry and insert there.
293 (org-footnote-goto-local-insertion-point)) 293 (org-footnote-goto-local-insertion-point)
294 (org-show-context 'link-search))
294 (t 295 (t
295 (setq re (concat "^" org-footnote-tag-for-non-org-mode-files "[ \t]*$")) 296 (setq re (concat "^" org-footnote-tag-for-non-org-mode-files "[ \t]*$"))
296 (unless (re-search-forward re nil t) 297 (unless (re-search-forward re nil t)
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el
index 02e7075da66..027787c0bfa 100644
--- a/lisp/org/org-gnus.el
+++ b/lisp/org/org-gnus.el
@@ -7,7 +7,7 @@
7;; Tassilo Horn <tassilo at member dot fsf dot org> 7;; Tassilo Horn <tassilo at member dot fsf dot org>
8;; Keywords: outlines, hypermedia, calendar, wp 8;; Keywords: outlines, hypermedia, calendar, wp
9;; Homepage: http://orgmode.org 9;; Homepage: http://orgmode.org
10;; Version: 6.30c 10;; Version: 6.31a
11;; 11;;
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13;; 13;;
@@ -36,6 +36,12 @@
36(require 'org) 36(require 'org)
37(eval-when-compile (require 'gnus-sum)) 37(eval-when-compile (require 'gnus-sum))
38 38
39;; Declare external functions and variables
40(declare-function message-fetch-field "message" (header &optional not-all))
41(declare-function message-narrow-to-head-1 "message" nil)
42;; The following line suppresses a compiler warning stemming from gnus-sum.el
43(declare-function gnus-summary-last-subject "gnus-sum" nil)
44
39;; Customization variables 45;; Customization variables
40 46
41(when (fboundp 'defvaralias) 47(when (fboundp 'defvaralias)
@@ -49,11 +55,6 @@ negates this setting for the duration of the command."
49 :group 'org-link-store 55 :group 'org-link-store
50 :type 'boolean) 56 :type 'boolean)
51 57
52;; Declare external functions and variables
53
54(defvar gnus-other-frame-object)
55(defvar gnus-group-name)
56(defvar gnus-article-current)
57 58
58;; Install the link type 59;; Install the link type
59(org-add-link-type "gnus" 'org-gnus-open) 60(org-add-link-type "gnus" 'org-gnus-open)
diff --git a/lisp/org/org-html.el b/lisp/org/org-html.el
index 5b0e7cb5bfb..194da257961 100644
--- a/lisp/org/org-html.el
+++ b/lisp/org/org-html.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -419,6 +419,9 @@ This may also be a function, building and inserting the postamble.")
419(defvar org-export-html-after-blockquotes-hook nil 419(defvar org-export-html-after-blockquotes-hook nil
420 "Hook run during HTML export, after blockquote, verse, center are done.") 420 "Hook run during HTML export, after blockquote, verse, center are done.")
421 421
422(defvar org-export-html-final-hook nil
423 "Hook run during HTML export, after blockquote, verse, center are done.")
424
422;;; HTML export 425;;; HTML export
423 426
424(defun org-export-html-preprocess (parameters) 427(defun org-export-html-preprocess (parameters)
@@ -1461,6 +1464,7 @@ lang=\"%s\" xml:lang=\"%s\">
1461 (delete-region beg end) 1464 (delete-region beg end)
1462 (insert (format "<span style=\"visibility:hidden;\">%s</span>" 1465 (insert (format "<span style=\"visibility:hidden;\">%s</span>"
1463 (make-string n ?x))))) 1466 (make-string n ?x)))))
1467 (run-hooks 'org-export-html-final-hook)
1464 (or to-buffer (save-buffer)) 1468 (or to-buffer (save-buffer))
1465 (goto-char (point-min)) 1469 (goto-char (point-min))
1466 (or (org-export-push-to-kill-ring "HTML") 1470 (or (org-export-push-to-kill-ring "HTML")
diff --git a/lisp/org/org-icalendar.el b/lisp/org/org-icalendar.el
index d3804e6cfb6..23e739fe972 100644
--- a/lisp/org/org-icalendar.el
+++ b/lisp/org/org-icalendar.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index 295125f9ec7..01ce9ef35df 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.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.30c 8;; Version: 6.31a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -212,16 +212,17 @@ If the entry does not have an ID, the function returns nil.
212However, when CREATE is non nil, create an ID if none is present already. 212However, when CREATE is non nil, create an ID if none is present already.
213PREFIX will be passed through to `org-id-new'. 213PREFIX will be passed through to `org-id-new'.
214In any case, the ID of the entry is returned." 214In any case, the ID of the entry is returned."
215 (let ((id (org-entry-get pom "ID"))) 215 (org-with-point-at pom
216 (cond 216 (let ((id (org-entry-get nil "ID")))
217 ((and id (stringp id) (string-match "\\S-" id)) 217 (cond
218 id) 218 ((and id (stringp id) (string-match "\\S-" id))
219 (create 219 id)
220 (setq id (org-id-new prefix)) 220 (create
221 (org-entry-put pom "ID" id) 221 (setq id (org-id-new prefix))
222 (org-id-add-location id (buffer-file-name (buffer-base-buffer))) 222 (org-entry-put pom "ID" id)
223 id) 223 (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
224 (t nil)))) 224 id)
225 (t nil)))))
225 226
226;;;###autoload 227;;;###autoload
227(defun org-id-get-with-outline-path-completion (&optional targets) 228(defun org-id-get-with-outline-path-completion (&optional targets)
diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el
index 7099ec2c30b..0ae2958c3d0 100644
--- a/lisp/org/org-indent.el
+++ b/lisp/org/org-indent.el
@@ -4,7 +4,7 @@
4;; Author: Carsten Dominik <carsten at orgmode dot org> 4;; Author: Carsten Dominik <carsten at orgmode dot org>
5;; Keywords: outlines, hypermedia, calendar, wp 5;; Keywords: outlines, hypermedia, calendar, wp
6;; Homepage: http://orgmode.org 6;; Homepage: http://orgmode.org
7;; Version: 6.30c 7;; Version: 6.31a
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
@@ -277,5 +277,5 @@ Point is assumed to be at the beginning of a headline."
277 277
278(provide 'org-indent) 278(provide 'org-indent)
279 279
280;; arch-tag: 981f57e3-d747-49d1-8e63-ed460682cee6 280;; arch-tag: b76736bc-9f4a-43cd-977c-ecfd6689846a
281;;; org-indent.el ends here 281;;; org-indent.el ends here
diff --git a/lisp/org/org-info.el b/lisp/org/org-info.el
index 3b5cfb148ea..92ca1264cae 100644
--- a/lisp/org/org-info.el
+++ b/lisp/org/org-info.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el
index 070aa73f375..336ee401bf4 100644
--- a/lisp/org/org-inlinetask.el
+++ b/lisp/org/org-inlinetask.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.30c 8;; Version: 6.31a
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -93,25 +93,6 @@ the value of this variable."
93 :group 'org-inlinetask 93 :group 'org-inlinetask
94 :type 'boolean) 94 :type 'boolean)
95 95
96(defcustom org-inlinetask-export 'arrow+content
97 "What should be done with inlinetasks upon export?
98Possible values:
99
100nil Remove entirely, headline and \"content\"
101arrow Insert heading in bold, preceeded by an arrow
102arrow+content Insert arrow and headline, add content below in an
103 #+begin_example box (ugly, but works for now)
104
105The \"content\" of an inline task is the material below the planning
106line and any drawers, up to a lines wit the same number of stars,
107but containing only the word END."
108 :group 'org-inlinetask
109 :group 'org-export-general
110 :type '(choice
111 (const :tag "Remove entirely" nil)
112 (const :tag "Headline preceeded by arrow" arrow)
113 (const :tag "Arrow, headline, + content" arrow+content)))
114
115(defvar org-odd-levels-only) 96(defvar org-odd-levels-only)
116(defvar org-keyword-time-regexp) 97(defvar org-keyword-time-regexp)
117(defvar org-drawer-regexp) 98(defvar org-drawer-regexp)
@@ -127,6 +108,8 @@ but containing only the word END."
127 (end-of-line -1)) 108 (end-of-line -1))
128(define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task) 109(define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task)
129 110
111(defvar htmlp) ; dynamically scoped into the next function
112(defvar latexp) ; dynamically scoped into the next function
130(defun org-inlinetask-export-handler () 113(defun org-inlinetask-export-handler ()
131 "Handle headlines with level larger or equal to `org-inlinetask-min-level'. 114 "Handle headlines with level larger or equal to `org-inlinetask-min-level'.
132Either remove headline and meta data, or do special formatting." 115Either remove headline and meta data, or do special formatting."
@@ -136,7 +119,7 @@ Either remove headline and meta data, or do special formatting."
136 (or org-inlinetask-min-level 200))) 119 (or org-inlinetask-min-level 200)))
137 (re1 (format "^\\(\\*\\{%d,\\}\\) .*\n" nstars)) 120 (re1 (format "^\\(\\*\\{%d,\\}\\) .*\n" nstars))
138 (re2 (concat "^[ \t]*" org-keyword-time-regexp)) 121 (re2 (concat "^[ \t]*" org-keyword-time-regexp))
139 headline beg end stars content) 122 headline beg end stars content indent)
140 (while (re-search-forward re1 nil t) 123 (while (re-search-forward re1 nil t)
141 (setq headline (match-string 0) 124 (setq headline (match-string 0)
142 stars (match-string 1) 125 stars (match-string 1)
@@ -156,15 +139,24 @@ Either remove headline and meta data, or do special formatting."
156 (setq content (buffer-substring beg (1- (point-at-bol)))) 139 (setq content (buffer-substring beg (1- (point-at-bol))))
157 (delete-region beg (1+ (match-end 0)))) 140 (delete-region beg (1+ (match-end 0))))
158 (goto-char beg) 141 (goto-char beg)
159 (when (and org-inlinetask-export 142 (when (string-match org-complex-heading-regexp headline)
160 (string-match org-complex-heading-regexp headline)) 143 (setq headline (concat
161 (when (memq org-inlinetask-export '(arrow+content arrow)) 144 (if (match-end 2)
162 (insert "\n\n\\Rightarrow\\Rightarrow\\Rightarrow *" 145 (concat (match-string 2 headline) " ") "")
163 (if (match-end 2) (concat (match-string 2 headline) " ") "") 146 (match-string 4 headline)))
164 (match-string 4 headline) "*\n")) 147 (if (not (string-match "\\S-" content))
165 (when (and content (eq org-inlinetask-export 'arrow+content)) 148 (setq content nil)
166 (insert "#+BEGIN_EXAMPLE\n" content "\n#+END_EXAMPLE\n")) 149 (if (string-match "[ \t\n]+\\'" content)
167 (insert "\n"))))) 150 (setq content (substring content 0 (match-beginning 0))))
151 (setq content (org-remove-indentation content))
152 (if latexp (setq content (concat "\\quad \\\\\n" content))))
153 (insert "- ")
154 (setq indent (make-string (current-column) ?\ ))
155 (insert headline " ::")
156 (when content
157 (insert (if htmlp " " (concat "\n" indent))
158 (mapconcat 'identity (org-split-string content "\n")
159 (concat "\n" indent)) "\n"))))))
168 160
169(defun org-inlinetask-fontify (limit) 161(defun org-inlinetask-fontify (limit)
170 "Fontify the inline tasks." 162 "Fontify the inline tasks."
@@ -196,5 +188,4 @@ Either remove headline and meta data, or do special formatting."
196 188
197(provide 'org-inlinetask) 189(provide 'org-inlinetask)
198 190
199;; arch-tag: b76736bc-9f4a-43cd-977c-ecfd6689846a
200;;; org-inlinetask.el ends here 191;;; org-inlinetask.el ends here
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el
index f415bd1cc0f..258a5c2224a 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.30c 7;; Version: 6.31a
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 55f2251f560..52d5739e933 100644
--- a/lisp/org/org-jsinfo.el
+++ b/lisp/org/org-jsinfo.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-latex.el b/lisp/org/org-latex.el
index 48a7ac2878b..6e06459b0e9 100644
--- a/lisp/org/org-latex.el
+++ b/lisp/org/org-latex.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Emacs Lisp Archive Entry 5;; Emacs Lisp Archive Entry
6;; Filename: org-latex.el 6;; Filename: org-latex.el
7;; Version: 6.30c 7;; Version: 6.31a
8;; Author: Bastien Guerry <bzg AT altern DOT org> 8;; Author: Bastien Guerry <bzg AT altern DOT org>
9;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com> 9;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
10;; Keywords: org, wp, tex 10;; Keywords: org, wp, tex
@@ -49,6 +49,7 @@
49(require 'footnote) 49(require 'footnote)
50(require 'org) 50(require 'org)
51(require 'org-exp) 51(require 'org-exp)
52(require 'org-macs)
52 53
53;;; Variables: 54;;; Variables:
54(defvar org-export-latex-class nil) 55(defvar org-export-latex-class nil)
@@ -410,6 +411,9 @@ These are the .aux, .log, .out, and .toc files."
410(defvar org-export-latex-after-blockquotes-hook nil 411(defvar org-export-latex-after-blockquotes-hook nil
411 "Hook run during LaTeX export, after blockquote, verse, center are done.") 412 "Hook run during LaTeX export, after blockquote, verse, center are done.")
412 413
414(defvar org-export-latex-final-hook nil
415 "Hook run in the finalized LaTeX buffer.")
416
413;;; Autoload functions: 417;;; Autoload functions:
414 418
415;;;###autoload 419;;;###autoload
@@ -662,6 +666,7 @@ when PUB-DIR is set, use this as the publishing directory."
662 (and (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t) 666 (and (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t)
663 (replace-match "\\tableofcontents" t t))) 667 (replace-match "\\tableofcontents" t t)))
664 668
669 (run-hooks 'org-export-latex-final-hook)
665 (or to-buffer (save-buffer)) 670 (or to-buffer (save-buffer))
666 (goto-char (point-min)) 671 (goto-char (point-min))
667 (or (org-export-push-to-kill-ring "LaTeX") 672 (or (org-export-push-to-kill-ring "LaTeX")
@@ -923,6 +928,7 @@ LEVEL indicates the default depth for export."
923 (goto-char (point-min)) 928 (goto-char (point-min))
924 (and (re-search-forward "^#\\+LaTeX_CLASS:[ \t]*\\([a-zA-Z]+\\)" nil t) 929 (and (re-search-forward "^#\\+LaTeX_CLASS:[ \t]*\\([a-zA-Z]+\\)" nil t)
925 (match-string 1)))) 930 (match-string 1))))
931 (plist-get org-export-latex-options-plist :latex-class)
926 org-export-latex-default-class) 932 org-export-latex-default-class)
927 org-export-latex-class 933 org-export-latex-class
928 (or (car (assoc org-export-latex-class org-export-latex-classes)) 934 (or (car (assoc org-export-latex-class org-export-latex-classes))
@@ -1003,11 +1009,10 @@ If BEG is non-nil, it is the beginning of the region.
1003If END is non-nil, it is the end of the region." 1009If END is non-nil, it is the end of the region."
1004 (save-excursion 1010 (save-excursion
1005 (goto-char (or beg (point-min))) 1011 (goto-char (or beg (point-min)))
1006 (let* ((pt (point))) 1012 (let* ((pt (point))
1007 (or end 1013 (end (if (re-search-forward "^\\*+ " end t)
1008 (and (re-search-forward "^\\*+ " end t) 1014 (goto-char (match-beginning 0))
1009 (setq end (match-beginning 0))) 1015 (goto-char (or end (point-max))))))
1010 (setq end (point-max)))
1011 (prog1 1016 (prog1
1012 (org-export-latex-content 1017 (org-export-latex-content
1013 (org-export-preprocess-string 1018 (org-export-preprocess-string
@@ -1233,9 +1238,8 @@ SUBSUP corresponds to the ^: option in the #+OPTIONS line.
1233Convert CHAR depending on STRING-BEFORE and STRING-AFTER." 1238Convert CHAR depending on STRING-BEFORE and STRING-AFTER."
1234 (cond ((equal string-before "\\") 1239 (cond ((equal string-before "\\")
1235 (concat string-before char string-after)) 1240 (concat string-before char string-after))
1236 ;; this is part of a math formula 1241 ((and (string-match "\\S-+" string-after))
1237 ((and (string-match "\\S-+" string-before) 1242 ;; this is part of a math formula
1238 (string-match "\\S-+" string-after))
1239 (cond ((eq 'org-link (get-text-property 0 'face char)) 1243 (cond ((eq 'org-link (get-text-property 0 'face char))
1240 (concat string-before "\\" char string-after)) 1244 (concat string-before "\\" char string-after))
1241 ((save-match-data (org-inside-latex-math-p)) 1245 ((save-match-data (org-inside-latex-math-p))
@@ -1480,9 +1484,9 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
1480 "%s" (substring ll i (1+ i)))) 1484 "%s" (substring ll i (1+ i))))
1481 (throw 'exit nil)))))) 1485 (throw 'exit nil))))))
1482 (let ((start 0) 1486 (let ((start 0)
1483 (trans '(("\\" . "\\backslash") 1487 (trans '(("\\" . "\\textbackslash{}")
1484 ("~" . "\\ensuremath{\\sim}") 1488 ("~" . "\\textasciitilde{}")
1485 ("^" . "\\ensuremath{\\wedge}"))) 1489 ("^" . "\\textasciicircum{}")))
1486 (rtn "") char) 1490 (rtn "") char)
1487 (while (string-match "[\\{}$%&_#~^]" string) 1491 (while (string-match "[\\{}$%&_#~^]" string)
1488 (setq char (match-string 0 string)) 1492 (setq char (match-string 0 string))
@@ -1551,8 +1555,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
1551 (cond ((and imgp (plist-get org-export-latex-options-plist :inline-images)) 1555 (cond ((and imgp (plist-get org-export-latex-options-plist :inline-images))
1552 (insert 1556 (insert
1553 (concat 1557 (concat
1554 (if floatp "\\begin{figure}[htb]\n") 1558 (if floatp "\\begin{figure}[htb]\n\\centering\n")
1555 (format "\\centerline{\\includegraphics[%s]{%s}}\n" 1559 (format "\\includegraphics[%s]{%s}\n"
1556 attr 1560 attr
1557 (if (file-name-absolute-p raw-path) 1561 (if (file-name-absolute-p raw-path)
1558 (expand-file-name raw-path) 1562 (expand-file-name raw-path)
@@ -1561,7 +1565,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
1561 (format "\\caption{%s%s}\n" 1565 (format "\\caption{%s%s}\n"
1562 (if label (concat "\\label{" label "}") "") 1566 (if label (concat "\\label{" label "}") "")
1563 (or caption ""))) 1567 (or caption "")))
1564 (if floatp "\\end{figure}\n")))) 1568 (if floatp "\\end{figure}"))))
1565 (coderefp 1569 (coderefp
1566 (insert (format 1570 (insert (format
1567 (org-export-get-coderef-format path desc) 1571 (org-export-get-coderef-format path desc)
@@ -1662,9 +1666,11 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
1662 (org-export-latex-protect-string 1666 (org-export-latex-protect-string
1663 (concat "\\hspace*{1cm}" (match-string 2))) t t) 1667 (concat "\\hspace*{1cm}" (match-string 2))) t t)
1664 (beginning-of-line 1)) 1668 (beginning-of-line 1))
1665 (unless (looking-at ".*?[^ \t\n].*?\\\\\\\\[ \t]*$") 1669 (if (looking-at "[ \t]*$")
1666 (end-of-line 1) 1670 (insert "\\vspace*{1em}")
1667 (insert "\\\\")) 1671 (unless (looking-at ".*?[^ \t\n].*?\\\\\\\\[ \t]*$")
1672 (end-of-line 1)
1673 (insert "\\\\")))
1668 (beginning-of-line 2)) 1674 (beginning-of-line 2))
1669 (and (looking-at "[ \t]*ORG-VERSE-END.*") 1675 (and (looking-at "[ \t]*ORG-VERSE-END.*")
1670 (org-replace-match-keep-properties "\\end{verse}" t t))) 1676 (org-replace-match-keep-properties "\\end{verse}" t t)))
@@ -1691,8 +1697,10 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
1691 "\\)?" 1697 "\\)?"
1692 (org-create-multibrace-regexp "{" "}" 3)))) 1698 (org-create-multibrace-regexp "{" "}" 3))))
1693 (while (re-search-forward re nil t) 1699 (while (re-search-forward re nil t)
1694 (add-text-properties (match-beginning 0) (match-end 0) 1700 (unless (save-excursion (goto-char (match-beginning 0))
1695 '(org-protected t)))) 1701 (equal (char-after (point-at-bol)) ?#))
1702 (add-text-properties (match-beginning 0) (match-end 0)
1703 '(org-protected t)))))
1696 1704
1697 ;; Protect LaTeX entities 1705 ;; Protect LaTeX entities
1698 (goto-char (point-min)) 1706 (goto-char (point-min))
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el
index a0ba28c5254..ed09f5b585d 100644
--- a/lisp/org/org-list.el
+++ b/lisp/org/org-list.el
@@ -7,7 +7,7 @@
7;; Bastien Guerry <bzg AT altern DOT org> 7;; Bastien Guerry <bzg AT altern DOT org>
8;; Keywords: outlines, hypermedia, calendar, wp 8;; Keywords: outlines, hypermedia, calendar, wp
9;; Homepage: http://orgmode.org 9;; Homepage: http://orgmode.org
10;; Version: 6.30c 10;; Version: 6.31a
11;; 11;;
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13;; 13;;
@@ -427,7 +427,7 @@ the whole buffer."
427 (re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)") 427 (re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)")
428 (re-box "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[- X]\\]\\)") 428 (re-box "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[- X]\\]\\)")
429 (re-find (concat re "\\|" re-box)) 429 (re-find (concat re "\\|" re-box))
430 beg-cookie end-cookie is-percent c-on c-off lim 430 beg-cookie end-cookie is-percent c-on c-off lim new
431 eline curr-ind next-ind continue-from startsearch 431 eline curr-ind next-ind continue-from startsearch
432 (recursive 432 (recursive
433 (or (not org-hierarchical-checkbox-statistics) 433 (or (not org-hierarchical-checkbox-statistics)
@@ -488,12 +488,12 @@ the whole buffer."
488 (goto-char continue-from) 488 (goto-char continue-from)
489 ;; update cookie 489 ;; update cookie
490 (when end-cookie 490 (when end-cookie
491 (delete-region beg-cookie end-cookie) 491 (setq new (if is-percent
492 (format "[%d%%]" (/ (* 100 c-on) (max 1 (+ c-on c-off))))
493 (format "[%d/%d]" c-on (+ c-on c-off))))
492 (goto-char beg-cookie) 494 (goto-char beg-cookie)
493 (insert 495 (insert new)
494 (if is-percent 496 (delete-region (point) (+ (point) (- end-cookie beg-cookie))))
495 (format "[%d%%]" (/ (* 100 c-on) (max 1 (+ c-on c-off))))
496 (format "[%d/%d]" c-on (+ c-on c-off)))))
497 ;; update items checkbox if it has one 497 ;; update items checkbox if it has one
498 (when (org-at-item-p) 498 (when (org-at-item-p)
499 (org-beginning-of-item) 499 (org-beginning-of-item)
@@ -812,7 +812,7 @@ with something like \"1.\" or \"2)\"."
812 (buffer-substring (point-at-bol) (match-beginning 3)))) 812 (buffer-substring (point-at-bol) (match-beginning 3))))
813 ;; (term (substring (match-string 3) -1)) 813 ;; (term (substring (match-string 3) -1))
814 ind1 (n (1- arg)) 814 ind1 (n (1- arg))
815 fmt bobp old new) 815 fmt bobp old new delta)
816 ;; find where this list begins 816 ;; find where this list begins
817 (org-beginning-of-item-list) 817 (org-beginning-of-item-list)
818 (setq bobp (bobp)) 818 (setq bobp (bobp))
@@ -834,7 +834,9 @@ with something like \"1.\" or \"2)\"."
834 (delete-region (match-beginning 2) (match-end 2)) 834 (delete-region (match-beginning 2) (match-end 2))
835 (goto-char (match-beginning 2)) 835 (goto-char (match-beginning 2))
836 (insert (setq new (format fmt (setq n (1+ n))))) 836 (insert (setq new (format fmt (setq n (1+ n)))))
837 (org-shift-item-indentation (- (length new) (length old)))))) 837 (setq delta (- (length new) (length old)))
838 (org-shift-item-indentation delta)
839 (if (= (org-current-line) line) (setq col (+ col delta))))))
838 (org-goto-line line) 840 (org-goto-line line)
839 (org-move-to-column col))) 841 (org-move-to-column col)))
840 842
diff --git a/lisp/org/org-mac-message.el b/lisp/org/org-mac-message.el
index 87fe77a7b70..ff68fd7756e 100644
--- a/lisp/org/org-mac-message.el
+++ b/lisp/org/org-mac-message.el
@@ -5,7 +5,7 @@
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Christopher Suckling <suckling at gmail dot com> 6;; Christopher Suckling <suckling at gmail dot com>
7 7
8;; Version: 6.30c 8;; Version: 6.31a
9;; Keywords: outlines, hypermedia, calendar, wp 9;; Keywords: outlines, hypermedia, calendar, wp
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index 0bc3d059eb4..f9d1d9b7124 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -102,6 +102,7 @@ We use a macro so that the test can happen at compilation time."
102 (save-excursion 102 (save-excursion
103 (goto-char (or ,pom (point))) 103 (goto-char (or ,pom (point)))
104 ,@body))) 104 ,@body)))
105(put 'org-with-point-at 'lisp-indent-function 1)
105 106
106(defmacro org-no-warnings (&rest body) 107(defmacro org-no-warnings (&rest body)
107 (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body)) 108 (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
@@ -117,7 +118,7 @@ We use a macro so that the test can happen at compilation time."
117 ,@body)) 118 ,@body))
118 119
119(defmacro org-if-unprotected-at (pos &rest body) 120(defmacro org-if-unprotected-at (pos &rest body)
120 "Execute BODY if there is no `org-protected' text property at point-1." 121 "Execute BODY if there is no `org-protected' text property at POS."
121 `(unless (get-text-property ,pos 'org-protected) 122 `(unless (get-text-property ,pos 'org-protected)
122 ,@body)) 123 ,@body))
123 124
diff --git a/lisp/org/org-mew.el b/lisp/org/org-mew.el
index 6840703fcde..4542f5be079 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.30c 8;; Version: 6.31a
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 8b90f3f93e8..3f628962ec4 100644
--- a/lisp/org/org-mhe.el
+++ b/lisp/org/org-mhe.el
@@ -6,7 +6,7 @@
6;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de> 6;; Author: 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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
new file mode 100644
index 00000000000..0204b5c2300
--- /dev/null
+++ b/lisp/org/org-mobile.el
@@ -0,0 +1,511 @@
1;;; org-mobile.el --- Code for asymmetric sync with a mobile device
2;; Copyright (C) 2009 Free Software Foundation, Inc.
3;;
4;; Author: Carsten Dominik <carsten at orgmode dot org>
5;; Keywords: outlines, hypermedia, calendar, wp
6;; Homepage: http://orgmode.org
7;; Version: 6.31a
8;;
9;; This file is part of GNU Emacs.
10;;
11;; GNU Emacs is free software: you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
15;;
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20;;
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23;;
24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25;;
26;;; Commentary:
27;;
28;; This file contains the code to interact with Richard Moreland's iPhone
29;; application MobileOrg. This code is documented in Appendix B of the
30;; Org-mode manual. The code is not specific for the iPhone, however.
31;; Any external viewer and flagging application that uses the same
32;; conventions could be used.
33
34(require 'org)
35(require 'org-agenda)
36
37(defgroup org-mobile nil
38 "Options concerning support for a viewer on a mobile device."
39 :tag "Org Mobile"
40 :group 'org)
41
42(defcustom org-mobile-files '(org-agenda-files)
43 "Files to be staged for MobileOrg.
44This is basically a list of filesand directories. Files will be staged
45directly. Directories will be search for files with the extension `.org'.
46In addition to this, the list may also contain the following symbols:
47
48org-agenda-files
49 This means, include the complete, unrestricted list of files given in
50 the variable `org-agenda-files'.
51org-agenda-text-search-extra-files
52 Include the files given in the variable
53 `org-agenda-text-search-extra-files'"
54 :group 'org-mobile
55 :type '(list :greedy t
56 (option (const :tag "org-agenda-files" org-agenda-files))
57 (option (const :tag "org-agenda-text-search-extra-files"
58 org-agenda-text-search-extra-files))
59 (repeat :inline t :tag "Additional files"
60 (file))))
61
62(defcustom org-mobile-directory ""
63 "The WebDAV directory where the interaction with the mobile takes place."
64 :group 'org-mobile
65 :type 'directory)
66
67(defcustom org-mobile-inbox-for-pull "~/org/from-mobile.org"
68 "The file where captured notes and flags will be appended to.
69During the execution of `org-mobile-pull', the file
70`org-mobile-capture-file' will be emptied it's contents have
71been appended to the file given here."
72 :group 'org-mobile
73 :type 'file)
74
75(defconst org-mobile-capture-file "mobileorg.org"
76 "The capture file where the mobile stores captured notes and flags.
77This should not be changed, because MobileOrg assumes this name.")
78
79(defcustom org-mobile-index-file "index.org"
80 "The index file with inks to all Org files that should be loaded by MobileOrg.
81Relative to `org-mobile-directory'. The Address field in the MobileOrg setup
82should point to this file."
83 :group 'org-mobile
84 :type 'file)
85
86(defcustom org-mobile-force-id-on-agenda-items t
87 "Non-nil means make all agenda items carry and ID."
88 :group 'org-mobile
89 :type 'boolean)
90
91(defcustom org-mobile-action-alist
92 '(("d" . (org-todo 'done))
93 ("a" . (org-archive-subtree-default))
94 ("d-a" . (progn (org-todo 'done) (org-archive-subtree-default)))
95 ("todo" . (org-todo data))
96 ("tags" . (org-set-tags-to data)))
97 "Alist with flags and actions for mobile sync.
98When flagging an entry, MobileOrg will create entries that look like
99
100 * F(action:data) [[id:entry-id][entry title]]
101
102This alist defines that the ACTION in the parentheses of F() should mean,
103i.e. what action should be taken. The :data part in the parenthesis is
104optional. If present, the string after the colon will be passed to the
105action form as the `data' variable.
106The car of each elements of the alist is an actions string. The cdr is
107an Emacs Lisp form that will be evaluated with the cursor on the headline
108of that entry."
109 :group 'org-mobile
110 :type '(repeat
111 (cons (string :tag "Action flag")
112 (sexp :tag "Action form"))))
113
114(defvar org-mobile-pre-push-hook nil
115 "Hook run before running `org-mobile-push'.
116This could be used to clean up `org-mobile-directory', for example to
117remove files that used to be included in the agenda but no longer are.
118The presence of such files would not really be a problem, but after time
119they may accumulate.")
120
121(defvar org-mobile-post-push-hook nil
122 "Hook run after running `org-mobile-push'.
123If Emacs does not have direct write access to the WebDAV directory used
124by the mobile device, this hook should be used to copy all files from the
125local staging directory `org-mobile-directory' to the WebDAV directory,
126for example using `rsync' or `scp'.")
127
128(defvar org-mobile-pre-pull-hook nil
129 "Hook run before executing `org-mobile-pull'.
130If Emacs does not have direct write access to the WebDAV directory used
131by the mobile device, this hook should be used to copy the capture file
132`mobileorg.org' from the WebDAV location to the local staging
133directory `org-mobile-directory'.")
134
135(defvar org-mobile-post-pull-hook nil
136 "Hook run after running `org-mobile-pull'.
137If Emacs does not have direct write access to the WebDAV directory used
138by the mobile device, this hook should be used to copy the emptied
139capture file `mobileorg.org' back to the WebDAV directory, for example
140using `rsync' or `scp'.")
141
142(defvar org-mobile-last-flagged-files nil
143 "List of files containing entreis flagged in the latest pull.")
144
145(defvar org-mobile-files-alist nil)
146(defvar org-mobile-checksum-files nil)
147
148(defun org-mobile-prepare-file-lists ()
149 (setq org-mobile-files-alist (org-mobile-files-alist))
150 (setq org-mobile-checksum-files (mapcar 'cdr org-mobile-files-alist)))
151
152(defun org-mobile-files-alist ()
153 "Expand the list in `org-mobile-files' to a list of existing files."
154 (let* ((files
155 (apply 'append (mapcar
156 (lambda (f)
157 (cond
158 ((eq f 'org-agenda-files) (org-agenda-files t))
159 ((eq f 'org-agenda-text-search-extra-files)
160 org-agenda-text-search-extra-files)
161 ((and (stringp f) (file-directory-p f))
162 (directory-files f 'full "\\.org\\'"))
163 ((and (stringp f) (file-exists-p f))
164 (list f))
165 (t nil)))
166 org-mobile-files)))
167 (orgdir-uname (file-name-as-directory (file-truename org-directory)))
168 (orgdir-re (concat "\\`" (regexp-quote orgdir-uname)))
169 uname seen rtn file link-name)
170 ;; Make the files unique, and determine the name under which they will
171 ;; be listed.
172 (while (setq file (pop files))
173 (setq uname (file-truename file))
174 (unless (member uname seen)
175 (push uname seen)
176 (if (string-match orgdir-re uname)
177 (setq link-name (substring uname (match-end 0)))
178 (setq link-name (file-name-nondirectory uname)))
179 (push (cons file link-name) rtn)))
180 (nreverse rtn)))
181
182;;;###autoload
183(defun org-mobile-push ()
184 "Push the current state of Org affairs to the WebDAV directory.
185This will create the index file, copy all agenda files there, and also
186create all custom agenda views, for upload to the mobile phone."
187 (interactive)
188 (org-mobile-check-setup)
189 (org-mobile-prepare-file-lists)
190 (run-hooks 'org-mobile-pre-push-hook)
191 (org-mobile-create-sumo-agenda)
192 (org-save-all-org-buffers) ; to save any IDs created by this process
193 (org-mobile-copy-agenda-files)
194 (org-mobile-create-index-file)
195 (org-mobile-write-checksums)
196 (run-hooks 'org-mobile-post-push-hook)
197 (message "Files for mobile viewer staged"))
198
199;;;###autoload
200(defun org-mobile-pull ()
201 "Pull the contents of `org-mobile-capture-file' and integrate them.
202Apply all flagged actions, flag entries to be flagged and then call an
203agenda view showing the flagged items."
204 (interactive)
205 (org-mobile-check-setup)
206 (run-hooks 'org-mobile-pre-pull-hook)
207 (let ((insertion-marker (org-mobile-move-capture)))
208 (if (not (markerp insertion-marker))
209 (message "No new items")
210 (org-with-point-at insertion-marker
211 (org-mobile-apply-flags (point) (point-max)))
212 (move-marker insertion-marker nil)
213 (run-hooks 'org-mobile-post-pull-hook)
214 (when org-mobile-last-flagged-files
215 ;; Make an agenda view of flagged entries, but only in the files
216 ;; where stuff has been added.
217 (put 'org-agenda-files 'org-restrict org-mobile-last-flagged-files)
218 (let ((org-agenda-keep-restriced-file-list t))
219 (org-agenda nil "?"))))))
220
221(defun org-mobile-check-setup ()
222 "Check if org-mobile-directory has been set up."
223 (when (or (not org-mobile-directory)
224 (not (stringp org-mobile-directory))
225 (not (string-match "\\S-" org-mobile-directory))
226 (not (file-exists-p org-mobile-directory))
227 (not (file-directory-p org-mobile-directory)))
228 (error
229 "Variable `org-mobile-directory' must point to an existing directory"))
230 (when (or (not org-mobile-inbox-for-pull)
231 (not (stringp org-mobile-inbox-for-pull))
232 (not (string-match "\\S-" org-mobile-inbox-for-pull))
233 (not (file-exists-p
234 (file-name-directory org-mobile-inbox-for-pull))))
235 (error
236 "Variable `org-mobile-inbox-for-pull' must point to a file in an existing directory")))
237
238(defun org-mobile-create-index-file ()
239 "Write the index file in the WebDAV directory."
240 (let ((files-alist org-mobile-files-alist)
241 file link-name todo-kwds done-kwds tags drawers entry)
242 (org-prepare-agenda-buffers (mapcar 'car files-alist))
243 (setq done-kwds (org-uniquify org-done-keywords-for-agenda))
244 (setq todo-kwds (org-delete-all
245 done-kwds
246 (org-uniquify org-todo-keywords-for-agenda)))
247 (setq drawers (org-uniquify org-drawers-for-agenda))
248 (setq tags (org-uniquify
249 (delq nil
250 (mapcar
251 (lambda (e)
252 (cond ((stringp e) e)
253 ((listp e)
254 (if (stringp (car e)) (car e) nil))
255 (t nil)))
256 org-tag-alist-for-agenda))))
257 (with-temp-file
258 (expand-file-name org-mobile-index-file org-mobile-directory)
259 (insert "#+TODO: " (mapconcat 'identity todo-kwds " ") " | "
260 (mapconcat 'identity done-kwds " ") "\n"
261 "#+TAGS: " (mapconcat 'identity tags " ") "\n"
262 "#+DRAWERS: " (mapconcat 'identity drawers " ") "\n")
263 (insert "* [[file:agendas.org][Agenda Views]]\n")
264 (while (setq entry (pop files-alist))
265 (setq file (car entry)
266 link-name (cdr entry))
267 (insert (format "* [[file:%s][%s]]\n"
268 link-name link-name)))
269 (insert (format "* [[file:%s][Captured before last sync]]\n"
270 org-mobile-capture-file)))))
271
272(defun org-mobile-copy-agenda-files ()
273 "Copy all agenda files to the stage or WebDAV directory."
274 (let ((files-alist org-mobile-files-alist)
275 file buf entry link-name target-path target-dir)
276 (while (setq entry (pop files-alist))
277 (setq file (car entry) link-name (cdr entry))
278 (when (file-exists-p file)
279 (setq target-path (expand-file-name link-name org-mobile-directory)
280 target-dir (file-name-directory target-path))
281 (unless (file-directory-p target-dir)
282 (make-directory target-dir 'parents)
283 (copy-file file target-path 'ok-if-exists))))
284 (setq file (expand-file-name org-mobile-capture-file
285 org-mobile-directory))
286 (unless (file-exists-p file)
287 (save-excursion
288 (setq buf (find-file file))
289 (insert "\n")
290 (save-buffer))
291 (kill-buffer buf))))
292
293(defun org-mobile-write-checksums ()
294 "Create checksums for all files in `org-mobile-directory'.
295The table of checksums is written to the file mobile-checksums."
296 (let ((cmd (cond ((executable-find "shasum"))
297 ((executable-find "sha1sum"))
298 ((executable-find "md5sum"))
299 ((executable-find "md5"))))
300 (files org-mobile-checksum-files))
301 (if (not cmd)
302 (message "Checksums could not be generated: no executable")
303 (with-temp-buffer
304 (cd org-mobile-directory)
305 (if (file-exists-p "agendas.org")
306 (push "agendas.org" files))
307 (if (file-exists-p "mobileorg.org")
308 (push "mobileorg.org" files))
309 (setq cmd (concat cmd " " (mapconcat 'shell-quote-argument files " ")
310 " > checksums.dat"))
311 (if (equal 0 (shell-command cmd))
312 (message "Checksums written")
313 (message "Checksums could not be generated"))))))
314
315(defun org-mobile-sumo-agenda-command ()
316 "Return an agenda custom command that comprises all custom commands."
317 (let ((custom-list
318 ;; normalize different versions
319 (delq nil
320 (mapcar
321 (lambda (x)
322 (cond ((stringp (cdr x)) nil)
323 ((stringp (nth 1 x)) x)
324 ((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
325 (t (cons (car x) (cons "" (cdr x))))))
326 org-agenda-custom-commands)))
327 new e key desc type match settings cmds gkey gdesc gsettings cnt)
328 (while (setq e (pop custom-list))
329 (cond
330 ((stringp (cdr e))
331 ;; this is a description entry - skip it
332 )
333 ((eq (nth 2 e) 'search)
334 ;; Search view is interactive, skip
335 )
336 ((memq (nth 2 e) '(todo-tree tags-tree occur-tree))
337 ;; These are trees, not really agenda commands
338 )
339 ((memq (nth 2 e) '(agenda todo tags))
340 ;; a normal command
341 (setq key (car e) desc (nth 1 e) type (nth 2 e) match (nth 3 e)
342 settings (nth 4 e))
343 (setq settings
344 (cons (list 'org-agenda-title-append
345 (concat "<break>KEYS=" key " TITLE: "
346 (if (and (stringp desc) (> (length desc) 0))
347 desc (symbol-name type))
348 " " match))
349 settings))
350 (push (list type match settings) new))
351 ((symbolp (nth 2 e))
352 ;; A user-defined function, not sure how to handle that yet
353 )
354 (t
355 ;; a block agenda
356 (setq gkey (car e) gdesc (nth 1 e) gsettings (nth 3 e) cmds (nth 2 e))
357 (setq cnt 0)
358 (while (setq e (pop cmds))
359 (setq type (car e) match (nth 1 e) settings (nth 2 e))
360 (setq settings (append gsettings settings))
361 (setq settings
362 (cons (list 'org-agenda-title-append
363 (concat "<break>KEYS=" gkey "#" (number-to-string
364 (setq cnt (1+ cnt)))
365 " TITLE: " gdesc " " match))
366 settings))
367 (push (list type match settings) new)))))
368 (list "X" "SUMO" (reverse new) nil)))
369
370;;;###autoload
371(defun org-mobile-create-sumo-agenda ()
372 "Create a file that contains all custom agenda views."
373 (interactive)
374 (let* ((file (expand-file-name "agendas.org"
375 org-mobile-directory))
376 (org-agenda-custom-commands
377 (list (append (org-mobile-sumo-agenda-command)
378 (list (list file))))))
379 (unless (file-writable-p file)
380 (error "Cannot write to file %s" file))
381 (org-store-agenda-views)))
382
383(defun org-mobile-move-capture ()
384 "Move the contents of the capture file to the inbox file.
385Return a marker to the location where the new content has been added.
386If nothing new has beed added, return nil."
387 (interactive)
388 (let ((inbox-buffer (find-file-noselect org-mobile-inbox-for-pull))
389 (capture-buffer (find-file-noselect
390 (expand-file-name org-mobile-capture-file
391 org-mobile-directory)))
392 (insertion-point (make-marker))
393 not-empty content)
394 (save-excursion
395 (set-buffer capture-buffer)
396 (setq content (buffer-string))
397 (setq not-empty (string-match "\\S-" content))
398 (when not-empty
399 (set-buffer inbox-buffer)
400 (widen)
401 (goto-char (point-max))
402 (or (bolp) (newline))
403 (move-marker insertion-point
404 (prog1 (point) (insert content)))
405 (save-buffer)
406 (set-buffer capture-buffer)
407 (erase-buffer)
408 (save-buffer)))
409 (kill-buffer capture-buffer)
410 (if not-empty insertion-point)))
411
412(defun org-mobile-apply-flags (&optional beg end)
413 "Apply all flags in the current buffer.
414If BEG and END are given, only do this in that region."
415 (interactive)
416 (require 'org-archive)
417 (setq org-mobile-last-flagged-files nil)
418 (setq beg (or beg (point-min)) end (or end (point-max)))
419 (goto-char beg)
420 (let ((marker (make-marker))
421 (org-inhibit-logging 'note)
422 (end (move-marker (make-marker) end))
423 action data id id-pos cmd text)
424 (while (re-search-forward
425 "^\\*+[ \t]+F(\\([^():\n]*\\)\\(:\\([^()\n]*\\)\\)?)[ \t]+\\[\\[id:\\([^]\n ]+\\)" end t)
426 (goto-char (- (match-beginning 1) 2))
427 (catch 'next
428 (setq action (match-string 1)
429 data (and (match-end 3) (match-string 3))
430 id (match-string 4)
431 cmd (if (equal action "")
432 '(progn
433 (org-toggle-tag "FLAGGED" 'on)
434 (and text (org-entry-put nil "THEFLAGGINGNOTE" text)))
435 (cdr (assoc action org-mobile-action-alist)))
436 text (org-trim (buffer-substring (1+ (point-at-eol))
437 (save-excursion
438 (org-end-of-subtree t))))
439 id-pos (org-id-find id 'marker))
440 (if (> (length text) 0)
441 ;; Make TEXT into a single line, to fit into a property
442 (setq text (mapconcat 'identity
443 (org-split-string text "\n")
444 "\\n"))
445 (setq text nil))
446 (unless id-pos
447 (insert "BAD ID REFERENCE ")
448 (throw 'next t))
449 (unless cmd
450 (insert "BAD FLAG ")
451 (throw 'next t))
452 (move-marker marker (point))
453 (save-excursion
454 (condition-case nil
455 (org-with-point-at id-pos
456 (progn
457 (eval cmd)
458 (if (member "FLAGGED" (org-get-tags))
459 (add-to-list 'org-mobile-last-flagged-files
460 (buffer-file-name (current-buffer))))))
461 (error
462 (progn
463 (switch-to-buffer (marker-buffer marker))
464 (goto-char marker)
465 (insert "EXECUTION FAILED ")
466 (throw 'next t)))))
467 ;; If we get here, the action has been applied successfully
468 ;; So remove the entry
469 (org-back-to-heading t)
470 (delete-region (point) (org-end-of-subtree t t))))
471 (move-marker marker nil)
472 (move-marker end nil)))
473
474(defun org-mobile-smart-read ()
475 "Parse the entry at point for shortcuts and expand them.
476These shortcuts are meant for fast and easy typing on the limited
477keyboards of a mobile device. Below we show a list of the shortcuts
478currently implemented.
479
480The entry is expected to contain an inactive time stamp indicating when
481the entry was created. When setting dates and
482times (for example for deadlines), the time strings are interpreted
483relative to that creation date.
484Abbreviations are expected to take up entire lines, jst because it is so
485easy to type RET on a mobile device. Abbreviations start with one or two
486letters, followed immediately by a dot and then additional information.
487Generally the entire shortcut line is removed after action have been taken.
488Time stamps will be constructed using `org-read-date'. So for example a
489line \"dd. 2tue\" will set a deadline on the second Tuesday after the
490creation date.
491
492Here are the shortcuts currently implemented:
493
494dd. string set deadline
495ss. string set scheduling
496tt. string set time tamp, here.
497ti. string set inactive time
498
499tg. tag1 tag2 tag3 set all these tags, change case where necessary
500td. kwd set this todo keyword, change case where necessary
501
502FIXME: Hmmm, not sure if we can make his work against the
503auto-correction feature. Needs a bit more thinking. So this function
504is currently a noop.")
505
506(provide 'org-mobile)
507
508;; arch-tag: ace0e26c-58f2-4309-8a61-05ec1535f658
509
510;;; org-mobile.el ends here
511
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index fd69589395d..d434e7fe450 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.30c 7;; Version: 6.31a
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-plot.el b/lisp/org/org-plot.el
index 684a515e96d..04894c0e75f 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.30c 8;; Version: 6.31a
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-protocol.el b/lisp/org/org-protocol.el
index 2fa84041d39..3b4f53f3b70 100644
--- a/lisp/org/org-protocol.el
+++ b/lisp/org/org-protocol.el
@@ -9,7 +9,7 @@
9;; Author: Ross Patterson <me AT rpatterson DOT net> 9;; Author: Ross Patterson <me AT rpatterson DOT net>
10;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de> 10;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de>
11;; Keywords: org, emacsclient, wp 11;; Keywords: org, emacsclient, wp
12;; Version: 6.30c 12;; Version: 6.31a
13 13
14;; This file is part of GNU Emacs. 14;; This file is part of GNU Emacs.
15;; 15;;
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el
index bac86366916..9cd7a8cefb3 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: Carsten Dominik <carsten DOT dominik AT gmail DOT com> 5;; Maintainer: Carsten Dominik <carsten DOT dominik AT gmail DOT com>
6;; Keywords: hypermedia, outlines, wp 6;; Keywords: hypermedia, outlines, wp
7;; Version: 6.30c 7;; Version: 6.31a
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-remember.el b/lisp/org/org-remember.el
index d3f83993daa..708c8e9aed1 100644
--- a/lisp/org/org-remember.el
+++ b/lisp/org/org-remember.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -771,8 +771,7 @@ The user is queried for the template."
771 (widen) 771 (widen)
772 (goto-char (point-min)) 772 (goto-char (point-min))
773 (if (re-search-forward 773 (if (re-search-forward
774 (concat "^\\*+[ \t]+" (regexp-quote heading) 774 (format org-complex-heading-regexp-format (regexp-quote heading))
775 (org-re "\\([ \t]+:[[:alnum:]@_:]*\\)?[ \t]*$"))
776 nil t) 775 nil t)
777 (goto-char (match-beginning 0)) 776 (goto-char (match-beginning 0))
778 (error "Target headline not found: %s" heading)))) 777 (error "Target headline not found: %s" heading))))
@@ -951,8 +950,8 @@ See also the variable `org-reverse-note-order'."
951 ((and (stringp heading) (string-match "\\S-" heading)) 950 ((and (stringp heading) (string-match "\\S-" heading))
952 (goto-char (point-min)) 951 (goto-char (point-min))
953 (if (re-search-forward 952 (if (re-search-forward
954 (concat "^\\*+[ \t]+" (regexp-quote heading) 953 (format org-complex-heading-regexp-format
955 (org-re "\\([ \t]+:[[:alnum:]@_:]*\\)?[ \t]*$")) 954 (regexp-quote heading))
956 nil t) 955 nil t)
957 (setq org-goto-start-pos (match-beginning 0)) 956 (setq org-goto-start-pos (match-beginning 0))
958 (when fastp 957 (when fastp
diff --git a/lisp/org/org-rmail.el b/lisp/org/org-rmail.el
index aed410f3d01..111124a87ec 100644
--- a/lisp/org/org-rmail.el
+++ b/lisp/org/org-rmail.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.21b 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -36,11 +36,8 @@
36 36
37;; Declare external functions and variables 37;; Declare external functions and variables
38(declare-function rmail-show-message "rmail" (&optional n no-summary)) 38(declare-function rmail-show-message "rmail" (&optional n no-summary))
39(declare-function rmail-get-header "rmail" (name &optional msgnum))
40(declare-function rmail-what-message "rmail" ()) 39(declare-function rmail-what-message "rmail" ())
41(defvar rmail-current-message) 40(defvar rmail-current-message)
42(defvar rmail-buffer)
43(defvar rmail-view-buffer)
44 41
45;; Install the link type 42;; Install the link type
46(org-add-link-type "rmail" 'org-rmail-open) 43(org-add-link-type "rmail" 'org-rmail-open)
@@ -49,35 +46,29 @@
49;; Implementation 46;; Implementation
50(defun org-rmail-store-link () 47(defun org-rmail-store-link ()
51 "Store a link to an Rmail folder or message." 48 "Store a link to an Rmail folder or message."
52 (when (memq major-mode '(rmail-mode rmail-summary-mode)) 49 (when (or (eq major-mode 'rmail-mode)
53 (let (message-id from to subject desc link) 50 (eq major-mode 'rmail-summary-mode))
54 (if (fboundp 'rmail-get-header) ; Emacs 23 51 (save-window-excursion
55 (setq message-id (rmail-get-header "message-id") 52 (save-restriction
56 from (rmail-get-header "from") 53 (when (eq major-mode 'rmail-summary-mode)
57 to (rmail-get-header "to") 54 (rmail-show-message rmail-current-message))
58 subject (rmail-get-header "subject")) 55 (when (fboundp 'rmail-narrow-to-non-pruned-header)
59 (save-window-excursion ; Emacs 22 56 (rmail-narrow-to-non-pruned-header))
60 (save-restriction 57 (let* ((folder buffer-file-name)
61 (when (eq major-mode 'rmail-summary-mode) 58 (message-id (mail-fetch-field "message-id"))
62 (rmail-show-message rmail-current-message)) 59 (from (mail-fetch-field "from"))
63 (with-no-warnings ; don't warn when compiling Emacs 23 60 (to (mail-fetch-field "to"))
64 (rmail-narrow-to-non-pruned-header)) 61 (subject (mail-fetch-field "subject"))
65 (setq message-id (mail-fetch-field "message-id") 62 desc link)
66 from (mail-fetch-field "from") 63 (org-store-link-props
67 to (mail-fetch-field "to") 64 :type "rmail" :from from :to to
68 subject (mail-fetch-field "subject")) 65 :subject subject :message-id message-id)
69 (rmail-show-message rmail-current-message)))) 66 (setq message-id (org-remove-angle-brackets message-id))
70 (org-store-link-props 67 (setq desc (org-email-link-description))
71 :type "rmail" :from from :to to 68 (setq link (org-make-link "rmail:" folder "#" message-id))
72 :subject subject :message-id message-id) 69 (org-add-link-props :link link :description desc)
73 (setq message-id (org-remove-angle-brackets message-id)) 70 (rmail-show-message rmail-current-message)
74 (setq desc (org-email-link-description)) 71 link)))))
75 (setq link (org-make-link "rmail:"
76 (with-current-buffer rmail-buffer
77 buffer-file-name)
78 "#" message-id))
79 (org-add-link-props :link link :description desc)
80 link)))
81 72
82(defun org-rmail-open (path) 73(defun org-rmail-open (path)
83 "Follow an Rmail message link to the specified PATH." 74 "Follow an Rmail message link to the specified PATH."
@@ -92,27 +83,19 @@
92 "Follow an Rmail link to FOLDER and ARTICLE." 83 "Follow an Rmail link to FOLDER and ARTICLE."
93 (require 'rmail) 84 (require 'rmail)
94 (setq article (org-add-angle-brackets article)) 85 (setq article (org-add-angle-brackets article))
95 (let (message-number buff) 86 (let (message-number)
96 (save-excursion 87 (save-excursion
97 (save-window-excursion 88 (save-window-excursion
98 (rmail (if (string= folder "RMAIL") rmail-file-name folder)) 89 (rmail (if (string= folder "RMAIL") rmail-file-name folder))
99 (setq buff (current-buffer) 90 (setq message-number
100 message-number 91 (save-restriction
101 (with-current-buffer 92 (widen)
102 (if (and (fboundp 'rmail-buffers-swapped-p) 93 (goto-char (point-max))
103 (rmail-buffers-swapped-p)) 94 (if (re-search-backward
104 rmail-view-buffer 95 (concat "^Message-ID:\\s-+" (regexp-quote
105 (current-buffer)) 96 (or article "")))
106 (save-restriction 97 nil t)
107 (widen) 98 (rmail-what-message))))))
108 (goto-char (point-max))
109 (if (re-search-backward
110 (concat "^Message-ID:\\s-+" (regexp-quote
111 (or article "")))
112 nil t)
113 ;; This is an rmail "debugging" function. :(
114 (with-current-buffer buff
115 (rmail-what-message))))))))
116 (if message-number 99 (if message-number
117 (progn 100 (progn
118 (rmail (if (string= folder "RMAIL") rmail-file-name folder)) 101 (rmail (if (string= folder "RMAIL") rmail-file-name folder))
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index b7536b21152..a5718d884de 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -7,7 +7,7 @@
7;; Bastien Guerry <bzg AT altern DOT org> 7;; Bastien Guerry <bzg AT altern DOT org>
8;; Keywords: outlines, hypermedia, calendar, wp 8;; Keywords: outlines, hypermedia, calendar, wp
9;; Homepage: http://orgmode.org 9;; Homepage: http://orgmode.org
10;; Version: 6.30c 10;; Version: 6.31a
11;; 11;;
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13;; 13;;
@@ -110,7 +110,8 @@ or similar things which you want to have when editing a source code file,
110but which mess up the display of a snippet in Org exported files.") 110but which mess up the display of a snippet in Org exported files.")
111 111
112(defcustom org-src-lang-modes 112(defcustom org-src-lang-modes
113 '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist)) 113 '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist)
114 ("asymptote" . asy))
114 "Alist mapping languages to their major mode. 115 "Alist mapping languages to their major mode.
115The key is the language name, the value is the string that should 116The key is the language name, the value is the string that should
116be inserted as the name of the major mode. For many languages this is 117be inserted as the name of the major mode. For many languages this is
@@ -185,7 +186,7 @@ the edited version."
185 (org-delete-overlay org-edit-src-overlay))) 186 (org-delete-overlay org-edit-src-overlay)))
186 (kill-buffer buffer)) 187 (kill-buffer buffer))
187 (setq buffer (generate-new-buffer 188 (setq buffer (generate-new-buffer
188 (concat "*Org Src " (file-name-nondirectory buffer-file-name) "[" lang "]*"))) 189 (org-src-construct-edit-buffer-name (buffer-name) lang)))
189 (setq ovl (org-make-overlay beg end)) 190 (setq ovl (org-make-overlay beg end))
190 (org-overlay-put ovl 'face 'secondary-selection) 191 (org-overlay-put ovl 'face 'secondary-selection)
191 (org-overlay-put ovl 'edit-buffer buffer) 192 (org-overlay-put ovl 'edit-buffer buffer)
@@ -231,13 +232,17 @@ the edited version."
231 (if buf (switch-to-buffer buf) 232 (if buf (switch-to-buffer buf)
232 (error "Something is wrong here")))) 233 (error "Something is wrong here"))))
233 234
235(defun org-src-construct-edit-buffer-name (org-buffer-name lang)
236 "Construct the buffer name for a source editing buffer"
237 (concat "*Org Src " org-buffer-name "[ " lang " ]*"))
238
234(defun org-edit-src-find-buffer (beg end) 239(defun org-edit-src-find-buffer (beg end)
235 "Find a source editing buffer that is already editing the region BEG to END." 240 "Find a source editing buffer that is already editing the region BEG to END."
236 (catch 'exit 241 (catch 'exit
237 (mapc 242 (mapc
238 (lambda (b) 243 (lambda (b)
239 (with-current-buffer b 244 (with-current-buffer b
240 (if (and (string-match "\\`*Org Edit " (buffer-name)) 245 (if (and (string-match "\\`*Org Src " (buffer-name))
241 (local-variable-p 'org-edit-src-beg-marker (current-buffer)) 246 (local-variable-p 'org-edit-src-beg-marker (current-buffer))
242 (local-variable-p 'org-edit-src-end-marker (current-buffer)) 247 (local-variable-p 'org-edit-src-end-marker (current-buffer))
243 (equal beg org-edit-src-beg-marker) 248 (equal beg org-edit-src-beg-marker)
@@ -289,7 +294,9 @@ the fragment in the Org-mode buffer."
289 (if (boundp 'org-edit-src-overlay) 294 (if (boundp 'org-edit-src-overlay)
290 (org-delete-overlay org-edit-src-overlay))) 295 (org-delete-overlay org-edit-src-overlay)))
291 (kill-buffer buffer)) 296 (kill-buffer buffer))
292 (setq buffer (generate-new-buffer "*Org Edit Src Example*")) 297 (setq buffer (generate-new-buffer
298 (org-src-construct-edit-buffer-name
299 (buffer-name) "Fixed Width")))
293 (setq ovl (org-make-overlay beg end)) 300 (setq ovl (org-make-overlay beg end))
294 (org-overlay-put ovl 'face 'secondary-selection) 301 (org-overlay-put ovl 'face 'secondary-selection)
295 (org-overlay-put ovl 'edit-buffer buffer) 302 (org-overlay-put ovl 'edit-buffer buffer)
@@ -474,14 +481,15 @@ the language, a switch telling of the content should be in a single line."
474(defun org-edit-src-save () 481(defun org-edit-src-save ()
475 "Save parent buffer with current state source-code buffer." 482 "Save parent buffer with current state source-code buffer."
476 (interactive) 483 (interactive)
477 (let ((p (point)) (m (mark)) msg) 484 (save-window-excursion
478 (org-edit-src-exit) 485 (let ((p (point)) (m (mark)) msg)
479 (save-buffer) 486 (org-edit-src-exit)
480 (setq msg (current-message)) 487 (save-buffer)
481 (org-edit-src-code) 488 (setq msg (current-message))
482 (push-mark m 'nomessage) 489 (org-edit-src-code)
483 (goto-char (min p (point-max))) 490 (push-mark m 'nomessage)
484 (message (or msg "")))) 491 (goto-char (min p (point-max)))
492 (message (or msg "")))))
485 493
486(defun org-src-mode-configure-edit-buffer () 494(defun org-src-mode-configure-edit-buffer ()
487 (when org-edit-src-from-org-mode 495 (when org-edit-src-from-org-mode
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 30d662140d9..452fba8bd33 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -614,6 +614,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
614 (re-search-forward "<[rl]?[0-9]+>" end t))) 614 (re-search-forward "<[rl]?[0-9]+>" end t)))
615 (goto-char beg) 615 (goto-char beg)
616 (setq falign (re-search-forward "<[rl][0-9]*>" end t)) 616 (setq falign (re-search-forward "<[rl][0-9]*>" end t))
617 (goto-char beg)
617 ;; Get the rows 618 ;; Get the rows
618 (setq lines (org-split-string 619 (setq lines (org-split-string
619 (buffer-substring beg end) "\n")) 620 (buffer-substring beg end) "\n"))
@@ -2712,6 +2713,7 @@ Parameters get priority."
2712 (pos (move-marker (make-marker) (point))) 2713 (pos (move-marker (make-marker) (point)))
2713 (startline 1) 2714 (startline 1)
2714 (wc (current-window-configuration)) 2715 (wc (current-window-configuration))
2716 (sel-win (selected-window))
2715 (titles '((column . "# Column Formulas\n") 2717 (titles '((column . "# Column Formulas\n")
2716 (field . "# Field Formulas\n") 2718 (field . "# Field Formulas\n")
2717 (named . "# Named Field Formulas\n"))) 2719 (named . "# Named Field Formulas\n")))
@@ -2724,6 +2726,7 @@ Parameters get priority."
2724 (org-set-local 'font-lock-global-modes (list 'not major-mode)) 2726 (org-set-local 'font-lock-global-modes (list 'not major-mode))
2725 (org-set-local 'org-pos pos) 2727 (org-set-local 'org-pos pos)
2726 (org-set-local 'org-window-configuration wc) 2728 (org-set-local 'org-window-configuration wc)
2729 (org-set-local 'org-selected-window sel-win)
2727 (use-local-map org-table-fedit-map) 2730 (use-local-map org-table-fedit-map)
2728 (org-add-hook 'post-command-hook 'org-table-fedit-post-command t t) 2731 (org-add-hook 'post-command-hook 'org-table-fedit-post-command t t)
2729 (easy-menu-add org-table-fedit-menu) 2732 (easy-menu-add org-table-fedit-menu)
@@ -2944,7 +2947,7 @@ With prefix ARG, apply the new formulas to the table."
2944 (progn 2947 (progn
2945 (org-table-fedit-convert-buffer 'org-table-convert-refs-to-rc) 2948 (org-table-fedit-convert-buffer 'org-table-convert-refs-to-rc)
2946 (setq org-table-buffer-is-an nil))) 2949 (setq org-table-buffer-is-an nil)))
2947 (let ((pos org-pos) eql var form) 2950 (let ((pos org-pos) (sel-win org-selected-window) eql var form)
2948 (goto-char (point-min)) 2951 (goto-char (point-min))
2949 (while (re-search-forward 2952 (while (re-search-forward
2950 "^\\(@[0-9]+\\$[0-9]+\\|\\$\\([a-zA-Z0-9]+\\)\\) *= *\\(.*\\(\n[ \t]+.*$\\)*\\)" 2953 "^\\(@[0-9]+\\$[0-9]+\\|\\$\\([a-zA-Z0-9]+\\)\\) *= *\\(.*\\(\n[ \t]+.*$\\)*\\)"
@@ -2960,7 +2963,7 @@ With prefix ARG, apply the new formulas to the table."
2960 (push (cons var form) eql))) 2963 (push (cons var form) eql)))
2961 (setq org-pos nil) 2964 (setq org-pos nil)
2962 (set-window-configuration org-window-configuration) 2965 (set-window-configuration org-window-configuration)
2963 (select-window (get-buffer-window (marker-buffer pos))) 2966 (select-window sel-win)
2964 (goto-char pos) 2967 (goto-char pos)
2965 (unless (org-at-table-p) 2968 (unless (org-at-table-p)
2966 (error "Lost table position - cannot install formulae")) 2969 (error "Lost table position - cannot install formulae"))
@@ -2975,9 +2978,9 @@ With prefix ARG, apply the new formulas to the table."
2975 "Abort editing formulas, without installing the changes." 2978 "Abort editing formulas, without installing the changes."
2976 (interactive) 2979 (interactive)
2977 (org-table-remove-rectangle-highlight) 2980 (org-table-remove-rectangle-highlight)
2978 (let ((pos org-pos)) 2981 (let ((pos org-pos) (sel-win org-selected-window))
2979 (set-window-configuration org-window-configuration) 2982 (set-window-configuration org-window-configuration)
2980 (select-window (get-buffer-window (marker-buffer pos))) 2983 (select-window sel-win)
2981 (goto-char pos) 2984 (goto-char pos)
2982 (move-marker pos nil) 2985 (move-marker pos nil)
2983 (message "Formula editing aborted without installing changes"))) 2986 (message "Formula editing aborted without installing changes")))
@@ -3340,7 +3343,8 @@ table editor in arbitrary modes.")
3340(defvar org-old-auto-fill-inhibit-regexp nil 3343(defvar org-old-auto-fill-inhibit-regexp nil
3341 "Local variable used by `orgtbl-mode'") 3344 "Local variable used by `orgtbl-mode'")
3342 3345
3343(defconst orgtbl-line-start-regexp "[ \t]*\\(|\\|#\\+\\(TBLFM\\|ORGTBL\\):\\)" 3346(defconst orgtbl-line-start-regexp
3347 "[ \t]*\\(|\\|#\\+\\(TBLFM\\|ORGTBL\\|TBLNAME\\):\\)"
3344 "Matches a line belonging to an orgtbl.") 3348 "Matches a line belonging to an orgtbl.")
3345 3349
3346(defconst orgtbl-extra-font-lock-keywords 3350(defconst orgtbl-extra-font-lock-keywords
@@ -4221,7 +4225,7 @@ list of the fields in the rectangle ."
4221 (save-excursion 4225 (save-excursion
4222 (goto-char (point-min)) 4226 (goto-char (point-min))
4223 (if (re-search-forward 4227 (if (re-search-forward
4224 (concat "^#[ \t]*\\+TBLNAME:[ \t]*" (regexp-quote name-or-id) "[ \t]*$") 4228 (concat "^[ \t]*#\\+TBLNAME:[ \t]*" (regexp-quote name-or-id) "[ \t]*$")
4225 nil t) 4229 nil t)
4226 (setq buffer (current-buffer) loc (match-beginning 0)) 4230 (setq buffer (current-buffer) loc (match-beginning 0))
4227 (setq id-loc (org-id-find name-or-id 'marker)) 4231 (setq id-loc (org-id-find name-or-id 'marker))
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index 847d5140973..715797c4021 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.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.30c 8;; Version: 6.31a
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-vm.el b/lisp/org/org-vm.el
index 6feb64732a4..b271c515667 100644
--- a/lisp/org/org-vm.el
+++ b/lisp/org/org-vm.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-w3m.el b/lisp/org/org-w3m.el
index 5f0bf265849..feba5608fd9 100644
--- a/lisp/org/org-w3m.el
+++ b/lisp/org/org-w3m.el
@@ -5,7 +5,7 @@
5;; Author: Andy Stewart <lazycat dot manatee at gmail dot com> 5;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
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.30c 8;; Version: 6.31a
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 af09d49fd6a..f4cdf7db259 100644
--- a/lisp/org/org-wl.el
+++ b/lisp/org/org-wl.el
@@ -6,7 +6,7 @@
6;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> 6;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -54,8 +54,6 @@
54;; Backward compatibility to old version of wl 54;; Backward compatibility to old version of wl
55(declare-function wl "ext:wl" () t) 55(declare-function wl "ext:wl" () t)
56(declare-function wl-summary-buffer-msgdb "ext:wl-folder" () t) 56(declare-function wl-summary-buffer-msgdb "ext:wl-folder" () t)
57;(declare-function wl-folder-get-elmo-folder "ext:wl-folder"
58; (entity &optional no-cache))
59(declare-function wl-summary-jump-to-msg-by-message-id "ext:wl-summary" 57(declare-function wl-summary-jump-to-msg-by-message-id "ext:wl-summary"
60 (&optional id)) 58 (&optional id))
61(declare-function wl-summary-line-from "ext:wl-summary" ()) 59(declare-function wl-summary-line-from "ext:wl-summary" ())
diff --git a/lisp/org/org-xoxo.el b/lisp/org/org-xoxo.el
index 61904c26542..e58a0003e35 100644
--- a/lisp/org/org-xoxo.el
+++ b/lisp/org/org-xoxo.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -30,6 +30,9 @@
30 30
31;;; XOXO export 31;;; XOXO export
32 32
33(defvar org-export-xoxo-final-hook nil
34 "Hook run after XOXO export, in the new buffer.")
35
33(defun org-export-as-xoxo-insert-into (buffer &rest output) 36(defun org-export-as-xoxo-insert-into (buffer &rest output)
34 (with-current-buffer buffer 37 (with-current-buffer buffer
35 (apply 'insert output))) 38 (apply 'insert output)))
@@ -112,6 +115,7 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
112 ;; Finish the buffer off and clean it up. 115 ;; Finish the buffer off and clean it up.
113 (switch-to-buffer-other-window out) 116 (switch-to-buffer-other-window out)
114 (indent-region (point-min) (point-max) nil) 117 (indent-region (point-min) (point-max) nil)
118 (run-hooks 'org-export-xoxo-final-hook)
115 (save-buffer) 119 (save-buffer)
116 (goto-char (point-min)) 120 (goto-char (point-min))
117 ))) 121 )))
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 9a5cf1e9581..39614ca0d39 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.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.30c 9;; Version: 6.31a
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -95,7 +95,7 @@
95 95
96;;; Version 96;;; Version
97 97
98(defconst org-version "6.30c" 98(defconst org-version "6.31a"
99 "The version number of the file org.el.") 99 "The version number of the file org.el.")
100 100
101(defun org-version (&optional here) 101(defun org-version (&optional here)
@@ -172,7 +172,7 @@ and loading it will require that you have downloaded and properly installed
172the org-mode distribution. 172the org-mode distribution.
173 173
174You can also use this system to load external packages (i.e. neither Org 174You can also use this system to load external packages (i.e. neither Org
175core modules, not modules from the CONTRIB directory). Just add symbols 175core modules, nor modules from the CONTRIB directory). Just add symbols
176to the end of the list. If the package is called org-xyz.el, then you need 176to the end of the list. If the package is called org-xyz.el, then you need
177to add the symbol `xyz', and the package must have a call to 177to add the symbol `xyz', and the package must have a call to
178 178
@@ -183,6 +183,7 @@ to add the symbol `xyz', and the package must have a call to
183 '(set :greedy t 183 '(set :greedy t
184 (const :tag " bbdb: Links to BBDB entries" org-bbdb) 184 (const :tag " bbdb: Links to BBDB entries" org-bbdb)
185 (const :tag " bibtex: Links to BibTeX entries" org-bibtex) 185 (const :tag " bibtex: Links to BibTeX entries" org-bibtex)
186 (const :tag " crypt: Encryption of subtrees" org-crypt)
186 (const :tag " gnus: Links to GNUS folders/messages" org-gnus) 187 (const :tag " gnus: Links to GNUS folders/messages" org-gnus)
187 (const :tag " id: Global IDs for identifying entries" org-id) 188 (const :tag " id: Global IDs for identifying entries" org-id)
188 (const :tag " info: Links to Info nodes" org-info) 189 (const :tag " info: Links to Info nodes" org-info)
@@ -200,19 +201,22 @@ to add the symbol `xyz', and the package must have a call to
200 (const :tag " mouse: Additional mouse support" org-mouse) 201 (const :tag " mouse: Additional mouse support" org-mouse)
201 202
202 (const :tag "C annotate-file: Annotate a file with org syntax" org-annotate-file) 203 (const :tag "C annotate-file: Annotate a file with org syntax" org-annotate-file)
203 (const :tag "C annotation-helper: Call Remember directly from Browser (OBSOLETE, use org-protocol)" org-annotation-helper) 204 (const :tag "C annotation-helper: Call Remember directly from Browser\n\t\t\t(OBSOLETE, use org-protocol)" org-annotation-helper)
204 (const :tag "C bookmark: Org links to bookmarks" org-bookmark) 205 (const :tag "C bookmark: Org links to bookmarks" org-bookmark)
205 (const :tag "C browser-url: Store link, directly from Browser (OBSOLETE, use org-protocol)" org-browser-url) 206 (const :tag "C browser-url: Store link, directly from Browser\n\t\t\t(OBSOLETE, use org-protocol)" org-browser-url)
206 (const :tag "C checklist: Extra functions for checklists in repeated tasks" org-checklist) 207 (const :tag "C checklist: Extra functions for checklists in repeated tasks" org-checklist)
207 (const :tag "C choose: Use TODO keywords to mark decisions states" org-choose) 208 (const :tag "C choose: Use TODO keywords to mark decisions states" org-choose)
208 (const :tag "C collector: Collect properties into tables" org-collector) 209 (const :tag "C collector: Collect properties into tables" org-collector)
209 (const :tag "C depend: TODO dependencies for Org-mode (PARTIALLY OBSOLETE, see built-in dependency support))" org-depend) 210 (const :tag "C depend: TODO dependencies for Org-mode\n\t\t\t(PARTIALLY OBSOLETE, see built-in dependency support))" org-depend)
210 (const :tag "C elisp-symbol: Org links to emacs-lisp symbols" org-elisp-symbol) 211 (const :tag "C elisp-symbol: Org links to emacs-lisp symbols" org-elisp-symbol)
211 (const :tag "C eval: Include command output as text" org-eval) 212 (const :tag "C eval: Include command output as text" org-eval)
212 (const :tag "C eval-light: Evaluate inbuffer-code on demand" org-eval-light) 213 (const :tag "C eval-light: Evaluate inbuffer-code on demand" org-eval-light)
213 (const :tag "C expiry: Expiry mechanism for Org entries" org-expiry) 214 (const :tag "C expiry: Expiry mechanism for Org entries" org-expiry)
214 (const :tag "C exp-bibtex: Export citations using BibTeX" org-exp-bibtex) 215 (const :tag "C exp-bibtex: Export citations using BibTeX" org-exp-bibtex)
215 (const :tag "C interactive-query: Interactive modification of tags query (PARTIALLY OBSOLETE, see secondary filtering)" org-interactive-query) 216 (const :tag "C interactive-query: Interactive modification of tags query\n\t\t\t(PARTIALLY OBSOLETE, see secondary filtering)" org-interactive-query)
217
218 (const :tag "C invoice Help manage client invoices in OrgMode" org-invoice)
219
216 (const :tag "C jira Add a jira:ticket protocol to Org" org-jira) 220 (const :tag "C jira Add a jira:ticket protocol to Org" org-jira)
217 (const :tag "C mairix: Hook mairix search into Org for different MUAs" org-mairix) 221 (const :tag "C mairix: Hook mairix search into Org for different MUAs" org-mairix)
218 (const :tag "C mac-iCal Imports events from iCal.app to the Emacs diary" org-mac-iCal) 222 (const :tag "C mac-iCal Imports events from iCal.app to the Emacs diary" org-mac-iCal)
@@ -282,14 +286,16 @@ is Emacs 23 only."
282This can also be configured on a per-file basis by adding one of 286This can also be configured on a per-file basis by adding one of
283the following lines anywhere in the buffer: 287the following lines anywhere in the buffer:
284 288
285 #+STARTUP: fold 289 #+STARTUP: fold (or `overview', this is equivalent)
286 #+STARTUP: nofold 290 #+STARTUP: nofold (or `showall', this is equivalent)
287 #+STARTUP: content" 291 #+STARTUP: content
292 #+STARTUP: showeverything"
288 :group 'org-startup 293 :group 'org-startup
289 :type '(choice 294 :type '(choice
290 (const :tag "nofold: show all" nil) 295 (const :tag "nofold: show all" nil)
291 (const :tag "fold: overview" t) 296 (const :tag "fold: overview" t)
292 (const :tag "content: all headlines" content))) 297 (const :tag "content: all headlines" content)
298 (const :tag "show everything, even drawers" showeverything)))
293 299
294(defcustom org-startup-truncated t 300(defcustom org-startup-truncated t
295 "Non-nil means, entering Org-mode will set `truncate-lines'. 301 "Non-nil means, entering Org-mode will set `truncate-lines'.
@@ -759,7 +765,9 @@ it to the beginning of the line.
759 765
760`C-e' will jump to the end of the headline, ignoring the presence of tags 766`C-e' will jump to the end of the headline, ignoring the presence of tags
761in the headline. A second `C-e' will then jump to the true end of the 767in the headline. A second `C-e' will then jump to the true end of the
762line, after any tags. 768line, after any tags. This also means that, when this variable is
769non-nil, `C-e' also will never jump beyond the end of the heading of a
770folded section, i.e. not after the ellipses.
763 771
764When set to the symbol `reversed', the first `C-a' or `C-e' works normally, 772When set to the symbol `reversed', the first `C-a' or `C-e' works normally,
765going to the true line boundary first. Only a directly following, identical 773going to the true line boundary first. Only a directly following, identical
@@ -770,17 +778,17 @@ set separately."
770 :group 'org-edit-structure 778 :group 'org-edit-structure
771 :type '(choice 779 :type '(choice
772 (const :tag "off" nil) 780 (const :tag "off" nil)
773 (const :tag "after stars/bullet and before tags first" t) 781 (const :tag "on: after stars/bullet and before tags first" t)
774 (const :tag "true line boundary first" reversed) 782 (const :tag "reversed: true line boundary first" reversed)
775 (cons :tag "Set C-a and C-e separately" 783 (cons :tag "Set C-a and C-e separately"
776 (choice :tag "Special C-a" 784 (choice :tag "Special C-a"
777 (const :tag "off" nil) 785 (const :tag "off" nil)
778 (const :tag "after stars/bullet first" t) 786 (const :tag "on: after stars/bullet first" t)
779 (const :tag "before stars/bullet first" reversed)) 787 (const :tag "reversed: before stars/bullet first" reversed))
780 (choice :tag "Special C-e" 788 (choice :tag "Special C-e"
781 (const :tag "off" nil) 789 (const :tag "off" nil)
782 (const :tag "before tags first" t) 790 (const :tag "on: before tags first" t)
783 (const :tag "after tags first" reversed))))) 791 (const :tag "reversed: after tags first" reversed)))))
784(if (fboundp 'defvaralias) 792(if (fboundp 'defvaralias)
785 (defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e)) 793 (defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e))
786 794
@@ -1699,6 +1707,7 @@ taken from the (otherwise obsolete) variable `org-todo-interpretation'."
1699(make-variable-buffer-local 'org-todo-keywords-1) 1707(make-variable-buffer-local 'org-todo-keywords-1)
1700(defvar org-todo-keywords-for-agenda nil) 1708(defvar org-todo-keywords-for-agenda nil)
1701(defvar org-done-keywords-for-agenda nil) 1709(defvar org-done-keywords-for-agenda nil)
1710(defvar org-drawers-for-agenda nil)
1702(defvar org-todo-keyword-alist-for-agenda nil) 1711(defvar org-todo-keyword-alist-for-agenda nil)
1703(defvar org-tag-alist-for-agenda nil) 1712(defvar org-tag-alist-for-agenda nil)
1704(defvar org-agenda-contributing-files nil) 1713(defvar org-agenda-contributing-files nil)
@@ -2022,11 +2031,11 @@ When nil, the notes will be orderer according to time."
2022 2031
2023(defcustom org-log-repeat 'time 2032(defcustom org-log-repeat 'time
2024 "Non-nil means, record moving through the DONE state when triggering repeat. 2033 "Non-nil means, record moving through the DONE state when triggering repeat.
2025An auto-repeating tasks is immediately switched back to TODO when marked 2034An auto-repeating task is immediately switched back to TODO when
2026done. If you are not logging state changes (by adding \"@\" or \"!\" to 2035marked DONE. If you are not logging state changes (by adding \"@\"
2027the TODO keyword definition, or recording a closing note by setting 2036or \"!\" to the TODO keyword definition), or set `org-log-done' to
2028`org-log-done', there will be no record of the task moving through DONE. 2037record a closing note, there will be no record of the task moving
2029This variable forces taking a note anyway. Possible values are: 2038through DONE. This variable forces taking a note anyway.
2030 2039
2031nil Don't force a record 2040nil Don't force a record
2032time Record a time stamp 2041time Record a time stamp
@@ -2669,14 +2678,28 @@ This is a property list with the following properties:
2669 :type 'plist) 2678 :type 'plist)
2670 2679
2671(defcustom org-format-latex-header "\\documentclass{article} 2680(defcustom org-format-latex-header "\\documentclass{article}
2672\\usepackage{fullpage} % do not remove
2673\\usepackage{amssymb} 2681\\usepackage{amssymb}
2674\\usepackage[usenames]{color} 2682\\usepackage[usenames]{color}
2675\\usepackage{amsmath} 2683\\usepackage{amsmath}
2676\\usepackage{latexsym} 2684\\usepackage{latexsym}
2677\\usepackage[mathscr]{eucal} 2685\\usepackage[mathscr]{eucal}
2678\\pagestyle{empty} % do not remove" 2686\\pagestyle{empty} % do not remove
2679 "The document header used for processing LaTeX fragments." 2687% The settings below are copied from fullpage.sty
2688\\setlength{\\textwidth}{\\paperwidth}
2689\\addtolength{\\textwidth}{-3cm}
2690\\setlength{\\oddsidemargin}{1.5cm}
2691\\addtolength{\\oddsidemargin}{-2.54cm}
2692\\setlength{\\evensidemargin}{\\oddsidemargin}
2693\\setlength{\\textheight}{\\paperheight}
2694\\addtolength{\\textheight}{-\\headheight}
2695\\addtolength{\\textheight}{-\\headsep}
2696\\addtolength{\\textheight}{-\\footskip}
2697\\addtolength{\\textheight}{-3cm}
2698\\setlength{\\topmargin}{1.5cm}
2699\\addtolength{\\topmargin}{-2.54cm}"
2700 "The document header used for processing LaTeX fragments.
2701It is imperative that this header make sure that no page number
2702appears on the page."
2680 :group 'org-latex 2703 :group 'org-latex
2681 :type 'string) 2704 :type 'string)
2682 2705
@@ -3211,6 +3234,13 @@ If yes, offer to stop it and to save the buffer with the changes."
3211 "org-indent" 3234 "org-indent"
3212 '(org-indent-mode))) 3235 '(org-indent-mode)))
3213 3236
3237;; Autoload org-mobile.el
3238
3239(eval-and-compile
3240 (org-autoload
3241 "org-mobile"
3242 '(org-mobile-push org-mobile-pull org-mobile-create-sumo-agenda)))
3243
3214;; Autoload archiving code 3244;; Autoload archiving code
3215;; The stuff that is needed for cycling and tags has to be defined here. 3245;; The stuff that is needed for cycling and tags has to be defined here.
3216 3246
@@ -3401,6 +3431,8 @@ group 3: Priority cookie
3401group 4: True headline 3431group 4: True headline
3402group 5: Tags") 3432group 5: Tags")
3403(make-variable-buffer-local 'org-complex-heading-regexp) 3433(make-variable-buffer-local 'org-complex-heading-regexp)
3434(defvar org-complex-heading-regexp-format nil)
3435(make-variable-buffer-local 'org-complex-heading-regexp-format)
3404(defvar org-todo-line-tags-regexp nil 3436(defvar org-todo-line-tags-regexp nil
3405 "Matches a headline and puts TODO state into group 2 if present. 3437 "Matches a headline and puts TODO state into group 2 if present.
3406Also put tags into group 4 if tags are present.") 3438Also put tags into group 4 if tags are present.")
@@ -3491,6 +3523,7 @@ After a match, the following groups carry important information:
3491 ("overview" org-startup-folded t) 3523 ("overview" org-startup-folded t)
3492 ("nofold" org-startup-folded nil) 3524 ("nofold" org-startup-folded nil)
3493 ("showall" org-startup-folded nil) 3525 ("showall" org-startup-folded nil)
3526 ("showeverything" org-startup-folded showeverything)
3494 ("content" org-startup-folded content) 3527 ("content" org-startup-folded content)
3495 ("indent" org-startup-indented t) 3528 ("indent" org-startup-indented t)
3496 ("noindent" org-startup-indented nil) 3529 ("noindent" org-startup-indented nil)
@@ -3755,6 +3788,11 @@ means to push this value onto the list in the variable.")
3755 (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") 3788 (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
3756 "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)" 3789 "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)"
3757 "\\(?:[ \t]+\\(:[[:alnum:]_@:]+:\\)\\)?[ \t]*$") 3790 "\\(?:[ \t]+\\(:[[:alnum:]_@:]+:\\)\\)?[ \t]*$")
3791 org-complex-heading-regexp-format
3792 (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
3793 (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
3794 "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(%s\\)"
3795 "\\(?:[ \t]+\\(:[[:alnum:]_@:]+:\\)\\)?[ \t]*$")
3758 org-nl-done-regexp 3796 org-nl-done-regexp
3759 (concat "\n\\*+[ \t]+" 3797 (concat "\n\\*+[ \t]+"
3760 "\\(?:" (mapconcat 'regexp-quote org-done-keywords "\\|") 3798 "\\(?:" (mapconcat 'regexp-quote org-done-keywords "\\|")
@@ -3872,6 +3910,8 @@ Respect keys that are already there."
3872 3910
3873(defvar org-window-configuration nil 3911(defvar org-window-configuration nil
3874 "Used in various places to store a window configuration.") 3912 "Used in various places to store a window configuration.")
3913(defvar org-selected-window nil
3914 "Used in various places to store a window configuration.")
3875(defvar org-finish-function nil 3915(defvar org-finish-function nil
3876 "Function to be called when `C-c C-c' is used. 3916 "Function to be called when `C-c C-c' is used.
3877This is for getting out of special buffers like remember.") 3917This is for getting out of special buffers like remember.")
@@ -4302,7 +4342,7 @@ will be prompted for."
4302 "Fontify #+ lines and blocks, in the correct ways." 4342 "Fontify #+ lines and blocks, in the correct ways."
4303 (let ((case-fold-search t)) 4343 (let ((case-fold-search t))
4304 (if (re-search-forward 4344 (if (re-search-forward
4305 "^\\([ \t]*#\\+\\(\\([a-zA-Z]+:?\\)\\(_\\([a-zA-Z]+\\)\\)?\\)\\(.*\\)\\)" 4345 "^\\([ \t]*#\\+\\(\\([a-zA-Z]+:?\\| \\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)\\(.*\\)\\)"
4306 limit t) 4346 limit t)
4307 (let ((beg (match-beginning 0)) 4347 (let ((beg (match-beginning 0))
4308 (beg1 (line-beginning-position 2)) 4348 (beg1 (line-beginning-position 2))
@@ -4345,12 +4385,17 @@ will be prompted for."
4345 beg (match-end 0) 4385 beg (match-end 0)
4346 '(font-lock-fontified t face org-meta-line)) 4386 '(font-lock-fontified t face org-meta-line))
4347 t) 4387 t)
4348 ((or (member dc1 '("caption:" "label:" "orgtbl:" "tblfm:" "tblname:")) 4388 ((or (member dc1 '("begin:" "end:" "caption:" "label:"
4389 "orgtbl:" "tblfm:" "tblname:"))
4349 (and (match-end 4) (equal dc3 "attr"))) 4390 (and (match-end 4) (equal dc3 "attr")))
4350 (add-text-properties 4391 (add-text-properties
4351 beg (match-end 0) 4392 beg (match-end 0)
4352 '(font-lock-fontified t face org-meta-line)) 4393 '(font-lock-fontified t face org-meta-line))
4353 t) 4394 t)
4395 ((member dc3 '(" " ""))
4396 (add-text-properties
4397 beg (match-end 0)
4398 '(font-lock-fontified t face font-lock-comment-face)))
4354 (t nil)))))) 4399 (t nil))))))
4355 4400
4356(defun org-activate-angle-links (limit) 4401(defun org-activate-angle-links (limit)
@@ -5083,11 +5128,12 @@ With a numeric prefix, show all headlines up to that level."
5083 ((eq org-startup-folded 'content) 5128 ((eq org-startup-folded 'content)
5084 (let ((this-command 'org-cycle) (last-command 'org-cycle)) 5129 (let ((this-command 'org-cycle) (last-command 'org-cycle))
5085 (org-cycle '(4)) (org-cycle '(4))))) 5130 (org-cycle '(4)) (org-cycle '(4)))))
5086 (if org-hide-block-startup (org-hide-block-all)) 5131 (unless (eq org-startup-folded 'showeverything)
5087 (org-set-visibility-according-to-property 'no-cleanup) 5132 (if org-hide-block-startup (org-hide-block-all))
5088 (org-cycle-hide-archived-subtrees 'all) 5133 (org-set-visibility-according-to-property 'no-cleanup)
5089 (org-cycle-hide-drawers 'all) 5134 (org-cycle-hide-archived-subtrees 'all)
5090 (org-cycle-show-empty-lines 'all)) 5135 (org-cycle-hide-drawers 'all)
5136 (org-cycle-show-empty-lines 'all)))
5091 5137
5092(defun org-set-visibility-according-to-property (&optional no-cleanup) 5138(defun org-set-visibility-according-to-property (&optional no-cleanup)
5093 "Switch subtree visibilities according to :VISIBILITY: property." 5139 "Switch subtree visibilities according to :VISIBILITY: property."
@@ -5251,7 +5297,11 @@ are at least `org-cycle-separator-lines' empty lines before the headline."
5251 (setq b (save-excursion 5297 (setq b (save-excursion
5252 (goto-char (match-beginning 0)) 5298 (goto-char (match-beginning 0))
5253 (org-back-over-empty-lines) 5299 (org-back-over-empty-lines)
5254 (point))) 5300 (if (save-excursion
5301 (goto-char (max (point-min) (1- (point))))
5302 (org-on-heading-p))
5303 (1- (point))
5304 (point))))
5255 (setq b (match-beginning 1))) 5305 (setq b (match-beginning 1)))
5256 (outline-flag-region b e nil))))))) 5306 (outline-flag-region b e nil)))))))
5257 ;; Never hide empty lines at the end of the file. 5307 ;; Never hide empty lines at the end of the file.
@@ -5626,7 +5676,7 @@ frame is not changed."
5626 (outline-up-heading 1 t))) 5676 (outline-up-heading 1 t)))
5627 (setq beg (point) 5677 (setq beg (point)
5628 heading (org-get-heading)) 5678 heading (org-get-heading))
5629 (org-end-of-subtree t) (setq end (point))) 5679 (org-end-of-subtree t t) (setq end (point)))
5630 (if (and (buffer-live-p org-last-indirect-buffer) 5680 (if (and (buffer-live-p org-last-indirect-buffer)
5631 (not (eq org-indirect-buffer-display 'new-frame)) 5681 (not (eq org-indirect-buffer-display 'new-frame))
5632 (not arg)) 5682 (not arg))
@@ -6045,7 +6095,9 @@ This will leave level 1 alone, convert level 2 to level 3, level 3 to
6045level 5 etc." 6095level 5 etc."
6046 (interactive) 6096 (interactive)
6047 (when (yes-or-no-p "Are you sure you want to globally change levels to odd? ") 6097 (when (yes-or-no-p "Are you sure you want to globally change levels to odd? ")
6048 (let ((org-odd-levels-only nil) n) 6098 (let ((outline-regexp org-outline-regexp)
6099 (outline-level 'org-outline-level)
6100 (org-odd-levels-only nil) n)
6049 (save-excursion 6101 (save-excursion
6050 (goto-char (point-min)) 6102 (goto-char (point-min))
6051 (while (re-search-forward "^\\*\\*+ " nil t) 6103 (while (re-search-forward "^\\*\\*+ " nil t)
@@ -6054,7 +6106,6 @@ level 5 etc."
6054 (org-demote)) 6106 (org-demote))
6055 (end-of-line 1)))))) 6107 (end-of-line 1))))))
6056 6108
6057
6058(defun org-convert-to-oddeven-levels () 6109(defun org-convert-to-oddeven-levels ()
6059 "Convert an org-mode file with only odd levels to one with odd and even levels. 6110 "Convert an org-mode file with only odd levels to one with odd and even levels.
6060This promotes level 3 to level 2, level 5 to level 3 etc. If the file contains a 6111This promotes level 3 to level 2, level 5 to level 3 etc. If the file contains a
@@ -6067,7 +6118,9 @@ is signaled in this case."
6067 (org-show-context t) 6118 (org-show-context t)
6068 (error "Not all levels are odd in this file. Conversion not possible")) 6119 (error "Not all levels are odd in this file. Conversion not possible"))
6069 (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ") 6120 (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ")
6070 (let ((org-odd-levels-only nil) n) 6121 (let ((outline-regexp org-outline-regexp)
6122 (outline-level 'org-outline-level)
6123 (org-odd-levels-only nil) n)
6071 (save-excursion 6124 (save-excursion
6072 (goto-char (point-min)) 6125 (goto-char (point-min))
6073 (while (re-search-forward "^\\*\\*+ " nil t) 6126 (while (re-search-forward "^\\*\\*+ " nil t)
@@ -6392,7 +6445,7 @@ If yes, remember the marker and the distance to BEG."
6392 (save-match-data 6445 (save-match-data
6393 (narrow-to-region 6446 (narrow-to-region
6394 (progn (org-back-to-heading t) (point)) 6447 (progn (org-back-to-heading t) (point))
6395 (progn (org-end-of-subtree t) (point)))))) 6448 (progn (org-end-of-subtree t t) (point))))))
6396 6449
6397(defun org-clone-subtree-with-time-shift (n &optional shift) 6450(defun org-clone-subtree-with-time-shift (n &optional shift)
6398 "Clone the task (subtree) at point N times. 6451 "Clone the task (subtree) at point N times.
@@ -7127,6 +7180,8 @@ type. For a simple example of an export function, see `org-bbdb.el'."
7127 (setcdr (assoc type org-link-protocols) (list follow export)) 7180 (setcdr (assoc type org-link-protocols) (list follow export))
7128 (push (list type follow export) org-link-protocols))) 7181 (push (list type follow export) org-link-protocols)))
7129 7182
7183(defvar org-agenda-buffer-name)
7184
7130;;;###autoload 7185;;;###autoload
7131(defun org-store-link (arg) 7186(defun org-store-link (arg)
7132 "\\<org-mode-map>Store an org-link to the current location. 7187 "\\<org-mode-map>Store an org-link to the current location.
@@ -7166,6 +7221,14 @@ For file links, arg negates `org-context-in-file-links'."
7166 (insert link) 7221 (insert link)
7167 (setq link (concat "(" label ")") desc nil))) 7222 (setq link (concat "(" label ")") desc nil)))
7168 7223
7224 ((equal (org-bound-and-true-p org-agenda-buffer-name) (buffer-name))
7225 ;; We are in the agenda, link to referenced location
7226 (let ((m (or (get-text-property (point) 'org-hd-marker)
7227 (get-text-property (point) 'org-marker))))
7228 (when m
7229 (org-with-point-at m
7230 (call-interactively 'org-store-link)))))
7231
7169 ((eq major-mode 'calendar-mode) 7232 ((eq major-mode 'calendar-mode)
7170 (let ((cd (calendar-cursor-to-date))) 7233 (let ((cd (calendar-cursor-to-date)))
7171 (setq link 7234 (setq link
@@ -7255,7 +7318,8 @@ For file links, arg negates `org-context-in-file-links'."
7255 (condition-case nil 7318 (condition-case nil
7256 (org-make-org-heading-search-string txt) 7319 (org-make-org-heading-search-string txt)
7257 (error ""))) 7320 (error "")))
7258 desc (or (nth 4 (org-heading-components)) "NONE")))) 7321 desc (or (nth 4 (ignore-errors
7322 (org-heading-components))) "NONE"))))
7259 (if (string-match "::\\'" cpltxt) 7323 (if (string-match "::\\'" cpltxt)
7260 (setq cpltxt (substring cpltxt 0 -2))) 7324 (setq cpltxt (substring cpltxt 0 -2)))
7261 (setq link (org-make-link cpltxt))))) 7325 (setq link (org-make-link cpltxt)))))
@@ -7692,9 +7756,10 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
7692 "Use iswitch as a completing-read replacement to choose from choices. 7756 "Use iswitch as a completing-read replacement to choose from choices.
7693PROMPT is a string to prompt with. CHOICES is a list of strings to choose 7757PROMPT is a string to prompt with. CHOICES is a list of strings to choose
7694from." 7758from."
7695 (let ((iswitchb-make-buflist-hook 7759 (let* ((iswitchb-use-virtual-buffers nil)
7696 (lambda () 7760 (iswitchb-make-buflist-hook
7697 (setq iswitchb-temp-buflist choices)))) 7761 (lambda ()
7762 (setq iswitchb-temp-buflist choices))))
7698 (iswitchb-read-buffer prompt))) 7763 (iswitchb-read-buffer prompt)))
7699 7764
7700(defun org-icompleting-read (&rest args) 7765(defun org-icompleting-read (&rest args)
@@ -8041,21 +8106,25 @@ application the system uses for this file type."
8041 (error "Abort")))) 8106 (error "Abort"))))
8042 8107
8043 (t 8108 (t
8044 (browse-url-at-point)))))) 8109 (browse-url-at-point)))))))
8045 (move-marker org-open-link-marker nil) 8110 (move-marker org-open-link-marker nil)
8046 (run-hook-with-args 'org-follow-link-hook))) 8111 (run-hook-with-args 'org-follow-link-hook))
8047 8112
8048(defun org-offer-links-in-entry (&optional nth) 8113(defun org-offer-links-in-entry (&optional nth zero)
8049 "Offer links in the curren entry and follow the selected link. 8114 "Offer links in the curren entry and follow the selected link.
8050If there is only one link, follow it immediately as well. 8115If there is only one link, follow it immediately as well.
8051If NTH is an integer immediately pick the NTH link found." 8116If NTH is an integer, immediately pick the NTH link found.
8117If ZERO is a string, check also this string for a link, and if
8118there is one, offer it as link number zero."
8052 (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|" 8119 (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|"
8053 "\\(" org-angle-link-re "\\)\\|" 8120 "\\(" org-angle-link-re "\\)\\|"
8054 "\\(" org-plain-link-re "\\)")) 8121 "\\(" org-plain-link-re "\\)"))
8055 (cnt ?0) 8122 (cnt ?0)
8056 (in-emacs (if (integerp nth) nil nth)) 8123 (in-emacs (if (integerp nth) nil nth))
8057 end 8124 have-zero end links link c)
8058 links link c) 8125 (when (and (stringp zero) (string-match org-bracket-link-regexp zero))
8126 (push (match-string 0 zero) links)
8127 (setq cnt (1- cnt) have-zero t))
8059 (save-excursion 8128 (save-excursion
8060 (org-back-to-heading t) 8129 (org-back-to-heading t)
8061 (setq end (save-excursion (outline-next-heading) (point))) 8130 (setq end (save-excursion (outline-next-heading) (point)))
@@ -8067,14 +8136,13 @@ If NTH is an integer immediately pick the NTH link found."
8067 ((null links) (error "No links")) 8136 ((null links) (error "No links"))
8068 ((equal (length links) 1) 8137 ((equal (length links) 1)
8069 (setq link (car links))) 8138 (setq link (car links)))
8070 ((and (integerp nth) (>= (length links) nth)) 8139 ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth)))
8071 (setq link (nth (1- nth) links))) 8140 (setq link (nth (if have-zero nth (1- nth)) links)))
8072 (t ; we have to select a link 8141 (t ; we have to select a link
8073 (save-excursion 8142 (save-excursion
8074 (save-window-excursion 8143 (save-window-excursion
8075 (delete-other-windows) 8144 (delete-other-windows)
8076 (with-output-to-temp-buffer "*Select Link*" 8145 (with-output-to-temp-buffer "*Select Link*"
8077 (princ "Select link\n\n")
8078 (mapc (lambda (l) 8146 (mapc (lambda (l)
8079 (if (not (string-match org-bracket-link-regexp l)) 8147 (if (not (string-match org-bracket-link-regexp l))
8080 (princ (format "[%c] %s\n" (incf cnt) 8148 (princ (format "[%c] %s\n" (incf cnt)
@@ -8091,6 +8159,7 @@ If NTH is an integer immediately pick the NTH link found."
8091 (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*")))) 8159 (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*"))))
8092 (when (equal c ?q) (error "Abort")) 8160 (when (equal c ?q) (error "Abort"))
8093 (setq nth (- c ?0)) 8161 (setq nth (- c ?0))
8162 (if have-zero (setq nth (1+ nth)))
8094 (unless (and (integerp nth) (>= (length links) nth)) 8163 (unless (and (integerp nth) (>= (length links) nth))
8095 (error "Invalid link selection")) 8164 (error "Invalid link selection"))
8096 (setq link (nth (1- nth) links)))) 8165 (setq link (nth (1- nth) links))))
@@ -8924,23 +8993,26 @@ If not found, stay at current position and return nil."
8924 pos)) 8993 pos))
8925 8994
8926(defconst org-dblock-start-re 8995(defconst org-dblock-start-re
8927 "^#\\+BEGIN:[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?" 8996 "^[ \t]*#\\+BEGIN:[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?"
8928 "Matches the startline of a dynamic block, with parameters.") 8997 "Matches the startline of a dynamic block, with parameters.")
8929 8998
8930(defconst org-dblock-end-re "^#\\+END\\([: \t\r\n]\\|$\\)" 8999(defconst org-dblock-end-re "^[ \t]*#\\+END\\([: \t\r\n]\\|$\\)"
8931 "Matches the end of a dynamic block.") 9000 "Matches the end of a dynamic block.")
8932 9001
8933(defun org-create-dblock (plist) 9002(defun org-create-dblock (plist)
8934 "Create a dynamic block section, with parameters taken from PLIST. 9003 "Create a dynamic block section, with parameters taken from PLIST.
8935PLIST must contain a :name entry which is used as name of the block." 9004PLIST must contain a :name entry which is used as name of the block."
8936 (unless (bolp) (newline)) 9005 (when (string-match "\\S-" (buffer-substring (point-at-bol) (point-at-eol)))
8937 (let ((name (plist-get plist :name))) 9006 (end-of-line 1)
9007 (newline))
9008 (let ((col (current-column))
9009 (name (plist-get plist :name)))
8938 (insert "#+BEGIN: " name) 9010 (insert "#+BEGIN: " name)
8939 (while plist 9011 (while plist
8940 (if (eq (car plist) :name) 9012 (if (eq (car plist) :name)
8941 (setq plist (cddr plist)) 9013 (setq plist (cddr plist))
8942 (insert " " (prin1-to-string (pop plist))))) 9014 (insert " " (prin1-to-string (pop plist)))))
8943 (insert "\n\n#+END:\n") 9015 (insert "\n\n" (make-string col ?\ ) "#+END:\n")
8944 (beginning-of-line -2))) 9016 (beginning-of-line -2)))
8945 9017
8946(defun org-prepare-dblock () 9018(defun org-prepare-dblock ()
@@ -8953,6 +9025,10 @@ the property list including an extra property :name with the block name."
8953 (name (org-no-properties (match-string 1))) 9025 (name (org-no-properties (match-string 1)))
8954 (params (append (list :name name) 9026 (params (append (list :name name)
8955 (read (concat "(" (match-string 3) ")"))))) 9027 (read (concat "(" (match-string 3) ")")))))
9028 (save-excursion
9029 (beginning-of-line 1)
9030 (skip-chars-forward " \t")
9031 (setq params (plist-put params :indentation-column (current-column))))
8956 (unless (re-search-forward org-dblock-end-re nil t) 9032 (unless (re-search-forward org-dblock-end-re nil t)
8957 (error "Dynamic block not terminated")) 9033 (error "Dynamic block not terminated"))
8958 (setq params 9034 (setq params
@@ -9000,11 +9076,24 @@ the correct writing function."
9000 (line (org-current-line)) 9076 (line (org-current-line))
9001 (params (org-prepare-dblock)) 9077 (params (org-prepare-dblock))
9002 (name (plist-get params :name)) 9078 (name (plist-get params :name))
9079 (indent (plist-get params :indentation-column))
9003 (cmd (intern (concat "org-dblock-write:" name)))) 9080 (cmd (intern (concat "org-dblock-write:" name))))
9004 (message "Updating dynamic block `%s' at line %d..." name line) 9081 (message "Updating dynamic block `%s' at line %d..." name line)
9005 (funcall cmd params) 9082 (funcall cmd params)
9006 (message "Updating dynamic block `%s' at line %d...done" name line) 9083 (message "Updating dynamic block `%s' at line %d...done" name line)
9007 (goto-char pos)))) 9084 (goto-char pos)
9085 (when (and indent (> indent 0))
9086 (setq indent (make-string indent ?\ ))
9087 (save-excursion
9088 (org-beginning-of-dblock)
9089 (forward-line 1)
9090 (while (not (looking-at org-dblock-end-re))
9091 (insert indent)
9092 (beginning-of-line 2))
9093 (when (looking-at org-dblock-end-re)
9094 (and (looking-at "[ \t]+")
9095 (replace-match ""))
9096 (insert indent)))))))
9008 9097
9009(defun org-beginning-of-dblock () 9098(defun org-beginning-of-dblock ()
9010 "Find the beginning of the dynamic block at point. 9099 "Find the beginning of the dynamic block at point.
@@ -9032,7 +9121,7 @@ This function can be used in a hook."
9032(defconst org-additional-option-like-keywords 9121(defconst org-additional-option-like-keywords
9033 '("BEGIN_HTML" "END_HTML" "HTML:" "ATTR_HTML" 9122 '("BEGIN_HTML" "END_HTML" "HTML:" "ATTR_HTML"
9034 "BEGIN_DocBook" "END_DocBook" "DocBook:" "ATTR_DocBook" 9123 "BEGIN_DocBook" "END_DocBook" "DocBook:" "ATTR_DocBook"
9035 "BEGIN_LaTeX" "END_LaTeX" "LaTeX:" "LATEX_HEADER:" "ATTR_LaTeX" 9124 "BEGIN_LaTeX" "END_LaTeX" "LaTeX:" "LATEX_HEADER:" "LATEX_CLASS:" "ATTR_LaTeX"
9036 "BEGIN:" "END:" 9125 "BEGIN:" "END:"
9037 "ORGTBL" "TBLFM:" "TBLNAME:" 9126 "ORGTBL" "TBLFM:" "TBLNAME:"
9038 "BEGIN_EXAMPLE" "END_EXAMPLE" 9127 "BEGIN_EXAMPLE" "END_EXAMPLE"
@@ -9698,7 +9787,7 @@ statistics everywhere."
9698 lim)) 9787 lim))
9699 (first t) 9788 (first t)
9700 (box-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)") 9789 (box-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)")
9701 level ltoggle l1 9790 level ltoggle l1 new ndel
9702 (cnt-all 0) (cnt-done 0) is-percent kwd cookie-present) 9791 (cnt-all 0) (cnt-done 0) is-percent kwd cookie-present)
9703 (catch 'exit 9792 (catch 'exit
9704 (save-excursion 9793 (save-excursion
@@ -9737,10 +9826,14 @@ statistics everywhere."
9737 (and (member kwd org-done-keywords) 9826 (and (member kwd org-done-keywords)
9738 (setq cnt-done (1+ cnt-done))) 9827 (setq cnt-done (1+ cnt-done)))
9739 (outline-next-heading))) 9828 (outline-next-heading)))
9740 (replace-match 9829 (setq new
9741 (if is-percent 9830 (if is-percent
9742 (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all))) 9831 (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all)))
9743 (format "[%d/%d]" cnt-done cnt-all))))) 9832 (format "[%d/%d]" cnt-done cnt-all))
9833 ndel (- (match-end 0) (match-beginning 0)))
9834 (goto-char (match-beginning 0))
9835 (insert new)
9836 (delete-region (point) (+ (point) ndel))))
9744 (when cookie-present 9837 (when cookie-present
9745 (run-hook-with-args 'org-after-todo-statistics-hook 9838 (run-hook-with-args 'org-after-todo-statistics-hook
9746 cnt-done (- cnt-all cnt-done))))) 9839 cnt-done (- cnt-all cnt-done)))))
@@ -10164,6 +10257,7 @@ be removed."
10164 (re-search-forward org-closed-time-regexp nil t))) 10257 (re-search-forward org-closed-time-regexp nil t)))
10165 (replace-match "") 10258 (replace-match "")
10166 (if (looking-at "--+<[^>]+>") (replace-match "")) 10259 (if (looking-at "--+<[^>]+>") (replace-match ""))
10260 (skip-chars-backward " ")
10167 (if (looking-at " +") (replace-match "")))) 10261 (if (looking-at " +") (replace-match ""))))
10168 (goto-char (point-max)) 10262 (goto-char (point-max))
10169 (when what 10263 (when what
@@ -11149,6 +11243,38 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
11149 (org-back-to-heading t) 11243 (org-back-to-heading t)
11150 (org-set-tags arg just-align)))) 11244 (org-set-tags arg just-align))))
11151 11245
11246(defun org-set-tags-to (data)
11247 "Set the tags of the current entry to DATA, replacing the current tags.
11248DATA may be a tags string like :aa:bb:cc:, or a list of tags.
11249If DATA is nil or the empty string, any tags will be removed."
11250 (interactive "sTags: ")
11251 (setq data
11252 (cond
11253 ((eq data nil) "")
11254 ((equal data "") "")
11255 ((stringp data)
11256 (concat ":" (mapconcat 'identity (org-split-string data ":+") ":")
11257 ":"))
11258 ((listp data)
11259 (concat ":" (mapconcat 'identity data ":") ":"))
11260 (t nil)))
11261 (when data
11262 (save-excursion
11263 (org-back-to-heading t)
11264 (when (looking-at org-complex-heading-regexp)
11265 (if (match-end 5)
11266 (progn
11267 (goto-char (match-beginning 5))
11268 (insert data)
11269 (delete-region (point) (point-at-eol))
11270 (org-set-tags nil 'align))
11271 (goto-char (point-at-eol))
11272 (insert " " data)
11273 (org-set-tags nil 'align)))
11274 (beginning-of-line 1)
11275 (if (looking-at ".*?\\([ \t]+\\)$")
11276 (delete-region (match-beginning 1) (match-end 1))))))
11277
11152(defun org-set-tags (&optional arg just-align) 11278(defun org-set-tags (&optional arg just-align)
11153 "Set the tags for the current headline. 11279 "Set the tags for the current headline.
11154With prefix ARG, realign all tags in headings in the current buffer." 11280With prefix ARG, realign all tags in headings in the current buffer."
@@ -11604,6 +11730,7 @@ a *different* entry, you cannot use these techniques."
11604 org-todo-keywords-for-agenda 11730 org-todo-keywords-for-agenda
11605 org-done-keywords-for-agenda 11731 org-done-keywords-for-agenda
11606 org-todo-keyword-alist-for-agenda 11732 org-todo-keyword-alist-for-agenda
11733 org-drawers-for-agenda
11607 org-tag-alist-for-agenda) 11734 org-tag-alist-for-agenda)
11608 11735
11609 (cond 11736 (cond
@@ -13234,11 +13361,11 @@ When SHOW-ALL is nil, only return the current occurrence of a time stamp."
13234 (setq n0 n1 n1 (min n1 n2) n2 (max n0 n2)) 13361 (setq n0 n1 n1 (min n1 n2) n2 (max n0 n2))
13235 (if show-all 13362 (if show-all
13236 (cond 13363 (cond
13237 ((eq prefer 'past) n1) 13364 ((eq prefer 'past) (if (= cday n2) n2 n1))
13238 ((eq prefer 'future) (if (= cday n1) n1 n2)) 13365 ((eq prefer 'future) (if (= cday n1) n1 n2))
13239 (t (if (> (abs (- cday n1)) (abs (- cday n2))) n2 n1))) 13366 (t (if (> (abs (- cday n1)) (abs (- cday n2))) n2 n1)))
13240 (cond 13367 (cond
13241 ((eq prefer 'past) n1) 13368 ((eq prefer 'past) (if (= cday n2) n2 n1))
13242 ((eq prefer 'future) (if (= cday n1) n1 n2)) 13369 ((eq prefer 'future) (if (= cday n1) n1 n2))
13243 (t (if (= cday n1) n1 n2))))))) 13370 (t (if (= cday n1) n1 n2)))))))
13244 13371
@@ -13768,7 +13895,7 @@ Optional argument FILE means, use this file instead of the current."
13768(defun org-check-agenda-file (file) 13895(defun org-check-agenda-file (file)
13769 "Make sure FILE exists. If not, ask user what to do." 13896 "Make sure FILE exists. If not, ask user what to do."
13770 (when (not (file-exists-p file)) 13897 (when (not (file-exists-p file))
13771 (message "non-existent file %s. [R]emove from list or [A]bort?" 13898 (message "non-existent agenda file %s. [R]emove from list or [A]bort?"
13772 (abbreviate-file-name file)) 13899 (abbreviate-file-name file))
13773 (let ((r (downcase (read-char-exclusive)))) 13900 (let ((r (downcase (read-char-exclusive))))
13774 (cond 13901 (cond
@@ -13827,6 +13954,8 @@ When a buffer is unmodified, it is just killed. When modified, it is saved
13827 (append org-done-keywords-for-agenda org-done-keywords)) 13954 (append org-done-keywords-for-agenda org-done-keywords))
13828 (setq org-todo-keyword-alist-for-agenda 13955 (setq org-todo-keyword-alist-for-agenda
13829 (append org-todo-keyword-alist-for-agenda org-todo-key-alist)) 13956 (append org-todo-keyword-alist-for-agenda org-todo-key-alist))
13957 (setq org-drawers-for-agenda
13958 (append org-drawers-for-agenda org-drawers))
13830 (setq org-tag-alist-for-agenda 13959 (setq org-tag-alist-for-agenda
13831 (append org-tag-alist-for-agenda org-tag-alist)) 13960 (append org-tag-alist-for-agenda org-tag-alist))
13832 13961
@@ -14036,7 +14165,9 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
14036 "Regular expressions for matching embedded LaTeX.") 14165 "Regular expressions for matching embedded LaTeX.")
14037 14166
14038(defun org-format-latex (prefix &optional dir overlays msg at forbuffer) 14167(defun org-format-latex (prefix &optional dir overlays msg at forbuffer)
14039 "Replace LaTeX fragments with links to an image, and produce images." 14168 "Replace LaTeX fragments with links to an image, and produce images.
14169Some of the options can be changed using the variable
14170`org-format-latex-options'."
14040 (if (and overlays (fboundp 'clear-image-cache)) (clear-image-cache)) 14171 (if (and overlays (fboundp 'clear-image-cache)) (clear-image-cache))
14041 (let* ((prefixnodir (file-name-nondirectory prefix)) 14172 (let* ((prefixnodir (file-name-nondirectory prefix))
14042 (absprefix (expand-file-name prefix dir)) 14173 (absprefix (expand-file-name prefix dir))
@@ -14114,6 +14245,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
14114(defvar org-export-latex-packages-alist) ;; defined in org-latex.el 14245(defvar org-export-latex-packages-alist) ;; defined in org-latex.el
14115;; This function borrows from Ganesh Swami's latex2png.el 14246;; This function borrows from Ganesh Swami's latex2png.el
14116(defun org-create-formula-image (string tofile options buffer) 14247(defun org-create-formula-image (string tofile options buffer)
14248 "This calls dvipng."
14117 (require 'org-latex) 14249 (require 'org-latex)
14118 (let* ((tmpdir (if (featurep 'xemacs) 14250 (let* ((tmpdir (if (featurep 'xemacs)
14119 (temp-directory) 14251 (temp-directory)
@@ -14332,6 +14464,8 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
14332(org-defkey org-mode-map "\C-c:" 'org-toggle-fixed-width-section) 14464(org-defkey org-mode-map "\C-c:" 'org-toggle-fixed-width-section)
14333(org-defkey org-mode-map "\C-c\C-x\C-f" 'org-emphasize) 14465(org-defkey org-mode-map "\C-c\C-x\C-f" 'org-emphasize)
14334(org-defkey org-mode-map "\C-c\C-xf" 'org-footnote-action) 14466(org-defkey org-mode-map "\C-c\C-xf" 'org-footnote-action)
14467(org-defkey org-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull)
14468(org-defkey org-mode-map "\C-c\C-x\C-mp" 'org-mobile-push)
14335(org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree) 14469(org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree)
14336;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree) 14470;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree)
14337 14471
@@ -14597,9 +14731,10 @@ See the individual commands for more information."
14597 (cond 14731 (cond
14598 ((org-at-table-p) (call-interactively 'org-table-previous-field)) 14732 ((org-at-table-p) (call-interactively 'org-table-previous-field))
14599 ((integerp arg) 14733 ((integerp arg)
14600 (message "Content view to level: %d" arg) 14734 (let ((arg2 (if org-odd-levels-only (1- (* 2 arg)) arg)))
14601 (org-content (prefix-numeric-value arg)) 14735 (message "Content view to level: %d" arg)
14602 (setq org-cycle-global-status 'overview)) 14736 (org-content (prefix-numeric-value arg2))
14737 (setq org-cycle-global-status 'overview)))
14603 (t (call-interactively 'org-global-cycle)))) 14738 (t (call-interactively 'org-global-cycle))))
14604 14739
14605(defun org-shiftmetaleft () 14740(defun org-shiftmetaleft ()
@@ -15000,7 +15135,7 @@ This command does many different things, depending on context:
15000 (if arg 15135 (if arg
15001 (call-interactively 'org-toggle-checkbox) 15136 (call-interactively 'org-toggle-checkbox)
15002 (call-interactively 'org-maybe-renumber-ordered-list))) 15137 (call-interactively 'org-maybe-renumber-ordered-list)))
15003 ((save-excursion (beginning-of-line 1) (looking-at "#\\+BEGIN:")) 15138 ((save-excursion (beginning-of-line 1) (looking-at org-dblock-start-re))
15004 ;; Dynamic block 15139 ;; Dynamic block
15005 (beginning-of-line 1) 15140 (beginning-of-line 1)
15006 (save-excursion (org-update-dblock))) 15141 (save-excursion (org-update-dblock)))
@@ -15014,7 +15149,7 @@ This command does many different things, depending on context:
15014 (beginning-of-line 1) 15149 (beginning-of-line 1)
15015 (skip-chars-backward " \r\n\t") 15150 (skip-chars-backward " \r\n\t")
15016 (if (org-at-table-p) 15151 (if (org-at-table-p)
15017 (org-call-with-arg 'org-table-recalculate t)))) 15152 (org-call-with-arg 'org-table-recalculate (or arg t)))))
15018 (t 15153 (t
15019; (org-set-regexps-and-options) 15154; (org-set-regexps-and-options)
15020; (org-restart-font-lock) 15155; (org-restart-font-lock)
@@ -15453,6 +15588,13 @@ See the individual commands for more information."
15453 :style toggle :selected (and (boundp 'org-export-with-LaTeX-fragments) 15588 :style toggle :selected (and (boundp 'org-export-with-LaTeX-fragments)
15454 org-export-with-LaTeX-fragments)]) 15589 org-export-with-LaTeX-fragments)])
15455 "--" 15590 "--"
15591 ("MobileOrg"
15592 ["Push Files and Views" org-mobile-push t]
15593 ["Get Captured and Flagged" org-mobile-pull t]
15594 ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "C-c a ?"]
15595 "--"
15596 ["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
15597 "--"
15456 ("Documentation" 15598 ("Documentation"
15457 ["Show Version" org-version t] 15599 ["Show Version" org-version t]
15458 ["Info Documentation" org-info t]) 15600 ["Info Documentation" org-info t])
@@ -15627,6 +15769,10 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
15627 15769
15628;;; Generally useful functions 15770;;; Generally useful functions
15629 15771
15772(defun org-get-at-bol (property)
15773 "Get text property PROPERTY at beginning of line."
15774 (get-text-property (point-at-bol) property))
15775
15630(defun org-find-text-property-in-string (prop s) 15776(defun org-find-text-property-in-string (prop s)
15631 "Return the first non-nil value of property PROP in string S." 15777 "Return the first non-nil value of property PROP in string S."
15632 (or (get-text-property 0 prop s) 15778 (or (get-text-property 0 prop s)
@@ -16291,7 +16437,7 @@ which make use of the date at the cursor."
16291 ;; text in a line directly attached to a headline would otherwise 16437 ;; text in a line directly attached to a headline would otherwise
16292 ;; fill the headline as well. 16438 ;; fill the headline as well.
16293 (org-set-local 'comment-start-skip "^#+[ \t]*") 16439 (org-set-local 'comment-start-skip "^#+[ \t]*")
16294 (org-set-local 'paragraph-separate "\f\\|\\*+ \\|[ ]*$\\|[ \t]*[:|]") 16440 (org-set-local 'paragraph-separate "\f\\|\\*+ \\|[ ]*$\\|[ \t]*[:|#]")
16295 ;; The paragraph starter includes hand-formatted lists. 16441 ;; The paragraph starter includes hand-formatted lists.
16296 (org-set-local 16442 (org-set-local
16297 'paragraph-start 16443 'paragraph-start
@@ -16299,6 +16445,7 @@ which make use of the date at the cursor."
16299 "\f" "\\|" 16445 "\f" "\\|"
16300 "[ ]*$" "\\|" 16446 "[ ]*$" "\\|"
16301 "\\*+ " "\\|" 16447 "\\*+ " "\\|"
16448 "[ \t]*#" "\\|"
16302 "[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)" "\\|" 16449 "[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)" "\\|"
16303 "[ \t]*[:|]" "\\|" 16450 "[ \t]*[:|]" "\\|"
16304 "\\$\\$" "\\|" 16451 "\\$\\$" "\\|"
@@ -16512,7 +16659,7 @@ beyond the end of the headline."
16512 (t 'end-of-line))) 16659 (t 'end-of-line)))
16513 (let ((pos (point))) 16660 (let ((pos (point)))
16514 (beginning-of-line 1) 16661 (beginning-of-line 1)
16515 (if (looking-at (org-re ".*?\\([ \t]*\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$")) 16662 (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*\\)?$"))
16516 (if (eq special t) 16663 (if (eq special t)
16517 (if (or (< pos (match-beginning 1)) 16664 (if (or (< pos (match-beginning 1))
16518 (= pos (match-end 0))) 16665 (= pos (match-end 0)))
@@ -16529,6 +16676,8 @@ beyond the end of the headline."
16529 16676
16530(define-key org-mode-map "\C-a" 'org-beginning-of-line) 16677(define-key org-mode-map "\C-a" 'org-beginning-of-line)
16531(define-key org-mode-map "\C-e" 'org-end-of-line) 16678(define-key org-mode-map "\C-e" 'org-end-of-line)
16679(define-key org-mode-map [home] 'org-beginning-of-line)
16680(define-key org-mode-map [end] 'org-end-of-line)
16532 16681
16533(defun org-backward-sentence (&optional arg) 16682(defun org-backward-sentence (&optional arg)
16534 "Go to beginning of sentence, or beginning of table field. 16683 "Go to beginning of sentence, or beginning of table field.
@@ -16696,8 +16845,11 @@ interactive command with similar behavior."
16696 (save-excursion 16845 (save-excursion
16697 (null (re-search-backward "^\\*+ " nil t)))) 16846 (null (re-search-backward "^\\*+ " nil t))))
16698 16847
16699(defalias 'org-on-heading-p 'outline-on-heading-p) 16848(defun org-on-heading-p (&optional ignored)
16700(defalias 'org-at-heading-p 'outline-on-heading-p) 16849 (outline-on-heading-p t))
16850(defun org-at-heading-p (&optional ignored)
16851 (outline-on-heading-p t))
16852
16701(defun org-at-heading-or-item-p () 16853(defun org-at-heading-or-item-p ()
16702 (or (org-on-heading-p) (org-at-item-p))) 16854 (or (org-on-heading-p) (org-at-item-p)))
16703 16855
@@ -16858,7 +17010,7 @@ If there is no such heading, return nil."
16858 (if (eq major-mode 'org-mode) 17010 (if (eq major-mode 'org-mode)
16859 (progn 17011 (progn
16860 (org-end-of-subtree nil t) 17012 (org-end-of-subtree nil t)
16861 (backward-char 1)) 17013 (unless (eobp) (backward-char 1)))
16862 ad-do-it)) 17014 ad-do-it))
16863 17015
16864(defun org-forward-same-level (arg &optional invisible-ok) 17016(defun org-forward-same-level (arg &optional invisible-ok)