aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/org
diff options
context:
space:
mode:
authorPaul Eggert2012-04-09 15:54:59 -0700
committerPaul Eggert2012-04-09 15:54:59 -0700
commit45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193 (patch)
tree5bc87a8b5a3c754b8eb44a612cc6c03561d6b968 /lisp/org
parent9d6b4d53469a9ffd67bd770fabc6fe254e35c21d (diff)
parent05920a43fc18e696b464387e781e7cfdcea5b5af (diff)
downloademacs-45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193.tar.gz
emacs-45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193.zip
Merge from trunk.
Diffstat (limited to 'lisp/org')
-rw-r--r--lisp/org/ChangeLog1552
-rw-r--r--lisp/org/ob-C.el4
-rw-r--r--lisp/org/ob-R.el3
-rw-r--r--lisp/org/ob-asymptote.el2
-rw-r--r--lisp/org/ob-clojure.el5
-rw-r--r--lisp/org/ob-ditaa.el18
-rw-r--r--lisp/org/ob-emacs-lisp.el14
-rw-r--r--lisp/org/ob-exp.el137
-rw-r--r--lisp/org/ob-fortran.el22
-rw-r--r--lisp/org/ob-js.el3
-rw-r--r--lisp/org/ob-lilypond.el16
-rw-r--r--lisp/org/ob-lisp.el7
-rw-r--r--lisp/org/ob-lob.el17
-rw-r--r--lisp/org/ob-maxima.el11
-rw-r--r--lisp/org/ob-perl.el4
-rw-r--r--lisp/org/ob-picolisp.el3
-rw-r--r--lisp/org/ob-plantuml.el1
-rw-r--r--lisp/org/ob-python.el4
-rw-r--r--lisp/org/ob-ref.el4
-rw-r--r--lisp/org/ob-scheme.el3
-rw-r--r--lisp/org/ob-sql.el1
-rw-r--r--lisp/org/ob-sqlite.el9
-rw-r--r--lisp/org/ob-table.el7
-rw-r--r--lisp/org/ob-tangle.el17
-rw-r--r--lisp/org/ob.el203
-rw-r--r--lisp/org/org-agenda.el80
-rw-r--r--lisp/org/org-archive.el2
-rw-r--r--lisp/org/org-ascii.el6
-rw-r--r--lisp/org/org-attach.el5
-rw-r--r--lisp/org/org-bbdb.el32
-rw-r--r--lisp/org/org-beamer.el59
-rw-r--r--lisp/org/org-bibtex.el23
-rw-r--r--lisp/org/org-capture.el51
-rw-r--r--lisp/org/org-clock.el26
-rw-r--r--lisp/org/org-colview.el27
-rw-r--r--lisp/org/org-compat.el2
-rw-r--r--lisp/org/org-crypt.el16
-rw-r--r--lisp/org/org-ctags.el4
-rw-r--r--lisp/org/org-datetree.el2
-rw-r--r--lisp/org/org-docbook.el4
-rw-r--r--lisp/org/org-entities.el2
-rw-r--r--lisp/org/org-eshell.el1
-rw-r--r--lisp/org/org-exp-blocks.el18
-rw-r--r--lisp/org/org-exp.el40
-rw-r--r--lisp/org/org-faces.el3
-rw-r--r--lisp/org/org-footnote.el167
-rw-r--r--lisp/org/org-freemind.el1
-rw-r--r--lisp/org/org-gnus.el1
-rw-r--r--lisp/org/org-habit.el28
-rw-r--r--lisp/org/org-html.el15
-rw-r--r--lisp/org/org-icalendar.el4
-rw-r--r--lisp/org/org-indent.el1
-rw-r--r--lisp/org/org-inlinetask.el1
-rw-r--r--lisp/org/org-latex.el66
-rw-r--r--lisp/org/org-list.el90
-rw-r--r--lisp/org/org-lparse.el215
-rw-r--r--lisp/org/org-mac-message.el6
-rw-r--r--lisp/org/org-mobile.el5
-rw-r--r--lisp/org/org-mouse.el8
-rw-r--r--lisp/org/org-odt.el650
-rw-r--r--lisp/org/org-protocol.el16
-rw-r--r--lisp/org/org-publish.el5
-rw-r--r--lisp/org/org-special-blocks.el13
-rw-r--r--lisp/org/org-src.el47
-rw-r--r--lisp/org/org-table.el18
-rw-r--r--lisp/org/org-taskjuggler.el8
-rw-r--r--lisp/org/org-timer.el1
-rw-r--r--lisp/org/org-wl.el5
-rw-r--r--lisp/org/org-xoxo.el2
-rw-r--r--lisp/org/org.el479
70 files changed, 3162 insertions, 1160 deletions
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 392fe25202f..618d5753a46 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,1461 @@
12012-04-03 Bastien Guerry <bzg@gnu.org>
2
3 * org.el (org-todo): Fix regression: rename `state' to
4 `org-state'.
5 (org-use-effective-time): Fix group and type.
6
72012-04-02 Bastien Guerry <bzg@gnu.org>
8
9 * org-clock.el (org-clock-out-if-current): Fix regression: rename
10 `org-clock-state' to `org-state' to match the name of the
11 dynamically-scoped variable in `org-todo'.
12
13 * org-agenda.el (entry, org-diary, org-class): Fix regression:
14 rename `org-entry' to `entry'.
15
162012-04-01 Bastien Guerry <bzg@gnu.org>
17
18 * org.el (org-todo): Fix regression in `org-todo'.
19
202012-04-01 Eric Schulte <eric.schulte@gmx.com>
21
22 * ob-C.el (org-babel-C-execute): Add .exe to the end of compiled
23 C files on windows.
24
252012-04-01 Eric Schulte <eric.schulte@gmx.com>
26
27 * ob-exp.el (org-babel-exp-code): Escape all lines when exporting
28 Org-mode blocks.
29
30 * ob.el (org-babel-parse-src-block-match): Make use of the new
31 language argument to org-babel-strip-protective-commas.
32 (org-babel-parse-inline-src-block-match): Make use of the new
33 language argument to org-babel-strip-protective-commas.
34 (org-babel-strip-protective-commas): Now accepts a language
35 argument.
36
372012-04-01 Bastien Guerry <bzg@gnu.org>
38
39 * org.el (org-fast-tag-selection): Fix an bug when listing tags
40 for completion.
41
422012-04-01 Ilya Shlyakhter <ilya_shl@alum.mit.edu> (tiny change)
43
44 * org.el (org-delete-property-globally): Fixed a bug that left
45 blank line in place of the property, instead of removing the line.
46
472012-04-01 Bastien Guerry <bzg@gnu.org>
48
49 * ob-maxima.el (org-babel-maxima-command): Add group information
50 to the defcustom.
51
522012-04-01 Bastien Guerry <bzg@gnu.org>
53
54 * org.el (org-mode): Use `buffer-face-mode' to remap the 'default
55 face to 'org-default.
56
572012-04-01 Bastien Guerry <bzg@gnu.org>
58
59 * org-ascii.el (org-export-as-ascii): Fix escaping of underscores
60 in links.
61
622012-04-01 Bastien Guerry <bzg@gnu.org>
63
64 * org.el: Prevent a bug while defining the menu by requiring
65 `org-beamer' when necessary.
66
672012-04-01 Bastien Guerry <bzg@gnu.org>
68
69 * org-table.el (orgtbl-self-insert-command): Use
70 `backward-delete-char' instead of `delete-backward-char' as this
71 last command gets caught by the compiler which says to not use it
72 in programs. `backward-delete-char' is just an alias for
73 `delete-backward-char' which is internally remapped to
74 `org-delete-backward-char' for optimization purpose.
75
762012-04-01 Bastien Guerry <bzg@gnu.org>
77
78 * org-latex.el (org-export-latex-subcontent): Bugfix: when
79 `org-export-latex-low-levels' is nil, do not export low levels.
80
812012-04-01 Eric Schulte <eric.schulte@gmx.com>
82
83 * ob.el (org-babel-insert-result): Fix bug in indented wrapped
84 results insertion.
85
862012-04-01 Bastien Guerry <bzg@gnu.org>
87
88 * org.el (org-set-tags): Include `org-tag-alist' in the list of
89 possible completions, even when there are tags defined in the
90 buffer.
91
922012-04-01 Bastien Guerry <bzg@gnu.org>
93
94 * org-mime.el (org-mime-htmlize): Set
95 `org-export-with-LaTeX-fragments' correctly.
96
972012-04-01 Bastien Guerry <bzg@gnu.org>
98
99 * org.el (org-set-tags): Don't add a column when there is only one
100 tag offered for completion.
101
1022012-04-01 Bastien Guerry <bzg@gnu.org>
103
104 * org.el (org-fast-tag-selection): Include tags from
105 `org-tag-alist' when completing with the TAB key.
106
1072012-04-01 Shoji Nishimura <nishimura.shoji@gmail.com> (tiny change)
108
109 * org.el (org-display-inline-images): Honor the ̀beg' parameter.
110
1112012-04-01 Bastien Guerry <bzg@gnu.org>
112
113 * org-latex.el (org-export-latex-subcontent): Don't insert a
114 linebreak when itemizing a subtree that is just a headline.
115
1162012-04-01 Eric Schulte <eric.schulte@gmx.com>
117
118 * ob-lob.el (org-babel-lob-get-info): Removed extra []s when
119 parsing inline call_foo lines.
120
1212012-04-01 Eric Schulte <eric.schulte@gmx.com>
122
123 * ob-maxima.el (org-babel-maxima-command): The maxima command used
124 should be configurable (defaults to maxima-command if defined).
125 (org-babel-execute:maxima): The maxima command used should be
126 configurable (defaults to maxima-command if defined).
127
1282012-04-01 Eric Schulte <eric.schulte@gmx.com>
129
130 * ob-C.el (org-babel-C-execute): Add the local directory to the
131 library search path for C/C++ block compilation.
132
1332012-04-01 Eric Schulte <eric.schulte@gmx.com>
134
135 * ob.el (org-babel-where-is-src-block-result): Don't truncate
136 results name on call line execution.
137
1382012-04-01 Ilya Shlyakhter <ilya_shl@alum.mit.edu> (tiny change)
139
140 * org-colview.el (org-columns-cleanup-item): Handle case of empty
141 headline
142
1432012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
144
145 * org-footnote.el (org-footnote-delete-definitions): Fix LaTeX
146 export error when a src block produces fake footnotes.
147
1482012-04-01 Bastien Guerry <bzg@gnu.org>
149
150 * org.el (org-read-date): Don't mention `parse-time-weekdays' and
151 `parse-time-months' in the docstring.
152
1532012-04-01 Bastien Guerry <bzg@gnu.org>
154
155 * org-agenda.el (org-agenda-filter-apply): Bugfix: Add let
156 binding.
157
1582012-04-01 Bastien Guerry <bzg@gnu.org> (tiny change)
159
160 * org-colview.el (org-columns-compute): Also consider inline tasks
161 when computing the sum.
162
1632012-04-01 Thomas Morgan <tlm@ziiuu.com> (tiny change)
164
165 * org-habit.el (org-habit-insert-consistency-graphs): Fix
166 alignment of consistency graph in filtered agenda view.
167
1682012-04-01 Bastien Guerry <bzg@gnu.org>
169
170 * org-latex.el (org-export-as-latex): Fix bug in setting the
171 export directory according to the LaTeX options.
172
1732012-04-01 K.Nagashima <uni.naga@gmail.com> (tiny change)
174
175 * org.el (org-show-subtree): Make interactive.
176
1772012-04-01 Ilya Shlyakhter <ilya_shl@alum.mit.edu>
178
179 * org-clock.el: (org-clock-get-table-data): Make sure todo-only
180 does not leak when it is set by make-org-tags-macher.
181
1822012-04-01 Bastien Guerry <bzg@gnu.org>
183
184 * org.el (org-cycle-internal-local): Don't try to hide drawers
185 within subtrees in this function, it slows cycling down.
186
1872012-04-01 Bastien Guerry <bzg@gnu.org>
188
189 * org-agenda.el (org-agenda-custom-commands-local-options): Fix
190 incorrect custom option definition.
191
1922012-04-01 Bastien Guerry <bzg@gnu.org>
193
194 * org-colview.el (org-columns-display-here): Bugfix: use the date
195 as the value for the ITEM column when displaying a summary.
196
1972012-04-01 Martyn Jago <martyn.jago@btinternet.com>
198
199 * ob-lilypond.el: Re-direct homepage to Worg.
200
2012012-04-01 Martyn Jago <martyn.jago@btinternet.com>
202
203 * ob-lilypond.el: Leave versioning to Org.
204
2052012-04-01 Martyn Jago <martyn.jago@btinternet.com>
206
207 * ob-lilypond.el: Fix compiler warning.
208
2092012-04-01 Jambunathan K <kjambunathan@gmail.com>
210
211 * org-odt.el (org-odt-format-entity-caption): Enumerate entities
212 that have either a caption or a label.
213 (org-odt-label-styles, org-odt-category-map-alist): Add a
214 separator between sequence number and caption. Introduced two
215 new label styles for handling of math formula and math label.
216 (org-odt-format-label-definition)
217 (org-export-odt-format-formula): Propagate above changes.
218
2192012-04-01 Bastien Guerry <bzg@gnu.org>
220
221 * org.el (org-enforce-todo-dependencies): Fix docstring.
222
2232012-04-01 Jambunathan K <kjambunathan@gmail.com>
224
225 * org-odt.el (org-export-odt-category-strings): New custom
226 variable.
227 (org-odt-category-map-alist): Modify interpretation. Don't
228 use the same field to double up as both a OpenDocument
229 variable and a category string. Entries in this list now
230 specify only the OpenDocument variable. Category strings are
231 obtained through an indirect lookup of
232 `org-export-odt-category-strings'. Use same OpenDocument
233 variables as what LibreOffice uses for various entities. Fix
234 docstring.
235 (org-odt-add-label-definition)
236 (org-odt-format-label-definition)
237 (org-odt-format-label-reference): Propagate above changes.
238
2392012-04-01 Bastien Guerry <bzg@gnu.org> (tiny change)
240
241 * org-latex.el (org-export-as-latex): Check TeX-master correctly.
242
2432012-04-01 Jambunathan K <kjambunathan@gmail.com>
244
245 * org-odt.el (org-odt-category-map-alist): Update docstring.
246 (org-export-odt-user-categories)
247 (org-export-odt-get-category-from-label)
248 (org-odt-get-label-category-and-style): Remove.
249 (org-odt-add-label-definition): Propagate above changes.
250
2512012-04-01 Bastien Guerry <bzg@gnu.org> (tiny change)
252
253 * org.el (org-refile): Don't allow creation of parents when using
254 the refile command to go to a headline.
255
2562012-04-01 Jambunathan K <kjambunathan@gmail.com>
257
258 * org-odt.el (org-odt-format-org-link): Resolve links to headlines
259 as section numbers only if section numbering is on.
260
2612012-04-01 Bastien Guerry <bzg@gnu.org>
262
263 * org.el (format-spec): Require 'format-spec.
264
2652012-04-01 Bastien Guerry <bzg@gnu.org> (tiny change)
266
267 * org-latex.el (org-export-as-latex): Fix TeX-master declaration.
268
2692012-04-01 Ilya Shlyakhter <ilya_shl@alum.mit.edu> (tiny change)
270
271 * org.el (org-imenu-get-tree): Check that looking-at succeeds
272 before using match results.
273
2742012-04-01 Bastien Guerry <bzg@gnu.org>
275
276 * org-exp-blocks.el (org-ditaa-jar-path): Make a defcustom.
277
2782012-04-01 Jambunathan K <kjambunathan@gmail.com>
279
280 * org-lparse.el (org-do-lparse): Make effective setting of
281 `org-export-headline-levels' available to the ODT exporter. Also
282 remove some stale comments.
283
2842012-04-01 Jambunathan K <kjambunathan@gmail.com>
285
286 * org-odt.el (org-odt-begin-toc): Handle named HTML entities in
287 per-language string for "Table Of Contents".
288
2892012-04-01 Bastien Guerry <bzg@gnu.org>
290
291 * org-exp-blocks.el (org-ditaa-jar-path): Fix merge conflict.
292
2932012-04-01 Shaun Johnson <shaun@slugfest.demon.co.uk> (tiny change)
294
295 * org-exp-blocks.el (org-ditaa-jar-path): Better heuristic to find
296 the libary name.
297
2982012-04-01 Suvayu Ali <fatkasuvayu+linux@gmail.com>
299
300 * org-src.el (org-edit-src-code): Change let bind to let*, e.g. if
301 case-fold-search is bound to nil globally, the
302 (case-fold-search t) doesn't work until we get to the body.
303
3042012-04-01 Bastien Guerry <bzg@gnu.org> (tiny change)
305
306 * org-latex.el (org-export-latex-tables): Allow to use
307 sidewaystable.
308
3092012-04-01 Eric Schulte <eric.schulte@gmx.com>
310
311 * ob.el (org-babel-expand-noweb-references): Fix bug in src name
312 regexp when using *org-babel-use-quick-and-dirty-noweb-expansion*.
313
3142012-04-01 David Maus <dmaus@ictsoc.de>
315
316 * org.el (org-scan-tags): Require one or more spaces (+) between
317 keyword and headline.
318
3192012-04-01 David Maus <dmaus@ictsoc.de>
320
321 * org-agenda.el (org-prepare-agenda): Don't reset
322 `org-done-keywords-for-agenda' when `org-agenda-multi'.
323
3242012-04-01 Thomas Morgan <tlm@ziiuu.com> (tiny change)
325
326 * org-habit.el (org-habit-insert-consistency-graphs): Fix bug
327 while inserting habit graph in the agenda buffer.
328
3292012-04-01 Bastien Guerry <bzg@gnu.org> (tiny change)
330
331 * org-src.el (org-src-edit-buffer-p): New function.
332
3332012-04-01 Bastien Guerry <bzg@gnu.org> (tiny change)
334
335 * org-agenda.el (org-agenda-skip-if): Fix the order conditions are
336 being checked. Also enhance the docstring a bit.
337
3382012-04-01 Bastien Guerry <bzg@gnu.org> (tiny change)
339
340 * org-agenda.el (org-agenda-tree-to-indirect-buffer): Fix the
341 display of indirect agenda window.
342
3432012-04-01 Bastien Guerry <bzg@gnu.org> (tiny change)
344
345 * org.el (org-create-formula-image, org-dvipng-color): Fix XEmacs
346 compatibility bug.
347
3482012-04-01 Carsten Dominik <carsten.dominik@gmail.com> (tiny change)
349
350 * org-clock.el (org-clock-get-table-data): Bind org-scanner-tags
351 to tags-list and org-trust-scanner-tags to t while evaluating the
352 matcher, since the matcher is always evaluated at the current
353 entry.
354
3552012-04-01 Ilya Shlyakhter <ilya_shl@alum.mit.edu> (tiny change)
356
357 * org.el (org-scan-tags): Bind org-trust-scanner-tags to t while
358 evaluating the matcher, since the matcher is always evaluated at
359 the current entry.
360
3612012-04-01 Ilya Shlyakhter <ilya_shl@alum.mit.edu> (tiny change)
362
363 * ob-lilypond.el (ly-compile-lilyfile): Fixed misplaced comma in a
364 quoting expression.
365
3662012-04-01 Eric Schulte <eric.schulte@gmx.com>
367
368 * ob.el (org-babel-merge-params): Add "eval" as acceptable noweb
369 argument.
370 (org-babel-noweb-p): The "eval" argument only expands during
371 evaluation.
372
3732012-04-01 Eric Schulte <eric.schulte@gmx.com>
374
375 * ob.el (org-strip-protective-commas): Declared.
376
377 * org-agenda.el (org-agenda-filtered-by-category): Declared.
378 (org-agenda-filter-apply): Capture free variable.
379
380 * org-footnote.el (org-skip-whitespace): Declared.
381
382 * org-mobile.el (org-agenda-filter): Declared.
383
384 * org-src.el (org-strip-protective-commas): Declared.
385
3862012-04-01 Sebastien Vauban <sva@mygooglest.com> (tiny change)
387
388 * org.el (org-version): Add autoload cookie.
389
3902012-04-01 David Maus <dmaus@ictsoc.de>
391
392 * org-attach.el (org-attach-store-link-p): Remove spurious quote
393 in customization form choice.
394
3952012-04-01 Tassilo Horn <tassilo@member.fsf.org>
396
397 * org-contacts.el (org-contacts-check-mail-address): Add missing
398 word to `y-or-n-p' question.
399
4002012-04-01 Eric Schulte <eric.schulte@gmx.com>
401
402 * ob-sh.el (org-babel-execute:sh): Pass all params to subroutine.
403 (org-babel-sh-evaluate): Apply :shebang and :padline to shell script
404 execution.
405
4062012-04-01 Eric Schulte <eric.schulte@gmx.com>
407
408 * ob.el (org-babel-insert-result): Ensure correct order for empty
409 result wrapping blocks.
410
4112012-04-01 Martyn Jago <martyn.jago@btinternet.com>
412
413 * ob-lilypond.el: Make auditioning of midi and pdf asynchronous,
414 and add easy pdf generation in the form of `ly-gen-pdf' variable.
415
4162012-04-01 Deech <deech@deech-ThinkPad-X200.none> (tiny change)
417
418 * ob-tangle.el (org-babel-spec-to-string): The link generated by
419 org-store-link is escaped twice when tangling with ":comments yes"
420 flag.
421
4222012-04-01 Bastien Guerry <bzg@gnu.org>
423
424 * org-html.el (org-export-as-html): Remove another useless space
425 before tag.
426
4272012-04-01 Bastien Guerry <bzg@gnu.org>
428
429 * org-html.el (org-export-as-html): Remove another useless space
430 before tag.
431
4322012-04-01 Bastien Guerry <bzg@gnu.org>
433
434 * org-html.el (org-export-as-html): Remove useless space before
435 tag.
436
4372012-04-01 Sebastien Vauban <sva@mygooglest.com> (tiny change)
438
439 * org.el (org-version): Add autoload cookie.
440
4412012-04-01 Bastien Guerry <bzg@gnu.org>
442
443 * org.el (org-get-category): Save match data.
444
4452012-04-01 Eric Schulte <eric.schulte@gmx.com>
446
447 * ob-tangle.el (org-babel-tangle): Don't prompt for a file name if
448 :tangle is specified.
449
450 * ob.el (org-babel-expand-noweb-references): Widen buffer when
451 expanding noweb references.
452
4532012-04-01 Eric Schulte <eric.schulte@gmx.com>
454
455 * ob-table.el (sbe): Don't accidentally leave a `t' value when
456 variables are force interpreted as strings.
457
4582012-04-01 David Maus <dmaus@ictsoc.de>
459
460 * org-bbdb.el (org-bbdb-open, org-bbdb-open-old)
461 (org-bbdb-open-new): Pass record name to avoid dynamic scoping.
462
4632012-04-01 David Maus <dmaus@ictsoc.de>
464
465 * org-bbdb.el (bbdb-record-get-field, bbdb-search-name)
466 (bbdb-search-organization): Declare functions to silence byte
467 compiler.
468
4692012-04-01 Bernt Hansen <bernt@norang.ca>
470
471 * org.el (org-clone-subtree-with-time-shift): Fix task cloning for
472 repeating tasks using .+n and ++n syntax
473
4742012-04-01 Karl Fogel <kfogel@red-bean.com> (tiny change)
475
476 * org-agenda.el (org-agenda-highlight-todo): Handle the case of a
477 heading that has a date but no todo keyword.
478
4792012-04-01 Eric Schulte <eric.schulte@gmx.com>
480
481 * ob.el (org-babel-find-named-result): Fix code block replacement
482 with results.
483
4842012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
485
486 * org-footnote.el (org-footnote-normalize): Do not normalize
487 labels when sort-only is non-nil.
488
4892012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
490
491 * org-footnote.el (org-footnote-normalize): Remove an useless part
492 of the function.
493 (org-insert-footnote-reference-near-definition): Remove function.
494
4952012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
496
497 * org-footnote.el (org-footnote-normalize): Fix normalization of
498 inline footnotes with no footnote section.
499
5002012-04-01 David Maus <dmaus@ictsoc.de>
501
502 * org-bbdb.el (org-bbdb-old): Replace `defvar' after loading 'bbdb
503 to check for old or new version by a check for the required
504 function in `org-bbdb-open' and `org-bbdb-store-link'.
505 (org-bbdb-store-link, org-bbdb-open): Check which version of bbdb is
506 to be used.
507
5082012-04-01 Eric Schulte <eric.schulte@gmx.com>
509
510 * ob.el (org-babel-find-named-result): Don't miss a code block
511 when there are confounding spaces after the result name.
512
5132012-04-01 Eric Schulte <eric.schulte@gmx.com>
514
515 * ob-lob.el (org-babel-block-lob-one-liner-regexp): Less greedy
516 regular expressions.
517 (org-babel-inline-lob-one-liner-regexp): Less greedy regular
518 expressions.
519
5202012-04-01 Eric Schulte <eric.schulte@gmx.com>
521
522 * ob.el (org-babel-examplize-region): Fixed bug in examplization.
523
5242012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
525
526 * org.el (org-link-search): Search for #+name affiliated keywords
527 and invisible targets.
528
5292012-04-01 Jambunathan K <kjambunathan@gmail.com>
530
531 * org-lparse.el (org-lparse-end-footnote-definition): Cleanup
532 newlines in a transcoded footnote definition. This ensures that
533 the line that is currently being processed by `org-do-lparse' loop
534 doesn't get broken up into multiple lines. Fix for the following
535 bug -
536
5372012-04-01 Jambunathan K <kjambunathan@gmail.com>
538
539 * org-footnote.el (org-footnote-normalize): Force a paragraph
540 break after the last footnote definition. This is an an implicit
541 assumption made by the org-lparse.el library. With this change,
542 footnote definitions can reliably be exported with ODT backend.
543 See http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg01013.html.
544
5452012-04-01 Eric Schulte <eric.schulte@gmx.com>
546
547 * ob-ditaa.el (org-ditaa-jar-path): Fix a recursive load error.
548
5492012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
550
551 * org-list.el (org-list-struct): Fix small bug introduced by
552 commit 8b7a3f249803aba612f9ad3ae50c2fc986247da4 in Org's git repo.
553
5542012-04-01 Eric Schulte <eric.schulte@gmx.com>
555
556 * ob-ditaa.el (org-ditaa-jar-path): Already defined in
557 org-exp-blocks.el.
558
559 * org-exp-blocks.el (org-ditaa-jar-path): Declare appropriately
560 for the fact that this is really now a Babel thing -- even if it
561 is used here and the definition should remain here for reasons of
562 load dependencies.
563
5642012-04-01 David Maus <dmaus@ictsoc.de>
565
566 * org-bbdb.el (org-bbdb-old): Wrap `defvar' so the variable gets
567 defined after bbdb was loaded.
568
5692012-04-01 Eric Schulte <eric.schulte@gmx.com>
570
571 * org-latex.el (org-export-latex-tables): Don't add spurious
572 preceding newline if caption is not above a longtable.
573
5742012-04-01 Jambunathan K <kjambunathan@gmail.com>
575
576 * org-odt.el (org-odt-insert-toc): Remove this stray,
577 dysfunctional routine. This possibly has crept in because of the
578 broken merges between "maint" and "origin" branches.
579 (org-odt-begin-table): Don't emit an empty paragraph when a table is
580 neither labeled nor captioned.
581 (org-odt-init-outfile): Remove reference to an unused variable.
582
5832012-04-01 Viktor Rosenfeld <listuser36@googlemail.com>
584
585 * ob-sql.el (org-babel-execute:sql): Add support for MonetDB to
586 SQL code blocks.
587
5882012-04-01 Andreas Leha <andreas.leha@med.uni-goettingen.de>
589
590 * ob.el (org-babel-goto-named-src-block): Pushing the point to the
591 org-mark-ring and guessing at the code block name to jump to.
592
5932012-04-01 David Maus <dmaus@ictsoc.de>
594
595 * org-agenda.el (org-agenda-tree-to-indirect-buffer): Fix handling
596 of indirect buffer and window.
597
5982012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
599
600 * org-footnote.el (org-footnote-forbidden-blocks): Allow footnotes
601 in verse blocks.
602
6032012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
604
605 * org-footnote.el (org-footnote-forbidden-blocks): Allow footnotes
606 in verse blocks.
607
6082012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
609
610 * org-exp.el (org-table-clean-before-export): Ignore table rows
611 defining parameters for formulas during export.
612
6132012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
614
615 * org-list.el (org-list-get-item-number): New function.
616
6172012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
618
619 * org-list.el (org-list-ending-method, org-list-end-regexp):
620 Removed variables.
621 (org-in-item-p, org-list-separating-blank-lines-number)
622 (org-list-parse-list, org-list-struct): Apply changes.
623
624 * org-exp.el (org-export-mark-list-end)
625 (org-export-mark-list-properties): Apply changes.
626
627 * org-latex.el (org-export-latex-lists): Apply changes.
628
6292012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
630
631 * org.el (org-cycle-internal-local): Correctly unfold headlines
632 containing an inlinetask.
633
6342012-04-01 Bastien Guerry <bzg@gnu.org>
635
636 * org.el (org-structure-template-alist): Fix missing angle
637 brackets for muse export style.
638
6392012-04-01 David Maus <dmaus@ictsoc.de>
640
641 * org.el (org-recenter-calendar): Use `with-selected-window' to
642 select calendar window and save currently selected window and
643 current buffer.
644
6452012-04-01 Toby S. Cubitt <tsc25@cantab.net> (tiny change)
646
647 * org.el (org-goto): call org-refile-get-location with NO-EXCLUDE
648 argument set, otherwise not only are headlines in the current
649 subtree excluded, but it throws an error if point happens not to
650 be within a subtree (e.g. at start of buffer).
651
6522012-04-01 David Maus <dmaus@ictsoc.de>
653
654 * org.el (org-scan-tags): Fix highlighting in sparse-tree.
655
6562012-04-01 David Maus <dmaus@ictsoc.de>
657
658 * org-clock.el (org-in-clocktable-p): Moved to org.el.
659
660 * org.el (org-in-clocktable-p): New function. Moved from
661 org-clock.el
662
6632012-04-01 David Maus <dmaus@ictsoc.de>
664
665 * org-exp.el (org-export-get-title-from-subtree): Don't format
666 tags in title if title headline does not have tags.
667
6682012-04-01 Bastien Guerry <bzg@gnu.org>
669
670 * org.el (org-cycle-internal-local): Fix bug: hide drawers in
671 inline tasks too.
672
6732012-04-01 Jambunathan K <kjambunathan@gmail.com>
674
675 * org-odt.el (org-odt-format-preamble): Don't insert TOC here.
676 Delay it till the end of export.
677 (org-odt-begin-document-body): Make a note of the default
678 position of TOC in `org-lparse-dyn-first-heading-pos'.
679 (org-odt-insert-toc): Insert TOC as directed by
680 [TABLE-OF-CONTENTS] line or at the default position.
681 (org-odt-end-export): Call `org-odt-insert-toc'.
682
6832012-04-01 Bastien Guerry <bzg@gnu.org>
684
685 * org.el (org-preview-latex-fragment): Throw an error when called
686 from a non-file buffer.
687
6882012-04-01 David Maus <dmaus@ictsoc.de>
689
690 * org-capture.el (org-capture-place-item): Don't search for
691 position in existing list if :exact-position was supplied.
692
6932012-04-01 Bastien Guerry <bzg@gnu.org>
694
695 * org.el (org-set-font-lock-defaults): Fix bug in done headline
696 fontification.
697
6982012-04-01 Jambunathan K <kjambunathan@gmail.com>
699
700 * org-odt.el (org-odt-format-textbox): Honor user-specified width
701 in captioned images.
702
7032012-04-01 Eric Schulte <eric.schulte@gmx.com>
704
705 * org.el (org-update-property-plist): Fix bug in property list
706 updates.
707
7082012-04-01 Eric Schulte <eric.schulte@gmx.com>
709
710 * ob.el (org-babel-balanced-split): Explicit checking if list
711 before calling member.
712
7132012-04-01 Eric Schulte <eric.schulte@gmx.com>
714
715 * ob-sqlite.el (org-babel-execute:sqlite): Specify the use of ","
716 as the separator to `org-table-convert-region'. Fixes errors when
717 only one result per line of output.
718
7192012-04-01 Eric Schulte <eric.schulte@gmx.com>
720
721 * ob.el (org-babel-strip-protective-commas): Use
722 `org-strip-protective-commas'.
723
724 * org-exp.el (org-export-select-backend-specific-text): Use
725 `org-strip-protective-commas'.
726
727 * org-src.el (org-edit-src-code): Use
728 `org-strip-protective-commas'.
729
730 * org.el (org-strip-protective-commas): Single definition for this
731 functionality.
732
7332012-04-01 Eric Schulte <eric.schulte@gmx.com>
734
735 * ob-sql.el: Mention ob-sqlite in the comments of ob-sql.
736
7372012-04-01 David Maus <dmaus@ictsoc.de>
738
739 * org-capture.el (org-capture-prepare-finalize-hook): New hook.
740 Run before the finalization process starts.
741 (org-capture-finalize): Run new hook.
742
7432012-04-01 Eric Schulte <eric.schulte@gmx.com>
744
745 * org.el (org-entry-get): Generalize to multiple "prop+"
746 properties.
747
7482012-04-01 Eric Schulte <eric.schulte@gmx.com>
749
750 * org-src.el (org-src-mode-map): Rebinding `org-edit-src-save' in
751 the `org-src-mode-map'.
752
7532012-04-01 David Maus <dmaus@ictsoc.de>
754
755 * org.el (org-recenter-calendar): Use `with-selected-window' to
756 select calendar window and save currently selected window and
757 current buffer.
758
7592012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
760
761 * org-list.el (org-list-ending-method, org-list-end-regexp):
762 Removed variables.
763 (org-in-item-p, org-list-separating-blank-lines-number)
764 (org-list-parse-list, org-list-struct): Apply changes.
765
766 * org-exp.el (org-export-mark-list-end)
767 (org-export-mark-list-properties): Apply changes.
768
769 * org-latex.el (org-export-latex-lists): Apply changes.
770
7712012-04-01 Eric Schulte <eric.schulte@gmx.com>
772
773 * org.el (org-entry-get): Accumulate properties from subtree
774 property drawers.
775
7762012-04-01 Eric Schulte <eric.schulte@gmx.com>
777
778 * org.el (org-entry-get): Accumulate properties from subtree
779 property drawers.
780
7812012-04-01 Jambunathan K <kjambunathan@gmail.com>
782
783 * org-odt.el (org-export-odt-image-size-probe-method)
784 (org-odt-do-image-size): Use imagemagick preferentially to
785 determine image sizes.
786
7872012-04-01 Jambunathan K <kjambunathan@gmail.com>
788
789 * org-odt.el (org-export-as-odt-to-buffer)
790 (org-replace-region-by-odt, org-export-region-as-odt): Remove
791 these interactive functions. They are of questionable value.
792
7932012-04-01 Toby S. Cubitt <tsc25@cantab.net> (tiny change)
794
795 * org.el (org-goto): call org-refile-get-location with NO-EXCLUDE
796 argument set, otherwise not only are headlines in the current
797 subtree excluded, but it throws an error if point happens not to
798 be within a subtree (e.g. at start of buffer).
799
8002012-04-01 Bastien Guerry <bzg@gnu.org>
801
802 * org-exp.el (org-export-kill-product-buffer-when-displayed)
803 (org-export-initial-scope, org-export-date-timestamp-format)
804 (org-export-with-tasks, org-export-email-info)
805 (org-export-table-remove-empty-lines): Add version tag.
806
8072012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
808
809 * org.el (org-cycle-internal-local): Correctly unfold headlines
810 containing an inlinetask.
811
8122012-04-01 Bernt Hansen <bernt@norang.ca>
813
814 * org-clock.el (org-clock-out): Do not delete the current clocking
815 task when org-clock-out-hook clocks in another task
816
8172012-04-01 David Maus <dmaus@ictsoc.de>
818
819 * org.el (org-scan-tags): Fix highlighting in sparse-tree.
820
8212012-04-01 Jambunathan K <kjambunathan@gmail.com>
822
823 * org-odt.el (org-export-odt-convert-processes): Re-define
824 (org-export-odt-convert-capabilities): Fix an accidental
825 regression.
826
8272012-04-01 Jambunathan K <kjambunathan@gmail.com>
828
829 * org-odt.el (org-export-odt-convert-capabilities): Change the
830 default value.
831
8322012-04-01 David Maus <dmaus@ictsoc.de>
833
834 * org-clock.el (org-in-clocktable-p): Moved to org.el.
835
836 * org.el (org-in-clocktable-p): New function. Moved from org-clock.el
837
8382012-04-01 David Maus <dmaus@ictsoc.de>
839
840 * org-exp.el (org-export-get-title-from-subtree): Don't format
841 tags in title if title headline does not have tags.
842
8432012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
844
845 * org-footnote.el (org-blank-before-new-entry)
846 (org-export-footnotes-seen, org-export-footnotes-data): Fix bogus
847 declarations.
848
8492012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
850
851 * org.el (org-beginning-of-line, org-end-of-line): Fix special C-a
852 and C-e behaviour with visual lines.
853
8542012-04-01 Eric Schulte <eric.schulte@gmx.com>
855
856 * org-exp-blocks.el (org-export-blocks): Changed the name of
857 exporting comment blocks given that it seems regular comment
858 blocks no longer export.
859
8602012-04-01 Eric Schulte <eric.schulte@gmx.com>
861
862 * ob-exp.el (org-babel-exp-get-export-buffer): Access current
863 export buffer.
864 (org-babel-exp-in-export-file): Access current export buffer.
865 (org-babel-exp-src-block): Access current export buffer.
866 (org-babel-exp-inline-src-blocks): Access current export buffer.
867
8682012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
869
870 * ob-exp.el (org-babel-exp-in-export-file)
871 (org-babel-exp-src-block, org-babel-exp-inline-src-blocks): Allow
872 org-current-export-file to contain a buffer.
873
8742012-04-01 Jambunathan K <kjambunathan@gmail.com>
875
876 * org-lparse.el (org-lparse-do-convert): Replace `call-process'
877 with `shell-command-to-string'.
878
8792012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
880
881 * org-footnote.el (org-footnote-create-definition): Fix space
882 insertion when creating a new footnote. This fixes newline
883 munching when `org-footnote-section' is nil and blank lines
884 stacking when it isn't nil.
885
8862012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
887
888 * org-footnote.el (org-footnote-normalize): Make sure that
889 footnotes are moved to a single place during export.
890
8912012-04-01 Bastien Guerry <bzg@gnu.org>
892
893 * org.el (org-cycle-internal-global): Prevent the display of
894 messages when cycling from with a Gnus article buffer.
895
8962012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
897
898 * org-footnote.el (org-footnote-normalize): Ensure footnote
899 definition will be inserted at the end of the section
900 corresponding to to its first reference.
901
9022012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
903
904 * org-footnote.el (org-footnote-at-definition-p): Make sure to
905 move point at the beginning of the separator before skiping white
906 spaces. Refactor code.
907
9082012-04-01 Eric Schulte <eric.schulte@gmx.com>
909
910 * ob-exp.el (org-babel-exp-src-block): Strip noweb references on
911 export when "strip-export".
912
913 * ob.el (org-babel-common-header-args-w-values): New noweb
914 header value.
915 (org-babel-merge-params): New noweb header value.
916 (org-babel-noweb-p): New noweb header value.
917
9182012-04-01 Eric Schulte <eric.schulte@gmx.com>
919
920 * ob-tangle.el (org-babel-tangle-clean): Just use default value.
921
922 * ob.el (org-babel-noweb-wrap): Add default value.
923 (org-babel-expand-noweb-references): Just use default value.
924
9252012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
926
927 * org-exp.el (org-export-select-backend-specific-text): Always
928 preserve original indentation as a text property so that lists do
929 not get broken by indentation at column 0.
930
9312012-04-01 Eric Schulte <eric.schulte@gmx.com>
932
933 * ob.el (org-babel-expand-noweb-references): Don't allow newlines
934 in source names in noweb references.
935
9362012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
937
938 * org.el (org-fill-line-break-nobreak-p): New function.
939 (org-set-autofill-regexps): Add previous function to
940 `fill-nobreak-predicate'.
941
9422012-04-01 Vitalie Spinu <spinuvit@gmail.com>
943
944 * ob-R.el (org-babel-R-evaluate-session): Inhibit R evaluation
945 visibility regardless of local user customization.
946
9472012-04-01 Vitalie Spinu <spinuvit@gmail.com>
948
949 * ob-R.el (org-babel-R-evaluate-session): Inhibit R evaluation
950 visibility regardless of local user customization.
951
9522012-04-01 Carsten Dominik <carsten.dominik@gmail.com>
953
954 * org-inlinetask.el (org-inlinetask-show-first-star): New option.
955 (org-inlinetask-fontify): Honor `org-inlinetask-show-first-star'.
956
957 * org-indent.el (org-indent-set-line-properties): Honor
958 `org-inlinetask-show-first-star'.
959
9602012-04-01 Bastien Guerry <bzg@gnu.org>
961
962 * org.el (org-set-regexps-and-options): Ensure `org-drawers'
963 doesn't contain duplicates.
964
9652012-04-01 Bastien Guerry <bzg@gnu.org>
966
967 * org.el (org-at-drawer-p): Normalize the docstring to match other
968 `org-at-*-p' docstrings.
969 (org-indent-block, org-indent-drawer, org-at-block-p): New
970 functions.
971 (org-metaright): Use the new functions to indent a drawer or a
972 block depending on the context. Also update the docstring.
973
9742012-04-01 Bastien Guerry <bzg@gnu.org>
975
976 * org.el (org-set-regexps-and-options): Set the value of
977 `org-drawers' by adding the value of the infile #+DRAWERS option
978 to that of the existing `org-drawers'.
979
9802012-04-01 Bastien Guerry <bzg@gnu.org>
981
982 * org.el (org-cycle-internal-local): Fix bug: hide drawers in
983 inline tasks too.
984
9852012-04-01 Bastien Guerry <bzg@gnu.org>
986
987 * org-inlinetask.el (org-inlinetask-toggle-visibility): Use
988 `org-show-entry' instead of `outline-flag-region' to keep the
989 drawers folded when unfolding an inline task.
990
9912012-04-01 Torsten Anders <torsten.anders@beds.ac.uk> (tiny change)
992
993 * org-beamer.el (org-beamer-environments-default): Add support and
994 keybinding for the `exampleblock' environment.
995
9962012-04-01 Michael Brand <michael.ch.brand@gmail.com>
997
998 * org.el (org-open-link-from-string): Regard `reference-buffer'
999 when setting `org-inhibit-startup'.
1000
10012012-04-01 Eric Schulte <eric.schulte@gmx.com>
1002
1003 * ob-exp.el (org-babel-exp-non-block-elements): Don't insert extra
1004 space between inline src block and results on export.
1005
10062012-04-01 Eric Schulte <eric.schulte@gmx.com>
1007
1008 * ob.el (org-babel-get-inline-src-block-matches): Allow *any*
1009 punctuation to proceed an inline src block.
1010
10112012-04-01 Eric Schulte <eric.schulte@gmx.com>
1012
1013 * ob.el (org-babel-get-inline-src-block-matches): Add ( to the
1014 list of characters allowed to proceed an inline src block.
1015
10162012-04-01 Eric Schulte <eric.schulte@gmx.com>
1017
1018 * ob-tangle.el (org-babel-tangle-clean): Use the customizable
1019 noweb wrappers.
1020
1021 * ob.el (org-babel-noweb-wrap-start): Begin a noweb reference.
1022 (org-babel-noweb-wrap-end): End a noweb reference.
1023 (org-babel-noweb-wrap): Apply the customizable noweb wrappers.
1024 (org-babel-expand-noweb-references): Use the customizable noweb
1025 wrappers.
1026
10272012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
1028
1029 * org.el (org-beginning-of-line): Handle case when there's no
1030 character after box.
1031
10322012-04-01 Jambunathan K <kjambunathan@gmail.com>
1033
1034 * org-odt.el (org-odt-format-preamble): Don't insert TOC here.
1035 Delay it till the end of export.
1036 (org-odt-begin-document-body): Make a note of the default
1037 position of TOC in `org-lparse-dyn-first-heading-pos'.
1038 (org-odt-insert-toc): Insert TOC as directed by
1039 [TABLE-OF-CONTENTS] line or at the default position.
1040 (org-odt-end-export): Call `org-odt-insert-toc'.
1041
10422012-04-01 Bastien Guerry <bzg@gnu.org>
1043
1044 * org.el (org-preview-latex-fragment): Throw an error when called
1045 from a non-file buffer.
1046
10472012-04-01 Bastien Guerry <bzg@gnu.org>
1048
1049 * org.el (org-insert-property-drawer): Not an interactive
1050 command anymore.
1051 (org-insert-drawer): With a prefix argument, insert a property
1052 drawer. Check for headline within the region before inserting the
1053 drawer. Don't include special drawers in the completion table.
1054 (org-mode-map): New keybinding `C-c C-x d' for
1055 `org-insert-drawer'.
1056
10572012-04-01 Bastien Guerry <bzg@gnu.org>
1058
1059 * org.el (org-insert-drawer): Support completion over known drawer
1060 names and inserting a drawer around the current region.
1061
10622012-04-01 Bastien Guerry <bzg@gnu.org>
1063
1064 * org.el (org-insert-drawer): New function.
1065 (org-insert-property-drawer): Use it.
1066
10672012-04-01 Bastien Guerry <bzg@gnu.org>
1068
1069 * org-list.el (org-mark-list): New function.
1070
10712012-04-01 Bastien Guerry <bzg@gnu.org>
1072
1073 * org-pcomplete.el (pcomplete/org-mode/drawer): New function to
1074 complete drawer at point.
1075 (org-thing-at-point): Use it.
1076
10772012-04-01 Bastien Guerry <bzg@gnu.org>
1078
1079 * org.el (org-meta-return): Use `newline-and-indent' when in a
1080 property drawer.
1081
10822012-04-01 Bastien Guerry <bzg@gnu.org>
1083
1084 * org.el (org-structure-template-alist): Fix docstring: the
1085 feature is not experimental anymore.
1086
10872012-04-01 Bastien Guerry <bzg@gnu.org>
1088
1089 * org-agenda.el (org-agenda-show-and-scroll-up): Allow `C-u' to
1090 display the item without unfolding drawers and logbooks.
1091
10922012-04-01 Bastien Guerry <bzg@gnu.org>
1093
1094 * org-src.el (org-edit-src-code): Make sure `buffer-file-name' is
1095 always nil.
1096
10972012-04-01 Bastien Guerry <bzg@gnu.org>
1098
1099 * org.el (org-structure-template-alist): Fix missing angle
1100 brackets for muse export style.
1101
11022012-04-01 Bastien Guerry <bzg@gnu.org>
1103
1104 * org.el (org-read-date): New parameter `inactive' when reading
1105 for insertion of inactive timestamps.
1106 (org-time-stamp, org-read-date-display): Use the new
1107 parameter.
1108
11092012-04-01 Eric Schulte <eric.schulte@gmx.com>
1110
1111 * ob.el (org-babel-expand-noweb-references): Only allow
1112 reference names which start and end with non-whitespace characters.
1113 Also, raise errors as appropriate given org-babel-noweb-error-langs.
1114
11152012-04-01 Bastien Guerry <bzg@gnu.org>
1116
1117 * org-src.el (org-src-in-org-buffer): Save and restore
1118 `buffer-undo-list' after editing.
1119
11202012-04-01 Eric Schulte <eric.schulte@gmx.com>
1121
1122 * ob.el (org-babel-common-header-args-w-values): Add new header
1123 argument.
1124 (org-babel-expand-noweb-references): Use header argument rather than
1125 customization variable.
1126
11272012-04-01 David Maus <dmaus@ictsoc.de>
1128
1129 * org-capture.el (org-capture-place-item): Don't search for
1130 position in existing list if :exact-position was supplied.
1131
11322012-04-01 Eric Schulte <eric.schulte@gmx.com>
1133
1134 * ob.el (org-babel-noweb-separator): Custom variable for
1135 accumulated noweb references.
1136 (org-babel-expand-noweb-references): Allow separator for noweb
1137 references.
1138
11392012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
1140
1141 * org.el (org-beginning-of-line): In an item, special position
1142 for C-a is after check-box, if any.
1143 (org-special-ctrl-a/e): Modify doc-string accordingly.
1144
11452012-04-01 Jambunathan K <kjambunathan@gmail.com>
1146
1147 * org-odt.el (org-export-odt-format-formula): Use :style
1148 property to specify custom table styles.
1149
11502012-04-01 Eric Schulte <eric.schulte@gmx.com>
1151
1152 * ob-exp.el (org-babel-exp-call-line-template): Control export of
1153 additional call line information.
1154 (org-babel-exp-non-block-elements): Fancier call line export.
1155
11562012-04-01 Jambunathan K <kjambunathan@gmail.com>
1157
1158 * org-odt.el (org-odt-entity-frame-styles): Add frame params
1159 for images that are anchored as character.
1160 (org-export-odt-format-image): Handle new anchor type
1161 "as-char".
1162 (org-export-odt-default-image-sizes-alist): Misc. change.
1163 (org-export-odt-format-formula): Misc. change.
1164
11652012-04-01 Eric Schulte <eric.schulte@gmx.com>
1166
1167 * ob.el (org-babel-check-src-block): Don't report valid header
1168 arguments as suspicious.
1169
11702012-04-01 Eric Schulte <eric.schulte@gmx.com>
1171
1172 * ob-exp.el (org-babel-exp-non-block-elements): Map over both
1173 inline src blocks and call lines on export.
1174
11752012-04-01 Jambunathan K <kjambunathan@gmail.com>
1176
1177 * org-odt.el (org-odt-label-styles): Add a new style.
1178 (org-odt-category-map-alist): Use it.
1179
11802012-04-01 Jambunathan K <kjambunathan@gmail.com>
1181
1182 * org-odt.el (org-odt-table-style-format): New. Template for
1183 auto-generated table styles.
1184 (org-odt-automatic-styles, org-odt-object-counters): New
1185 variables.
1186 (org-odt-add-automatic-style): New function.
1187 (org-odt-write-automatic-styles): New function. Create
1188 automatic styles for tables that have custom :rel-width.
1189 (org-odt-begin-table): Parse attributes specified with
1190 "#+ATTR_ODT: " option and use it to create an automatic table
1191 style.
1192 (org-odt-save-as-outfile): Call
1193 `org-odt-add-write-automatic-styles'.
1194 (org-odt-init-outfile): Init newly add variables.
1195 (org-odt-section-count): Remove it.
1196 (org-odt-begin-section): Use `org-odt-add-automatic-style' to
1197 generate an automatic section name.
1198
11992012-04-01 Eric Schulte <eric.schulte@gmx.com>
1200
1201 * ob.el (org-babel-map-executables): Correctly position point when
1202 mapping hits an inline code block.
1203
12042012-04-01 Eric Schulte <eric.schulte@gmx.com>
1205
1206 * ob.el (org-babel-execute-src-block): Ensure params are
1207 incorporated *before* checking if evaluation is legal.
1208
12092012-04-01 Eric Schulte <eric.schulte@gmx.com>
1210
1211 * ob-exp.el (org-babel-exp-lob-one-liners): Ensure `end' is a
1212 marker so it is updated as required during export.
1213
12142012-04-01 Eric Schulte <eric.schulte@gmx.com>
1215
1216 * org-src.el (org-src-in-org-buffer): Run commands in the parent
1217 buffer.
1218 (org-edit-src-save): Use new macro.
1219 (org-src-tangle): Tangle the parent buffer.
1220
12212012-04-01 Bastien Guerry <bzg@gnu.org>
1222
1223 * org.el (org-set-font-lock-defaults): Fix bug in done
1224 headline fontification.
1225
12262012-04-01 Bastien Guerry <bzg@gnu.org>
1227
1228 * org.el (org-set-font-lock-defaults): Fix bug in done
1229 headline fontification.
1230
12312012-04-01 Bastien Guerry <bzg@gnu.org>
1232
1233 * org.el (org-return): Act normally when in code blocks.
1234
12352012-04-01 Bastien Guerry <bzg@gnu.org>
1236
1237 * org.el (org-in-src-block-p): New function.
1238 (org-context): Return new contexts :clocktable and :src-block.
1239
12402012-04-01 Bastien Guerry <bzg@gnu.org>
1241
1242 * org.el (org-set-tags-command, org-set-tags): Make ̀C-u C-c
1243 C-q' do the right thing even when point is before the first
1244 heading.
1245
12462012-04-01 Eric Schulte <eric.schulte@gmx.com>
1247
1248 * ob.el (org-babel-noweb-p): Disambiguate intersection name.
1249
12502012-04-01 Jambunathan K <kjambunathan@gmail.com>
1251
1252 * org-odt.el (org-odt-format-textbox): Honor user-specified
1253 width in captioned images.
1254
12552012-04-01 Eric Schulte <eric.schulte@gmx.com>
1256
1257 * ob.el (org-babel-map-src-blocks): Replace gensym with make-symbol.
1258 (org-babel-map-inline-src-blocks): Replace gensym with make-symbol.
1259 (org-babel-map-call-lines): Replace gensym with make-symbol.
1260 (org-babel-map-executables): Replace gensym with make-symbol.
1261
12622012-04-01 Eric Schulte <eric.schulte@gmx.com>
1263
1264 * ob-exp.el (org-babel-exp-results): Alter a copy of info.
1265
12662012-04-01 Bastien Guerry <bzg@gnu.org>
1267
1268 * org-html.el (org-export-as-html): Initialize
1269 `html-pre-real-contents' correctly.
1270
12712012-04-01 Bastien Guerry <bzg@gnu.org>
1272
1273 * org-html.el (org-export-as-html): Initialize
1274 `html-pre-real-contents' correctly.
1275
12762012-04-01 Eric Schulte <eric.schulte@gmx.com>
1277
1278 * ob-exp.el (org-babel-exp-code): Ensure code block name is a
1279 string on export.
1280
12812012-04-01 Eric Schulte <eric.schulte@gmx.com>
1282
1283 * ob-exp.el (org-babel-exp-code-template): Customizable code
1284 block export format string.
1285 (org-babel-exp-code): Customizable code block export.
1286
12872012-04-01 Eric Schulte <eric.schulte@gmx.com>
1288
1289 * ob-clojure.el (org-babel-execute:clojure): Removed dependency
1290 on deprecated swank-clojure.
1291
12922012-04-01 Eric Schulte <eric.schulte@gmx.com>
1293
1294 * ob.el (org-babel-map-src-blocks): Don't pollute symbol space.
1295 (org-babel-map-inline-src-blocks): Don't pollute symbol space.
1296 (org-babel-map-call-lines): Don't pollute symbol space.
1297 (org-babel-map-executables): Map over *all* executable Org-mode
1298 elements.
1299 (org-babel-execute-buffer): Execute elements in buffer order instead
1300 of arbitrarily.
1301
13022012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
1303
1304 * org.el (org-ctrl-c-ctrl-c): Fix a naive structure backup.
1305 Those must be done with `copy-tree'.
1306
13072012-04-01 Eric Schulte <eric.schulte@gmx.com>
1308
1309 * org-src.el (org-edit-src-code): Referenced code block should
1310 not be evaluated on code block edit.
1311
13122012-04-01 Bastien Guerry <bzg@gnu.org>
1313
1314 * org.el (org-structure-template-alist): Use uppercase for
1315 keywords.
1316
13172012-04-01 Eric Schulte <eric.schulte@gmx.com>
1318
1319 * ob.el (org-babel-insert-result): Capitalize RESULTS in :wrap'd
1320 code block results.
1321
13222012-04-01 Eric Schulte <eric.schulte@gmx.com>
1323
1324 * ob.el (org-babel-results-keyword): New user-configurable
1325 results keyword.
1326 (org-babel-where-is-src-block-result): Use new user-configurable
1327 results keyword.
1328
13292012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
1330
1331 * org-indent.el (org-indent-refresh-maybe): Check for new
1332 headlines from the beginning of the line to be sure to catch
1333 any newly inserted headline there.
1334
13352012-04-01 Eric Schulte <eric.schulte@gmx.com>
1336
1337 * ob-exp.el (org-babel-exp-src-block): Use `org-babel-noweb-p'.
1338 (org-babel-exp-inline-src-blocks): Use `org-babel-noweb-p'.
1339
1340 * ob-tangle.el (org-babel-tangle-collect-blocks): Use
1341 `org-babel-noweb-p'.
1342
1343 * ob.el (org-babel-execute-src-block): Use `org-babel-noweb-p'.
1344 (org-babel-expand-src-block): Use `org-babel-noweb-p'.
1345 (org-babel-load-in-session): Use `org-babel-noweb-p'.
1346 (org-babel-merge-params): Use `org-babel-noweb-p'.
1347 (org-babel-noweb-p): New function used to determine if noweb
1348 expansion should be carried out in a given context.
1349
13502012-04-01 Eric Schulte <eric.schulte@gmx.com>
1351
1352 * org.el (org-update-property-plist): Fix bug in property list
1353 updates.
1354
13552012-04-01 François Pinard <pinard@iro.umontreal.ca> (tiny change)
1356
1357 * org.el (org-kill-line): Use `kill-visual-line' in
1358 `visual-line-mode'.
1359
13602012-04-01 Bernt Hansen <bernt@norang.ca>
1361
1362 * org-agenda.el (org-agenda-switch-to): Widen org buffer only if point is
1363 outside the current restriction
1364
13652012-04-01 Bernt Hansen <bernt@norang.ca>
1366
1367 * org-agenda.el (org-agenda-clock-in): Save restriction when clocking in from the agenda
1368
13692012-04-01 Bernt Hansen <bernt@norang.ca>
1370
1371 * org.el: Honour existing restrictions when regenerating the agenda
1372
13732012-04-01 Bastien Guerry <bzg@gnu.org>
1374
1375 * org-agenda.el: New alias for `list-diary-entries-hook'.
1376
13772012-04-01 Eric Schulte <eric.schulte@gmx.com>
1378
1379 * ob.el (org-babel-common-header-args-w-values): Add the new
1380 header argument name.
1381 (org-babel-insert-result): Respect the value of the :wrap header
1382 argument when inserting results.
1383 (org-babel-result-end): Find the end of arbitrarily named result
1384 blocks.
1385
13862012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
1387
1388 * org-indent.el (org-indent-refresh-maybe): Check for new
1389 headlines from the beginning of the line to be sure to catch
1390 any newly inserted headline there.
1391
13922012-04-01 Eric Schulte <eric.schulte@gmx.com>
1393
1394 * org.el (org-update-property-plist): Remove old instances of
1395 property when adding a new value for property.
1396
13972012-04-01 Martyn Jago <martyn.jago@btinternet.com>
1398
1399 * ob-emacs-lisp.el: A comment on the last line of an emacs-lisp
1400 code block would cause an error when the block is was executed. This
1401 fix cures this behaviour.
1402
14032012-04-01 Eric Schulte <eric.schulte@gmx.com>
1404
1405 * ob.el (org-babel-expand-noweb-references): Resurrect dropped
1406 pieces of a previous patch.
1407
14082012-04-01 Eric Schulte <eric.schulte@gmx.com>
1409
1410 * ob-maxima.el (org-babel-execute:maxima): Fix compiler warning.
1411
14122012-04-01 Eric Schulte <eric.schulte@gmx.com>
1413
1414 * ob.el (org-babel-expand-noweb-references): Resurrect dropped
1415 pieces of a previous patch.
1416
14172012-04-01 Eric Schulte <eric.schulte@gmx.com>
1418
1419 * ob-maxima.el (org-babel-execute:maxima): Fix compiler warning.
1420
14212012-04-01 Bastien Guerry <bzg@gnu.org>
1422
1423 * org-eshell.el (org-eshell-open): Use (goto-char (point-max))
1424 instead of (end-of-buffer).
1425
14262012-04-01 Bastien Guerry <bzg@gnu.org>
1427
1428 * org-bbdb.el (name): Declare variable.
1429 (bbdb-record-get-field, bbdb-search-name)
1430 (bbdb-search-organization): Declare as part of ext:bbdb.
1431
14322012-04-01 Bastien Guerry <bzg@gnu.org>
1433
1434 * org-mobile.el (org-mobile-push): Use `org-agenda-tag-filter'
1435 instead of the obsolete `org-agenda-filter'.
1436
14372012-04-01 Bastien Guerry <bzg@gnu.org>
1438
1439 * org-agenda.el: Add an alias for `org-agenda-filter'.
1440 (diary-list-entries-hook): Use the non-obsolete hook.
1441 (org-agenda-filter-apply): Silent compiler warning.
1442
14432012-04-01 Bastien Guerry <bzg@gnu.org>
1444
1445 * ob-ditaa.el (org-ditaa-jar-path): Make a defcustom.
1446 (org-ditaa-jar-option): New option.
1447 (org-babel-execute:ditaa): Use it.
1448
14492012-04-01 Eric Schulte <eric.schulte@gmx.com>
1450
1451 * ob.el (org-babel-balanced-split): Explicit checking if list
1452 before calling member.
1453
14542012-04-01 Eric Schulte <eric.schulte@gmx.com>
1455
1456 * ob.el (org-babel-balanced-split): Explicit checking if list
1457 before calling member.
1458
12012-02-14 Chong Yidong <cyd@gnu.org> 14592012-02-14 Chong Yidong <cyd@gnu.org>
2 1460
3 * org-footnote.el: Remove bogus defvar values (Bug#10745). 1461 * org-footnote.el: Remove bogus defvar values (Bug#10745).
@@ -8296,7 +9754,7 @@
8296 Remove hard-wired configuration of minted export 9754 Remove hard-wired configuration of minted export
8297 (org-export-latex-minted-with-line-numbers): Remove variable. 9755 (org-export-latex-minted-with-line-numbers): Remove variable.
8298 9756
82992010-12-11 Bastien Guerry <bzg@altern.org> 97572010-12-11 Bastien Guerry <bzg@gnu.org>
8300 9758
8301 * org-clock.el (org-dblock-write:clocktable): Fix double 9759 * org-clock.el (org-dblock-write:clocktable): Fix double
8302 reference to `link' in let construct. 9760 reference to `link' in let construct.
@@ -9690,7 +11148,7 @@
9690 * org.el (org-make-link-string): Don't escape characters in link 11148 * org.el (org-make-link-string): Don't escape characters in link
9691 type. 11149 type.
9692 11150
96932010-11-11 Bastien Guerry <bzg@altern.org> 111512010-11-11 Bastien Guerry <bzg@gnu.org>
9694 11152
9695 * org-capture.el (org-capture-templates): Update docstring to 11153 * org-capture.el (org-capture-templates): Update docstring to
9696 advertise %:org-date. 11154 advertise %:org-date.
@@ -9775,7 +11233,7 @@
9775 * ob-keys.el (org-babel-key-bindings): Key bindings for block 11233 * ob-keys.el (org-babel-key-bindings): Key bindings for block
9776 demarcation. 11234 demarcation.
9777 11235
97782010-11-11 Bastien Guerry <bzg@altern.org> 112362010-11-11 Bastien Guerry <bzg@gnu.org>
9779 11237
9780 * org.el (org-link-types): Add the "message" link type. 11238 * org.el (org-link-types): Add the "message" link type.
9781 11239
@@ -9784,7 +11242,7 @@
9784 * org.el (org-link-types): Add 'message:' link type to default 11242 * org.el (org-link-types): Add 'message:' link type to default
9785 link types. 11243 link types.
9786 11244
97872010-11-11 Bastien Guerry <bzg@altern.org> 112452010-11-11 Bastien Guerry <bzg@gnu.org>
9788 11246
9789 * org-gnus.el (org-gnus-store-link): Add the :date property to 11247 * org-gnus.el (org-gnus-store-link): Add the :date property to
9790 gnus links, allowing the use of %:date in capture templates. 11248 gnus links, allowing the use of %:date in capture templates.
@@ -10017,7 +11475,7 @@
10017 * org.el (org-src-fontify-natively): Set to nil by default. 11475 * org.el (org-src-fontify-natively): Set to nil by default.
10018 Supply cutomize interface. 11476 Supply cutomize interface.
10019 11477
100202010-11-11 Bastien Guerry <bzg@altern.org> 114782010-11-11 Bastien Guerry <bzg@gnu.org>
10021 11479
10022 * org-ascii.el (org-export-as-ascii): Fix bug in ASCII export: use 11480 * org-ascii.el (org-export-as-ascii): Fix bug in ASCII export: use
10023 `org-bracket-link-analytic-regexp++' to match the link type. 11481 `org-bracket-link-analytic-regexp++' to match the link type.
@@ -11275,7 +12733,7 @@
11275 (org-org-menu): Remove the entry to configure LaTeX snippet 12733 (org-org-menu): Remove the entry to configure LaTeX snippet
11276 processing. 12734 processing.
11277 12735
112782010-11-11 Bastien Guerry <bzg@altern.org> 127362010-11-11 Bastien Guerry <bzg@gnu.org>
11279 12737
11280 * org-agenda.el (org-agenda-clock-goto): Use `\C-c\C-x\C-j' for 12738 * org-agenda.el (org-agenda-clock-goto): Use `\C-c\C-x\C-j' for
11281 `org-clock-goto' and `J' for `org-agenda-clock-goto'. If the 12739 `org-clock-goto' and `J' for `org-agenda-clock-goto'. If the
@@ -12111,7 +13569,7 @@
12111 * org-html.el (org-export-html-close-lists-maybe): Check if raw 13569 * org-html.el (org-export-html-close-lists-maybe): Check if raw
12112 HTML stuff was actually made from an example. 13570 HTML stuff was actually made from an example.
12113 13571
121142010-07-19 Bastien Guerry <bzg@altern.org> 135722010-07-19 Bastien Guerry <bzg@gnu.org>
12115 13573
12116 * org-latex.el: Items are no longer skipped when their first line 13574 * org-latex.el: Items are no longer skipped when their first line
12117 ends on a protected element. 13575 ends on a protected element.
@@ -12124,18 +13582,18 @@
12124 * org-exp-blocks.el (org-export-blocks-preprocess): 13582 * org-exp-blocks.el (org-export-blocks-preprocess):
12125 Cleanup trailing newline after block. 13583 Cleanup trailing newline after block.
12126 13584
121272010-07-19 Bastien Guerry <bzg@altern.org> 135852010-07-19 Bastien Guerry <bzg@gnu.org>
12128 13586
12129 * org-exp.el: Comment regexp now matches documentation. No more 13587 * org-exp.el: Comment regexp now matches documentation. No more
12130 protection check when deleting comments before export. 13588 protection check when deleting comments before export.
12131 13589
121322010-07-19 Bastien Guerry <bzg@altern.org> 135902010-07-19 Bastien Guerry <bzg@gnu.org>
12133 13591
12134 * org-exp.el (org-export-preprocess-string): 13592 * org-exp.el (org-export-preprocess-string):
12135 Now using `org-export-handle-include-files-recurse' to resolve 13593 Now using `org-export-handle-include-files-recurse' to resolve
12136 included files. 13594 included files.
12137 13595
121382010-07-19 Bastien Guerry <bzg@altern.org> 135962010-07-19 Bastien Guerry <bzg@gnu.org>
12139 13597
12140 * org-agenda.el (org-agenda-get-deadlines) 13598 * org-agenda.el (org-agenda-get-deadlines)
12141 (org-agenda-get-scheduled): 13599 (org-agenda-get-scheduled):
@@ -12146,7 +13604,7 @@
12146 now instead of resetting on the cyclic repeating date. This makes it 13604 now instead of resetting on the cyclic repeating date. This makes it
12147 much more obvious when you missed a repeating task after the repeater. 13605 much more obvious when you missed a repeating task after the repeater.
12148 13606
121492010-07-19 Bastien Guerry <bzg@altern.org> 136072010-07-19 Bastien Guerry <bzg@gnu.org>
12150 13608
12151 * org-exp.el (org-export-mark-blockquote-verse-center): 13609 * org-exp.el (org-export-mark-blockquote-verse-center):
12152 Consider environments that end at eob. 13610 Consider environments that end at eob.
@@ -12186,16 +13644,16 @@
12186 from latex backend specific instructions (#+LaTeX) are already 13644 from latex backend specific instructions (#+LaTeX) are already
12187 protected and won't be treated as normal environments. 13645 protected and won't be treated as normal environments.
12188 13646
121892010-07-19 Bastien Guerry <bzg@altern.org> 136472010-07-19 Bastien Guerry <bzg@gnu.org>
12190 13648
12191 * org-timer.el (org-timer-set-timer): Fix typo in the docstring. 13649 * org-timer.el (org-timer-set-timer): Fix typo in the docstring.
12192 13650
121932010-07-19 Bastien Guerry <bzg@altern.org> 136512010-07-19 Bastien Guerry <bzg@gnu.org>
12194 13652
12195 * org-timer.el (org-timer-set-timer): Use a prefix argument. 13653 * org-timer.el (org-timer-set-timer): Use a prefix argument.
12196 See the docstring of the function. 13654 See the docstring of the function.
12197 13655
121982010-07-19 Bastien Guerry <bzg@altern.org> 136562010-07-19 Bastien Guerry <bzg@gnu.org>
12199 13657
12200 * org-timer.el (org-timer-set-timer): Fix bug about canceling 13658 * org-timer.el (org-timer-set-timer): Fix bug about canceling
12201 timers. 13659 timers.
@@ -12216,7 +13674,7 @@
12216 t before calling `org-clock-out', so that that function can 13674 t before calling `org-clock-out', so that that function can
12217 know its call context. 13675 know its call context.
12218 13676
122192010-07-19 Bastien Guerry <bzg@altern.org> 136772010-07-19 Bastien Guerry <bzg@gnu.org>
12220 13678
12221 * org-timer.el (org-timer-default-timer): New variable. 13679 * org-timer.el (org-timer-default-timer): New variable.
12222 (org-timer-set-timer): Use the new variable. Also offer the 13680 (org-timer-set-timer): Use the new variable. Also offer the
@@ -12666,7 +14124,7 @@
12666 * org-compat.el (org-overlays-at): Function removed. 14124 * org-compat.el (org-overlays-at): Function removed.
12667 (org-overlays-in): Function removed. 14125 (org-overlays-in): Function removed.
12668 14126
126692010-07-19 Bastien Guerry <bzg@altern.org> 141272010-07-19 Bastien Guerry <bzg@gnu.org>
12670 14128
12671 * org-clock.el (org-clock-set-current): Just return the headline 14129 * org-clock.el (org-clock-set-current): Just return the headline
12672 itself, strip the TODO keyword, the priority cookie and the tags. 14130 itself, strip the TODO keyword, the priority cookie and the tags.
@@ -12912,7 +14370,7 @@
12912 * org-publish.el (org-publish-aux-preprocess): Control case 14370 * org-publish.el (org-publish-aux-preprocess): Control case
12913 sensitivity. 14371 sensitivity.
12914 14372
129152010-04-10 Bastien Guerry <bzg@altern.org> 143732010-04-10 Bastien Guerry <bzg@gnu.org>
12916 14374
12917 * org.el (org-splice-latex-header): Fix typo. 14375 * org.el (org-splice-latex-header): Fix typo.
12918 14376
@@ -13400,7 +14858,7 @@
13400 restricted, as an agenda mode. 14858 restricted, as an agenda mode.
13401 (org-agenda-fontify-priorities): Allow simple colors as values. 14859 (org-agenda-fontify-priorities): Allow simple colors as values.
13402 14860
134032010-04-10 Bastien Guerry <bzg@altern.org> 148612010-04-10 Bastien Guerry <bzg@gnu.org>
13404 14862
13405 * org-timer.el (org-timer-current-timer): Rename from 14863 * org-timer.el (org-timer-current-timer): Rename from
13406 `org-timer-last-timer'. 14864 `org-timer-last-timer'.
@@ -13418,7 +14876,7 @@
13418 * org-exp.el (org-export-format-source-code-or-example): 14876 * org-exp.el (org-export-format-source-code-or-example):
13419 Fix textarea tag. 14877 Fix textarea tag.
13420 14878
134212010-04-10 Bastien Guerry <bzg@altern.org> 148792010-04-10 Bastien Guerry <bzg@gnu.org>
13422 14880
13423 * org-clock.el (org-clock-current-task): New variable to store 14881 * org-clock.el (org-clock-current-task): New variable to store
13424 last clocked in task. 14882 last clocked in task.
@@ -14733,7 +16191,7 @@
14733 (org-columns-compile-format): Support the additional parameter in 16191 (org-columns-compile-format): Support the additional parameter in
14734 org-columns-compile-map. 16192 org-columns-compile-map.
14735 16193
147362009-11-13 Bastien Guerry <bzg@altern.org> 161942009-11-13 Bastien Guerry <bzg@gnu.org>
14737 16195
14738 * org.el (org-mode-hook): Turn `org-mode-hook' into a customizable 16196 * org.el (org-mode-hook): Turn `org-mode-hook' into a customizable
14739 variable. 16197 variable.
@@ -15402,7 +16860,7 @@
15402 * org.el (org-shifttab): Interpret arg differently when using only 16860 * org.el (org-shifttab): Interpret arg differently when using only
15403 odd levels. 16861 odd levels.
15404 16862
154052009-10-01 Bastien Guerry <bzg@altern.org> 168632009-10-01 Bastien Guerry <bzg@gnu.org>
15406 16864
15407 * org.el (org-check-agenda-file): Use a more explicit message. 16865 * org.el (org-check-agenda-file): Use a more explicit message.
15408 16866
@@ -15411,7 +16869,7 @@
15411 * org-exp.el (org-export-remove-special-table-lines): Don't remove 16869 * org-exp.el (org-export-remove-special-table-lines): Don't remove
15412 normal lines. 16870 normal lines.
15413 16871
154142009-10-01 Bastien Guerry <bzg@altern.org> 168722009-10-01 Bastien Guerry <bzg@gnu.org>
15415 16873
15416 * org.el (org-offer-links-in-entry): Don't use "Select link" as a 16874 * org.el (org-offer-links-in-entry): Don't use "Select link" as a
15417 prompt in the temporary window. 16875 prompt in the temporary window.
@@ -15622,7 +17080,7 @@
15622 * org-gnus.el (org-gnus-store-link): Restore the linking to a 17080 * org-gnus.el (org-gnus-store-link): Restore the linking to a
15623 website. 17081 website.
15624 17082
156252009-09-02 Bastien Guerry <bzg@altern.org> 170832009-09-02 Bastien Guerry <bzg@gnu.org>
15626 17084
15627 * org-latex.el (org-export-latex-first-lines): Bugfix. 17085 * org-latex.el (org-export-latex-first-lines): Bugfix.
15628 17086
@@ -15766,7 +17224,7 @@
15766 (org-remember-apply-template): Use `org-remember-escaped-%' to 17224 (org-remember-apply-template): Use `org-remember-escaped-%' to
15767 detect escaped % signs. 17225 detect escaped % signs.
15768 17226
157692009-09-02 Bastien Guerry <bzg@altern.org> 172272009-09-02 Bastien Guerry <bzg@gnu.org>
15770 17228
15771 * org-timer.el (org-timer-set-timer): Use `org-notify' and play a 17229 * org-timer.el (org-timer-set-timer): Use `org-notify' and play a
15772 sound when showing the notification. 17230 sound when showing the notification.
@@ -15900,7 +17358,7 @@
15900 * org-exp.el (org-export-format-source-code-or-example): 17358 * org-exp.el (org-export-format-source-code-or-example):
15901 Use listing package if requested by the user. 17359 Use listing package if requested by the user.
15902 17360
159032009-09-02 Bastien Guerry <bzg@altern.org> 173612009-09-02 Bastien Guerry <bzg@gnu.org>
15904 17362
15905 * org.el (org-iswitchb): Fix bug when aborting the `org-iswitchb' 17363 * org.el (org-iswitchb): Fix bug when aborting the `org-iswitchb'
15906 command before actually switching to a buffer. 17364 command before actually switching to a buffer.
@@ -16134,14 +17592,14 @@
16134 * org-macs.el (org-unmodified): Turn of modification hooks while 17592 * org-macs.el (org-unmodified): Turn of modification hooks while
16135 running this macro. 17593 running this macro.
16136 17594
161372009-08-06 Bastien Guerry <bzg@altern.org> 175952009-08-06 Bastien Guerry <bzg@gnu.org>
16138 17596
16139 * org.el (org-adapt-indentation): Slightly improve the docstring. 17597 * org.el (org-adapt-indentation): Slightly improve the docstring.
16140 (org-occur): Sends an error when the user inputs an empty string. 17598 (org-occur): Sends an error when the user inputs an empty string.
16141 (org-priority): Bugfix: the tag alignement should happen within 17599 (org-priority): Bugfix: the tag alignement should happen within
16142 save-excursion. 17600 save-excursion.
16143 17601
161442009-08-06 Bastien Guerry <bzg@altern.org> 176022009-08-06 Bastien Guerry <bzg@gnu.org>
16145 17603
16146 * org.el (org-make-link-regexps): Don't exclude parentheses from 17604 * org.el (org-make-link-regexps): Don't exclude parentheses from
16147 `org-plain-link-re'. 17605 `org-plain-link-re'.
@@ -16155,7 +17613,7 @@
16155 * org-clock.el (org-clock-in): Bugfix: recognize timestamps with 17613 * org-clock.el (org-clock-in): Bugfix: recognize timestamps with
16156 an abbreviated format for days. 17614 an abbreviated format for days.
16157 17615
161582009-08-06 Bastien Guerry <bzg@altern.org> 176162009-08-06 Bastien Guerry <bzg@gnu.org>
16159 17617
16160 * org-protocol.el (org-protocol-default-template-key): 17618 * org-protocol.el (org-protocol-default-template-key):
16161 New option. 17619 New option.
@@ -16172,7 +17630,7 @@
16172 (org-update-parent-todo-statistics): Possibly use the new allowed 17630 (org-update-parent-todo-statistics): Possibly use the new allowed
16173 value of `org-provide-todo-statistics'. 17631 value of `org-provide-todo-statistics'.
16174 17632
161752009-08-06 Bastien Guerry <bzg@altern.org> 176332009-08-06 Bastien Guerry <bzg@gnu.org>
16176 17634
16177 * org-timer.el: Add autoload cookie. 17635 * org-timer.el: Add autoload cookie.
16178 17636
@@ -16197,7 +17655,7 @@
16197 (org-update-parent-todo-statistics): Possibly use the new 17655 (org-update-parent-todo-statistics): Possibly use the new
16198 'all-headline value from `org-provide-todo-statistics'. 17656 'all-headline value from `org-provide-todo-statistics'.
16199 17657
162002009-08-06 Bastien Guerry <bzg@altern.org> 176582009-08-06 Bastien Guerry <bzg@gnu.org>
16201 17659
16202 * org-clock.el (org-dblock-write:clocktable): Add a new option 17660 * org-clock.el (org-dblock-write:clocktable): Add a new option
16203 :timestamp which allows display of timestamps in clock reports. 17661 :timestamp which allows display of timestamps in clock reports.
@@ -16213,7 +17671,7 @@
16213 * org.el (org-eval-in-calendar): Select the right frame. 17671 * org.el (org-eval-in-calendar): Select the right frame.
16214 (org-save-frame-excursion): Remove this macro. 17672 (org-save-frame-excursion): Remove this macro.
16215 17673
162162009-08-06 Bastien Guerry <bzg@altern.org> 176742009-08-06 Bastien Guerry <bzg@gnu.org>
16217 17675
16218 * org-list.el (org-list-beginning-re): Bugfix: don't use * when 17676 * org-list.el (org-list-beginning-re): Bugfix: don't use * when
16219 trying to find the beginning of a list. 17677 trying to find the beginning of a list.
@@ -16227,7 +17685,7 @@
16227 (org-id-method): Use `org-id-uuid-program'. 17685 (org-id-method): Use `org-id-uuid-program'.
16228 (org-id-new): Use `org-id-uuid-program'. 17686 (org-id-new): Use `org-id-uuid-program'.
16229 17687
162302009-08-06 Bastien Guerry <bzg@altern.org> 176882009-08-06 Bastien Guerry <bzg@gnu.org>
16231 17689
16232 * org-exp.el (org-export-number-lines): Allow whitespace in code 17690 * org-exp.el (org-export-number-lines): Allow whitespace in code
16233 references. Allow the -r switch to remove the references in the 17691 references. Allow the -r switch to remove the references in the
@@ -16240,18 +17698,18 @@
16240 * org-clock.el (org-show-notification-handler): New option. 17698 * org-clock.el (org-show-notification-handler): New option.
16241 (org-show-notification): Use the new option. 17699 (org-show-notification): Use the new option.
16242 17700
162432009-08-06 Bastien Guerry <bzg@altern.org> 177012009-08-06 Bastien Guerry <bzg@gnu.org>
16244 17702
16245 * org.el (org-eval-in-calendar): Fix a bug about calendar 17703 * org.el (org-eval-in-calendar): Fix a bug about calendar
16246 navigation when `calendar-setup' value is 'calendar-only. 17704 navigation when `calendar-setup' value is 'calendar-only.
16247 17705
162482009-08-06 Bastien Guerry <bzg@altern.org> 177062009-08-06 Bastien Guerry <bzg@gnu.org>
16249 17707
16250 * org.el (orgstruct++-mode): Fix typo in docstring. 17708 * org.el (orgstruct++-mode): Fix typo in docstring.
16251 (org-insert-link): Clean up: (or (...)) => (...) 17709 (org-insert-link): Clean up: (or (...)) => (...)
16252 (org-insert-link): Use TAB for stored links completion. 17710 (org-insert-link): Use TAB for stored links completion.
16253 17711
162542009-08-06 Bastien Guerry <bzg@altern.org> 177122009-08-06 Bastien Guerry <bzg@gnu.org>
16255 17713
16256 * org.el (org-get-refile-targets): Fix bug: don't ignore case when 17714 * org.el (org-get-refile-targets): Fix bug: don't ignore case when
16257 building the list of targets. 17715 building the list of targets.
@@ -16268,12 +17726,12 @@
16268 * org-plot.el (org-plot/gnuplot): Run with an idle timer to avoid 17726 * org-plot.el (org-plot/gnuplot): Run with an idle timer to avoid
16269 premature deletion of the data when using org-plot in a script. 17727 premature deletion of the data when using org-plot in a script.
16270 17728
162712009-08-06 Bastien Guerry <bzg@altern.org> 177292009-08-06 Bastien Guerry <bzg@gnu.org>
16272 17730
16273 * org-clock.el (org-clock-in-prepare-hook): New hook. 17731 * org-clock.el (org-clock-in-prepare-hook): New hook.
16274 (org-clock-in): Use this new hook. 17732 (org-clock-in): Use this new hook.
16275 17733
162762009-08-06 Bastien Guerry <bzg@altern.org> 177342009-08-06 Bastien Guerry <bzg@gnu.org>
16277 17735
16278 * org.el (org-special-ctrl-a/e): Explicitly bind the value 17736 * org.el (org-special-ctrl-a/e): Explicitly bind the value
16279 'reversed for this option to the "true line boundary first" 17737 'reversed for this option to the "true line boundary first"
@@ -17307,7 +18765,7 @@
17307 18765
17308 * org-exp.el (org-export-splice-attributes): New function. 18766 * org-exp.el (org-export-splice-attributes): New function.
17309 18767
173102009-08-06 Bastien Guerry <bzg@altern.org> 187682009-08-06 Bastien Guerry <bzg@gnu.org>
17311 Daniel M German <dmg@uvic.org> 18769 Daniel M German <dmg@uvic.org>
17312 Sebastian Rose <sebastian_rose@gmx.de> 18770 Sebastian Rose <sebastian_rose@gmx.de>
17313 Ross Patterson <me@rpatterson.net> 18771 Ross Patterson <me@rpatterson.net>
@@ -17518,7 +18976,7 @@
17518 18976
17519 * org-exp.el (org-export-as-ascii): Improve export of plain lists. 18977 * org-exp.el (org-export-as-ascii): Improve export of plain lists.
17520 18978
175212009-08-06 Bastien Guerry <bzg@altern.org> 189792009-08-06 Bastien Guerry <bzg@gnu.org>
17522 18980
17523 * org.el (org-toggle-fixed-width-section): Bug fix: insert a 18981 * org.el (org-toggle-fixed-width-section): Bug fix: insert a
17524 column and a space, not only a column. 18982 column and a space, not only a column.
@@ -19333,7 +20791,7 @@
19333 * org-archive.el (org-archive-to-archive-sibling): Handle top 20791 * org-archive.el (org-archive-to-archive-sibling): Handle top
19334 level headlines better. 20792 level headlines better.
19335 20793
193362008-10-26 Bastien Guerry <bzg@altern.org> 207942008-10-26 Bastien Guerry <bzg@gnu.org>
19337 20795
19338 * org-export-latex.el (org-export-latex-classes): 20796 * org-export-latex.el (org-export-latex-classes):
19339 Add \usepackage{graphicx} to the default list of packages. 20797 Add \usepackage{graphicx} to the default list of packages.
@@ -19557,7 +21015,7 @@
19557 New functions, similar to the outline versions, but invisible headings 21015 New functions, similar to the outline versions, but invisible headings
19558 are OK. 21016 are OK.
19559 21017
195602008-10-12 Bastien Guerry <bzg@altern.org> 210182008-10-12 Bastien Guerry <bzg@gnu.org>
19561 21019
19562 * org.el (org-auto-repeat-maybe): Insert a space between 21020 * org.el (org-auto-repeat-maybe): Insert a space between
19563 the timestamp's type and the timestamp itself. 21021 the timestamp's type and the timestamp itself.
@@ -19569,13 +21027,13 @@
19569 21027
19570 * org.el (org-map-entries): Protect the keyword-selecting variables. 21028 * org.el (org-map-entries): Protect the keyword-selecting variables.
19571 21029
195722008-10-12 Bastien Guerry <bzg@altern.org> 210302008-10-12 Bastien Guerry <bzg@gnu.org>
19573 21031
19574 * org-agenda.el (org-agenda-to-appt): Make sure the function check 21032 * org-agenda.el (org-agenda-to-appt): Make sure the function check
19575 against all agenda files. 21033 against all agenda files.
19576 21034
195772008-10-12 Carsten Dominik <dominik@science.uva.nl> 210352008-10-12 Carsten Dominik <dominik@science.uva.nl>
19578 Bastien Guerry <bzg@altern.org> 21036 Bastien Guerry <bzg@gnu.org>
19579 21037
19580 * org-list.el: New file, aggregating list functions from org.el 21038 * org-list.el: New file, aggregating list functions from org.el
19581 and org-export-latex.el. 21039 and org-export-latex.el.
@@ -19587,7 +21045,7 @@
19587 * org-agenda.el (org-agenda-to-appt): Fix bug with appointment 21045 * org-agenda.el (org-agenda-to-appt): Fix bug with appointment
19588 time before 1am. 21046 time before 1am.
19589 21047
195902008-10-12 Bastien Guerry <bzg@altern.org> 210482008-10-12 Bastien Guerry <bzg@gnu.org>
19591 21049
19592 * org-export-latex.el (org-export-latex-keywords-maybe): Bug fix. 21050 * org-export-latex.el (org-export-latex-keywords-maybe): Bug fix.
19593 21051
@@ -19632,7 +21090,7 @@
19632 21090
19633 * org-compat.el (org-propertize): New function. 21091 * org-compat.el (org-propertize): New function.
19634 21092
196352008-10-12 Bastien Guerry <bzg@altern.org> 210932008-10-12 Bastien Guerry <bzg@gnu.org>
19636 21094
19637 * org-export-latex.el (org-export-latex-tables): Protect exported 21095 * org-export-latex.el (org-export-latex-tables): Protect exported
19638 tables from further special chars conversion. 21096 tables from further special chars conversion.
@@ -19738,7 +21196,7 @@
19738 21196
19739 * org.el (org-log-note-extra): New variable. 21197 * org.el (org-log-note-extra): New variable.
19740 21198
197412008-10-12 Bastien Guerry <bzg@altern.org> 211992008-10-12 Bastien Guerry <bzg@gnu.org>
19742 21200
19743 * org.el (org-additional-option-like-keywords): Add keywords for 21201 * org.el (org-additional-option-like-keywords): Add keywords for
19744 the _QUOTE, _VERSE and _SRC environments. 21202 the _QUOTE, _VERSE and _SRC environments.
@@ -20391,7 +21849,7 @@
20391 (org-structure-template-alist): New, experimental option. 21849 (org-structure-template-alist): New, experimental option.
20392 (org-complete): Call `org-complete-expand-structure-template'. 21850 (org-complete): Call `org-complete-expand-structure-template'.
20393 21851
203942008-06-17 Bastien Guerry <bzg@altern.org> 218522008-06-17 Bastien Guerry <bzg@gnu.org>
20395 21853
20396 * org-export-latex.el (org-export-latex-preprocess): 21854 * org-export-latex.el (org-export-latex-preprocess):
20397 Add support for blockquotes. 21855 Add support for blockquotes.
diff --git a/lisp/org/ob-C.el b/lisp/org/ob-C.el
index 4f33fc45310..5f6c1cb1dd1 100644
--- a/lisp/org/ob-C.el
+++ b/lisp/org/ob-C.el
@@ -88,7 +88,9 @@ or `org-babel-execute:C++'."
88 (cond 88 (cond
89 ((equal org-babel-c-variant 'c) ".c") 89 ((equal org-babel-c-variant 'c) ".c")
90 ((equal org-babel-c-variant 'cpp) ".cpp")))) 90 ((equal org-babel-c-variant 'cpp) ".cpp"))))
91 (tmp-bin-file (org-babel-temp-file "C-bin-")) 91 (tmp-bin-file (org-babel-temp-file
92 "C-bin-"
93 (if (equal system-type 'windows-nt) ".exe" "")))
92 (cmdline (cdr (assoc :cmdline params))) 94 (cmdline (cdr (assoc :cmdline params)))
93 (flags (cdr (assoc :flags params))) 95 (flags (cdr (assoc :flags params)))
94 (full-body (org-babel-C-expand body params)) 96 (full-body (org-babel-C-expand body params))
diff --git a/lisp/org/ob-R.el b/lisp/org/ob-R.el
index e8400f494ad..49a8a85cf6d 100644
--- a/lisp/org/ob-R.el
+++ b/lisp/org/ob-R.el
@@ -279,7 +279,8 @@ last statement in BODY, as elisp."
279 (with-temp-buffer 279 (with-temp-buffer
280 (insert (org-babel-chomp body)) 280 (insert (org-babel-chomp body))
281 (let ((ess-local-process-name 281 (let ((ess-local-process-name
282 (process-name (get-buffer-process session)))) 282 (process-name (get-buffer-process session)))
283 (ess-eval-visibly-p nil))
283 (ess-eval-buffer nil))) 284 (ess-eval-buffer nil)))
284 (let ((tmp-file (org-babel-temp-file "R-"))) 285 (let ((tmp-file (org-babel-temp-file "R-")))
285 (org-babel-comint-eval-invisibly-and-wait-for-file 286 (org-babel-comint-eval-invisibly-and-wait-for-file
diff --git a/lisp/org/ob-asymptote.el b/lisp/org/ob-asymptote.el
index 913c5230815..d95829c7f79 100644
--- a/lisp/org/ob-asymptote.el
+++ b/lisp/org/ob-asymptote.el
@@ -1,6 +1,6 @@
1;;; ob-asymptote.el --- org-babel functions for asymptote evaluation 1;;; ob-asymptote.el --- org-babel functions for asymptote evaluation
2 2
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Eric Schulte 5;; Author: Eric Schulte
6;; Keywords: literate programming, reproducible research 6;; Keywords: literate programming, reproducible research
diff --git a/lisp/org/ob-clojure.el b/lisp/org/ob-clojure.el
index 1c0c37c1dd4..69d3db86de4 100644
--- a/lisp/org/ob-clojure.el
+++ b/lisp/org/ob-clojure.el
@@ -31,7 +31,6 @@
31;;; - clojure (at least 1.2.0) 31;;; - clojure (at least 1.2.0)
32;;; - clojure-mode 32;;; - clojure-mode
33;;; - slime 33;;; - slime
34;;; - swank-clojure
35 34
36;;; By far, the best way to install these components is by following 35;;; By far, the best way to install these components is by following
37;;; the directions as set out by Phil Hagelberg (Technomancy) on the 36;;; the directions as set out by Phil Hagelberg (Technomancy) on the
@@ -75,7 +74,7 @@
75 74
76(defun org-babel-execute:clojure (body params) 75(defun org-babel-execute:clojure (body params)
77 "Execute a block of Clojure code with Babel." 76 "Execute a block of Clojure code with Babel."
78 (require 'slime) (require 'swank-clojure) 77 (require 'slime)
79 (with-temp-buffer 78 (with-temp-buffer
80 (insert (org-babel-expand-body:clojure body params)) 79 (insert (org-babel-expand-body:clojure body params))
81 ((lambda (result) 80 ((lambda (result)
@@ -86,7 +85,7 @@
86 (condition-case nil (org-babel-script-escape result) 85 (condition-case nil (org-babel-script-escape result)
87 (error result))))) 86 (error result)))))
88 (slime-eval 87 (slime-eval
89 `(swank:interactive-eval-region 88 `(swank:eval-and-grab-output
90 ,(buffer-substring-no-properties (point-min) (point-max))) 89 ,(buffer-substring-no-properties (point-min) (point-max)))
91 (cdr (assoc :package params)))))) 90 (cdr (assoc :package params))))))
92 91
diff --git a/lisp/org/ob-ditaa.el b/lisp/org/ob-ditaa.el
index 17e9d5d0ccf..57ae4b94758 100644
--- a/lisp/org/ob-ditaa.el
+++ b/lisp/org/ob-ditaa.el
@@ -39,22 +39,10 @@
39(require 'ob) 39(require 'ob)
40 40
41(defvar org-babel-default-header-args:ditaa 41(defvar org-babel-default-header-args:ditaa
42 '((:results . "file") 42 '((:results . "file") (:exports . "results") (:java . "-Dfile.encoding=UTF-8"))
43 (:exports . "results")
44 (:java . "-Dfile.encoding=UTF-8"))
45 "Default arguments for evaluating a ditaa source block.") 43 "Default arguments for evaluating a ditaa source block.")
46 44
47(defcustom org-ditaa-jar-path nil 45(defvar org-ditaa-jar-path)
48 "Path for the ditaa jar file."
49 :group 'org-babel
50 :type 'string)
51
52(defcustom org-ditaa-jar-option "-jar"
53 "Option for the ditaa jar file.
54Do not leave leading or trailing spaces in this string."
55 :group 'org-babel
56 :type 'string)
57
58(defun org-babel-execute:ditaa (body params) 46(defun org-babel-execute:ditaa (body params)
59 "Execute a block of Ditaa code with org-babel. 47 "Execute a block of Ditaa code with org-babel.
60This function is called by `org-babel-execute-src-block'." 48This function is called by `org-babel-execute-src-block'."
@@ -67,7 +55,7 @@ This function is called by `org-babel-execute-src-block'."
67 (cmdline (cdr (assoc :cmdline params))) 55 (cmdline (cdr (assoc :cmdline params)))
68 (java (cdr (assoc :java params))) 56 (java (cdr (assoc :java params)))
69 (in-file (org-babel-temp-file "ditaa-")) 57 (in-file (org-babel-temp-file "ditaa-"))
70 (cmd (concat "java " java " " org-ditaa-jar-option " " 58 (cmd (concat "java " java " -jar "
71 (shell-quote-argument 59 (shell-quote-argument
72 (expand-file-name org-ditaa-jar-path)) 60 (expand-file-name org-ditaa-jar-path))
73 " " cmdline 61 " " cmdline
diff --git a/lisp/org/ob-emacs-lisp.el b/lisp/org/ob-emacs-lisp.el
index afbc20d5fc5..c8af6062002 100644
--- a/lisp/org/ob-emacs-lisp.el
+++ b/lisp/org/ob-emacs-lisp.el
@@ -41,13 +41,13 @@
41 (result-params (cdr (assoc :result-params params))) 41 (result-params (cdr (assoc :result-params params)))
42 (print-level nil) (print-length nil) 42 (print-level nil) (print-length nil)
43 (body (if (> (length vars) 0) 43 (body (if (> (length vars) 0)
44 (concat "(let (" 44 (concat "(let ("
45 (mapconcat 45 (mapconcat
46 (lambda (var) 46 (lambda (var)
47 (format "%S" (print `(,(car var) ',(cdr var))))) 47 (format "%S" (print `(,(car var) ',(cdr var)))))
48 vars "\n ") 48 vars "\n ")
49 ")\n" body ")") 49 ")\n" body "\n)")
50 body))) 50 (concat body "\n"))))
51 (if (or (member "code" result-params) 51 (if (or (member "code" result-params)
52 (member "pp" result-params)) 52 (member "pp" result-params))
53 (concat "(pp " body ")") body))) 53 (concat "(pp " body ")") body)))
diff --git a/lisp/org/ob-exp.el b/lisp/org/ob-exp.el
index bfb3aa85bca..0f0cca3d94b 100644
--- a/lisp/org/ob-exp.el
+++ b/lisp/org/ob-exp.el
@@ -2,7 +2,7 @@
2 2
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Eric Schulte 5;; Authors: Eric Schulte
6;; Dan Davison 6;; Dan Davison
7;; Keywords: literate programming, reproducible research 7;; Keywords: literate programming, reproducible research
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
@@ -34,8 +34,7 @@
34(defvar org-babel-ref-split-regexp) 34(defvar org-babel-ref-split-regexp)
35(declare-function org-babel-lob-get-info "ob-lob" ()) 35(declare-function org-babel-lob-get-info "ob-lob" ())
36(declare-function org-babel-eval-wipe-error-buffer "ob-eval" ()) 36(declare-function org-babel-eval-wipe-error-buffer "ob-eval" ())
37(add-to-list 'org-export-interblocks '(src org-babel-exp-inline-src-blocks)) 37(add-to-list 'org-export-interblocks '(src org-babel-exp-non-block-elements))
38(add-to-list 'org-export-interblocks '(lob org-babel-exp-lob-one-liners))
39 38
40(org-export-blocks-add-block '(src org-babel-exp-src-block nil)) 39(org-export-blocks-add-block '(src org-babel-exp-src-block nil))
41 40
@@ -44,6 +43,7 @@
44When set to nil no code will be evaluated as part of the export 43When set to nil no code will be evaluated as part of the export
45process." 44process."
46 :group 'org-babel 45 :group 'org-babel
46 :version "24.1"
47 :type 'boolean) 47 :type 'boolean)
48(put 'org-export-babel-evaluate 'safe-local-variable (lambda (x) (eq x nil))) 48(put 'org-export-babel-evaluate 'safe-local-variable (lambda (x) (eq x nil)))
49 49
@@ -117,33 +117,74 @@ none ----- do not display either code or results upon export"
117 (nth 1 info))) 117 (nth 1 info)))
118 (org-babel-exp-do-export info 'block hash))))) 118 (org-babel-exp-do-export info 'block hash)))))
119 119
120(defun org-babel-exp-inline-src-blocks (start end) 120(defvar org-babel-default-lob-header-args)
121 "Process inline source blocks between START and END for export. 121(defun org-babel-exp-non-block-elements (start end)
122See `org-babel-exp-src-block' for export options, currently the 122 "Process inline source and call lines between START and END for export."
123options and are taken from `org-babel-default-inline-header-args'."
124 (interactive) 123 (interactive)
125 (save-excursion 124 (save-excursion
126 (goto-char start) 125 (goto-char start)
127 (while (and (< (point) end) 126 (unless (markerp end)
128 (re-search-forward org-babel-inline-src-block-regexp end t)) 127 (let ((m (make-marker)))
129 (let* ((info (save-match-data (org-babel-parse-inline-src-block-match))) 128 (set-marker m end (current-buffer))
130 (params (nth 2 info))) 129 (setq end m)))
131 (save-match-data 130 (let ((rx (concat "\\(" org-babel-inline-src-block-regexp
132 (goto-char (match-beginning 2)) 131 "\\|" org-babel-lob-one-liner-regexp "\\)")))
132 (while (and (< (point) (marker-position end))
133 (re-search-forward rx end t))
134 (if (save-excursion
135 (goto-char (match-beginning 0))
136 (looking-at org-babel-inline-src-block-regexp))
137 (progn
138 (forward-char 1)
139 (let* ((info (save-match-data
140 (org-babel-parse-inline-src-block-match)))
141 (params (nth 2 info)))
142 (save-match-data
143 (goto-char (match-beginning 2))
144 (unless (org-babel-in-example-or-verbatim)
145 ;; expand noweb references in the original file
146 (setf (nth 1 info)
147 (if (and (cdr (assoc :noweb params))
148 (string= "yes" (cdr (assoc :noweb params))))
149 (org-babel-expand-noweb-references
150 info (get-file-buffer org-current-export-file))
151 (nth 1 info)))
152 (let ((code-replacement (save-match-data
153 (org-babel-exp-do-export
154 info 'inline))))
155 (if code-replacement
156 (progn (replace-match code-replacement nil nil nil 1)
157 (delete-char 1))
158 (org-babel-examplize-region (match-beginning 1)
159 (match-end 1))
160 (forward-char 2)))))))
133 (unless (org-babel-in-example-or-verbatim) 161 (unless (org-babel-in-example-or-verbatim)
134 ;; expand noweb references in the original file 162 (let* ((lob-info (org-babel-lob-get-info))
135 (setf (nth 1 info) 163 (inlinep (match-string 11))
136 (if (and (cdr (assoc :noweb params)) 164 (inline-start (match-end 11))
137 (string= "yes" (cdr (assoc :noweb params)))) 165 (inline-end (match-end 0))
138 (org-babel-expand-noweb-references 166 (rep (let ((lob-info (org-babel-lob-get-info)))
139 info (get-file-buffer org-current-export-file)) 167 (save-match-data
140 (nth 1 info))) 168 (org-babel-exp-do-export
141 (let ((code-replacement (save-match-data 169 (list "emacs-lisp" "results"
142 (org-babel-exp-do-export info 'inline)))) 170 (org-babel-merge-params
143 (if code-replacement 171 org-babel-default-header-args
144 (replace-match code-replacement nil nil nil 1) 172 org-babel-default-lob-header-args
145 (org-babel-examplize-region (match-beginning 1) (match-end 1)) 173 (org-babel-params-from-properties)
146 (forward-char 2))))))))) 174 (org-babel-parse-header-arguments
175 (org-babel-clean-text-properties
176 (concat ":var results="
177 (mapconcat #'identity
178 (butlast lob-info)
179 " ")))))
180 "" nil (car (last lob-info)))
181 'lob)))))
182 (if inlinep
183 (save-excursion
184 (goto-char inline-start)
185 (delete-region inline-start inline-end)
186 (insert rep))
187 (replace-match rep t t)))))))))
147 188
148(defun org-babel-in-example-or-verbatim () 189(defun org-babel-in-example-or-verbatim ()
149 "Return true if point is in example or verbatim code. 190 "Return true if point is in example or verbatim code.
@@ -158,46 +199,6 @@ org-mode text."
158 (org-in-block-p org-list-forbidden-blocks) 199 (org-in-block-p org-list-forbidden-blocks)
159 (org-between-regexps-p "^[ \t]*#\\+begin_src" "^[ \t]*#\\+end_src"))) 200 (org-between-regexps-p "^[ \t]*#\\+begin_src" "^[ \t]*#\\+end_src")))
160 201
161(defvar org-babel-default-lob-header-args)
162(defun org-babel-exp-lob-one-liners (start end)
163 "Process Library of Babel calls between START and END for export.
164See `org-babel-exp-src-block' for export options. Currently the
165options are taken from `org-babel-default-header-args'."
166 (interactive)
167 (save-excursion
168 (goto-char start)
169 (while (and (< (point) end)
170 (re-search-forward org-babel-lob-one-liner-regexp end t))
171 (unless (org-babel-in-example-or-verbatim)
172 (let* ((lob-info (org-babel-lob-get-info))
173 (inlinep (match-string 11))
174 (inline-start (match-end 11))
175 (inline-end (match-end 0))
176 (rep (let ((lob-info (org-babel-lob-get-info)))
177 (save-match-data
178 (org-babel-exp-do-export
179 (list "emacs-lisp" "results"
180 (org-babel-merge-params
181 org-babel-default-header-args
182 org-babel-default-lob-header-args
183 (org-babel-params-from-properties)
184 (org-babel-parse-header-arguments
185 (org-babel-clean-text-properties
186 (concat ":var results="
187 (mapconcat #'identity
188 (butlast lob-info) " ")))))
189 "" nil (car (last lob-info)))
190 'lob)))))
191 (setq end (+ end (- (length rep)
192 (- (length (match-string 0))
193 (length (or (match-string 11) ""))))))
194 (if inlinep
195 (save-excursion
196 (goto-char inline-start)
197 (delete-region inline-start inline-end)
198 (insert rep))
199 (replace-match rep t t)))))))
200
201(defun org-babel-exp-do-export (info type &optional hash) 202(defun org-babel-exp-do-export (info type &optional hash)
202 "Return a string with the exported content of a code block. 203 "Return a string with the exported content of a code block.
203The function respects the value of the :exports header argument." 204The function respects the value of the :exports header argument."
@@ -218,7 +219,9 @@ The function respects the value of the :exports header argument."
218 "#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC" 219 "#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC"
219 `(("lang" . ,(nth 0 info)) 220 `(("lang" . ,(nth 0 info))
220 ("flags" . ,((lambda (f) (when f (concat " " f))) (nth 3 info))) 221 ("flags" . ,((lambda (f) (when f (concat " " f))) (nth 3 info)))
221 ("body" . ,(nth 1 info))))) 222 ("body" . ,(if (string= (nth 0 info) "org")
223 (replace-regexp-in-string "^" "," (nth 1 info))
224 (nth 1 info))))))
222 225
223(defun org-babel-exp-results (info type &optional silent hash) 226(defun org-babel-exp-results (info type &optional silent hash)
224 "Evaluate and return the results of the current code block for export. 227 "Evaluate and return the results of the current code block for export.
diff --git a/lisp/org/ob-fortran.el b/lisp/org/ob-fortran.el
index 46d2269a1d7..491dde3e070 100644
--- a/lisp/org/ob-fortran.el
+++ b/lisp/org/ob-fortran.el
@@ -3,30 +3,28 @@
3;; Copyright (C) 2011-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 4
5;; Authors: Sergey Litvinov 5;; Authors: Sergey Litvinov
6;; Eric Schulte 6;; Eric Schulte
7;; Keywords: literate programming, reproducible research, fortran 7;; Keywords: literate programming, reproducible research, fortran
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 7.8.02
10 9
11;; This file is part of GNU Emacs. 10;; This program is free software; you can redistribute it and/or modify
12
13;; GNU Emacs is free software: you can redistribute it and/or modify
14;; it under the terms of the GNU General Public License as published by 11;; it under the terms of the GNU General Public License as published by
15;; the Free Software Foundation, either version 3 of the License, or 12;; the Free Software Foundation; either version 3, or (at your option)
16;; (at your option) any later version. 13;; any later version.
17 14;;
18;; GNU Emacs is distributed in the hope that it will be useful, 15;; This program is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of 16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details. 18;; GNU General Public License for more details.
22 19;;
23;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA.
25 24
26;;; Commentary: 25;;; Commentary:
27 26
28;; Org-Babel support for evaluating fortran code. 27;; Org-Babel support for evaluating fortran code.
29;; Based on ob-C.el by Eric Schulte.
30 28
31;;; Code: 29;;; Code:
32(require 'ob) 30(require 'ob)
diff --git a/lisp/org/ob-js.el b/lisp/org/ob-js.el
index bbb7aa0855e..20cad4e6b40 100644
--- a/lisp/org/ob-js.el
+++ b/lisp/org/ob-js.el
@@ -1,6 +1,6 @@
1;;; ob-js.el --- org-babel functions for Javascript 1;;; ob-js.el --- org-babel functions for Javascript
2 2
3;; Copyright (C) 2010-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2010-2012 Free Software Foundation, Inc.
4 4
5;; Author: Eric Schulte 5;; Author: Eric Schulte
6;; Keywords: literate programming, reproducible research, js 6;; Keywords: literate programming, reproducible research, js
@@ -55,6 +55,7 @@
55(defcustom org-babel-js-cmd "node" 55(defcustom org-babel-js-cmd "node"
56 "Name of command used to evaluate js blocks." 56 "Name of command used to evaluate js blocks."
57 :group 'org-babel 57 :group 'org-babel
58 :version "24.1"
58 :type 'string) 59 :type 'string)
59 60
60(defvar org-babel-js-function-wrapper 61(defvar org-babel-js-function-wrapper
diff --git a/lisp/org/ob-lilypond.el b/lisp/org/ob-lilypond.el
index 0dde0de9e42..a1e4c9f83e4 100644
--- a/lisp/org/ob-lilypond.el
+++ b/lisp/org/ob-lilypond.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Martyn Jago 5;; Author: Martyn Jago
6;; Keywords: babel language, literate programming 6;; Keywords: babel language, literate programming
7;; Homepage: https://github.com/mjago/ob-lilypond 7;; Homepage: http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10 10
@@ -30,18 +30,14 @@
30(require 'ob) 30(require 'ob)
31(require 'ob-eval) 31(require 'ob-eval)
32(require 'ob-tangle) 32(require 'ob-tangle)
33(require 'outline)
33(defalias 'lilypond-mode 'LilyPond-mode) 34(defalias 'lilypond-mode 'LilyPond-mode)
34 35
35(declare-function show-all "outline" ())
36
37(add-to-list 'org-babel-tangle-lang-exts '("LilyPond" . "ly")) 36(add-to-list 'org-babel-tangle-lang-exts '("LilyPond" . "ly"))
38 37
39(defvar org-babel-default-header-args:lilypond '() 38(defvar org-babel-default-header-args:lilypond '()
40 "Default header arguments for js code blocks.") 39 "Default header arguments for js code blocks.")
41 40
42(defconst ly-version "0.3"
43 "The version number of the file ob-lilypond.el.")
44
45(defvar ly-compile-post-tangle t 41(defvar ly-compile-post-tangle t
46 "Following the org-babel-tangle (C-c C-v t) command, 42 "Following the org-babel-tangle (C-c C-v t) command,
47ly-compile-post-tangle determines whether ob-lilypond should 43ly-compile-post-tangle determines whether ob-lilypond should
@@ -408,13 +404,7 @@ If TEST is non-nil, it contains a simulation of the OS for test purposes"
408 (message (concat "Arrange mode has been " 404 (message (concat "Arrange mode has been "
409 (if ly-arrange-mode "ENABLED." "DISABLED.")))) 405 (if ly-arrange-mode "ENABLED." "DISABLED."))))
410 406
411(defun ly-version (&optional insert-at-point) 407(defun ly-switch-extension (file-name ext)
412 (interactive)
413 (let ((version (format "ob-lilypond version %s" ly-version)))
414 (when insert-at-point (insert version))
415 (message version)))
416
417 (defun ly-switch-extension (file-name ext)
418 "Utility command to swap current FILE-NAME extension with EXT" 408 "Utility command to swap current FILE-NAME extension with EXT"
419 409
420 (concat (file-name-sans-extension 410 (concat (file-name-sans-extension
diff --git a/lisp/org/ob-lisp.el b/lisp/org/ob-lisp.el
index 2e457878b7f..8fb67219692 100644
--- a/lisp/org/ob-lisp.el
+++ b/lisp/org/ob-lisp.el
@@ -2,9 +2,9 @@
2 2
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Joel Boehland 5;; Authors: Joel Boehland
6;; Eric Schulte 6;; Eric Schulte
7;; David T. O'Toole <dto@gnu.org> 7;; David T. O'Toole <dto@gnu.org>
8;; Keywords: literate programming, reproducible research 8;; Keywords: literate programming, reproducible research
9;; Homepage: http://orgmode.org 9;; Homepage: http://orgmode.org
10 10
@@ -49,6 +49,7 @@
49For example a value of \"(progn ;; %s\\n %%s)\" would ignore the 49For example a value of \"(progn ;; %s\\n %%s)\" would ignore the
50current directory string." 50current directory string."
51 :group 'org-babel 51 :group 'org-babel
52 :version "24.1"
52 :type 'string) 53 :type 'string)
53 54
54(defun org-babel-expand-body:lisp (body params) 55(defun org-babel-expand-body:lisp (body params)
diff --git a/lisp/org/ob-lob.el b/lisp/org/ob-lob.el
index 8976427ab7e..7828f1d51c2 100644
--- a/lisp/org/ob-lob.el
+++ b/lisp/org/ob-lob.el
@@ -2,8 +2,8 @@
2 2
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Eric Schulte 5;; Authors: Eric Schulte
6;; Dan Davison 6;; Dan Davison
7;; Keywords: literate programming, reproducible research 7;; Keywords: literate programming, reproducible research
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9 9
@@ -39,6 +39,7 @@ files to `org-babel-lob-files'.")
39 "Files used to populate the `org-babel-library-of-babel'. 39 "Files used to populate the `org-babel-library-of-babel'.
40To add files to this list use the `org-babel-lob-ingest' command." 40To add files to this list use the `org-babel-lob-ingest' command."
41 :group 'org-babel 41 :group 'org-babel
42 :version "24.1"
42 :type 'list) 43 :type 'list)
43 44
44(defvar org-babel-default-lob-header-args '((:exports . "results")) 45(defvar org-babel-default-lob-header-args '((:exports . "results"))
@@ -65,14 +66,14 @@ To add files to this list use the `org-babel-lob-ingest' command."
65 66
66(defconst org-babel-block-lob-one-liner-regexp 67(defconst org-babel-block-lob-one-liner-regexp
67 (concat 68 (concat
68 "^\\([ \t]*\\)#\\+call:[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)" 69 "^\\([ \t]*?\\)#\\+call:[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
69 "\(\\([^\n]*\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?") 70 "\(\\([^\n]*?\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?")
70 "Regexp to match non-inline calls to predefined source block functions.") 71 "Regexp to match non-inline calls to predefined source block functions.")
71 72
72(defconst org-babel-inline-lob-one-liner-regexp 73(defconst org-babel-inline-lob-one-liner-regexp
73 (concat 74 (concat
74 "\\([^\n]*\\)call_\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)" 75 "\\([^\n]*?\\)call_\\([^\(\)\n]+?\\)\\(\\[\\(.*?\\)\\]\\|\\(\\)\\)"
75 "\(\\([^\n]*\\)\)\\(\\[\\(.*?\\)\\]\\)?") 76 "\(\\([^\n]*?\\)\)\\(\\[\\(.*?\\)\\]\\)?")
76 "Regexp to match inline calls to predefined source block functions.") 77 "Regexp to match inline calls to predefined source block functions.")
77 78
78(defconst org-babel-lob-one-liner-regexp 79(defconst org-babel-lob-one-liner-regexp
@@ -108,8 +109,8 @@ if so then run the appropriate source block from the Library."
108 (list 109 (list
109 (format "%s%s(%s)%s" 110 (format "%s%s(%s)%s"
110 (nonempty 3 12) 111 (nonempty 3 12)
111 (if (not (= 0 (length (nonempty 5 13)))) 112 (if (not (= 0 (length (nonempty 5 14))))
112 (concat "[" (nonempty 5 13) "]") "") 113 (concat "[" (nonempty 5 14) "]") "")
113 (or (nonempty 7 16) "") 114 (or (nonempty 7 16) "")
114 (or (nonempty 8 19) "")) 115 (or (nonempty 8 19) ""))
115 (nonempty 9 18))) 116 (nonempty 9 18)))
diff --git a/lisp/org/ob-maxima.el b/lisp/org/ob-maxima.el
index 74bcb069434..b092e1330e7 100644
--- a/lisp/org/ob-maxima.el
+++ b/lisp/org/ob-maxima.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Eric S Fraga 5;; Author: Eric S Fraga
6;; Eric Schulte 6;; Eric Schulte
7;; Keywords: literate programming, reproducible research, maxima 7;; Keywords: literate programming, reproducible research, maxima
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9 9
@@ -40,6 +40,11 @@
40 40
41(defvar org-babel-default-header-args:maxima '()) 41(defvar org-babel-default-header-args:maxima '())
42 42
43(defcustom org-babel-maxima-command
44 (if (boundp 'maxima-command) maxima-command "maxima")
45 "Command used to call maxima on the shell."
46 :group 'org-babel)
47
43(defun org-babel-maxima-expand (body params) 48(defun org-babel-maxima-expand (body params)
44 "Expand a block of Maxima code according to its header arguments." 49 "Expand a block of Maxima code according to its header arguments."
45 (let ((vars (mapcar #'cdr (org-babel-get-header params :var)))) 50 (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
@@ -67,8 +72,8 @@ called by `org-babel-execute-src-block'."
67 (result 72 (result
68 (let* ((cmdline (cdr (assoc :cmdline params))) 73 (let* ((cmdline (cdr (assoc :cmdline params)))
69 (in-file (org-babel-temp-file "maxima-" ".max")) 74 (in-file (org-babel-temp-file "maxima-" ".max"))
70 (cmd (format "maxima --very-quiet -r 'batchload(%S)$' %s" 75 (cmd (format "%s --very-quiet -r 'batchload(%S)$' %s"
71 in-file cmdline))) 76 org-babel-maxima-command in-file cmdline)))
72 (with-temp-file in-file (insert (org-babel-maxima-expand body params))) 77 (with-temp-file in-file (insert (org-babel-maxima-expand body params)))
73 (message cmd) 78 (message cmd)
74 ((lambda (raw) ;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' " 79 ((lambda (raw) ;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' "
diff --git a/lisp/org/ob-perl.el b/lisp/org/ob-perl.el
index 916eb029dbe..71e02b05054 100644
--- a/lisp/org/ob-perl.el
+++ b/lisp/org/ob-perl.el
@@ -2,8 +2,8 @@
2 2
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Dan Davison 5;; Authors: Dan Davison
6;; Eric Schulte 6;; Eric Schulte
7;; Keywords: literate programming, reproducible research 7;; Keywords: literate programming, reproducible research
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9 9
diff --git a/lisp/org/ob-picolisp.el b/lisp/org/ob-picolisp.el
index 572b6590e8d..06c9ab8df60 100644
--- a/lisp/org/ob-picolisp.el
+++ b/lisp/org/ob-picolisp.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 2010-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2010-2012 Free Software Foundation, Inc.
4 4
5;; Authors: Thorsten Jolitz 5;; Authors: Thorsten Jolitz
6;; Eric Schulte 6;; Eric Schulte
7;; Keywords: literate programming, reproducible research 7;; Keywords: literate programming, reproducible research
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9 9
@@ -76,6 +76,7 @@
76(defcustom org-babel-picolisp-cmd "pil" 76(defcustom org-babel-picolisp-cmd "pil"
77 "Name of command used to evaluate picolisp blocks." 77 "Name of command used to evaluate picolisp blocks."
78 :group 'org-babel 78 :group 'org-babel
79 :version "24.1"
79 :type 'string) 80 :type 'string)
80 81
81(defun org-babel-expand-body:picolisp (body params &optional processed-params) 82(defun org-babel-expand-body:picolisp (body params &optional processed-params)
diff --git a/lisp/org/ob-plantuml.el b/lisp/org/ob-plantuml.el
index da700527f71..55729eb4172 100644
--- a/lisp/org/ob-plantuml.el
+++ b/lisp/org/ob-plantuml.el
@@ -44,6 +44,7 @@
44(defcustom org-plantuml-jar-path nil 44(defcustom org-plantuml-jar-path nil
45 "Path to the plantuml.jar file." 45 "Path to the plantuml.jar file."
46 :group 'org-babel 46 :group 'org-babel
47 :version "24.1"
47 :type 'string) 48 :type 'string)
48 49
49(defun org-babel-execute:plantuml (body params) 50(defun org-babel-execute:plantuml (body params)
diff --git a/lisp/org/ob-python.el b/lisp/org/ob-python.el
index 5e7a2f0e6b5..0dc744aaa73 100644
--- a/lisp/org/ob-python.el
+++ b/lisp/org/ob-python.el
@@ -2,8 +2,8 @@
2 2
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Eric Schulte 5;; Authors: Eric Schulte
6;; Dan Davison 6;; Dan Davison
7;; Keywords: literate programming, reproducible research 7;; Keywords: literate programming, reproducible research
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9 9
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el
index cde594e11b0..08cb4e3a25f 100644
--- a/lisp/org/ob-ref.el
+++ b/lisp/org/ob-ref.el
@@ -2,8 +2,8 @@
2 2
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Eric Schulte 5;; Authors: Eric Schulte
6;; Dan Davison 6;; Dan Davison
7;; Keywords: literate programming, reproducible research 7;; Keywords: literate programming, reproducible research
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9 9
diff --git a/lisp/org/ob-scheme.el b/lisp/org/ob-scheme.el
index 4bcde94235f..ce2992840ca 100644
--- a/lisp/org/ob-scheme.el
+++ b/lisp/org/ob-scheme.el
@@ -1,6 +1,6 @@
1;;; ob-scheme.el --- org-babel functions for Scheme 1;;; ob-scheme.el --- org-babel functions for Scheme
2 2
3;; Copyright (C) 2010-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2010-2012 Free Software Foundation, Inc.
4 4
5;; Author: Eric Schulte 5;; Author: Eric Schulte
6;; Keywords: literate programming, reproducible research, scheme 6;; Keywords: literate programming, reproducible research, scheme
@@ -54,6 +54,7 @@
54(defcustom org-babel-scheme-cmd "guile" 54(defcustom org-babel-scheme-cmd "guile"
55 "Name of command used to evaluate scheme blocks." 55 "Name of command used to evaluate scheme blocks."
56 :group 'org-babel 56 :group 'org-babel
57 :version "24.1"
57 :type 'string) 58 :type 'string)
58 59
59(defun org-babel-expand-body:scheme (body params) 60(defun org-babel-expand-body:scheme (body params)
diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el
index 3f7882c9919..68bd95af9f9 100644
--- a/lisp/org/ob-sql.el
+++ b/lisp/org/ob-sql.el
@@ -24,6 +24,7 @@
24;;; Commentary: 24;;; Commentary:
25 25
26;; Org-Babel support for evaluating sql source code. 26;; Org-Babel support for evaluating sql source code.
27;; (see also ob-sqlite.el)
27;; 28;;
28;; SQL is somewhat unique in that there are many different engines for 29;; SQL is somewhat unique in that there are many different engines for
29;; the evaluation of sql (Mysql, PostgreSQL, etc...), so much of this 30;; the evaluation of sql (Mysql, PostgreSQL, etc...), so much of this
diff --git a/lisp/org/ob-sqlite.el b/lisp/org/ob-sqlite.el
index 599113ca830..84d6bb26bae 100644
--- a/lisp/org/ob-sqlite.el
+++ b/lisp/org/ob-sqlite.el
@@ -93,7 +93,14 @@ This function is called by `org-babel-execute-src-block'."
93 (member "code" result-params) 93 (member "code" result-params)
94 (equal (point-min) (point-max))) 94 (equal (point-min) (point-max)))
95 (buffer-string) 95 (buffer-string)
96 (org-table-convert-region (point-min) (point-max)) 96 (org-table-convert-region (point-min) (point-max)
97 (if (or (member :csv others)
98 (member :column others)
99 (member :line others)
100 (member :list others)
101 (member :html others) separator)
102 nil
103 '(4)))
97 (org-babel-sqlite-table-or-scalar 104 (org-babel-sqlite-table-or-scalar
98 (org-babel-sqlite-offset-colnames 105 (org-babel-sqlite-offset-colnames
99 (org-table-to-lisp) headers-p)))))) 106 (org-table-to-lisp) headers-p))))))
diff --git a/lisp/org/ob-table.el b/lisp/org/ob-table.el
index 7b4920e1ec4..f636415d987 100644
--- a/lisp/org/ob-table.el
+++ b/lisp/org/ob-table.el
@@ -75,9 +75,8 @@ results
75 75
76NOTE: by default string variable names are interpreted as 76NOTE: by default string variable names are interpreted as
77references to source-code blocks, to force interpretation of a 77references to source-code blocks, to force interpretation of a
78cell's value as a string, prefix the identifier with two \"$\"s 78cell's value as a string, prefix the identifier a \"$\" (e.g.,
79rather than a single \"$\" (i.e. \"$$2\" instead of \"$2\" in the 79\"$$2\" instead of \"$2\" or \"$@2$2\" instead of \"@2$2\").
80example above.
81 80
82NOTE: it is also possible to pass header arguments to the code 81NOTE: it is also possible to pass header arguments to the code
83block. In this case a table cell should hold the string value of 82block. In this case a table cell should hold the string value of
@@ -97,7 +96,7 @@ as shown in the example below.
97 (delq nil (mapcar 96 (delq nil (mapcar
98 (lambda (el) 97 (lambda (el)
99 (if (eq '$ el) 98 (if (eq '$ el)
100 (setq quote t) 99 (prog1 nil (setq quote t))
101 (prog1 (if quote 100 (prog1 (if quote
102 (format "\"%s\"" el) 101 (format "\"%s\"" el)
103 (org-babel-clean-text-properties el)) 102 (org-babel-clean-text-properties el))
diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el
index 0b4eaf1fafa..db4721b70bc 100644
--- a/lisp/org/ob-tangle.el
+++ b/lisp/org/ob-tangle.el
@@ -47,6 +47,7 @@ be inserted as the extension commonly used to identify files
47written in this language. If no entry is found in this list, 47written in this language. If no entry is found in this list,
48then the name of the language is used." 48then the name of the language is used."
49 :group 'org-babel-tangle 49 :group 'org-babel-tangle
50 :version "24.1"
50 :type '(repeat 51 :type '(repeat
51 (cons 52 (cons
52 (string "Language name") 53 (string "Language name")
@@ -55,16 +56,19 @@ then the name of the language is used."
55(defcustom org-babel-post-tangle-hook nil 56(defcustom org-babel-post-tangle-hook nil
56 "Hook run in code files tangled by `org-babel-tangle'." 57 "Hook run in code files tangled by `org-babel-tangle'."
57 :group 'org-babel 58 :group 'org-babel
59 :version "24.1"
58 :type 'hook) 60 :type 'hook)
59 61
60(defcustom org-babel-pre-tangle-hook '(save-buffer) 62(defcustom org-babel-pre-tangle-hook '(save-buffer)
61 "Hook run at the beginning of `org-babel-tangle'." 63 "Hook run at the beginning of `org-babel-tangle'."
62 :group 'org-babel 64 :group 'org-babel
65 :version "24.1"
63 :type 'hook) 66 :type 'hook)
64 67
65(defcustom org-babel-tangle-body-hook nil 68(defcustom org-babel-tangle-body-hook nil
66 "Hook run over the contents of each code block body." 69 "Hook run over the contents of each code block body."
67 :group 'org-babel 70 :group 'org-babel
71 :version "24.1"
68 :type 'hook) 72 :type 'hook)
69 73
70(defcustom org-babel-tangle-comment-format-beg "[[%link][%source-name]]" 74(defcustom org-babel-tangle-comment-format-beg "[[%link][%source-name]]"
@@ -79,6 +83,7 @@ information into the output using `org-fill-template'.
79Whether or not comments are inserted during tangling is 83Whether or not comments are inserted during tangling is
80controlled by the :comments header argument." 84controlled by the :comments header argument."
81 :group 'org-babel 85 :group 'org-babel
86 :version "24.1"
82 :type 'string) 87 :type 'string)
83 88
84(defcustom org-babel-tangle-comment-format-end "%source-name ends here" 89(defcustom org-babel-tangle-comment-format-end "%source-name ends here"
@@ -93,6 +98,7 @@ information into the output using `org-fill-template'.
93Whether or not comments are inserted during tangling is 98Whether or not comments are inserted during tangling is
94controlled by the :comments header argument." 99controlled by the :comments header argument."
95 :group 'org-babel 100 :group 'org-babel
101 :version "24.1"
96 :type 'string) 102 :type 'string)
97 103
98(defcustom org-babel-process-comment-text #'org-babel-trim 104(defcustom org-babel-process-comment-text #'org-babel-trim
@@ -101,6 +107,7 @@ inserted as comments in tangled source-code files. The function
101should take a single string argument and return a string 107should take a single string argument and return a string
102result. The default value is `org-babel-trim'." 108result. The default value is `org-babel-trim'."
103 :group 'org-babel 109 :group 'org-babel
110 :version "24.1"
104 :type 'function) 111 :type 'function)
105 112
106(defun org-babel-find-file-noselect-refresh (file) 113(defun org-babel-find-file-noselect-refresh (file)
@@ -185,9 +192,11 @@ exported source code blocks by language."
185 (when only-this-block 192 (when only-this-block
186 (unless (org-babel-where-is-src-block-head) 193 (unless (org-babel-where-is-src-block-head)
187 (error "Point is not currently inside of a code block")) 194 (error "Point is not currently inside of a code block"))
188 (unless target-file 195 (save-match-data
189 (setq target-file 196 (unless (or (cdr (assoc :tangle (nth 2 (org-babel-get-src-block-info))))
190 (read-from-minibuffer "Tangle to: " (buffer-file-name)))) 197 target-file)
198 (setq target-file
199 (read-from-minibuffer "Tangle to: " (buffer-file-name)))))
191 (narrow-to-region (match-beginning 0) (match-end 0))) 200 (narrow-to-region (match-beginning 0) (match-end 0)))
192 (save-excursion 201 (save-excursion
193 (let ((block-counter 0) 202 (let ((block-counter 0)
@@ -393,7 +402,7 @@ form
393 (start-line file link source-name params body comment)" 402 (start-line file link source-name params body comment)"
394 (let* ((start-line (nth 0 spec)) 403 (let* ((start-line (nth 0 spec))
395 (file (nth 1 spec)) 404 (file (nth 1 spec))
396 (link (org-link-escape (nth 2 spec))) 405 (link (nth 2 spec))
397 (source-name (nth 3 spec)) 406 (source-name (nth 3 spec))
398 (body (nth 5 spec)) 407 (body (nth 5 spec))
399 (comment (nth 6 spec)) 408 (comment (nth 6 spec))
diff --git a/lisp/org/ob.el b/lisp/org/ob.el
index 0288eb357b5..ac6de9f1bbf 100644
--- a/lisp/org/ob.el
+++ b/lisp/org/ob.el
@@ -2,7 +2,7 @@
2 2
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Eric Schulte 5;; Authors: Eric Schulte
6;; Dan Davison 6;; Dan Davison
7;; Keywords: literate programming, reproducible research 7;; Keywords: literate programming, reproducible research
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
@@ -79,6 +79,7 @@
79(declare-function org-list-struct "org-list" ()) 79(declare-function org-list-struct "org-list" ())
80(declare-function org-list-prevs-alist "org-list" (struct)) 80(declare-function org-list-prevs-alist "org-list" (struct))
81(declare-function org-list-get-list-end "org-list" (item struct prevs)) 81(declare-function org-list-get-list-end "org-list" (item struct prevs))
82(declare-function org-strip-protective-commas "org" (beg end))
82 83
83(defgroup org-babel nil 84(defgroup org-babel nil
84 "Code block evaluation and management in `org-mode' documents." 85 "Code block evaluation and management in `org-mode' documents."
@@ -104,6 +105,7 @@ against accidental code block evaluation. The
104`org-babel-no-eval-on-ctrl-c-ctrl-c' variable can be used to 105`org-babel-no-eval-on-ctrl-c-ctrl-c' variable can be used to
105remove code block execution from the C-c C-c keybinding." 106remove code block execution from the C-c C-c keybinding."
106 :group 'org-babel 107 :group 'org-babel
108 :version "24.1"
107 :type '(choice boolean function)) 109 :type '(choice boolean function))
108;; don't allow this variable to be changed through file settings 110;; don't allow this variable to be changed through file settings
109(put 'org-confirm-babel-evaluate 'safe-local-variable (lambda (x) (eq x t))) 111(put 'org-confirm-babel-evaluate 'safe-local-variable (lambda (x) (eq x t)))
@@ -111,8 +113,16 @@ remove code block execution from the C-c C-c keybinding."
111(defcustom org-babel-no-eval-on-ctrl-c-ctrl-c nil 113(defcustom org-babel-no-eval-on-ctrl-c-ctrl-c nil
112 "Remove code block evaluation from the C-c C-c key binding." 114 "Remove code block evaluation from the C-c C-c key binding."
113 :group 'org-babel 115 :group 'org-babel
116 :version "24.1"
114 :type 'boolean) 117 :type 'boolean)
115 118
119(defcustom org-babel-results-keyword "RESULTS"
120 "Keyword used to name results generated by code blocks.
121Should be either RESULTS or NAME however any capitalization may
122be used."
123 :group 'org-babel
124 :type 'string)
125
116(defvar org-babel-src-name-regexp 126(defvar org-babel-src-name-regexp
117 "^[ \t]*#\\+name:[ \t]*" 127 "^[ \t]*#\\+name:[ \t]*"
118 "Regular expression used to match a source name line.") 128 "Regular expression used to match a source name line.")
@@ -169,8 +179,8 @@ Returns non-nil if match-data set"
169 (first-line-p (= 1 (line-number-at-pos))) 179 (first-line-p (= 1 (line-number-at-pos)))
170 (orig (point))) 180 (orig (point)))
171 (let ((search-for (cond ((and src-at-0-p first-line-p "src_")) 181 (let ((search-for (cond ((and src-at-0-p first-line-p "src_"))
172 (first-line-p "[ \t]src_") 182 (first-line-p "[[:punct:] \t]src_")
173 (t "[ \f\t\n\r\v]src_"))) 183 (t "[[:punct:] \f\t\n\r\v]src_")))
174 (lower-limit (if first-line-p 184 (lower-limit (if first-line-p
175 nil 185 nil
176 (- (point-at-bol) 1)))) 186 (- (point-at-bol) 1))))
@@ -376,6 +386,7 @@ then run `org-babel-pop-to-session'."
376 (noeval) 386 (noeval)
377 (noweb . ((yes no tangle))) 387 (noweb . ((yes no tangle)))
378 (noweb-ref . :any) 388 (noweb-ref . :any)
389 (noweb-sep . :any)
379 (padline . ((yes no))) 390 (padline . ((yes no)))
380 (results . ((file list vector table scalar verbatim) 391 (results . ((file list vector table scalar verbatim)
381 (raw org html latex code pp wrap) 392 (raw org html latex code pp wrap)
@@ -469,7 +480,10 @@ the header arguments specified at the front of the source code
469block." 480block."
470 (interactive) 481 (interactive)
471 (let ((info (or info (org-babel-get-src-block-info)))) 482 (let ((info (or info (org-babel-get-src-block-info))))
472 (when (org-babel-confirm-evaluate info) 483 (when (org-babel-confirm-evaluate
484 (let ((i info))
485 (setf (nth 2 i) (org-babel-merge-params (nth 2 info) params))
486 i))
473 (let* ((lang (nth 0 info)) 487 (let* ((lang (nth 0 info))
474 (params (if params 488 (params (if params
475 (org-babel-process-params 489 (org-babel-process-params
@@ -597,15 +611,17 @@ arguments and pop open the results in a preview buffer."
597 ;; TODO: report malformed code block 611 ;; TODO: report malformed code block
598 ;; TODO: report incompatible combinations of header arguments 612 ;; TODO: report incompatible combinations of header arguments
599 ;; TODO: report uninitialized variables 613 ;; TODO: report uninitialized variables
600 (let ((too-close 2)) ;; <- control closeness to report potential match 614 (let ((too-close 2) ;; <- control closeness to report potential match
615 (names (mapcar #'symbol-name org-babel-header-arg-names)))
601 (dolist (header (mapcar (lambda (arg) (substring (symbol-name (car arg)) 1)) 616 (dolist (header (mapcar (lambda (arg) (substring (symbol-name (car arg)) 1))
602 (and (org-babel-where-is-src-block-head) 617 (and (org-babel-where-is-src-block-head)
603 (org-babel-parse-header-arguments 618 (org-babel-parse-header-arguments
604 (org-babel-clean-text-properties 619 (org-babel-clean-text-properties
605 (match-string 4)))))) 620 (match-string 4))))))
606 (dolist (name (mapcar #'symbol-name org-babel-header-arg-names)) 621 (dolist (name names)
607 (when (and (not (string= header name)) 622 (when (and (not (string= header name))
608 (<= (org-babel-edit-distance header name) too-close)) 623 (<= (org-babel-edit-distance header name) too-close)
624 (not (member header names)))
609 (error "supplied header \"%S\" is suspiciously close to \"%S\"" 625 (error "supplied header \"%S\" is suspiciously close to \"%S\""
610 header name)))) 626 header name))))
611 (message "No suspicious header arguments found."))) 627 (message "No suspicious header arguments found.")))
@@ -885,6 +901,31 @@ buffer."
885(def-edebug-spec org-babel-map-call-lines (form body)) 901(def-edebug-spec org-babel-map-call-lines (form body))
886 902
887;;;###autoload 903;;;###autoload
904(defmacro org-babel-map-executables (file &rest body)
905 (declare (indent 1))
906 (let ((tempvar (make-symbol "file"))
907 (rx (make-symbol "rx")))
908 `(let* ((,tempvar ,file)
909 (,rx (concat "\\(" org-babel-src-block-regexp
910 "\\|" org-babel-inline-src-block-regexp
911 "\\|" org-babel-lob-one-liner-regexp "\\)"))
912 (visited-p (or (null ,tempvar)
913 (get-file-buffer (expand-file-name ,tempvar))))
914 (point (point)) to-be-removed)
915 (save-window-excursion
916 (when ,tempvar (find-file ,tempvar))
917 (setq to-be-removed (current-buffer))
918 (goto-char (point-min))
919 (while (re-search-forward ,rx nil t)
920 (goto-char (match-beginning 1))
921 (when (looking-at org-babel-inline-src-block-regexp)(forward-char 1))
922 (save-match-data ,@body)
923 (goto-char (match-end 0))))
924 (unless visited-p (kill-buffer to-be-removed))
925 (goto-char point))))
926(def-edebug-spec org-babel-map-executables (form body))
927
928;;;###autoload
888(defun org-babel-execute-buffer (&optional arg) 929(defun org-babel-execute-buffer (&optional arg)
889 "Execute source code blocks in a buffer. 930 "Execute source code blocks in a buffer.
890Call `org-babel-execute-src-block' on every source block in 931Call `org-babel-execute-src-block' on every source block in
@@ -892,12 +933,10 @@ the current buffer."
892 (interactive "P") 933 (interactive "P")
893 (org-babel-eval-wipe-error-buffer) 934 (org-babel-eval-wipe-error-buffer)
894 (org-save-outline-visibility t 935 (org-save-outline-visibility t
895 (org-babel-map-src-blocks nil 936 (org-babel-map-executables nil
896 (org-babel-execute-src-block arg)) 937 (if (looking-at org-babel-lob-one-liner-regexp)
897 (org-babel-map-inline-src-blocks nil 938 (org-babel-lob-execute-maybe)
898 (org-babel-execute-src-block arg)) 939 (org-babel-execute-src-block arg)))))
899 (org-babel-map-call-lines nil
900 (org-babel-lob-execute-maybe))))
901 940
902;;;###autoload 941;;;###autoload
903(defun org-babel-execute-subtree (&optional arg) 942(defun org-babel-execute-subtree (&optional arg)
@@ -999,6 +1038,89 @@ This can be called with C-c C-c."
999 (when hash (kill-new hash) (message hash)))) 1038 (when hash (kill-new hash) (message hash))))
1000(add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-hash-at-point) 1039(add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-hash-at-point)
1001 1040
1041(defun org-babel-result-hide-spec ()
1042 "Hide portions of results lines.
1043Add `org-babel-hide-result' as an invisibility spec for hiding
1044portions of results lines."
1045 (add-to-invisibility-spec '(org-babel-hide-result . t)))
1046(add-hook 'org-mode-hook 'org-babel-result-hide-spec)
1047
1048(defvar org-babel-hide-result-overlays nil
1049 "Overlays hiding results.")
1050
1051(defun org-babel-result-hide-all ()
1052 "Fold all results in the current buffer."
1053 (interactive)
1054 (org-babel-show-result-all)
1055 (save-excursion
1056 (while (re-search-forward org-babel-result-regexp nil t)
1057 (save-excursion (goto-char (match-beginning 0))
1058 (org-babel-hide-result-toggle-maybe)))))
1059
1060(defun org-babel-show-result-all ()
1061 "Unfold all results in the current buffer."
1062 (mapc 'delete-overlay org-babel-hide-result-overlays)
1063 (setq org-babel-hide-result-overlays nil))
1064
1065;;;###autoload
1066(defun org-babel-hide-result-toggle-maybe ()
1067 "Toggle visibility of result at point."
1068 (interactive)
1069 (let ((case-fold-search t))
1070 (if (save-excursion
1071 (beginning-of-line 1)
1072 (looking-at org-babel-result-regexp))
1073 (progn (org-babel-hide-result-toggle)
1074 t) ;; to signal that we took action
1075 nil))) ;; to signal that we did not
1076
1077(defun org-babel-hide-result-toggle (&optional force)
1078 "Toggle the visibility of the current result."
1079 (interactive)
1080 (save-excursion
1081 (beginning-of-line)
1082 (if (re-search-forward org-babel-result-regexp nil t)
1083 (let ((start (progn (beginning-of-line 2) (- (point) 1)))
1084 (end (progn
1085 (while (looking-at org-babel-multi-line-header-regexp)
1086 (forward-line 1))
1087 (goto-char (- (org-babel-result-end) 1)) (point)))
1088 ov)
1089 (if (memq t (mapcar (lambda (overlay)
1090 (eq (overlay-get overlay 'invisible)
1091 'org-babel-hide-result))
1092 (overlays-at start)))
1093 (if (or (not force) (eq force 'off))
1094 (mapc (lambda (ov)
1095 (when (member ov org-babel-hide-result-overlays)
1096 (setq org-babel-hide-result-overlays
1097 (delq ov org-babel-hide-result-overlays)))
1098 (when (eq (overlay-get ov 'invisible)
1099 'org-babel-hide-result)
1100 (delete-overlay ov)))
1101 (overlays-at start)))
1102 (setq ov (make-overlay start end))
1103 (overlay-put ov 'invisible 'org-babel-hide-result)
1104 ;; make the block accessible to isearch
1105 (overlay-put
1106 ov 'isearch-open-invisible
1107 (lambda (ov)
1108 (when (member ov org-babel-hide-result-overlays)
1109 (setq org-babel-hide-result-overlays
1110 (delq ov org-babel-hide-result-overlays)))
1111 (when (eq (overlay-get ov 'invisible)
1112 'org-babel-hide-result)
1113 (delete-overlay ov))))
1114 (push ov org-babel-hide-result-overlays)))
1115 (error "Not looking at a result line"))))
1116
1117;; org-tab-after-check-for-cycling-hook
1118(add-hook 'org-tab-first-hook 'org-babel-hide-result-toggle-maybe)
1119;; Remove overlays when changing major mode
1120(add-hook 'org-mode-hook
1121 (lambda () (org-add-hook 'change-major-mode-hook
1122 'org-babel-show-result-all 'append 'local)))
1123
1002(defvar org-file-properties) 1124(defvar org-file-properties)
1003(defun org-babel-params-from-properties (&optional lang) 1125(defun org-babel-params-from-properties (&optional lang)
1004 "Retrieve parameters specified as properties. 1126 "Retrieve parameters specified as properties.
@@ -1042,7 +1164,7 @@ may be specified in the properties of the current outline entry."
1042 ;; get block body less properties, protective commas, and indentation 1164 ;; get block body less properties, protective commas, and indentation
1043 (with-temp-buffer 1165 (with-temp-buffer
1044 (save-match-data 1166 (save-match-data
1045 (insert (org-babel-strip-protective-commas body)) 1167 (insert (org-babel-strip-protective-commas body lang))
1046 (unless preserve-indentation (org-do-remove-indentation)) 1168 (unless preserve-indentation (org-do-remove-indentation))
1047 (buffer-string))) 1169 (buffer-string)))
1048 (org-babel-merge-params 1170 (org-babel-merge-params
@@ -1060,7 +1182,7 @@ may be specified in the properties of the current outline entry."
1060 (lang-headers (intern (concat "org-babel-default-header-args:" lang)))) 1182 (lang-headers (intern (concat "org-babel-default-header-args:" lang))))
1061 (list lang 1183 (list lang
1062 (org-babel-strip-protective-commas 1184 (org-babel-strip-protective-commas
1063 (org-babel-clean-text-properties (match-string 5))) 1185 (org-babel-clean-text-properties (match-string 5)) lang)
1064 (org-babel-merge-params 1186 (org-babel-merge-params
1065 org-babel-default-inline-header-args 1187 org-babel-default-inline-header-args
1066 (org-babel-params-from-properties lang) 1188 (org-babel-params-from-properties lang)
@@ -1376,9 +1498,10 @@ buffer or nil if no such result exists."
1376 (catch 'is-a-code-block 1498 (catch 'is-a-code-block
1377 (when (re-search-forward 1499 (when (re-search-forward
1378 (concat org-babel-result-regexp 1500 (concat org-babel-result-regexp
1379 "[ \t]" (regexp-quote name) "[ \t\n\f\v\r]") nil t) 1501 "[ \t]" (regexp-quote name) "[ \t\n\f\v\r]+") nil t)
1380 (when (and (string= "name" (downcase (match-string 1))) 1502 (when (and (string= "name" (downcase (match-string 1)))
1381 (or (looking-at org-babel-src-block-regexp) 1503 (or (beginning-of-line 1)
1504 (looking-at org-babel-src-block-regexp)
1382 (looking-at org-babel-multi-line-header-regexp))) 1505 (looking-at org-babel-multi-line-header-regexp)))
1383 (throw 'is-a-code-block (org-babel-find-named-result name (point)))) 1506 (throw 'is-a-code-block (org-babel-find-named-result name (point))))
1384 (beginning-of-line 0) (point))))) 1507 (beginning-of-line 0) (point)))))
@@ -1491,7 +1614,7 @@ following the source block."
1491 (inlinep (when (org-babel-get-inline-src-block-matches) 1614 (inlinep (when (org-babel-get-inline-src-block-matches)
1492 (match-end 0))) 1615 (match-end 0)))
1493 (name (if on-lob-line 1616 (name (if on-lob-line
1494 (nth 0 (org-babel-lob-get-info)) 1617 (mapconcat #'identity (butlast (org-babel-lob-get-info)) "")
1495 (nth 4 (or info (org-babel-get-src-block-info 'light))))) 1618 (nth 4 (or info (org-babel-get-src-block-info 'light)))))
1496 (head (unless on-lob-line (org-babel-where-is-src-block-head))) 1619 (head (unless on-lob-line (org-babel-where-is-src-block-head)))
1497 found beg end) 1620 found beg end)
@@ -1544,7 +1667,7 @@ following the source block."
1544 (lambda (el) " ") 1667 (lambda (el) " ")
1545 (org-number-sequence 1 indent) "") 1668 (org-number-sequence 1 indent) "")
1546 "") 1669 "")
1547 "#+results" 1670 "#+" org-babel-results-keyword
1548 (when hash (concat "["hash"]")) 1671 (when hash (concat "["hash"]"))
1549 ":" 1672 ":"
1550 (when name (concat " " name)) "\n")) 1673 (when name (concat " " name)) "\n"))
@@ -1715,8 +1838,9 @@ code ---- the results are extracted in the syntax of the source
1715 (setq results-switches 1838 (setq results-switches
1716 (if results-switches (concat " " results-switches) "")) 1839 (if results-switches (concat " " results-switches) ""))
1717 (flet ((wrap (start finish) 1840 (flet ((wrap (start finish)
1718 (goto-char beg) (insert (concat start "\n"))
1719 (goto-char end) (insert (concat finish "\n")) 1841 (goto-char end) (insert (concat finish "\n"))
1842 (goto-char beg) (insert (concat start "\n"))
1843 (goto-char end) (goto-char (point-at-eol))
1720 (setq end (point-marker))) 1844 (setq end (point-marker)))
1721 (proper-list-p (it) (and (listp it) (null (cdr (last it)))))) 1845 (proper-list-p (it) (and (listp it) (null (cdr (last it))))))
1722 ;; insert results based on type 1846 ;; insert results based on type
@@ -1802,7 +1926,8 @@ code ---- the results are extracted in the syntax of the source
1802 (prvs (org-list-prevs-alist struct))) 1926 (prvs (org-list-prevs-alist struct)))
1803 (org-list-get-list-end (point-at-bol) struct prvs))) 1927 (org-list-get-list-end (point-at-bol) struct prvs)))
1804 ((looking-at "^\\([ \t]*\\):RESULTS:") 1928 ((looking-at "^\\([ \t]*\\):RESULTS:")
1805 (re-search-forward (concat "^" (match-string 1) ":END:"))) 1929 (progn (re-search-forward (concat "^" (match-string 1) ":END:"))
1930 (forward-char 1) (point)))
1806 (t 1931 (t
1807 (let ((case-fold-search t) 1932 (let ((case-fold-search t)
1808 (blocks-re (regexp-opt 1933 (blocks-re (regexp-opt
@@ -1835,7 +1960,8 @@ file's directory then expand relative links."
1835(defun org-babel-examplize-region (beg end &optional results-switches) 1960(defun org-babel-examplize-region (beg end &optional results-switches)
1836 "Comment out region using the inline '==' or ': ' org example quote." 1961 "Comment out region using the inline '==' or ': ' org example quote."
1837 (interactive "*r") 1962 (interactive "*r")
1838 (flet ((chars-between (b e) (string-match "[\\S]" (buffer-substring b e)))) 1963 (flet ((chars-between (b e)
1964 (not (string-match "^[\\s]*$" (buffer-substring b e)))))
1839 (if (or (chars-between (save-excursion (goto-char beg) (point-at-bol)) beg) 1965 (if (or (chars-between (save-excursion (goto-char beg) (point-at-bol)) beg)
1840 (chars-between end (save-excursion (goto-char end) (point-at-eol)))) 1966 (chars-between end (save-excursion (goto-char end) (point-at-eol))))
1841 (save-excursion 1967 (save-excursion
@@ -2031,7 +2157,8 @@ block but are passed literally to the \"example-block\"."
2031 (with-temp-buffer 2157 (with-temp-buffer
2032 (insert body) (goto-char (point-min)) 2158 (insert body) (goto-char (point-min))
2033 (setq index (point)) 2159 (setq index (point))
2034 (while (and (re-search-forward "<<\\(.+?\\)>>" nil t)) 2160 (while (and (re-search-forward "<<\\([^ \t\n].+?[^ \t\n]\\|[^ \t\n]\\)>>"
2161 nil t))
2035 (save-match-data (setf source-name (match-string 1))) 2162 (save-match-data (setf source-name (match-string 1)))
2036 (save-match-data (setq evaluate (string-match "\(.*\)" source-name))) 2163 (save-match-data (setq evaluate (string-match "\(.*\)" source-name)))
2037 (save-match-data 2164 (save-match-data
@@ -2046,6 +2173,8 @@ block but are passed literally to the \"example-block\"."
2046 (setq index (point)) 2173 (setq index (point))
2047 (nb-add 2174 (nb-add
2048 (with-current-buffer parent-buffer 2175 (with-current-buffer parent-buffer
2176 (save-restriction
2177 (widen)
2049 (mapconcat ;; interpose PREFIX between every line 2178 (mapconcat ;; interpose PREFIX between every line
2050 #'identity 2179 #'identity
2051 (split-string 2180 (split-string
@@ -2061,7 +2190,7 @@ block but are passed literally to the \"example-block\"."
2061 (when (org-babel-ref-goto-headline-id source-name) 2190 (when (org-babel-ref-goto-headline-id source-name)
2062 (org-babel-ref-headline-body))) 2191 (org-babel-ref-headline-body)))
2063 ;; find the expansion of reference in this buffer 2192 ;; find the expansion of reference in this buffer
2064 (let ((rx (concat rx-prefix source-name)) 2193 (let ((rx (concat rx-prefix source-name "[ \t\n]"))
2065 expansion) 2194 expansion)
2066 (save-excursion 2195 (save-excursion
2067 (goto-char (point-min)) 2196 (goto-char (point-min))
@@ -2069,6 +2198,8 @@ block but are passed literally to the \"example-block\"."
2069 (while (re-search-forward rx nil t) 2198 (while (re-search-forward rx nil t)
2070 (let* ((i (org-babel-get-src-block-info 'light)) 2199 (let* ((i (org-babel-get-src-block-info 'light))
2071 (body (org-babel-expand-noweb-references i)) 2200 (body (org-babel-expand-noweb-references i))
2201 (sep (or (cdr (assoc :noweb-sep (nth 2 i)))
2202 "\n"))
2072 (full (if comment 2203 (full (if comment
2073 ((lambda (cs) 2204 ((lambda (cs)
2074 (concat (c-wrap (car cs)) "\n" 2205 (concat (c-wrap (car cs)) "\n"
@@ -2076,13 +2207,15 @@ block but are passed literally to the \"example-block\"."
2076 (c-wrap (cadr cs)))) 2207 (c-wrap (cadr cs))))
2077 (org-babel-tangle-comment-links i)) 2208 (org-babel-tangle-comment-links i))
2078 body))) 2209 body)))
2079 (setq expansion (concat expansion full)))) 2210 (setq expansion (cons sep (cons full expansion)))))
2080 (org-babel-map-src-blocks nil 2211 (org-babel-map-src-blocks nil
2081 (let ((i (org-babel-get-src-block-info 'light))) 2212 (let ((i (org-babel-get-src-block-info 'light)))
2082 (when (equal (or (cdr (assoc :noweb-ref (nth 2 i))) 2213 (when (equal (or (cdr (assoc :noweb-ref (nth 2 i)))
2083 (nth 4 i)) 2214 (nth 4 i))
2084 source-name) 2215 source-name)
2085 (let* ((body (org-babel-expand-noweb-references i)) 2216 (let* ((body (org-babel-expand-noweb-references i))
2217 (sep (or (cdr (assoc :noweb-sep (nth 2 i)))
2218 "\n"))
2086 (full (if comment 2219 (full (if comment
2087 ((lambda (cs) 2220 ((lambda (cs)
2088 (concat (c-wrap (car cs)) "\n" 2221 (concat (c-wrap (car cs)) "\n"
@@ -2090,8 +2223,10 @@ block but are passed literally to the \"example-block\"."
2090 (c-wrap (cadr cs)))) 2223 (c-wrap (cadr cs))))
2091 (org-babel-tangle-comment-links i)) 2224 (org-babel-tangle-comment-links i))
2092 body))) 2225 body)))
2093 (setq expansion (concat expansion full)))))))) 2226 (setq expansion
2094 expansion) 2227 (cons sep (cons full expansion)))))))))
2228 (and expansion
2229 (mapconcat #'identity (nreverse (cdr expansion)) "")))
2095 ;; possibly raise an error if named block doesn't exist 2230 ;; possibly raise an error if named block doesn't exist
2096 (if (member lang org-babel-noweb-error-langs) 2231 (if (member lang org-babel-noweb-error-langs)
2097 (error "%s" (concat 2232 (error "%s" (concat
@@ -2099,7 +2234,7 @@ block but are passed literally to the \"example-block\"."
2099 "could not be resolved (see " 2234 "could not be resolved (see "
2100 "`org-babel-noweb-error-langs')")) 2235 "`org-babel-noweb-error-langs')"))
2101 ""))) 2236 "")))
2102 "[\n\r]") (concat "\n" prefix))))) 2237 "[\n\r]") (concat "\n" prefix))))))
2103 (nb-add (buffer-substring index (point-max))))) 2238 (nb-add (buffer-substring index (point-max)))))
2104 new-body)) 2239 new-body))
2105 2240
@@ -2108,10 +2243,16 @@ block but are passed literally to the \"example-block\"."
2108 (when text 2243 (when text
2109 (set-text-properties 0 (length text) nil text) text)) 2244 (set-text-properties 0 (length text) nil text) text))
2110 2245
2111(defun org-babel-strip-protective-commas (body) 2246(defun org-babel-strip-protective-commas (body &optional lang)
2112 "Strip protective commas from bodies of source blocks." 2247 "Strip protective commas from bodies of source blocks."
2113 (when body 2248 (with-temp-buffer
2114 (replace-regexp-in-string "^,#" "#" body))) 2249 (insert body)
2250 (if (and lang (string= lang "org"))
2251 (progn (goto-char (point-min))
2252 (while (re-search-forward "^[ \t]*\\(,\\)" nil t)
2253 (replace-match "" nil nil nil 1)))
2254 (org-strip-protective-commas (point-min) (point-max)))
2255 (buffer-string)))
2115 2256
2116(defun org-babel-script-escape (str &optional force) 2257(defun org-babel-script-escape (str &optional force)
2117 "Safely convert tables into elisp lists." 2258 "Safely convert tables into elisp lists."
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index bdf68819089..324ddd27f9a 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -247,9 +247,7 @@ you can \"misuse\" it to also add other text to the header. However,
247 247
248;; Keep custom values for `org-agenda-filter-preset' compatible with 248;; Keep custom values for `org-agenda-filter-preset' compatible with
249;; the new variable `org-agenda-tag-filter-preset'. 249;; the new variable `org-agenda-tag-filter-preset'.
250(if (fboundp 'defvaralias) 250(defvaralias 'org-agenda-filter-preset 'org-agenda-tag-filter-preset)
251 (defvaralias 'org-agenda-filter-preset 'org-agenda-tag-filter-preset)
252 (defvaralias 'org-agenda-filter 'org-agenda-tag-filter))
253 251
254(defconst org-agenda-custom-commands-local-options 252(defconst org-agenda-custom-commands-local-options
255 `(repeat :tag "Local settings for this command. Remember to quote values" 253 `(repeat :tag "Local settings for this command. Remember to quote values"
@@ -306,11 +304,13 @@ you can \"misuse\" it to also add other text to the header. However,
306 (string :tag "+tag or -tag")))) 304 (string :tag "+tag or -tag"))))
307 (list :tag "Set daily/weekly entry types" 305 (list :tag "Set daily/weekly entry types"
308 (const org-agenda-entry-types) 306 (const org-agenda-entry-types)
309 (set :greedy t :value (:deadline :scheduled :timestamp :sexp) 307 (list
310 (const :deadline) 308 (const :format "" quote)
311 (const :scheduled) 309 (set :greedy t :value (:deadline :scheduled :timestamp :sexp)
312 (const :timestamp) 310 (const :deadline)
313 (const :sexp))) 311 (const :scheduled)
312 (const :timestamp)
313 (const :sexp))))
314 (list :tag "Standard skipping condition" 314 (list :tag "Standard skipping condition"
315 :value (org-agenda-skip-function '(org-agenda-skip-entry-if)) 315 :value (org-agenda-skip-function '(org-agenda-skip-entry-if))
316 (const org-agenda-skip-function) 316 (const org-agenda-skip-function)
@@ -408,7 +408,7 @@ where
408 408
409desc A description string to be displayed in the dispatcher menu. 409desc A description string to be displayed in the dispatcher menu.
410cmd An agenda command, similar to the above. However, tree commands 410cmd An agenda command, similar to the above. However, tree commands
411 are no allowed, but instead you can get agenda and global todo list. 411 are not allowed, but instead you can get agenda and global todo list.
412 So valid commands for a set are: 412 So valid commands for a set are:
413 (agenda \"\" settings) 413 (agenda \"\" settings)
414 (alltodo \"\" settings) 414 (alltodo \"\" settings)
@@ -649,6 +649,7 @@ See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
649to make his option also apply to the tags-todo list." 649to make his option also apply to the tags-todo list."
650 :group 'org-agenda-skip 650 :group 'org-agenda-skip
651 :group 'org-agenda-todo-list 651 :group 'org-agenda-todo-list
652 :version "24.1"
652 :type '(choice 653 :type '(choice
653 (const :tag "Ignore future timestamp todos" future) 654 (const :tag "Ignore future timestamp todos" future)
654 (const :tag "Ignore past or present timestamp todos" past) 655 (const :tag "Ignore past or present timestamp todos" past)
@@ -796,6 +797,7 @@ trigger you to schedule it, and then you don't want to be reminded of it
796because you will take care of it on the day when scheduled." 797because you will take care of it on the day when scheduled."
797 :group 'org-agenda-skip 798 :group 'org-agenda-skip
798 :group 'org-agenda-daily/weekly 799 :group 'org-agenda-daily/weekly
800 :version "24.1"
799 :type '(choice 801 :type '(choice
800 (const :tag "Alwas show prewarning" nil) 802 (const :tag "Alwas show prewarning" nil)
801 (const :tag "Remove prewarning if entry is scheduled" t) 803 (const :tag "Remove prewarning if entry is scheduled" t)
@@ -860,6 +862,7 @@ property so than moving the mouse over the command shows it.
860Setting it to nil is good if matcher strings are very long and/or if 862Setting it to nil is good if matcher strings are very long and/or if
861you want to use two-column display (see `org-agenda-menu-two-column')." 863you want to use two-column display (see `org-agenda-menu-two-column')."
862 :group 'org-agenda 864 :group 'org-agenda
865 :version "24.1"
863 :type 'boolean) 866 :type 'boolean)
864 867
865(defcustom org-agenda-menu-two-column nil 868(defcustom org-agenda-menu-two-column nil
@@ -867,6 +870,7 @@ you want to use two-column display (see `org-agenda-menu-two-column')."
867If you use this, you probably want to set `org-agenda-menu-show-matcher' 870If you use this, you probably want to set `org-agenda-menu-show-matcher'
868to nil." 871to nil."
869 :group 'org-agenda 872 :group 'org-agenda
873 :version "24.1"
870 :type 'boolean) 874 :type 'boolean)
871 875
872(defcustom org-finalize-agenda-hook nil 876(defcustom org-finalize-agenda-hook nil
@@ -890,6 +894,7 @@ Needs to be set before org.el is loaded."
890 "Non-nil means `org-agenda-follow-mode' displays only the 894 "Non-nil means `org-agenda-follow-mode' displays only the
891current item's tree, in an indirect buffer." 895current item's tree, in an indirect buffer."
892 :group 'org-agenda 896 :group 'org-agenda
897 :version "24.1"
893 :type 'boolean) 898 :type 'boolean)
894 899
895(defcustom org-agenda-show-outline-path t 900(defcustom org-agenda-show-outline-path t
@@ -1042,11 +1047,13 @@ This function makes sure that dates are aligned for easy reading."
1042 "Non-nil means use leading zero for military times in agenda. 1047 "Non-nil means use leading zero for military times in agenda.
1043For example, 9:30am would become 09:30 rather than 9:30." 1048For example, 9:30am would become 09:30 rather than 9:30."
1044 :group 'org-agenda-daily/weekly 1049 :group 'org-agenda-daily/weekly
1050 :version "24.1"
1045 :type 'boolean) 1051 :type 'boolean)
1046 1052
1047(defcustom org-agenda-timegrid-use-ampm nil 1053(defcustom org-agenda-timegrid-use-ampm nil
1048 "When set, show AM/PM style timestamps on the timegrid." 1054 "When set, show AM/PM style timestamps on the timegrid."
1049 :group 'org-agenda 1055 :group 'org-agenda
1056 :version "24.1"
1050 :type 'boolean) 1057 :type 'boolean)
1051 1058
1052(defun org-agenda-time-of-day-to-ampm (time) 1059(defun org-agenda-time-of-day-to-ampm (time)
@@ -1094,6 +1101,7 @@ stamp currently points to the past, the first key press will move it
1094to today. WHen nil, just move one day forward even if the date stays 1101to today. WHen nil, just move one day forward even if the date stays
1095in the past." 1102in the past."
1096 :group 'org-agenda-daily/weekly 1103 :group 'org-agenda-daily/weekly
1104 :version "24.1"
1097 :type 'boolean) 1105 :type 'boolean)
1098 1106
1099(defcustom org-agenda-include-diary nil 1107(defcustom org-agenda-include-diary nil
@@ -1106,6 +1114,7 @@ Custom commands can set this variable in the options section."
1106 "If non-nil, include entries within their deadline warning period. 1114 "If non-nil, include entries within their deadline warning period.
1107Custom commands can set this variable in the options section." 1115Custom commands can set this variable in the options section."
1108 :group 'org-agenda-daily/weekly 1116 :group 'org-agenda-daily/weekly
1117 :version "24.1"
1109 :type 'boolean) 1118 :type 'boolean)
1110 1119
1111(defcustom org-agenda-repeating-timestamp-show-all t 1120(defcustom org-agenda-repeating-timestamp-show-all t
@@ -1181,6 +1190,7 @@ issue display.
1181:short-face face for clock intervals that are too short" 1190:short-face face for clock intervals that are too short"
1182 :group 'org-agenda-daily/weekly 1191 :group 'org-agenda-daily/weekly
1183 :group 'org-clock 1192 :group 'org-clock
1193 :version "24.1"
1184 :type 'plist) 1194 :type 'plist)
1185 1195
1186(defcustom org-agenda-log-mode-add-notes t 1196(defcustom org-agenda-log-mode-add-notes t
@@ -1239,6 +1249,7 @@ by preceding the first snippet with \"+\" or \"-\". If the first snippet
1239is a regexp marked with braces like \"{abc}\", this will also switch to 1249is a regexp marked with braces like \"{abc}\", this will also switch to
1240boolean search." 1250boolean search."
1241 :group 'org-agenda-search-view 1251 :group 'org-agenda-search-view
1252 :version "24.1"
1242 :type 'boolean) 1253 :type 'boolean)
1243 1254
1244(if (fboundp 'defvaralias) 1255(if (fboundp 'defvaralias)
@@ -1249,6 +1260,7 @@ boolean search."
1249 "Non-nil means, search words must be matches as complete words. 1260 "Non-nil means, search words must be matches as complete words.
1250When nil, they may also match part of a word." 1261When nil, they may also match part of a word."
1251 :group 'org-agenda-search-view 1262 :group 'org-agenda-search-view
1263 :version "24.1"
1252 :type 'boolean) 1264 :type 'boolean)
1253 1265
1254(defgroup org-agenda-time-grid nil 1266(defgroup org-agenda-time-grid nil
@@ -1312,12 +1324,14 @@ a grid line."
1312(defcustom org-agenda-show-current-time-in-grid t 1324(defcustom org-agenda-show-current-time-in-grid t
1313 "Non-nil means show the current time in the time grid." 1325 "Non-nil means show the current time in the time grid."
1314 :group 'org-agenda-time-grid 1326 :group 'org-agenda-time-grid
1327 :version "24.1"
1315 :type 'boolean) 1328 :type 'boolean)
1316 1329
1317(defcustom org-agenda-current-time-string 1330(defcustom org-agenda-current-time-string
1318 "now - - - - - - - - - - - - - - - - - - - - - - - - -" 1331 "now - - - - - - - - - - - - - - - - - - - - - - - - -"
1319 "The string for the current time marker in the agenda." 1332 "The string for the current time marker in the agenda."
1320 :group 'org-agenda-time-grid 1333 :group 'org-agenda-time-grid
1334 :version "24.1"
1321 :type 'string) 1335 :type 'string)
1322 1336
1323(defgroup org-agenda-sorting nil 1337(defgroup org-agenda-sorting nil
@@ -1528,6 +1542,7 @@ that passed since this item was scheduled first."
1528 "Text preceding item pulled into the agenda by inactive time stamps. 1542 "Text preceding item pulled into the agenda by inactive time stamps.
1529These entries are added to the agenda when pressing \"[\"." 1543These entries are added to the agenda when pressing \"[\"."
1530 :group 'org-agenda-line-format 1544 :group 'org-agenda-line-format
1545 :version "24.1"
1531 :type '(list 1546 :type '(list
1532 (string :tag "Scheduled today ") 1547 (string :tag "Scheduled today ")
1533 (string :tag "Scheduled previously"))) 1548 (string :tag "Scheduled previously")))
@@ -1566,6 +1581,7 @@ the headline/diary entry."
1566 "Non-nil means remove time ranges specifications in agenda 1581 "Non-nil means remove time ranges specifications in agenda
1567items that span on several days." 1582items that span on several days."
1568 :group 'org-agenda-line-format 1583 :group 'org-agenda-line-format
1584 :version "24.1"
1569 :type 'boolean) 1585 :type 'boolean)
1570 1586
1571(defcustom org-agenda-default-appointment-duration nil 1587(defcustom org-agenda-default-appointment-duration nil
@@ -1647,6 +1663,7 @@ The only argument passed to that function is the day. It should
1647returns a face, or nil if does not want to specify a face and let 1663returns a face, or nil if does not want to specify a face and let
1648the normal rules apply." 1664the normal rules apply."
1649 :group 'org-agenda-line-format 1665 :group 'org-agenda-line-format
1666 :version "24.1"
1650 :type 'function) 1667 :type 'function)
1651 1668
1652(defcustom org-agenda-category-icon-alist nil 1669(defcustom org-agenda-category-icon-alist nil
@@ -1679,6 +1696,7 @@ category, you can use:
1679 1696
1680 (\"Emacs\" '(space . (:width (16))))" 1697 (\"Emacs\" '(space . (:width (16))))"
1681 :group 'org-agenda-line-format 1698 :group 'org-agenda-line-format
1699 :version "24.1"
1682 :type '(alist :key-type (string :tag "Regexp matching category") 1700 :type '(alist :key-type (string :tag "Regexp matching category")
1683 :value-type (choice (list :tag "Icon" 1701 :value-type (choice (list :tag "Icon"
1684 (string :tag "File or data") 1702 (string :tag "File or data")
@@ -1741,6 +1759,7 @@ With selected entries in an agenda buffer, `B R' will call
1741the custom function `set-category' on the selected entries. 1759the custom function `set-category' on the selected entries.
1742Note that functions in this alist don't need to be quoted." 1760Note that functions in this alist don't need to be quoted."
1743 :type 'alist 1761 :type 'alist
1762 :version "24.1"
1744 :group 'org-agenda) 1763 :group 'org-agenda)
1745 1764
1746(eval-when-compile 1765(eval-when-compile
@@ -1770,7 +1789,7 @@ works you probably want to add it to `org-agenda-custom-commands' for good."
1770 (setcdr ass (cdr entry)) 1789 (setcdr ass (cdr entry))
1771 (push entry org-agenda-custom-commands)))) 1790 (push entry org-agenda-custom-commands))))
1772 1791
1773;;; Define the org-agenda-mode 1792;;; Define the Org-agenda-mode
1774 1793
1775(defvar org-agenda-mode-map (make-sparse-keymap) 1794(defvar org-agenda-mode-map (make-sparse-keymap)
1776 "Keymap for `org-agenda-mode'.") 1795 "Keymap for `org-agenda-mode'.")
@@ -3075,7 +3094,6 @@ the global options and expect it to be applied to the entire view.")
3075 3094
3076(defun org-prepare-agenda (&optional name) 3095(defun org-prepare-agenda (&optional name)
3077 (setq org-todo-keywords-for-agenda nil) 3096 (setq org-todo-keywords-for-agenda nil)
3078 (setq org-done-keywords-for-agenda nil)
3079 (setq org-drawers-for-agenda nil) 3097 (setq org-drawers-for-agenda nil)
3080 (unless org-agenda-persistent-filter 3098 (unless org-agenda-persistent-filter
3081 (setq org-agenda-tag-filter nil 3099 (setq org-agenda-tag-filter nil
@@ -3094,6 +3112,7 @@ the global options and expect it to be applied to the entire view.")
3094 (make-string (window-width) org-agenda-block-separator)) 3112 (make-string (window-width) org-agenda-block-separator))
3095 "\n")) 3113 "\n"))
3096 (narrow-to-region (point) (point-max))) 3114 (narrow-to-region (point) (point-max)))
3115 (setq org-done-keywords-for-agenda nil)
3097 (org-agenda-reset-markers) 3116 (org-agenda-reset-markers)
3098 (setq org-agenda-contributing-files nil) 3117 (setq org-agenda-contributing-files nil)
3099 (setq org-agenda-columns-active nil) 3118 (setq org-agenda-columns-active nil)
@@ -4221,7 +4240,7 @@ See `org-agenda-skip-if' for details."
4221(defun org-agenda-skip-if (subtree conditions) 4240(defun org-agenda-skip-if (subtree conditions)
4222 "Checks current entity for CONDITIONS. 4241 "Checks current entity for CONDITIONS.
4223If SUBTREE is non-nil, the entire subtree is checked. Otherwise, only 4242If SUBTREE is non-nil, the entire subtree is checked. Otherwise, only
4224the entry, i.e. the text before the next heading is checked. 4243the entry (i.e. the text before the next heading) is checked.
4225 4244
4226CONDITIONS is a list of symbols, boolean OR is used to combine the results 4245CONDITIONS is a list of symbols, boolean OR is used to combine the results
4227from different tests. Valid conditions are: 4246from different tests. Valid conditions are:
@@ -4247,12 +4266,12 @@ keywords, which may include \"*\" to match any todo keyword.
4247 4266
4248would skip all entries with \"TODO\" or \"WAITING\" keywords. 4267would skip all entries with \"TODO\" or \"WAITING\" keywords.
4249 4268
4250Instead of a list a keyword class may be given 4269Instead of a list, a keyword class may be given. For example:
4251 4270
4252 (org-agenda-skip-entry-if 'nottodo 'done) 4271 (org-agenda-skip-entry-if 'nottodo 'done)
4253 4272
4254would skip entries that haven't been marked with any of \"DONE\" 4273would skip entries that haven't been marked with any of \"DONE\"
4255keywords. Possible classes are: `todo', `done', `any'. 4274keywords. Possible classes are: `todo', `done', `any'.
4256 4275
4257If any of these conditions is met, this function returns the end point of 4276If any of these conditions is met, this function returns the end point of
4258the entity, causing the search to continue from there. This is a function 4277the entity, causing the search to continue from there. This is a function
@@ -4285,8 +4304,8 @@ that can be put into `org-agenda-skip-function' for the duration of a command."
4285 (stringp (nth 1 m)) 4304 (stringp (nth 1 m))
4286 (not (re-search-forward (nth 1 m) end t))) 4305 (not (re-search-forward (nth 1 m) end t)))
4287 (and (or 4306 (and (or
4288 (setq m (memq 'todo conditions)) 4307 (setq m (memq 'nottodo conditions))
4289 (setq m (memq 'nottodo conditions))) 4308 (setq m (memq 'todo conditions)))
4290 (org-agenda-skip-if-todo m end))) 4309 (org-agenda-skip-if-todo m end)))
4291 end))) 4310 end)))
4292 4311
@@ -4377,7 +4396,7 @@ of what a project is and how to check if it stuck, customize the variable
4377;;; Diary integration 4396;;; Diary integration
4378 4397
4379(defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param. 4398(defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param.
4380(defvar diary-list-entries-hook) 4399(defvar list-diary-entries-hook)
4381(defvar diary-time-regexp) 4400(defvar diary-time-regexp)
4382(defun org-get-entries-from-diary (date) 4401(defun org-get-entries-from-diary (date)
4383 "Get the (Emacs Calendar) diary entries for DATE." 4402 "Get the (Emacs Calendar) diary entries for DATE."
@@ -4386,8 +4405,8 @@ of what a project is and how to check if it stuck, customize the variable
4386 (diary-display-hook '(fancy-diary-display)) 4405 (diary-display-hook '(fancy-diary-display))
4387 (diary-display-function 'fancy-diary-display) 4406 (diary-display-function 'fancy-diary-display)
4388 (pop-up-frames nil) 4407 (pop-up-frames nil)
4389 (diary-list-entries-hook 4408 (list-diary-entries-hook
4390 (cons 'org-diary-default-entry diary-list-entries-hook)) 4409 (cons 'org-diary-default-entry list-diary-entries-hook))
4391 (diary-file-name-prefix-function nil) ; turn this feature off 4410 (diary-file-name-prefix-function nil) ; turn this feature off
4392 (diary-modify-entry-list-string-function 'org-modify-diary-entry-string) 4411 (diary-modify-entry-list-string-function 'org-modify-diary-entry-string)
4393 entries 4412 entries
@@ -5870,8 +5889,18 @@ could bind the variable in the options section of a custom command.")
5870 (let ((pl (text-property-any 0 (length x) 'org-heading t x))) 5889 (let ((pl (text-property-any 0 (length x) 'org-heading t x)))
5871 (setq re (get-text-property 0 'org-todo-regexp x)) 5890 (setq re (get-text-property 0 'org-todo-regexp x))
5872 (when (and re 5891 (when (and re
5892 ;; Test `pl' because if there's no heading content,
5893 ;; there's no point matching to highlight. Note
5894 ;; that if we didn't test `pl' first, and there
5895 ;; happened to be no keyword from `org-todo-regexp'
5896 ;; on this heading line, then the `equal' comparison
5897 ;; afterwards would spuriously succeed in the case
5898 ;; where `pl' is nil -- causing an args-out-of-range
5899 ;; error when we try to add text properties to text
5900 ;; that isn't there.
5901 pl
5873 (equal (string-match (concat "\\(\\.*\\)" re "\\( +\\)") 5902 (equal (string-match (concat "\\(\\.*\\)" re "\\( +\\)")
5874 x (or pl 0)) pl)) 5903 x pl) pl))
5875 (add-text-properties 5904 (add-text-properties
5876 (or (match-end 1) (match-end 0)) (match-end 0) 5905 (or (match-end 1) (match-end 0)) (match-end 0)
5877 (list 'face (org-get-todo-face (match-string 2 x))) 5906 (list 'face (org-get-todo-face (match-string 2 x)))
@@ -6182,8 +6211,8 @@ When this is the global TODO list, a prefix argument will be interpreted."
6182 (recenter window-line))) 6211 (recenter window-line)))
6183 6212
6184(defvar org-global-tags-completion-table nil) 6213(defvar org-global-tags-completion-table nil)
6185(defvar org-agenda-filtered-by-category nil)
6186(defvar org-agenda-filter-form nil) 6214(defvar org-agenda-filter-form nil)
6215(defvar org-agenda-filtered-by-category nil)
6187 6216
6188(defun org-agenda-filter-by-category (strip) 6217(defun org-agenda-filter-by-category (strip)
6189 "Keep only those lines in the agenda buffer that have a specific category. 6218 "Keep only those lines in the agenda buffer that have a specific category.
@@ -7282,16 +7311,18 @@ use the dedicated frame)."
7282 (if (and current-prefix-arg (listp current-prefix-arg)) 7311 (if (and current-prefix-arg (listp current-prefix-arg))
7283 (org-agenda-do-tree-to-indirect-buffer) 7312 (org-agenda-do-tree-to-indirect-buffer)
7284 (let ((agenda-window (selected-window)) 7313 (let ((agenda-window (selected-window))
7285 (indirect-window (get-buffer-window org-last-indirect-buffer))) 7314 (indirect-window
7315 (and org-last-indirect-buffer
7316 (get-buffer-window org-last-indirect-buffer))))
7286 (save-window-excursion (org-agenda-do-tree-to-indirect-buffer)) 7317 (save-window-excursion (org-agenda-do-tree-to-indirect-buffer))
7287 (unwind-protect 7318 (unwind-protect
7288 (progn 7319 (progn
7289 (unless indirect-window 7320 (unless (and indirect-window (window-live-p indirect-window))
7290 (setq indirect-window (split-window agenda-window))) 7321 (setq indirect-window (split-window agenda-window)))
7291 (select-window indirect-window) 7322 (select-window indirect-window)
7292 (switch-to-buffer org-last-indirect-buffer :norecord) 7323 (switch-to-buffer org-last-indirect-buffer :norecord)
7293 (fit-window-to-buffer indirect-window)) 7324 (fit-window-to-buffer indirect-window))
7294 (select-window agenda-window))))) 7325 (select-window (get-buffer-window org-agenda-buffer-name))))))
7295 7326
7296(defun org-agenda-do-tree-to-indirect-buffer () 7327(defun org-agenda-do-tree-to-indirect-buffer ()
7297 "Same as `org-agenda-tree-to-indirect-buffer' without saving window." 7328 "Same as `org-agenda-tree-to-indirect-buffer' without saving window."
@@ -7986,6 +8017,7 @@ top-level as top-level entries at the end of the file."
7986(defcustom org-agenda-insert-diary-extract-time nil 8017(defcustom org-agenda-insert-diary-extract-time nil
7987 "Non-nil means extract any time specification from the diary entry." 8018 "Non-nil means extract any time specification from the diary entry."
7988 :group 'org-agenda 8019 :group 'org-agenda
8020 :version "24.1"
7989 :type 'boolean) 8021 :type 'boolean)
7990 8022
7991(defun org-agenda-add-entry-to-org-agenda-diary-file (type text &optional d1 d2) 8023(defun org-agenda-add-entry-to-org-agenda-diary-file (type text &optional d1 d2)
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index 4137e2caf2b..db3b8250bc0 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -43,6 +43,7 @@
43(defcustom org-archive-reversed-order nil 43(defcustom org-archive-reversed-order nil
44 "Non-nil means make the tree first child under the archive heading, not last." 44 "Non-nil means make the tree first child under the archive heading, not last."
45 :group 'org-archive 45 :group 'org-archive
46 :version "24.1"
46 :type 'boolean) 47 :type 'boolean)
47 48
48(defcustom org-archive-sibling-heading "Archive" 49(defcustom org-archive-sibling-heading "Archive"
@@ -72,6 +73,7 @@ This variable is obsolete and has no effect anymore, instead add or remove
72(defcustom org-archive-subtree-add-inherited-tags 'infile 73(defcustom org-archive-subtree-add-inherited-tags 'infile
73 "Non-nil means append inherited tags when archiving a subtree." 74 "Non-nil means append inherited tags when archiving a subtree."
74 :group 'org-archive 75 :group 'org-archive
76 :version "24.1"
75 :type '(choice 77 :type '(choice
76 (const :tag "Never" nil) 78 (const :tag "Never" nil)
77 (const :tag "When archiving a subtree to the same file" infile) 79 (const :tag "When archiving a subtree to the same file" infile)
diff --git a/lisp/org/org-ascii.el b/lisp/org/org-ascii.el
index 90f39fd3d8d..61cbe1560a4 100644
--- a/lisp/org/org-ascii.el
+++ b/lisp/org/org-ascii.el
@@ -1,6 +1,6 @@
1;;; org-ascii.el --- ASCII export for Org-mode 1;;; org-ascii.el --- ASCII export for Org-mode
2 2
3;; Copyright (C) 2004-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
@@ -438,7 +438,9 @@ publishing directory."
438 link (concat (match-string 1 line) path) 438 link (concat (match-string 1 line) path)
439 type (match-string 2 line) 439 type (match-string 2 line)
440 desc0 (match-string 5 line) 440 desc0 (match-string 5 line)
441 desc (or desc0 link)) 441 desc0 (replace-regexp-in-string "\\\\_" "_" desc0)
442 desc (or desc0 link)
443 desc (replace-regexp-in-string "\\\\_" "_" desc))
442 (if (and (> (length link) 8) 444 (if (and (> (length link) 8)
443 (equal (substring link 0 8) "coderef:")) 445 (equal (substring link 0 8) "coderef:"))
444 (setq line (replace-match 446 (setq line (replace-match
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el
index 6f7476c6ba9..a87993f4b2e 100644
--- a/lisp/org/org-attach.el
+++ b/lisp/org/org-attach.el
@@ -1,6 +1,6 @@
1;;; org-attach.el --- Manage file attachments to org-mode tasks 1;;; org-attach.el --- Manage file attachments to org-mode tasks
2 2
3;; Copyright (C) 2008-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
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
@@ -101,10 +101,11 @@ ln create a hard link. Note that this is not supported
101(defcustom org-attach-store-link-p nil 101(defcustom org-attach-store-link-p nil
102 "Non-nil means store a link to a file when attaching it." 102 "Non-nil means store a link to a file when attaching it."
103 :group 'org-attach 103 :group 'org-attach
104 :version "24.1"
104 :type '(choice 105 :type '(choice
105 (const :tag "Don't store link" nil) 106 (const :tag "Don't store link" nil)
106 (const :tag "Link to origin location" t) 107 (const :tag "Link to origin location" t)
107 (const :tag "Link to the attach-dir location" 'attached))) 108 (const :tag "Link to the attach-dir location" attached)))
108 109
109;;;###autoload 110;;;###autoload
110(defun org-attach () 111(defun org-attach ()
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el
index 3df4c2044e9..04af6969de5 100644
--- a/lisp/org/org-bbdb.el
+++ b/lisp/org/org-bbdb.el
@@ -1,9 +1,9 @@
1;;; org-bbdb.el --- Support for links to BBDB entries from within Org-mode 1;;; org-bbdb.el --- Support for links to BBDB entries from within Org-mode
2 2
3;; Copyright (C) 2004-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <carsten at orgmode dot org>, 5;; Authors: Carsten Dominik <carsten at orgmode dot org>
6;; Thomas Baumann <thomas dot baumann at ch dot tum dot de> 6;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; 9;;
@@ -112,20 +112,14 @@
112 (&optional dont-check-disk already-in-db-buffer)) 112 (&optional dont-check-disk already-in-db-buffer))
113(declare-function bbdb-split "ext:bbdb" (string separators)) 113(declare-function bbdb-split "ext:bbdb" (string separators))
114(declare-function bbdb-string-trim "ext:bbdb" (string)) 114(declare-function bbdb-string-trim "ext:bbdb" (string))
115(declare-function bbdb-record-get-field "ext:bbdb" 115(declare-function bbdb-record-get-field "ext:bbdb" (record field))
116 (fn file &optional arglist fileonly)) 116(declare-function bbdb-search-name "ext:bbdb-com" (regexp &optional layout))
117;; These two functions below are part of BBDB3: 117(declare-function bbdb-search-organization "ext:bbdb-com" (regexp &optional layout))
118(declare-function bbdb-search-name "ext:bbdb" (regexp &optional layout))
119(declare-function bbdb-search-organization "ext:bbdb" (regexp &optional layout))
120 118
121(declare-function calendar-leap-year-p "calendar" (year)) 119(declare-function calendar-leap-year-p "calendar" (year))
122(declare-function diary-ordinal-suffix "diary-lib" (n)) 120(declare-function diary-ordinal-suffix "diary-lib" (n))
123 121
124(defvar date) ;; dynamically scoped from Org 122(defvar date) ;; dynamically scoped from Org
125(defvar name) ;; dynamically scoped from Org
126
127;; Support for version 2.35
128(defvar org-bbdb-old (fboundp 'bbdb-record-get-field-internal))
129 123
130;; Customization 124;; Customization
131 125
@@ -206,7 +200,7 @@ date year)."
206 ;; This is BBDB, we make this link! 200 ;; This is BBDB, we make this link!
207 (let* ((rec (bbdb-current-record)) 201 (let* ((rec (bbdb-current-record))
208 (name (bbdb-record-name rec)) 202 (name (bbdb-record-name rec))
209 (company (if org-bbdb-old 203 (company (if (fboundp 'bbdb-record-getprop)
210 (bbdb-record-getprop rec 'company) 204 (bbdb-record-getprop rec 'company)
211 (car (bbdb-record-get-field rec 'organization)))) 205 (car (bbdb-record-get-field rec 'organization))))
212 (link (org-make-link "bbdb:" name))) 206 (link (org-make-link "bbdb:" name)))
@@ -227,14 +221,14 @@ italicized, in all other cases it is left unchanged."
227 221
228(defun org-bbdb-open (name) 222(defun org-bbdb-open (name)
229 "Follow a BBDB link to NAME." 223 "Follow a BBDB link to NAME."
230 (require 'bbdb) 224 (require 'bbdb-com)
231 (let ((inhibit-redisplay (not debug-on-error)) 225 (let ((inhibit-redisplay (not debug-on-error))
232 (bbdb-electric-p nil)) 226 (bbdb-electric-p nil))
233 (if org-bbdb-old 227 (if (fboundp 'bbdb-name)
234 (org-bbdb-open-old) 228 (org-bbdb-open-old name)
235 (org-bbdb-open-new)))) 229 (org-bbdb-open-new name))))
236 230
237(defun org-bbdb-open-old () 231(defun org-bbdb-open-old (name)
238 (catch 'exit 232 (catch 'exit
239 ;; Exact match on name 233 ;; Exact match on name
240 (bbdb-name (concat "\\`" name "\\'") nil) 234 (bbdb-name (concat "\\`" name "\\'") nil)
@@ -254,7 +248,7 @@ italicized, in all other cases it is left unchanged."
254 (delete-window (get-buffer-window "*BBDB*")) 248 (delete-window (get-buffer-window "*BBDB*"))
255 (error "No matching BBDB record")))) 249 (error "No matching BBDB record"))))
256 250
257(defun org-bbdb-open-new () 251(defun org-bbdb-open-new (name)
258 (catch 'exit 252 (catch 'exit
259 ;; Exact match on name 253 ;; Exact match on name
260 (bbdb-search-name (concat "\\`" name "\\'") nil) 254 (bbdb-search-name (concat "\\`" name "\\'") nil)
diff --git a/lisp/org/org-beamer.el b/lisp/org/org-beamer.el
index 28b79a03dfe..041a9154095 100644
--- a/lisp/org/org-beamer.el
+++ b/lisp/org/org-beamer.el
@@ -1,6 +1,6 @@
1;;; org-beamer.el --- Beamer-specific LaTeX export for org-mode 1;;; org-beamer.el --- Beamer-specific LaTeX export for org-mode
2;; 2;;
3;; Copyright (C) 2007-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
4;; 4;;
5;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com> 5;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com>
6;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com> 6;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
@@ -43,6 +43,7 @@
43(defcustom org-beamer-use-parts nil 43(defcustom org-beamer-use-parts nil
44 "" 44 ""
45 :group 'org-beamer 45 :group 'org-beamer
46 :version "24.1"
46 :type 'boolean) 47 :type 'boolean)
47 48
48(defcustom org-beamer-frame-level 1 49(defcustom org-beamer-frame-level 1
@@ -52,6 +53,7 @@ Setting this to 2 will allow sections, 3 will allow subsections as well.
52You can set this to 4 as well, if you at the same time set 53You can set this to 4 as well, if you at the same time set
53`org-beamer-use-parts' to make the top levels `\part'." 54`org-beamer-use-parts' to make the top levels `\part'."
54 :group 'org-beamer 55 :group 'org-beamer
56 :version "24.1"
55 :type '(choice 57 :type '(choice
56 (const :tag "Frames need a BEAMER_env property" nil) 58 (const :tag "Frames need a BEAMER_env property" nil)
57 (integer :tag "Specific level makes a frame"))) 59 (integer :tag "Specific level makes a frame")))
@@ -60,12 +62,14 @@ You can set this to 4 as well, if you at the same time set
60 "Default options string to use for frames, should contains the [brackets]. 62 "Default options string to use for frames, should contains the [brackets].
61And example for this is \"[allowframebreaks]\"." 63And example for this is \"[allowframebreaks]\"."
62 :group 'org-beamer 64 :group 'org-beamer
65 :version "24.1"
63 :type '(string :tag "[options]")) 66 :type '(string :tag "[options]"))
64 67
65(defcustom org-beamer-column-view-format 68(defcustom org-beamer-column-view-format
66 "%45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)" 69 "%45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)"
67 "Default column view format that should be used to fill the template." 70 "Default column view format that should be used to fill the template."
68 :group 'org-beamer 71 :group 'org-beamer
72 :version "24.1"
69 :type '(choice 73 :type '(choice
70 (const :tag "Do not insert Beamer column view format" nil) 74 (const :tag "Do not insert Beamer column view format" nil)
71 (string :tag "Beamer column view format"))) 75 (string :tag "Beamer column view format")))
@@ -76,6 +80,7 @@ And example for this is \"[allowframebreaks]\"."
76When a beamer template is filled, this will be the default for 80When a beamer template is filled, this will be the default for
77BEAMER_HEADER_EXTRA, which will be inserted just before \\begin{document}." 81BEAMER_HEADER_EXTRA, which will be inserted just before \\begin{document}."
78 :group 'org-beamer 82 :group 'org-beamer
83 :version "24.1"
79 :type '(choice 84 :type '(choice
80 (const :tag "Do not insert Beamer themes" nil) 85 (const :tag "Do not insert Beamer themes" nil)
81 (string :tag "Beamer themes"))) 86 (string :tag "Beamer themes")))
@@ -142,6 +147,7 @@ open The opening template for the environment, with the following escapes
142close The closing string of the environment." 147close The closing string of the environment."
143 148
144 :group 'org-beamer 149 :group 'org-beamer
150 :version "24.1"
145 :type '(repeat 151 :type '(repeat
146 (list 152 (list
147 (string :tag "Environment") 153 (string :tag "Environment")
@@ -235,7 +241,7 @@ in org-export-latex-classes."
235 (envs (append org-beamer-environments-extra 241 (envs (append org-beamer-environments-extra
236 org-beamer-environments-default)) 242 org-beamer-environments-default))
237 (props (org-get-text-property-any 0 'org-props text)) 243 (props (org-get-text-property-any 0 'org-props text))
238 (in "") (out "") option action defaction environment extra 244 (in "") (out "") org-beamer-option org-beamer-action org-beamer-defaction org-beamer-environment org-beamer-extra
239 columns-option column-option 245 columns-option column-option
240 env have-text ass tmp) 246 env have-text ass tmp)
241 (if (= frame-level 0) (setq frame-level nil)) 247 (if (= frame-level 0) (setq frame-level nil))
@@ -266,10 +272,10 @@ in org-export-latex-classes."
266 272
267 (setq in (org-fill-template 273 (setq in (org-fill-template
268 "\\begin{frame}%a%A%o%T%S%x" 274 "\\begin{frame}%a%A%o%T%S%x"
269 (list (cons "a" (or action "")) 275 (list (cons "a" (or org-beamer-action ""))
270 (cons "A" (or defaction "")) 276 (cons "A" (or org-beamer-defaction ""))
271 (cons "o" (or option org-beamer-frame-default-options "")) 277 (cons "o" (or org-beamer-option org-beamer-frame-default-options ""))
272 (cons "x" (if extra (concat "\n" extra) "")) 278 (cons "x" (if org-beamer-extra (concat "\n" org-beamer-extra) ""))
273 (cons "h" "%s") 279 (cons "h" "%s")
274 (cons "T" (if (string-match "\\S-" text) 280 (cons "T" (if (string-match "\\S-" text)
275 "\n\\frametitle{%s}" "")) 281 "\n\\frametitle{%s}" ""))
@@ -294,10 +300,10 @@ in org-export-latex-classes."
294 (setq have-text (string-match "\\S-" text)) 300 (setq have-text (string-match "\\S-" text))
295 (setq in (org-fill-template 301 (setq in (org-fill-template
296 (nth 2 ass) 302 (nth 2 ass)
297 (list (cons "a" (or action "")) 303 (list (cons "a" (or org-beamer-action ""))
298 (cons "A" (or defaction "")) 304 (cons "A" (or org-beamer-defaction ""))
299 (cons "o" (or option "")) 305 (cons "o" (or org-beamer-option ""))
300 (cons "x" (if extra (concat "\n" extra) "")) 306 (cons "x" (if org-beamer-extra (concat "\n" org-beamer-extra) ""))
301 (cons "h" "%s") 307 (cons "h" "%s")
302 (cons "H" (if have-text (concat "{" text "}") "")) 308 (cons "H" (if have-text (concat "{" text "}") ""))
303 (cons "U" (if have-text (concat "[" text "]") "")))) 309 (cons "U" (if have-text (concat "[" text "]") ""))))
@@ -321,31 +327,31 @@ in org-export-latex-classes."
321 (cons text (cdr (assoc level default)))) 327 (cons text (cdr (assoc level default))))
322 (t nil)))) 328 (t nil))))
323 329
324(defvar extra) 330(defvar org-beamer-extra)
325(defvar option) 331(defvar org-beamer-option)
326(defvar action) 332(defvar org-beamer-action)
327(defvar defaction) 333(defvar org-beamer-defaction)
328(defvar environment) 334(defvar org-beamer-environment)
329(defun org-beamer-get-special (props) 335(defun org-beamer-get-special (props)
330 "Extract an option, action, and default action string from text. 336 "Extract an option, action, and default action string from text.
331The variables option, action, defaction, extra are all scoped into 337The variables org-beamer-option, org-beamer-action, org-beamer-defaction,
332this function dynamically." 338org-beamer-extra are all scoped into this function dynamically."
333 (let (tmp) 339 (let (tmp)
334 (setq environment (org-beamer-assoc-not-empty "BEAMER_env" props)) 340 (setq org-beamer-environment (org-beamer-assoc-not-empty "BEAMER_env" props))
335 (setq extra (org-beamer-assoc-not-empty "BEAMER_extra" props)) 341 (setq org-beamer-extra (org-beamer-assoc-not-empty "BEAMER_extra" props))
336 (when extra 342 (when org-beamer-extra
337 (setq extra (replace-regexp-in-string "\\\\n" "\n" extra))) 343 (setq org-beamer-extra (replace-regexp-in-string "\\\\n" "\n" org-beamer-extra)))
338 (setq tmp (org-beamer-assoc-not-empty "BEAMER_envargs" props)) 344 (setq tmp (org-beamer-assoc-not-empty "BEAMER_envargs" props))
339 (when tmp 345 (when tmp
340 (setq tmp (copy-sequence tmp)) 346 (setq tmp (copy-sequence tmp))
341 (if (string-match "\\[<[^][<>]*>\\]" tmp) 347 (if (string-match "\\[<[^][<>]*>\\]" tmp)
342 (setq defaction (match-string 0 tmp) 348 (setq org-beamer-defaction (match-string 0 tmp)
343 tmp (replace-match "" t t tmp))) 349 tmp (replace-match "" t t tmp)))
344 (if (string-match "\\[[^][]*\\]" tmp) 350 (if (string-match "\\[[^][]*\\]" tmp)
345 (setq option (match-string 0 tmp) 351 (setq org-beamer-option (match-string 0 tmp)
346 tmp (replace-match "" t t tmp))) 352 tmp (replace-match "" t t tmp)))
347 (if (string-match "<[^<>]*>" tmp) 353 (if (string-match "<[^<>]*>" tmp)
348 (setq action (match-string 0 tmp) 354 (setq org-beamer-action (match-string 0 tmp)
349 tmp (replace-match "" t t tmp)))))) 355 tmp (replace-match "" t t tmp))))))
350 356
351(defun org-beamer-assoc-not-empty (elt list) 357(defun org-beamer-assoc-not-empty (elt list)
@@ -402,6 +408,7 @@ the value will be inserted right after the documentclass statement."
402(defcustom org-beamer-fragile-re "\\\\\\(verb\\|lstinline\\)\\|^[ \t]*\\\\begin{\\(verbatim\\|lstlisting\\|minted\\)}" 408(defcustom org-beamer-fragile-re "\\\\\\(verb\\|lstinline\\)\\|^[ \t]*\\\\begin{\\(verbatim\\|lstlisting\\|minted\\)}"
403 "If this regexp matches in a frame, the frame is marked as fragile." 409 "If this regexp matches in a frame, the frame is marked as fragile."
404 :group 'org-beamer 410 :group 'org-beamer
411 :version "24.1"
405 :type 'regexp) 412 :type 'regexp)
406 413
407(defface org-beamer-tag '((t (:box (:line-width 1 :color grey40)))) 414(defface org-beamer-tag '((t (:box (:line-width 1 :color grey40))))
@@ -511,6 +518,7 @@ This function will run in the final LaTeX document."
511(defcustom org-beamer-outline-frame-title "Outline" 518(defcustom org-beamer-outline-frame-title "Outline"
512 "Default title of a frame containing an outline." 519 "Default title of a frame containing an outline."
513 :group 'org-beamer 520 :group 'org-beamer
521 :version "24.1"
514 :type '(string :tag "Outline frame title") 522 :type '(string :tag "Outline frame title")
515) 523)
516 524
@@ -519,6 +527,7 @@ This function will run in the final LaTeX document."
519You might want to put e.g. [allowframebreaks=0.9] here. Remember to 527You might want to put e.g. [allowframebreaks=0.9] here. Remember to
520include square brackets." 528include square brackets."
521 :group 'org-beamer 529 :group 'org-beamer
530 :version "24.1"
522 :type '(string :tag "Outline frame options") 531 :type '(string :tag "Outline frame options")
523) 532)
524 533
@@ -579,7 +588,7 @@ include square brackets."
579(add-hook 'org-export-preprocess-before-selecting-backend-code-hook 588(add-hook 'org-export-preprocess-before-selecting-backend-code-hook
580 'org-beamer-select-beamer-code) 589 'org-beamer-select-beamer-code)
581 590
582(defun org-insert-beamer-options-template (kind) 591(defun org-insert-beamer-options-template (&optional kind)
583 "Insert a settings template, to make sure users do this right." 592 "Insert a settings template, to make sure users do this right."
584 (interactive (progn 593 (interactive (progn
585 (message "Current [s]ubtree or [g]lobal?") 594 (message "Current [s]ubtree or [g]lobal?")
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el
index 17cdbc27f29..21e36a7c187 100644
--- a/lisp/org/org-bibtex.el
+++ b/lisp/org/org-bibtex.el
@@ -1,10 +1,10 @@
1;;; org-bibtex.el --- Org links to BibTeX entries 1;;; org-bibtex.el --- Org links to BibTeX entries
2;; 2;;
3;; Copyright (C) 2007-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
4;; 4;;
5;; Author: Bastien Guerry <bzg at altern dot org> 5;; Authors: 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;; Eric Schulte <schulte dot eric at gmail dot com> 7;; Eric Schulte <schulte dot eric at gmail dot com>
8;; Keywords: org, wp, remember 8;; Keywords: org, wp, remember
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -112,7 +112,7 @@
112(eval-when-compile 112(eval-when-compile
113 (require 'cl)) 113 (require 'cl))
114 114
115(defvar description nil) ; dynamically scoped from org.el 115(defvar org-bibtex-description nil) ; dynamically scoped from org.el
116(defvar org-id-locations) 116(defvar org-id-locations)
117 117
118(declare-function bibtex-beginning-of-entry "bibtex" ()) 118(declare-function bibtex-beginning-of-entry "bibtex" ())
@@ -216,12 +216,14 @@
216(defcustom org-bibtex-autogen-keys nil 216(defcustom org-bibtex-autogen-keys nil
217 "Set to a truth value to use `bibtex-generate-autokey' to generate keys." 217 "Set to a truth value to use `bibtex-generate-autokey' to generate keys."
218 :group 'org-bibtex 218 :group 'org-bibtex
219 :version "24.1"
219 :type 'boolean) 220 :type 'boolean)
220 221
221(defcustom org-bibtex-prefix nil 222(defcustom org-bibtex-prefix nil
222 "Optional prefix for all bibtex property names. 223 "Optional prefix for all bibtex property names.
223For example setting to 'BIB_' would allow interoperability with fireforg." 224For example setting to 'BIB_' would allow interoperability with fireforg."
224 :group 'org-bibtex 225 :group 'org-bibtex
226 :version "24.1"
225 :type 'string) 227 :type 'string)
226 228
227(defcustom org-bibtex-treat-headline-as-title t 229(defcustom org-bibtex-treat-headline-as-title t
@@ -230,6 +232,7 @@ If an entry is missing a title property, use the headline text as
230the property. If this value is t, `org-bibtex-check' will ignore 232the property. If this value is t, `org-bibtex-check' will ignore
231a missing title field." 233a missing title field."
232 :group 'org-bibtex 234 :group 'org-bibtex
235 :version "24.1"
233 :type 'boolean) 236 :type 'boolean)
234 237
235(defcustom org-bibtex-export-arbitrary-fields nil 238(defcustom org-bibtex-export-arbitrary-fields nil
@@ -238,6 +241,7 @@ This only has effect if `org-bibtex-prefix' is defined, so as to
238ensure that other org-properties, such as CATEGORY or LOGGING are 241ensure that other org-properties, such as CATEGORY or LOGGING are
239not placed in the exported bibtex entry." 242not placed in the exported bibtex entry."
240 :group 'org-bibtex 243 :group 'org-bibtex
244 :version "24.1"
241 :type 'boolean) 245 :type 'boolean)
242 246
243(defcustom org-bibtex-key-property "CUSTOM_ID" 247(defcustom org-bibtex-key-property "CUSTOM_ID"
@@ -247,11 +251,13 @@ bibtex headlines from within an org file. This can be set to ID
247to enable global links, but only with great caution, as global 251to enable global links, but only with great caution, as global
248IDs must be unique." 252IDs must be unique."
249 :group 'org-bibtex 253 :group 'org-bibtex
254 :version "24.1"
250 :type 'string) 255 :type 'string)
251 256
252(defcustom org-bibtex-tags nil 257(defcustom org-bibtex-tags nil
253 "List of tag(s) that should be added to new bib entries." 258 "List of tag(s) that should be added to new bib entries."
254 :group 'org-bibtex 259 :group 'org-bibtex
260 :version "24.1"
255 :type '(repeat :tag "Tag" (string))) 261 :type '(repeat :tag "Tag" (string)))
256 262
257(defcustom org-bibtex-tags-are-keywords nil 263(defcustom org-bibtex-tags-are-keywords nil
@@ -266,17 +272,20 @@ comma-separated string of keywords when exported to bibtex. Tags
266defined in `org-bibtex-tags' or `org-bibtex-no-export-tags' will 272defined in `org-bibtex-tags' or `org-bibtex-no-export-tags' will
267not be exported." 273not be exported."
268 :group 'org-bibtex 274 :group 'org-bibtex
275 :version "24.1"
269 :type 'boolean) 276 :type 'boolean)
270 277
271(defcustom org-bibtex-no-export-tags nil 278(defcustom org-bibtex-no-export-tags nil
272 "List of tag(s) that should not be converted to keywords. 279 "List of tag(s) that should not be converted to keywords.
273This variable is relevant only if `org-bibtex-export-tags-as-keywords` is t." 280This variable is relevant only if `org-bibtex-export-tags-as-keywords` is t."
274 :group 'org-bibtex 281 :group 'org-bibtex
282 :version "24.1"
275 :type '(repeat :tag "Tag" (string))) 283 :type '(repeat :tag "Tag" (string)))
276 284
277(defcustom org-bibtex-type-property-name "btype" 285(defcustom org-bibtex-type-property-name "btype"
278 "Property in which to store bibtex entry type (e.g., article)." 286 "Property in which to store bibtex entry type (e.g., article)."
279 :group 'org-bibtex 287 :group 'org-bibtex
288 :version "24.1"
280 :type 'string) 289 :type 'string)
281 290
282 291
@@ -467,7 +476,7 @@ With optional argument OPTIONAL, also prompt for optional fields."
467 :btype (or (cdr (assoc "=type=" entry)) "[no type]") 476 :btype (or (cdr (assoc "=type=" entry)) "[no type]")
468 :type "bibtex" 477 :type "bibtex"
469 :link link 478 :link link
470 :description description)))) 479 :description org-bibtex-description))))
471 480
472(defun org-create-file-search-in-bibtex () 481(defun org-create-file-search-in-bibtex ()
473 "Create the search string and description for a BibTeX database entry." 482 "Create the search string and description for a BibTeX database entry."
@@ -485,7 +494,7 @@ With optional argument OPTIONAL, also prompt for optional fields."
485 (bibtex-autokey-titleword-case-convert-function 'identity) 494 (bibtex-autokey-titleword-case-convert-function 'identity)
486 (bibtex-autokey-titleword-length 'infty) 495 (bibtex-autokey-titleword-length 'infty)
487 (bibtex-autokey-year-title-separator ": ")) 496 (bibtex-autokey-year-title-separator ": "))
488 (setq description (bibtex-generate-autokey))) 497 (setq org-bibtex-description (bibtex-generate-autokey)))
489 ;; Now parse the entry, get the key and return it. 498 ;; Now parse the entry, get the key and return it.
490 (save-excursion 499 (save-excursion
491 (bibtex-beginning-of-entry) 500 (bibtex-beginning-of-entry)
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index 31694d47bc0..454463f7086 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -1,6 +1,6 @@
1;;; org-capture.el --- Fast note taking in Org-mode 1;;; org-capture.el --- Fast note taking in Org-mode
2 2
3;; Copyright (C) 2010-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2010-2012 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
@@ -262,6 +262,7 @@ w3, w3m | %:type %:url
262info | %:type %:file %:node 262info | %:type %:file %:node
263calendar | %:type %:date" 263calendar | %:type %:date"
264 :group 'org-capture 264 :group 'org-capture
265 :version "24.1"
265 :type 266 :type
266 '(repeat 267 '(repeat
267 (choice :value ("" "" entry (file "~/org/notes.org") "") 268 (choice :value ("" "" entry (file "~/org/notes.org") "")
@@ -336,12 +337,14 @@ calendar | %:type %:date"
336The capture buffer is still current when this hook runs and it is 337The capture buffer is still current when this hook runs and it is
337widened to the entire buffer." 338widened to the entire buffer."
338 :group 'org-capture 339 :group 'org-capture
340 :version "24.1"
339 :type 'hook) 341 :type 'hook)
340 342
341(defcustom org-capture-after-finalize-hook nil 343(defcustom org-capture-after-finalize-hook nil
342 "Hook that is run right after a capture process is finalized. 344 "Hook that is run right after a capture process is finalized.
343 Suitable for window cleanup" 345 Suitable for window cleanup"
344 :group 'org-capture 346 :group 'org-capture
347 :version "24.1"
345 :type 'hook) 348 :type 'hook)
346 349
347;;; The property list for keeping information about the capture process 350;;; The property list for keeping information about the capture process
@@ -911,30 +914,30 @@ it. When it is a variable, retrieve the value. Return whatever we get."
911 (target-entry-p (org-capture-get :target-entry-p)) 914 (target-entry-p (org-capture-get :target-entry-p))
912 (ind 0) 915 (ind 0)
913 beg end) 916 beg end)
914 (cond 917 (if (org-capture-get :exact-position)
915 ((org-capture-get :exact-position) 918 (goto-char (org-capture-get :exact-position))
916 (goto-char (org-capture-get :exact-position))) 919 (cond
917 ((not target-entry-p) 920 ((not target-entry-p)
918 ;; Insert as top-level entry, either at beginning or at end of file 921 ;; Insert as top-level entry, either at beginning or at end of file
919 (setq beg (point-min) end (point-max))) 922 (setq beg (point-min) end (point-max)))
920 (t 923 (t
921 (setq beg (1+ (point-at-eol)) 924 (setq beg (1+ (point-at-eol))
922 end (save-excursion (outline-next-heading) (point))))) 925 end (save-excursion (outline-next-heading) (point)))))
923 (if (org-capture-get :prepend) 926 (if (org-capture-get :prepend)
924 (progn
925 (goto-char beg)
926 (if (org-list-search-forward (org-item-beginning-re) end t)
927 (progn
928 (goto-char (match-beginning 0))
929 (setq ind (org-get-indentation)))
930 (goto-char end)
931 (setq ind 0)))
932 (goto-char end)
933 (if (org-list-search-backward (org-item-beginning-re) beg t)
934 (progn 927 (progn
935 (setq ind (org-get-indentation)) 928 (goto-char beg)
936 (org-end-of-item)) 929 (if (org-list-search-forward (org-item-beginning-re) end t)
937 (setq ind 0))) 930 (progn
931 (goto-char (match-beginning 0))
932 (setq ind (org-get-indentation)))
933 (goto-char end)
934 (setq ind 0)))
935 (goto-char end)
936 (if (org-list-search-backward (org-item-beginning-re) beg t)
937 (progn
938 (setq ind (org-get-indentation))
939 (org-end-of-item))
940 (setq ind 0))))
938 ;; Remove common indentation 941 ;; Remove common indentation
939 (setq txt (org-remove-indentation txt)) 942 (setq txt (org-remove-indentation txt))
940 ;; Make sure this is indeed an item 943 ;; Make sure this is indeed an item
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 6211ae45b1b..7105bfe13dc 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1,6 +1,6 @@
1;;; org-clock.el --- The time clocking code for Org-mode 1;;; org-clock.el --- The time clocking code for Org-mode
2 2
3;; Copyright (C) 2004-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
@@ -226,6 +226,7 @@ should get a different face (`org-mode-line-clock-overrun').
226When this is a string, it is prepended to the clock string as an indication, 226When this is a string, it is prepended to the clock string as an indication,
227also using the face `org-mode-line-clock-overrun'." 227also using the face `org-mode-line-clock-overrun'."
228 :group 'org-clock 228 :group 'org-clock
229 :version "24.1"
229 :type '(choice 230 :type '(choice
230 (const :tag "Just mark the time string" nil) 231 (const :tag "Just mark the time string" nil)
231 (string :tag "Text to prepend"))) 232 (string :tag "Text to prepend")))
@@ -267,12 +268,14 @@ string as argument."
267 :formatter nil) 268 :formatter nil)
268 "Default properties for clock tables." 269 "Default properties for clock tables."
269 :group 'org-clock 270 :group 'org-clock
271 :version "24.1"
270 :type 'plist) 272 :type 'plist)
271 273
272(defcustom org-clock-clocktable-formatter 'org-clocktable-write-default 274(defcustom org-clock-clocktable-formatter 'org-clocktable-write-default
273 "Function to turn clocking data into a table. 275 "Function to turn clocking data into a table.
274For more information, see `org-clocktable-write-default'." 276For more information, see `org-clocktable-write-default'."
275 :group 'org-clocktable 277 :group 'org-clocktable
278 :version "24.1"
276 :type 'function) 279 :type 'function)
277 280
278;; FIXME: translate es and nl last string "Clock summary at" 281;; FIXME: translate es and nl last string "Clock summary at"
@@ -283,6 +286,7 @@ For more information, see `org-clocktable-write-default'."
283 ("nl" "Bestand" "N" "Tijdstip" "Hoofding" "Duur" "ALLES" "Totale duur" "Bestandstijd" "Clock summary at")) 286 ("nl" "Bestand" "N" "Tijdstip" "Hoofding" "Duur" "ALLES" "Totale duur" "Bestandstijd" "Clock summary at"))
284 "Terms used in clocktable, translated to different languages." 287 "Terms used in clocktable, translated to different languages."
285 :group 'org-clocktable 288 :group 'org-clocktable
289 :version "24.1"
286 :type 'alist) 290 :type 'alist)
287 291
288(defcustom org-clock-clocktable-default-properties '(:maxlevel 2 :scope file) 292(defcustom org-clock-clocktable-default-properties '(:maxlevel 2 :scope file)
@@ -310,11 +314,13 @@ play with them."
310(defcustom org-clock-report-include-clocking-task nil 314(defcustom org-clock-report-include-clocking-task nil
311 "When non-nil, include the current clocking task time in clock reports." 315 "When non-nil, include the current clocking task time in clock reports."
312 :group 'org-clock 316 :group 'org-clock
317 :version "24.1"
313 :type 'boolean) 318 :type 'boolean)
314 319
315(defcustom org-clock-resolve-expert nil 320(defcustom org-clock-resolve-expert nil
316 "Non-nil means do not show the splash buffer with the clock resolver." 321 "Non-nil means do not show the splash buffer with the clock resolver."
317 :group 'org-clock 322 :group 'org-clock
323 :version "24.1"
318 :type 'boolean) 324 :type 'boolean)
319 325
320(defvar org-clock-in-prepare-hook nil 326(defvar org-clock-in-prepare-hook nil
@@ -1691,7 +1697,7 @@ from the `before-change-functions' in the current buffer."
1691 (remove-hook 'before-change-functions 1697 (remove-hook 'before-change-functions
1692 'org-clock-remove-overlays 'local)))) 1698 'org-clock-remove-overlays 'local))))
1693 1699
1694(defvar state) ;; dynamically scoped into this function 1700(defvar org-state) ;; dynamically scoped into this function
1695(defun org-clock-out-if-current () 1701(defun org-clock-out-if-current ()
1696 "Clock out if the current entry contains the running clock. 1702 "Clock out if the current entry contains the running clock.
1697This is used to stop the clock after a TODO entry is marked DONE, 1703This is used to stop the clock after a TODO entry is marked DONE,
@@ -1700,9 +1706,9 @@ and is only done if the variable `org-clock-out-when-done' is not nil."
1700 org-clock-out-when-done 1706 org-clock-out-when-done
1701 (marker-buffer org-clock-marker) 1707 (marker-buffer org-clock-marker)
1702 (or (and (eq t org-clock-out-when-done) 1708 (or (and (eq t org-clock-out-when-done)
1703 (member state org-done-keywords)) 1709 (member org-state org-done-keywords))
1704 (and (listp org-clock-out-when-done) 1710 (and (listp org-clock-out-when-done)
1705 (member state org-clock-out-when-done))) 1711 (member org-state org-clock-out-when-done)))
1706 (equal (or (buffer-base-buffer (org-clocking-buffer)) 1712 (equal (or (buffer-base-buffer (org-clocking-buffer))
1707 (org-clocking-buffer)) 1713 (org-clocking-buffer))
1708 (or (buffer-base-buffer (current-buffer)) 1714 (or (buffer-base-buffer (current-buffer))
@@ -1763,17 +1769,6 @@ buffer and update it."
1763 (org-combine-plists org-clock-clocktable-default-properties props)))) 1769 (org-combine-plists org-clock-clocktable-default-properties props))))
1764 (org-update-dblock)) 1770 (org-update-dblock))
1765 1771
1766(defun org-in-clocktable-p ()
1767 "Check if the cursor is in a clocktable."
1768 (let ((pos (point)) start)
1769 (save-excursion
1770 (end-of-line 1)
1771 (and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
1772 (setq start (match-beginning 0))
1773 (re-search-forward "^[ \t]*#\\+END:.*" nil t)
1774 (>= (match-end 0) pos)
1775 start))))
1776
1777(defun org-day-of-week (day month year) 1772(defun org-day-of-week (day month year)
1778 "Returns the day of the week as an integer." 1773 "Returns the day of the week as an integer."
1779 (nth 6 1774 (nth 6
@@ -2445,6 +2440,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
2445 (tags (plist-get params :tags)) 2440 (tags (plist-get params :tags))
2446 (properties (plist-get params :properties)) 2441 (properties (plist-get params :properties))
2447 (inherit-property-p (plist-get params :inherit-props)) 2442 (inherit-property-p (plist-get params :inherit-props))
2443 todo-only
2448 (matcher (if tags (cdr (org-make-tags-matcher tags)))) 2444 (matcher (if tags (cdr (org-make-tags-matcher tags))))
2449 cc range-text st p time level hdl props tsp tbl) 2445 cc range-text st p time level hdl props tsp tbl)
2450 2446
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 04d2b626f91..5cec355d738 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -1,6 +1,6 @@
1;;; org-colview.el --- Column View in Org-mode 1;;; org-colview.el --- Column View in Org-mode
2 2
3;; Copyright (C) 2004-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
@@ -194,7 +194,9 @@ This is the compiled version of the format.")
194 (point-at-bol) (point-at-eol))))) 194 (point-at-bol) (point-at-eol)))))
195 ;; In agenda, just get the `txt' property 195 ;; In agenda, just get the `txt' property
196 (org-no-properties 196 (org-no-properties
197 (org-get-at-bol 'txt)))) 197 (or (org-get-at-bol 'txt)
198 (buffer-substring
199 (point) (progn (end-of-line) (point)))))))
198 (assoc property props)) 200 (assoc property props))
199 width (or (cdr (assoc property org-columns-current-maxwidths)) 201 width (or (cdr (assoc property org-columns-current-maxwidths))
200 (nth 2 column) 202 (nth 2 column)
@@ -355,7 +357,7 @@ CPHR is the complex heading regexp to use for parsing ITEM."
355 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1)))))) 357 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1))))))
356 (and (match-end 2) (not (assoc "TODO" fmt)) (concat " " (match-string 2 item))) 358 (and (match-end 2) (not (assoc "TODO" fmt)) (concat " " (match-string 2 item)))
357 (and (match-end 3) (not (assoc "PRIORITY" fmt)) (concat " " (match-string 3 item))) 359 (and (match-end 3) (not (assoc "PRIORITY" fmt)) (concat " " (match-string 3 item)))
358 " " (save-match-data (org-columns-compact-links (match-string 4 item))) 360 " " (save-match-data (org-columns-compact-links (or (match-string 4 item) "")))
359 (and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item))))) 361 (and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item)))))
360 (add-text-properties 362 (add-text-properties
361 0 (1+ (match-end 1)) 363 0 (1+ (match-end 1))
@@ -928,6 +930,8 @@ Don't set this, this is meant for dynamic scoping.")
928 (overlay-put ov 'display (format fmt val))))) 930 (overlay-put ov 'display (format fmt val)))))
929 org-columns-overlays)))) 931 org-columns-overlays))))
930 932
933(defvar org-inlinetask-min-level
934 (if (featurep 'org-inlinetask) org-inlinetask-min-level 15))
931(defun org-columns-compute (property) 935(defun org-columns-compute (property)
932 "Sum the values of property PROPERTY hierarchically, for the entire buffer." 936 "Sum the values of property PROPERTY hierarchically, for the entire buffer."
933 (interactive) 937 (interactive)
@@ -942,7 +946,9 @@ Don't set this, this is meant for dynamic scoping.")
942 (fun (nth 6 ass)) 946 (fun (nth 6 ass))
943 (calc (or (nth 7 ass) 'identity)) 947 (calc (or (nth 7 ass) 'identity))
944 (beg org-columns-top-level-marker) 948 (beg org-columns-top-level-marker)
945 last-level val valflag flag end sumpos sum-alist sum str str1 useval) 949 (inminlevel org-inlinetask-min-level)
950 (last-level org-inlinetask-min-level)
951 val valflag flag end sumpos sum-alist sum str str1 useval)
946 (save-excursion 952 (save-excursion
947 ;; Find the region to compute 953 ;; Find the region to compute
948 (goto-char beg) 954 (goto-char beg)
@@ -951,16 +957,21 @@ Don't set this, this is meant for dynamic scoping.")
951 ;; Walk the tree from the back and do the computations 957 ;; Walk the tree from the back and do the computations
952 (while (re-search-backward re beg t) 958 (while (re-search-backward re beg t)
953 (setq sumpos (match-beginning 0) 959 (setq sumpos (match-beginning 0)
954 last-level level 960 last-level (if (not (or (zerop level) (eq level inminlevel)))
961 level last-level)
955 level (org-outline-level) 962 level (org-outline-level)
956 val (org-entry-get nil property) 963 val (org-entry-get nil property)
957 valflag (and val (string-match "\\S-" val))) 964 valflag (and val (string-match "\\S-" val)))
958 (cond 965 (cond
959 ((< level last-level) 966 ((< level last-level)
960 ;; put the sum of lower levels here as a property 967 ;; put the sum of lower levels here as a property
961 (setq sum (when (aref lvals last-level) 968 (setq sum (+ (if (and (/= last-level inminlevel)
962 (apply fun (aref lvals last-level))) 969 (aref lvals last-level))
963 flag (aref lflag last-level) ; any valid entries from children? 970 (apply fun (aref lvals last-level)) 0)
971 (if (aref lvals inminlevel)
972 (apply fun (aref lvals inminlevel)) 0))
973 flag (or (aref lflag last-level) ; any valid entries from children?
974 (aref lflag inminlevel)) ; or inline tasks?
964 str (org-columns-number-to-string sum format printf) 975 str (org-columns-number-to-string sum format printf)
965 str1 (org-add-props (copy-sequence str) nil 'org-computed t 'face 'bold) 976 str1 (org-add-props (copy-sequence str) nil 'org-computed t 'face 'bold)
966 useval (if flag str1 (if valflag val "")) 977 useval (if flag str1 (if valflag val ""))
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 7c969375a7f..ce72e25d991 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -1,6 +1,6 @@
1;;; org-compat.el --- Compatibility code for Org-mode 1;;; org-compat.el --- Compatibility code for Org-mode
2 2
3;; Copyright (C) 2004-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el
index a128b046038..c613ba20e48 100644
--- a/lisp/org/org-crypt.el
+++ b/lisp/org/org-crypt.el
@@ -236,16 +236,20 @@ See `org-crypt-disable-auto-save'."
236(defun org-encrypt-entries () 236(defun org-encrypt-entries ()
237 "Encrypt all top-level entries in the current buffer." 237 "Encrypt all top-level entries in the current buffer."
238 (interactive) 238 (interactive)
239 (org-scan-tags 239 (let (todo-only)
240 'org-encrypt-entry 240 (org-scan-tags
241 (cdr (org-make-tags-matcher org-crypt-tag-matcher)))) 241 'org-encrypt-entry
242 (cdr (org-make-tags-matcher org-crypt-tag-matcher))
243 todo-only)))
242 244
243(defun org-decrypt-entries () 245(defun org-decrypt-entries ()
244 "Decrypt all entries in the current buffer." 246 "Decrypt all entries in the current buffer."
245 (interactive) 247 (interactive)
246 (org-scan-tags 248 (let (todo-only)
247 'org-decrypt-entry 249 (org-scan-tags
248 (cdr (org-make-tags-matcher org-crypt-tag-matcher)))) 250 'org-decrypt-entry
251 (cdr (org-make-tags-matcher org-crypt-tag-matcher))
252 todo-only)))
249 253
250(defun org-crypt-use-before-save-magic () 254(defun org-crypt-use-before-save-magic ()
251 "Add a hook to automatically encrypt entries before a file is saved to disk." 255 "Add a hook to automatically encrypt entries before a file is saved to disk."
diff --git a/lisp/org/org-ctags.el b/lisp/org/org-ctags.el
index ea94d419957..8b5bc6ecdf6 100644
--- a/lisp/org/org-ctags.el
+++ b/lisp/org/org-ctags.el
@@ -162,6 +162,7 @@ See the ctags documentation for more information.")
162 (t "ctags-exuberant")) 162 (t "ctags-exuberant"))
163 "Full path to the ctags executable file." 163 "Full path to the ctags executable file."
164 :group 'org-ctags 164 :group 'org-ctags
165 :version "24.1"
165 :type 'file) 166 :type 'file)
166 167
167(defcustom org-ctags-open-link-functions 168(defcustom org-ctags-open-link-functions
@@ -170,6 +171,7 @@ See the ctags documentation for more information.")
170 org-ctags-ask-append-topic) 171 org-ctags-ask-append-topic)
171 "List of functions to be prepended to ORG-OPEN-LINK-FUNCTIONS when ORG-CTAGS is active." 172 "List of functions to be prepended to ORG-OPEN-LINK-FUNCTIONS when ORG-CTAGS is active."
172 :group 'org-ctags 173 :group 'org-ctags
174 :version "24.1"
173 :type 'hook 175 :type 'hook
174 :options '(org-ctags-find-tag 176 :options '(org-ctags-find-tag
175 org-ctags-ask-rebuild-tags-file-then-find-tag 177 org-ctags-ask-rebuild-tags-file-then-find-tag
@@ -186,7 +188,7 @@ See the ctags documentation for more information.")
186Created as a local variable in each buffer.") 188Created as a local variable in each buffer.")
187 189
188(defcustom org-ctags-new-topic-template 190(defcustom org-ctags-new-topic-template
189 "* <<%t>>\n\n\n\n\n\n" 191 " <<%t>>\n\n\n\n\n\n"
190 "Text to insert when creating a new org file via opening a hyperlink. 192 "Text to insert when creating a new org file via opening a hyperlink.
191The following patterns are replaced in the string: 193The following patterns are replaced in the string:
192 `%t' - replaced with the capitalized title of the hyperlink" 194 `%t' - replaced with the capitalized title of the hyperlink"
diff --git a/lisp/org/org-datetree.el b/lisp/org/org-datetree.el
index 3042be782c9..192d1d6e6df 100644
--- a/lisp/org/org-datetree.el
+++ b/lisp/org/org-datetree.el
@@ -1,6 +1,6 @@
1;;; org-datetree.el --- Create date entries in a tree 1;;; org-datetree.el --- Create date entries in a tree
2 2
3;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org/org-docbook.el b/lisp/org/org-docbook.el
index 499ab5da7d9..c3fd62c1fe2 100644
--- a/lisp/org/org-docbook.el
+++ b/lisp/org/org-docbook.el
@@ -1,6 +1,6 @@
1;;; org-docbook.el --- DocBook exporter for org-mode 1;;; org-docbook.el --- DocBook exporter for org-mode
2;; 2;;
3;; Copyright (C) 2007-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
4;; 4;;
5;; Emacs Lisp Archive Entry 5;; Emacs Lisp Archive Entry
6;; Filename: org-docbook.el 6;; Filename: org-docbook.el
@@ -150,6 +150,7 @@ avoid same set of footnote IDs being used multiple times."
150(defcustom org-export-docbook-footnote-separator "<superscript>, </superscript>" 150(defcustom org-export-docbook-footnote-separator "<superscript>, </superscript>"
151 "Text used to separate footnotes." 151 "Text used to separate footnotes."
152 :group 'org-export-docbook 152 :group 'org-export-docbook
153 :version "24.1"
153 :type 'string) 154 :type 'string)
154 155
155(defcustom org-export-docbook-emphasis-alist 156(defcustom org-export-docbook-emphasis-alist
@@ -195,6 +196,7 @@ This XSLT stylesheet is used by
195Object (FO) files. You can use either `fo/docbook.xsl' that 196Object (FO) files. You can use either `fo/docbook.xsl' that
196comes with DocBook, or any customization layer you may have." 197comes with DocBook, or any customization layer you may have."
197 :group 'org-export-docbook 198 :group 'org-export-docbook
199 :version "24.1"
198 :type 'string) 200 :type 'string)
199 201
200(defcustom org-export-docbook-xslt-proc-command nil 202(defcustom org-export-docbook-xslt-proc-command nil
diff --git a/lisp/org/org-entities.el b/lisp/org/org-entities.el
index fe3c52892a1..8b5b3f312e4 100644
--- a/lisp/org/org-entities.el
+++ b/lisp/org/org-entities.el
@@ -44,6 +44,7 @@
44For example, this will replace \"\\nsup\" with \"[not a superset of]\" 44For example, this will replace \"\\nsup\" with \"[not a superset of]\"
45in backends where the corresponding character is not available." 45in backends where the corresponding character is not available."
46 :group 'org-entities 46 :group 'org-entities
47 :version "24.1"
47 :type 'boolean) 48 :type 'boolean)
48 49
49(defcustom org-entities-user nil 50(defcustom org-entities-user nil
@@ -68,6 +69,7 @@ utf-8 replacement Use the special characters available in utf-8.
68If you define new entities here that require specific LaTeX packages to be 69If you define new entities here that require specific LaTeX packages to be
69loaded, add these packages to `org-export-latex-packages-alist'." 70loaded, add these packages to `org-export-latex-packages-alist'."
70 :group 'org-entities 71 :group 'org-entities
72 :version "24.1"
71 :type '(repeat 73 :type '(repeat
72 (list 74 (list
73 (string :tag "name ") 75 (string :tag "name ")
diff --git a/lisp/org/org-eshell.el b/lisp/org/org-eshell.el
index 16b19e26d08..f572095d818 100644
--- a/lisp/org/org-eshell.el
+++ b/lisp/org/org-eshell.el
@@ -3,7 +3,6 @@
3;; Copyright (C) 2011-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 4
5;; Author: Konrad Hinsen <konrad.hinsen AT fastmail.net> 5;; Author: Konrad Hinsen <konrad.hinsen AT fastmail.net>
6;; Version: 0.1
7 6
8;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
9 8
diff --git a/lisp/org/org-exp-blocks.el b/lisp/org/org-exp-blocks.el
index e5ff5c59eec..7d466cec65d 100644
--- a/lisp/org/org-exp-blocks.el
+++ b/lisp/org/org-exp-blocks.el
@@ -57,9 +57,9 @@
57;; using the dot utility. For information on dot see 57;; using the dot utility. For information on dot see
58;; http://www.graphviz.org/ 58;; http://www.graphviz.org/
59;; 59;;
60;; comment :: Wrap comments with titles and author information, in 60;; export-comment :: Wrap comments with titles and author information,
61;; their own divs with author-specific ids allowing for css 61;; in their own divs with author-specific ids allowing for
62;; coloring of comments based on the author. 62;; css coloring of comments based on the author.
63;; 63;;
64;;; Adding new blocks 64;;; Adding new blocks
65;; 65;;
@@ -73,6 +73,7 @@
73(eval-when-compile 73(eval-when-compile
74 (require 'cl)) 74 (require 'cl))
75(require 'org) 75(require 'org)
76(require 'find-func)
76 77
77(defun org-export-blocks-set (var value) 78(defun org-export-blocks-set (var value)
78 "Set the value of `org-export-blocks' and install fontification." 79 "Set the value of `org-export-blocks' and install fontification."
@@ -87,7 +88,7 @@
87 value)) 88 value))
88 89
89(defcustom org-export-blocks 90(defcustom org-export-blocks
90 '((comment org-export-blocks-format-comment t) 91 '((export-comment org-export-blocks-format-comment t)
91 (ditaa org-export-blocks-format-ditaa nil) 92 (ditaa org-export-blocks-format-ditaa nil)
92 (dot org-export-blocks-format-dot nil)) 93 (dot org-export-blocks-format-dot nil))
93 "Use this alist to associate block types with block exporting functions. 94 "Use this alist to associate block types with block exporting functions.
@@ -135,6 +136,7 @@ export function should accept three arguments."
135(defcustom org-export-blocks-postblock-hook nil 136(defcustom org-export-blocks-postblock-hook nil
136 "Run after blocks have been processed with `org-export-blocks-preprocess'." 137 "Run after blocks have been processed with `org-export-blocks-preprocess'."
137 :group 'org-export-general 138 :group 'org-export-general
139 :version "24.1"
138 :type 'hook) 140 :type 'hook)
139 141
140(defun org-export-blocks-html-quote (body &optional open close) 142(defun org-export-blocks-html-quote (body &optional open close)
@@ -224,7 +226,7 @@ which defaults to the value of `org-export-blocks-witheld'."
224 226
225;;-------------------------------------------------------------------------------- 227;;--------------------------------------------------------------------------------
226;; ditaa: create images from ASCII art using the ditaa utility 228;; ditaa: create images from ASCII art using the ditaa utility
227(defvar org-ditaa-jar-path (expand-file-name 229(defcustom org-ditaa-jar-path (expand-file-name
228 "ditaa.jar" 230 "ditaa.jar"
229 (file-name-as-directory 231 (file-name-as-directory
230 (expand-file-name 232 (expand-file-name
@@ -232,8 +234,10 @@ which defaults to the value of `org-export-blocks-witheld'."
232 (file-name-as-directory 234 (file-name-as-directory
233 (expand-file-name 235 (expand-file-name
234 "../contrib" 236 "../contrib"
235 (file-name-directory (or load-file-name buffer-file-name))))))) 237 (file-name-directory (find-library-name "org")))))))
236 "Path to the ditaa jar executable.") 238 "Path to the ditaa jar executable."
239 :group 'org-babel
240 :type 'string)
237 241
238(defvar org-export-current-backend) ; dynamically bound in org-exp.el 242(defvar org-export-current-backend) ; dynamically bound in org-exp.el
239(defun org-export-blocks-format-ditaa (body &rest headers) 243(defun org-export-blocks-format-ditaa (body &rest headers)
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el
index c7e1a94216e..174619a3b8f 100644
--- a/lisp/org/org-exp.el
+++ b/lisp/org/org-exp.el
@@ -98,6 +98,7 @@ is nil, the buffer remains buried also in these cases."
98This applied to the commands `org-export-as-html-and-open' and 98This applied to the commands `org-export-as-html-and-open' and
99`org-export-as-pdf-and-open'." 99`org-export-as-pdf-and-open'."
100 :group 'org-export-general 100 :group 'org-export-general
101 :version "24.1"
101 :type 'boolean) 102 :type 'boolean)
102 103
103(defcustom org-export-run-in-background nil 104(defcustom org-export-run-in-background nil
@@ -120,6 +121,7 @@ force an export command into the current process."
120 "The initial scope when exporting with `org-export'. 121 "The initial scope when exporting with `org-export'.
121This variable can be either set to 'buffer or 'subtree." 122This variable can be either set to 'buffer or 'subtree."
122 :group 'org-export-general 123 :group 'org-export-general
124 :version "24.1"
123 :type '(choice 125 :type '(choice
124 (const :tag "Export current buffer" 'buffer) 126 (const :tag "Export current buffer" 'buffer)
125 (const :tag "Export current subtree" 'subtree))) 127 (const :tag "Export current subtree" 'subtree)))
@@ -220,6 +222,7 @@ and in `org-clock-clocktable-language-setup'."
220(defcustom org-export-date-timestamp-format "%Y-%m-%d" 222(defcustom org-export-date-timestamp-format "%Y-%m-%d"
221 "Time string format for Org timestamps in the #+DATE option." 223 "Time string format for Org timestamps in the #+DATE option."
222 :group 'org-export-general 224 :group 'org-export-general
225 :version "24.1"
223 :type 'string) 226 :type 'string)
224 227
225(defvar org-export-page-description "" 228(defvar org-export-page-description ""
@@ -317,6 +320,7 @@ done include only tasks that are already done.
317nil remove all tasks before export 320nil remove all tasks before export
318list of TODO kwds keep only tasks with these keywords" 321list of TODO kwds keep only tasks with these keywords"
319 :group 'org-export-general 322 :group 'org-export-general
323 :version "24.1"
320 :type '(choice 324 :type '(choice
321 (const :tag "All tasks" t) 325 (const :tag "All tasks" t)
322 (const :tag "No tasks" nil) 326 (const :tag "No tasks" nil)
@@ -367,6 +371,7 @@ e.g. \"author:nil\"."
367This option can also be set with the +OPTIONS line, 371This option can also be set with the +OPTIONS line,
368e.g. \"email:t\"." 372e.g. \"email:t\"."
369 :group 'org-export-general 373 :group 'org-export-general
374 :version "24.1"
370 :type 'boolean) 375 :type 'boolean)
371 376
372(defcustom org-export-creator-info t 377(defcustom org-export-creator-info t
@@ -594,6 +599,7 @@ the values of constants may be useful to have."
594This is the global equivalent of the :remove-nil-lines option 599This is the global equivalent of the :remove-nil-lines option
595when locally sending a table with #+ORGTBL." 600when locally sending a table with #+ORGTBL."
596 :group 'org-export-tables 601 :group 'org-export-tables
602 :version "24.1"
597 :type 'boolean) 603 :type 'boolean)
598 604
599(defcustom org-export-prefer-native-exporter-for-tables nil 605(defcustom org-export-prefer-native-exporter-for-tables nil
@@ -1730,10 +1736,11 @@ from the buffer."
1730 ":[ \t]*\\(.*\\)") nil t) 1736 ":[ \t]*\\(.*\\)") nil t)
1731 (if (not (eq backend org-export-current-backend)) 1737 (if (not (eq backend org-export-current-backend))
1732 (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max))) 1738 (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
1733 (replace-match "\\1\\2" t) 1739 (let ((ind (get-text-property (point-at-bol) 'original-indentation)))
1734 (add-text-properties 1740 (replace-match "\\1\\2" t)
1735 (point-at-bol) (min (1+ (point-at-eol)) (point-max)) 1741 (add-text-properties
1736 `(org-protected t original-indentation ,ind org-native-text t)))) 1742 (point-at-bol) (min (1+ (point-at-eol)) (point-max))
1743 `(org-protected t original-indentation ,ind org-native-text t)))))
1737 ;; Delete #+ATTR_BACKEND: stuff of another backend. Those 1744 ;; Delete #+ATTR_BACKEND: stuff of another backend. Those
1738 ;; matching the current backend will be taken care of by 1745 ;; matching the current backend will be taken care of by
1739 ;; `org-export-attach-captions-and-attributes' 1746 ;; `org-export-attach-captions-and-attributes'
@@ -1748,7 +1755,8 @@ from the buffer."
1748 (while (re-search-forward (concat "^[ \t]*#\\+BEGIN_" backend-name "\\>.*\n?") 1755 (while (re-search-forward (concat "^[ \t]*#\\+BEGIN_" backend-name "\\>.*\n?")
1749 nil t) 1756 nil t)
1750 (setq beg (match-beginning 0) beg-content (match-end 0)) 1757 (setq beg (match-beginning 0) beg-content (match-end 0))
1751 (setq ind (save-excursion (goto-char beg) (org-get-indentation))) 1758 (setq ind (or (get-text-property beg 'original-indentation)
1759 (save-excursion (goto-char beg) (org-get-indentation))))
1752 (when (re-search-forward (concat "^[ \t]*#\\+END_" backend-name "\\>.*\n?") 1760 (when (re-search-forward (concat "^[ \t]*#\\+END_" backend-name "\\>.*\n?")
1753 nil t) 1761 nil t)
1754 (setq end (match-end 0) end-content (match-beginning 0)) 1762 (setq end (match-end 0) end-content (match-beginning 0))
@@ -1759,17 +1767,7 @@ from the buffer."
1759 beg-content end-content 1767 beg-content end-content
1760 `(org-protected t original-indentation ,ind org-native-text t)) 1768 `(org-protected t original-indentation ,ind org-native-text t))
1761 ;; strip protective commas 1769 ;; strip protective commas
1762 (save-excursion 1770 (org-strip-protective-commas beg-content end-content)
1763 (save-match-data
1764 (goto-char beg-content)
1765 (let ((front-line (save-excursion
1766 (re-search-forward
1767 "[^[:space:]]" end-content t)
1768 (goto-char (match-beginning 0))
1769 (current-column))))
1770 (while (re-search-forward "^[ \t]*\\(,\\)" end-content t)
1771 (when (= (current-column) front-line)
1772 (replace-match "" nil nil nil 1))))))
1773 (delete-region (match-beginning 0) (match-end 0)) 1771 (delete-region (match-beginning 0) (match-end 0))
1774 (save-excursion 1772 (save-excursion
1775 (goto-char beg) 1773 (goto-char beg)
@@ -1816,8 +1814,7 @@ These special cookies will later be interpreted by the backend."
1816 (top (point-at-bol)) 1814 (top (point-at-bol))
1817 (top-ind (org-list-get-ind top struct))) 1815 (top-ind (org-list-get-ind top struct)))
1818 (goto-char bottom) 1816 (goto-char bottom)
1819 (when (and (not (eq org-list-ending-method 'indent)) 1817 (when (and (not (looking-at "[ \t]*$"))
1820 (not (looking-at "[ \t]*$"))
1821 (looking-at org-list-end-re)) 1818 (looking-at org-list-end-re))
1822 (replace-match "")) 1819 (replace-match ""))
1823 (unless (bolp) (insert "\n")) 1820 (unless (bolp) (insert "\n"))
@@ -1875,8 +1872,7 @@ These special properties will later be interpreted by the backend."
1875 ;; useful to line processing exporters. 1872 ;; useful to line processing exporters.
1876 (goto-char bottom) 1873 (goto-char bottom)
1877 (when (or (looking-at "^ORG-LIST-END-MARKER\n") 1874 (when (or (looking-at "^ORG-LIST-END-MARKER\n")
1878 (and (not (eq org-list-ending-method 'indent)) 1875 (and (not (looking-at "[ \t]*$"))
1879 (not (looking-at "[ \t]*$"))
1880 (looking-at org-list-end-re))) 1876 (looking-at org-list-end-re)))
1881 (replace-match "")) 1877 (replace-match ""))
1882 (unless (bolp) (insert "\n")) 1878 (unless (bolp) (insert "\n"))
@@ -2203,7 +2199,7 @@ can work correctly."
2203 ;; This is a subtree, we take the title from the first heading 2199 ;; This is a subtree, we take the title from the first heading
2204 (goto-char rbeg) 2200 (goto-char rbeg)
2205 (looking-at org-todo-line-tags-regexp) 2201 (looking-at org-todo-line-tags-regexp)
2206 (setq title (if (eq tags t) 2202 (setq title (if (and (eq tags t) (match-string 4))
2207 (format "%s\t%s" (match-string 3) (match-string 4)) 2203 (format "%s\t%s" (match-string 3) (match-string 4))
2208 (match-string 3))) 2204 (match-string 3)))
2209 (org-unmodified 2205 (org-unmodified
@@ -3277,7 +3273,7 @@ If yes remove the column and the special lines."
3277 ((org-table-cookie-line-p x) 3273 ((org-table-cookie-line-p x)
3278 ;; This line contains formatting cookies, discard it 3274 ;; This line contains formatting cookies, discard it
3279 nil) 3275 nil)
3280 ((string-match "^[ \t]*| *[!_^/] *|" x) 3276 ((string-match "^[ \t]*| *\\([!_^/$]\\|\\\\\\$\\) *|" x)
3281 ;; ignore this line 3277 ;; ignore this line
3282 nil) 3278 nil)
3283 ((or (string-match "^\\([ \t]*\\)|-+\\+" x) 3279 ((or (string-match "^\\([ \t]*\\)|-+\\+" x)
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index e71ce2322ae..481d662eca1 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -351,6 +351,7 @@ keywords will then be interpreted as either foreground or background
351color." 351color."
352 :group 'org-faces 352 :group 'org-faces
353 :group 'org-todo 353 :group 'org-todo
354 :version "24.1"
354 :type '(repeat 355 :type '(repeat
355 (cons (choice (const todo) (const tag) (const priority)) 356 (cons (choice (const todo) (const tag) (const priority))
356 (choice (const :foreground) (const :background))))) 357 (choice (const :foreground) (const :background)))))
@@ -547,6 +548,7 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
547When nil, format these as normal Org. This is the default, because the 548When nil, format these as normal Org. This is the default, because the
548content of these blocks will still be treated as Org syntax." 549content of these blocks will still be treated as Org syntax."
549 :group 'org-faces 550 :group 'org-faces
551 :version "24.1"
550 :type 'boolean) 552 :type 'boolean)
551 553
552(defface org-clock-overlay ;; copied from secondary-selection 554(defface org-clock-overlay ;; copied from secondary-selection
@@ -732,6 +734,7 @@ If nil, then all levels >=org-n-level-faces are styled like
732level org-n-level-faces" 734level org-n-level-faces"
733 :group 'org-appearance 735 :group 'org-appearance
734 :group 'org-faces 736 :group 'org-faces
737 :version "24.1"
735 :type 'boolean) 738 :type 'boolean)
736 739
737(defface org-latex-and-export-specials 740(defface org-latex-and-export-specials
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el
index 573bd648959..34fc31f39d6 100644
--- a/lisp/org/org-footnote.el
+++ b/lisp/org/org-footnote.el
@@ -58,6 +58,7 @@
58(declare-function org-show-context "org" (&optional key)) 58(declare-function org-show-context "org" (&optional key))
59(declare-function org-trim "org" (s)) 59(declare-function org-trim "org" (s))
60(declare-function outline-next-heading "outline") 60(declare-function outline-next-heading "outline")
61(declare-function org-skip-whitespace "org" ())
61 62
62(defvar org-outline-regexp-bol) ; defined in org.el 63(defvar org-outline-regexp-bol) ; defined in org.el
63(defvar org-odd-levels-only) ; defined in org.el 64(defvar org-odd-levels-only) ; defined in org.el
@@ -84,8 +85,8 @@
84 (org-re "^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]") 85 (org-re "^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]")
85 "Regular expression matching the definition of a footnote.") 86 "Regular expression matching the definition of a footnote.")
86 87
87(defvar org-footnote-forbidden-blocks '("example" "verse" "src" "ascii" "beamer" 88(defconst org-footnote-forbidden-blocks
88 "docbook" "html" "latex" "odt") 89 '("ascii" "beamer" "comment" "docbook" "example" "html" "latex" "odt" "src")
89 "Names of blocks where footnotes are not allowed.") 90 "Names of blocks where footnotes are not allowed.")
90 91
91(defgroup org-footnote nil 92(defgroup org-footnote nil
@@ -242,40 +243,46 @@ positions, and the definition, when inlined."
242 (match-end 0) (1- end))))))))) 243 (match-end 0) (1- end)))))))))
243 244
244(defun org-footnote-at-definition-p () 245(defun org-footnote-at-definition-p ()
245 "Is the cursor at a footnote definition? 246 "Is point within a footnote definition?
246 247
247This matches only pure definitions like [1] or [fn:name] at the beginning 248This matches only pure definitions like [1] or [fn:name] at the
248of a line. It does not match references like [fn:name:definition], where the 249beginning of a line. It does not match references like
249footnote text is included and defined locally. 250\[fn:name:definition], where the footnote text is included and
251defined locally.
250 252
251The return value will be nil if not at a footnote definition, and a list with 253The return value will be nil if not at a footnote definition, and
252label, start, end and definition of the footnote otherwise." 254a list with label, start, end and definition of the footnote
255otherwise."
253 (when (save-excursion (beginning-of-line) (org-footnote-in-valid-context-p)) 256 (when (save-excursion (beginning-of-line) (org-footnote-in-valid-context-p))
254 (save-excursion 257 (save-excursion
255 (end-of-line) 258 (end-of-line)
259 ;; Footnotes definitions are separated by new headlines or blank
260 ;; lines.
256 (let ((lim (save-excursion (re-search-backward 261 (let ((lim (save-excursion (re-search-backward
257 (concat org-outline-regexp-bol 262 (concat org-outline-regexp-bol
258 "\\|^[ \t]*$") nil t)))) 263 "\\|^[ \t]*$") nil t))))
259 (when (re-search-backward org-footnote-definition-re lim t) 264 (when (re-search-backward org-footnote-definition-re lim t)
260 (end-of-line) 265 (let ((label (org-match-string-no-properties 1))
261 (list (org-match-string-no-properties 1) 266 (beg (match-beginning 0))
262 (match-beginning 0) 267 (beg-def (match-end 0))
263 (save-match-data 268 ;; In message-mode, do not search after signature.
264 ;; In a message, limit search to signature. 269 (end (let ((bound (and (derived-mode-p 'message-mode)
265 (let ((bound (and (derived-mode-p 'message-mode) 270 (save-excursion
266 (save-excursion 271 (goto-char (point-max))
267 (goto-char (point-max)) 272 (re-search-backward
268 (re-search-backward 273 message-signature-separator nil t)))))
269 message-signature-separator nil t))))) 274 (if (progn
270 (or (and (re-search-forward 275 (end-of-line)
276 (re-search-forward
271 (concat org-outline-regexp-bol "\\|" 277 (concat org-outline-regexp-bol "\\|"
272 org-footnote-definition-re "\\|" 278 org-footnote-definition-re "\\|"
273 "^[ \t]*$") 279 "^[ \t]*$") bound 'move))
274 bound 'move) 280 (progn (goto-char (match-beginning 0))
275 (progn (skip-chars-forward " \t\n") (point-at-bol))) 281 (org-skip-whitespace)
276 (point)))) 282 (point-at-bol))
277 (org-trim (buffer-substring-no-properties 283 (point)))))
278 (match-end 0) (point))))))))) 284 (list label beg end
285 (org-trim (buffer-substring-no-properties beg-def end)))))))))
279 286
280(defun org-footnote-get-next-reference (&optional label backward limit) 287(defun org-footnote-get-next-reference (&optional label backward limit)
281 "Return complete reference of the next footnote. 288 "Return complete reference of the next footnote.
@@ -541,7 +548,9 @@ or new, let the user edit the definition of the footnote."
541 (unless (bolp) (newline)) 548 (unless (bolp) (newline))
542 (set-marker max nil)))) 549 (set-marker max nil))))
543 ;; Insert footnote label. 550 ;; Insert footnote label.
544 (insert "\n[" label "] ") 551 (when (zerop (org-back-over-empty-lines)) (newline))
552 (insert "[" label "] \n")
553 (backward-char)
545 ;; Only notify user about next possible action when in an Org 554 ;; Only notify user about next possible action when in an Org
546 ;; buffer, as the bindings may have different meanings otherwise. 555 ;; buffer, as the bindings may have different meanings otherwise.
547 (when (eq major-mode 'org-mode) 556 (when (eq major-mode 'org-mode)
@@ -651,6 +660,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
651 (goto-char (point-min)) 660 (goto-char (point-min))
652 (while (setq ref (org-footnote-get-next-reference)) 661 (while (setq ref (org-footnote-get-next-reference))
653 (let* ((lbl (car ref)) 662 (let* ((lbl (car ref))
663 (pos (nth 1 ref))
654 ;; When footnote isn't anonymous, check if it's label 664 ;; When footnote isn't anonymous, check if it's label
655 ;; (REF) is already stored in REF-TABLE. In that case, 665 ;; (REF) is already stored in REF-TABLE. In that case,
656 ;; extract number used to identify it (MARKER). If 666 ;; extract number used to identify it (MARKER). If
@@ -667,8 +677,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
667 ;; If EXPORT-PROPS isn't nil, also add `org-footnote' 677 ;; If EXPORT-PROPS isn't nil, also add `org-footnote'
668 ;; property to it, so it can be easily recognized by 678 ;; property to it, so it can be easily recognized by
669 ;; exporters. 679 ;; exporters.
670 (if sort-only 680 (if sort-only (goto-char (nth 2 ref))
671 (goto-char (nth 2 ref))
672 (delete-region (nth 1 ref) (nth 2 ref)) 681 (delete-region (nth 1 ref) (nth 2 ref))
673 (goto-char (nth 1 ref)) 682 (goto-char (nth 1 ref))
674 (let ((new-ref (format "[%d]" marker))) 683 (let ((new-ref (format "[%d]" marker)))
@@ -678,7 +687,8 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
678 org-footnote-fill-after-inline-note-extraction 687 org-footnote-fill-after-inline-note-extraction
679 (org-fill-paragraph))) 688 (org-fill-paragraph)))
680 ;; Add label (REF), identifier (MARKER), definition (DEF) 689 ;; Add label (REF), identifier (MARKER), definition (DEF)
681 ;; and type (INLINEP) to REF-TABLE if data was unknown. 690 ;; type (INLINEP) and position (POS) to REF-TABLE if data
691 ;; was unknown.
682 (unless a 692 (unless a
683 (let ((def (or (nth 3 ref) ; inline 693 (let ((def (or (nth 3 ref) ; inline
684 (and export-props 694 (and export-props
@@ -696,27 +706,35 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
696 '(:todo-keywords t :tags t :priority t)))) 706 '(:todo-keywords t :tags t :priority t))))
697 (org-export-preprocess-string def parameters)) 707 (org-export-preprocess-string def parameters))
698 def) 708 def)
699 inlinep) ref-table))))) 709 ;; Reference beginning position is a marker
710 ;; to preserve it during further buffer
711 ;; modifications.
712 inlinep (copy-marker pos)) ref-table)))))
700 ;; 2. Find and remove the footnote section, if any. Also 713 ;; 2. Find and remove the footnote section, if any. Also
701 ;; determine where footnotes shall be inserted (INS-POINT). 714 ;; determine where footnotes shall be inserted (INS-POINT).
702 (goto-char (point-min))
703 (cond 715 (cond
704 ((and org-footnote-section 716 ((and org-footnote-section (eq major-mode 'org-mode))
705 (eq major-mode 'org-mode) 717 (goto-char (point-min))
706 (re-search-forward 718 (if (re-search-forward
707 (concat "^\\*[ \t]+" (regexp-quote org-footnote-section) 719 (concat "^\\*[ \t]+" (regexp-quote org-footnote-section)
708 "[ \t]*$") 720 "[ \t]*$") nil t)
709 nil t)) 721 (delete-region (match-beginning 0) (org-end-of-subtree t t)))
710 (delete-region (match-beginning 0) (org-end-of-subtree t))) 722 ;; A new footnote section is inserted by default at the end of
711 ((eq major-mode 'org-mode) 723 ;; the buffer.
712 (goto-char (point-max)) 724 (goto-char (point-max))
725 (skip-chars-backward " \r\t\n")
726 (forward-line)
713 (unless (bolp) (newline))) 727 (unless (bolp) (newline)))
728 ;; No footnote section set: Footnotes will be added at the end
729 ;; of the section containing their first reference.
730 ((eq major-mode 'org-mode))
714 (t 731 (t
715 ;; Remove any left-over tag in the buffer, if one is set up. 732 ;; Remove any left-over tag in the buffer, if one is set up.
716 (when org-footnote-tag-for-non-org-mode-files 733 (when org-footnote-tag-for-non-org-mode-files
717 (let ((tag (concat "^" (regexp-quote 734 (let ((tag (concat "^" (regexp-quote
718 org-footnote-tag-for-non-org-mode-files) 735 org-footnote-tag-for-non-org-mode-files)
719 "[ \t]*$"))) 736 "[ \t]*$")))
737 (goto-char (point-min))
720 (while (re-search-forward tag nil t) 738 (while (re-search-forward tag nil t)
721 (replace-match "") 739 (replace-match "")
722 (delete-region (point) (progn (forward-line) (point)))))) 740 (delete-region (point) (progn (forward-line) (point))))))
@@ -742,18 +760,21 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
742 (lambda (x) 760 (lambda (x)
743 (cond 761 (cond
744 ;; When only sorting, ignore inline footnotes. 762 ;; When only sorting, ignore inline footnotes.
745 ((and sort-only (nth 3 x)) nil) 763 ;; Also clear position marker.
764 ((and sort-only (nth 3 x))
765 (set-marker (nth 4 x) nil) nil)
746 ;; No definition available: provide one. 766 ;; No definition available: provide one.
747 ((not (nth 2 x)) 767 ((not (nth 2 x))
748 (append (butlast x 2) 768 (append
749 (list (format "DEFINITION NOT FOUND: %s" (car x)) 769 (list (car x) (nth 1 x)
750 (nth 3 x)))) 770 (format "DEFINITION NOT FOUND: %s" (car x)))
771 (nthcdr 3 x)))
751 (t x))) 772 (t x)))
752 ref-table))) 773 ref-table)))
753 (setq ref-table (nreverse ref-table)) 774 (setq ref-table (nreverse ref-table))
754 ;; 4. Remove left-over definitions in the buffer. 775 ;; 4. Remove left-over definitions in the buffer.
755 (mapc (lambda (x) (unless (nth 3 x) 776 (mapc (lambda (x)
756 (org-footnote-delete-definitions (car x)))) 777 (unless (nth 3 x) (org-footnote-delete-definitions (car x))))
757 ref-table) 778 ref-table)
758 ;; 5. Insert the footnotes again in the buffer, at the 779 ;; 5. Insert the footnotes again in the buffer, at the
759 ;; appropriate spot. 780 ;; appropriate spot.
@@ -764,7 +785,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
764 ;; Cases when footnotes should be inserted in one place. 785 ;; Cases when footnotes should be inserted in one place.
765 ((or (not (eq major-mode 'org-mode)) 786 ((or (not (eq major-mode 'org-mode))
766 org-footnote-section 787 org-footnote-section
767 (not sort-only)) 788 export-props)
768 ;; Insert again the section title, if any. Ensure that title, 789 ;; Insert again the section title, if any. Ensure that title,
769 ;; or the subsequent footnotes, will be separated by a blank 790 ;; or the subsequent footnotes, will be separated by a blank
770 ;; lines from the rest of the document. In an Org buffer, 791 ;; lines from the rest of the document. In an Org buffer,
@@ -775,11 +796,6 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
775 (skip-chars-backward " \t\n\r") 796 (skip-chars-backward " \t\n\r")
776 (delete-region (point) ins-point) 797 (delete-region (point) ins-point)
777 (unless (bolp) (newline)) 798 (unless (bolp) (newline))
778 ;; Keep one blank line between footnotes and signature.
779 (when (and (derived-mode-p 'message-mode)
780 (save-excursion
781 (re-search-forward message-signature-separator nil t)))
782 (open-line 1))
783 (when org-footnote-tag-for-non-org-mode-files 799 (when org-footnote-tag-for-non-org-mode-files
784 (insert "\n" org-footnote-tag-for-non-org-mode-files "\n"))) 800 (insert "\n" org-footnote-tag-for-non-org-mode-files "\n")))
785 ((and org-footnote-section (not export-props)) 801 ((and org-footnote-section (not export-props))
@@ -789,31 +805,31 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
789 (insert "* " org-footnote-section "\n"))) 805 (insert "* " org-footnote-section "\n")))
790 (set-marker ins-point nil) 806 (set-marker ins-point nil)
791 ;; Insert the footnotes, separated by a blank line. 807 ;; Insert the footnotes, separated by a blank line.
792 (insert (mapconcat (lambda (x) (format "\n[%s] %s" 808 (insert
793 (nth (if sort-only 0 1) x) (nth 2 x))) 809 (mapconcat
794 ref-table "\n")) 810 (lambda (x)
795 (unless (eobp) (insert "\n")) 811 ;; Clean markers.
812 (set-marker (nth 4 x) nil)
813 (format "\n[%s] %s" (nth (if sort-only 0 1) x) (nth 2 x)))
814 ref-table "\n"))
815 (unless (eobp) (insert "\n\n"))
796 ;; When exporting, add newly inserted markers along with their 816 ;; When exporting, add newly inserted markers along with their
797 ;; associated definition to `org-export-footnotes-seen'. 817 ;; associated definition to `org-export-footnotes-seen'.
798 (when export-props 818 (when export-props (setq org-export-footnotes-seen ref-table)))
799 (setq org-export-footnotes-seen ref-table))) 819 ;; Each footnote definition has to be inserted at the end of
800 ;; Else, insert each definition at the end of the section 820 ;; the section where its first reference belongs.
801 ;; containing their first reference. Happens only in Org files 821 (t
802 ;; with no special footnote section, and only when doing 822 (mapc
803 ;; sorting. 823 (lambda (x)
804 (t (mapc 'org-insert-footnote-reference-near-definition 824 (let ((pos (nth 4 x)))
805 ref-table)))))) 825 (goto-char pos)
806 826 ;; Clean marker.
807(defun org-insert-footnote-reference-near-definition (entry) 827 (set-marker pos nil))
808 "Find first reference of footnote ENTRY and insert the definition there. 828 (org-footnote-goto-local-insertion-point)
809ENTRY is (fn-label num-mark definition)." 829 (insert (format "\n[%s] %s\n"
810 (when (car entry) 830 (if sort-only (car x) (nth 1 x))
811 (goto-char (point-min)) 831 (nth 2 x))))
812 (let ((ref (org-footnote-get-next-reference (car entry)))) 832 ref-table))))))
813 (when ref
814 (goto-char (nth 2 ref))
815 (org-footnote-goto-local-insertion-point)
816 (insert (format "\n[%s] %s\n" (car entry) (nth 2 entry)))))))
817 833
818(defun org-footnote-goto-local-insertion-point () 834(defun org-footnote-goto-local-insertion-point ()
819 "Find insertion point for footnote, just before next outline heading." 835 "Find insertion point for footnote, just before next outline heading."
@@ -848,8 +864,9 @@ Return the number of footnotes removed."
848 (ndef 0)) 864 (ndef 0))
849 (while (re-search-forward def-re nil t) 865 (while (re-search-forward def-re nil t)
850 (let ((full-def (org-footnote-at-definition-p))) 866 (let ((full-def (org-footnote-at-definition-p)))
851 (delete-region (nth 1 full-def) (nth 2 full-def))) 867 (when full-def
852 (incf ndef)) 868 (delete-region (nth 1 full-def) (nth 2 full-def))
869 (incf ndef))))
853 ndef))) 870 ndef)))
854 871
855(defun org-footnote-delete (&optional label) 872(defun org-footnote-delete (&optional label)
diff --git a/lisp/org/org-freemind.el b/lisp/org/org-freemind.el
index 8b774007206..3b94d928945 100644
--- a/lisp/org/org-freemind.el
+++ b/lisp/org/org-freemind.el
@@ -414,6 +414,7 @@ MATCHED is the link just matched."
414 ;; with this setting now, but not before??? Was this perhaps a java 414 ;; with this setting now, but not before??? Was this perhaps a java
415 ;; bug or is it a windows xp bug (some resource gets exhausted if you 415 ;; bug or is it a windows xp bug (some resource gets exhausted if you
416 ;; use sticky keys which I do). 416 ;; use sticky keys which I do).
417 :version "24.1"
417 :group 'org-freemind) 418 :group 'org-freemind)
418 419
419(defun org-freemind-org-text-to-freemind-subnode/note (node-name start end drawers-regexp) 420(defun org-freemind-org-text-to-freemind-subnode/note (node-name start end drawers-regexp)
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el
index f0c64a0d765..5b855c291f0 100644
--- a/lisp/org/org-gnus.el
+++ b/lisp/org/org-gnus.el
@@ -62,6 +62,7 @@ configured) IMAP servers don't support this operation quickly.
62So if following a link to a Gnus article takes ages, try setting 62So if following a link to a Gnus article takes ages, try setting
63this variable to `t'." 63this variable to `t'."
64 :group 'org-link-store 64 :group 'org-link-store
65 :version "24.1"
65 :type 'boolean) 66 :type 'boolean)
66 67
67 68
diff --git a/lisp/org/org-habit.el b/lisp/org/org-habit.el
index 67f87797cb1..6b4776662e2 100644
--- a/lisp/org/org-habit.el
+++ b/lisp/org/org-habit.el
@@ -70,11 +70,13 @@ relative to the current effective date."
70(defcustom org-habit-today-glyph ?! 70(defcustom org-habit-today-glyph ?!
71 "Glyph character used to identify today." 71 "Glyph character used to identify today."
72 :group 'org-habit 72 :group 'org-habit
73 :version "24.1"
73 :type 'character) 74 :type 'character)
74 75
75(defcustom org-habit-completed-glyph ?* 76(defcustom org-habit-completed-glyph ?*
76 "Glyph character used to show completed days on which a task was done." 77 "Glyph character used to show completed days on which a task was done."
77 :group 'org-habit 78 :group 'org-habit
79 :version "24.1"
78 :type 'character) 80 :type 'character)
79 81
80(defface org-habit-clear-face 82(defface org-habit-clear-face
@@ -334,7 +336,14 @@ current time."
334 (let ((inhibit-read-only t) l c 336 (let ((inhibit-read-only t) l c
335 (buffer-invisibility-spec '(org-link)) 337 (buffer-invisibility-spec '(org-link))
336 (moment (time-subtract (current-time) 338 (moment (time-subtract (current-time)
337 (list 0 (* 3600 org-extend-today-until) 0)))) 339 (list 0 (* 3600 org-extend-today-until) 0)))
340 disabled-overlays)
341 ;; Disable filters; this helps with alignment if there are links.
342 (mapc (lambda (ol)
343 (when (overlay-get ol 'invisible)
344 (overlay-put ol 'invisible nil)
345 (setq disabled-overlays (cons ol disabled-overlays))))
346 (overlays-in (point-min) (point-max)))
338 (save-excursion 347 (save-excursion
339 (goto-char (if line (point-at-bol) (point-min))) 348 (goto-char (if line (point-at-bol) (point-min)))
340 (while (not (eobp)) 349 (while (not (eobp))
@@ -344,14 +353,15 @@ current time."
344 (delete-char (min (+ 1 org-habit-preceding-days 353 (delete-char (min (+ 1 org-habit-preceding-days
345 org-habit-following-days) 354 org-habit-following-days)
346 (- (line-end-position) (point)))) 355 (- (line-end-position) (point))))
347 (insert (org-habit-build-graph 356 (insert-before-markers
348 habit 357 (org-habit-build-graph
349 (time-subtract moment 358 habit
350 (days-to-time org-habit-preceding-days)) 359 (time-subtract moment (days-to-time org-habit-preceding-days))
351 moment 360 moment
352 (time-add moment 361 (time-add moment (days-to-time org-habit-following-days))))))
353 (days-to-time org-habit-following-days)))))) 362 (forward-line)))
354 (forward-line))))) 363 (mapc (lambda (ol) (overlay-put ol 'invisible t))
364 disabled-overlays)))
355 365
356(defun org-habit-toggle-habits () 366(defun org-habit-toggle-habits ()
357 "Toggle display of habits in an agenda buffer." 367 "Toggle display of habits in an agenda buffer."
diff --git a/lisp/org/org-html.el b/lisp/org/org-html.el
index 82fdd507b03..5cecc44a2df 100644
--- a/lisp/org/org-html.el
+++ b/lisp/org/org-html.el
@@ -64,6 +64,7 @@ by the footnotes themselves."
64(defcustom org-export-html-footnote-separator "<sup>, </sup>" 64(defcustom org-export-html-footnote-separator "<sup>, </sup>"
65 "Text used to separate footnotes." 65 "Text used to separate footnotes."
66 :group 'org-export-html 66 :group 'org-export-html
67 :version "24.1"
67 :type 'string) 68 :type 'string)
68 69
69(defcustom org-export-html-coding-system nil 70(defcustom org-export-html-coding-system nil
@@ -252,6 +253,7 @@ You can also customize this for each buffer, using something like
252 253
253#+MATHJAX: scale:\"133\" align:\"right\" mathml:t path:\"/MathJax/\"" 254#+MATHJAX: scale:\"133\" align:\"right\" mathml:t path:\"/MathJax/\""
254 :group 'org-export-html 255 :group 'org-export-html
256 :version "24.1"
255 :type '(list :greedy t 257 :type '(list :greedy t
256 (list :tag "path (the path from where to load MathJax.js)" 258 (list :tag "path (the path from where to load MathJax.js)"
257 (const :format " " path) (string)) 259 (const :format " " path) (string))
@@ -335,6 +337,7 @@ You can also customize this for each buffer, using something like
335</script>" 337</script>"
336 "The MathJax setup for XHTML files." 338 "The MathJax setup for XHTML files."
337 :group 'org-export-html 339 :group 'org-export-html
340 :version "24.1"
338 :type 'string) 341 :type 'string)
339 342
340(defcustom org-export-html-tag-class-prefix "" 343(defcustom org-export-html-tag-class-prefix ""
@@ -361,6 +364,7 @@ It requires to %s: both will be replaced by the anchor referring
361to the headline (e.g. \"sec-2\"). When set to `nil', don't insert 364to the headline (e.g. \"sec-2\"). When set to `nil', don't insert
362HTML anchors in headlines." 365HTML anchors in headlines."
363 :group 'org-export-html 366 :group 'org-export-html
367 :version "24.1"
364 :type 'string) 368 :type 'string)
365 369
366(defcustom org-export-html-preamble t 370(defcustom org-export-html-preamble t
@@ -392,6 +396,7 @@ precedence over this variable."
392If you need to use a \"%\" character, you need to escape it 396If you need to use a \"%\" character, you need to escape it
393like that: \"%%\"." 397like that: \"%%\"."
394 :group 'org-export-html 398 :group 'org-export-html
399 :version "24.1"
395 :type 'string) 400 :type 'string)
396 401
397(defcustom org-export-html-postamble 'auto 402(defcustom org-export-html-postamble 'auto
@@ -432,6 +437,7 @@ precedence over this variable."
432If you need to use a \"%\" character, you need to escape it 437If you need to use a \"%\" character, you need to escape it
433like that: \"%%\"." 438like that: \"%%\"."
434 :group 'org-export-html 439 :group 'org-export-html
440 :version "24.1"
435 :type 'string) 441 :type 'string)
436 442
437(defcustom org-export-html-home/up-format 443(defcustom org-export-html-home/up-format
@@ -548,6 +554,7 @@ When nil, alignment will only be specified in the column tags, but this
548is ignored by some browsers (like Firefox, Safari). Opera does it right 554is ignored by some browsers (like Firefox, Safari). Opera does it right
549though." 555though."
550 :group 'org-export-tables 556 :group 'org-export-tables
557 :version "24.1"
551 :type 'boolean) 558 :type 'boolean)
552 559
553(defcustom org-export-html-table-use-header-tags-for-first-column nil 560(defcustom org-export-html-table-use-header-tags-for-first-column nil
@@ -578,6 +585,7 @@ When nil, also column one will use data tags."
578 (">" . "&gt;")) 585 (">" . "&gt;"))
579 "Alist of characters to be converted by `org-html-protect'." 586 "Alist of characters to be converted by `org-html-protect'."
580 :group 'org-export-html 587 :group 'org-export-html
588 :version "24.1"
581 :type '(repeat (cons (string :tag "Character") 589 :type '(repeat (cons (string :tag "Character")
582 (string :tag "HTML equivalent")))) 590 (string :tag "HTML equivalent"))))
583 591
@@ -639,6 +647,7 @@ This is a list of three strings, the first one for the preamble
639DIV, the second one for the content DIV and the third one for the 647DIV, the second one for the content DIV and the third one for the
640postamble DIV." 648postamble DIV."
641 :group 'org-export-html 649 :group 'org-export-html
650 :version "24.1"
642 :type '(list 651 :type '(list
643 (string :tag " Div for the preamble:") 652 (string :tag " Div for the preamble:")
644 (string :tag " Div for the content:") 653 (string :tag " Div for the content:")
@@ -1351,7 +1360,7 @@ PUB-DIR is set, use this as the publishing directory."
1351 ;; insert html preamble 1360 ;; insert html preamble
1352 (when (plist-get opt-plist :html-preamble) 1361 (when (plist-get opt-plist :html-preamble)
1353 (let ((html-pre (plist-get opt-plist :html-preamble)) 1362 (let ((html-pre (plist-get opt-plist :html-preamble))
1354 html-pre-real-contents) 1363 (html-pre-real-contents ""))
1355 (cond ((stringp html-pre) 1364 (cond ((stringp html-pre)
1356 (setq html-pre-real-contents 1365 (setq html-pre-real-contents
1357 (format-spec html-pre `((?t . ,title) (?a . ,author) 1366 (format-spec html-pre `((?t . ,title) (?a . ,author)
@@ -1422,7 +1431,7 @@ PUB-DIR is set, use this as the publishing directory."
1422 (if (string-match 1431 (if (string-match
1423 (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt) 1432 (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt)
1424 (setq txt (replace-match 1433 (setq txt (replace-match
1425 "&nbsp;&nbsp;&nbsp;<span class=\"tag\"> \\1</span>" t nil txt))) 1434 "&nbsp;&nbsp;&nbsp;<span class=\"tag\">\\1</span>" t nil txt)))
1426 (if (string-match quote-re0 txt) 1435 (if (string-match quote-re0 txt)
1427 (setq txt (replace-match "" t t txt))) 1436 (setq txt (replace-match "" t t txt)))
1428 (setq snumber (org-section-number level)) 1437 (setq snumber (org-section-number level))
@@ -1630,7 +1639,7 @@ PUB-DIR is set, use this as the publishing directory."
1630 "done" "todo") 1639 "done" "todo")
1631 " " (org-export-html-get-todo-kwd-class-name 1640 " " (org-export-html-get-todo-kwd-class-name
1632 (match-string 2 line)) 1641 (match-string 2 line))
1633 "\"> " (match-string 2 line) 1642 "\">" (match-string 2 line)
1634 "</span>" (substring line (match-end 2))))) 1643 "</span>" (substring line (match-end 2)))))
1635 1644
1636 ;; Does this contain a reference to a footnote? 1645 ;; Does this contain a reference to a footnote?
diff --git a/lisp/org/org-icalendar.el b/lisp/org/org-icalendar.el
index 29f6c74c529..d73a6195b32 100644
--- a/lisp/org/org-icalendar.el
+++ b/lisp/org/org-icalendar.el
@@ -54,6 +54,7 @@ for timed events. If non-zero, alarms are created.
54- The alarm will go off N minutes before the event 54- The alarm will go off N minutes before the event
55- only a DISPLAY action is defined." 55- only a DISPLAY action is defined."
56 :group 'org-export-icalendar 56 :group 'org-export-icalendar
57 :version "24.1"
57 :type 'integer) 58 :type 'integer)
58 59
59(defcustom org-icalendar-combined-name "OrgMode" 60(defcustom org-icalendar-combined-name "OrgMode"
@@ -64,6 +65,7 @@ for timed events. If non-zero, alarms are created.
64(defcustom org-icalendar-combined-description nil 65(defcustom org-icalendar-combined-description nil
65 "Calendar description for the combined iCalendar (all agenda files)." 66 "Calendar description for the combined iCalendar (all agenda files)."
66 :group 'org-export-icalendar 67 :group 'org-export-icalendar
68 :version "24.1"
67 :type 'string) 69 :type 'string)
68 70
69(defcustom org-icalendar-use-plain-timestamp t 71(defcustom org-icalendar-use-plain-timestamp t
@@ -74,6 +76,7 @@ for timed events. If non-zero, alarms are created.
74(defcustom org-icalendar-honor-noexport-tag nil 76(defcustom org-icalendar-honor-noexport-tag nil
75 "Non-nil means don't export entries with a tag in `org-export-exclude-tags'." 77 "Non-nil means don't export entries with a tag in `org-export-exclude-tags'."
76 :group 'org-export-icalendar 78 :group 'org-export-icalendar
79 :version "24.1"
77 :type 'boolean) 80 :type 'boolean)
78 81
79(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due) 82(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due)
@@ -213,6 +216,7 @@ Interesting value are:
213 - \":%Y%m%dT%H%M%SZ\" for time expressed in Universal Time" 216 - \":%Y%m%dT%H%M%SZ\" for time expressed in Universal Time"
214 217
215 :group 'org-export-icalendar 218 :group 'org-export-icalendar
219 :version "24.1"
216 :type '(choice 220 :type '(choice
217 (const :tag "Local time" ":%Y%m%dT%H%M%S") 221 (const :tag "Local time" ":%Y%m%dT%H%M%S")
218 (const :tag "Explicit local time" ";TZID=%Z:%Y%m%dT%H%M%S") 222 (const :tag "Explicit local time" ";TZID=%Z:%Y%m%dT%H%M%S")
diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el
index ae0c91eaedf..99a75841dee 100644
--- a/lisp/org/org-indent.el
+++ b/lisp/org/org-indent.el
@@ -412,6 +412,7 @@ This function is meant to be called by `after-change-functions'."
412 (if (or org-indent-modified-headline-flag 412 (if (or org-indent-modified-headline-flag
413 (save-excursion 413 (save-excursion
414 (goto-char beg) 414 (goto-char beg)
415 (beginning-of-line)
415 (re-search-forward org-outline-regexp-bol end t))) 416 (re-search-forward org-outline-regexp-bol end t)))
416 (let ((end (save-excursion 417 (let ((end (save-excursion
417 (goto-char end) 418 (goto-char end)
diff --git a/lisp/org/org-inlinetask.el b/lisp/org/org-inlinetask.el
index a14e4043e54..5cd190050b4 100644
--- a/lisp/org/org-inlinetask.el
+++ b/lisp/org/org-inlinetask.el
@@ -173,6 +173,7 @@ or, with the additional package \"todonotes\" for LaTeX,
173This should be the state `org-inlinetask-insert-task' should use by 173This should be the state `org-inlinetask-insert-task' should use by
174default, or nil of no state should be assigned." 174default, or nil of no state should be assigned."
175 :group 'org-inlinetask 175 :group 'org-inlinetask
176 :version "24.1"
176 :type '(choice 177 :type '(choice
177 (const :tag "No state" nil) 178 (const :tag "No state" nil)
178 (string :tag "Specific state"))) 179 (string :tag "Specific state")))
diff --git a/lisp/org/org-latex.el b/lisp/org/org-latex.el
index ba7f8fd6259..4418dee73e8 100644
--- a/lisp/org/org-latex.el
+++ b/lisp/org/org-latex.el
@@ -218,6 +218,7 @@ For example, adding an entry
218will cause \\usepackage[utf8x]{inputenc} to be used for buffers that 218will cause \\usepackage[utf8x]{inputenc} to be used for buffers that
219are written as utf8 files." 219are written as utf8 files."
220 :group 'org-export-latex 220 :group 'org-export-latex
221 :version "24.1"
221 :type '(repeat 222 :type '(repeat
222 (cons 223 (cons
223 (string :tag "Derived from buffer") 224 (string :tag "Derived from buffer")
@@ -283,6 +284,7 @@ markup defined, the first one in the association list will be used."
283(defcustom org-export-latex-tag-markup "\\textbf{%s}" 284(defcustom org-export-latex-tag-markup "\\textbf{%s}"
284 "Markup for tags, as a printf format." 285 "Markup for tags, as a printf format."
285 :group 'org-export-latex 286 :group 'org-export-latex
287 :version "24.1"
286 :type 'string) 288 :type 'string)
287 289
288(defcustom org-export-latex-timestamp-markup "\\textit{%s}" 290(defcustom org-export-latex-timestamp-markup "\\textit{%s}"
@@ -293,6 +295,7 @@ markup defined, the first one in the association list will be used."
293(defcustom org-export-latex-timestamp-inactive-markup "\\textit{%s}" 295(defcustom org-export-latex-timestamp-inactive-markup "\\textit{%s}"
294 "A printf format string to be applied to inactive time stamps." 296 "A printf format string to be applied to inactive time stamps."
295 :group 'org-export-latex 297 :group 'org-export-latex
298 :version "24.1"
296 :type 'string) 299 :type 'string)
297 300
298(defcustom org-export-latex-timestamp-keyword-markup "\\texttt{%s}" 301(defcustom org-export-latex-timestamp-keyword-markup "\\texttt{%s}"
@@ -307,6 +310,7 @@ If it contains two %s instances, the first will be filled with
307the link, the second with the link description. If it contains 310the link, the second with the link description. If it contains
308only one, the %s will be filled with the link." 311only one, the %s will be filled with the link."
309 :group 'org-export-latex 312 :group 'org-export-latex
313 :version "24.1"
310 :type 'string) 314 :type 'string)
311 315
312(defcustom org-export-latex-hyperref-format "\\hyperref[%s]{%s}" 316(defcustom org-export-latex-hyperref-format "\\hyperref[%s]{%s}"
@@ -314,11 +318,13 @@ only one, the %s will be filled with the link."
314The format must contain one or two %s instances. The first one 318The format must contain one or two %s instances. The first one
315will be filled with the link, the second with its description." 319will be filled with the link, the second with its description."
316 :group 'org-export-latex 320 :group 'org-export-latex
321 :version "24.1"
317 :type 'string) 322 :type 'string)
318 323
319(defcustom org-export-latex-footnote-separator "\\textsuperscript{,}\\," 324(defcustom org-export-latex-footnote-separator "\\textsuperscript{,}\\,"
320 "Text used to separate footnotes." 325 "Text used to separate footnotes."
321 :group 'org-export-latex 326 :group 'org-export-latex
327 :version "24.1"
322 :type 'string) 328 :type 'string)
323 329
324(defcustom org-export-latex-quotes 330(defcustom org-export-latex-quotes
@@ -336,6 +342,7 @@ For each item in a CONS, the first string is a regexp
336for allowed characters before/after the quote, the second 342for allowed characters before/after the quote, the second
337string defines the replacement string for this quote." 343string defines the replacement string for this quote."
338 :group 'org-export-latex 344 :group 'org-export-latex
345 :version "24.1"
339 :type '(list 346 :type '(list
340 (cons :tag "Opening quote" 347 (cons :tag "Opening quote"
341 (string :tag "Regexp for char before") 348 (string :tag "Regexp for char before")
@@ -361,6 +368,7 @@ string defines the replacement string for this quote."
361 "When non-nil, the caption is set above the table. When nil, 368 "When non-nil, the caption is set above the table. When nil,
362the caption is set below the table." 369the caption is set below the table."
363 :group 'org-export-latex 370 :group 'org-export-latex
371 :version "24.1"
364 :type 'boolean) 372 :type 'boolean)
365 373
366(defcustom org-export-latex-tables-column-borders nil 374(defcustom org-export-latex-tables-column-borders nil
@@ -478,6 +486,7 @@ Code blocks exported with the listings package (controlled by the
478`org-export-latex-listings' variable) can be named in the style 486`org-export-latex-listings' variable) can be named in the style
479of noweb." 487of noweb."
480 :group 'org-export-latex 488 :group 'org-export-latex
489 :version "24.1"
481 :type 'boolean) 490 :type 'boolean)
482 491
483(defcustom org-export-latex-minted-langs 492(defcustom org-export-latex-minted-langs
@@ -499,6 +508,7 @@ with:
499pygmentize -L lexers 508pygmentize -L lexers
500" 509"
501 :group 'org-export-latex 510 :group 'org-export-latex
511 :version "24.1"
502 :type '(repeat 512 :type '(repeat
503 (list 513 (list
504 (symbol :tag "Major mode ") 514 (symbol :tag "Major mode ")
@@ -522,6 +532,7 @@ black keywords.
522Note that the same options will be applied to blocks of all 532Note that the same options will be applied to blocks of all
523languages." 533languages."
524 :group 'org-export-latex 534 :group 'org-export-latex
535 :version "24.1"
525 :type '(repeat 536 :type '(repeat
526 (list 537 (list
527 (string :tag "Listings option name ") 538 (string :tag "Listings option name ")
@@ -545,6 +556,7 @@ will result in src blocks being exported with
545as the start of the minted environment. Note that the same 556as the start of the minted environment. Note that the same
546options will be applied to blocks of all languages." 557options will be applied to blocks of all languages."
547 :group 'org-export-latex 558 :group 'org-export-latex
559 :version "24.1"
548 :type '(repeat 560 :type '(repeat
549 (list 561 (list
550 (string :tag "Minted option name ") 562 (string :tag "Minted option name ")
@@ -586,11 +598,13 @@ and `org-export-with-tags' instead."
586(defcustom org-latex-default-figure-position "htb" 598(defcustom org-latex-default-figure-position "htb"
587 "Default position for latex figures." 599 "Default position for latex figures."
588 :group 'org-export-latex 600 :group 'org-export-latex
601 :version "24.1"
589 :type 'string) 602 :type 'string)
590 603
591(defcustom org-export-latex-tabular-environment "tabular" 604(defcustom org-export-latex-tabular-environment "tabular"
592 "Default environment used to build tables." 605 "Default environment used to build tables."
593 :group 'org-export-latex 606 :group 'org-export-latex
607 :version "24.1"
594 :type 'string) 608 :type 'string)
595 609
596(defcustom org-export-latex-inline-image-extensions 610(defcustom org-export-latex-inline-image-extensions
@@ -657,6 +671,18 @@ This function should accept the file name as its single argument."
657 "bibtex %b" 671 "bibtex %b"
658 "pdflatex -interaction nonstopmode -output-directory %o %f" 672 "pdflatex -interaction nonstopmode -output-directory %o %f"
659 "pdflatex -interaction nonstopmode -output-directory %o %f")) 673 "pdflatex -interaction nonstopmode -output-directory %o %f"))
674 (const :tag "2 runs of xelatex"
675 ("xelatex -interaction nonstopmode -output-directory %o %f"
676 "xelatex -interaction nonstopmode -output-directory %o %f"))
677 (const :tag "3 runs of xelatex"
678 ("xelatex -interaction nonstopmode -output-directory %o %f"
679 "xelatex -interaction nonstopmode -output-directory %o %f"
680 "xelatex -interaction nonstopmode -output-directory %o %f"))
681 (const :tag "xelatex,bibtex,xelatex,xelatex"
682 ("xelatex -interaction nonstopmode -output-directory %o %f"
683 "bibtex %b"
684 "xelatex -interaction nonstopmode -output-directory %o %f"
685 "xelatex -interaction nonstopmode -output-directory %o %f"))
660 (const :tag "texi2dvi" 686 (const :tag "texi2dvi"
661 ("texi2dvi -p -b -c -V %f")) 687 ("texi2dvi -p -b -c -V %f"))
662 (const :tag "rubber" 688 (const :tag "rubber"
@@ -667,6 +693,7 @@ This function should accept the file name as its single argument."
667 '("aux" "idx" "log" "out" "toc" "nav" "snm" "vrb") 693 '("aux" "idx" "log" "out" "toc" "nav" "snm" "vrb")
668 "The list of file extensions to consider as LaTeX logfiles." 694 "The list of file extensions to consider as LaTeX logfiles."
669 :group 'org-export-pdf 695 :group 'org-export-pdf
696 :version "24.1"
670 :type '(repeat (string :tag "Extension"))) 697 :type '(repeat (string :tag "Extension")))
671 698
672(defcustom org-export-pdf-remove-logfiles t 699(defcustom org-export-pdf-remove-logfiles t
@@ -855,7 +882,7 @@ when PUB-DIR is set, use this as the publishing directory."
855 (concat 882 (concat
856 (file-name-as-directory 883 (file-name-as-directory
857 (or pub-dir 884 (or pub-dir
858 (org-export-directory :LaTeX ext-plist))) 885 (org-export-directory :LaTeX org-export-latex-options-plist)))
859 (file-name-sans-extension 886 (file-name-sans-extension
860 (or (and subtree-p 887 (or (and subtree-p
861 (org-entry-get rbeg "EXPORT_FILE_NAME" t)) 888 (org-entry-get rbeg "EXPORT_FILE_NAME" t))
@@ -870,7 +897,7 @@ when PUB-DIR is set, use this as the publishing directory."
870 (concat filename ".tex") 897 (concat filename ".tex")
871 filename))) 898 filename)))
872 (auto-insert nil); Avoid any auto-insert stuff for the new file 899 (auto-insert nil); Avoid any auto-insert stuff for the new file
873 (TeX-master t) ; Avoid the Query for TeX master from AUCTeX 900 (TeX-master (boundp 'TeX-master))
874 (buffer (if to-buffer 901 (buffer (if to-buffer
875 (cond 902 (cond
876 ((eq to-buffer 'string) (get-buffer-create 903 ((eq to-buffer 'string) (get-buffer-create
@@ -1224,7 +1251,7 @@ numbered sections and lower levels as unnumbered sections."
1224 org-export-target-aliases)))) 1251 org-export-target-aliases))))
1225 (sectioning org-export-latex-sectioning) 1252 (sectioning org-export-latex-sectioning)
1226 (depth org-export-latex-sectioning-depth) 1253 (depth org-export-latex-sectioning-depth)
1227 main-heading sub-heading) 1254 main-heading sub-heading ctnt)
1228 (when (symbolp (car sectioning)) 1255 (when (symbolp (car sectioning))
1229 (setq sectioning (funcall (car sectioning) level heading)) 1256 (setq sectioning (funcall (car sectioning) level heading))
1230 (when sectioning 1257 (when sectioning
@@ -1291,16 +1318,20 @@ numbered sections and lower levels as unnumbered sections."
1291 (delete-region (point-at-bol 0) (point)) 1318 (delete-region (point-at-bol 0) (point))
1292 (insert (format "\\begin{%s}\n" 1319 (insert (format "\\begin{%s}\n"
1293 (symbol-name org-export-latex-low-levels)))) 1320 (symbol-name org-export-latex-low-levels))))
1294 (insert (format "\n\\item %s\\\\\n%s%%" 1321 (let ((ctnt (org-export-latex-content content)))
1295 heading 1322 (insert (format (if (not (equal (replace-regexp-in-string "\n" "" ctnt) ""))
1296 (if label (format "\\label{%s}" label) ""))) 1323 "\n\\item %s\\\\\n%s%%"
1297 (insert (org-export-latex-content content)) 1324 "\n\\item %s\n%s%%")
1325 heading
1326 (if label (format "\\label{%s}" label) "")))
1327 (insert ctnt))
1298 (cond ((stringp subcontent) (insert subcontent)) 1328 (cond ((stringp subcontent) (insert subcontent))
1299 ((listp subcontent) (org-export-latex-sub subcontent))) 1329 ((listp subcontent) (org-export-latex-sub subcontent)))
1300 (insert (format "\\end{%s} %% ends low level\n" 1330 (insert (format "\\end{%s} %% ends low level\n"
1301 (symbol-name org-export-latex-low-levels)))) 1331 (symbol-name org-export-latex-low-levels))))
1302 1332
1303 ((listp org-export-latex-low-levels) 1333 ((and (listp org-export-latex-low-levels)
1334 org-export-latex-low-levels)
1304 (if (string-match "% ends low level$" 1335 (if (string-match "% ends low level$"
1305 (buffer-substring (point-at-bol 0) (point))) 1336 (buffer-substring (point-at-bol 0) (point)))
1306 (delete-region (point-at-bol 0) (point)) 1337 (delete-region (point-at-bol 0) (point))
@@ -1902,10 +1933,14 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
1902 'org-label raw-table) 1933 'org-label raw-table)
1903 longtblp (and attr (stringp attr) 1934 longtblp (and attr (stringp attr)
1904 (string-match "\\<longtable\\>" attr)) 1935 (string-match "\\<longtable\\>" attr))
1905 tblenv (if (and attr (stringp attr) 1936 tblenv (if (and attr (stringp attr))
1906 (or (string-match (regexp-quote "table*") attr) 1937 (cond ((string-match "\\<sidewaystable\\>" attr)
1907 (string-match "\\<multicolumn\\>" attr))) 1938 "sidewaystable")
1908 "table*" "table") 1939 ((or (string-match (regexp-quote "table*") attr)
1940 (string-match "\\<multicolumn\\>" attr))
1941 "table*")
1942 (t "table"))
1943 "table")
1909 tabular-env 1944 tabular-env
1910 (if (and attr (stringp attr) 1945 (if (and attr (stringp attr)
1911 (string-match "\\(tabular.\\)" attr)) 1946 (string-match "\\(tabular.\\)" attr))
@@ -1988,7 +2023,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
1988 (if shortn (concat "[" shortn "]") "") 2023 (if shortn (concat "[" shortn "]") "")
1989 (or caption "") 2024 (or caption "")
1990 (if label (format "\\label{%s}" label) ""))) 2025 (if label (format "\\label{%s}" label) "")))
1991 (if (and longtblp caption) "\\\\\n" "\n") 2026 (if (and longtblp caption org-export-latex-table-caption-above)
2027 "\\\\\n" "\n")
1992 (if (and org-export-latex-tables-centered (not longtblp)) 2028 (if (and org-export-latex-tables-centered (not longtblp))
1993 "\\begin{center}\n") 2029 "\\begin{center}\n")
1994 (if (not longtblp) 2030 (if (not longtblp)
@@ -2572,9 +2608,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
2572 "Convert plain text lists in current buffer into LaTeX lists." 2608 "Convert plain text lists in current buffer into LaTeX lists."
2573 ;; `org-list-end-re' output has changed since preprocess from 2609 ;; `org-list-end-re' output has changed since preprocess from
2574 ;; org-exp.el. Make sure it is taken into account. 2610 ;; org-exp.el. Make sure it is taken into account.
2575 (let ((org-list-ending-method 2611 (let ((org-list-end-re "^ORG-LIST-END-MARKER\n"))
2576 (if (eq org-list-ending-method 'regexp) 'regexp 'both))
2577 (org-list-end-re "^ORG-LIST-END-MARKER\n"))
2578 (mapc 2612 (mapc
2579 (lambda (e) 2613 (lambda (e)
2580 ;; For each type of context allowed for list export (E), find 2614 ;; For each type of context allowed for list export (E), find
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el
index da8a810895c..c3775888325 100644
--- a/lisp/org/org-list.el
+++ b/lisp/org/org-list.el
@@ -207,7 +207,7 @@ Valid values are ?. and ?\). To get both terminators, use t."
207 :group 'org-plain-lists 207 :group 'org-plain-lists
208 :type '(choice (const :tag "dot like in \"2.\"" ?.) 208 :type '(choice (const :tag "dot like in \"2.\"" ?.)
209 (const :tag "paren like in \"2)\"" ?\)) 209 (const :tag "paren like in \"2)\"" ?\))
210 (const :tab "both" t))) 210 (const :tag "both" t)))
211 211
212(defcustom org-alphabetical-lists nil 212(defcustom org-alphabetical-lists nil
213 "Non-nil means single character alphabetical bullets are allowed. 213 "Non-nil means single character alphabetical bullets are allowed.
@@ -215,6 +215,7 @@ Both uppercase and lowercase are handled. Lists with more than
21526 items will fallback to standard numbering. Alphabetical 21526 items will fallback to standard numbering. Alphabetical
216counters like \"[@c]\" will be recognized." 216counters like \"[@c]\" will be recognized."
217 :group 'org-plain-lists 217 :group 'org-plain-lists
218 :version "24.1"
218 :type 'boolean) 219 :type 'boolean)
219 220
220(defcustom org-list-two-spaces-after-bullet-regexp nil 221(defcustom org-list-two-spaces-after-bullet-regexp nil
@@ -229,42 +230,12 @@ spaces instead of one after the bullet in each item of the list."
229 (const :tag "never" nil) 230 (const :tag "never" nil)
230 (regexp))) 231 (regexp)))
231 232
232(defcustom org-list-ending-method 'both
233 "Determine where plain lists should end.
234Valid values are: `regexp', `indent' or `both'.
235
236When set to `regexp', Org will look into two variables,
237`org-empty-line-terminates-plain-lists' and the more general
238`org-list-end-regexp', to determine what will end lists.
239
240When set to `indent', a list will end whenever a line following
241an item, but not starting one, is less or equally indented than
242the first item of the list.
243
244When set to `both', each of the preceding methods is applied to
245determine lists endings. This is the default method."
246 :group 'org-plain-lists
247 :type '(choice
248 (const :tag "With a regexp defining ending" regexp)
249 (const :tag "With indentation of regular (no bullet) text" indent)
250 (const :tag "With both methods" both)))
251
252(defcustom org-empty-line-terminates-plain-lists nil 233(defcustom org-empty-line-terminates-plain-lists nil
253 "Non-nil means an empty line ends all plain list levels. 234 "Non-nil means an empty line ends all plain list levels.
254This variable only makes sense if `org-list-ending-method' is set 235Otherwise, two of them will be necessary."
255to `regexp' or `both'. This is then equivalent to set
256`org-list-end-regexp' to \"^[ \\t]*$\"."
257 :group 'org-plain-lists 236 :group 'org-plain-lists
258 :type 'boolean) 237 :type 'boolean)
259 238
260(defcustom org-list-end-regexp "^[ \t]*\n[ \t]*\n"
261 "Regexp matching the end of all plain list levels.
262It must start with \"^\" and end with \"\\n\". It defaults to 2
263blank lines. `org-empty-line-terminates-plain-lists' has
264precedence over it."
265 :group 'org-plain-lists
266 :type 'string)
267
268(defcustom org-list-automatic-rules '((bullet . t) 239(defcustom org-list-automatic-rules '((bullet . t)
269 (checkbox . t) 240 (checkbox . t)
270 (indent . t)) 241 (indent . t))
@@ -288,6 +259,7 @@ indent when non-nil, indenting or outdenting list top-item
288 outdenting a list whose bullet is * to column 0 will 259 outdenting a list whose bullet is * to column 0 will
289 change that bullet to \"-\"." 260 change that bullet to \"-\"."
290 :group 'org-plain-lists 261 :group 'org-plain-lists
262 :version "24.1"
291 :type '(alist :tag "Sets of rules" 263 :type '(alist :tag "Sets of rules"
292 :key-type 264 :key-type
293 (choice 265 (choice
@@ -307,6 +279,7 @@ This affects the behavior of \\[org-move-item-up],
307 \\[org-move-item-down], \\[org-next-item] and 279 \\[org-move-item-down], \\[org-next-item] and
308 \\[org-previous-item]." 280 \\[org-previous-item]."
309 :group 'org-plain-lists 281 :group 'org-plain-lists
282 :version "24.1"
310 :type 'boolean) 283 :type 'boolean)
311 284
312(defvar org-checkbox-statistics-hook nil 285(defvar org-checkbox-statistics-hook nil
@@ -336,6 +309,7 @@ When the indentation would be larger than this, it will become
336By setting this to a small number, usually 1 or 2, one can more 309By setting this to a small number, usually 1 or 2, one can more
337clearly distinguish sub-items in a list." 310clearly distinguish sub-items in a list."
338 :group 'org-plain-lists 311 :group 'org-plain-lists
312 :version "24.1"
339 :type 'integer) 313 :type 'integer)
340 314
341(defcustom org-list-radio-list-templates 315(defcustom org-list-radio-list-templates
@@ -381,9 +355,8 @@ specifically, type `block' is determined by the variable
381 355
382;;; Predicates and regexps 356;;; Predicates and regexps
383 357
384(defconst org-list-end-re (if org-empty-line-terminates-plain-lists 358(defconst org-list-end-re (if org-empty-line-terminates-plain-lists "^[ \t]*\n"
385 "^[ \t]*\n" 359 "^[ \t]*\n[ \t]*\n")
386 org-list-end-regexp)
387 "Regex corresponding to the end of a list. 360 "Regex corresponding to the end of a list.
388It depends on `org-empty-line-terminates-plain-lists'.") 361It depends on `org-empty-line-terminates-plain-lists'.")
389 362
@@ -432,8 +405,7 @@ group 4: description tag")
432 (not (org-in-block-p org-list-forbidden-blocks))) 405 (not (org-in-block-p org-list-forbidden-blocks)))
433 406
434(defun org-in-item-p () 407(defun org-in-item-p ()
435 "Return item beginning position when in a plain list, nil otherwise. 408 "Return item beginning position when in a plain list, nil otherwise."
436This checks `org-list-ending-method'."
437 (save-excursion 409 (save-excursion
438 (beginning-of-line) 410 (beginning-of-line)
439 (let* ((case-fold-search t) 411 (let* ((case-fold-search t)
@@ -460,8 +432,7 @@ This checks `org-list-ending-method'."
460 ;; to compute its boundaries END-BOUNDS. When point is 432 ;; to compute its boundaries END-BOUNDS. When point is
461 ;; in-between, move cursor before regexp beginning. 433 ;; in-between, move cursor before regexp beginning.
462 (let ((hl 0) (i -1) end-bounds) 434 (let ((hl 0) (i -1) end-bounds)
463 (when (and (not (eq org-list-ending-method 'indent)) 435 (when (and (progn
464 (progn
465 (while (setq i (string-match 436 (while (setq i (string-match
466 "[\r\n]" org-list-end-re (1+ i))) 437 "[\r\n]" org-list-end-re (1+ i)))
467 (setq hl (1+ hl))) 438 (setq hl (1+ hl)))
@@ -470,23 +441,18 @@ This checks `org-list-ending-method'."
470 (< (point) (cdr end-bounds))) 441 (< (point) (cdr end-bounds)))
471 (goto-char (car end-bounds)) 442 (goto-char (car end-bounds))
472 (forward-line -1))) 443 (forward-line -1)))
473 ;; Look for an item, less indented that reference line if 444 ;; Look for an item, less indented that reference line.
474 ;; `org-list-ending-method' isn't `regexp'.
475 (catch 'exit 445 (catch 'exit
476 (while t 446 (while t
477 (let ((ind (org-get-indentation))) 447 (let ((ind (org-get-indentation)))
478 (cond 448 (cond
479 ;; This is exactly what we want. 449 ;; This is exactly what we want.
480 ((and (looking-at item-re) 450 ((and (looking-at item-re) (< ind ind-ref))
481 (or (< ind ind-ref)
482 (eq org-list-ending-method 'regexp)))
483 (throw 'exit (point))) 451 (throw 'exit (point)))
484 ;; At upper bound of search or looking at the end of a 452 ;; At upper bound of search or looking at the end of a
485 ;; previous list: search is over. 453 ;; previous list: search is over.
486 ((<= (point) lim-up) (throw 'exit nil)) 454 ((<= (point) lim-up) (throw 'exit nil))
487 ((and (not (eq org-list-ending-method 'indent)) 455 ((looking-at org-list-end-re) (throw 'exit nil))
488 (looking-at org-list-end-re))
489 (throw 'exit nil))
490 ;; Skip blocks, drawers, inline-tasks, blank lines 456 ;; Skip blocks, drawers, inline-tasks, blank lines
491 ((and (looking-at "^[ \t]*#\\+end_") 457 ((and (looking-at "^[ \t]*#\\+end_")
492 (re-search-backward "^[ \t]*#\\+begin_" lim-up t))) 458 (re-search-backward "^[ \t]*#\\+begin_" lim-up t)))
@@ -703,8 +669,7 @@ Assume point is at an item."
703 (forward-line -1)) 669 (forward-line -1))
704 ;; Looking at a list ending regexp. Dismiss useless 670 ;; Looking at a list ending regexp. Dismiss useless
705 ;; data recorded above BEG-CELL. Jump to part 2. 671 ;; data recorded above BEG-CELL. Jump to part 2.
706 ((and (not (eq org-list-ending-method 'indent)) 672 ((looking-at org-list-end-re)
707 (looking-at org-list-end-re))
708 (throw 'exit 673 (throw 'exit
709 (setq itm-lst 674 (setq itm-lst
710 (memq (assq (car beg-cell) itm-lst) itm-lst)))) 675 (memq (assq (car beg-cell) itm-lst) itm-lst))))
@@ -716,10 +681,7 @@ Assume point is at an item."
716 ((looking-at item-re) 681 ((looking-at item-re)
717 (push (funcall assoc-at-point ind) itm-lst) 682 (push (funcall assoc-at-point ind) itm-lst)
718 (push (cons ind (point)) end-lst) 683 (push (cons ind (point)) end-lst)
719 (when (or (and (eq org-list-ending-method 'regexp) 684 (when (< ind text-min-ind) (setq beg-cell (cons (point) ind)))
720 (<= ind (cdr beg-cell)))
721 (< ind text-min-ind))
722 (setq beg-cell (cons (point) ind)))
723 (forward-line -1)) 685 (forward-line -1))
724 ;; Skip blocks, drawers, inline tasks, blank lines. 686 ;; Skip blocks, drawers, inline tasks, blank lines.
725 ((and (looking-at "^[ \t]*#\\+end_") 687 ((and (looking-at "^[ \t]*#\\+end_")
@@ -732,14 +694,13 @@ Assume point is at an item."
732 (forward-line -1)) 694 (forward-line -1))
733 ((looking-at "^[ \t]*$") 695 ((looking-at "^[ \t]*$")
734 (forward-line -1)) 696 (forward-line -1))
735 ;; From there, point is not at an item. Unless ending 697 ;; From there, point is not at an item. Interpret
736 ;; method is `regexp', interpret line's indentation: 698 ;; line's indentation:
737 ;; - text at column 0 is necessarily out of any list. 699 ;; - text at column 0 is necessarily out of any list.
738 ;; Dismiss data recorded above BEG-CELL. Jump to 700 ;; Dismiss data recorded above BEG-CELL. Jump to
739 ;; part 2. 701 ;; part 2.
740 ;; - any other case may be an ending position for an 702 ;; - any other case may be an ending position for an
741 ;; hypothetical item above. Store it and proceed. 703 ;; hypothetical item above. Store it and proceed.
742 ((eq org-list-ending-method 'regexp) (forward-line -1))
743 ((zerop ind) 704 ((zerop ind)
744 (throw 'exit 705 (throw 'exit
745 (setq itm-lst 706 (setq itm-lst
@@ -771,8 +732,7 @@ Assume point is at an item."
771 (next-single-property-change (point) 'org-example nil lim-down))) 732 (next-single-property-change (point) 'org-example nil lim-down)))
772 ;; Looking at a list ending regexp. Save point as an 733 ;; Looking at a list ending regexp. Save point as an
773 ;; ending position and jump to part 3. 734 ;; ending position and jump to part 3.
774 ((and (not (eq org-list-ending-method 'indent)) 735 ((looking-at org-list-end-re)
775 (looking-at org-list-end-re))
776 (throw 'exit (push (cons 0 (point)) end-lst-2))) 736 (throw 'exit (push (cons 0 (point)) end-lst-2)))
777 ((looking-at item-re) 737 ((looking-at item-re)
778 ;; Point is at an item. Add data to ITM-LST-2. It may 738 ;; Point is at an item. Add data to ITM-LST-2. It may
@@ -788,16 +748,14 @@ Assume point is at an item."
788 ;; Ind is lesser or equal than BEG-CELL's. The list is 748 ;; Ind is lesser or equal than BEG-CELL's. The list is
789 ;; over: store point as an ending position and jump to 749 ;; over: store point as an ending position and jump to
790 ;; part 3. 750 ;; part 3.
791 ((and (not (eq org-list-ending-method 'regexp)) 751 ((<= ind (cdr beg-cell))
792 (<= ind (cdr beg-cell)))
793 (throw 'exit 752 (throw 'exit
794 (push (cons 0 (funcall end-before-blank)) end-lst-2))) 753 (push (cons 0 (funcall end-before-blank)) end-lst-2)))
795 ;; Else, if ind is lesser or equal than previous item's, 754 ;; Else, if ind is lesser or equal than previous item's,
796 ;; this is an ending position: store it. In any case, 755 ;; this is an ending position: store it. In any case,
797 ;; skip block or drawer at point, and move to next line. 756 ;; skip block or drawer at point, and move to next line.
798 (t 757 (t
799 (when (and (not (eq org-list-ending-method 'regexp)) 758 (when (<= ind (nth 1 (car itm-lst-2)))
800 (<= ind (nth 1 (car itm-lst-2))))
801 (push (cons ind (point)) end-lst-2)) 759 (push (cons ind (point)) end-lst-2))
802 (cond 760 (cond
803 ((and (looking-at "^[ \t]*#\\+begin_") 761 ((and (looking-at "^[ \t]*#\\+begin_")
@@ -1192,9 +1150,7 @@ some heuristics to guess the result."
1192 (point)))))))) 1150 (point))))))))
1193 (cond 1151 (cond
1194 ;; Trivial cases where there should be none. 1152 ;; Trivial cases where there should be none.
1195 ((or (and (not (eq org-list-ending-method 'indent)) 1153 ((or org-empty-line-terminates-plain-lists (not insert-blank-p)) 0)
1196 org-empty-line-terminates-plain-lists)
1197 (not insert-blank-p)) 0)
1198 ;; When `org-blank-before-new-entry' says so, it is 1. 1154 ;; When `org-blank-before-new-entry' says so, it is 1.
1199 ((eq insert-blank-p t) 1) 1155 ((eq insert-blank-p t) 1)
1200 ;; `plain-list-item' is 'auto. Count blank lines separating 1156 ;; `plain-list-item' is 'auto. Count blank lines separating
@@ -2929,9 +2885,7 @@ Point is left at list end."
2929 (goto-char top) 2885 (goto-char top)
2930 (when delete 2886 (when delete
2931 (delete-region top bottom) 2887 (delete-region top bottom)
2932 (when (and (not (eq org-list-ending-method 'indent)) 2888 (when (and (not (looking-at "[ \t]*$")) (looking-at org-list-end-re))
2933 (not (looking-at "[ \t]*$"))
2934 (looking-at org-list-end-re))
2935 (replace-match ""))) 2889 (replace-match "")))
2936 out)) 2890 out))
2937 2891
diff --git a/lisp/org/org-lparse.el b/lisp/org/org-lparse.el
index 229135e9b50..c9669dd8ab4 100644
--- a/lisp/org/org-lparse.el
+++ b/lisp/org/org-lparse.el
@@ -484,37 +484,33 @@ This is a helper routine for interactive use."
484 (error "Cannot convert from %s format to %s format?" 484 (error "Cannot convert from %s format to %s format?"
485 in-fmt out-fmt))) 485 in-fmt out-fmt)))
486 (convert-process (car how)) 486 (convert-process (car how))
487 (program (car convert-process))
488 (dummy (and (or program (error "Converter not configured"))
489 (or (executable-find program)
490 (error "Cannot find converter %s" program))))
491 (out-file (concat (file-name-sans-extension in-file) "." 487 (out-file (concat (file-name-sans-extension in-file) "."
492 (nth 1 (or (cdr how) out-fmt)))) 488 (nth 1 (or (cdr how) out-fmt))))
489 (extra-options (or (nth 2 (cdr how)) ""))
493 (out-dir (file-name-directory in-file)) 490 (out-dir (file-name-directory in-file))
494 (arglist (mapcar (lambda (arg) 491 (cmd (format-spec convert-process
495 (format-spec 492 `((?i . ,(shell-quote-argument in-file))
496 arg `((?i . ,in-file) 493 (?I . ,(browse-url-file-url in-file))
497 (?I . ,(browse-url-file-url in-file)) 494 (?f . ,out-fmt)
498 (?f . ,out-fmt) 495 (?o . ,out-file)
499 (?o . ,out-file) 496 (?O . ,(browse-url-file-url out-file))
500 (?O . ,(browse-url-file-url out-file)) 497 (?d . , (shell-quote-argument out-dir))
501 (?d . ,out-dir) 498 (?D . ,(browse-url-file-url out-dir))
502 (?D . ,(browse-url-file-url out-dir))))) 499 (?x . ,extra-options)))))
503 (cdr convert-process))))
504 (when (file-exists-p out-file) 500 (when (file-exists-p out-file)
505 (delete-file out-file)) 501 (delete-file out-file))
506 502
507 (message "Executing %s %s" program (mapconcat 'identity arglist " ")) 503 (message "Executing %s" cmd)
508 (apply 'call-process program nil nil nil arglist) 504 (let ((cmd-output (shell-command-to-string cmd)))
505 (message "%s" cmd-output))
506
509 (cond 507 (cond
510 ((file-exists-p out-file) 508 ((file-exists-p out-file)
511 (message "Exported to %s using %s" out-file program) 509 (message "Exported to %s" out-file)
512 (when prefix-arg 510 (when prefix-arg
513 (message "Opening %s..." out-file) 511 (message "Opening %s..." out-file)
514 (org-open-file out-file)) 512 (org-open-file out-file))
515 out-file 513 out-file)
516 ;; (set-buffer (find-file-noselect out-file))
517 )
518 (t 514 (t
519 (message "Export to %s failed" out-file) 515 (message "Export to %s failed" out-file)
520 nil)))) 516 nil))))
@@ -598,11 +594,7 @@ version."
598 (org-lparse-par-open-stashed 0) 594 (org-lparse-par-open-stashed 0)
599 595
600 ;; list related vars 596 ;; list related vars
601 (org-lparse-list-level 0) ; list level starts at 1. A 597 (org-lparse-list-stack '())
602 ; value of 0 implies we are
603 ; outside of any list
604 (org-lparse-list-item-count 0)
605 org-lparse-list-stack
606 598
607 ;; list-table related vars 599 ;; list-table related vars
608 org-lparse-list-table-p 600 org-lparse-list-table-p
@@ -817,6 +809,8 @@ version."
817 (setq umax-toc (if (integerp org-export-with-toc) 809 (setq umax-toc (if (integerp org-export-with-toc)
818 (min org-export-with-toc umax) 810 (min org-export-with-toc umax)
819 umax)) 811 umax))
812 (setq org-lparse-opt-plist
813 (plist-put org-lparse-opt-plist :headline-levels umax))
820 814
821 (when (and org-export-with-toc (not body-only)) 815 (when (and org-export-with-toc (not body-only))
822 (setq lines (org-lparse-prepare-toc 816 (setq lines (org-lparse-prepare-toc
@@ -853,48 +847,6 @@ version."
853 (org-lparse-end-environment 'fixedwidth)) 847 (org-lparse-end-environment 'fixedwidth))
854 (throw 'nextline nil)) 848 (throw 'nextline nil))
855 849
856 ;; Notes: The baseline version of org-html.el (git commit
857 ;; 3d802e), while encountering a *line-long* protected text,
858 ;; does one of the following two things based on the state
859 ;; of the export buffer.
860
861 ;; 1. If a paragraph element has just been opened and
862 ;; contains only whitespace as content, insert the
863 ;; protected text as part of the previous paragraph.
864
865 ;; 2. If the paragraph element has already been opened and
866 ;; contains some valid content insert the protected text
867 ;; as part of the current paragraph.
868
869 ;; I think --->
870
871 ;; Scenario 1 mentioned above kicks in when a block of
872 ;; protected text has to be inserted en bloc. For example,
873 ;; this happens, when inserting an source or example block
874 ;; or preformatted content enclosed in #+backend,
875 ;; #+begin_backend ... #+end_backend)
876
877 ;; Scenario 2 mentioned above kicks in when the protected
878 ;; text is part of a running sentence. For example this
879 ;; happens in the case of an *multiline* LaTeX equation that
880 ;; needs to be inserted verbatim.
881
882 ;; org-html.el in the master branch seems to do some
883 ;; jugglery by moving paragraphs around. Inorder to make
884 ;; these changes backend-agnostic introduce a new text
885 ;; property org-native-text and impose the added semantics
886 ;; that these protected blocks appear outside of a
887 ;; conventional paragraph element.
888 ;;
889 ;; Extra Note: Check whether org-example and org-native-text
890 ;; are entirely equivalent.
891
892 ;; Fixes bug reported by Christian Moe concerning verbatim
893 ;; LaTeX fragments.
894 ;; on git commit 533ba3f90250a1f25f494c390d639ea6274f235c
895 ;; http://repo.or.cz/w/org-mode/org-jambu.git/shortlog/refs/heads/staging
896 ;; See http://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01379.html
897
898 ;; Native Text 850 ;; Native Text
899 (when (and (get-text-property 0 'org-native-text line) 851 (when (and (get-text-property 0 'org-native-text line)
900 ;; Make sure it is the entire line that is protected 852 ;; Make sure it is the entire line that is protected
@@ -1081,10 +1033,11 @@ version."
1081 table-buffer (nreverse table-buffer) 1033 table-buffer (nreverse table-buffer)
1082 table-orig-buffer (nreverse table-orig-buffer)) 1034 table-orig-buffer (nreverse table-orig-buffer))
1083 (org-lparse-end-paragraph) 1035 (org-lparse-end-paragraph)
1036 (when org-lparse-list-table-p
1037 (error "Regular tables are not allowed in a list-table block"))
1084 (org-lparse-insert 'TABLE table-buffer table-orig-buffer))) 1038 (org-lparse-insert 'TABLE table-buffer table-orig-buffer)))
1085 1039
1086 ;; Normal lines 1040 ;; Normal lines
1087
1088 (t 1041 (t
1089 ;; This line either is list item or end a list. 1042 ;; This line either is list item or end a list.
1090 (when (get-text-property 0 'list-item line) 1043 (when (get-text-property 0 'list-item line)
@@ -1820,6 +1773,12 @@ Stripping happens only when the exported backend is not one of
1820 (org-lparse-end 'FOOTNOTE-DEFINITION n) 1773 (org-lparse-end 'FOOTNOTE-DEFINITION n)
1821 (setq org-lparse-insert-tag-with-newlines 'both) 1774 (setq org-lparse-insert-tag-with-newlines 'both)
1822 (let ((footnote-def (org-lparse-end-collect))) 1775 (let ((footnote-def (org-lparse-end-collect)))
1776 ;; Cleanup newlines in footnote definition. This ensures that a
1777 ;; transcoded line is never (wrongly) broken in to multiple lines.
1778 (let ((pos 0))
1779 (while (string-match "[\r\n]+" footnote-def pos)
1780 (setq pos (1+ (match-beginning 0)))
1781 (setq footnote-def (replace-match " " t t footnote-def))))
1823 (push (cons n footnote-def) org-lparse-footnote-definitions))) 1782 (push (cons n footnote-def) org-lparse-footnote-definitions)))
1824 1783
1825(defvar org-lparse-collect-buffer nil 1784(defvar org-lparse-collect-buffer nil
@@ -2104,8 +2063,6 @@ When TITLE is nil, just close all open levels."
2104 ("d" . description))))) 2063 ("d" . description)))))
2105 2064
2106;; following vars are bound during `org-do-lparse' 2065;; following vars are bound during `org-do-lparse'
2107(defvar org-lparse-list-level)
2108(defvar org-lparse-list-item-count)
2109(defvar org-lparse-list-stack) 2066(defvar org-lparse-list-stack)
2110(defvar org-lparse-list-table:table-row) 2067(defvar org-lparse-list-table:table-row)
2111(defvar org-lparse-list-table:lines) 2068(defvar org-lparse-list-table:lines)
@@ -2147,73 +2104,69 @@ When TITLE is nil, just close all open levels."
2147;; https://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01101.html 2104;; https://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01101.html
2148 2105
2149(defun org-lparse-begin-list (ltype) 2106(defun org-lparse-begin-list (ltype)
2150 (incf org-lparse-list-level) 2107 (push ltype org-lparse-list-stack)
2151 (push org-lparse-list-item-count org-lparse-list-stack) 2108 (let ((list-level (length org-lparse-list-stack)))
2152 (setq org-lparse-list-item-count 0) 2109 (cond
2153 (cond 2110 ((not org-lparse-list-table-p)
2154 ((not org-lparse-list-table-p) 2111 (org-lparse-begin 'LIST ltype))
2155 (org-lparse-begin 'LIST ltype)) 2112 ;; process LIST-TABLE
2156 ;; process LIST-TABLE 2113 ((= 1 list-level)
2157 ((= 1 org-lparse-list-level) 2114 ;; begin LIST-TABLE
2158 ;; begin LIST-TABLE 2115 (setq org-lparse-list-table:lines nil)
2159 (setq org-lparse-list-table:lines nil) 2116 (setq org-lparse-list-table:table-row nil))
2160 (setq org-lparse-list-table:table-row nil)) 2117 ((= 2 list-level)
2161 ((= 2 org-lparse-list-level) 2118 (ignore))
2162 (ignore)) 2119 (t
2163 (t 2120 (org-lparse-begin 'LIST ltype)))))
2164 (org-lparse-begin 'LIST ltype))))
2165 2121
2166(defun org-lparse-end-list (ltype) 2122(defun org-lparse-end-list (ltype)
2167 (setq org-lparse-list-item-count (pop org-lparse-list-stack)) 2123 (pop org-lparse-list-stack)
2168 (decf org-lparse-list-level) 2124 (let ((list-level (length org-lparse-list-stack)))
2169 (cond 2125 (cond
2170 ((not org-lparse-list-table-p) 2126 ((not org-lparse-list-table-p)
2171 (org-lparse-end 'LIST ltype)) 2127 (org-lparse-end 'LIST ltype))
2172 ;; process LIST-TABLE 2128 ;; process LIST-TABLE
2173 ((= 0 org-lparse-list-level) 2129 ((= 0 list-level)
2174 ;; end LIST-TABLE 2130 ;; end LIST-TABLE
2175 (insert (org-lparse-format-list-table 2131 (insert (org-lparse-format-list-table
2176 (nreverse org-lparse-list-table:lines)))) 2132 (nreverse org-lparse-list-table:lines))))
2177 ((= 1 org-lparse-list-level) 2133 ((= 1 list-level)
2178 (ignore)) 2134 (ignore))
2179 (t 2135 (t
2180 (org-lparse-end 'LIST ltype)))) 2136 (org-lparse-end 'LIST ltype)))))
2181 2137
2182(defun org-lparse-begin-list-item (ltype &optional arg headline) 2138(defun org-lparse-begin-list-item (ltype &optional arg headline)
2183 (incf org-lparse-list-item-count) 2139 (let ((list-level (length org-lparse-list-stack)))
2184 (cond 2140 (cond
2185 ((not org-lparse-list-table-p) 2141 ((not org-lparse-list-table-p)
2186 (org-lparse-begin 'LIST-ITEM ltype arg headline)) 2142 (org-lparse-begin 'LIST-ITEM ltype arg headline))
2187 ;; process LIST-TABLE 2143 ;; process LIST-TABLE
2188 ((and (= 1 org-lparse-list-level) 2144 ((= 1 list-level)
2189 (= 1 org-lparse-list-item-count)) 2145 ;; begin TABLE-ROW for LIST-TABLE
2190 ;; begin TABLE-ROW for LIST-TABLE 2146 (setq org-lparse-list-table:table-row nil)
2191 (setq org-lparse-list-table:table-row nil) 2147 (org-lparse-begin-list-table:table-cell))
2192 (org-lparse-begin-list-table:table-cell)) 2148 ((= 2 list-level)
2193 ((and (= 2 org-lparse-list-level) 2149 ;; begin TABLE-CELL for LIST-TABLE
2194 (= 1 org-lparse-list-item-count)) 2150 (org-lparse-begin-list-table:table-cell))
2195 ;; begin TABLE-CELL for LIST-TABLE 2151 (t
2196 (org-lparse-begin-list-table:table-cell)) 2152 (org-lparse-begin 'LIST-ITEM ltype arg headline)))))
2197 (t
2198 (org-lparse-begin 'LIST-ITEM ltype arg headline))))
2199 2153
2200(defun org-lparse-end-list-item (ltype) 2154(defun org-lparse-end-list-item (ltype)
2201 (decf org-lparse-list-item-count) 2155 (let ((list-level (length org-lparse-list-stack)))
2202 (cond 2156 (cond
2203 ((not org-lparse-list-table-p) 2157 ((not org-lparse-list-table-p)
2204 (org-lparse-end 'LIST-ITEM ltype)) 2158 (org-lparse-end 'LIST-ITEM ltype))
2205 ;; process LIST-TABLE 2159 ;; process LIST-TABLE
2206 ((and (= 1 org-lparse-list-level) 2160 ((= 1 list-level)
2207 (= 0 org-lparse-list-item-count)) 2161 ;; end TABLE-ROW for LIST-TABLE
2208 ;; end TABLE-ROW for LIST-TABLE 2162 (org-lparse-end-list-table:table-cell)
2209 (org-lparse-end-list-table:table-cell) 2163 (push (nreverse org-lparse-list-table:table-row)
2210 (push (nreverse org-lparse-list-table:table-row) 2164 org-lparse-list-table:lines))
2211 org-lparse-list-table:lines)) 2165 ((= 2 list-level)
2212 ((= 2 org-lparse-list-level) 2166 ;; end TABLE-CELL for LIST-TABLE
2213 ;; end TABLE-CELL for LIST-TABLE 2167 (org-lparse-end-list-table:table-cell))
2214 (org-lparse-end-list-table:table-cell)) 2168 (t
2215 (t 2169 (org-lparse-end 'LIST-ITEM ltype)))))
2216 (org-lparse-end 'LIST-ITEM ltype))))
2217 2170
2218(defvar org-lparse-list-table:table-cell-open) 2171(defvar org-lparse-list-table:table-cell-open)
2219(defun org-lparse-begin-list-table:table-cell () 2172(defun org-lparse-begin-list-table:table-cell ()
diff --git a/lisp/org/org-mac-message.el b/lisp/org/org-mac-message.el
index b87d91f4cc2..2223c63f154 100644
--- a/lisp/org/org-mac-message.el
+++ b/lisp/org/org-mac-message.el
@@ -1,9 +1,9 @@
1;;; org-mac-message.el --- Links to Apple Mail.app messages from within Org-mode 1;;; org-mac-message.el --- Links to Apple Mail.app messages from within Org-mode
2 2
3;; Copyright (C) 2008-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Authors: John Wiegley <johnw@gnu.org>
6;; Christopher Suckling <suckling at gmail dot com> 6;; Christopher Suckling <suckling at gmail dot com>
7 7
8;; Keywords: outlines, hypermedia, calendar, wp 8;; Keywords: outlines, hypermedia, calendar, wp
9 9
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
index bcc1c90932a..3bd9a7c0bbd 100644
--- a/lisp/org/org-mobile.el
+++ b/lisp/org/org-mobile.el
@@ -68,6 +68,7 @@ org-agenda-text-search-extra-files
68(defcustom org-mobile-files-exclude-regexp "" 68(defcustom org-mobile-files-exclude-regexp ""
69 "A regexp to exclude files from `org-mobile-files'." 69 "A regexp to exclude files from `org-mobile-files'."
70 :group 'org-mobile 70 :group 'org-mobile
71 :version "24.1"
71 :type 'regexp) 72 :type 'regexp)
72 73
73(defcustom org-mobile-directory "" 74(defcustom org-mobile-directory ""
@@ -84,6 +85,7 @@ Turning on encryption requires to set the same password in the MobileOrg
84application. Before turning this on, check of MobileOrg does already 85application. Before turning this on, check of MobileOrg does already
85support it - at the time of this writing it did not yet." 86support it - at the time of this writing it did not yet."
86 :group 'org-mobile 87 :group 'org-mobile
88 :version "24.1"
87 :type 'boolean) 89 :type 'boolean)
88 90
89(defcustom org-mobile-encryption-tempfile "~/orgtmpcrypt" 91(defcustom org-mobile-encryption-tempfile "~/orgtmpcrypt"
@@ -91,6 +93,7 @@ support it - at the time of this writing it did not yet."
91This must be local file on your local machine (not on the WebDAV server). 93This must be local file on your local machine (not on the WebDAV server).
92You might want to put this file into a directory where only you have access." 94You might want to put this file into a directory where only you have access."
93 :group 'org-mobile 95 :group 'org-mobile
96 :version "24.1"
94 :type 'directory) 97 :type 'directory)
95 98
96(defcustom org-mobile-encryption-password "" 99(defcustom org-mobile-encryption-password ""
@@ -111,6 +114,7 @@ it, this also limits the security of this approach. You can also leave
111this variable empty - Org will then ask for the password once per Emacs 114this variable empty - Org will then ask for the password once per Emacs
112session." 115session."
113 :group 'org-mobile 116 :group 'org-mobile
117 :version "24.1"
114 :type '(string :tag "Password")) 118 :type '(string :tag "Password"))
115 119
116(defvar org-mobile-encryption-password-session nil) 120(defvar org-mobile-encryption-password-session nil)
@@ -150,6 +154,7 @@ custom all custom agendas defined by the user
150all the custom agendas and the default ones 154all the custom agendas and the default ones
151list a list of selection key(s) as string." 155list a list of selection key(s) as string."
152 :group 'org-mobile 156 :group 'org-mobile
157 :version "24.1"
153 :type '(choice 158 :type '(choice
154 (const :tag "Default Agendas" default) 159 (const :tag "Default Agendas" default)
155 (const :tag "Custom Agendas" custom) 160 (const :tag "Custom Agendas" custom)
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index b1d9f22a4e0..5a87bd64697 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -315,11 +315,11 @@ nor a function, elements of KEYWORDS are used directly."
315 (replace-match "") 315 (replace-match "")
316 (just-one-space)) 316 (just-one-space))
317 317
318(defvar rest) 318(defvar org-mouse-rest)
319(defun org-mouse-replace-match-and-surround (newtext &optional fixedcase 319(defun org-mouse-replace-match-and-surround (newtext &optional fixedcase
320 literal string subexp) 320 literal string subexp)
321 "The same as `replace-match', but surrounds the replacement with spaces." 321 "The same as `replace-match', but surrounds the replacement with spaces."
322 (apply 'replace-match rest) 322 (apply 'replace-match org-mouse-rest)
323 (save-excursion 323 (save-excursion
324 (goto-char (match-beginning (or subexp 0))) 324 (goto-char (match-beginning (or subexp 0)))
325 (just-one-space) 325 (just-one-space)
@@ -990,7 +990,7 @@ This means, between the beginning of line and the point."
990 (replace-match replace-text)) 990 (replace-match replace-text))
991 (forward-line)))) 991 (forward-line))))
992 992
993(defvar _cmd) ;dynamically scoped from `org-with-remote-undo'. 993(defvar org-mouse-cmd) ;dynamically scoped from `org-with-remote-undo'.
994 994
995(defun org-mouse-do-remotely (command) 995(defun org-mouse-do-remotely (command)
996; (org-agenda-check-no-diary) 996; (org-agenda-check-no-diary)
@@ -1021,7 +1021,7 @@ This means, between the beginning of line and the point."
1021 (setq marker (copy-marker (point))) 1021 (setq marker (copy-marker (point)))
1022 (goto-char (max (point-at-bol) (- (point-at-eol) anticol))) 1022 (goto-char (max (point-at-bol) (- (point-at-eol) anticol)))
1023 (funcall command) 1023 (funcall command)
1024 (message "_cmd: %S" _cmd) 1024 (message "_cmd: %S" org-mouse-cmd)
1025 (message "this-command: %S" this-command) 1025 (message "this-command: %S" this-command)
1026 (unless (eq (marker-position marker) (marker-position endmarker)) 1026 (unless (eq (marker-position marker) (marker-position endmarker))
1027 (setq newhead (org-get-heading)))) 1027 (setq newhead (org-get-heading))))
diff --git a/lisp/org/org-odt.el b/lisp/org/org-odt.el
index c8fa7ea363b..234272a378d 100644
--- a/lisp/org/org-odt.el
+++ b/lisp/org/org-odt.el
@@ -1,4 +1,4 @@
1;;; org-odt.el --- OpenDocumentText export for Org-mode 1;;; org-odt.el --- OpenDocument Text exporter for Org-mode
2 2
3;; Copyright (C) 2010-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2010-2012 Free Software Foundation, Inc.
4 4
@@ -31,9 +31,23 @@
31(defgroup org-export-odt nil 31(defgroup org-export-odt nil
32 "Options specific for ODT export of Org-mode files." 32 "Options specific for ODT export of Org-mode files."
33 :tag "Org Export ODT" 33 :tag "Org Export ODT"
34 :group 'org-export) 34 :group 'org-export
35 :version "24.1")
36
37(defvar org-lparse-dyn-first-heading-pos) ; let bound during org-do-lparse
38(defun org-odt-insert-toc ()
39 (goto-char (point-min))
40 (cond
41 ((re-search-forward
42 "\\(<text:p [^>]*>\\)?\\s-*\\[TABLE-OF-CONTENTS\\]\\s-*\\(</text:p>\\)?"
43 nil t)
44 (replace-match ""))
45 (t
46 (goto-char org-lparse-dyn-first-heading-pos)))
47 (insert (org-odt-format-toc)))
35 48
36(defun org-odt-end-export () 49(defun org-odt-end-export ()
50 (org-odt-insert-toc)
37 (org-odt-fixup-label-references) 51 (org-odt-fixup-label-references)
38 52
39 ;; remove empty paragraphs 53 ;; remove empty paragraphs
@@ -139,6 +153,7 @@ with GNU ELPA tar or standard Emacs distribution."
139 (const :tag "Not set" nil) 153 (const :tag "Not set" nil)
140 (directory :tag "Schema directory")) 154 (directory :tag "Schema directory"))
141 :group 'org-export-odt 155 :group 'org-export-odt
156 :version "24.1"
142 :set 157 :set
143 (lambda (var value) 158 (lambda (var value)
144 "Set `org-export-odt-schema-dir'. 159 "Set `org-export-odt-schema-dir'.
@@ -258,7 +273,8 @@ The exporter embeds the exported content just before
258If unspecified, the file named \"OrgOdtContentTemplate.xml\" 273If unspecified, the file named \"OrgOdtContentTemplate.xml\"
259under `org-odt-styles-dir' is used." 274under `org-odt-styles-dir' is used."
260 :type 'file 275 :type 'file
261 :group 'org-export-odt) 276 :group 'org-export-odt
277 :version "24.1")
262 278
263(defcustom org-export-odt-styles-file nil 279(defcustom org-export-odt-styles-file nil
264 "Default styles file for use with ODT export. 280 "Default styles file for use with ODT export.
@@ -292,6 +308,7 @@ a per-file basis. For example,
292#+ODT_STYLES_FILE: \"/path/to/styles.xml\" or 308#+ODT_STYLES_FILE: \"/path/to/styles.xml\" or
293#+ODT_STYLES_FILE: (\"/path/to/file.ott\" (\"styles.xml\" \"image/hdr.png\"))." 309#+ODT_STYLES_FILE: (\"/path/to/file.ott\" (\"styles.xml\" \"image/hdr.png\"))."
294 :group 'org-export-odt 310 :group 'org-export-odt
311 :version "24.1"
295 :type 312 :type
296 '(choice 313 '(choice
297 (const :tag "Factory settings" nil) 314 (const :tag "Factory settings" nil)
@@ -313,20 +330,21 @@ a per-file basis. For example,
313(defvar org-export-odt-embed-images t 330(defvar org-export-odt-embed-images t
314 "Should the images be copied in to the odt file or just linked?") 331 "Should the images be copied in to the odt file or just linked?")
315 332
316(defvar org-export-odt-inline-images 'maybe) ; counterpart of 333(defvar org-export-odt-inline-images 'maybe)
317 ; `org-export-html-inline-images'
318
319(defcustom org-export-odt-inline-image-extensions 334(defcustom org-export-odt-inline-image-extensions
320 '("png" "jpeg" "jpg" "gif") 335 '("png" "jpeg" "jpg" "gif")
321 "Extensions of image files that can be inlined into HTML." 336 "Extensions of image files that can be inlined into HTML."
322 :type '(repeat (string :tag "Extension")) 337 :type '(repeat (string :tag "Extension"))
323 :group 'org-export-odt) 338 :group 'org-export-odt
339 :version "24.1")
324 340
325(defcustom org-export-odt-pixels-per-inch display-pixels-per-inch 341(defcustom org-export-odt-pixels-per-inch display-pixels-per-inch
326 ;; FIXME add docstring 342 "Scaling factor for converting images pixels to inches.
327 "" 343Use this for sizing of embedded images. See Info node `(org)
344Images in ODT export' for more information."
328 :type 'float 345 :type 'float
329 :group 'org-export-odt) 346 :group 'org-export-odt
347 :version "24.1")
330 348
331(defcustom org-export-odt-create-custom-styles-for-srcblocks t 349(defcustom org-export-odt-create-custom-styles-for-srcblocks t
332 "Whether custom styles for colorized source blocks be automatically created. 350 "Whether custom styles for colorized source blocks be automatically created.
@@ -344,6 +362,7 @@ styles.xml already contains needed styles for colorizing to work.
344This variable is effective only if 362This variable is effective only if
345`org-export-odt-fontify-srcblocks' is turned on." 363`org-export-odt-fontify-srcblocks' is turned on."
346 :group 'org-export-odt 364 :group 'org-export-odt
365 :version "24.1"
347 :type 'boolean) 366 :type 'boolean)
348 367
349(defvar org-export-odt-default-org-styles-alist 368(defvar org-export-odt-default-org-styles-alist
@@ -396,6 +415,7 @@ resulting document to this format. During customization of this
396variable, the list of valid values are populated based on 415variable, the list of valid values are populated based on
397`org-export-odt-convert-capabilities'." 416`org-export-odt-convert-capabilities'."
398 :group 'org-export-odt 417 :group 'org-export-odt
418 :version "24.1"
399 :type '(choice :convert-widget 419 :type '(choice :convert-widget
400 (lambda (w) 420 (lambda (w)
401 (apply 'widget-convert (widget-type w) 421 (apply 'widget-convert (widget-type w)
@@ -425,40 +445,6 @@ emacs --batch
425 --visit=MyFile --funcall org-export-as-odt-batch" 445 --visit=MyFile --funcall org-export-as-odt-batch"
426 (org-lparse-batch "odt")) 446 (org-lparse-batch "odt"))
427 447
428;;;###autoload
429(defun org-export-as-odt-to-buffer (arg)
430 "Call `org-lparse-odt` with output to a temporary buffer.
431No file is created. The prefix ARG is passed through to `org-lparse-to-buffer'."
432 (interactive "P")
433 (org-lparse-to-buffer "odt" arg))
434
435;;;###autoload
436(defun org-replace-region-by-odt (beg end)
437 "Assume the current region has org-mode syntax, and convert it to ODT.
438This can be used in any buffer. For example, you could write an
439itemized list in org-mode syntax in an ODT buffer and then use this
440command to convert it."
441 (interactive "r")
442 (org-replace-region-by "odt" beg end))
443
444;;;###autoload
445(defun org-export-region-as-odt (beg end &optional body-only buffer)
446 "Convert region from BEG to END in org-mode buffer to ODT.
447If prefix arg BODY-ONLY is set, omit file header, footer, and table of
448contents, and only produce the region of converted text, useful for
449cut-and-paste operations.
450If BUFFER is a buffer or a string, use/create that buffer as a target
451of the converted ODT. If BUFFER is the symbol `string', return the
452produced ODT as a string and leave not buffer behind. For example,
453a Lisp program could call this function in the following way:
454
455 (setq odt (org-export-region-as-odt beg end t 'string))
456
457When called interactively, the output buffer is selected, and shown
458in a window. A non-interactive call will only return the buffer."
459 (interactive "r\nP")
460 (org-lparse-region "odt" beg end body-only buffer))
461
462;;; org-export-as-odt 448;;; org-export-as-odt
463;;;###autoload 449;;;###autoload
464(defun org-export-as-odt (arg &optional hidden ext-plist 450(defun org-export-as-odt (arg &optional hidden ext-plist
@@ -609,13 +595,12 @@ PUB-DIR is set, use this as the publishing directory."
609 '("<text:date style:data-style-name=\"%s\" text:date-value=\"%s\">" 595 '("<text:date style:data-style-name=\"%s\" text:date-value=\"%s\">"
610 . "</text:date>") date "N75" iso-date)) 596 . "</text:date>") date "N75" iso-date))
611 ;; separator 597 ;; separator
612 "<text:p text:style-name=\"OrgSubtitle\"/>")) 598 "<text:p text:style-name=\"OrgSubtitle\"/>")))))
613 ;; toc
614 (org-odt-format-toc))))
615 599
616(defun org-odt-begin-document-body (opt-plist) 600(defun org-odt-begin-document-body (opt-plist)
617 (org-odt-begin-office-body) 601 (org-odt-begin-office-body)
618 (insert (org-odt-format-preamble opt-plist))) 602 (insert (org-odt-format-preamble opt-plist))
603 (setq org-lparse-dyn-first-heading-pos (point)))
619 604
620(defvar org-lparse-body-only) ; let bound during org-do-lparse 605(defvar org-lparse-body-only) ; let bound during org-do-lparse
621(defvar org-lparse-to-buffer) ; let bound during org-do-lparse 606(defvar org-lparse-to-buffer) ; let bound during org-do-lparse
@@ -646,6 +631,15 @@ PUB-DIR is set, use this as the publishing directory."
646(defun org-odt-end-outline-text () 631(defun org-odt-end-outline-text ()
647 (ignore)) 632 (ignore))
648 633
634(defun org-odt-begin-section (style &optional name)
635 (let ((default-name (car (org-odt-add-automatic-style "Section"))))
636 (org-lparse-insert-tag
637 "<text:section text:style-name=\"%s\" text:name=\"%s\">"
638 style (or name default-name))))
639
640(defun org-odt-end-section ()
641 (org-lparse-insert-tag "</text:section>"))
642
649(defun org-odt-begin-paragraph (&optional style) 643(defun org-odt-begin-paragraph (&optional style)
650 (org-lparse-insert-tag 644 (org-lparse-insert-tag
651 "<text:p%s>" (org-odt-get-extra-attrs-for-paragraph-style style))) 645 "<text:p%s>" (org-odt-get-extra-attrs-for-paragraph-style style)))
@@ -729,13 +723,17 @@ PUB-DIR is set, use this as the publishing directory."
729 (list)) 723 (list))
730 (t (error "Unknown environment %s" style)))) 724 (t (error "Unknown environment %s" style))))
731 725
732(defvar org-lparse-list-level) ; dynamically bound in org-do-lparse 726(defvar org-lparse-list-stack) ; dynamically bound in org-do-lparse
727(defvar org-odt-list-stack-stashed)
733(defun org-odt-begin-list (ltype) 728(defun org-odt-begin-list (ltype)
734 (setq ltype (or (org-lparse-html-list-type-to-canonical-list-type ltype) 729 (setq ltype (or (org-lparse-html-list-type-to-canonical-list-type ltype)
735 ltype)) 730 ltype))
736 (let* ((style-name (org-odt-get-style-name-for-entity 'list ltype)) 731 (let* ((style-name (org-odt-get-style-name-for-entity 'list ltype))
737 (extra (concat (when (= org-lparse-list-level 1) 732 (extra (concat (if (or org-lparse-list-table-p
738 " text:continue-numbering=\"false\"") 733 (and (= 1 (length org-lparse-list-stack))
734 (null org-odt-list-stack-stashed)))
735 " text:continue-numbering=\"false\""
736 " text:continue-numbering=\"true\"")
739 (when style-name 737 (when style-name
740 (format " text:style-name=\"%s\"" style-name))))) 738 (format " text:style-name=\"%s\"" style-name)))))
741 (case ltype 739 (case ltype
@@ -758,11 +756,15 @@ PUB-DIR is set, use this as the publishing directory."
758 (ordered 756 (ordered
759 (assert (not headline) t) 757 (assert (not headline) t)
760 (let* ((counter arg) (extra "")) 758 (let* ((counter arg) (extra ""))
761 (org-lparse-insert-tag "<text:list-item>") 759 (org-lparse-insert-tag (if (= (length org-lparse-list-stack)
760 (length org-odt-list-stack-stashed))
761 "<text:list-header>" "<text:list-item>"))
762 (org-lparse-begin-paragraph))) 762 (org-lparse-begin-paragraph)))
763 (unordered 763 (unordered
764 (let* ((id arg) (extra "")) 764 (let* ((id arg) (extra ""))
765 (org-lparse-insert-tag "<text:list-item>") 765 (org-lparse-insert-tag (if (= (length org-lparse-list-stack)
766 (length org-odt-list-stack-stashed))
767 "<text:list-header>" "<text:list-item>"))
766 (org-lparse-begin-paragraph) 768 (org-lparse-begin-paragraph)
767 (insert (if headline (org-odt-format-target headline id) 769 (insert (if headline (org-odt-format-target headline id)
768 (org-odt-format-bookmark "" id))))) 770 (org-odt-format-bookmark "" id)))))
@@ -783,13 +785,30 @@ PUB-DIR is set, use this as the publishing directory."
783 ltype)) 785 ltype))
784 (case ltype 786 (case ltype
785 ((ordered unordered) 787 ((ordered unordered)
786 (org-lparse-insert-tag "</text:list-item>")) 788 (org-lparse-insert-tag (if (= (length org-lparse-list-stack)
789 (length org-odt-list-stack-stashed))
790 (prog1 "</text:list-header>"
791 (setq org-odt-list-stack-stashed nil))
792 "</text:list-item>")))
787 (description 793 (description
788 (org-lparse-end-list-item-1) 794 (org-lparse-end-list-item-1)
789 (org-lparse-end-list 'description) 795 (org-lparse-end-list 'description)
790 (org-lparse-end-list-item-1)) 796 (org-lparse-end-list-item-1))
791 (t (error "Unknown list type")))) 797 (t (error "Unknown list type"))))
792 798
799(defun org-odt-discontinue-list ()
800 (let ((stashed-stack org-lparse-list-stack))
801 (loop for list-type in stashed-stack
802 do (org-lparse-end-list-item-1 list-type)
803 (org-lparse-end-list list-type))
804 (setq org-odt-list-stack-stashed stashed-stack)))
805
806(defun org-odt-continue-list ()
807 (setq org-odt-list-stack-stashed (nreverse org-odt-list-stack-stashed))
808 (loop for list-type in org-odt-list-stack-stashed
809 do (org-lparse-begin-list list-type)
810 (org-lparse-begin-list-item list-type)))
811
793;; Following variables are let bound when table emission is in 812;; Following variables are let bound when table emission is in
794;; progress. See org-lparse.el. 813;; progress. See org-lparse.el.
795(defvar org-lparse-table-begin-marker) 814(defvar org-lparse-table-begin-marker)
@@ -882,6 +901,7 @@ The TABLE-STYLE-NAME \"OrgEquation\" is used internally for
882formatting of numbered display equations. Do not delete this 901formatting of numbered display equations. Do not delete this
883style from the list." 902style from the list."
884 :group 'org-export-odt 903 :group 'org-export-odt
904 :version "24.1"
885 :type '(choice 905 :type '(choice
886 (const :tag "None" nil) 906 (const :tag "None" nil)
887 (repeat :tag "Table Styles" 907 (repeat :tag "Table Styles"
@@ -897,17 +917,100 @@ style from the list."
897 :key-type symbol 917 :key-type symbol
898 :value-type (const :tag "True" t)))))) 918 :value-type (const :tag "True" t))))))
899 919
920(defvar org-odt-table-style-format
921 "
922<style:style style:name=\"%s\" style:family=\"table\">
923 <style:table-properties style:rel-width=\"%d%%\" fo:margin-top=\"0cm\" fo:margin-bottom=\"0.20cm\" table:align=\"center\"/>
924</style:style>
925"
926 "Template for auto-generated Table styles.")
927
928(defvar org-odt-automatic-styles '()
929 "Registry of automatic styles for various OBJECT-TYPEs.
930The variable has the following form:
931\(\(OBJECT-TYPE-A
932 \(\(OBJECT-NAME-A.1 OBJECT-PROPS-A.1\)
933 \(OBJECT-NAME-A.2 OBJECT-PROPS-A.2\) ...\)\)
934 \(OBJECT-TYPE-B
935 \(\(OBJECT-NAME-B.1 OBJECT-PROPS-B.1\)
936 \(OBJECT-NAME-B.2 OBJECT-PROPS-B.2\) ...\)\)
937 ...\).
938
939OBJECT-TYPEs could be \"Section\", \"Table\", \"Figure\" etc.
940OBJECT-PROPS is (typically) a plist created by passing
941\"#+ATTR_ODT: \" option to `org-lparse-get-block-params'.
942
943Use `org-odt-add-automatic-style' to add update this variable.'")
944
945(defvar org-odt-object-counters nil
946 "Running counters for various OBJECT-TYPEs.
947Use this to generate automatic names and style-names. See
948`org-odt-add-automatic-style'.")
949
950(defun org-odt-write-automatic-styles ()
951 "Write automatic styles to \"content.xml\"."
952 (with-current-buffer
953 (find-file-noselect (expand-file-name "content.xml") t)
954 ;; position the cursor
955 (goto-char (point-min))
956 (re-search-forward " </office:automatic-styles>" nil t)
957 (goto-char (match-beginning 0))
958 ;; write automatic table styles
959 (loop for (style-name props) in
960 (plist-get org-odt-automatic-styles 'Table) do
961 (when (setq props (or (plist-get props :rel-width) 96))
962 (insert (format org-odt-table-style-format style-name props))))))
963
964(defun org-odt-add-automatic-style (object-type &optional object-props)
965 "Create an automatic style of type OBJECT-TYPE with param OBJECT-PROPS.
966OBJECT-PROPS is (typically) a plist created by passing
967\"#+ATTR_ODT: \" option of the object in question to
968`org-lparse-get-block-params'.
969
970Use `org-odt-object-counters' to generate an automatic
971OBJECT-NAME and STYLE-NAME. If OBJECT-PROPS is non-nil, add a
972new entry in `org-odt-automatic-styles'. Return (OBJECT-NAME
973. STYLE-NAME)."
974 (assert (stringp object-type))
975 (let* ((object (intern object-type))
976 (seqvar object)
977 (seqno (1+ (or (plist-get org-odt-object-counters seqvar) 0)))
978 (object-name (format "%s%d" object-type seqno)) style-name)
979 (setq org-odt-object-counters
980 (plist-put org-odt-object-counters seqvar seqno))
981 (when object-props
982 (setq style-name (format "Org%s" object-name))
983 (setq org-odt-automatic-styles
984 (plist-put org-odt-automatic-styles object
985 (append (list (list style-name object-props))
986 (plist-get org-odt-automatic-styles object)))))
987 (cons object-name style-name)))
988
989(defvar org-odt-table-indentedp nil)
900(defun org-odt-begin-table (caption label attributes) 990(defun org-odt-begin-table (caption label attributes)
901 (setq org-odt-table-style attributes) 991 (setq org-odt-table-indentedp (not (null org-lparse-list-stack)))
992 (when org-odt-table-indentedp
993 ;; Within the Org file, the table is appearing within a list item.
994 ;; OpenDocument doesn't allow table to appear within list items.
995 ;; Temporarily terminate the list, emit the table and then
996 ;; re-continue the list.
997 (org-odt-discontinue-list)
998 ;; Put the Table in an indented section.
999 (let ((level (length org-odt-list-stack-stashed)))
1000 (org-odt-begin-section (format "OrgIndentedSection-Level-%d" level))))
1001 (setq attributes (org-lparse-get-block-params attributes))
1002 (setq org-odt-table-style (plist-get attributes :style))
902 (setq org-odt-table-style-spec 1003 (setq org-odt-table-style-spec
903 (assoc org-odt-table-style org-export-odt-table-styles)) 1004 (assoc org-odt-table-style org-export-odt-table-styles))
904 (when label 1005 (when (or label caption)
905 (insert 1006 (insert
906 (org-odt-format-stylized-paragraph 1007 (org-odt-format-stylized-paragraph
907 'table (org-odt-format-entity-caption label caption "__Table__")))) 1008 'table (org-odt-format-entity-caption label caption "__Table__"))))
908 (org-lparse-insert-tag 1009 (let ((name-and-style (org-odt-add-automatic-style "Table" attributes)))
909 "<table:table table:name=\"%s\" table:style-name=\"%s\">" 1010 (org-lparse-insert-tag
910 (or label "") (or (nth 1 org-odt-table-style-spec) "OrgTable")) 1011 "<table:table table:name=\"%s\" table:style-name=\"%s\">"
1012 (car name-and-style) (or (nth 1 org-odt-table-style-spec)
1013 (cdr name-and-style) "OrgTable")))
911 (setq org-lparse-table-begin-marker (point))) 1014 (setq org-lparse-table-begin-marker (point)))
912 1015
913(defvar org-lparse-table-colalign-info) 1016(defvar org-lparse-table-colalign-info)
@@ -940,14 +1043,17 @@ style from the list."
940 ((equal spec "table-cell:style-name") 1043 ((equal spec "table-cell:style-name")
941 (replace-match table-cell-style t t)))))) 1044 (replace-match table-cell-style t t))))))
942 (goto-char (point-max)) 1045 (goto-char (point-max))
943 (org-lparse-insert-tag "</table:table>")) 1046 (org-lparse-insert-tag "</table:table>")
1047 (when org-odt-table-indentedp
1048 (org-odt-end-section)
1049 (org-odt-continue-list)))
944 1050
945(defun org-odt-begin-table-rowgroup (&optional is-header-row) 1051(defun org-odt-begin-table-rowgroup (&optional is-header-row)
946 (when org-lparse-table-rowgrp-open 1052 (when org-lparse-table-rowgrp-open
947 (org-lparse-end 'TABLE-ROWGROUP)) 1053 (org-lparse-end 'TABLE-ROWGROUP))
948 (org-lparse-insert-tag (if is-header-row 1054 (org-lparse-insert-tag (if is-header-row
949 "<table:table-header-rows>" 1055 "<table:table-header-rows>"
950 "<table:table-rows>")) 1056 "<table:table-rows>"))
951 (setq org-lparse-table-rowgrp-open t) 1057 (setq org-lparse-table-rowgrp-open t)
952 (setq org-lparse-table-cur-rowgrp-is-hdr is-header-row)) 1058 (setq org-lparse-table-cur-rowgrp-is-hdr is-header-row))
953 1059
@@ -1078,6 +1184,16 @@ styles congruent with the ODF-1.2 specification."
1078 (org-lparse-end-paragraph)) 1184 (org-lparse-end-paragraph))
1079 1185
1080(defun org-odt-begin-toc (lang-specific-heading max-level) 1186(defun org-odt-begin-toc (lang-specific-heading max-level)
1187 ;; Strings in `org-export-language-setup' can contain named html
1188 ;; entities. Replace those with utf-8 equivalents.
1189 (let ((i 0) entity rpl)
1190 (while (string-match "&\\([^#].*?\\);" lang-specific-heading i)
1191 (setq entity (match-string 1 lang-specific-heading))
1192 (if (not (setq rpl (org-entity-get-representation entity 'utf8)))
1193 (setq i (match-end 0))
1194 (setq i (+ (match-beginning 0) (length rpl)))
1195 (setq lang-specific-heading
1196 (replace-match rpl t t lang-specific-heading)))))
1081 (insert 1197 (insert
1082 (format " 1198 (format "
1083 <text:table-of-content text:style-name=\"Sect2\" text:protected=\"true\" text:name=\"Table of Contents1\"> 1199 <text:table-of-content text:style-name=\"Sect2\" text:protected=\"true\" text:name=\"Table of Contents1\">
@@ -1117,9 +1233,9 @@ styles congruent with the ODF-1.2 specification."
1117 (concat snumber ". ")) 1233 (concat snumber ". "))
1118 headline 1234 headline
1119 (and tags 1235 (and tags
1120 (concat 1236 (concat
1121 (org-lparse-format 'SPACES 3) 1237 (org-lparse-format 'SPACES 3)
1122 (org-lparse-format 'FONTIFY tags "tag"))))) 1238 (org-lparse-format 'FONTIFY tags "tag")))))
1123 (when todo 1239 (when todo
1124 (setq headline (org-lparse-format 'FONTIFY headline "todo"))) 1240 (setq headline (org-lparse-format 'FONTIFY headline "todo")))
1125 1241
@@ -1137,10 +1253,13 @@ styles congruent with the ODF-1.2 specification."
1137(defun org-odt-format-link (desc href &optional attr) 1253(defun org-odt-format-link (desc href &optional attr)
1138 (cond 1254 (cond
1139 ((and (= (string-to-char href) ?#) (not org-odt-suppress-xref)) 1255 ((and (= (string-to-char href) ?#) (not org-odt-suppress-xref))
1140 (setq href (concat org-export-odt-bookmark-prefix (substring href 1))) 1256 (setq href (substring href 1))
1141 (let ((xref-format "text")) 1257 (let ((xref-format "text"))
1142 (when (numberp desc) 1258 (when (numberp desc)
1143 (setq desc (format "%d" desc) xref-format "number")) 1259 (setq desc (format "%d" desc) xref-format "number"))
1260 (when (listp desc)
1261 (setq desc (mapconcat 'identity desc ".") xref-format "chapter"))
1262 (setq href (concat org-export-odt-bookmark-prefix href))
1144 (org-odt-format-tags 1263 (org-odt-format-tags
1145 '("<text:bookmark-ref text:reference-format=\"%s\" text:ref-name=\"%s\">" . 1264 '("<text:bookmark-ref text:reference-format=\"%s\" text:ref-name=\"%s\">" .
1146 "</text:bookmark-ref>") 1265 "</text:bookmark-ref>")
@@ -1204,7 +1323,8 @@ Turn this option on if you want to colorize the source code
1204blocks in the exported file. For colorization to work, you need 1323blocks in the exported file. For colorization to work, you need
1205to make available an enhanced version of `htmlfontify' library." 1324to make available an enhanced version of `htmlfontify' library."
1206 :type 'boolean 1325 :type 'boolean
1207 :group 'org-export-odt) 1326 :group 'org-export-odt
1327 :version "24.1")
1208 1328
1209(defun org-odt-format-source-line-with-line-number-and-label 1329(defun org-odt-format-source-line-with-line-number-and-label
1210 (line rpllbl num fontifier par-style) 1330 (line rpllbl num fontifier par-style)
@@ -1415,15 +1535,27 @@ value of `org-export-odt-fontify-srcblocks."
1415 (org-odt-copy-image-file thefile) thelink)))) 1535 (org-odt-copy-image-file thefile) thelink))))
1416 (org-export-odt-format-image thefile href))) 1536 (org-export-odt-format-image thefile href)))
1417 1537
1418(defun org-export-odt-format-formula (src href &optional embed-as) 1538(defvar org-odt-entity-labels-alist nil
1419 "Create image tag with source and attributes." 1539 "Associate Labels with the Labeled entities.
1540Each element of the alist is of the form (LABEL-NAME
1541CATEGORY-NAME SEQNO LABEL-STYLE-NAME). LABEL-NAME is same as
1542that specified by \"#+LABEL: ...\" line. CATEGORY-NAME is the
1543type of the entity that LABEL-NAME is attached to. CATEGORY-NAME
1544can be one of \"Table\", \"Figure\" or \"Equation\". SEQNO is
1545the unique number assigned to the referenced entity on a
1546per-CATEGORY basis. It is generated sequentially and is 1-based.
1547LABEL-STYLE-NAME is a key `org-odt-label-styles'.
1548
1549See `org-odt-add-label-definition' and
1550`org-odt-fixup-label-references'.")
1551
1552(defun org-export-odt-format-formula (src href)
1420 (save-match-data 1553 (save-match-data
1421 (let* ((caption (org-find-text-property-in-string 'org-caption src)) 1554 (let* ((caption (org-find-text-property-in-string 'org-caption src))
1422 (caption (and caption (org-xml-format-desc caption))) 1555 (caption (and caption (org-xml-format-desc caption)))
1423 (label (org-find-text-property-in-string 'org-label src)) 1556 (label (org-find-text-property-in-string 'org-label src))
1424 (latex-frag (org-find-text-property-in-string 'org-latex-src src)) 1557 (latex-frag (org-find-text-property-in-string 'org-latex-src src))
1425 (embed-as (or embed-as 1558 (embed-as (or (and latex-frag
1426 (and latex-frag
1427 (org-find-text-property-in-string 1559 (org-find-text-property-in-string
1428 'org-latex-src-embed-type src)) 1560 'org-latex-src-embed-type src))
1429 (if (or caption label) 'paragraph 'character))) 1561 (if (or caption label) 'paragraph 'character)))
@@ -1438,11 +1570,15 @@ value of `org-export-odt-fontify-srcblocks."
1438 (org-lparse-end-paragraph) 1570 (org-lparse-end-paragraph)
1439 (org-lparse-insert-list-table 1571 (org-lparse-insert-list-table
1440 `((,(org-odt-format-entity 1572 `((,(org-odt-format-entity
1441 (if caption "CaptionedDisplayFormula" "DisplayFormula") 1573 (if (not (or caption label)) "DisplayFormula"
1442 href width height :caption caption :label nil) 1574 "CaptionedDisplayFormula")
1443 ,(if (not label) "" 1575 href width height :caption caption :label label)
1444 (org-odt-format-entity-caption label nil "__MathFormula__")))) 1576 ,(if (not (or caption label)) ""
1445 nil nil nil "OrgEquation" nil '((1 "c" 8) (2 "c" 1))) 1577 (let* ((label-props (car org-odt-entity-labels-alist)))
1578 (setcar (last label-props) "math-label")
1579 (apply 'org-odt-format-label-definition
1580 caption label-props)))))
1581 nil nil nil ":style \"OrgEquation\"" nil '((1 "c" 8) (2 "c" 1)))
1446 (throw 'nextline nil)))))) 1582 (throw 'nextline nil))))))
1447 1583
1448(defvar org-odt-embedded-formulas-count 0) 1584(defvar org-odt-embedded-formulas-count 0)
@@ -1457,19 +1593,19 @@ value of `org-export-odt-fontify-srcblocks."
1457 (message "Embedding %s as %s ..." 1593 (message "Embedding %s as %s ..."
1458 (substring-no-properties path) target-file) 1594 (substring-no-properties path) target-file)
1459 1595
1460 (make-directory target-dir) 1596 (make-directory target-dir)
1461 (org-odt-create-manifest-file-entry 1597 (org-odt-create-manifest-file-entry
1462 "application/vnd.oasis.opendocument.formula" target-dir "1.2") 1598 "application/vnd.oasis.opendocument.formula" target-dir "1.2")
1463 1599
1464 (case (org-odt-is-formula-link-p src-file) 1600 (case (org-odt-is-formula-link-p src-file)
1465 (mathml 1601 (mathml
1466 (copy-file src-file target-file 'overwrite)) 1602 (copy-file src-file target-file 'overwrite))
1467 (odf 1603 (odf
1468 (org-odt-zip-extract-one src-file "content.xml" target-dir)) 1604 (org-odt-zip-extract-one src-file "content.xml" target-dir))
1469 (t 1605 (t
1470 (error "%s is not a formula file" src-file))) 1606 (error "%s is not a formula file" src-file)))
1471 1607
1472 (org-odt-create-manifest-file-entry "text/xml" target-file)) 1608 (org-odt-create-manifest-file-entry "text/xml" target-file))
1473 target-file)) 1609 target-file))
1474 1610
1475(defun org-odt-format-inline-formula (thefile) 1611(defun org-odt-format-inline-formula (thefile)
@@ -1508,7 +1644,8 @@ ATTR is a string of other attributes of the a element."
1508 (not fragment))) 1644 (not fragment)))
1509 (type (if (equal type-1 "id") "file" type-1)) 1645 (type (if (equal type-1 "id") "file" type-1))
1510 (filename path) 1646 (filename path)
1511 (thefile path)) 1647 (thefile path)
1648 sec-frag sec-nos)
1512 (cond 1649 (cond
1513 ;; check for inlined images 1650 ;; check for inlined images
1514 ((and (member type '("file")) 1651 ((and (member type '("file"))
@@ -1524,6 +1661,7 @@ ATTR is a string of other attributes of the a element."
1524 (org-odt-is-formula-link-p filename) 1661 (org-odt-is-formula-link-p filename)
1525 (or (not descp))) 1662 (or (not descp)))
1526 (org-odt-format-inline-formula thefile)) 1663 (org-odt-format-inline-formula thefile))
1664 ;; code references
1527 ((string= type "coderef") 1665 ((string= type "coderef")
1528 (let* ((ref fragment) 1666 (let* ((ref fragment)
1529 (lineno-or-ref (cdr (assoc ref org-export-code-refs))) 1667 (lineno-or-ref (cdr (assoc ref org-export-code-refs)))
@@ -1546,6 +1684,23 @@ ATTR is a string of other attributes of the a element."
1546 (or desc "%s")) 1684 (or desc "%s"))
1547 lineno-or-ref)) 1685 lineno-or-ref))
1548 (org-odt-format-link (org-xml-format-desc desc) href))))) 1686 (org-odt-format-link (org-xml-format-desc desc) href)))))
1687 ;; links to headlines
1688 ((and (string= type "")
1689 (or (not thefile) (string= thefile ""))
1690 (plist-get org-lparse-opt-plist :section-numbers)
1691 (setq sec-frag fragment)
1692 (org-find-text-property-in-string 'org-no-description fragment)
1693 (or (string-match "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag)
1694 (and (setq sec-frag
1695 (loop for alias in org-export-target-aliases do
1696 (when (member fragment (cdr alias))
1697 (return (car alias)))))
1698 (string-match "\\`sec\\(\\(-[0-9]+\\)+\\)" sec-frag)))
1699 (setq sec-nos (org-split-string (match-string 1 sec-frag) "-"))
1700 (<= (length sec-nos) (plist-get org-lparse-opt-plist
1701 :headline-levels)))
1702 (let ((org-odt-suppress-xref nil))
1703 (org-odt-format-link sec-nos (concat "#" sec-frag) attr)))
1549 (t 1704 (t
1550 (when (string= type "file") 1705 (when (string= type "file")
1551 (setq thefile 1706 (setq thefile
@@ -1574,7 +1729,7 @@ ATTR is a string of other attributes of the a element."
1574 "</text:h>") text level level))) 1729 "</text:h>") text level level)))
1575 1730
1576(defun org-odt-format-headline (title extra-targets tags 1731(defun org-odt-format-headline (title extra-targets tags
1577 &optional snumber level) 1732 &optional snumber level)
1578 (concat 1733 (concat
1579 (org-lparse-format 'EXTRA-TARGETS extra-targets) 1734 (org-lparse-format 'EXTRA-TARGETS extra-targets)
1580 1735
@@ -1654,9 +1809,7 @@ ATTR is a string of other attributes of the a element."
1654 (attr-plist (org-lparse-get-block-params attr)) 1809 (attr-plist (org-lparse-get-block-params attr))
1655 (user-frame-anchor 1810 (user-frame-anchor
1656 (car (assoc-string (plist-get attr-plist :anchor) 1811 (car (assoc-string (plist-get attr-plist :anchor)
1657 (if (or caption label) 1812 '(("as-char") ("paragraph") ("page")) t)))
1658 '(("paragraph") ("page"))
1659 '(("character") ("paragraph") ("page"))) t)))
1660 (user-frame-style 1813 (user-frame-style
1661 (and user-frame-anchor (plist-get attr-plist :style))) 1814 (and user-frame-anchor (plist-get attr-plist :style)))
1662 (user-frame-attrs 1815 (user-frame-attrs
@@ -1666,8 +1819,10 @@ ATTR is a string of other attributes of the a element."
1666 (embed-as (cond 1819 (embed-as (cond
1667 (latex-frag 1820 (latex-frag
1668 (symbol-name 1821 (symbol-name
1669 (or (org-find-text-property-in-string 1822 (case (org-find-text-property-in-string
1670 'org-latex-src-embed-type src) 'character))) 1823 'org-latex-src-embed-type src)
1824 (paragraph 'paragraph)
1825 (t 'as-char))))
1671 (user-frame-anchor) 1826 (user-frame-anchor)
1672 (t "paragraph"))) 1827 (t "paragraph")))
1673 (size (org-odt-image-size-from-file 1828 (size (org-odt-image-size-from-file
@@ -1714,7 +1869,8 @@ ATTR is a string of other attributes of the a element."
1714 (org-odt-format-tags 1869 (org-odt-format-tags
1715 '("<draw:text-box %s>" . "</draw:text-box>") 1870 '("<draw:text-box %s>" . "</draw:text-box>")
1716 text (concat (format " fo:min-height=\"%0.2fcm\"" (or height .2)) 1871 text (concat (format " fo:min-height=\"%0.2fcm\"" (or height .2))
1717 (format " fo:min-width=\"%0.2fcm\"" (or width .2)))) 1872 (unless width
1873 (format " fo:min-width=\"%0.2fcm\"" (or width .2)))))
1718 width nil style extra anchor-type)) 1874 width nil style extra anchor-type))
1719 1875
1720(defun org-odt-format-inlinetask (heading content 1876(defun org-odt-format-inlinetask (heading content
@@ -1729,9 +1885,13 @@ ATTR is a string of other attributes of the a element."
1729 content) nil nil "OrgInlineTaskFrame" " style:rel-width=\"100%\""))) 1885 content) nil nil "OrgInlineTaskFrame" " style:rel-width=\"100%\"")))
1730 1886
1731(defvar org-odt-entity-frame-styles 1887(defvar org-odt-entity-frame-styles
1732 '(("CharacterImage" "__Figure__" ("OrgInlineImage" nil "as-char")) 1888 '(("As-CharImage" "__Figure__" ("OrgInlineImage" nil "as-char"))
1733 ("ParagraphImage" "__Figure__" ("OrgDisplayImage" nil "paragraph")) 1889 ("ParagraphImage" "__Figure__" ("OrgDisplayImage" nil "paragraph"))
1734 ("PageImage" "__Figure__" ("OrgPageImage" nil "page")) 1890 ("PageImage" "__Figure__" ("OrgPageImage" nil "page"))
1891 ("CaptionedAs-CharImage" "__Figure__"
1892 ("OrgCaptionedImage"
1893 " style:rel-width=\"100%\" style:rel-height=\"scale\"" "paragraph")
1894 ("OrgInlineImage" nil "as-char"))
1735 ("CaptionedParagraphImage" "__Figure__" 1895 ("CaptionedParagraphImage" "__Figure__"
1736 ("OrgCaptionedImage" 1896 ("OrgCaptionedImage"
1737 " style:rel-width=\"100%\" style:rel-height=\"scale\"" "paragraph") 1897 " style:rel-width=\"100%\" style:rel-height=\"scale\"" "paragraph")
@@ -1803,12 +1963,12 @@ ATTR is a string of other attributes of the a element."
1803 target-file)) 1963 target-file))
1804 1964
1805(defvar org-export-odt-image-size-probe-method 1965(defvar org-export-odt-image-size-probe-method
1806 '(emacs imagemagick force) 1966 (append (and (executable-find "identify") '(imagemagick)) ; See Bug#10675
1807 "Ordered list of methods by for determining size of an embedded 1967 '(emacs fixed))
1808 image.") 1968 "Ordered list of methods for determining image sizes.")
1809 1969
1810(defvar org-export-odt-default-image-sizes-alist 1970(defvar org-export-odt-default-image-sizes-alist
1811 '(("character" . (5 . 0.4)) 1971 '(("as-char" . (5 . 0.4))
1812 ("paragraph" . (5 . 5))) 1972 ("paragraph" . (5 . 5)))
1813 "Hardcoded image dimensions one for each of the anchor 1973 "Hardcoded image dimensions one for each of the anchor
1814 methods.") 1974 methods.")
@@ -1832,7 +1992,9 @@ ATTR is a string of other attributes of the a element."
1832 (pixels-to-cms (cdr size-in-pixels))))))) 1992 (pixels-to-cms (cdr size-in-pixels)))))))
1833 (case probe-method 1993 (case probe-method
1834 (emacs 1994 (emacs
1835 (size-in-cms (ignore-errors (image-size (create-image file) 'pixels)))) 1995 (size-in-cms (ignore-errors ; Emacs could be in batch mode
1996 (clear-image-cache)
1997 (image-size (create-image file) 'pixels))))
1836 (imagemagick 1998 (imagemagick
1837 (size-in-cms 1999 (size-in-cms
1838 (let ((dim (shell-command-to-string 2000 (let ((dim (shell-command-to-string
@@ -1877,27 +2039,15 @@ ATTR is a string of other attributes of the a element."
1877 (setq width (* scale width) height (* scale height))))) 2039 (setq width (* scale width) height (* scale height)))))
1878 (cons width height))) 2040 (cons width height)))
1879 2041
1880(defvar org-odt-entity-labels-alist nil
1881 "Associate Labels with the Labeled entities.
1882Each element of the alist is of the form (LABEL-NAME
1883CATEGORY-NAME SEQNO LABEL-STYLE-NAME). LABEL-NAME is same as
1884that specified by \"#+LABEL: ...\" line. CATEGORY-NAME is the
1885type of the entity that LABEL-NAME is attached to. CATEGORY-NAME
1886can be one of \"Table\", \"Figure\" or \"Equation\". SEQNO is
1887the unique number assigned to the referenced entity on a
1888per-CATEGORY basis. It is generated sequentially and is 1-based.
1889LABEL-STYLE-NAME is a key `org-odt-label-styles'.
1890
1891See `org-odt-add-label-definition' and
1892`org-odt-fixup-label-references'.")
1893
1894(defvar org-odt-entity-counts-plist nil 2042(defvar org-odt-entity-counts-plist nil
1895 "Plist of running counters of SEQNOs for each of the CATEGORY-NAMEs. 2043 "Plist of running counters of SEQNOs for each of the CATEGORY-NAMEs.
1896See `org-odt-entity-labels-alist' for known CATEGORY-NAMEs.") 2044See `org-odt-entity-labels-alist' for known CATEGORY-NAMEs.")
1897 2045
1898(defvar org-odt-label-styles 2046(defvar org-odt-label-styles
1899 '(("text" "(%n)" "text" "(%n)") 2047 '(("math-formula" "%c" "text" "(%n)")
1900 ("category-and-value" "%e %n%c" "category-and-value" "%e %n")) 2048 ("math-label" "(%n)" "text" "(%n)")
2049 ("category-and-value" "%e %n: %c" "category-and-value" "%e %n")
2050 ("value" "%e %n: %c" "value" "%n"))
1901 "Specify how labels are applied and referenced. 2051 "Specify how labels are applied and referenced.
1902This is an alist where each element is of the 2052This is an alist where each element is of the
1903form (LABEL-STYLE-NAME LABEL-ATTACH-FMT LABEL-REF-MODE 2053form (LABEL-STYLE-NAME LABEL-ATTACH-FMT LABEL-REF-MODE
@@ -1918,89 +2068,105 @@ specifiers - %e and %n. %e is replaced with the CATEGORY-NAME.
1918%n is replaced with SEQNO. See 2068%n is replaced with SEQNO. See
1919`org-odt-format-label-reference'.") 2069`org-odt-format-label-reference'.")
1920 2070
2071(defcustom org-export-odt-category-strings
2072 '(("en" "Table" "Figure" "Equation" "Equation"))
2073 "Specify category strings for various captionable entities.
2074Captionable entity can be one of a Table, an Embedded Image, a
2075LaTeX fragment (generated with dvipng) or a Math Formula.
2076
2077For example, when `org-export-default-language' is \"en\", an
2078embedded image will be captioned as \"Figure 1: Orgmode Logo\".
2079If you want the images to be captioned instead as \"Illustration
20801: Orgmode Logo\", then modify the entry for \"en\" as shown
2081below.
2082
2083 \(setq org-export-odt-category-strings
2084 '\(\(\"en\" \"Table\" \"Illustration\"
2085 \"Equation\" \"Equation\"\)\)\)"
2086 :group 'org-export-odt
2087 :version "24.1"
2088 :type '(repeat (list (string :tag "Language tag")
2089 (choice :tag "Table"
2090 (const :tag "Use Default" nil)
2091 (string :tag "Category string"))
2092 (choice :tag "Figure"
2093 (const :tag "Use Default" nil)
2094 (string :tag "Category string"))
2095 (choice :tag "Math Formula"
2096 (const :tag "Use Default" nil)
2097 (string :tag "Category string"))
2098 (choice :tag "Dvipng Image"
2099 (const :tag "Use Default" nil)
2100 (string :tag "Category string")))))
2101
1921(defvar org-odt-category-map-alist 2102(defvar org-odt-category-map-alist
1922 '(("__Table__" "Table" "category-and-value") 2103 '(("__Table__" "Table" "value")
1923 ("__Figure__" "Figure" "category-and-value") 2104 ("__Figure__" "Illustration" "value")
1924 ("__MathFormula__" "Equation" "text") 2105 ("__MathFormula__" "Text" "math-formula")
1925 ("__DvipngImage__" "Equation" "category-and-value")) 2106 ("__DvipngImage__" "Equation" "value")
1926 "Map a CATEGORY-HANDLE to CATEGORY-NAME and LABEL-STYLE. 2107 ;; ("__Table__" "Table" "category-and-value")
1927This is an alist where each element is of the form 2108 ;; ("__Figure__" "Figure" "category-and-value")
1928\\(CATEGORY-HANDLE CATEGORY-NAME LABEL-STYLE\\). CATEGORY_HANDLE 2109 ;; ("__DvipngImage__" "Equation" "category-and-value")
1929could either be one of the internal handles (as seen above) or be 2110 )
1930derived from the \"#+LABEL:<label-name>\" specification. See 2111 "Map a CATEGORY-HANDLE to OD-VARIABLE and LABEL-STYLE.
1931`org-export-odt-get-category-from-label'. CATEGORY-NAME and 2112This is a list where each entry is of the form \\(CATEGORY-HANDLE
1932LABEL-STYLE are used for generating ODT labels. See 2113OD-VARIABLE LABEL-STYLE\\). CATEGORY_HANDLE identifies the
1933`org-odt-label-styles'.") 2114captionable entity in question. OD-VARIABLE is the OpenDocument
1934 2115sequence counter associated with the entity. These counters are
1935(defvar org-export-odt-user-categories 2116declared within
1936 '("Illustration" "Table" "Text" "Drawing" "Equation" "Figure")) 2117\"<text:sequence-decls>...</text:sequence-decls>\" block of
1937 2118`org-export-odt-content-template-file'. LABEL-STYLE is a key
1938(defvar org-export-odt-get-category-from-label nil 2119into `org-odt-label-styles' and specifies how a given entity
1939 "Should category of label be inferred from label itself. 2120should be captioned and referenced.
1940When this option is non-nil, a label is parsed in to two 2121
1941component parts delimited by a \":\" (colon) as shown here - 2122The position of a CATEGORY-HANDLE in this list is used as an
1942#+LABEL:[CATEGORY-HANDLE:]EXTRA. The CATEGORY-HANDLE is mapped 2123index in to per-language entry for
1943to a CATEGORY-NAME and LABEL-STYLE using 2124`org-export-odt-category-strings' to retrieve a CATEGORY-NAME.
1944`org-odt-category-map-alist'. (If no such map is provided and 2125This CATEGORY-NAME is then used for qualifying the user-specified
1945CATEGORY-NAME is set to CATEGORY-HANDLE and LABEL-STYLE is set to 2126captions on export.")
1946\"category-and-value\"). If CATEGORY-NAME so obtained is listed
1947under `org-export-odt-user-categories' then the user specified
1948styles are used. Otherwise styles as determined by the internal
1949CATEGORY-HANDLE is used. See
1950`org-odt-get-label-category-and-style' for details.")
1951
1952(defun org-odt-get-label-category-and-style (label default-category)
1953 "See `org-export-odt-get-category-from-label'."
1954 (let ((default-category-map
1955 (assoc default-category org-odt-category-map-alist))
1956 user-category user-category-map category)
1957 (cond
1958 ((not org-export-odt-get-category-from-label)
1959 default-category-map)
1960 ((not (setq user-category
1961 (save-match-data
1962 (and (string-match "\\`\\(.*\\):.+" label)
1963 (match-string 1 label)))))
1964 default-category-map)
1965 (t
1966 (setq user-category-map
1967 (or (assoc user-category org-odt-category-map-alist)
1968 (list nil user-category "category-and-value"))
1969 category (nth 1 user-category-map))
1970 (if (member category org-export-odt-user-categories)
1971 user-category-map
1972 default-category-map)))))
1973 2127
1974(defun org-odt-add-label-definition (label default-category) 2128(defun org-odt-add-label-definition (label default-category)
1975 "Create an entry in `org-odt-entity-labels-alist' and return it." 2129 "Create an entry in `org-odt-entity-labels-alist' and return it."
1976 (setq label (substring-no-properties label)) 2130 (let* ((label-props (assoc default-category org-odt-category-map-alist))
1977 (let* ((label-props (org-odt-get-label-category-and-style 2131 ;; identify the sequence number
1978 label default-category)) 2132 (counter (nth 1 label-props))
1979 (category (nth 1 label-props)) 2133 (sequence-var (intern counter))
1980 (counter category)
1981 (label-style (nth 2 label-props))
1982 (sequence-var (intern (mapconcat
1983 'downcase
1984 (org-split-string counter) "-")))
1985 (seqno (1+ (or (plist-get org-odt-entity-counts-plist sequence-var) 2134 (seqno (1+ (or (plist-get org-odt-entity-counts-plist sequence-var)
1986 0))) 2135 0)))
1987 (label-props (list label category seqno label-style))) 2136 ;; assign an internal label, if user has not provided one
2137 (label (if label (substring-no-properties label)
2138 (format "%s-%s" default-category seqno)))
2139 ;; identify label style
2140 (label-style (nth 2 label-props))
2141 ;; grok language setting
2142 (en-strings (assoc-default "en" org-export-odt-category-strings))
2143 (lang (plist-get org-lparse-opt-plist :language))
2144 (lang-strings (assoc-default lang org-export-odt-category-strings))
2145 ;; retrieve localized category sting
2146 (pos (- (length org-odt-category-map-alist)
2147 (length (memq label-props org-odt-category-map-alist))))
2148 (category (or (nth pos lang-strings) (nth pos en-strings)))
2149 (label-props (list label category counter seqno label-style)))
2150 ;; synchronize internal counters
1988 (setq org-odt-entity-counts-plist 2151 (setq org-odt-entity-counts-plist
1989 (plist-put org-odt-entity-counts-plist sequence-var seqno)) 2152 (plist-put org-odt-entity-counts-plist sequence-var seqno))
2153 ;; stash label properties for later retrieval
1990 (push label-props org-odt-entity-labels-alist) 2154 (push label-props org-odt-entity-labels-alist)
1991 label-props)) 2155 label-props))
1992 2156
1993(defun org-odt-format-label-definition (caption label category seqno label-style) 2157(defun org-odt-format-label-definition (caption label category counter
2158 seqno label-style)
1994 (assert label) 2159 (assert label)
1995 (format-spec 2160 (format-spec
1996 (cadr (assoc-string label-style org-odt-label-styles t)) 2161 (cadr (assoc-string label-style org-odt-label-styles t))
1997 `((?e . ,category) 2162 `((?e . ,category)
1998 (?n . ,(org-odt-format-tags 2163 (?n . ,(org-odt-format-tags
1999 '("<text:sequence text:ref-name=\"%s\" text:name=\"%s\" text:formula=\"ooow:%s+1\" style:num-format=\"1\">" . "</text:sequence>") 2164 '("<text:sequence text:ref-name=\"%s\" text:name=\"%s\" text:formula=\"ooow:%s+1\" style:num-format=\"1\">" . "</text:sequence>")
2000 (format "%d" seqno) label category category)) 2165 (format "%d" seqno) label counter counter))
2001 (?c . ,(or (and caption (concat ": " caption)) ""))))) 2166 (?c . ,(or caption "")))))
2002 2167
2003(defun org-odt-format-label-reference (label category seqno label-style) 2168(defun org-odt-format-label-reference (label category counter
2169 seqno label-style)
2004 (assert label) 2170 (assert label)
2005 (save-match-data 2171 (save-match-data
2006 (let* ((fmt (cddr (assoc-string label-style org-odt-label-styles t))) 2172 (let* ((fmt (cddr (assoc-string label-style org-odt-label-styles t)))
@@ -2026,10 +2192,9 @@ CATEGORY-HANDLE is used. See
2026 (format "Unable to resolve reference to label \"%s\"" label)))))) 2192 (format "Unable to resolve reference to label \"%s\"" label))))))
2027 2193
2028(defun org-odt-format-entity-caption (label caption category) 2194(defun org-odt-format-entity-caption (label caption category)
2029 (or (and label 2195 (if (not (or label caption)) ""
2030 (apply 'org-odt-format-label-definition 2196 (apply 'org-odt-format-label-definition caption
2031 caption (org-odt-add-label-definition label category))) 2197 (org-odt-add-label-definition label category))))
2032 caption ""))
2033 2198
2034(defun org-odt-format-tags (tag text &rest args) 2199(defun org-odt-format-tags (tag text &rest args)
2035 (let ((prefix (when org-lparse-encode-pending "@")) 2200 (let ((prefix (when org-lparse-encode-pending "@"))
@@ -2054,6 +2219,9 @@ CATEGORY-HANDLE is used. See
2054 org-odt-embedded-images-count 0 2219 org-odt-embedded-images-count 0
2055 org-odt-embedded-formulas-count 0 2220 org-odt-embedded-formulas-count 0
2056 org-odt-entity-labels-alist nil 2221 org-odt-entity-labels-alist nil
2222 org-odt-list-stack-stashed nil
2223 org-odt-automatic-styles nil
2224 org-odt-object-counters nil
2057 org-odt-entity-counts-plist nil) 2225 org-odt-entity-counts-plist nil)
2058 content-file)) 2226 content-file))
2059 2227
@@ -2064,10 +2232,14 @@ component xml buffers before they are saved. Turn this off for
2064regular use. Turn this on if you need to examine the xml 2232regular use. Turn this on if you need to examine the xml
2065visually." 2233visually."
2066 :group 'org-export-odt 2234 :group 'org-export-odt
2235 :version "24.1"
2067 :type 'boolean) 2236 :type 'boolean)
2068 2237
2069(defvar hfy-user-sheet-assoc) ; bound during org-do-lparse 2238(defvar hfy-user-sheet-assoc) ; bound during org-do-lparse
2070(defun org-odt-save-as-outfile (target opt-plist) 2239(defun org-odt-save-as-outfile (target opt-plist)
2240 ;; write automatic styles
2241 (org-odt-write-automatic-styles)
2242
2071 ;; write meta file 2243 ;; write meta file
2072 (org-odt-update-meta-file opt-plist) 2244 (org-odt-update-meta-file opt-plist)
2073 2245
@@ -2183,21 +2355,21 @@ visually."
2183 xmlns:ooo=\"http://openoffice.org/2004/office\" 2355 xmlns:ooo=\"http://openoffice.org/2004/office\"
2184 office:version=\"1.2\"> 2356 office:version=\"1.2\">
2185 <office:meta>" "\n" 2357 <office:meta>" "\n"
2186 (org-odt-format-author) 2358 (org-odt-format-author)
2187 (org-odt-format-tags 2359 (org-odt-format-tags
2188 '("\n<meta:initial-creator>" . "</meta:initial-creator>") author) 2360 '("\n<meta:initial-creator>" . "</meta:initial-creator>") author)
2189 (org-odt-format-tags '("\n<dc:date>" . "</dc:date>") date) 2361 (org-odt-format-tags '("\n<dc:date>" . "</dc:date>") date)
2190 (org-odt-format-tags 2362 (org-odt-format-tags
2191 '("\n<meta:creation-date>" . "</meta:creation-date>") date) 2363 '("\n<meta:creation-date>" . "</meta:creation-date>") date)
2192 (org-odt-format-tags '("\n<meta:generator>" . "</meta:generator>") 2364 (org-odt-format-tags '("\n<meta:generator>" . "</meta:generator>")
2193 (when org-export-creator-info 2365 (when org-export-creator-info
2194 (format "Org-%s/Emacs-%s" 2366 (format "Org-%s/Emacs-%s"
2195 org-version emacs-version))) 2367 org-version emacs-version)))
2196 (org-odt-format-tags '("\n<meta:keyword>" . "</meta:keyword>") keywords) 2368 (org-odt-format-tags '("\n<meta:keyword>" . "</meta:keyword>") keywords)
2197 (org-odt-format-tags '("\n<dc:subject>" . "</dc:subject>") description) 2369 (org-odt-format-tags '("\n<dc:subject>" . "</dc:subject>") description)
2198 (org-odt-format-tags '("\n<dc:title>" . "</dc:title>") title) 2370 (org-odt-format-tags '("\n<dc:title>" . "</dc:title>") title)
2199 "\n" 2371 "\n"
2200 " </office:meta>" "</office:document-meta>") 2372 " </office:meta>" "</office:document-meta>")
2201 nil (expand-file-name "meta.xml"))) 2373 nil (expand-file-name "meta.xml")))
2202 2374
2203 ;; create a manifest entry for meta.xml 2375 ;; create a manifest entry for meta.xml
@@ -2256,23 +2428,19 @@ visually."
2256 (replace-match "")))) 2428 (replace-match ""))))
2257 2429
2258(defcustom org-export-odt-convert-processes 2430(defcustom org-export-odt-convert-processes
2259 '(("BasicODConverter" 2431 '(("LibreOffice"
2260 ("soffice" "-norestore" "-invisible" "-headless" 2432 "soffice --headless --convert-to %f%x --outdir %d %i")
2261 "\"macro:///BasicODConverter.Main.Convert(%I,%f,%O)\""))
2262 ("unoconv" 2433 ("unoconv"
2263 ("unoconv" "-f" "%f" "-o" "%d" "%i"))) 2434 "unoconv -f %f -o %d %i"))
2264 "Specify a list of document converters and their usage. 2435 "Specify a list of document converters and their usage.
2265The converters in this list are offered as choices while 2436The converters in this list are offered as choices while
2266customizing `org-export-odt-convert-process'. 2437customizing `org-export-odt-convert-process'.
2267 2438
2268This variable is an alist where each element is of the 2439This variable is a list where each element is of the
2269form (CONVERTER-NAME CONVERTER-PROCESS). CONVERTER-NAME is name 2440form (CONVERTER-NAME CONVERTER-CMD). CONVERTER-NAME is the name
2270of the converter. CONVERTER-PROCESS specifies the command-line 2441of the converter. CONVERTER-CMD is the shell command for the
2271syntax of the converter and is of the form (CONVERTER-PROGRAM 2442converter and can contain format specifiers. These format
2272ARG1 ARG2 ...). CONVERTER-PROGRAM is the name of the executable. 2443specifiers are interpreted as below:
2273ARG1, ARG2 etc are command line options that are passed to
2274CONVERTER-PROGRAM. Format specifiers can be used in the ARGs and
2275they are interpreted as below:
2276 2444
2277%i input file name in full 2445%i input file name in full
2278%I input file name as a URL 2446%I input file name as a URL
@@ -2280,21 +2448,23 @@ they are interpreted as below:
2280%o output file name in full 2448%o output file name in full
2281%O output file name as a URL 2449%O output file name as a URL
2282%d output dir in full 2450%d output dir in full
2283%D output dir as a URL." 2451%D output dir as a URL.
2452%x extra options as set in `org-export-odt-convert-capabilities'."
2284 :group 'org-export-odt 2453 :group 'org-export-odt
2454 :version "24.1"
2285 :type 2455 :type
2286 '(choice 2456 '(choice
2287 (const :tag "None" nil) 2457 (const :tag "None" nil)
2288 (alist :tag "Converters" 2458 (alist :tag "Converters"
2289 :key-type (string :tag "Converter Name") 2459 :key-type (string :tag "Converter Name")
2290 :value-type (group (cons (string :tag "Executable") 2460 :value-type (group (string :tag "Command line")))))
2291 (repeat (string :tag "Command line args")))))))
2292 2461
2293(defcustom org-export-odt-convert-process nil 2462(defcustom org-export-odt-convert-process "LibreOffice"
2294 "Use this converter to convert from \"odt\" format to other formats. 2463 "Use this converter to convert from \"odt\" format to other formats.
2295During customization, the list of converter names are populated 2464During customization, the list of converter names are populated
2296from `org-export-odt-convert-processes'." 2465from `org-export-odt-convert-processes'."
2297 :group 'org-export-odt 2466 :group 'org-export-odt
2467 :version "24.1"
2298 :type '(choice :convert-widget 2468 :type '(choice :convert-widget
2299 (lambda (w) 2469 (lambda (w)
2300 (apply 'widget-convert (widget-type w) 2470 (apply 'widget-convert (widget-type w)
@@ -2306,19 +2476,20 @@ from `org-export-odt-convert-processes'."
2306 2476
2307(defcustom org-export-odt-convert-capabilities 2477(defcustom org-export-odt-convert-capabilities
2308 '(("Text" 2478 '(("Text"
2309 ("odt" "ott" "doc" "rtf") 2479 ("odt" "ott" "doc" "rtf" "docx")
2310 (("pdf" "pdf") ("odt" "odt") ("xhtml" "html") ("rtf" "rtf") 2480 (("pdf" "pdf") ("odt" "odt") ("rtf" "rtf") ("ott" "ott")
2311 ("ott" "ott") ("doc" "doc") ("ooxml" "xml") ("html" "html"))) 2481 ("doc" "doc" ":\"MS Word 97\"") ("docx" "docx") ("html" "html")))
2312 ("Web" 2482 ("Web"
2313 ("html" "xhtml") (("pdf" "pdf") ("odt" "txt") ("html" "html"))) 2483 ("html")
2484 (("pdf" "pdf") ("odt" "odt") ("html" "html")))
2314 ("Spreadsheet" 2485 ("Spreadsheet"
2315 ("ods" "ots" "xls" "csv") 2486 ("ods" "ots" "xls" "csv" "xlsx")
2316 (("pdf" "pdf") ("ots" "ots") ("html" "html") ("csv" "csv") 2487 (("pdf" "pdf") ("ots" "ots") ("html" "html") ("csv" "csv") ("ods" "ods")
2317 ("ods" "ods") ("xls" "xls") ("xhtml" "xhtml") ("ooxml" "xml"))) 2488 ("xls" "xls") ("xlsx" "xlsx")))
2318 ("Presentation" 2489 ("Presentation"
2319 ("odp" "otp" "ppt") 2490 ("odp" "otp" "ppt" "pptx")
2320 (("pdf" "pdf") ("swf" "swf") ("odp" "odp") ("xhtml" "xml") 2491 (("pdf" "pdf") ("swf" "swf") ("odp" "odp") ("otp" "otp") ("ppt" "ppt")
2321 ("otp" "otp") ("ppt" "ppt") ("odg" "odg") ("html" "html")))) 2492 ("pptx" "pptx") ("odg" "odg"))))
2322 "Specify input and output formats of `org-export-odt-convert-process'. 2493 "Specify input and output formats of `org-export-odt-convert-process'.
2323More correctly, specify the set of input and output formats that 2494More correctly, specify the set of input and output formats that
2324the user is actually interested in. 2495the user is actually interested in.
@@ -2327,7 +2498,7 @@ This variable is an alist where each element is of the
2327form (DOCUMENT-CLASS INPUT-FMT-LIST OUTPUT-FMT-ALIST). 2498form (DOCUMENT-CLASS INPUT-FMT-LIST OUTPUT-FMT-ALIST).
2328INPUT-FMT-LIST is a list of INPUT-FMTs. OUTPUT-FMT-ALIST is an 2499INPUT-FMT-LIST is a list of INPUT-FMTs. OUTPUT-FMT-ALIST is an
2329alist where each element is of the form (OUTPUT-FMT 2500alist where each element is of the form (OUTPUT-FMT
2330OUTPUT-FILE-EXTENSION). 2501OUTPUT-FILE-EXTENSION EXTRA-OPTIONS).
2331 2502
2332The variable is interpreted as follows: 2503The variable is interpreted as follows:
2333`org-export-odt-convert-process' can take any document that is in 2504`org-export-odt-convert-process' can take any document that is in
@@ -2340,6 +2511,9 @@ serves dual purposes:
2340- It is used as the value of \"%f\" specifier in 2511- It is used as the value of \"%f\" specifier in
2341 `org-export-odt-convert-process'. 2512 `org-export-odt-convert-process'.
2342 2513
2514EXTRA-OPTIONS is used as the value of \"%x\" specifier in
2515`org-export-odt-convert-process'.
2516
2343DOCUMENT-CLASS is used to group a set of file formats in 2517DOCUMENT-CLASS is used to group a set of file formats in
2344INPUT-FMT-LIST in to a single class. 2518INPUT-FMT-LIST in to a single class.
2345 2519
@@ -2353,16 +2527,21 @@ with that class.
2353See default setting of this variable for an typical 2527See default setting of this variable for an typical
2354configuration." 2528configuration."
2355 :group 'org-export-odt 2529 :group 'org-export-odt
2530 :version "24.1"
2356 :type 2531 :type
2357 '(choice 2532 '(choice
2358 (const :tag "None" nil) 2533 (const :tag "None" nil)
2359 (alist :key-type (string :tag "Document Class") 2534 (alist :tag "Capabilities"
2535 :key-type (string :tag "Document Class")
2360 :value-type 2536 :value-type
2361 (group (repeat :tag "Input formats" (string :tag "Input format")) 2537 (group (repeat :tag "Input formats" (string :tag "Input format"))
2362 (alist :tag "Output formats" 2538 (alist :tag "Output formats"
2363 :key-type (string :tag "Output format") 2539 :key-type (string :tag "Output format")
2364 :value-type 2540 :value-type
2365 (group (string :tag "Output file extension"))))))) 2541 (group (string :tag "Output file extension")
2542 (choice
2543 (const :tag "None" nil)
2544 (string :tag "Extra options"))))))))
2366 2545
2367(declare-function org-create-math-formula "org" 2546(declare-function org-create-math-formula "org"
2368 (latex-frag &optional mathml-file)) 2547 (latex-frag &optional mathml-file))
@@ -2544,10 +2723,6 @@ Do this when translation to MathML fails."
2544 ;; create a manifest entry for styles.xml 2723 ;; create a manifest entry for styles.xml
2545 (org-odt-create-manifest-file-entry "text/xml" "styles.xml")) 2724 (org-odt-create-manifest-file-entry "text/xml" "styles.xml"))
2546 2725
2547(defvar org-export-odt-factory-settings
2548 "d4328fb9d1b6cb211d4320ff546829f26700dc5e"
2549 "SHA1 hash of OrgOdtStyles.xml.")
2550
2551(defun org-odt-configure-outline-numbering (level) 2726(defun org-odt-configure-outline-numbering (level)
2552 "Outline numbering is retained only upto LEVEL. 2727 "Outline numbering is retained only upto LEVEL.
2553To disable outline numbering pass a LEVEL of 0." 2728To disable outline numbering pass a LEVEL of 0."
@@ -2585,7 +2760,6 @@ non-nil."
2585 (or (file-name-nondirectory buffer-file-name))) 2760 (or (file-name-nondirectory buffer-file-name)))
2586 "." "odf") 2761 "." "odf")
2587 (file-name-directory buffer-file-name)))) 2762 (file-name-directory buffer-file-name))))
2588 (message "default val is %s" odf-filename)
2589 (read-file-name "ODF filename: " nil odf-filename nil 2763 (read-file-name "ODF filename: " nil odf-filename nil
2590 (file-name-nondirectory odf-filename))))) 2764 (file-name-nondirectory odf-filename)))))
2591 (let* ((org-lparse-backend 'odf) 2765 (let* ((org-lparse-backend 'odf)
@@ -2612,7 +2786,7 @@ non-nil."
2612 2786
2613;;;###autoload 2787;;;###autoload
2614(defun org-export-as-odf-and-open () 2788(defun org-export-as-odf-and-open ()
2615 "Export LaTeX fragment as OpenDocument formula and immediately open it. 2789 "Export LaTeX fragment as OpenDocument formula and immediately open it.
2616Use `org-export-as-odf' to read LaTeX fragment and OpenDocument 2790Use `org-export-as-odf' to read LaTeX fragment and OpenDocument
2617formula file." 2791formula file."
2618 (interactive) 2792 (interactive)
diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el
index a79d4fcfbb2..419a1ffcaa4 100644
--- a/lisp/org/org-protocol.el
+++ b/lisp/org/org-protocol.el
@@ -1,11 +1,11 @@
1;;; org-protocol.el --- Intercept calls from emacsclient to trigger custom actions. 1;;; org-protocol.el --- Intercept calls from emacsclient to trigger custom actions.
2 2;;
3;; Copyright (C) 2008-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
4 4;;
5;; Author: Bastien Guerry <bzg AT gnu DOT org> 5;; Authors: Bastien Guerry <bzg AT gnu DOT org>
6;; Daniel M German <dmg AT uvic DOT org> 6;; Daniel M German <dmg AT uvic DOT org>
7;; Sebastian Rose <sebastian_rose AT gmx DOT de> 7;; Sebastian Rose <sebastian_rose AT gmx DOT de>
8;; Ross Patterson <me AT rpatterson DOT net> 8;; Ross Patterson <me AT rpatterson DOT net>
9;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de> 9;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de>
10;; Keywords: org, emacsclient, wp 10;; Keywords: org, emacsclient, wp
11 11
@@ -225,7 +225,7 @@ Consider using the interactive functions `org-protocol-create' and
225 :type 'alist) 225 :type 'alist)
226 226
227(defcustom org-protocol-protocol-alist nil 227(defcustom org-protocol-protocol-alist nil
228 "* Register custom handlers for org-protocol. 228 " Register custom handlers for org-protocol.
229 229
230Each element of this list must be of the form: 230Each element of this list must be of the form:
231 231
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el
index 67540a67688..74cab14716c 100644
--- a/lisp/org/org-publish.el
+++ b/lisp/org/org-publish.el
@@ -248,6 +248,7 @@ nil won't sort files.
248You can overwrite this default per project in your 248You can overwrite this default per project in your
249`org-publish-project-alist', using `:sitemap-sort-files'." 249`org-publish-project-alist', using `:sitemap-sort-files'."
250 :group 'org-publish 250 :group 'org-publish
251 :version "24.1"
251 :type 'symbol) 252 :type 'symbol)
252 253
253(defcustom org-publish-sitemap-sort-folders 'first 254(defcustom org-publish-sitemap-sort-folders 'first
@@ -260,6 +261,7 @@ Any other value will not mix files and folders.
260You can overwrite this default per project in your 261You can overwrite this default per project in your
261`org-publish-project-alist', using `:sitemap-sort-folders'." 262`org-publish-project-alist', using `:sitemap-sort-folders'."
262 :group 'org-publish 263 :group 'org-publish
264 :version "24.1"
263 :type 'symbol) 265 :type 'symbol)
264 266
265(defcustom org-publish-sitemap-sort-ignore-case nil 267(defcustom org-publish-sitemap-sort-ignore-case nil
@@ -268,12 +270,14 @@ You can overwrite this default per project in your
268You can overwrite this default per project in your 270You can overwrite this default per project in your
269`org-publish-project-alist', using `:sitemap-ignore-case'." 271`org-publish-project-alist', using `:sitemap-ignore-case'."
270 :group 'org-publish 272 :group 'org-publish
273 :version "24.1"
271 :type 'boolean) 274 :type 'boolean)
272 275
273(defcustom org-publish-sitemap-date-format "%Y-%m-%d" 276(defcustom org-publish-sitemap-date-format "%Y-%m-%d"
274 "Format for `format-time-string' which is used to print a date 277 "Format for `format-time-string' which is used to print a date
275in the sitemap." 278in the sitemap."
276 :group 'org-publish 279 :group 'org-publish
280 :version "24.1"
277 :type 'string) 281 :type 'string)
278 282
279(defcustom org-publish-sitemap-file-entry-format "%t" 283(defcustom org-publish-sitemap-file-entry-format "%t"
@@ -284,6 +288,7 @@ You could use brackets to delimit on what part the link will be.
284%a is the author. 288%a is the author.
285%d is the date formatted using `org-publish-sitemap-date-format'." 289%d is the date formatted using `org-publish-sitemap-date-format'."
286 :group 'org-publish 290 :group 'org-publish
291 :version "24.1"
287 :type 'string) 292 :type 'string)
288 293
289 294
diff --git a/lisp/org/org-special-blocks.el b/lisp/org/org-special-blocks.el
index fc882a33396..5bf8362357f 100644
--- a/lisp/org/org-special-blocks.el
+++ b/lisp/org/org-special-blocks.el
@@ -1,3 +1,4 @@
1;;; org-special-blocks.el --- handle Org special blocks
1;; Copyright (C) 2009-2012 Free Software Foundation, Inc. 2;; Copyright (C) 2009-2012 Free Software Foundation, Inc.
2 3
3;; Author: Chris Gray <chrismgray@gmail.com> 4;; Author: Chris Gray <chrismgray@gmail.com>
@@ -79,17 +80,17 @@ seen. This is run after a few special cases are taken care of."
79(add-hook 'org-export-latex-after-blockquotes-hook 80(add-hook 'org-export-latex-after-blockquotes-hook
80 'org-special-blocks-convert-latex-special-cookies) 81 'org-special-blocks-convert-latex-special-cookies)
81 82
82(defvar line) 83(defvar org-special-blocks-line)
83(defun org-special-blocks-convert-html-special-cookies () 84(defun org-special-blocks-convert-html-special-cookies ()
84 "Converts the special cookies into div blocks." 85 "Converts the special cookies into div blocks."
85 ;; Uses the dynamically-bound variable `line'. 86 ;; Uses the dynamically-bound variable `org-special-blocks-line'.
86 (when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" line) 87 (when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" org-special-blocks-line)
87 (message "%s" (match-string 1)) 88 (message "%s" (match-string 1))
88 (when (equal (match-string 2 line) "START") 89 (when (equal (match-string 2 org-special-blocks-line) "START")
89 (org-close-par-maybe) 90 (org-close-par-maybe)
90 (insert "\n<div class=\"" (match-string 1 line) "\">") 91 (insert "\n<div class=\"" (match-string 1 org-special-blocks-line) "\">")
91 (org-open-par)) 92 (org-open-par))
92 (when (equal (match-string 2 line) "END") 93 (when (equal (match-string 2 org-special-blocks-line) "END")
93 (org-close-par-maybe) 94 (org-close-par-maybe)
94 (insert "\n</div>") 95 (insert "\n</div>")
95 (org-open-par)) 96 (org-open-par))
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index ac574ed4dd2..496dafe5e77 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -43,6 +43,8 @@
43(declare-function org-switch-to-buffer-other-window "org" (&rest args)) 43(declare-function org-switch-to-buffer-other-window "org" (&rest args))
44(declare-function org-pop-to-buffer-same-window 44(declare-function org-pop-to-buffer-same-window
45 "org-compat" (&optional buffer-or-name norecord label)) 45 "org-compat" (&optional buffer-or-name norecord label))
46(declare-function org-strip-protective-commas "org" (beg end))
47(declare-function org-base-buffer "org" (buffer))
46 48
47(defcustom org-edit-src-region-extra nil 49(defcustom org-edit-src-region-extra nil
48 "Additional regexps to identify regions for editing with `org-edit-src-code'. 50 "Additional regexps to identify regions for editing with `org-edit-src-code'.
@@ -153,7 +155,8 @@ but which mess up the display of a snippet in Org exported files.")
153(defcustom org-src-lang-modes 155(defcustom org-src-lang-modes
154 '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist) 156 '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist)
155 ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql) 157 ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql)
156 ("calc" . fundamental) ("C" . c) ("cpp" . c++)) 158 ("calc" . fundamental) ("C" . c) ("cpp" . c++)
159 ("screen" . shell-script))
157 "Alist mapping languages to their major mode. 160 "Alist mapping languages to their major mode.
158The key is the language name, the value is the string that should 161The key is the language name, the value is the string that should
159be inserted as the name of the major mode. For many languages this is 162be inserted as the name of the major mode. For many languages this is
@@ -211,16 +214,16 @@ buffer."
211 (interactive) 214 (interactive)
212 (unless (eq context 'save) 215 (unless (eq context 'save)
213 (setq org-edit-src-saved-temp-window-config (current-window-configuration))) 216 (setq org-edit-src-saved-temp-window-config (current-window-configuration)))
214 (let ((mark (and (org-region-active-p) (mark))) 217 (let* ((mark (and (org-region-active-p) (mark)))
215 (case-fold-search t) 218 (case-fold-search t)
216 (info (org-edit-src-find-region-and-lang)) 219 (info (org-edit-src-find-region-and-lang))
217 (full-info (org-babel-get-src-block-info)) 220 (full-info (org-babel-get-src-block-info 'light))
218 (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive 221 (org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive
219 (beg (make-marker)) 222 (beg (make-marker))
220 (end (make-marker)) 223 (end (make-marker))
221 (allow-write-back-p (null code)) 224 (allow-write-back-p (null code))
222 block-nindent total-nindent ovl lang lang-f single lfmt buffer msg 225 block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
223 begline markline markcol line col transmitted-variables) 226 begline markline markcol line col transmitted-variables)
224 (if (not info) 227 (if (not info)
225 nil 228 nil
226 (setq beg (move-marker beg (nth 0 info)) 229 (setq beg (move-marker beg (nth 0 info))
@@ -306,11 +309,13 @@ buffer."
306 (error "Language mode `%s' fails with: %S" lang-f (nth 1 e))))) 309 (error "Language mode `%s' fails with: %S" lang-f (nth 1 e)))))
307 (dolist (pair transmitted-variables) 310 (dolist (pair transmitted-variables)
308 (org-set-local (car pair) (cadr pair))) 311 (org-set-local (car pair) (cadr pair)))
309 (when (eq major-mode 'org-mode) 312 (if (eq major-mode 'org-mode)
310 (goto-char (point-min)) 313 (progn
311 (while (re-search-forward "^," nil t) 314 (goto-char (point-min))
312 (if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent))) 315 (while (re-search-forward "^," nil t)
313 (replace-match ""))) 316 (if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent)))
317 (replace-match "")))
318 (org-strip-protective-commas (point-min) (point-max)))
314 (when markline 319 (when markline
315 (org-goto-line (1+ (- markline begline))) 320 (org-goto-line (1+ (- markline begline)))
316 (org-move-to-column 321 (org-move-to-column
@@ -369,6 +374,15 @@ buffer."
369 "Construct the buffer name for a source editing buffer." 374 "Construct the buffer name for a source editing buffer."
370 (concat "*Org Src " org-buffer-name "[ " lang " ]*")) 375 (concat "*Org Src " org-buffer-name "[ " lang " ]*"))
371 376
377(defun org-src-edit-buffer-p (&optional buffer)
378 "Test whether BUFFER (or the current buffer if BUFFER is nil)
379is a source block editing buffer."
380 (let ((buffer (org-base-buffer (or buffer (current-buffer)))))
381 (and (buffer-name buffer)
382 (string-match "\\`*Org Src " (buffer-name buffer))
383 (local-variable-p 'org-edit-src-beg-marker buffer)
384 (local-variable-p 'org-edit-src-end-marker buffer))))
385
372(defun org-edit-src-find-buffer (beg end) 386(defun org-edit-src-find-buffer (beg end)
373 "Find a source editing buffer that is already editing the region BEG to END." 387 "Find a source editing buffer that is already editing the region BEG to END."
374 (catch 'exit 388 (catch 'exit
@@ -747,6 +761,7 @@ Org-babel commands."
747 "If non-nil, the effect of TAB in a code block is as if it were 761 "If non-nil, the effect of TAB in a code block is as if it were
748issued in the language major mode buffer." 762issued in the language major mode buffer."
749 :type 'boolean 763 :type 'boolean
764 :version "24.1"
750 :group 'org-babel) 765 :group 'org-babel)
751 766
752(defun org-src-native-tab-command-maybe () 767(defun org-src-native-tab-command-maybe ()
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 0d2a2e6a973..ae12cee2abe 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -169,11 +169,13 @@ window configuration, it is not recommended to set this variable to nil,
169except maybe locally in a special file that has mostly tables with long 169except maybe locally in a special file that has mostly tables with long
170fields." 170fields."
171 :group 'org-table 171 :group 'org-table
172 :version "24.1"
172 :type 'boolean) 173 :type 'boolean)
173 174
174(defcustom org-table-fix-formulas-confirm nil 175(defcustom org-table-fix-formulas-confirm nil
175 "Whether the user should confirm when Org fixes formulas." 176 "Whether the user should confirm when Org fixes formulas."
176 :group 'org-table-editing 177 :group 'org-table-editing
178 :version "24.1"
177 :type '(choice 179 :type '(choice
178 (const :tag "with yes-or-no" yes-or-no-p) 180 (const :tag "with yes-or-no" yes-or-no-p)
179 (const :tag "with y-or-n" y-or-n-p) 181 (const :tag "with y-or-n" y-or-n-p)
@@ -236,6 +238,7 @@ number of hours. Other allowed values are 'seconds, 'minutes and
236'days, and the output will be a fraction of seconds, minutes or 238'days, and the output will be a fraction of seconds, minutes or
237days." 239days."
238 :group 'org-table-calculation 240 :group 'org-table-calculation
241 :version "24.1"
239 :type '(choice (symbol :tag "Seconds" 'seconds) 242 :type '(choice (symbol :tag "Seconds" 'seconds)
240 (symbol :tag "Minutes" 'minutes) 243 (symbol :tag "Minutes" 'minutes)
241 (symbol :tag "Hours " 'hours) 244 (symbol :tag "Hours " 'hours)
@@ -247,6 +250,7 @@ For example, using \"~%s~\" will display the result within tilde
247characters. Beware that modifying the display can prevent the 250characters. Beware that modifying the display can prevent the
248field from being used in another formula." 251field from being used in another formula."
249 :group 'org-table-settings 252 :group 'org-table-settings
253 :version "24.1"
250 :type 'string) 254 :type 'string)
251 255
252(defcustom org-table-formula-evaluate-inline t 256(defcustom org-table-formula-evaluate-inline t
@@ -1299,7 +1303,7 @@ However, when FORCE is non-nil, create new columns if necessary."
1299(defun org-table-line-to-dline (line &optional above) 1303(defun org-table-line-to-dline (line &optional above)
1300 "Turn a buffer line number into a data line number. 1304 "Turn a buffer line number into a data line number.
1301If there is no data line in this line, return nil. 1305If there is no data line in this line, return nil.
1302If there is no matching dline (most likely the reference was a hline), the 1306If there is no matching dline (most likely te reference was a hline), the
1303first dline below it is used. When ABOVE is non-nil, the one above is used." 1307first dline below it is used. When ABOVE is non-nil, the one above is used."
1304 (catch 'exit 1308 (catch 'exit
1305 (let ((ll (length org-table-dlines)) 1309 (let ((ll (length org-table-dlines))
@@ -2364,7 +2368,7 @@ of the new mark."
2364 (looking-at org-table-auto-recalculate-regexp)) 2368 (looking-at org-table-auto-recalculate-regexp))
2365 (org-table-recalculate) t)) 2369 (org-table-recalculate) t))
2366 2370
2367(defvar modes) 2371(defvar org-table-modes)
2368(defsubst org-set-calc-mode (var &optional value) 2372(defsubst org-set-calc-mode (var &optional value)
2369 (if (stringp var) 2373 (if (stringp var)
2370 (setq var (assoc var '(("D" calc-angle-mode deg) 2374 (setq var (assoc var '(("D" calc-angle-mode deg)
@@ -2372,10 +2376,10 @@ of the new mark."
2372 ("F" calc-prefer-frac t) 2376 ("F" calc-prefer-frac t)
2373 ("S" calc-symbolic-mode t))) 2377 ("S" calc-symbolic-mode t)))
2374 value (nth 2 var) var (nth 1 var))) 2378 value (nth 2 var) var (nth 1 var)))
2375 (if (memq var modes) 2379 (if (memq var org-table-modes)
2376 (setcar (cdr (memq var modes)) value) 2380 (setcar (cdr (memq var org-table-modes)) value)
2377 (cons var (cons value modes))) 2381 (cons var (cons value org-table-modes)))
2378 modes) 2382 org-table-modes)
2379 2383
2380(defun org-table-eval-formula (&optional arg equation 2384(defun org-table-eval-formula (&optional arg equation
2381 suppress-align suppress-const 2385 suppress-align suppress-const
@@ -4154,7 +4158,7 @@ overwritten, and the table is not marked as requiring realignment."
4154 (looking-at "[^|\n]* +|")) 4158 (looking-at "[^|\n]* +|"))
4155 (let (org-table-may-need-update) 4159 (let (org-table-may-need-update)
4156 (goto-char (1- (match-end 0))) 4160 (goto-char (1- (match-end 0)))
4157 (delete-char -1) 4161 (backward-delete-char 1)
4158 (goto-char (match-beginning 0)) 4162 (goto-char (match-beginning 0))
4159 (self-insert-command N)) 4163 (self-insert-command N))
4160 (setq org-table-may-need-update t) 4164 (setq org-table-may-need-update t)
diff --git a/lisp/org/org-taskjuggler.el b/lisp/org/org-taskjuggler.el
index c1a59ee70cb..4409013589f 100644
--- a/lisp/org/org-taskjuggler.el
+++ b/lisp/org/org-taskjuggler.el
@@ -166,28 +166,33 @@
166(defcustom org-export-taskjuggler-extension ".tjp" 166(defcustom org-export-taskjuggler-extension ".tjp"
167 "Extension of TaskJuggler files." 167 "Extension of TaskJuggler files."
168 :group 'org-export-taskjuggler 168 :group 'org-export-taskjuggler
169 :version "24.1"
169 :type 'string) 170 :type 'string)
170 171
171(defcustom org-export-taskjuggler-project-tag "taskjuggler_project" 172(defcustom org-export-taskjuggler-project-tag "taskjuggler_project"
172 "Tag, property or todo used to find the tree containing all 173 "Tag, property or todo used to find the tree containing all
173the tasks for the project." 174the tasks for the project."
174 :group 'org-export-taskjuggler 175 :group 'org-export-taskjuggler
176 :version "24.1"
175 :type 'string) 177 :type 'string)
176 178
177(defcustom org-export-taskjuggler-resource-tag "taskjuggler_resource" 179(defcustom org-export-taskjuggler-resource-tag "taskjuggler_resource"
178 "Tag, property or todo used to find the tree containing all the 180 "Tag, property or todo used to find the tree containing all the
179resources for the project." 181resources for the project."
180 :group 'org-export-taskjuggler 182 :group 'org-export-taskjuggler
183 :version "24.1"
181 :type 'string) 184 :type 'string)
182 185
183(defcustom org-export-taskjuggler-target-version 2.4 186(defcustom org-export-taskjuggler-target-version 2.4
184 "Which version of TaskJuggler the exporter is targeting." 187 "Which version of TaskJuggler the exporter is targeting."
185 :group 'org-export-taskjuggler 188 :group 'org-export-taskjuggler
189 :version "24.1"
186 :type 'number) 190 :type 'number)
187 191
188(defcustom org-export-taskjuggler-default-project-version "1.0" 192(defcustom org-export-taskjuggler-default-project-version "1.0"
189 "Default version string for the project." 193 "Default version string for the project."
190 :group 'org-export-taskjuggler 194 :group 'org-export-taskjuggler
195 :version "24.1"
191 :type 'string) 196 :type 'string)
192 197
193(defcustom org-export-taskjuggler-default-project-duration 280 198(defcustom org-export-taskjuggler-default-project-duration 280
@@ -195,6 +200,7 @@ resources for the project."
195in the root node of the task tree, i.e. the tree that has been marked 200in the root node of the task tree, i.e. the tree that has been marked
196with `org-export-taskjuggler-project-tag'" 201with `org-export-taskjuggler-project-tag'"
197 :group 'org-export-taskjuggler 202 :group 'org-export-taskjuggler
203 :version "24.1"
198 :type 'integer) 204 :type 'integer)
199 205
200(defcustom org-export-taskjuggler-default-reports 206(defcustom org-export-taskjuggler-default-reports
@@ -214,6 +220,7 @@ with `org-export-taskjuggler-project-tag'"
214}") 220}")
215 "Default reports for the project." 221 "Default reports for the project."
216 :group 'org-export-taskjuggler 222 :group 'org-export-taskjuggler
223 :version "24.1"
217 :type '(repeat (string :tag "Report"))) 224 :type '(repeat (string :tag "Report")))
218 225
219(defcustom org-export-taskjuggler-default-global-properties 226(defcustom org-export-taskjuggler-default-global-properties
@@ -230,6 +237,7 @@ include another TaskJuggler file.
230The global properties are inserted after the project declaration 237The global properties are inserted after the project declaration
231but before any resource and task declarations." 238but before any resource and task declarations."
232 :group 'org-export-taskjuggler 239 :group 'org-export-taskjuggler
240 :version "24.1"
233 :type '(string :tag "Preamble")) 241 :type '(string :tag "Preamble"))
234 242
235;;; Hooks 243;;; Hooks
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index 44a53ad0f15..a3bde0fd7f6 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.el
@@ -53,6 +53,7 @@ the value of the relative timer."
53 "The default timer when a timer is set. 53 "The default timer when a timer is set.
54When 0, the user is prompted for a value." 54When 0, the user is prompted for a value."
55 :group 'org-time 55 :group 'org-time
56 :version "24.1"
56 :type 'number) 57 :type 'number)
57 58
58(defvar org-timer-start-hook nil 59(defvar org-timer-start-hook nil
diff --git a/lisp/org/org-wl.el b/lisp/org/org-wl.el
index 6d2370671bd..8a79ec0d765 100644
--- a/lisp/org/org-wl.el
+++ b/lisp/org/org-wl.el
@@ -46,11 +46,13 @@
46(defcustom org-wl-link-remove-filter nil 46(defcustom org-wl-link-remove-filter nil
47 "Remove filter condition if message is filter folder." 47 "Remove filter condition if message is filter folder."
48 :group 'org-wl 48 :group 'org-wl
49 :version "24.1"
49 :type 'boolean) 50 :type 'boolean)
50 51
51(defcustom org-wl-shimbun-prefer-web-links nil 52(defcustom org-wl-shimbun-prefer-web-links nil
52 "If non-nil create web links for shimbun messages." 53 "If non-nil create web links for shimbun messages."
53 :group 'org-wl 54 :group 'org-wl
55 :version "24.1"
54 :type 'boolean) 56 :type 'boolean)
55 57
56(defcustom org-wl-nntp-prefer-web-links nil 58(defcustom org-wl-nntp-prefer-web-links nil
@@ -58,16 +60,19 @@
58When folder name contains string \"gmane\" link to gmane, 60When folder name contains string \"gmane\" link to gmane,
59googlegroups otherwise." 61googlegroups otherwise."
60 :type 'boolean 62 :type 'boolean
63 :version "24.1"
61 :group 'org-wl) 64 :group 'org-wl)
62 65
63(defcustom org-wl-disable-folder-check t 66(defcustom org-wl-disable-folder-check t
64 "Disable check for new messages when open a link." 67 "Disable check for new messages when open a link."
65 :type 'boolean 68 :type 'boolean
69 :version "24.1"
66 :group 'org-wl) 70 :group 'org-wl)
67 71
68(defcustom org-wl-namazu-default-index nil 72(defcustom org-wl-namazu-default-index nil
69 "Default namazu search index." 73 "Default namazu search index."
70 :type 'directory 74 :type 'directory
75 :version "24.1"
71 :group 'org-wl) 76 :group 'org-wl)
72 77
73;; Declare external functions and variables 78;; Declare external functions and variables
diff --git a/lisp/org/org-xoxo.el b/lisp/org/org-xoxo.el
index fc3a9732041..a282fbf1808 100644
--- a/lisp/org/org-xoxo.el
+++ b/lisp/org/org-xoxo.el
@@ -1,6 +1,6 @@
1;;; org-xoxo.el --- XOXO export for Org-mode 1;;; org-xoxo.el --- XOXO export for Org-mode
2 2
3;; Copyright (C) 2004-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
4 4
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 57d2c96514e..0f13223d0c1 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -1,12 +1,12 @@
1;;; org.el --- Outline-based notes management and organizer 1;;; org.el --- Outline-based notes management and organizer
2;; Carstens outline-mode for keeping track of everything. 2;; Carstens outline-mode for keeping track of everything.
3;; Copyright (C) 2004-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
4;; 4;;
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Maintainer: Bastien Guerry <bzg at gnu dot org> 6;; Maintainer: Bastien Guerry <bzg at gnu 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: 7.8.03 9;; Version: 7.8.08
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -75,6 +75,7 @@
75 (require 'gnus-sum)) 75 (require 'gnus-sum))
76 76
77(require 'calendar) 77(require 'calendar)
78(require 'format-spec)
78 79
79;; Emacs 22 calendar compatibility: Make sure the new variables are available 80;; Emacs 22 calendar compatibility: Make sure the new variables are available
80(when (fboundp 'defvaralias) 81(when (fboundp 'defvaralias)
@@ -151,6 +152,7 @@ keybinding. By default only Emacs Lisp (which has no
151requirements) is loaded." 152requirements) is loaded."
152 :group 'org-babel 153 :group 'org-babel
153 :set 'org-babel-do-load-languages 154 :set 'org-babel-do-load-languages
155 :version "24.1"
154 :type '(alist :tag "Babel Languages" 156 :type '(alist :tag "Babel Languages"
155 :key-type 157 :key-type
156 (choice 158 (choice
@@ -199,13 +201,15 @@ When non-nil, clones of a subtree don't inherit the ID property.
199Otherwise they inherit the ID property with a new unique 201Otherwise they inherit the ID property with a new unique
200identifier." 202identifier."
201 :type 'boolean 203 :type 'boolean
204 :version "24.1"
202 :group 'org-id) 205 :group 'org-id)
203 206
204;;; Version 207;;; Version
205 208
206(defconst org-version "7.8.03" 209(defconst org-version "7.8.08"
207 "The version number of the file org.el.") 210 "The version number of the file org.el.")
208 211
212;;;###autoload
209(defun org-version (&optional here) 213(defun org-version (&optional here)
210 "Show the org-mode version in the echo area. 214 "Show the org-mode version in the echo area.
211With prefix arg HERE, insert it at point." 215With prefix arg HERE, insert it at point."
@@ -257,6 +261,7 @@ With prefix arg HERE, insert it at point."
257(defcustom org-log-buffer-setup-hook nil 261(defcustom org-log-buffer-setup-hook nil
258 "Hook that is run after an Org log buffer is created." 262 "Hook that is run after an Org log buffer is created."
259 :group 'org 263 :group 'org
264 :version "24.1"
260 :type 'hook) 265 :type 'hook)
261 266
262(defvar org-modules) ; defined below 267(defvar org-modules) ; defined below
@@ -426,6 +431,7 @@ already archived entries."
426 (const :tag "All headlines in active region" t) 431 (const :tag "All headlines in active region" t)
427 (const :tag "In active region, headlines at the same level than the first one" 'start-level) 432 (const :tag "In active region, headlines at the same level than the first one" 'start-level)
428 (string :tag "Tags/Property/Todo matcher")) 433 (string :tag "Tags/Property/Todo matcher"))
434 :version "24.1"
429 :group 'org-todo 435 :group 'org-todo
430 :group 'org-archive) 436 :group 'org-archive)
431 437
@@ -494,6 +500,7 @@ Not all export backends support this, but HTML does.
494This option can also be set with the +OPTIONS line, e.g. \"^:nil\"." 500This option can also be set with the +OPTIONS line, e.g. \"^:nil\"."
495 :group 'org-startup 501 :group 'org-startup
496 :group 'org-export-translation 502 :group 'org-export-translation
503 :version "24.1"
497 :type '(choice 504 :type '(choice
498 (const :tag "Always interpret" t) 505 (const :tag "Always interpret" t)
499 (const :tag "Only with braces" {}) 506 (const :tag "Only with braces" {})
@@ -510,6 +517,7 @@ the following lines anywhere in the buffer:
510 517
511 #+STARTUP: beamer" 518 #+STARTUP: beamer"
512 :group 'org-startup 519 :group 'org-startup
520 :version "24.1"
513 :type 'boolean) 521 :type 'boolean)
514 522
515(defcustom org-startup-align-all-tables nil 523(defcustom org-startup-align-all-tables nil
@@ -530,6 +538,7 @@ the following lines anywhere in the buffer:
530 #+STARTUP: inlineimages 538 #+STARTUP: inlineimages
531 #+STARTUP: noinlineimages" 539 #+STARTUP: noinlineimages"
532 :group 'org-startup 540 :group 'org-startup
541 :version "24.1"
533 :type 'boolean) 542 :type 'boolean)
534 543
535(defcustom org-insert-mode-line-in-empty-file nil 544(defcustom org-insert-mode-line-in-empty-file nil
@@ -1067,6 +1076,7 @@ used to kill (part-of) a headline that has hidden text behind it.
1067Any other non-nil value will result in a query to the user, if it is 1076Any other non-nil value will result in a query to the user, if it is
1068OK to kill that hidden subtree. When nil, kill without remorse." 1077OK to kill that hidden subtree. When nil, kill without remorse."
1069 :group 'org-edit-structure 1078 :group 'org-edit-structure
1079 :version "24.1"
1070 :type '(choice 1080 :type '(choice
1071 (const :tag "Do not protect hidden subtrees" nil) 1081 (const :tag "Do not protect hidden subtrees" nil)
1072 (const :tag "Protect hidden subtrees with a security query" t) 1082 (const :tag "Protect hidden subtrees with a security query" t)
@@ -1087,6 +1097,7 @@ smart Make point visible, and do insertion/deletion if it is
1087 allows insertion and backward-delete right before ellipses. 1097 allows insertion and backward-delete right before ellipses.
1088 FIXME: maybe in this case we should not even show?" 1098 FIXME: maybe in this case we should not even show?"
1089 :group 'org-edit-structure 1099 :group 'org-edit-structure
1100 :version "24.1"
1090 :type '(choice 1101 :type '(choice
1091 (const :tag "Do not check" nil) 1102 (const :tag "Do not check" nil)
1092 (const :tag "Throw error when trying to edit" error) 1103 (const :tag "Throw error when trying to edit" error)
@@ -1540,6 +1551,7 @@ Changing this requires a restart of Emacs to work correctly."
1540When nil, the link search tries to match a phrase with all words 1551When nil, the link search tries to match a phrase with all words
1541in the search text." 1552in the search text."
1542 :group 'org-link-follow 1553 :group 'org-link-follow
1554 :version "24.1"
1543 :type '(choice 1555 :type '(choice
1544 (const :tag "Use fuzzy text search" nil) 1556 (const :tag "Use fuzzy text search" nil)
1545 (const :tag "Match only exact headline" t) 1557 (const :tag "Match only exact headline" t)
@@ -1659,6 +1671,7 @@ single keystroke rather than having to type \"yes\"."
1659(defcustom org-confirm-shell-link-not-regexp "" 1671(defcustom org-confirm-shell-link-not-regexp ""
1660 "A regexp to skip confirmation for shell links." 1672 "A regexp to skip confirmation for shell links."
1661 :group 'org-link-follow 1673 :group 'org-link-follow
1674 :version "24.1"
1662 :type 'regexp) 1675 :type 'regexp)
1663 1676
1664(defcustom org-confirm-elisp-link-function 'yes-or-no-p 1677(defcustom org-confirm-elisp-link-function 'yes-or-no-p
@@ -1684,6 +1697,7 @@ single keystroke rather than having to type \"yes\"."
1684(defcustom org-confirm-elisp-link-not-regexp "" 1697(defcustom org-confirm-elisp-link-not-regexp ""
1685 "A regexp to skip confirmation for Elisp links." 1698 "A regexp to skip confirmation for Elisp links."
1686 :group 'org-link-follow 1699 :group 'org-link-follow
1700 :version "24.1"
1687 :type 'regexp) 1701 :type 'regexp)
1688 1702
1689(defconst org-file-apps-defaults-gnu 1703(defconst org-file-apps-defaults-gnu
@@ -1906,6 +1920,7 @@ When bulk-refiling from the agenda, the value `note' is forbidden and
1906will temporarily be changed to `time'." 1920will temporarily be changed to `time'."
1907 :group 'org-refile 1921 :group 'org-refile
1908 :group 'org-progress 1922 :group 'org-progress
1923 :version "24.1"
1909 :type '(choice 1924 :type '(choice
1910 (const :tag "No logging" nil) 1925 (const :tag "No logging" nil)
1911 (const :tag "Record timestamp" time) 1926 (const :tag "Record timestamp" time)
@@ -1981,6 +1996,7 @@ If you have added new entries to a buffer that might themselves be targets,
1981you need to clear the cache manually by pressing `C-0 C-c C-w' or, if you 1996you need to clear the cache manually by pressing `C-0 C-c C-w' or, if you
1982find that easier, `C-u C-u C-u C-c C-w'." 1997find that easier, `C-u C-u C-u C-c C-w'."
1983 :group 'org-refile 1998 :group 'org-refile
1999 :version "24.1"
1984 :type 'boolean) 2000 :type 'boolean)
1985 2001
1986(defcustom org-refile-use-outline-path nil 2002(defcustom org-refile-use-outline-path nil
@@ -2036,6 +2052,7 @@ don't contain a set of subtrees, but it might be convenient to
2036do so sometimes: in that case, the first line of the region is 2052do so sometimes: in that case, the first line of the region is
2037converted to a headline before refiling." 2053converted to a headline before refiling."
2038 :group 'org-refile 2054 :group 'org-refile
2055 :version "24.1"
2039 :type 'boolean) 2056 :type 'boolean)
2040 2057
2041(defgroup org-todo nil 2058(defgroup org-todo nil
@@ -2246,10 +2263,7 @@ TODO state changes
2246Also, if a parent has an :ORDERED: property, switching an entry to DONE will 2263Also, if a parent has an :ORDERED: property, switching an entry to DONE will
2247be blocked if any prior sibling is not yet done. 2264be blocked if any prior sibling is not yet done.
2248Finally, if the parent is blocked because of ordered siblings of its own, 2265Finally, if the parent is blocked because of ordered siblings of its own,
2249the child will also be blocked. 2266the child will also be blocked."
2250This variable needs to be set before org.el is loaded, and you need to
2251restart Emacs after a change to make the change effective. The only way
2252to change is while Emacs is running is through the customize interface."
2253 :set (lambda (var val) 2267 :set (lambda (var val)
2254 (set var val) 2268 (set var val)
2255 (if val 2269 (if val
@@ -2512,6 +2526,7 @@ By default this is the first task in a TODO sequence, or the previous state
2512in a TODO_TYP set. But you can specify another task here. 2526in a TODO_TYP set. But you can specify another task here.
2513alternatively, set the :REPEAT_TO_STATE: property of the entry." 2527alternatively, set the :REPEAT_TO_STATE: property of the entry."
2514 :group 'org-todo 2528 :group 'org-todo
2529 :version "24.1"
2515 :type '(choice (const :tag "Head of sequence" nil) 2530 :type '(choice (const :tag "Head of sequence" nil)
2516 (string :tag "Specific state"))) 2531 (string :tag "Specific state")))
2517 2532
@@ -2596,6 +2611,7 @@ an integer, increasing by 1000 for each priority level.
2596The user can set a different function here, which should take a string 2611The user can set a different function here, which should take a string
2597as an argument and return the numeric priority." 2612as an argument and return the numeric priority."
2598 :group 'org-priorities 2613 :group 'org-priorities
2614 :version "24.1"
2599 :type 'function) 2615 :type 'function)
2600 2616
2601(defgroup org-time nil 2617(defgroup org-time nil
@@ -2737,6 +2753,7 @@ But you can also set a deviating value here.
2737This may t or nil, or the symbol `org-read-date-prefer-future'." 2753This may t or nil, or the symbol `org-read-date-prefer-future'."
2738 :group 'org-agenda 2754 :group 'org-agenda
2739 :group 'org-time 2755 :group 'org-time
2756 :version "24.1"
2740 :type '(choice 2757 :type '(choice
2741 (const :tag "Use org-read-date-prefer-future" 2758 (const :tag "Use org-read-date-prefer-future"
2742 org-read-date-prefer-future) 2759 org-read-date-prefer-future)
@@ -2771,6 +2788,7 @@ has limited date range is not negligible.
2771A workaround for this problem is to use diary sexp dates for time 2788A workaround for this problem is to use diary sexp dates for time
2772stamps outside of this range." 2789stamps outside of this range."
2773 :group 'org-time 2790 :group 'org-time
2791 :version "24.1"
2774 :type 'boolean) 2792 :type 'boolean)
2775 2793
2776(defcustom org-read-date-display-live t 2794(defcustom org-read-date-display-live t
@@ -2817,8 +2835,9 @@ be the favorite working time of John Wiegley :-)"
2817For example, if `org-extend-today-until' is 8, and it's 4am, then the 2835For example, if `org-extend-today-until' is 8, and it's 4am, then the
2818\"effective time\" of any timestamps between midnight and 8am will be 2836\"effective time\" of any timestamps between midnight and 8am will be
281923:59 of the previous day." 283723:59 of the previous day."
2820 :group 'boolean 2838 :group 'org-time
2821 :type 'integer) 2839 :version "24.1"
2840 :type 'boolean)
2822 2841
2823(defcustom org-edit-timestamp-down-means-later nil 2842(defcustom org-edit-timestamp-down-means-later nil
2824 "Non-nil means S-down will increase the time in a time stamp. 2843 "Non-nil means S-down will increase the time in a time stamp.
@@ -2891,6 +2910,7 @@ tags in that file can be created dynamically (there are none).
2891 'org-complete-tags-always-offer-all-agenda-tags) 2910 'org-complete-tags-always-offer-all-agenda-tags)
2892 t)))" 2911 t)))"
2893 :group 'org-tags 2912 :group 'org-tags
2913 :version "24.1"
2894 :type 'boolean) 2914 :type 'boolean)
2895 2915
2896(defvar org-file-tags nil 2916(defvar org-file-tags nil
@@ -3059,6 +3079,7 @@ and the clock summary:
3059 (org-entry-get (point) \"Effort\")))) 3079 (org-entry-get (point) \"Effort\"))))
3060 (org-minutes-to-hh:mm-string (- effort clocksum))))))" 3080 (org-minutes-to-hh:mm-string (- effort clocksum))))))"
3061 :group 'org-properties 3081 :group 'org-properties
3082 :version "24.1"
3062 :type 'alist) 3083 :type 'alist)
3063 3084
3064(defcustom org-use-property-inheritance nil 3085(defcustom org-use-property-inheritance nil
@@ -3330,6 +3351,7 @@ This is a property list with the following properties:
3330 "Non-nil means signal an error when image creation of LaTeX snippets fails. 3351 "Non-nil means signal an error when image creation of LaTeX snippets fails.
3331When nil, just push out a message." 3352When nil, just push out a message."
3332 :group 'org-latex 3353 :group 'org-latex
3354 :version "24.1"
3333 :type 'boolean) 3355 :type 'boolean)
3334(defcustom org-latex-to-mathml-jar-file nil 3356(defcustom org-latex-to-mathml-jar-file nil
3335 "Value of\"%j\" in `org-latex-to-mathml-convert-command'. 3357 "Value of\"%j\" in `org-latex-to-mathml-convert-command'.
@@ -3338,6 +3360,7 @@ Use this to specify additional executable file say a jar file.
3338When using MathToWeb as the converter, specify the full-path to 3360When using MathToWeb as the converter, specify the full-path to
3339your mathtoweb.jar file." 3361your mathtoweb.jar file."
3340 :group 'org-latex 3362 :group 'org-latex
3363 :version "24.1"
3341 :type '(choice 3364 :type '(choice
3342 (const :tag "None" nil) 3365 (const :tag "None" nil)
3343 (file :tag "JAR file" :must-match t))) 3366 (file :tag "JAR file" :must-match t)))
@@ -3355,6 +3378,7 @@ This command is used by `org-create-math-formula'.
3355When using MathToWeb as the converter, set this to 3378When using MathToWeb as the converter, set this to
3356\"java -jar %j -unicode -force -df %o %I\"." 3379\"java -jar %j -unicode -force -df %o %I\"."
3357 :group 'org-latex 3380 :group 'org-latex
3381 :version "24.1"
3358 :type '(choice 3382 :type '(choice
3359 (const :tag "None" nil) 3383 (const :tag "None" nil)
3360 (string :tag "\nShell command"))) 3384 (string :tag "\nShell command")))
@@ -3464,6 +3488,7 @@ compiling LaTeX snippets into images for inclusion into HTML."
3464 :group 'org-export-latex 3488 :group 'org-export-latex
3465 :set 'org-set-packages-alist 3489 :set 'org-set-packages-alist
3466 :get 'org-get-packages-alist 3490 :get 'org-get-packages-alist
3491 :version "24.1"
3467 :type '(repeat 3492 :type '(repeat
3468 (choice 3493 (choice
3469 (list :tag "options/package pair" 3494 (list :tag "options/package pair"
@@ -3529,6 +3554,7 @@ lines to the buffer:
3529For example, a value '(title) for this list will make the document's title 3554For example, a value '(title) for this list will make the document's title
3530appear in the buffer without the initial #+TITLE: keyword." 3555appear in the buffer without the initial #+TITLE: keyword."
3531 :group 'org-appearance 3556 :group 'org-appearance
3557 :version "24.1"
3532 :type '(set (const :tag "#+AUTHOR" author) 3558 :type '(set (const :tag "#+AUTHOR" author)
3533 (const :tag "#+DATE" date) 3559 (const :tag "#+DATE" date)
3534 (const :tag "#+EMAIL" email) 3560 (const :tag "#+EMAIL" email)
@@ -3569,11 +3595,13 @@ org-level-* faces."
3569 "Non-nil means show entities as UTF8 characters. 3595 "Non-nil means show entities as UTF8 characters.
3570When nil, the \\name form remains in the buffer." 3596When nil, the \\name form remains in the buffer."
3571 :group 'org-appearance 3597 :group 'org-appearance
3598 :version "24.1"
3572 :type 'boolean) 3599 :type 'boolean)
3573 3600
3574(defcustom org-pretty-entities-include-sub-superscripts t 3601(defcustom org-pretty-entities-include-sub-superscripts t
3575 "Non-nil means, pretty entity display includes formatting sub/superscripts." 3602 "Non-nil means, pretty entity display includes formatting sub/superscripts."
3576 :group 'org-appearance 3603 :group 'org-appearance
3604 :version "24.1"
3577 :type 'boolean) 3605 :type 'boolean)
3578 3606
3579(defvar org-emph-re nil 3607(defvar org-emph-re nil
@@ -4446,12 +4474,13 @@ means to push this value onto the list in the variable.")
4446 4474
4447(defun org-update-property-plist (key val props) 4475(defun org-update-property-plist (key val props)
4448 "Update PROPS with KEY and VAL." 4476 "Update PROPS with KEY and VAL."
4449 (if (string= "+" (substring key (- (length key) 1))) 4477 (let* ((appending (string= "+" (substring key (- (length key) 1))))
4450 (let* ((key (substring key 0 (- (length key) 1))) 4478 (key (if appending (substring key 0 (- (length key) 1)) key))
4451 (previous (cdr (assoc key props)))) 4479 (remainder (org-remove-if (lambda (p) (string= (car p) key)) props))
4452 (cons (cons key (concat previous " " val)) 4480 (previous (cdr (assoc key props))))
4453 (org-remove-if (lambda (p) (string= (car p) key)) props))) 4481 (if appending
4454 (cons (cons key val) props))) 4482 (cons (cons key (if previous (concat previous " " val) val)) remainder)
4483 (cons (cons key val) remainder))))
4455 4484
4456(defconst org-block-regexp 4485(defconst org-block-regexp
4457 "^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$" 4486 "^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$"
@@ -4842,7 +4871,7 @@ This is for getting out of special buffers like remember.")
4842;; FIXME: Occasionally check by commenting these, to make sure 4871;; FIXME: Occasionally check by commenting these, to make sure
4843;; no other functions uses these, forgetting to let-bind them. 4872;; no other functions uses these, forgetting to let-bind them.
4844(defvar entry) 4873(defvar entry)
4845(defvar last-state) 4874(defvar org-last-state)
4846(defvar date) 4875(defvar date)
4847 4876
4848;; Defined somewhere in this file, but used before definition. 4877;; Defined somewhere in this file, but used before definition.
@@ -4892,6 +4921,8 @@ sure that we are at the beginning of the line.")
4892 "Matches an headline, putting stars and text into groups. 4921 "Matches an headline, putting stars and text into groups.
4893Stars are put in group 1 and the trimmed body in group 2.") 4922Stars are put in group 1 and the trimmed body in group 2.")
4894 4923
4924(defvar buffer-face-mode-face)
4925
4895;;;###autoload 4926;;;###autoload
4896(define-derived-mode org-mode outline-mode "Org" 4927(define-derived-mode org-mode outline-mode "Org"
4897 "Outline-based notes management and organizer, alias 4928 "Outline-based notes management and organizer, alias
@@ -5025,8 +5056,9 @@ The following commands are available:
5025 (set (make-local-variable 'pcomplete-parse-arguments-function) 5056 (set (make-local-variable 'pcomplete-parse-arguments-function)
5026 'org-parse-arguments) 5057 'org-parse-arguments)
5027 (set (make-local-variable 'pcomplete-termination-string) "") 5058 (set (make-local-variable 'pcomplete-termination-string) "")
5028 (set (make-local-variable 'face-remapping-alist) 5059 (when (>= emacs-major-version 23)
5029 '((default org-default))) 5060 (set (make-local-variable 'buffer-face-mode-face) 'org-default)
5061 (buffer-face-mode))
5030 5062
5031 ;; If empty file that did not turn on org-mode automatically, make it to. 5063 ;; If empty file that did not turn on org-mode automatically, make it to.
5032 (if (and org-insert-mode-line-in-empty-file 5064 (if (and org-insert-mode-line-in-empty-file
@@ -5353,6 +5385,7 @@ will be prompted for."
5353(defcustom org-src-fontify-natively nil 5385(defcustom org-src-fontify-natively nil
5354 "When non-nil, fontify code in code blocks." 5386 "When non-nil, fontify code in code blocks."
5355 :type 'boolean 5387 :type 'boolean
5388 :version "24.1"
5356 :group 'org-appearance 5389 :group 'org-appearance
5357 :group 'org-babel) 5390 :group 'org-babel)
5358 5391
@@ -5459,6 +5492,22 @@ will be prompted for."
5459 '(font-lock-fontified t face font-lock-comment-face))) 5492 '(font-lock-fontified t face font-lock-comment-face)))
5460 (t nil)))))) 5493 (t nil))))))
5461 5494
5495(defun org-strip-protective-commas (beg end)
5496 "Strip protective commas between BEG and END in the current buffer."
5497 (interactive "r")
5498 (save-excursion
5499 (save-match-data
5500 (goto-char beg)
5501 (let ((front-line (save-excursion
5502 (re-search-forward
5503 "[^[:space:]]" end t)
5504 (goto-char (match-beginning 0))
5505 (current-column))))
5506 (while (re-search-forward "^[ \t]*\\(,\\)\\([*]\\|#\\+\\)" end t)
5507 (goto-char (match-beginning 1))
5508 (when (= (current-column) front-line)
5509 (replace-match "" nil nil nil 1)))))))
5510
5462(defun org-activate-angle-links (limit) 5511(defun org-activate-angle-links (limit)
5463 "Run through the buffer and add overlays to links." 5512 "Run through the buffer and add overlays to links."
5464 (if (re-search-forward org-angle-link-re limit t) 5513 (if (re-search-forward org-angle-link-re limit t)
@@ -5791,7 +5840,7 @@ needs to be inserted at a specific position in the font-lock sequence.")
5791 (if org-fontify-done-headline 5840 (if org-fontify-done-headline
5792 (list (format org-heading-keyword-regexp-format 5841 (list (format org-heading-keyword-regexp-format
5793 (concat 5842 (concat
5794 "\\(" 5843 "\\(?:"
5795 (mapconcat 'regexp-quote org-done-keywords "\\|") 5844 (mapconcat 'regexp-quote org-done-keywords "\\|")
5796 "\\)")) 5845 "\\)"))
5797 '(2 'org-headline-done t)) 5846 '(2 'org-headline-done t))
@@ -6295,7 +6344,12 @@ in special contexts.
6295 (if (org-at-item-p) 6344 (if (org-at-item-p)
6296 (org-list-set-item-visibility (point-at-bol) struct 'children) 6345 (org-list-set-item-visibility (point-at-bol) struct 'children)
6297 (org-show-entry) 6346 (org-show-entry)
6298 (show-children) 6347 (org-with-limited-levels (show-children))
6348 ;; FIXME: This slows down the func way too much.
6349 ;; How keep drawers hidden in subtree anyway?
6350 ;; (when (memq 'org-cycle-hide-drawers org-cycle-hook)
6351 ;; (org-cycle-hide-drawers 'subtree))
6352
6299 ;; Fold every list in subtree to top-level items. 6353 ;; Fold every list in subtree to top-level items.
6300 (when (eq org-cycle-include-plain-lists 'integrate) 6354 (when (eq org-cycle-include-plain-lists 'integrate)
6301 (save-excursion 6355 (save-excursion
@@ -6786,7 +6840,7 @@ This command works around this by showing a copy of the current buffer
6786in an indirect buffer, in overview mode. You can dive into the tree in 6840in an indirect buffer, in overview mode. You can dive into the tree in
6787that copy, use org-occur and incremental search to find a location. 6841that copy, use org-occur and incremental search to find a location.
6788When pressing RET or `Q', the command returns to the original buffer in 6842When pressing RET or `Q', the command returns to the original buffer in
6789which the visibility is still unchanged. After RET is will also jump to 6843which the visibility is still unchanged. After RET it will also jump to
6790the location selected in the indirect buffer and expose the headline 6844the location selected in the indirect buffer and expose the headline
6791hierarchy above." 6845hierarchy above."
6792 (interactive "P") 6846 (interactive "P")
@@ -6803,7 +6857,7 @@ hierarchy above."
6803 (selected-point 6857 (selected-point
6804 (if (eq interface 'outline) 6858 (if (eq interface 'outline)
6805 (car (org-get-location (current-buffer) org-goto-help)) 6859 (car (org-get-location (current-buffer) org-goto-help))
6806 (let ((pa (org-refile-get-location "Goto"))) 6860 (let ((pa (org-refile-get-location "Goto" nil nil t)))
6807 (org-refile-check-position pa) 6861 (org-refile-check-position pa)
6808 (nth 3 pa))))) 6862 (nth 3 pa)))))
6809 (if selected-point 6863 (if selected-point
@@ -7890,7 +7944,7 @@ the following will happen:
7890 repeater intact. 7944 repeater intact.
7891- the start days in the repeater in the original entry will be shifted 7945- the start days in the repeater in the original entry will be shifted
7892 to past the last clone. 7946 to past the last clone.
7893I this way you can spell out a number of instances of a repeating task, 7947In this way you can spell out a number of instances of a repeating task,
7894and still retain the repeater to cover future instances of the task." 7948and still retain the repeater to cover future instances of the task."
7895 (interactive "nNumber of clones to produce: \nsDate shift per clone (e.g. +1w, empty to copy unchanged): ") 7949 (interactive "nNumber of clones to produce: \nsDate shift per clone (e.g. +1w, empty to copy unchanged): ")
7896 (let (beg end template task idprop 7950 (let (beg end template task idprop
@@ -7917,7 +7971,7 @@ and still retain the repeater to cover future instances of the task."
7917 (setq end (point)) 7971 (setq end (point))
7918 (setq template (buffer-substring beg end)) 7972 (setq template (buffer-substring beg end))
7919 (when (and doshift 7973 (when (and doshift
7920 (string-match "<[^<>\n]+ \\+[0-9]+[dwmy][^<>\n]*>" template)) 7974 (string-match "<[^<>\n]+ [.+]?\\+[0-9]+[dwmy][^<>\n]*>" template))
7921 (delete-region beg end) 7975 (delete-region beg end)
7922 (setq end beg) 7976 (setq end beg)
7923 (setq nmin 0 nmax (1+ nmax) n-no-remove nmax)) 7977 (setq nmin 0 nmax (1+ nmax) n-no-remove nmax))
@@ -7948,7 +8002,7 @@ and still retain the repeater to cover future instances of the task."
7948 (while (re-search-forward org-ts-regexp nil t) 8002 (while (re-search-forward org-ts-regexp nil t)
7949 (save-excursion 8003 (save-excursion
7950 (goto-char (match-beginning 0)) 8004 (goto-char (match-beginning 0))
7951 (if (looking-at "<[^<>\n]+\\( +\\+[0-9]+[dwmy]\\)") 8005 (if (looking-at "<[^<>\n]+\\( +[.+]?\\+[0-9]+[dwmy]\\)")
7952 (delete-region (match-beginning 1) (match-end 1))))))) 8006 (delete-region (match-beginning 1) (match-end 1)))))))
7953 (setq task (buffer-string))) 8007 (setq task (buffer-string)))
7954 (insert task)) 8008 (insert task))
@@ -7958,8 +8012,7 @@ and still retain the repeater to cover future instances of the task."
7958 8012
7959(defun org-sort (with-case) 8013(defun org-sort (with-case)
7960 "Call `org-sort-entries', `org-table-sort-lines' or `org-sort-list'. 8014 "Call `org-sort-entries', `org-table-sort-lines' or `org-sort-list'.
7961Optional argument WITH-CASE means sort case-sensitively. 8015Optional argument WITH-CASE means sort case-sensitively."
7962With a double prefix argument, also remove duplicate entries."
7963 (interactive "P") 8016 (interactive "P")
7964 (cond 8017 (cond
7965 ((org-at-table-p) (org-call-with-arg 'org-table-sort-lines with-case)) 8018 ((org-at-table-p) (org-call-with-arg 'org-table-sort-lines with-case))
@@ -8477,11 +8530,12 @@ call CMD."
8477 8530
8478(defun org-get-category (&optional pos force-refresh) 8531(defun org-get-category (&optional pos force-refresh)
8479 "Get the category applying to position POS." 8532 "Get the category applying to position POS."
8480 (if force-refresh (org-refresh-category-properties)) 8533 (save-match-data
8481 (let ((pos (or pos (point)))) 8534 (if force-refresh (org-refresh-category-properties))
8482 (or (get-text-property pos 'org-category) 8535 (let ((pos (or pos (point))))
8483 (progn (org-refresh-category-properties) 8536 (or (get-text-property pos 'org-category)
8484 (get-text-property pos 'org-category))))) 8537 (progn (org-refresh-category-properties)
8538 (get-text-property pos 'org-category))))))
8485 8539
8486(defun org-refresh-category-properties () 8540(defun org-refresh-category-properties ()
8487 "Refresh category text properties in the buffer." 8541 "Refresh category text properties in the buffer."
@@ -8625,7 +8679,7 @@ For file links, arg negates `org-context-in-file-links'."
8625 (setq link (plist-get org-store-link-plist :link) 8679 (setq link (plist-get org-store-link-plist :link)
8626 desc (or (plist-get org-store-link-plist :description) link))) 8680 desc (or (plist-get org-store-link-plist :description) link)))
8627 8681
8628 ((equal (buffer-name) "*Org Edit Src Example*") 8682 ((org-src-edit-buffer-p)
8629 (let (label gc) 8683 (let (label gc)
8630 (while (or (not label) 8684 (while (or (not label)
8631 (save-excursion 8685 (save-excursion
@@ -9439,7 +9493,7 @@ Org-mode syntax."
9439 (interactive "sLink: \nP") 9493 (interactive "sLink: \nP")
9440 (let ((reference-buffer (or reference-buffer (current-buffer)))) 9494 (let ((reference-buffer (or reference-buffer (current-buffer))))
9441 (with-temp-buffer 9495 (with-temp-buffer
9442 (let ((org-inhibit-startup t)) 9496 (let ((org-inhibit-startup (not reference-buffer)))
9443 (org-mode) 9497 (org-mode)
9444 (insert s) 9498 (insert s)
9445 (goto-char (point-min)) 9499 (goto-char (point-min))
@@ -10621,7 +10675,8 @@ prefix argument (`C-u C-u C-u C-c C-w')."
10621 (t (concat "Refile subtree \"" 10675 (t (concat "Refile subtree \""
10622 heading-text "\" to"))) 10676 heading-text "\" to")))
10623 default-buffer 10677 default-buffer
10624 org-refile-allow-creating-parent-nodes 10678 (and (not (equal '(4) goto))
10679 org-refile-allow-creating-parent-nodes)
10625 goto)))))) 10680 goto))))))
10626 (setq file (nth 1 it) 10681 (setq file (nth 1 it)
10627 re (nth 2 it) 10682 re (nth 2 it)
@@ -11028,11 +11083,11 @@ This function can be used in a hook."
11028 "<example>\n?\n</example>") 11083 "<example>\n?\n</example>")
11029 ("q" "#+begin_quote\n?\n#+end_quote" 11084 ("q" "#+begin_quote\n?\n#+end_quote"
11030 "<quote>\n?\n</quote>") 11085 "<quote>\n?\n</quote>")
11031 ("v" "#+begin_verse\n?\n#+end_verse" 11086 ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE"
11032 "<verse>\n?\n/verse>") 11087 "<verse>\n?\n</verse>")
11033 ("c" "#+begin_center\n?\n#+end_center" 11088 ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER"
11034 "<center>\n?\n/center>") 11089 "<center>\n?\n</center>")
11035 ("l" "#+begin_latex\n?\n#+end_latex" 11090 ("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX"
11036 "<literal style=\"latex\">\n?\n</literal>") 11091 "<literal style=\"latex\">\n?\n</literal>")
11037 ("L" "#+latex: " 11092 ("L" "#+latex: "
11038 "<literal style=\"latex\">?</literal>") 11093 "<literal style=\"latex\">?</literal>")
@@ -11231,22 +11286,22 @@ For calling through lisp, arg is also interpreted in the following way:
11231 (interpret (nth 1 ass)) 11286 (interpret (nth 1 ass))
11232 (done-word (nth 3 ass)) 11287 (done-word (nth 3 ass))
11233 (final-done-word (nth 4 ass)) 11288 (final-done-word (nth 4 ass))
11234 (last-state (or this "")) 11289 (org-last-state (or this ""))
11235 (completion-ignore-case t) 11290 (completion-ignore-case t)
11236 (member (member this org-todo-keywords-1)) 11291 (member (member this org-todo-keywords-1))
11237 (tail (cdr member)) 11292 (tail (cdr member))
11238 (state (cond 11293 (org-state (cond
11239 ((and org-todo-key-trigger 11294 ((and org-todo-key-trigger
11240 (or (and (equal arg '(4)) 11295 (or (and (equal arg '(4))
11241 (eq org-use-fast-todo-selection 'prefix)) 11296 (eq org-use-fast-todo-selection 'prefix))
11242 (and (not arg) org-use-fast-todo-selection 11297 (and (not arg) org-use-fast-todo-selection
11243 (not (eq org-use-fast-todo-selection 11298 (not (eq org-use-fast-todo-selection
11244 'prefix))))) 11299 'prefix)))))
11245 ;; Use fast selection 11300 ;; Use fast selection
11246 (org-fast-todo-selection)) 11301 (org-fast-todo-selection))
11247 ((and (equal arg '(4)) 11302 ((and (equal arg '(4))
11248 (or (not org-use-fast-todo-selection) 11303 (or (not org-use-fast-todo-selection)
11249 (not org-todo-key-trigger))) 11304 (not org-todo-key-trigger)))
11250 ;; Read a state with completion 11305 ;; Read a state with completion
11251 (org-icompleting-read 11306 (org-icompleting-read
11252 "State: " (mapcar (lambda(x) (list x)) 11307 "State: " (mapcar (lambda(x) (list x))
@@ -11295,12 +11350,12 @@ For calling through lisp, arg is also interpreted in the following way:
11295 nil))) 11350 nil)))
11296 (t 11351 (t
11297 (car tail)))) 11352 (car tail))))
11298 (state (or 11353 (org-state (or
11299 (run-hook-with-args-until-success 11354 (run-hook-with-args-until-success
11300 'org-todo-get-default-hook state last-state) 11355 'org-todo-get-default-hook org-state org-last-state)
11301 state)) 11356 org-state))
11302 (next (if state (concat " " state " ") " ")) 11357 (next (if org-state (concat " " org-state " ") " "))
11303 (change-plist (list :type 'todo-state-change :from this :to state 11358 (change-plist (list :type 'todo-state-change :from this :to org-state
11304 :position startpos)) 11359 :position startpos))
11305 dolog now-done-p) 11360 dolog now-done-p)
11306 (when org-blocker-hook 11361 (when org-blocker-hook
@@ -11312,16 +11367,16 @@ For calling through lisp, arg is also interpreted in the following way:
11312 (run-hook-with-args-until-failure 11367 (run-hook-with-args-until-failure
11313 'org-blocker-hook change-plist)))) 11368 'org-blocker-hook change-plist))))
11314 (if (org-called-interactively-p 'interactive) 11369 (if (org-called-interactively-p 'interactive)
11315 (error "TODO state change from %s to %s blocked" this state) 11370 (error "TODO state change from %s to %s blocked" this org-state)
11316 ;; fail silently 11371 ;; fail silently
11317 (message "TODO state change from %s to %s blocked" this state) 11372 (message "TODO state change from %s to %s blocked" this org-state)
11318 (throw 'exit nil)))) 11373 (throw 'exit nil))))
11319 (store-match-data match-data) 11374 (store-match-data match-data)
11320 (replace-match next t t) 11375 (replace-match next t t)
11321 (unless (pos-visible-in-window-p hl-pos) 11376 (unless (pos-visible-in-window-p hl-pos)
11322 (message "TODO state changed to %s" (org-trim next))) 11377 (message "TODO state changed to %s" (org-trim next)))
11323 (unless head 11378 (unless head
11324 (setq head (org-get-todo-sequence-head state) 11379 (setq head (org-get-todo-sequence-head org-state)
11325 ass (assoc head org-todo-kwd-alist) 11380 ass (assoc head org-todo-kwd-alist)
11326 interpret (nth 1 ass) 11381 interpret (nth 1 ass)
11327 done-word (nth 3 ass) 11382 done-word (nth 3 ass)
@@ -11329,24 +11384,24 @@ For calling through lisp, arg is also interpreted in the following way:
11329 (when (memq arg '(nextset previousset)) 11384 (when (memq arg '(nextset previousset))
11330 (message "Keyword-Set %d/%d: %s" 11385 (message "Keyword-Set %d/%d: %s"
11331 (- (length org-todo-sets) -1 11386 (- (length org-todo-sets) -1
11332 (length (memq (assoc state org-todo-sets) org-todo-sets))) 11387 (length (memq (assoc org-state org-todo-sets) org-todo-sets)))
11333 (length org-todo-sets) 11388 (length org-todo-sets)
11334 (mapconcat 'identity (assoc state org-todo-sets) " "))) 11389 (mapconcat 'identity (assoc org-state org-todo-sets) " ")))
11335 (setq org-last-todo-state-is-todo 11390 (setq org-last-todo-state-is-todo
11336 (not (member state org-done-keywords))) 11391 (not (member org-state org-done-keywords)))
11337 (setq now-done-p (and (member state org-done-keywords) 11392 (setq now-done-p (and (member org-state org-done-keywords)
11338 (not (member this org-done-keywords)))) 11393 (not (member this org-done-keywords))))
11339 (and logging (org-local-logging logging)) 11394 (and logging (org-local-logging logging))
11340 (when (and (or org-todo-log-states org-log-done) 11395 (when (and (or org-todo-log-states org-log-done)
11341 (not (eq org-inhibit-logging t)) 11396 (not (eq org-inhibit-logging t))
11342 (not (memq arg '(nextset previousset)))) 11397 (not (memq arg '(nextset previousset))))
11343 ;; we need to look at recording a time and note 11398 ;; we need to look at recording a time and note
11344 (setq dolog (or (nth 1 (assoc state org-todo-log-states)) 11399 (setq dolog (or (nth 1 (assoc org-state org-todo-log-states))
11345 (nth 2 (assoc this org-todo-log-states)))) 11400 (nth 2 (assoc this org-todo-log-states))))
11346 (if (and (eq dolog 'note) (eq org-inhibit-logging 'note)) 11401 (if (and (eq dolog 'note) (eq org-inhibit-logging 'note))
11347 (setq dolog 'time)) 11402 (setq dolog 'time))
11348 (when (and state 11403 (when (and org-state
11349 (member state org-not-done-keywords) 11404 (member org-state org-not-done-keywords)
11350 (not (member this org-not-done-keywords))) 11405 (not (member this org-not-done-keywords)))
11351 ;; This is now a todo state and was not one before 11406 ;; This is now a todo state and was not one before
11352 ;; If there was a CLOSED time stamp, get rid of it. 11407 ;; If there was a CLOSED time stamp, get rid of it.
@@ -11355,18 +11410,18 @@ For calling through lisp, arg is also interpreted in the following way:
11355 ;; It is now done, and it was not done before 11410 ;; It is now done, and it was not done before
11356 (org-add-planning-info 'closed (org-current-effective-time)) 11411 (org-add-planning-info 'closed (org-current-effective-time))
11357 (if (and (not dolog) (eq 'note org-log-done)) 11412 (if (and (not dolog) (eq 'note org-log-done))
11358 (org-add-log-setup 'done state this 'findpos 'note))) 11413 (org-add-log-setup 'done org-state this 'findpos 'note)))
11359 (when (and state dolog) 11414 (when (and org-state dolog)
11360 ;; This is a non-nil state, and we need to log it 11415 ;; This is a non-nil state, and we need to log it
11361 (org-add-log-setup 'state state this 'findpos dolog))) 11416 (org-add-log-setup 'state org-state this 'findpos dolog)))
11362 ;; Fixup tag positioning 11417 ;; Fixup tag positioning
11363 (org-todo-trigger-tag-changes state) 11418 (org-todo-trigger-tag-changes org-state)
11364 (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t)) 11419 (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t))
11365 (when org-provide-todo-statistics 11420 (when org-provide-todo-statistics
11366 (org-update-parent-todo-statistics)) 11421 (org-update-parent-todo-statistics))
11367 (run-hooks 'org-after-todo-state-change-hook) 11422 (run-hooks 'org-after-todo-state-change-hook)
11368 (if (and arg (not (member state org-done-keywords))) 11423 (if (and arg (not (member org-state org-done-keywords)))
11369 (setq head (org-get-todo-sequence-head state))) 11424 (setq head (org-get-todo-sequence-head org-state)))
11370 (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head) 11425 (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head)
11371 ;; Do we need to trigger a repeat? 11426 ;; Do we need to trigger a repeat?
11372 (when now-done-p 11427 (when now-done-p
@@ -11375,7 +11430,7 @@ For calling through lisp, arg is also interpreted in the following way:
11375 (save-match-data 11430 (save-match-data
11376 (setq org-agenda-headline-snapshot-before-repeat 11431 (setq org-agenda-headline-snapshot-before-repeat
11377 (org-get-heading)))) 11432 (org-get-heading))))
11378 (org-auto-repeat-maybe state)) 11433 (org-auto-repeat-maybe org-state))
11379 ;; Fixup cursor location if close to the keyword 11434 ;; Fixup cursor location if close to the keyword
11380 (if (and (outline-on-heading-p) 11435 (if (and (outline-on-heading-p)
11381 (not (bolp)) 11436 (not (bolp))
@@ -11847,7 +11902,7 @@ of repeating deadline/scheduled time stamps to new date.
11847This function is run automatically after each state change to a DONE state." 11902This function is run automatically after each state change to a DONE state."
11848 ;; last-state is dynamically scoped into this function 11903 ;; last-state is dynamically scoped into this function
11849 (let* ((repeat (org-get-repeat)) 11904 (let* ((repeat (org-get-repeat))
11850 (aa (assoc last-state org-todo-kwd-alist)) 11905 (aa (assoc org-last-state org-todo-kwd-alist))
11851 (interpret (nth 1 aa)) 11906 (interpret (nth 1 aa))
11852 (head (nth 2 aa)) 11907 (head (nth 2 aa))
11853 (whata '(("d" . day) ("m" . month) ("y" . year))) 11908 (whata '(("d" . day) ("m" . month) ("y" . year)))
@@ -11860,7 +11915,7 @@ This function is run automatically after each state change to a DONE state."
11860 (setq to-state (or (org-entry-get nil "REPEAT_TO_STATE") 11915 (setq to-state (or (org-entry-get nil "REPEAT_TO_STATE")
11861 org-todo-repeat-to-state)) 11916 org-todo-repeat-to-state))
11862 (unless (and to-state (member to-state org-todo-keywords-1)) 11917 (unless (and to-state (member to-state org-todo-keywords-1))
11863 (setq to-state (if (eq interpret 'type) last-state head))) 11918 (setq to-state (if (eq interpret 'type) org-last-state head)))
11864 (org-todo to-state) 11919 (org-todo to-state)
11865 (when (or org-log-repeat (org-entry-get nil "CLOCK")) 11920 (when (or org-log-repeat (org-entry-get nil "CLOCK"))
11866 (org-entry-put nil "LAST_REPEAT" (format-time-string 11921 (org-entry-put nil "LAST_REPEAT" (format-time-string
@@ -11874,7 +11929,7 @@ This function is run automatically after each state change to a DONE state."
11874 (setq org-log-note-how 'note)) 11929 (setq org-log-note-how 'note))
11875 ;; Set up for taking a record 11930 ;; Set up for taking a record
11876 (org-add-log-setup 'state (or done-word (car org-done-keywords)) 11931 (org-add-log-setup 'state (or done-word (car org-done-keywords))
11877 last-state 11932 org-last-state
11878 'findpos org-log-repeat))) 11933 'findpos org-log-repeat)))
11879 (org-back-to-heading t) 11934 (org-back-to-heading t)
11880 (org-add-planning-info nil nil 'closed) 11935 (org-add-planning-info nil nil 'closed)
@@ -12742,7 +12797,7 @@ obtain a list of properties. Building the tags list for each entry in such
12742a file becomes an N^2 operation - but with this variable set, it scales 12797a file becomes an N^2 operation - but with this variable set, it scales
12743as N.") 12798as N.")
12744 12799
12745(defun org-scan-tags (action matcher &optional todo-only start-level) 12800(defun org-scan-tags (action matcher todo-only &optional start-level)
12746 "Scan headline tags with inheritance and produce output ACTION. 12801 "Scan headline tags with inheritance and produce output ACTION.
12747 12802
12748ACTION can be `sparse-tree' to produce a sparse tree in the current buffer, 12803ACTION can be `sparse-tree' to produce a sparse tree in the current buffer,
@@ -12752,7 +12807,9 @@ this case the return value is a list of all return values from these calls.
12752 12807
12753MATCHER is a Lisp form to be evaluated, testing if a given set of tags 12808MATCHER is a Lisp form to be evaluated, testing if a given set of tags
12754qualifies a headline for inclusion. When TODO-ONLY is non-nil, 12809qualifies a headline for inclusion. When TODO-ONLY is non-nil,
12755only lines with a TODO keyword are included in the output. 12810only lines with a not-done TODO keyword are included in the output.
12811This should be the same variable that was scoped into
12812and set by `org-make-tags-matcher' when it constructed MATCHER.
12756 12813
12757START-LEVEL can be a string with asterisks, reducing the scope to 12814START-LEVEL can be a string with asterisks, reducing the scope to
12758headlines matching this string." 12815headlines matching this string."
@@ -12861,7 +12918,7 @@ headlines matching this string."
12861 (and org-highlight-sparse-tree-matches 12918 (and org-highlight-sparse-tree-matches
12862 (org-get-heading) (match-end 0) 12919 (org-get-heading) (match-end 0)
12863 (org-highlight-new-match 12920 (org-highlight-new-match
12864 (match-beginning 0) (match-beginning 1))) 12921 (match-beginning 1) (match-end 1)))
12865 (org-show-context 'tags-tree)) 12922 (org-show-context 'tags-tree))
12866 ((eq action 'agenda) 12923 ((eq action 'agenda)
12867 (setq txt (org-agenda-format-item 12924 (setq txt (org-agenda-format-item
@@ -12922,8 +12979,6 @@ headlines matching this string."
12922 (if (member x org-use-tag-inheritance) x nil)) 12979 (if (member x org-use-tag-inheritance) x nil))
12923 tags))))) 12980 tags)))))
12924 12981
12925(defvar todo-only) ;; dynamically scoped
12926
12927(defun org-match-sparse-tree (&optional todo-only match) 12982(defun org-match-sparse-tree (&optional todo-only match)
12928 "Create a sparse tree according to tags string MATCH. 12983 "Create a sparse tree according to tags string MATCH.
12929MATCH can contain positive and negative selection of tags, like 12984MATCH can contain positive and negative selection of tags, like
@@ -12970,9 +13025,29 @@ instead of the agenda files."
12970 (org-agenda-files)))))))) 13025 (org-agenda-files))))))))
12971 13026
12972(defun org-make-tags-matcher (match) 13027(defun org-make-tags-matcher (match)
12973 "Create the TAGS/TODO matcher form for the selection string MATCH." 13028 "Create the TAGS/TODO matcher form for the selection string MATCH.
12974 ;; todo-only is scoped dynamically into this function, and the function 13029
12975 ;; may change it if the matcher asks for it. 13030The variable `todo-only' is scoped dynamically into this function; it will be
13031set to t if the matcher restricts matching to TODO entries,
13032otherwise will not be touched.
13033
13034Returns a cons of the selection string MATCH and the constructed
13035lisp form implementing the matcher. The matcher is to be
13036evaluated at an Org entry, with point on the headline,
13037and returns t if the entry matches the
13038selection string MATCH. The returned lisp form references
13039two variables with information about the entry, which must be
13040bound around the form's evaluation: todo, the TODO keyword at the
13041entry (or nil of none); and tags-list, the list of all tags at the
13042entry including inherited ones. Additionally, the category
13043of the entry (if any) must be specified as the text property
13044'org-category on the headline.
13045
13046See also `org-scan-tags'.
13047"
13048 (declare (special todo-only))
13049 (unless (boundp 'todo-only)
13050 (error "org-make-tags-matcher expects todo-only to be scoped in"))
12976 (unless match 13051 (unless match
12977 ;; Get a new match request, with completion 13052 ;; Get a new match request, with completion
12978 (let ((org-last-tags-completion-table 13053 (let ((org-last-tags-completion-table
@@ -13089,6 +13164,9 @@ instead of the agenda files."
13089 (setq matcher (if todomatcher 13164 (setq matcher (if todomatcher
13090 (list 'and tagsmatcher todomatcher) 13165 (list 'and tagsmatcher todomatcher)
13091 tagsmatcher)) 13166 tagsmatcher))
13167 (when todo-only
13168 (setq matcher (list 'and '(member todo org-not-done-keywords)
13169 matcher)))
13092 (cons match0 matcher))) 13170 (cons match0 matcher)))
13093 13171
13094(defun org-op-to-function (op &optional stringp) 13172(defun org-op-to-function (op &optional stringp)
@@ -13344,7 +13422,8 @@ With prefix ARG, realign all tags in headings in the current buffer."
13344 ;; Get a new set of tags from the user 13422 ;; Get a new set of tags from the user
13345 (save-excursion 13423 (save-excursion
13346 (setq table (append org-tag-persistent-alist 13424 (setq table (append org-tag-persistent-alist
13347 (or org-tag-alist (org-get-buffer-tags)) 13425 org-tag-alist
13426 (org-get-buffer-tags)
13348 (and 13427 (and
13349 org-complete-tags-always-offer-all-agenda-tags 13428 org-complete-tags-always-offer-all-agenda-tags
13350 (org-global-tags-completion-table 13429 (org-global-tags-completion-table
@@ -13362,7 +13441,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
13362 current-tags inherited-tags table 13441 current-tags inherited-tags table
13363 (if org-fast-tag-selection-include-todo 13442 (if org-fast-tag-selection-include-todo
13364 org-todo-key-alist)) 13443 org-todo-key-alist))
13365 (let ((org-add-colon-after-tag-completion t)) 13444 (let ((org-add-colon-after-tag-completion (< 1 (length table))))
13366 (org-trim 13445 (org-trim
13367 (org-icompleting-read "Tags: " 13446 (org-icompleting-read "Tags: "
13368 'org-tags-completion-function 13447 'org-tags-completion-function
@@ -13646,9 +13725,11 @@ Returns the new tags string, or nil to not change the current settings."
13646 (condition-case nil 13725 (condition-case nil
13647 (setq tg (org-icompleting-read 13726 (setq tg (org-icompleting-read
13648 "Tag: " 13727 "Tag: "
13649 (or buffer-tags 13728 (delete-dups
13650 (with-current-buffer buf 13729 (append (or buffer-tags
13651 (org-get-buffer-tags))))) 13730 (with-current-buffer buf
13731 (mapcar 'car (org-get-buffer-tags))))
13732 (mapcar 'car table)))))
13652 (quit (setq tg ""))) 13733 (quit (setq tg "")))
13653 (when (string-match "\\S-" tg) 13734 (when (string-match "\\S-" tg)
13654 (add-to-list 'buffer-tags (list tg)) 13735 (add-to-list 'buffer-tags (list tg))
@@ -13802,7 +13883,8 @@ a *different* entry, you cannot use these techniques."
13802 org-done-keywords-for-agenda 13883 org-done-keywords-for-agenda
13803 org-todo-keyword-alist-for-agenda 13884 org-todo-keyword-alist-for-agenda
13804 org-drawers-for-agenda 13885 org-drawers-for-agenda
13805 org-tag-alist-for-agenda) 13886 org-tag-alist-for-agenda
13887 todo-only)
13806 13888
13807 (cond 13889 (cond
13808 ((eq match t) (setq matcher t)) 13890 ((eq match t) (setq matcher t))
@@ -13835,7 +13917,7 @@ a *different* entry, you cannot use these techniques."
13835 (progn 13917 (progn
13836 (org-prepare-agenda-buffers 13918 (org-prepare-agenda-buffers
13837 (list (buffer-file-name (current-buffer)))) 13919 (list (buffer-file-name (current-buffer))))
13838 (setq res (org-scan-tags func matcher nil start-level))) 13920 (setq res (org-scan-tags func matcher todo-only start-level)))
13839 ;; Get the right scope 13921 ;; Get the right scope
13840 (cond 13922 (cond
13841 ((and scope (listp scope) (symbolp (car scope))) 13923 ((and scope (listp scope) (symbolp (car scope)))
@@ -13856,7 +13938,7 @@ a *different* entry, you cannot use these techniques."
13856 (save-restriction 13938 (save-restriction
13857 (widen) 13939 (widen)
13858 (goto-char (point-min)) 13940 (goto-char (point-min))
13859 (setq res (append res (org-scan-tags func matcher)))))))))) 13941 (setq res (append res (org-scan-tags func matcher todo-only))))))))))
13860 res))) 13942 res)))
13861 13943
13862;;;; Properties 13944;;;; Properties
@@ -14137,24 +14219,26 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy."
14137 ;; retrieve it, but specify the wanted property 14219 ;; retrieve it, but specify the wanted property
14138 (cdr (assoc property (org-entry-properties nil 'special property))) 14220 (cdr (assoc property (org-entry-properties nil 'special property)))
14139 (let ((range (unless (org-before-first-heading-p) 14221 (let ((range (unless (org-before-first-heading-p)
14140 (org-get-property-block)))) 14222 (org-get-property-block)))
14141 (when (and range (goto-char (car range))) 14223 (props (list (or (assoc property org-file-properties)
14142 ((lambda (val) (when val (if literal-nil val (org-not-nil val)))) 14224 (assoc property org-global-properties)
14143 (cond 14225 (assoc property org-global-properties-fixed))))
14144 ((re-search-forward 14226 val)
14145 (org-re-property property) (cdr range) t) 14227 (flet ((ap (key)
14146 (if (match-end 1) (org-match-string-no-properties 1) "")) 14228 (when (re-search-forward
14147 ((re-search-forward 14229 (org-re-property key) (cdr range) t)
14148 (org-re-property (concat property "+")) (cdr range) t) 14230 (setq props
14149 (cdr (assoc 14231 (org-update-property-plist
14150 property 14232 key
14151 (org-update-property-plist 14233 (if (match-end 1)
14152 (concat property "+") 14234 (org-match-string-no-properties 1) "")
14153 (if (match-end 1) (org-match-string-no-properties 1) "") 14235 props)))))
14154 (list (or (assoc property org-file-properties) 14236 (when (and range (goto-char (car range)))
14155 (assoc property org-global-properties) 14237 (ap property)
14156 (assoc property org-global-properties-fixed) 14238 (goto-char (car range))
14157 )))))))))))))) 14239 (while (ap (concat property "+")))
14240 (setq val (cdr (assoc property props)))
14241 (when val (if literal-nil val (org-not-nil val))))))))))
14158 14242
14159(defun org-property-or-variable-value (var &optional inherit) 14243(defun org-property-or-variable-value (var &optional inherit)
14160 "Check if there is a property fixing the value of VAR. 14244 "Check if there is a property fixing the value of VAR.
@@ -14543,7 +14627,7 @@ in the current file."
14543 (org-re-property property) 14627 (org-re-property property)
14544 nil t) 14628 nil t)
14545 (setq cnt (1+ cnt)) 14629 (setq cnt (1+ cnt))
14546 (replace-match "")) 14630 (delete-region (match-beginning 0) (1+ (point-at-eol))))
14547 (message "Property \"%s\" removed from %d entries" property cnt))))) 14631 (message "Property \"%s\" removed from %d entries" property cnt)))))
14548 14632
14549(defvar org-columns-current-fmt-compiled) ; defined in org-colview.el 14633(defvar org-columns-current-fmt-compiled) ; defined in org-colview.el
@@ -14848,7 +14932,7 @@ So these are more for recording a certain time/date."
14848(defvar org-read-date-analyze-futurep nil) 14932(defvar org-read-date-analyze-futurep nil)
14849(defvar org-read-date-analyze-forced-year nil) 14933(defvar org-read-date-analyze-forced-year nil)
14850 14934
14851(defun org-read-date (&optional with-time to-time from-string prompt 14935(defun org-read-date (&optional org-with-time to-time from-string prompt
14852 default-time default-input) 14936 default-time default-input)
14853 "Read a date, possibly a time, and make things smooth for the user. 14937 "Read a date, possibly a time, and make things smooth for the user.
14854The prompt will suggest to enter an ISO date, but you can also enter anything 14938The prompt will suggest to enter an ISO date, but you can also enter anything
@@ -14881,9 +14965,7 @@ plus or minus, it is relative to the date in DEFAULT-TIME. E.g.
14881 +2w --> two weeks from today 14965 +2w --> two weeks from today
14882 ++5 --> five days from default date 14966 ++5 --> five days from default date
14883 14967
14884The function understands only English month and weekday abbreviations, 14968The function understands only English month and weekday abbreviations.
14885but this can be configured with the variables `parse-time-months' and
14886`parse-time-weekdays'.
14887 14969
14888While prompting, a calendar is popped up - you can also select the 14970While prompting, a calendar is popped up - you can also select the
14889date with the mouse (button 1). The calendar shows a period of three 14971date with the mouse (button 1). The calendar shows a period of three
@@ -14904,24 +14986,24 @@ the time/date that is used for everything that is not specified by the
14904user." 14986user."
14905 (require 'parse-time) 14987 (require 'parse-time)
14906 (let* ((org-time-stamp-rounding-minutes 14988 (let* ((org-time-stamp-rounding-minutes
14907 (if (equal with-time '(16)) '(0 0) org-time-stamp-rounding-minutes)) 14989 (if (equal org-with-time '(16)) '(0 0) org-time-stamp-rounding-minutes))
14908 (org-dcst org-display-custom-times) 14990 (org-dcst org-display-custom-times)
14909 (ct (org-current-time)) 14991 (ct (org-current-time))
14910 (def (or org-overriding-default-time default-time ct)) 14992 (org-def (or org-overriding-default-time default-time ct))
14911 (defdecode (decode-time def)) 14993 (org-defdecode (decode-time org-def))
14912 (dummy (progn 14994 (dummy (progn
14913 (when (< (nth 2 defdecode) org-extend-today-until) 14995 (when (< (nth 2 org-defdecode) org-extend-today-until)
14914 (setcar (nthcdr 2 defdecode) -1) 14996 (setcar (nthcdr 2 org-defdecode) -1)
14915 (setcar (nthcdr 1 defdecode) 59) 14997 (setcar (nthcdr 1 org-defdecode) 59)
14916 (setq def (apply 'encode-time defdecode) 14998 (setq org-def (apply 'encode-time org-defdecode)
14917 defdecode (decode-time def))))) 14999 org-defdecode (decode-time org-def)))))
14918 (calendar-frame-setup nil) 15000 (calendar-frame-setup nil)
14919 (calendar-setup nil) 15001 (calendar-setup nil)
14920 (calendar-move-hook nil) 15002 (calendar-move-hook nil)
14921 (calendar-view-diary-initially-flag nil) 15003 (calendar-view-diary-initially-flag nil)
14922 (calendar-view-holidays-initially-flag nil) 15004 (calendar-view-holidays-initially-flag nil)
14923 (timestr (format-time-string 15005 (timestr (format-time-string
14924 (if with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") def)) 15006 (if org-with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") org-def))
14925 (prompt (concat (if prompt (concat prompt " ") "") 15007 (prompt (concat (if prompt (concat prompt " ") "")
14926 (format "Date+time [%s]: " timestr))) 15008 (format "Date+time [%s]: " timestr)))
14927 ans (org-ans0 "") org-ans1 org-ans2 final) 15009 ans (org-ans0 "") org-ans1 org-ans2 final)
@@ -14934,7 +15016,7 @@ user."
14934 (calendar) 15016 (calendar)
14935 (unwind-protect 15017 (unwind-protect
14936 (progn 15018 (progn
14937 (calendar-forward-day (- (time-to-days def) 15019 (calendar-forward-day (- (time-to-days org-def)
14938 (calendar-absolute-from-gregorian 15020 (calendar-absolute-from-gregorian
14939 (calendar-current-date)))) 15021 (calendar-current-date))))
14940 (org-eval-in-calendar nil t) 15022 (org-eval-in-calendar nil t)
@@ -15020,7 +15102,7 @@ user."
15020 (delete-overlay org-read-date-overlay) 15102 (delete-overlay org-read-date-overlay)
15021 (setq org-read-date-overlay nil))))) 15103 (setq org-read-date-overlay nil)))))
15022 15104
15023 (setq final (org-read-date-analyze ans def defdecode)) 15105 (setq final (org-read-date-analyze ans org-def org-defdecode))
15024 15106
15025 (when org-read-date-analyze-forced-year 15107 (when org-read-date-analyze-forced-year
15026 (message "Year was forced into %s" 15108 (message "Year was forced into %s"
@@ -15042,9 +15124,9 @@ user."
15042 (nth 2 final) (nth 1 final)) 15124 (nth 2 final) (nth 1 final))
15043 (format "%04d-%02d-%02d" (nth 5 final) (nth 4 final) (nth 3 final)))))) 15125 (format "%04d-%02d-%02d" (nth 5 final) (nth 4 final) (nth 3 final))))))
15044 15126
15045(defvar def) 15127(defvar org-def)
15046(defvar defdecode) 15128(defvar org-defdecode)
15047(defvar with-time) 15129(defvar org-with-time)
15048(defun org-read-date-display () 15130(defun org-read-date-display ()
15049 "Display the current date prompt interpretation in the minibuffer." 15131 "Display the current date prompt interpretation in the minibuffer."
15050 (when org-read-date-display-live 15132 (when org-read-date-display-live
@@ -15060,11 +15142,11 @@ user."
15060 (let* ((ans (concat (buffer-substring (point-at-bol) (point-max)) 15142 (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
15061 " " (or org-ans1 org-ans2))) 15143 " " (or org-ans1 org-ans2)))
15062 (org-end-time-was-given nil) 15144 (org-end-time-was-given nil)
15063 (f (org-read-date-analyze ans def defdecode)) 15145 (f (org-read-date-analyze ans org-def org-defdecode))
15064 (fmts (if org-dcst 15146 (fmts (if org-dcst
15065 org-time-stamp-custom-formats 15147 org-time-stamp-custom-formats
15066 org-time-stamp-formats)) 15148 org-time-stamp-formats))
15067 (fmt (if (or with-time 15149 (fmt (if (or org-with-time
15068 (and (boundp 'org-time-was-given) org-time-was-given)) 15150 (and (boundp 'org-time-was-given) org-time-was-given))
15069 (cdr fmts) 15151 (cdr fmts)
15070 (car fmts))) 15152 (car fmts)))
@@ -15080,7 +15162,7 @@ user."
15080 (make-overlay (1- (point-at-eol)) (point-at-eol))) 15162 (make-overlay (1- (point-at-eol)) (point-at-eol)))
15081 (org-overlay-display org-read-date-overlay txt 'secondary-selection)))) 15163 (org-overlay-display org-read-date-overlay txt 'secondary-selection))))
15082 15164
15083(defun org-read-date-analyze (ans def defdecode) 15165(defun org-read-date-analyze (ans org-def org-defdecode)
15084 "Analyze the combined answer of the date prompt." 15166 "Analyze the combined answer of the date prompt."
15085 ;; FIXME: cleanup and comment 15167 ;; FIXME: cleanup and comment
15086 (let ((nowdecode (decode-time (current-time))) 15168 (let ((nowdecode (decode-time (current-time)))
@@ -15092,7 +15174,7 @@ user."
15092 (when (string-match "\\`[ \t]*\\.[ \t]*\\'" ans) 15174 (when (string-match "\\`[ \t]*\\.[ \t]*\\'" ans)
15093 (setq ans "+0")) 15175 (setq ans "+0"))
15094 15176
15095 (when (setq delta (org-read-date-get-relative ans (current-time) def)) 15177 (when (setq delta (org-read-date-get-relative ans (current-time) org-def))
15096 (setq ans (replace-match "" t t ans) 15178 (setq ans (replace-match "" t t ans)
15097 deltan (car delta) 15179 deltan (car delta)
15098 deltaw (nth 1 delta) 15180 deltaw (nth 1 delta)
@@ -15186,19 +15268,19 @@ user."
15186 (substring ans (match-end 7)))))) 15268 (substring ans (match-end 7))))))
15187 15269
15188 (setq tl (parse-time-string ans) 15270 (setq tl (parse-time-string ans)
15189 day (or (nth 3 tl) (nth 3 defdecode)) 15271 day (or (nth 3 tl) (nth 3 org-defdecode))
15190 month (or (nth 4 tl) 15272 month (or (nth 4 tl)
15191 (if (and org-read-date-prefer-future 15273 (if (and org-read-date-prefer-future
15192 (nth 3 tl) (< (nth 3 tl) (nth 3 nowdecode))) 15274 (nth 3 tl) (< (nth 3 tl) (nth 3 nowdecode)))
15193 (prog1 (1+ (nth 4 nowdecode)) (setq futurep t)) 15275 (prog1 (1+ (nth 4 nowdecode)) (setq futurep t))
15194 (nth 4 defdecode))) 15276 (nth 4 org-defdecode)))
15195 year (or (and (not kill-year) (nth 5 tl)) 15277 year (or (and (not kill-year) (nth 5 tl))
15196 (if (and org-read-date-prefer-future 15278 (if (and org-read-date-prefer-future
15197 (nth 4 tl) (< (nth 4 tl) (nth 4 nowdecode))) 15279 (nth 4 tl) (< (nth 4 tl) (nth 4 nowdecode)))
15198 (prog1 (1+ (nth 5 nowdecode)) (setq futurep t)) 15280 (prog1 (1+ (nth 5 nowdecode)) (setq futurep t))
15199 (nth 5 defdecode))) 15281 (nth 5 org-defdecode)))
15200 hour (or (nth 2 tl) (nth 2 defdecode)) 15282 hour (or (nth 2 tl) (nth 2 org-defdecode))
15201 minute (or (nth 1 tl) (nth 1 defdecode)) 15283 minute (or (nth 1 tl) (nth 1 org-defdecode))
15202 second (or (nth 0 tl) 0) 15284 second (or (nth 0 tl) 0)
15203 wday (nth 6 tl)) 15285 wday (nth 6 tl))
15204 15286
@@ -15269,13 +15351,12 @@ user."
15269 (condition-case nil 15351 (condition-case nil
15270 (ignore (encode-time second minute hour day month year)) 15352 (ignore (encode-time second minute hour day month year))
15271 (error 15353 (error
15272 (setq year (nth 5 defdecode)) 15354 (setq year (nth 5 org-defdecode))
15273 (setq org-read-date-analyze-forced-year t)))) 15355 (setq org-read-date-analyze-forced-year t))))
15274 (setq org-read-date-analyze-futurep futurep) 15356 (setq org-read-date-analyze-futurep futurep)
15275 (list second minute hour day month year))) 15357 (list second minute hour day month year)))
15276 15358
15277(defvar parse-time-weekdays) 15359(defvar parse-time-weekdays)
15278
15279(defun org-read-date-get-relative (s today default) 15360(defun org-read-date-get-relative (s today default)
15280 "Check string S for special relative date string. 15361 "Check string S for special relative date string.
15281TODAY and DEFAULT are internal times, for today and for a default. 15362TODAY and DEFAULT are internal times, for today and for a default.
@@ -16072,14 +16153,12 @@ in the timestamp determines what will be changed."
16072 16153
16073(defun org-recenter-calendar (date) 16154(defun org-recenter-calendar (date)
16074 "If the calendar is visible, recenter it to DATE." 16155 "If the calendar is visible, recenter it to DATE."
16075 (let* ((win (selected-window)) 16156 (let ((cwin (get-buffer-window "*Calendar*" t)))
16076 (cwin (get-buffer-window "*Calendar*" t))
16077 (calendar-move-hook nil))
16078 (when cwin 16157 (when cwin
16079 (select-window cwin) 16158 (let ((calendar-move-hook nil))
16080 (calendar-goto-date (if (listp date) date 16159 (with-selected-window cwin
16081 (calendar-gregorian-from-absolute date))) 16160 (calendar-goto-date (if (listp date) date
16082 (select-window win)))) 16161 (calendar-gregorian-from-absolute date))))))))
16083 16162
16084(defun org-goto-calendar (&optional arg) 16163(defun org-goto-calendar (&optional arg)
16085 "Go to the Emacs calendar at the current date. 16164 "Go to the Emacs calendar at the current date.
@@ -16156,6 +16235,7 @@ minutes.
16156For example, if the value of this variable is ((\"hours\" . 60)), then an 16235For example, if the value of this variable is ((\"hours\" . 60)), then an
16157effort string \"2hours\" is equivalent to 120 minutes." 16236effort string \"2hours\" is equivalent to 120 minutes."
16158 :group 'org-agenda 16237 :group 'org-agenda
16238 :version "24.1"
16159 :type '(alist :key-type (string :tag "Modifier") 16239 :type '(alist :key-type (string :tag "Modifier")
16160 :value-type (number :tag "Minutes"))) 16240 :value-type (number :tag "Minutes")))
16161 16241
@@ -16695,6 +16775,8 @@ the cursor is before the first headline,
16695display all fragments in the buffer. 16775display all fragments in the buffer.
16696The images can be removed again with \\[org-ctrl-c-ctrl-c]." 16776The images can be removed again with \\[org-ctrl-c-ctrl-c]."
16697 (interactive "P") 16777 (interactive "P")
16778 (unless buffer-file-name
16779 (error "Can't preview LaTeX fragment in a non-file buffer"))
16698 (org-remove-latex-fragment-image-overlays) 16780 (org-remove-latex-fragment-image-overlays)
16699 (save-excursion 16781 (save-excursion
16700 (save-restriction 16782 (save-restriction
@@ -16966,7 +17048,7 @@ inspection."
16966 (dvifile (concat texfilebase ".dvi")) 17048 (dvifile (concat texfilebase ".dvi"))
16967 (pngfile (concat texfilebase ".png")) 17049 (pngfile (concat texfilebase ".png"))
16968 (fnh (if (featurep 'xemacs) 17050 (fnh (if (featurep 'xemacs)
16969 (font-height (get-face-font 'default)) 17051 (font-height (face-font 'default))
16970 (face-attribute 'default :height nil))) 17052 (face-attribute 'default :height nil)))
16971 (scale (or (plist-get options (if buffer :scale :html-scale)) 1.0)) 17053 (scale (or (plist-get options (if buffer :scale :html-scale)) 1.0))
16972 (dpi (number-to-string (* scale (floor (* 0.9 (if buffer fnh 140.)))))) 17054 (dpi (number-to-string (* scale (floor (* 0.9 (if buffer fnh 140.))))))
@@ -16995,13 +17077,19 @@ inspection."
16995 (if (not (file-exists-p dvifile)) 17077 (if (not (file-exists-p dvifile))
16996 (progn (message "Failed to create dvi file from %s" texfile) nil) 17078 (progn (message "Failed to create dvi file from %s" texfile) nil)
16997 (condition-case nil 17079 (condition-case nil
16998 (call-process "dvipng" nil nil nil 17080 (if (featurep 'xemacs)
17081 (call-process "dvipng" nil nil nil
16999 "-fg" fg "-bg" bg 17082 "-fg" fg "-bg" bg
17000 "-D" dpi
17001 ;;"-x" scale "-y" scale
17002 "-T" "tight" 17083 "-T" "tight"
17003 "-o" pngfile 17084 "-o" pngfile
17004 dvifile) 17085 dvifile)
17086 (call-process "dvipng" nil nil nil
17087 "-fg" fg "-bg" bg
17088 "-D" dpi
17089 ;;"-x" scale "-y" scale
17090 "-T" "tight"
17091 "-o" pngfile
17092 dvifile))
17005 (error nil)) 17093 (error nil))
17006 (if (not (file-exists-p pngfile)) 17094 (if (not (file-exists-p pngfile))
17007 (if org-format-latex-signal-error 17095 (if org-format-latex-signal-error
@@ -17077,7 +17165,12 @@ SNIPPETS-P indicates if this is run to create snippet images for HTML."
17077 "Return an rgb color specification for dvipng." 17165 "Return an rgb color specification for dvipng."
17078 (apply 'format "rgb %s %s %s" 17166 (apply 'format "rgb %s %s %s"
17079 (mapcar 'org-normalize-color 17167 (mapcar 'org-normalize-color
17080 (color-values (face-attribute 'default attr nil))))) 17168 (if (featurep 'xemacs)
17169 (color-rgb-components
17170 (face-property 'default
17171 (cond ((eq attr :foreground) 'foreground)
17172 ((eq attr :background) 'background))))
17173 (color-values (face-attribute 'default attr nil))))))
17081 17174
17082(defun org-normalize-color (value) 17175(defun org-normalize-color (value)
17083 "Return string to be used as color value for an RGB component." 17176 "Return string to be used as color value for an RGB component."
@@ -17121,7 +17214,7 @@ BEG and END default to the buffer boundaries."
17121 (save-restriction 17214 (save-restriction
17122 (widen) 17215 (widen)
17123 (setq beg (or beg (point-min)) end (or end (point-max))) 17216 (setq beg (or beg (point-min)) end (or end (point-max)))
17124 (goto-char (point-min)) 17217 (goto-char beg)
17125 (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?" 17218 (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
17126 (substring (org-image-file-name-regexp) 0 -2) 17219 (substring (org-image-file-name-regexp) 0 -2)
17127 "\\)\\]" (if include-linked "" "\\]"))) 17220 "\\)\\]" (if include-linked "" "\\]")))
@@ -17204,9 +17297,7 @@ BEG and END default to the buffer boundaries."
17204(org-defkey org-mode-map "\C-i" 'org-cycle) 17297(org-defkey org-mode-map "\C-i" 'org-cycle)
17205(org-defkey org-mode-map [(tab)] 'org-cycle) 17298(org-defkey org-mode-map [(tab)] 'org-cycle)
17206(org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived) 17299(org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived)
17207(org-defkey org-mode-map [(meta tab)] 'pcomplete)
17208(org-defkey org-mode-map "\M-\t" 'pcomplete) 17300(org-defkey org-mode-map "\M-\t" 'pcomplete)
17209(org-defkey org-mode-map "\M-\C-i" 'pcomplete)
17210;; The following line is necessary under Suse GNU/Linux 17301;; The following line is necessary under Suse GNU/Linux
17211(unless (featurep 'xemacs) 17302(unless (featurep 'xemacs)
17212 (org-defkey org-mode-map [S-iso-lefttab] 'org-shifttab)) 17303 (org-defkey org-mode-map [S-iso-lefttab] 'org-shifttab))
@@ -17570,7 +17661,7 @@ overwritten, and the table is not marked as requiring realignment."
17570 (looking-at "[^|\n]* |")) 17661 (looking-at "[^|\n]* |"))
17571 (let (org-table-may-need-update) 17662 (let (org-table-may-need-update)
17572 (goto-char (1- (match-end 0))) 17663 (goto-char (1- (match-end 0)))
17573 (delete-char -1) 17664 (backward-delete-char 1)
17574 (goto-char (match-beginning 0)) 17665 (goto-char (match-beginning 0))
17575 (self-insert-command N))) 17666 (self-insert-command N)))
17576 (t 17667 (t
@@ -18424,22 +18515,22 @@ This command does many different things, depending on context:
18424 ;; only if function was called with an argument. Send list only 18515 ;; only if function was called with an argument. Send list only
18425 ;; if at top item. 18516 ;; if at top item.
18426 (let* ((struct (org-list-struct)) 18517 (let* ((struct (org-list-struct))
18427 (new-struct struct) 18518 (firstp (= (org-list-get-top-point struct) (point-at-bol)))
18428 (firstp (= (org-list-get-top-point struct) (point-at-bol)))) 18519 old-struct)
18429 (when arg 18520 (when arg
18430 (setq new-struct (copy-tree struct)) 18521 (setq old-struct (copy-tree struct))
18431 (if firstp 18522 (if firstp
18432 ;; If at first item of sub-list, add check-box to every 18523 ;; If at first item of sub-list, add check-box to every
18433 ;; item at the same level. 18524 ;; item at the same level.
18434 (mapc 18525 (mapc
18435 (lambda (pos) 18526 (lambda (pos)
18436 (unless (org-list-get-checkbox pos new-struct) 18527 (unless (org-list-get-checkbox pos struct)
18437 (org-list-set-checkbox pos new-struct "[ ]"))) 18528 (org-list-set-checkbox pos struct "[ ]")))
18438 (org-list-get-all-items 18529 (org-list-get-all-items
18439 (point-at-bol) new-struct (org-list-prevs-alist new-struct))) 18530 (point-at-bol) struct (org-list-prevs-alist struct)))
18440 (org-list-set-checkbox (point-at-bol) new-struct "[ ]"))) 18531 (org-list-set-checkbox (point-at-bol) struct "[ ]")))
18441 (org-list-write-struct 18532 (org-list-write-struct
18442 new-struct (org-list-parents-alist new-struct) struct) 18533 struct (org-list-parents-alist struct) old-struct)
18443 (when arg (org-update-checkbox-count-maybe)) 18534 (when arg (org-update-checkbox-count-maybe))
18444 (when firstp (org-list-send-list 'maybe)))) 18535 (when firstp (org-list-send-list 'maybe))))
18445 ((save-excursion (beginning-of-line 1) (looking-at org-dblock-start-re)) 18536 ((save-excursion (beginning-of-line 1) (looking-at org-dblock-start-re))
@@ -19026,7 +19117,8 @@ See the individual commands for more information."
19026 (org-inside-LaTeX-fragment-p)] 19117 (org-inside-LaTeX-fragment-p)]
19027 ["Insert citation" org-reftex-citation t] 19118 ["Insert citation" org-reftex-citation t]
19028 "--" 19119 "--"
19029 ["Template for BEAMER" org-insert-beamer-options-template t]) 19120 ["Template for BEAMER" (progn (require 'org-beamer)
19121 (org-insert-beamer-options-template)) t])
19030 "--" 19122 "--"
19031 ("MobileOrg" 19123 ("MobileOrg"
19032 ["Push Files and Views" org-mobile-push t] 19124 ["Push Files and Views" org-mobile-push t]
@@ -19253,6 +19345,17 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
19253 (eval form) 19345 (eval form)
19254 (error (format "%%![Error: %s]" error)))) 19346 (error (format "%%![Error: %s]" error))))
19255 19347
19348(defun org-in-clocktable-p ()
19349 "Check if the cursor is in a clocktable."
19350 (let ((pos (point)) start)
19351 (save-excursion
19352 (end-of-line 1)
19353 (and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
19354 (setq start (match-beginning 0))
19355 (re-search-forward "^[ \t]*#\\+END:.*" nil t)
19356 (>= (match-end 0) pos)
19357 start))))
19358
19256(defun org-in-commented-line () 19359(defun org-in-commented-line ()
19257 "Is point in a line starting with `#'?" 19360 "Is point in a line starting with `#'?"
19258 (equal (char-after (point-at-bol)) ?#)) 19361 (equal (char-after (point-at-bol)) ?#))
@@ -20404,14 +20507,28 @@ beyond the end of the headline."
20404 ((not (eq last-command this-command)) (point)) 20507 ((not (eq last-command this-command)) (point))
20405 (t refpos))))) 20508 (t refpos)))))
20406 ((org-at-item-p) 20509 ((org-at-item-p)
20407 (goto-char 20510 ;; Being at an item and not looking at an the item means point
20408 (if (eq special t) 20511 ;; was previously moved to beginning of a visual line, which
20409 (cond ((> pos (match-end 0)) (match-end 0)) 20512 ;; doesn't contain the item. Therefore, do nothing special,
20410 ((= pos (point)) (match-end 0)) 20513 ;; just stay here.
20411 (t (point))) 20514 (when (looking-at org-list-full-item-re)
20412 (cond ((> pos (point)) (point)) 20515 ;; Set special position at first white space character after
20413 ((not (eq last-command this-command)) (point)) 20516 ;; bullet, and check-box, if any.
20414 (t (match-end 0)))))))) 20517 (let ((after-bullet
20518 (let ((box (match-end 3)))
20519 (if (not box) (match-end 1)
20520 (let ((after (char-after box)))
20521 (if (and after (= after ? )) (1+ box) box))))))
20522 ;; Special case: Move point to special position when
20523 ;; currently after it or at beginning of line.
20524 (if (eq special t)
20525 (when (or (> pos after-bullet) (= (point) pos))
20526 (goto-char after-bullet))
20527 ;; Reversed case: Move point to special position when
20528 ;; point was already at beginning of line and command is
20529 ;; repeated.
20530 (when (and (= (point) pos) (eq last-command this-command))
20531 (goto-char after-bullet))))))))
20415 (org-no-warnings 20532 (org-no-warnings
20416 (and (featurep 'xemacs) (setq zmacs-region-stays t))))) 20533 (and (featurep 'xemacs) (setq zmacs-region-stays t)))))
20417 20534
@@ -20450,7 +20567,10 @@ beyond the end of the headline."
20450 (move-end-of-line 1) 20567 (move-end-of-line 1)
20451 (when (overlays-at (1- (point))) (backward-char 1))) 20568 (when (overlays-at (1- (point))) (backward-char 1)))
20452 ;; At an item: Move before any hidden text. 20569 ;; At an item: Move before any hidden text.
20453 (t (call-interactively 'end-of-line))) 20570 (t (call-interactively
20571 (cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line)
20572 ((fboundp 'move-end-of-line) 'move-end-of-line)
20573 (t 'end-of-line)))))
20454 (org-no-warnings 20574 (org-no-warnings
20455 (and (featurep 'xemacs) (setq zmacs-region-stays t))))) 20575 (and (featurep 'xemacs) (setq zmacs-region-stays t)))))
20456 20576
@@ -20899,6 +21019,7 @@ Stop at the first and last subheadings of a superior heading."
20899 21019
20900(defun org-show-subtree () 21020(defun org-show-subtree ()
20901 "Show everything after this heading at deeper levels." 21021 "Show everything after this heading at deeper levels."
21022 (interactive)
20902 (outline-flag-region 21023 (outline-flag-region
20903 (point) 21024 (point)
20904 (save-excursion 21025 (save-excursion
@@ -20987,8 +21108,8 @@ Show the heading too, if it is currently invisible."
20987 (goto-char (point-max)) 21108 (goto-char (point-max))
20988 (while (re-search-backward re nil t) 21109 (while (re-search-backward re nil t)
20989 (setq level (org-reduced-level (funcall outline-level))) 21110 (setq level (org-reduced-level (funcall outline-level)))
20990 (when (<= level n) 21111 (when (and (<= level n)
20991 (looking-at org-complex-heading-regexp) 21112 (looking-at org-complex-heading-regexp))
20992 (setq head (org-link-display-format 21113 (setq head (org-link-display-format
20993 (org-match-string-no-properties 4)) 21114 (org-match-string-no-properties 4))
20994 m (org-imenu-new-marker)) 21115 m (org-imenu-new-marker))