aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa2012-10-30 20:38:37 +0900
committerKenichi Handa2012-10-30 20:38:37 +0900
commit6ccc848cd85e75d77d6b11a46f5f23f860db9ff5 (patch)
treee10cb69f3bbe6f2d9616d3867f12bf035c70e0f8 /lisp
parentaee5b18ec3c7844ca125249914113eeaef04342c (diff)
parentfcc1acdadbeae00d8dcabeb6dccb20da9672af2c (diff)
downloademacs-6ccc848cd85e75d77d6b11a46f5f23f860db9ff5.tar.gz
emacs-6ccc848cd85e75d77d6b11a46f5f23f860db9ff5.zip
merge trun
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog203
-rw-r--r--lisp/bookmark.el6
-rw-r--r--lisp/cedet/ChangeLog33
-rw-r--r--lisp/cedet/ede/locate.el30
-rw-r--r--lisp/cedet/semantic.el2
-rw-r--r--lisp/cedet/semantic/analyze.el34
-rw-r--r--lisp/cedet/semantic/chart.el5
-rw-r--r--lisp/cedet/semantic/db-el.el7
-rw-r--r--lisp/cedet/semantic/db-file.el5
-rw-r--r--lisp/cedet/semantic/grammar-wy.el5
-rw-r--r--lisp/cedet/semantic/grammar.el12
-rw-r--r--lisp/cedet/semantic/texi.el10
-rw-r--r--lisp/cedet/srecode/compile.el2
-rw-r--r--lisp/cedet/srecode/dictionary.el1
-rw-r--r--lisp/cedet/srecode/insert.el4
-rw-r--r--lisp/cedet/srecode/java.el5
-rw-r--r--lisp/cedet/srecode/map.el3
-rw-r--r--lisp/dired.el25
-rw-r--r--lisp/emacs-lisp/advice.el8
-rw-r--r--lisp/emacs-lisp/checkdoc.el2
-rw-r--r--lisp/emacs-lisp/cl-extra.el3
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el13
-rw-r--r--lisp/emacs-lisp/cl-macs.el2
-rw-r--r--lisp/emacs-lisp/cl.el11
-rw-r--r--lisp/emacs-lisp/easymenu.el147
-rw-r--r--lisp/emacs-lisp/eieio-opt.el8
-rw-r--r--lisp/emacs-lisp/eieio.el23
-rw-r--r--lisp/emacs-lisp/macroexp.el9
-rw-r--r--lisp/emacs-lisp/package.el5
-rw-r--r--lisp/erc/ChangeLog4
-rw-r--r--lisp/erc/erc-backend.el3
-rw-r--r--lisp/face-remap.el38
-rw-r--r--lisp/files.el9
-rw-r--r--lisp/help.el7
-rw-r--r--lisp/imenu.el2
-rw-r--r--lisp/info.el1
-rw-r--r--lisp/isearch.el6
-rw-r--r--lisp/minibuffer.el224
-rw-r--r--lisp/mouse.el4
-rw-r--r--lisp/net/ldap.el1
-rw-r--r--lisp/org/ChangeLog297
-rw-r--r--lisp/org/ob-ditaa.el1
-rw-r--r--lisp/org/ob-haskell.el2
-rw-r--r--lisp/org/ob-io.el2
-rw-r--r--lisp/org/ob-keys.el4
-rw-r--r--lisp/org/ob-lob.el5
-rw-r--r--lisp/org/ob-picolisp.el1
-rw-r--r--lisp/org/ob-ref.el1
-rw-r--r--lisp/org/ob-scala.el14
-rw-r--r--lisp/org/ob-sql.el3
-rw-r--r--lisp/org/ob-sqlite.el3
-rw-r--r--lisp/org/ob-tangle.el5
-rw-r--r--lisp/org/ob.el37
-rw-r--r--lisp/org/org-agenda.el275
-rw-r--r--lisp/org/org-archive.el7
-rw-r--r--lisp/org/org-ascii.el5
-rw-r--r--lisp/org/org-attach.el4
-rw-r--r--lisp/org/org-bbdb.el6
-rw-r--r--lisp/org/org-beamer.el3
-rw-r--r--lisp/org/org-capture.el8
-rw-r--r--lisp/org/org-clock.el75
-rw-r--r--lisp/org/org-colview.el4
-rw-r--r--lisp/org/org-compat.el2
-rw-r--r--lisp/org/org-datetree.el4
-rw-r--r--lisp/org/org-docbook.el4
-rw-r--r--lisp/org/org-element.el252
-rw-r--r--lisp/org/org-exp.el8
-rw-r--r--lisp/org/org-faces.el8
-rw-r--r--lisp/org/org-feed.el4
-rw-r--r--lisp/org/org-footnote.el4
-rw-r--r--lisp/org/org-freemind.el6
-rw-r--r--lisp/org/org-html.el6
-rw-r--r--lisp/org/org-icalendar.el4
-rw-r--r--lisp/org/org-id.el7
-rw-r--r--lisp/org/org-indent.el4
-rw-r--r--lisp/org/org-install.el44
-rw-r--r--lisp/org/org-irc.el4
-rw-r--r--lisp/org/org-latex.el36
-rw-r--r--lisp/org/org-lparse.el22
-rw-r--r--lisp/org/org-mobile.el5
-rw-r--r--lisp/org/org-odt.el6
-rw-r--r--lisp/org/org-plot.el4
-rw-r--r--lisp/org/org-publish.el5
-rw-r--r--lisp/org/org-remember.el4
-rw-r--r--lisp/org/org-src.el70
-rw-r--r--lisp/org/org-table.el69
-rw-r--r--lisp/org/org-taskjuggler.el4
-rw-r--r--lisp/org/org-timer.el6
-rw-r--r--lisp/org/org-version.el6
-rw-r--r--lisp/org/org-xoxo.el4
-rw-r--r--lisp/org/org.el434
-rw-r--r--lisp/profiler.el4
-rw-r--r--lisp/progmodes/compile.el20
-rw-r--r--lisp/progmodes/gud.el5
-rw-r--r--lisp/progmodes/sh-script.el99
-rw-r--r--lisp/repeat.el4
-rw-r--r--lisp/startup.el1
-rw-r--r--lisp/subr.el4
-rw-r--r--lisp/thingatpt.el3
-rw-r--r--lisp/time.el20
-rw-r--r--lisp/tmm.el27
-rw-r--r--lisp/vc/diff-mode.el42
-rw-r--r--lisp/vc/vc-hooks.el2
-rw-r--r--lisp/wdired.el25
-rw-r--r--lisp/window.el16
-rw-r--r--lisp/woman.el4
106 files changed, 2006 insertions, 990 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 16c4983d385..bd535894cdf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,206 @@
12012-10-30 Glenn Morris <rgm@gnu.org>
2
3 * emacs-lisp/cl-extra.el (cl-mapc): Add autoload cookie. Doc fix.
4
5 * emacs-lisp/cl.el (letf): Doc fix. (Bug#12760)
6
72012-10-29 Chong Yidong <cyd@gnu.org>
8
9 * isearch.el (isearch-other-meta-char): Ensure that a reprocessed
10 function key is stored in a keyboard macro (Bug#4894).
11
12 * thingatpt.el (number-at-point): Apply a thing-at-point property.
13
142012-10-29 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * vc/diff-mode.el (diff-context->unified): Don't get confused by "hunk
17 header comments".
18 (diff-unified->context, diff-context->unified)
19 (diff-reverse-direction, diff-fixup-modifs): Use `use-region-p'.
20
21 * emacs-lisp/cl.el (letf): Add missing indent rules (bug#12759).
22
23 * files.el (find-alternate-file): Only ask one question (bug#12487).
24
252012-10-29 Chong Yidong <cyd@gnu.org>
26
27 * vc/vc-hooks.el (vc-file-clearprops): Kill vc-parent-buffer.
28 Suggested by Dan Nicolaescu (Bug#6326).
29
30 * info.el (Info-complete-menu-item): Avoid duplicates (Bug#12705).
31
32 * startup.el (fancy-about-screen): Don't message (Bug#12680).
33
34 * thingatpt.el (thing-at-point): Doc fix (Bug#12691).
35
36 * imenu.el (imenu): Inhibit push-mark message (Bug#12726).
37
38 * face-remap.el (face-remap-add-relative): Handle the case where a
39 face-remapping-alist entry is a cons cell (Bug#12762).
40
412012-10-29 Kevin Ryde <user42@zip.com.au>
42
43 * woman.el (woman-parse-numeric-value): Handle picas correctly
44 (Bug#12639).
45
462012-10-29 Glenn Morris <rgm@gnu.org>
47
48 * emacs-lisp/cl.el (defsetf): Doc fix.
49
502012-10-29 Stefan Monnier <monnier@iro.umontreal.ca>
51
52 * progmodes/sh-script.el (sh-font-lock-paren): Also put punctuation
53 syntax to the matching opener, if any (bug#12547).
54 (sh-smie-sh-forward-token, sh-smie-sh-backward-token): Recognize this
55 matching open as a "case-(".
56 (sh-smie-rc-grammar): Add a corresponding rule for it.
57
582012-10-28 Daniel Hackney <dan@haxney.org>
59
60 * emacs-lisp/package.el (package-generate-autoloads): Kill buffer
61 "PKGNAME-autoloads.el" in case we created it.
62
632012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
64
65 * minibuffer.el (completion--sifn-requote): Rewrite to handle things
66 like Tramp's "/foo:~bar//baz" -> "/scpc:foo:/baz" mapping (bug#11714).
67 (completion--twq-all): Disable too-strict assertions.
68
69 * tmm.el (tmm-prompt): Use map-keymap (bug#12744).
70
712012-10-27 Eli Zaretskii <eliz@gnu.org>
72
73 * profiler.el (profiler-report-make-entry-part): Fix help-echo
74 text to match the real keybindings.
75
762012-10-27 Juri Linkov <juri@jurta.org>
77
78 * wdired.el (wdired-keep-marker-rename): New defcustom.
79 (wdired-do-renames): Use it instead of `dired-keep-marker-rename'.
80 (Bug#11795)
81
82 * dired.el (dired-keep-marker-rename): Add reference to
83 `wdired-keep-marker-rename' in the docstring.
84 Add default character value ?R to display initially in
85 Customization UI instead of ?@.
86
872012-10-27 Martin Rudalics <rudalics@gmx.at>
88
89 * window.el (display-buffer): In doc-string describe
90 window-height and window-width alist entries.
91
92 * time.el (display-time-world): Restore fit-window-to-buffer
93 behavior.
94
952012-10-27 Chong Yidong <cyd@gnu.org>
96
97 * subr.el (insert-buffer-substring-as-yank): Doc fix.
98
992012-10-26 Jambunathan K <kjambunathan@gmail.com>
100
101 * minibuffer.el (completion-category-overrides): New completion
102 category `bookmark' (bug#11131).
103
1042012-10-26 Stefan Monnier <monnier@iro.umontreal.ca>
105
106 * emacs-lisp/advice.el (ad-assemble-advised-definition):
107 Silence bogus compiler warnings for ad-do-it.
108
109 * bookmark.el (bookmark-completing-read): Set the completion category
110 to `bookmark' (bug#11131).
111
1122012-10-26 Bastien <bzg@altern.org>
113 Stefan Monnier <monnier@iro.umontreal.ca>
114
115 * face-remap.el: Use lexical-binding.
116 (text-scale-adjust): Improve docstring. Use itself for the temporary
117 overlay-map bindings, so as to repeat the "Use..." message each time.
118
1192012-10-26 Stefan Monnier <monnier@iro.umontreal.ca>
120
121 * emacs-lisp/macroexp.el (macroexp--expand-all):
122 Obey byte-compile-warning-enabled-p (bug#12486).
123
124 * vc/diff-mode.el (diff-end-of-hunk): Also skip potential "no LF at eol".
125 (diff-refine-hunk): Similarly, handle the "no LF at eol" (bug#12584).
126
1272012-10-26 Martin Rudalics <rudalics@gmx.at>
128
129 * mouse.el (mouse-drag-line): Move last form into preceding when
130 clause (Bug#12731).
131
132 * help.el (resize-temp-buffer-window): Fix doc-string.
133
1342012-10-25 David Engster <deng@randomsample.de>
135
136 * emacs-lisp/eieio.el (eieio-update-lisp-imenu-expression):
137 Remove. This feature is already integrated in imenu.
138
139 * emacs-lisp/eieio-opt.el: Remove require for `button' since it is
140 always loaded. Require `speedbar' unconditionally.
141
1422012-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
143
144 * dired.el (dired-get-marked-files): Allow ! on . and .. (bug#12725).
145
146 * minibuffer.el (minibuffer-force-complete): Fix thinko.
147
148 * net/ldap.el (ldap-search-internal): The official ldif format starts
149 with a "version: 1" header (bug#12724).
150
151 * emacs-lisp/package.el (package-installed-p): Warn if not ready
152 (bug#12721).
153
1542012-10-25 Glenn Morris <rgm@gnu.org>
155
156 * emacs-lisp/cl-macs.el (cl-progv): Doc fix.
157
1582012-10-24 Stefan Monnier <monnier@iro.umontreal.ca>
159
160 * minibuffer.el (minibuffer-force-complete): Use one more marker
161 for the temporary-overlay-map command (bug#12619).
162
1632012-10-24 Chong Yidong <cyd@gnu.org>
164
165 * time.el (display-time-world-mode): Derive from special-mode.
166 (display-time-world): Use display-buffer (Bug#12708).
167 (display-time-world-mode-map): Variable deleted.
168 (display-time-world-display): Wrap the final delete-char inside
169 inhibit-read-only.
170
1712012-10-24 Chong Yidong <cyd@gnu.org>
172
173 * dired.el (dired-mark, dired-unmark, dired-flag-file-deletion):
174 Doc fix.
175
176 * emacs-lisp/easymenu.el (easy-menu-define): Doc fix (Bug#12628).
177
1782012-10-24 Stefan Monnier <monnier@iro.umontreal.ca>
179
180 * minibuffer.el (completion--all-sorted-completions-location): New var.
181 (completion--cache-all-sorted-completions)
182 (completion--flush-all-sorted-completions): Use it.
183 (completion-in-region, completion-in-region--postch)
184 (completion-at-point, completion-help-at-point): Use markers in
185 completion-in-region--data (bug#12619).
186
1872012-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
188
189 * progmodes/compile.el (compilation-start): Try to handle common
190 quoting of `cd' argument (bug#12640).
191
192 * vc/diff-mode.el (diff-hunk): `save-excursion' while refining
193 (bug#12671).
194
1952012-10-23 Glenn Morris <rgm@gnu.org>
196
197 * progmodes/gud.el (gud-menu-map):
198 Check gdb-active-process is bound. (Bug#12358)
199
12012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> 2002012-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
2 201
202 * repeat.el (repeat): Set real-this-command (bug#12232).
203
3 * htmlfontify.el (hfy-post-html-hook): 204 * htmlfontify.el (hfy-post-html-hook):
4 * filesets.el (filesets-cache-fill-content-hook): 205 * filesets.el (filesets-cache-fill-content-hook):
5 * arc-mode.el (archive-extract-hook): 206 * arc-mode.el (archive-extract-hook):
@@ -146,7 +347,7 @@
146 Recover input meta mode when the new coding system doesn not use 8-bit. 347 Recover input meta mode when the new coding system doesn not use 8-bit.
147 Supply TERMINAL arg to set-input-meta-mode. 348 Supply TERMINAL arg to set-input-meta-mode.
148 349
1492012-10-17 Michael Heerdegen <michael_heerdegen@web.de> (tiny change) 3502012-10-17 Michael Heerdegen <michael_heerdegen@web.de>
150 351
151 * wdired.el (wdired-old-marks): New variable. 352 * wdired.el (wdired-old-marks): New variable.
152 (wdired-change-to-wdired-mode): Locally set wdired-old-marks. 353 (wdired-change-to-wdired-mode): Locally set wdired-old-marks.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 838e5a5ec00..78ca6f22c8e 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -433,7 +433,11 @@ the empty string."
433 ": "))) 433 ": ")))
434 (str 434 (str
435 (completing-read prompt 435 (completing-read prompt
436 bookmark-alist 436 (lambda (string pred action)
437 (if (eq action 'metadata)
438 '(metadata (category . bookmark))
439 (complete-with-action
440 action bookmark-alist string pred)))
437 nil 441 nil
438 0 442 0
439 nil 443 nil
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 7656248cac5..6f2669e9fee 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,36 @@
12012-10-25 David Engster <deng@randomsample.de>
2
3 * semantic/analyze.el (semantic-analyze-dereference-alias): New
4 function to dereference aliases.
5 (semantic-analyze-current-context-default): Use it.
6
7 * semantic/grammar.el (semantic-grammar-create-package):
8 * srecode/compile.el (srecode-compile-templates): Throw a proper
9 error if semantic-mode is not enabled (bug#9968).
10
11 Compiler warning fixes:
12
13 * semantic.el (semantic-elapsed-time): Make it a defsubst.
14
15 * srecode/dictionary.el (srecode-adebug-dictionary): Remove
16 require for `semantic'.
17
18 * srecode/map.el:
19 * srecode/insert.el: Declare functions from `data-debug'.
20
21 * semantic/grammar.el: Require `help-fns'. Declare functions from
22 `eldoc', which is required in function body.
23
24 * srecode/java.el:
25 * semantic/texi.el:
26 * semantic/grammar-wy.el:
27 * semantic/db-file.el:
28 * semantic/db-el.el:
29 * semantic/chart.el: Fix requires.
30
31 * ede/locate.el: Remove useless requires. Declare functions
32 instead and require in functions when needed.
33
12012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> 342012-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
2 35
3 * semantic/db-file.el (semanticdb-save-database-functions): 36 * semantic/db-file.el (semanticdb-save-database-functions):
diff --git a/lisp/cedet/ede/locate.el b/lisp/cedet/ede/locate.el
index c008f5fb945..03227907af4 100644
--- a/lisp/cedet/ede/locate.el
+++ b/lisp/cedet/ede/locate.el
@@ -49,13 +49,7 @@
49;; when it is available. 49;; when it is available.
50 50
51(require 'ede) 51(require 'ede)
52(eval-when-compile (require 'data-debug) 52(eval-when-compile (require 'locate))
53 (require 'eieio-datadebug)
54 (require 'cedet-global)
55 (require 'cedet-idutils)
56 (require 'cedet-cscope))
57
58(require 'locate)
59 53
60;;; Code: 54;;; Code:
61(defcustom ede-locate-setup-options 55(defcustom ede-locate-setup-options
@@ -214,6 +208,12 @@ that created this EDE locate object."
214 208
215;;; GLOBAL 209;;; GLOBAL
216;; 210;;
211
212(declare-function cedet-gnu-global-version-check "cedet-global")
213(declare-function cedet-gnu-global-root "cedet-global")
214(declare-function cedet-gnu-global-expand-filename "cedet-global")
215(declare-function cedet-gnu-global-create/update-database "cedet-global")
216
217(defclass ede-locate-global (ede-locate-base) 217(defclass ede-locate-global (ede-locate-base)
218 () 218 ()
219 "EDE Locator using GNU Global. 219 "EDE Locator using GNU Global.
@@ -260,6 +260,12 @@ that created this EDE locate object."
260 260
261;;; IDUTILS 261;;; IDUTILS
262;; 262;;
263
264(declare-function cedet-idutils-version-check "cedet-idutils")
265(declare-function cedet-idutils-support-for-directory "cedet-idutils")
266(declare-function cedet-idutils-expand-filename "cedet-idutils")
267(declare-function cedet-idutils-create/update-database "cedet-idutils")
268
263(defclass ede-locate-idutils (ede-locate-base) 269(defclass ede-locate-idutils (ede-locate-base)
264 () 270 ()
265 "EDE Locator using IDUtils. 271 "EDE Locator using IDUtils.
@@ -303,6 +309,12 @@ that created this EDE locate object."
303 309
304;;; CSCOPE 310;;; CSCOPE
305;; 311;;
312
313(declare-function cedet-cscope-version-check "cedet-scope")
314(declare-function cedet-cscope-support-for-directory "cedet-scope")
315(declare-function cedet-cscope-expand-filename "cedet-cscope")
316(declare-function cedet-cscope-create/update-database "cedet-cscope")
317
306(defclass ede-locate-cscope (ede-locate-base) 318(defclass ede-locate-cscope (ede-locate-base)
307 () 319 ()
308 "EDE Locator using Cscope. 320 "EDE Locator using Cscope.
@@ -315,6 +327,7 @@ file name searching variable `cedet-cscope-file-command'.")
315 ;; Get ourselves initialized. 327 ;; Get ourselves initialized.
316 (call-next-method) 328 (call-next-method)
317 ;; Do the checks. 329 ;; Do the checks.
330 (require 'cedet-cscope)
318 (cedet-cscope-version-check) 331 (cedet-cscope-version-check)
319 (when (not (cedet-cscope-support-for-directory (oref loc root))) 332 (when (not (cedet-cscope-support-for-directory (oref loc root)))
320 (error "Cannot use Cscope in %s" 333 (error "Cannot use Cscope in %s"
@@ -324,6 +337,7 @@ file name searching variable `cedet-cscope-file-command'.")
324(defmethod ede-locate-ok-in-project :static ((loc ede-locate-cscope) 337(defmethod ede-locate-ok-in-project :static ((loc ede-locate-cscope)
325 root) 338 root)
326 "Is it ok to use this project type under ROOT." 339 "Is it ok to use this project type under ROOT."
340 (require 'cedet-cscope)
327 (cedet-cscope-version-check) 341 (cedet-cscope-version-check)
328 (when (cedet-cscope-support-for-directory root) 342 (when (cedet-cscope-support-for-directory root)
329 root)) 343 root))
@@ -334,11 +348,13 @@ file name searching variable `cedet-cscope-file-command'.")
334Searches are done under the current root of the EDE project 348Searches are done under the current root of the EDE project
335that created this EDE locate object." 349that created this EDE locate object."
336 (let ((default-directory (oref loc root))) 350 (let ((default-directory (oref loc root)))
351 (require 'cedet-cscope)
337 (cedet-cscope-expand-filename filesubstring))) 352 (cedet-cscope-expand-filename filesubstring)))
338 353
339(defmethod ede-locate-create/update-root-database :STATIC 354(defmethod ede-locate-create/update-root-database :STATIC
340 ((loc ede-locate-cscope) root) 355 ((loc ede-locate-cscope) root)
341 "Create or update the GNU Global database for the current project." 356 "Create or update the GNU Global database for the current project."
357 (require 'cedet-cscope)
342 (cedet-cscope-create/update-database root)) 358 (cedet-cscope-create/update-database root))
343 359
344(provide 'ede/locate) 360(provide 'ede/locate)
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index 373864a43d5..01d3206f662 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -382,7 +382,7 @@ to use Semantic, and `semantic-init-hook' is run."
382 "When non-nil, activate the interactive parsing debugger. 382 "When non-nil, activate the interactive parsing debugger.
383Do not set this yourself. Call `semantic-debug'.") 383Do not set this yourself. Call `semantic-debug'.")
384 384
385(defun semantic-elapsed-time (start end) 385(defsubst semantic-elapsed-time (start end)
386 "Copied from elp.el. Was `elp-elapsed-time'. 386 "Copied from elp.el. Was `elp-elapsed-time'.
387Arguments START and END bound the time being calculated." 387Arguments START and END bound the time being calculated."
388 (float-time (time-subtract end start))) 388 (float-time (time-subtract end start)))
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el
index 63acc555343..d03c72a5983 100644
--- a/lisp/cedet/semantic/analyze.el
+++ b/lisp/cedet/semantic/analyze.el
@@ -527,7 +527,7 @@ Returns an object based on symbol `semantic-analyze-context'."
527 (function nil) 527 (function nil)
528 (fntag nil) 528 (fntag nil)
529 arg fntagend argtag 529 arg fntagend argtag
530 assign asstag 530 assign asstag newseq
531 ) 531 )
532 532
533 ;; Pattern for Analysis: 533 ;; Pattern for Analysis:
@@ -601,16 +601,26 @@ Returns an object based on symbol `semantic-analyze-context'."
601 601
602 (if debug-on-error 602 (if debug-on-error
603 (catch 'unfindable 603 (catch 'unfindable
604 ;; If debug on error is on, allow debugging in this fcn.
605 (setq prefix (semantic-analyze-find-tag-sequence 604 (setq prefix (semantic-analyze-find-tag-sequence
606 prefix scope 'prefixtypes 'unfindable))) 605 prefix scope 'prefixtypes 'unfindable))
606 ;; If there's an alias, dereference it and analyze
607 ;; sequence again.
608 (when (setq newseq
609 (semantic-analyze-dereference-alias prefix))
610 (setq prefix (semantic-analyze-find-tag-sequence
611 newseq scope 'prefixtypes 'unfindable))))
607 ;; Debug on error is off. Capture errors and move on 612 ;; Debug on error is off. Capture errors and move on
608 (condition-case err 613 (condition-case err
609 ;; NOTE: This line is duplicated in 614 ;; NOTE: This line is duplicated in
610 ;; semantic-analyzer-debug-global-symbol 615 ;; semantic-analyzer-debug-global-symbol
611 ;; You will need to update both places. 616 ;; You will need to update both places.
612 (setq prefix (semantic-analyze-find-tag-sequence 617 (progn
613 prefix scope 'prefixtypes)) 618 (setq prefix (semantic-analyze-find-tag-sequence
619 prefix scope 'prefixtypes))
620 (when (setq newseq
621 (semantic-analyze-dereference-alias prefix))
622 (setq prefix (semantic-analyze-find-tag-sequence
623 newseq scope 'prefixtypes))))
614 (error (semantic-analyze-push-error err)))) 624 (error (semantic-analyze-push-error err))))
615 ) 625 )
616 626
@@ -679,6 +689,20 @@ Returns an object based on symbol `semantic-analyze-context'."
679 ;; Return our context. 689 ;; Return our context.
680 context-return)) 690 context-return))
681 691
692(defun semantic-analyze-dereference-alias (taglist)
693 "Dereference first tag in TAGLIST if it is an alias.
694Returns a sequence of names which can then be fed again into
695`semantic-analyze-find-tag-sequence'.
696Returns nil if no alias was found."
697 (when (eq (semantic-tag-get-attribute (car taglist) :kind) 'alias)
698 (let ((tagname
699 (semantic-analyze-split-name
700 (semantic-tag-name
701 (car (semantic-tag-get-attribute (car taglist) :members))))))
702 (append (if (listp tagname)
703 tagname
704 (list tagname))
705 (cdr taglist)))))
682 706
683(defun semantic-adebug-analyze (&optional ctxt) 707(defun semantic-adebug-analyze (&optional ctxt)
684 "Perform `semantic-analyze-current-context'. 708 "Perform `semantic-analyze-current-context'.
diff --git a/lisp/cedet/semantic/chart.el b/lisp/cedet/semantic/chart.el
index c6b13475862..2c6f7344acf 100644
--- a/lisp/cedet/semantic/chart.el
+++ b/lisp/cedet/semantic/chart.el
@@ -26,12 +26,9 @@
26;; the output of the semantic parser. 26;; the output of the semantic parser.
27;; 27;;
28 28
29(require 'semantic)
30(require 'chart) 29(require 'chart)
31(require 'semantic/db) 30(require 'semantic/db)
32(require 'semantic/tag) 31(require 'semantic/find)
33
34(eval-when-compile (require 'semantic/find))
35 32
36;;; Code: 33;;; Code:
37 34
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el
index 281479045ea..dbb3bfae34d 100644
--- a/lisp/cedet/semantic/db-el.el
+++ b/lisp/cedet/semantic/db-el.el
@@ -31,12 +31,7 @@
31;; 31;;
32 32
33(require 'semantic/db) 33(require 'semantic/db)
34 34(require 'eieio-opt)
35(eval-when-compile
36 ;; For generic function searching.
37 (require 'eieio)
38 (require 'eieio-opt)
39 (require 'eieio-base))
40 35
41(declare-function semantic-elisp-desymbolify "semantic/bovine/el") 36(declare-function semantic-elisp-desymbolify "semantic/bovine/el")
42(declare-function semantic-tag-similar-p "semantic/tag-ls") 37(declare-function semantic-tag-similar-p "semantic/tag-ls")
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el
index 4f8e93dc391..905c62a89dd 100644
--- a/lisp/cedet/semantic/db-file.el
+++ b/lisp/cedet/semantic/db-file.el
@@ -25,12 +25,9 @@
25;; A set of semanticdb classes for persistently saving caches on disk. 25;; A set of semanticdb classes for persistently saving caches on disk.
26;; 26;;
27 27
28(require 'semantic)
29(require 'semantic/db) 28(require 'semantic/db)
30(require 'cedet-files) 29(require 'cedet-files)
31 30(require 'data-debug)
32(eval-when-compile
33 (require 'data-debug))
34 31
35(defvar semanticdb-file-version semantic-version 32(defvar semanticdb-file-version semantic-version
36 "Version of semanticdb we are writing files to disk with.") 33 "Version of semanticdb we are writing files to disk with.")
diff --git a/lisp/cedet/semantic/grammar-wy.el b/lisp/cedet/semantic/grammar-wy.el
index 8a33c8c8a1a..a926f636b4b 100644
--- a/lisp/cedet/semantic/grammar-wy.el
+++ b/lisp/cedet/semantic/grammar-wy.el
@@ -23,9 +23,8 @@
23 23
24;;; Code: 24;;; Code:
25 25
26(require 'semantic/lex) 26(require 'semantic)
27(eval-when-compile (require 'semantic/bovine)) 27
28
29;;; Prologue 28;;; Prologue
30;; 29;;
31(defvar semantic-grammar-lex-c-char-re) 30(defvar semantic-grammar-lex-c-char-re)
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index b85396a79ae..c0e7b8f9038 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -35,6 +35,7 @@
35(require 'semantic/format) 35(require 'semantic/format)
36(require 'semantic/grammar-wy) 36(require 'semantic/grammar-wy)
37(require 'semantic/idle) 37(require 'semantic/idle)
38(require 'help-fns)
38 39
39(declare-function semantic-momentary-highlight-tag "semantic/decorate") 40(declare-function semantic-momentary-highlight-tag "semantic/decorate")
40(declare-function semantic-analyze-context "semantic/analyze") 41(declare-function semantic-analyze-context "semantic/analyze")
@@ -47,6 +48,9 @@
47 (require 'semantic/find) 48 (require 'semantic/find)
48 (require 'semantic/db)) 49 (require 'semantic/db))
49 50
51(declare-function semantic-grammar-wy--install-parser
52 "semantic/gram-wy-fallback")
53
50 54
51;;;; 55;;;;
52;;;; Set up lexer 56;;;; Set up lexer
@@ -825,6 +829,8 @@ Does nothing if the Lisp code seems up to date.
825If optional argument FORCE is non-nil, unconditionally re-generate the 829If optional argument FORCE is non-nil, unconditionally re-generate the
826Lisp code." 830Lisp code."
827 (interactive "P") 831 (interactive "P")
832 (unless (semantic-active-p)
833 (error "You have to activate semantic-mode to create a package."))
828 (setq force (or force current-prefix-arg)) 834 (setq force (or force current-prefix-arg))
829 (semantic-fetch-tags) 835 (semantic-fetch-tags)
830 (let* ( 836 (let* (
@@ -1636,6 +1642,12 @@ Select the buffer containing the tag's definition, and move point there."
1636 ) 1642 )
1637 "Association of syntax elements, and the corresponding help.") 1643 "Association of syntax elements, and the corresponding help.")
1638 1644
1645(declare-function eldoc-function-argstring "eldoc")
1646(declare-function eldoc-docstring-format-sym-doc "eldoc")
1647(declare-function eldoc-last-data-store "eldoc")
1648(declare-function eldoc-get-fnsym-args-string "eldoc")
1649(declare-function eldoc-get-var-docstring "eldoc")
1650
1639(defun semantic-grammar-eldoc-get-macro-docstring (macro expander) 1651(defun semantic-grammar-eldoc-get-macro-docstring (macro expander)
1640 "Return a one-line docstring for the given grammar MACRO. 1652 "Return a one-line docstring for the given grammar MACRO.
1641EXPANDER is the name of the function that expands MACRO." 1653EXPANDER is the name of the function that expands MACRO."
diff --git a/lisp/cedet/semantic/texi.el b/lisp/cedet/semantic/texi.el
index 9380940282f..d79e71bb265 100644
--- a/lisp/cedet/semantic/texi.el
+++ b/lisp/cedet/semantic/texi.el
@@ -26,17 +26,11 @@
26;; parser plug-in is the function `semantic-texi-parse-region' that 26;; parser plug-in is the function `semantic-texi-parse-region' that
27;; overrides `semantic-parse-region'. 27;; overrides `semantic-parse-region'.
28 28
29(require 'semantic) 29(require 'semantic/db-find)
30(require 'semantic/format) 30(require 'semantic/format)
31(require 'semantic/ctxt)
31(require 'texinfo) 32(require 'texinfo)
32 33
33(eval-when-compile
34 (require 'semantic/db)
35 (require 'semantic/db-find)
36 (require 'semantic/ctxt)
37 (require 'semantic/find)
38 (require 'semantic/doc))
39
40(defvar ede-minor-mode) 34(defvar ede-minor-mode)
41(declare-function lookup-words "ispell") 35(declare-function lookup-words "ispell")
42(declare-function ede-current-project "ede") 36(declare-function ede-current-project "ede")
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el
index 8a1291f8d72..8457e35abe5 100644
--- a/lisp/cedet/srecode/compile.el
+++ b/lisp/cedet/srecode/compile.el
@@ -199,6 +199,8 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
199(defun srecode-compile-templates () 199(defun srecode-compile-templates ()
200 "Compile a semantic recode template file into a mode-local variable." 200 "Compile a semantic recode template file into a mode-local variable."
201 (interactive) 201 (interactive)
202 (unless (semantic-active-p)
203 (error "You have to activate semantic-mode to compile SRecode templates."))
202 (require 'srecode/insert) 204 (require 'srecode/insert)
203 (message "Compiling template %s..." 205 (message "Compiling template %s..."
204 (file-name-nondirectory (buffer-file-name))) 206 (file-name-nondirectory (buffer-file-name)))
diff --git a/lisp/cedet/srecode/dictionary.el b/lisp/cedet/srecode/dictionary.el
index 6262383c397..2b6bbb51eaa 100644
--- a/lisp/cedet/srecode/dictionary.el
+++ b/lisp/cedet/srecode/dictionary.el
@@ -604,7 +604,6 @@ STATE is the current compiler state."
604 "Run data-debug on this mode's dictionary." 604 "Run data-debug on this mode's dictionary."
605 (interactive) 605 (interactive)
606 (require 'eieio-datadebug) 606 (require 'eieio-datadebug)
607 (require 'semantic)
608 (require 'srecode/find) 607 (require 'srecode/find)
609 (let* ((modesym major-mode) 608 (let* ((modesym major-mode)
610 (start (current-time)) 609 (start (current-time))
diff --git a/lisp/cedet/srecode/insert.el b/lisp/cedet/srecode/insert.el
index 726aa41cffd..f099c0ca6eb 100644
--- a/lisp/cedet/srecode/insert.el
+++ b/lisp/cedet/srecode/insert.el
@@ -195,6 +195,10 @@ Buffer based features related to change hooks is handled one level up."
195 ;; area. Return value is not important. 195 ;; area. Return value is not important.
196 )) 196 ))
197 197
198(declare-function data-debug-new-buffer "data-debug")
199(declare-function data-debug-insert-stuff-list "data-debug")
200(declare-function data-debug-insert-thing dictionary "data-debug")
201
198(defun srecode-insert-show-error-report (dictionary format &rest args) 202(defun srecode-insert-show-error-report (dictionary format &rest args)
199 "Display an error report based on DICTIONARY, FORMAT and ARGS. 203 "Display an error report based on DICTIONARY, FORMAT and ARGS.
200This is intended to diagnose problems with failed template 204This is intended to diagnose problems with failed template
diff --git a/lisp/cedet/srecode/java.el b/lisp/cedet/srecode/java.el
index 3635a39d383..43e9273da76 100644
--- a/lisp/cedet/srecode/java.el
+++ b/lisp/cedet/srecode/java.el
@@ -26,10 +26,7 @@
26;;; Code: 26;;; Code:
27 27
28(require 'srecode/dictionary) 28(require 'srecode/dictionary)
29(require 'semantic/tag) 29(require 'semantic/find)
30
31(eval-when-compile
32 (require 'semantic/find))
33 30
34;;;###autoload 31;;;###autoload
35(defun srecode-semantic-handle-:java (dict) 32(defun srecode-semantic-handle-:java (dict)
diff --git a/lisp/cedet/srecode/map.el b/lisp/cedet/srecode/map.el
index d6613ee1b02..7fb5c16a1f3 100644
--- a/lisp/cedet/srecode/map.el
+++ b/lisp/cedet/srecode/map.el
@@ -215,7 +215,8 @@ Optional argument RESET forces a reset of the current map."
215 ;; Eventually, I want to return many maps to search through. 215 ;; Eventually, I want to return many maps to search through.
216 (list srecode-current-map))) 216 (list srecode-current-map)))
217 217
218(eval-when-compile (require 'data-debug)) 218(declare-function data-debug-new-buffer "data-debug")
219(declare-function data-debug-insert-stuff-list "data-debug")
219 220
220(defun srecode-adebug-maps () 221(defun srecode-adebug-maps ()
221 "Run ADEBUG on the output of `srecode-get-maps'." 222 "Run ADEBUG on the output of `srecode-get-maps'."
diff --git a/lisp/dired.el b/lisp/dired.el
index a4bc16caebf..5f7ee48a810 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -137,9 +137,12 @@ A value of t means move to first file."
137 "Controls marking of renamed files. 137 "Controls marking of renamed files.
138If t, files keep their previous marks when they are renamed. 138If t, files keep their previous marks when they are renamed.
139If a character, renamed files (whether previously marked or not) 139If a character, renamed files (whether previously marked or not)
140are afterward marked with that character." 140are afterward marked with that character.
141This option affects only files renamed by `dired-do-rename' and
142`dired-do-rename-regexp'. See `wdired-keep-marker-rename'
143if you want to do the same for files renamed in WDired mode."
141 :type '(choice (const :tag "Keep" t) 144 :type '(choice (const :tag "Keep" t)
142 (character :tag "Mark")) 145 (character :tag "Mark" :value ?R))
143 :group 'dired-mark) 146 :group 'dired-mark)
144 147
145(defcustom dired-keep-marker-copy ?C 148(defcustom dired-keep-marker-copy ?C
@@ -620,7 +623,7 @@ Don't use that together with FILTER."
620 (let* ((all-of-them 623 (let* ((all-of-them
621 (save-excursion 624 (save-excursion
622 (dired-map-over-marks 625 (dired-map-over-marks
623 (dired-get-filename localp) 626 (dired-get-filename localp 'no-error-if-not-filep)
624 arg nil distinguish-one-marked))) 627 arg nil distinguish-one-marked)))
625 result) 628 result)
626 (if (not filter) 629 (if (not filter)
@@ -3107,10 +3110,11 @@ argument or confirmation)."
3107 (forward-line 1)))) 3110 (forward-line 1))))
3108 3111
3109(defun dired-mark (arg) 3112(defun dired-mark (arg)
3110 "Mark the current (or next ARG) files. 3113 "Mark the file at point in the Dired buffer.
3114If the region is active, mark all files in the region.
3115Otherwise, with a prefix arg, mark files on the next ARG lines.
3116
3111If on a subdir headerline, mark all its files except `.' and `..'. 3117If on a subdir headerline, mark all its files except `.' and `..'.
3112If the region is active in Transient Mark mode, mark all files
3113in the active region.
3114 3118
3115Use \\[dired-unmark-all-files] to remove all marks 3119Use \\[dired-unmark-all-files] to remove all marks
3116and \\[dired-unmark] on a subdir to remove the marks in 3120and \\[dired-unmark] on a subdir to remove the marks in
@@ -3136,7 +3140,10 @@ this subdir."
3136 (function (lambda () (delete-char 1) (insert dired-marker-char)))))))) 3140 (function (lambda () (delete-char 1) (insert dired-marker-char))))))))
3137 3141
3138(defun dired-unmark (arg) 3142(defun dired-unmark (arg)
3139 "Unmark the current (or next ARG) files. 3143 "Unmark the file at point in the Dired buffer.
3144If the region is active, unmark all files in the region.
3145Otherwise, with a prefix arg, unmark files on the next ARG lines.
3146
3140If looking at a subdir, unmark all its files except `.' and `..'. 3147If looking at a subdir, unmark all its files except `.' and `..'.
3141If the region is active in Transient Mark mode, unmark all files 3148If the region is active in Transient Mark mode, unmark all files
3142in the active region." 3149in the active region."
@@ -3146,7 +3153,9 @@ in the active region."
3146 3153
3147(defun dired-flag-file-deletion (arg) 3154(defun dired-flag-file-deletion (arg)
3148 "In Dired, flag the current line's file for deletion. 3155 "In Dired, flag the current line's file for deletion.
3149With prefix arg, repeat over several lines. 3156If the region is active, flag all files in the region.
3157Otherwise, with a prefix arg, flag files on the next ARG lines.
3158
3150If on a subdir headerline, flag all its files except `.' and `..'. 3159If on a subdir headerline, flag all its files except `.' and `..'.
3151If the region is active in Transient Mark mode, flag all files 3160If the region is active in Transient Mark mode, flag all files
3152in the active region." 3161in the active region."
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 007871aa3a6..bd85238e23e 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2897,8 +2897,11 @@ definition, INTERACTIVE if non-nil is the interactive form to be used,
2897ORIG is a form that calls the body of the original unadvised function, 2897ORIG is a form that calls the body of the original unadvised function,
2898and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG 2898and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG
2899should be modified. The assembled function will be returned." 2899should be modified. The assembled function will be returned."
2900 2900 ;; The ad-do-it call should always have the right number of arguments,
2901 (let (before-forms around-form around-form-protected after-forms definition) 2901 ;; but the compiler might signal a bogus warning because it checks the call
2902 ;; against the advertised calling convention.
2903 (let ((around-form `(setq ad-return-value (with-no-warnings ,orig)))
2904 before-forms around-form-protected after-forms definition)
2902 (dolist (advice befores) 2905 (dolist (advice befores)
2903 (cond ((and (ad-advice-protected advice) 2906 (cond ((and (ad-advice-protected advice)
2904 before-forms) 2907 before-forms)
@@ -2911,7 +2914,6 @@ should be modified. The assembled function will be returned."
2911 (append before-forms 2914 (append before-forms
2912 (ad-body-forms (ad-advice-definition advice))))))) 2915 (ad-body-forms (ad-advice-definition advice)))))))
2913 2916
2914 (setq around-form `(setq ad-return-value ,orig))
2915 (dolist (advice (reverse arounds)) 2917 (dolist (advice (reverse arounds))
2916 ;; If any of the around advices is protected then we 2918 ;; If any of the around advices is protected then we
2917 ;; protect the complete around advice onion: 2919 ;; protect the complete around advice onion:
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 6250edc8792..ffa42e97221 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -286,7 +286,7 @@ DEFUNINFO is the return value of `checkdoc-defun-info'. ENDPOINT is the
286location of end of the documentation string.") 286location of end of the documentation string.")
287 287
288(define-obsolete-variable-alias 'checkdoc-comment-style-hooks 288(define-obsolete-variable-alias 'checkdoc-comment-style-hooks
289 checkdoc-comment-style-functions "24.3") 289 'checkdoc-comment-style-functions "24.3")
290(defvar checkdoc-comment-style-functions nil 290(defvar checkdoc-comment-style-functions nil
291 "Hook run after the standard comment style check is completed. 291 "Hook run after the standard comment style check is completed.
292Must return nil if no errors are found, or a string describing the 292Must return nil if no errors are found, or a string describing the
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 913ebf2015f..c72e3342648 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -149,8 +149,9 @@ the elements themselves.
149 (setq cl-list (cdr cl-list))) 149 (setq cl-list (cdr cl-list)))
150 (nreverse cl-res)))) 150 (nreverse cl-res))))
151 151
152;;;###autoload
152(defun cl-mapc (cl-func cl-seq &rest cl-rest) 153(defun cl-mapc (cl-func cl-seq &rest cl-rest)
153 "Like `mapcar', but does not accumulate values returned by the function. 154 "Like `cl-mapcar', but does not accumulate values returned by the function.
154\n(fn FUNCTION SEQUENCE...)" 155\n(fn FUNCTION SEQUENCE...)"
155 (if cl-rest 156 (if cl-rest
156 (progn (apply 'cl-map nil cl-func cl-seq cl-rest) 157 (progn (apply 'cl-map nil cl-func cl-seq cl-rest)
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index d05fbc42060..5ad6e37a5a1 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -10,8 +10,8 @@
10;;;;;; cl-truncate cl-ceiling cl-floor cl-isqrt cl-lcm cl-gcd cl--set-frame-visible-p 10;;;;;; cl-truncate cl-ceiling cl-floor cl-isqrt cl-lcm cl-gcd cl--set-frame-visible-p
11;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively 11;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively
12;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan 12;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan
13;;;;;; cl-mapl cl-maplist cl-map cl--mapcar-many cl-equalp cl-coerce) 13;;;;;; cl-mapl cl-mapc cl-maplist cl-map cl--mapcar-many cl-equalp
14;;;;;; "cl-extra" "cl-extra.el" "1572ae52fa4fbd9c4bf89b49a068a865") 14;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "7d7f65d8a05e954a919fe2555b68fb05")
15;;; Generated autoloads from cl-extra.el 15;;; Generated autoloads from cl-extra.el
16 16
17(autoload 'cl-coerce "cl-extra" "\ 17(autoload 'cl-coerce "cl-extra" "\
@@ -46,6 +46,11 @@ the elements themselves.
46 46
47\(fn FUNCTION LIST...)" nil nil) 47\(fn FUNCTION LIST...)" nil nil)
48 48
49(autoload 'cl-mapc "cl-extra" "\
50Like `cl-mapcar', but does not accumulate values returned by the function.
51
52\(fn FUNCTION SEQUENCE...)" nil nil)
53
49(autoload 'cl-mapl "cl-extra" "\ 54(autoload 'cl-mapl "cl-extra" "\
50Like `cl-maplist', but does not accumulate values returned by the function. 55Like `cl-maplist', but does not accumulate values returned by the function.
51 56
@@ -260,7 +265,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value.
260;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when 265;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when
261;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp 266;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp
262;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) 267;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*)
263;;;;;; "cl-macs" "cl-macs.el" "885919e79dbcd11081cfb2e039b470c7") 268;;;;;; "cl-macs" "cl-macs.el" "366e9efa4e3e7a81b2253e503611b23a")
264;;; Generated autoloads from cl-macs.el 269;;; Generated autoloads from cl-macs.el
265 270
266(autoload 'cl--compiler-macro-list* "cl-macs" "\ 271(autoload 'cl--compiler-macro-list* "cl-macs" "\
@@ -485,7 +490,7 @@ before assigning any symbols SYM to the corresponding values.
485Bind SYMBOLS to VALUES dynamically in BODY. 490Bind SYMBOLS to VALUES dynamically in BODY.
486The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. 491The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists.
487Each symbol in the first list is bound to the corresponding value in the 492Each symbol in the first list is bound to the corresponding value in the
488second list (or made unbound if VALUES is shorter than SYMBOLS); then the 493second list (or to nil if VALUES is shorter than SYMBOLS); then the
489BODY forms are executed and their result is returned. This is much like 494BODY forms are executed and their result is returned. This is much like
490a `let' form, except that the list of symbols can be computed at run-time. 495a `let' form, except that the list of symbols can be computed at run-time.
491 496
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 592c33d21c5..a448973c1bb 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1603,7 +1603,7 @@ before assigning any symbols SYM to the corresponding values.
1603 "Bind SYMBOLS to VALUES dynamically in BODY. 1603 "Bind SYMBOLS to VALUES dynamically in BODY.
1604The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. 1604The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists.
1605Each symbol in the first list is bound to the corresponding value in the 1605Each symbol in the first list is bound to the corresponding value in the
1606second list (or made unbound if VALUES is shorter than SYMBOLS); then the 1606second list (or to nil if VALUES is shorter than SYMBOLS); then the
1607BODY forms are executed and their result is returned. This is much like 1607BODY forms are executed and their result is returned. This is much like
1608a `let' form, except that the list of symbols can be computed at run-time." 1608a `let' form, except that the list of symbols can be computed at run-time."
1609 (declare (indent 2) (debug (form form body))) 1609 (declare (indent 2) (debug (form form body)))
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index 34beed0d9ef..d3ef83961e2 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -511,7 +511,10 @@ rather than relying on `lexical-binding'."
511 511
512(defmacro letf (bindings &rest body) 512(defmacro letf (bindings &rest body)
513 "Dynamically scoped let-style bindings for places. 513 "Dynamically scoped let-style bindings for places.
514Like `cl-letf', but with some extra backward compatibility." 514For more details, see `cl-letf'. This macro behaves like that one
515in almost every respect (apart from details that relate to some
516deprecated usage of `symbol-function' in place forms)." ; bug#12760
517 (declare (indent 1) (debug cl-letf))
515 ;; Like cl-letf, but with special handling of symbol-function. 518 ;; Like cl-letf, but with special handling of symbol-function.
516 `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function) 519 `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function)
517 `((cl--symbol-function ,@(cdar x)) ,@(cdr x)) 520 `((cl--symbol-function ,@(cdar x)) ,@(cdr x))
@@ -568,9 +571,9 @@ well for simple place forms. In the simple `defsetf' form, `setf's of
568the form (setf (NAME ARGS...) VAL) are transformed to function or macro 571the form (setf (NAME ARGS...) VAL) are transformed to function or macro
569calls of the form (FUNC ARGS... VAL). Example: 572calls of the form (FUNC ARGS... VAL). Example:
570 573
571 (cl-defsetf aref aset) 574 (defsetf aref aset)
572 575
573Alternate form: (cl-defsetf NAME ARGLIST (STORE) BODY...). 576Alternate form: (defsetf NAME ARGLIST (STORE) BODY...).
574Here, the above `setf' call is expanded by binding the argument forms ARGS 577Here, the above `setf' call is expanded by binding the argument forms ARGS
575according to ARGLIST, binding the value form VAL to STORE, then executing 578according to ARGLIST, binding the value form VAL to STORE, then executing
576BODY, which must return a Lisp form that does the necessary `setf' operation. 579BODY, which must return a Lisp form that does the necessary `setf' operation.
@@ -578,7 +581,7 @@ Actually, ARGLIST and STORE may be bound to temporary variables which are
578introduced automatically to preserve proper execution order of the arguments. 581introduced automatically to preserve proper execution order of the arguments.
579Example: 582Example:
580 583
581 (cl-defsetf nth (n x) (v) `(setcar (nthcdr ,n ,x) ,v)) 584 (defsetf nth (n x) (v) `(setcar (nthcdr ,n ,x) ,v))
582 585
583\(fn NAME [FUNC | ARGLIST (STORE) BODY...])" 586\(fn NAME [FUNC | ARGLIST (STORE) BODY...])"
584 (declare (debug 587 (declare (debug
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 939fab78942..26a1fce2309 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -44,110 +44,101 @@ menus, turn this variable off, otherwise it is probably better to keep it on.")
44 44
45;;;###autoload 45;;;###autoload
46(defmacro easy-menu-define (symbol maps doc menu) 46(defmacro easy-menu-define (symbol maps doc menu)
47 "Define a menu bar submenu in maps MAPS, according to MENU. 47 "Define a pop-up menu and/or menu bar menu specified by MENU.
48If SYMBOL is non-nil, define SYMBOL as a function to pop up the
49submenu defined by MENU, with DOC as its doc string.
48 50
49If SYMBOL is non-nil, store the menu keymap in the value of SYMBOL, 51MAPS, if non-nil, should be a keymap or a list of keymaps; add
50and define SYMBOL as a function to pop up the menu, with DOC as its doc string. 52the submenu defined by MENU to the keymap or each of the keymaps,
51If SYMBOL is nil, just store the menu keymap into MAPS. 53as a top-level menu bar item.
52 54
53The first element of MENU must be a string. It is the menu bar item name. 55The first element of MENU must be a string. It is the menu bar
54It may be followed by the following keyword argument pairs 56item name. It may be followed by the following keyword argument
57pairs:
55 58
56 :filter FUNCTION 59 :filter FUNCTION
60 FUNCTION must be a function which, if called with one
61 argument---the list of the other menu items---returns the
62 items to actually display.
57 63
58FUNCTION is a function with one argument, the rest of menu items. 64 :visible INCLUDE
59It returns the remaining items of the displayed menu. 65 INCLUDE is an expression. The menu is visible if the
66 expression evaluates to a non-nil value. `:included' is an
67 alias for `:visible'.
60 68
61 :visible INCLUDE 69 :active ENABLE
70 ENABLE is an expression. The menu is enabled for selection
71 if the expression evaluates to a non-nil value. `:enable' is
72 an alias for `:active'.
62 73
63INCLUDE is an expression; this menu is only visible if this 74The rest of the elements in MENU are menu items.
64expression has a non-nil value. `:included' is an alias for `:visible'. 75A menu item can be a vector of three elements:
65 76
66 :active ENABLE 77 [NAME CALLBACK ENABLE]
67
68ENABLE is an expression; the menu is enabled for selection whenever
69this expression's value is non-nil. `:enable' is an alias for `:active'.
70
71The rest of the elements in MENU, are menu items.
72
73A menu item is usually a vector of three elements: [NAME CALLBACK ENABLE]
74 78
75NAME is a string--the menu item name. 79NAME is a string--the menu item name.
76 80
77CALLBACK is a command to run when the item is chosen, 81CALLBACK is a command to run when the item is chosen, or an
78or a list to evaluate when the item is chosen. 82expression to evaluate when the item is chosen.
79 83
80ENABLE is an expression; the item is enabled for selection 84ENABLE is an expression; the item is enabled for selection if the
81whenever this expression's value is non-nil. 85expression evaluates to a non-nil value.
82 86
83Alternatively, a menu item may have the form: 87Alternatively, a menu item may have the form:
84 88
85 [ NAME CALLBACK [ KEYWORD ARG ] ... ] 89 [ NAME CALLBACK [ KEYWORD ARG ]... ]
86
87Where KEYWORD is one of the symbols defined below.
88
89 :keys KEYS
90
91KEYS is a string; a complex keyboard equivalent to this menu item.
92This is normally not needed because keyboard equivalents are usually
93computed automatically.
94KEYS is expanded with `substitute-command-keys' before it is used.
95
96 :key-sequence KEYS
97
98KEYS is nil, a string or a vector; nil or a keyboard equivalent to this
99menu item.
100This is a hint that will considerably speed up Emacs's first display of
101a menu. Use `:key-sequence nil' when you know that this menu item has no
102keyboard equivalent.
103
104 :active ENABLE
105
106ENABLE is an expression; the item is enabled for selection whenever
107this expression's value is non-nil. `:enable' is an alias for `:active'.
108
109 :visible INCLUDE
110
111INCLUDE is an expression; this item is only visible if this
112expression has a non-nil value. `:included' is an alias for `:visible'.
113
114 :label FORM
115 90
116FORM is an expression that will be dynamically evaluated and whose 91where NAME and CALLBACK have the same meanings as above, and each
117value will be used for the menu entry's text label (the default is NAME). 92optional KEYWORD and ARG pair should be one of the following:
118 93
119 :suffix FORM 94 :keys KEYS
95 KEYS is a string; a keyboard equivalent to the menu item.
96 This is normally not needed because keyboard equivalents are
97 usually computed automatically. KEYS is expanded with
98 `substitute-command-keys' before it is used.
120 99
121FORM is an expression that will be dynamically evaluated and whose 100 :key-sequence KEYS
122value will be concatenated to the menu entry's label. 101 KEYS is a hint for speeding up Emacs's first display of the
102 menu. It should be nil if you know that the menu item has no
103 keyboard equivalent; otherwise it should be a string or
104 vector specifying a keyboard equivalent for the menu item.
123 105
124 :style STYLE 106 :active ENABLE
107 ENABLE is an expression; the item is enabled for selection
108 whenever this expression's value is non-nil. `:enable' is an
109 alias for `:active'.
125 110
126STYLE is a symbol describing the type of menu item. The following are 111 :visible INCLUDE
127defined: 112 INCLUDE is an expression; this item is only visible if this
113 expression has a non-nil value. `:included' is an alias for
114 `:visible'.
128 115
129toggle: A checkbox. 116 :label FORM
130 Prepend the name with `(*) ' or `( ) ' depending on if selected or not. 117 FORM is an expression that is dynamically evaluated and whose
131radio: A radio button. 118 value serves as the menu item's label (the default is NAME).
132 Prepend the name with `[X] ' or `[ ] ' depending on if selected or not.
133button: Surround the name with `[' and `]'. Use this for an item in the
134 menu bar itself.
135anything else means an ordinary menu item.
136 119
137 :selected SELECTED 120 :suffix FORM
121 FORM is an expression that is dynamically evaluated and whose
122 value is concatenated with the menu entry's label.
138 123
139SELECTED is an expression; the checkbox or radio button is selected 124 :style STYLE
140whenever this expression's value is non-nil. 125 STYLE is a symbol describing the type of menu item; it should
126 be `toggle' (a checkbox), or `radio' (a radio button), or any
127 other value (meaning an ordinary menu item).
141 128
142 :help HELP 129 :selected SELECTED
130 SELECTED is an expression; the checkbox or radio button is
131 selected whenever the expression's value is non-nil.
143 132
144HELP is a string, the help to display for the menu item. 133 :help HELP
134 HELP is a string, the help to display for the menu item.
145 135
146A menu item can be a string. Then that string appears in the menu as 136Alternatively, a menu item can be a string. Then that string
147unselectable text. A string consisting solely of hyphens is displayed 137appears in the menu as unselectable text. A string consisting
148as a solid horizontal line. 138solely of dashes is displayed as a menu separator.
149 139
150A menu item can be a list with the same format as MENU. This is a submenu." 140Alternatively, a menu item can be a list with the same format as
141MENU. This is a submenu."
151 (declare (indent defun) (debug (symbolp body))) 142 (declare (indent defun) (debug (symbolp body)))
152 `(progn 143 `(progn
153 ,(if symbol `(defvar ,symbol nil ,doc)) 144 ,(if symbol `(defvar ,symbol nil ,doc))
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 64b240b9d5d..c8bdd7758fa 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -29,9 +29,9 @@
29;; 29;;
30 30
31(require 'eieio) 31(require 'eieio)
32(require 'button)
33(require 'help-mode)
34(require 'find-func) 32(require 'find-func)
33(require 'speedbar)
34(require 'help-mode)
35 35
36;;; Code: 36;;; Code:
37;;;###autoload 37;;;###autoload
@@ -710,10 +710,6 @@ Arguments UNUSED are not used."
710 710
711;;; SPEEDBAR SUPPORT 711;;; SPEEDBAR SUPPORT
712;; 712;;
713(eval-when-compile
714 (condition-case nil
715 (require 'speedbar)
716 (error (message "Error loading speedbar... ignored"))))
717 713
718(defvar eieio-class-speedbar-key-map nil 714(defvar eieio-class-speedbar-key-map nil
719 "Keymap used when working with a project in speedbar.") 715 "Keymap used when working with a project in speedbar.")
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 608134bd54f..3f7b49bde25 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -3049,29 +3049,6 @@ Optional argument NOESCAPE is passed to `prin1-to-string' when appropriate."
3049 ) 3049 )
3050 ) 3050 )
3051 3051
3052;;; Interfacing with imenu in emacs lisp mode
3053;; (Only if the expression is defined)
3054;;
3055(if (eval-when-compile (boundp 'lisp-imenu-generic-expression))
3056(progn
3057
3058(defun eieio-update-lisp-imenu-expression ()
3059 "Examine `lisp-imenu-generic-expression' and modify it to find `defmethod'."
3060 (let ((exp lisp-imenu-generic-expression))
3061 (while exp
3062 ;; it's of the form '( ( title expr indx ) ... )
3063 (let* ((subcar (cdr (car exp)))
3064 (substr (car subcar)))
3065 (if (and (not (string-match "|method\\\\" substr))
3066 (string-match "|advice\\\\" substr))
3067 (setcar subcar
3068 (replace-match "|advice\\|method\\" t t substr 0))))
3069 (setq exp (cdr exp)))))
3070
3071(eieio-update-lisp-imenu-expression)
3072
3073))
3074
3075;;; Autoloading some external symbols, and hooking into the help system 3052;;; Autoloading some external symbols, and hooking into the help system
3076;; 3053;;
3077 3054
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index cab693fecac..2a3730745c6 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -154,11 +154,16 @@ Assumes the caller has bound `macroexpand-all-environment'."
154 (if (and (not (eq form new-form)) ;It was a macro call. 154 (if (and (not (eq form new-form)) ;It was a macro call.
155 (car-safe form) 155 (car-safe form)
156 (symbolp (car form)) 156 (symbolp (car form))
157 (get (car form) 'byte-obsolete-info)) 157 (get (car form) 'byte-obsolete-info)
158 (or (not (fboundp 'byte-compile-warning-enabled-p))
159 (byte-compile-warning-enabled-p 'obsolete)))
158 (let* ((fun (car form)) 160 (let* ((fun (car form))
159 (obsolete (get fun 'byte-obsolete-info))) 161 (obsolete (get fun 'byte-obsolete-info)))
160 (macroexp--warn-and-return 162 (macroexp--warn-and-return
161 (macroexp--obsolete-warning fun obsolete "macro") 163 (macroexp--obsolete-warning
164 fun obsolete
165 (if (symbolp (symbol-function fun))
166 "alias" "macro"))
162 new-form)) 167 new-form))
163 new-form))) 168 new-form)))
164 (pcase form 169 (pcase form
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 28d166271fb..6629410a1f1 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -590,7 +590,9 @@ EXTRA-PROPERTIES is currently unused."
590 (version-control 'never)) 590 (version-control 'never))
591 (unless (fboundp 'autoload-ensure-default-file) 591 (unless (fboundp 'autoload-ensure-default-file)
592 (package-autoload-ensure-default-file generated-autoload-file)) 592 (package-autoload-ensure-default-file generated-autoload-file))
593 (update-directory-autoloads pkg-dir))) 593 (update-directory-autoloads pkg-dir)
594 (let ((buf (find-buffer-visiting generated-autoload-file)))
595 (when buf (kill-buffer buf)))))
594 596
595(defvar tar-parse-info) 597(defvar tar-parse-info)
596(declare-function tar-untar-buffer "tar-mode" ()) 598(declare-function tar-untar-buffer "tar-mode" ())
@@ -728,6 +730,7 @@ It will move point to somewhere in the headers."
728(defun package-installed-p (package &optional min-version) 730(defun package-installed-p (package &optional min-version)
729 "Return true if PACKAGE, of MIN-VERSION or newer, is installed. 731 "Return true if PACKAGE, of MIN-VERSION or newer, is installed.
730MIN-VERSION should be a version list." 732MIN-VERSION should be a version list."
733 (unless package--initialized (error "package.el is not yet initialized!"))
731 (let ((pkg-desc (assq package package-alist))) 734 (let ((pkg-desc (assq package package-alist)))
732 (if pkg-desc 735 (if pkg-desc
733 (version-list-<= min-version 736 (version-list-<= min-version
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index bb8dadbbfcd..13dbba769a4 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,7 @@
12012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * erc-backend.el: Only require `erc' during compilation (bug#12740).
4
12012-10-18 Stefan Monnier <monnier@iro.umontreal.ca> 52012-10-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * erc-backend.el: Require `erc' instead of autoloading its macros 7 * erc-backend.el: Require `erc' instead of autoloading its macros
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 858a6bd8e82..90b96d7c763 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -102,8 +102,7 @@
102;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. 102;; There's a fairly strong mutual dependency between erc.el and erc-backend.el.
103;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the 103;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the
104;; reverse is true: 104;; reverse is true:
105(provide 'erc-backend) 105(eval-when-compile (provide 'erc-backend) (require 'erc))
106(require 'erc)
107 106
108;;;; Variables and options 107;;;; Variables and options
109 108
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 09503d7c154..903c12a787e 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -1,4 +1,4 @@
1;;; face-remap.el --- Functions for managing `face-remapping-alist' 1;;; face-remap.el --- Functions for managing `face-remapping-alist' -*- lexical-binding: t -*-
2;; 2;;
3;; Copyright (C) 2008-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
4;; 4;;
@@ -132,7 +132,10 @@ other than the normal definition of FACE via `face-remap-set-base'."
132 (when (null entry) 132 (when (null entry)
133 (setq entry (list face face)) ; explicitly merge with global def 133 (setq entry (list face face)) ; explicitly merge with global def
134 (push entry face-remapping-alist)) 134 (push entry face-remapping-alist))
135 (setcdr entry (face-remap-order (cons specs (cdr entry)))) 135 (let ((faces (cdr entry)))
136 (if (symbolp faces)
137 (setq faces (list faces)))
138 (setcdr entry (face-remap-order (cons specs faces))))
136 (cons face specs))) 139 (cons face specs)))
137 140
138(defun face-remap-remove-relative (cookie) 141(defun face-remap-remove-relative (cookie)
@@ -285,7 +288,9 @@ See `text-scale-increase' for more details."
285;;;###autoload (define-key ctl-x-map [(control ?0)] 'text-scale-adjust) 288;;;###autoload (define-key ctl-x-map [(control ?0)] 'text-scale-adjust)
286;;;###autoload 289;;;###autoload
287(defun text-scale-adjust (inc) 290(defun text-scale-adjust (inc)
288 "Increase or decrease the height of the default face in the current buffer. 291 "Adjust the height of the default face by INC.
292
293INC may be passed as a numeric prefix argument.
289 294
290The actual adjustment made depends on the final component of the 295The actual adjustment made depends on the final component of the
291key-binding used to invoke the command, with all modifiers removed: 296key-binding used to invoke the command, with all modifiers removed:
@@ -294,9 +299,11 @@ key-binding used to invoke the command, with all modifiers removed:
294 - Decrease the default face height by one step 299 - Decrease the default face height by one step
295 0 Reset the default face height to the global default 300 0 Reset the default face height to the global default
296 301
297Then, continue to read input events and further adjust the face 302When adjusting with `+' or `-', continue to read input events and
298height as long as the input event read (with all modifiers removed) 303further adjust the face height as long as the input event read
299is one of the above. 304\(with all modifiers removed) is `+' or `-'.
305
306When adjusting with `0', immediately finish.
300 307
301Each step scales the height of the default face by the variable 308Each step scales the height of the default face by the variable
302`text-scale-mode-step' (a negative number of steps decreases the 309`text-scale-mode-step' (a negative number of steps decreases the
@@ -309,8 +316,7 @@ even when it is bound in a non-top-level keymap. For binding in
309a top-level keymap, `text-scale-increase' or 316a top-level keymap, `text-scale-increase' or
310`text-scale-decrease' may be more appropriate." 317`text-scale-decrease' may be more appropriate."
311 (interactive "p") 318 (interactive "p")
312 (let ((first t) 319 (let ((ev last-command-event)
313 (ev last-command-event)
314 (echo-keystrokes nil)) 320 (echo-keystrokes nil))
315 (let* ((base (event-basic-type ev)) 321 (let* ((base (event-basic-type ev))
316 (step 322 (step
@@ -320,19 +326,15 @@ a top-level keymap, `text-scale-increase' or
320 (?0 0) 326 (?0 0)
321 (t inc)))) 327 (t inc))))
322 (text-scale-increase step) 328 (text-scale-increase step)
323 ;; FIXME: do it after every "iteration of the loop". 329 ;; (unless (zerop step)
324 (message "+,-,0 for further adjustment: ") 330 (message "Use +,-,0 for further adjustment")
325 (set-temporary-overlay-map 331 (set-temporary-overlay-map
326 (let ((map (make-sparse-keymap))) 332 (let ((map (make-sparse-keymap)))
327 (dolist (mods '(() (control))) 333 (dolist (mods '(() (control)))
328 (define-key map (vector (append mods '(?-))) 'text-scale-decrease) 334 (dolist (key '(?- ?+ ?= ?0)) ;; = is often unshifted +.
329 (define-key map (vector (append mods '(?+))) 'text-scale-increase) 335 (define-key map (vector (append mods (list key)))
330 ;; = is unshifted + on most keyboards. 336 (lambda () (interactive) (text-scale-adjust (abs inc))))))
331 (define-key map (vector (append mods '(?=))) 'text-scale-increase) 337 map))))) ;; )
332 (define-key map (vector (append mods '(?0)))
333 (lambda () (interactive) (text-scale-increase 0))))
334 map)
335 t))))
336 338
337 339
338;; ---------------------------------------------------------------- 340;; ----------------------------------------------------------------
diff --git a/lisp/files.el b/lisp/files.el
index e030aff0ae2..26c5c683b3d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1537,12 +1537,9 @@ killed."
1537 t))) 1537 t)))
1538 (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) 1538 (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions)
1539 (error "Aborted")) 1539 (error "Aborted"))
1540 (when (and (buffer-modified-p) buffer-file-name) 1540 (and (buffer-modified-p) buffer-file-name
1541 (if (yes-or-no-p (format "Buffer %s is modified; save it first? " 1541 (not (yes-or-no-p "Kill and replace the buffer without saving it? "))
1542 (buffer-name))) 1542 (error "Aborted"))
1543 (save-buffer)
1544 (unless (yes-or-no-p "Kill and replace the buffer without saving it? ")
1545 (error "Aborted"))))
1546 (let ((obuf (current-buffer)) 1543 (let ((obuf (current-buffer))
1547 (ofile buffer-file-name) 1544 (ofile buffer-file-name)
1548 (onum buffer-file-number) 1545 (onum buffer-file-number)
diff --git a/lisp/help.el b/lisp/help.el
index 0df9c607f69..449818207b3 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1012,8 +1012,8 @@ WINDOW can be any live window and defaults to the selected one.
1012 1012
1013Do not make WINDOW higher than `temp-buffer-max-height' nor 1013Do not make WINDOW higher than `temp-buffer-max-height' nor
1014smaller than `window-min-height'. Do nothing if WINDOW is not 1014smaller than `window-min-height'. Do nothing if WINDOW is not
1015vertically combined or some of its contents are scrolled out of 1015vertically combined, some of its contents are scrolled out of
1016view." 1016view, or WINDOW was not created by `display-buffer'."
1017 (setq window (window-normalize-window window t)) 1017 (setq window (window-normalize-window window t))
1018 (let ((buffer-name (buffer-name (window-buffer window)))) 1018 (let ((buffer-name (buffer-name (window-buffer window))))
1019 (let ((height (if (functionp temp-buffer-max-height) 1019 (let ((height (if (functionp temp-buffer-max-height)
@@ -1022,11 +1022,12 @@ view."
1022 temp-buffer-max-height)) 1022 temp-buffer-max-height))
1023 (quit-cadr (cadr (window-parameter window 'quit-restore)))) 1023 (quit-cadr (cadr (window-parameter window 'quit-restore))))
1024 (cond 1024 (cond
1025 ;; Don't resize WINDOW if it showed another buffer before. 1025 ;; Resize WINDOW iff it was split off by `display-buffer'.
1026 ((and (eq quit-cadr 'window) 1026 ((and (eq quit-cadr 'window)
1027 (pos-visible-in-window-p (point-min) window) 1027 (pos-visible-in-window-p (point-min) window)
1028 (window-combined-p window)) 1028 (window-combined-p window))
1029 (fit-window-to-buffer window height)) 1029 (fit-window-to-buffer window height))
1030 ;; Resize FRAME iff it was created by `display-buffer'.
1030 ((and fit-frame-to-buffer 1031 ((and fit-frame-to-buffer
1031 (eq quit-cadr 'frame) 1032 (eq quit-cadr 'frame)
1032 (eq window (frame-root-window window))) 1033 (eq window (frame-root-window window)))
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 47a2f1e3b40..4686d1cf538 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -1018,7 +1018,7 @@ for more information."
1018 (if (stringp index-item) 1018 (if (stringp index-item)
1019 (setq index-item (assoc index-item (imenu--make-index-alist)))) 1019 (setq index-item (assoc index-item (imenu--make-index-alist))))
1020 (when index-item 1020 (when index-item
1021 (push-mark) 1021 (push-mark nil t)
1022 (let* ((is-special-item (listp (cdr index-item))) 1022 (let* ((is-special-item (listp (cdr index-item)))
1023 (function 1023 (function
1024 (if is-special-item 1024 (if is-special-item
diff --git a/lisp/info.el b/lisp/info.el
index 5862e5e850f..36ffa806f04 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2646,6 +2646,7 @@ Because of ambiguities, this should be concatenated with something like
2646 (while (re-search-forward pattern nil t) 2646 (while (re-search-forward pattern nil t)
2647 (push (match-string-no-properties 1) 2647 (push (match-string-no-properties 1)
2648 completions)) 2648 completions))
2649 (setq completions (delete-dups completions))
2649 ;; Check subsequent nodes if applicable. 2650 ;; Check subsequent nodes if applicable.
2650 (or (and Info-complete-next-re 2651 (or (and Info-complete-next-re
2651 (setq nextnode (Info-extract-pointer "next" t)) 2652 (setq nextnode (Info-extract-pointer "next" t))
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 37993767013..0bfda880d93 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2149,7 +2149,8 @@ Isearch mode."
2149 (setq prefix-arg arg) 2149 (setq prefix-arg arg)
2150 (apply 'isearch-unread keylist)) 2150 (apply 'isearch-unread keylist))
2151 (setq keylist 2151 (setq keylist
2152 (listify-key-sequence (lookup-key local-function-key-map key))) 2152 (listify-key-sequence
2153 (lookup-key local-function-key-map key)))
2153 (while keylist 2154 (while keylist
2154 (setq key (car keylist)) 2155 (setq key (car keylist))
2155 ;; If KEY is a printing char, we handle it here 2156 ;; If KEY is a printing char, we handle it here
@@ -2158,6 +2159,9 @@ Isearch mode."
2158 (if (and (integerp key) 2159 (if (and (integerp key)
2159 (>= key ?\s) (/= key 127) (< key 256)) 2160 (>= key ?\s) (/= key 127) (< key 256))
2160 (progn 2161 (progn
2162 ;; Ensure that the processed char is recorded in
2163 ;; the keyboard macro, if any (Bug#4894)
2164 (store-kbd-macro-event key)
2161 (isearch-process-search-char key) 2165 (isearch-process-search-char key)
2162 (setq keylist (cdr keylist))) 2166 (setq keylist (cdr keylist)))
2163 ;; As the remaining keys in KEYLIST can't be handled 2167 ;; As the remaining keys in KEYLIST can't be handled
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index f865a0269d4..38347f23f7d 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -378,6 +378,8 @@ Note: TABLE needs to be a proper completion table which obeys predicates."
378 ;; that `concat' and `unquote' commute (which tends to be the case). 378 ;; that `concat' and `unquote' commute (which tends to be the case).
379 ;; And we ask `requote' to do the work of mapping from unquoted positions 379 ;; And we ask `requote' to do the work of mapping from unquoted positions
380 ;; back to quoted positions. 380 ;; back to quoted positions.
381 ;; FIXME: For some forms of "quoting" such as the truncation behavior of
382 ;; substitute-in-file-name, it would be desirable not to requote completely.
381 "Return a new completion table operating on quoted text. 383 "Return a new completion table operating on quoted text.
382TABLE operates on the unquoted text. 384TABLE operates on the unquoted text.
383UNQUOTE is a function that takes a string and returns a new unquoted string. 385UNQUOTE is a function that takes a string and returns a new unquoted string.
@@ -527,10 +529,12 @@ for use at QPOS."
527 (`(,qfullpos . ,qfun) 529 (`(,qfullpos . ,qfun)
528 (funcall requote (+ boundary (length prefix)) string)) 530 (funcall requote (+ boundary (length prefix)) string))
529 (qfullprefix (substring string 0 qfullpos)) 531 (qfullprefix (substring string 0 qfullpos))
530 (_ (cl-assert (completion--string-equal-p 532 ;; FIXME: This assertion can be wrong, e.g. in Cygwin, where
531 (funcall unquote qfullprefix) 533 ;; (unquote "c:\bin") => "/usr/bin" but (unquote "c:\") => "/".
532 (concat (substring ustring 0 boundary) prefix)) 534 ;;(cl-assert (completion--string-equal-p
533 t)) 535 ;; (funcall unquote qfullprefix)
536 ;; (concat (substring ustring 0 boundary) prefix))
537 ;; t))
534 (qboundary (car (funcall requote boundary string))) 538 (qboundary (car (funcall requote boundary string)))
535 (_ (cl-assert (<= qboundary qfullpos))) 539 (_ (cl-assert (<= qboundary qfullpos)))
536 ;; FIXME: this split/quote/concat business messes up the carefully 540 ;; FIXME: this split/quote/concat business messes up the carefully
@@ -559,14 +563,16 @@ for use at QPOS."
559 (let* ((new (substring completion (length prefix))) 563 (let* ((new (substring completion (length prefix)))
560 (qnew (funcall qfun new)) 564 (qnew (funcall qfun new))
561 (qcompletion (concat qprefix qnew))) 565 (qcompletion (concat qprefix qnew)))
562 (cl-assert 566 ;; FIXME: Similarly here, Cygwin's mapping trips this
563 (completion--string-equal-p 567 ;; assertion.
564 (funcall unquote 568 ;;(cl-assert
565 (concat (substring string 0 qboundary) 569 ;; (completion--string-equal-p
566 qcompletion)) 570 ;; (funcall unquote
567 (concat (substring ustring 0 boundary) 571 ;; (concat (substring string 0 qboundary)
568 completion)) 572 ;; qcompletion))
569 t) 573 ;; (concat (substring ustring 0 boundary)
574 ;; completion))
575 ;; t)
570 qcompletion)) 576 qcompletion))
571 completions) 577 completions)
572 qboundary)))) 578 qboundary))))
@@ -743,6 +749,7 @@ completing buffer and file names, respectively."
743 (const buffer) 749 (const buffer)
744 (const file) 750 (const file)
745 (const unicode-name) 751 (const unicode-name)
752 (const bookmark)
746 symbol) 753 symbol)
747 :value-type 754 :value-type
748 (set :tag "Properties to override" 755 (set :tag "Properties to override"
@@ -871,6 +878,7 @@ completion candidates than this number."
871 878
872(defvar completion-all-sorted-completions nil) 879(defvar completion-all-sorted-completions nil)
873(make-variable-buffer-local 'completion-all-sorted-completions) 880(make-variable-buffer-local 'completion-all-sorted-completions)
881(defvar-local completion--all-sorted-completions-location nil)
874(defvar completion-cycling nil) 882(defvar completion-cycling nil)
875 883
876(defvar completion-fail-discreetly nil 884(defvar completion-fail-discreetly nil
@@ -1048,14 +1056,19 @@ scroll the window of possible completions."
1048 1056
1049(defun completion--cache-all-sorted-completions (comps) 1057(defun completion--cache-all-sorted-completions (comps)
1050 (add-hook 'after-change-functions 1058 (add-hook 'after-change-functions
1051 'completion--flush-all-sorted-completions nil t) 1059 'completion--flush-all-sorted-completions nil t)
1060 (setq completion--all-sorted-completions-location
1061 (cons (copy-marker (field-beginning)) (copy-marker (field-end))))
1052 (setq completion-all-sorted-completions comps)) 1062 (setq completion-all-sorted-completions comps))
1053 1063
1054(defun completion--flush-all-sorted-completions (&rest _ignore) 1064(defun completion--flush-all-sorted-completions (&optional start end _len)
1055 (remove-hook 'after-change-functions 1065 (unless (and start end
1056 'completion--flush-all-sorted-completions t) 1066 (or (> start (cdr completion--all-sorted-completions-location))
1057 (setq completion-cycling nil) 1067 (< end (car completion--all-sorted-completions-location))))
1058 (setq completion-all-sorted-completions nil)) 1068 (remove-hook 'after-change-functions
1069 'completion--flush-all-sorted-completions t)
1070 (setq completion-cycling nil)
1071 (setq completion-all-sorted-completions nil)))
1059 1072
1060(defun completion--metadata (string base md-at-point table pred) 1073(defun completion--metadata (string base md-at-point table pred)
1061 ;; Like completion-metadata, but for the specific case of getting the 1074 ;; Like completion-metadata, but for the specific case of getting the
@@ -1108,7 +1121,7 @@ Repeated uses step through the possible completions."
1108 ;; FIXME: Need to deal with the extra-size issue here as well. 1121 ;; FIXME: Need to deal with the extra-size issue here as well.
1109 ;; FIXME: ~/src/emacs/t<M-TAB>/lisp/minibuffer.el completes to 1122 ;; FIXME: ~/src/emacs/t<M-TAB>/lisp/minibuffer.el completes to
1110 ;; ~/src/emacs/trunk/ and throws away lisp/minibuffer.el. 1123 ;; ~/src/emacs/trunk/ and throws away lisp/minibuffer.el.
1111 (let* ((start (field-beginning)) 1124 (let* ((start (copy-marker (field-beginning)))
1112 (end (field-end)) 1125 (end (field-end))
1113 ;; (md (completion--field-metadata start)) 1126 ;; (md (completion--field-metadata start))
1114 (all (completion-all-sorted-completions)) 1127 (all (completion-all-sorted-completions))
@@ -1118,10 +1131,10 @@ Repeated uses step through the possible completions."
1118 (completion--message 1131 (completion--message
1119 (if all "No more completions" "No completions"))) 1132 (if all "No more completions" "No completions")))
1120 ((not (consp (cdr all))) 1133 ((not (consp (cdr all)))
1121 (let ((mod (equal (car all) (buffer-substring-no-properties base end)))) 1134 (let ((done (equal (car all) (buffer-substring-no-properties base end))))
1122 (if mod (completion--replace base end (car all))) 1135 (unless done (completion--replace base end (car all)))
1123 (completion--done (buffer-substring-no-properties start (point)) 1136 (completion--done (buffer-substring-no-properties start (point))
1124 'finished (unless mod "Sole completion")))) 1137 'finished (when done "Sole completion"))))
1125 (t 1138 (t
1126 (completion--replace base end (car all)) 1139 (completion--replace base end (car all))
1127 (completion--done (buffer-substring-no-properties start (point)) 'sole) 1140 (completion--done (buffer-substring-no-properties start (point)) 'sole)
@@ -1758,7 +1771,10 @@ exit."
1758 (when completion-in-region-mode-predicate 1771 (when completion-in-region-mode-predicate
1759 (completion-in-region-mode 1) 1772 (completion-in-region-mode 1)
1760 (setq completion-in-region--data 1773 (setq completion-in-region--data
1761 (list (current-buffer) start end collection))) 1774 (list (if (markerp start) start (copy-marker start))
1775 (copy-marker end) collection)))
1776 ;; FIXME: `minibuffer-complete' should call `completion-in-region' rather
1777 ;; than the other way around!
1762 (unwind-protect 1778 (unwind-protect
1763 (call-interactively 'minibuffer-complete) 1779 (call-interactively 'minibuffer-complete)
1764 (delete-overlay ol))))) 1780 (delete-overlay ol)))))
@@ -1782,12 +1798,12 @@ exit."
1782 (or unread-command-events ;Don't pop down the completions in the middle of 1798 (or unread-command-events ;Don't pop down the completions in the middle of
1783 ;mouse-drag-region/mouse-set-point. 1799 ;mouse-drag-region/mouse-set-point.
1784 (and completion-in-region--data 1800 (and completion-in-region--data
1785 (and (eq (car completion-in-region--data) 1801 (and (eq (marker-buffer (nth 0 completion-in-region--data))
1786 (current-buffer)) 1802 (current-buffer))
1787 (>= (point) (nth 1 completion-in-region--data)) 1803 (>= (point) (nth 0 completion-in-region--data))
1788 (<= (point) 1804 (<= (point)
1789 (save-excursion 1805 (save-excursion
1790 (goto-char (nth 2 completion-in-region--data)) 1806 (goto-char (nth 1 completion-in-region--data))
1791 (line-end-position))) 1807 (line-end-position)))
1792 (funcall completion-in-region-mode--predicate))) 1808 (funcall completion-in-region-mode--predicate)))
1793 (completion-in-region-mode -1))) 1809 (completion-in-region-mode -1)))
@@ -1892,17 +1908,19 @@ The completion method is determined by `completion-at-point-functions'."
1892 (let ((res (run-hook-wrapped 'completion-at-point-functions 1908 (let ((res (run-hook-wrapped 'completion-at-point-functions
1893 #'completion--capf-wrapper 'all))) 1909 #'completion--capf-wrapper 'all)))
1894 (pcase res 1910 (pcase res
1895 (`(,_ . ,(and (pred functionp) f)) (funcall f)) 1911 (`(,_ . ,(and (pred functionp) f)) (funcall f))
1896 (`(,hookfun . (,start ,end ,collection . ,plist)) 1912 (`(,hookfun . (,start ,end ,collection . ,plist))
1897 (let* ((completion-extra-properties plist) 1913 (unless (markerp start) (setq start (copy-marker start)))
1898 (completion-in-region-mode-predicate 1914 (let* ((completion-extra-properties plist)
1899 (lambda () 1915 (completion-in-region-mode-predicate
1900 ;; We're still in the same completion field. 1916 (lambda ()
1901 (eq (car-safe (funcall hookfun)) start)))) 1917 ;; We're still in the same completion field.
1902 (completion-in-region start end collection 1918 (let ((newstart (car-safe (funcall hookfun))))
1903 (plist-get plist :predicate)))) 1919 (and newstart (= newstart start))))))
1904 ;; Maybe completion already happened and the function returned t. 1920 (completion-in-region start end collection
1905 (_ (cdr res))))) 1921 (plist-get plist :predicate))))
1922 ;; Maybe completion already happened and the function returned t.
1923 (_ (cdr res)))))
1906 1924
1907(defun completion-help-at-point () 1925(defun completion-help-at-point ()
1908 "Display the completions on the text around point. 1926 "Display the completions on the text around point.
@@ -1914,32 +1932,34 @@ The completion method is determined by `completion-at-point-functions'."
1914 (pcase res 1932 (pcase res
1915 (`(,_ . ,(and (pred functionp) f)) 1933 (`(,_ . ,(and (pred functionp) f))
1916 (message "Don't know how to show completions for %S" f)) 1934 (message "Don't know how to show completions for %S" f))
1917 (`(,hookfun . (,start ,end ,collection . ,plist)) 1935 (`(,hookfun . (,start ,end ,collection . ,plist))
1918 (let* ((minibuffer-completion-table collection) 1936 (unless (markerp start) (setq start (copy-marker start)))
1919 (minibuffer-completion-predicate (plist-get plist :predicate)) 1937 (let* ((minibuffer-completion-table collection)
1920 (completion-extra-properties plist) 1938 (minibuffer-completion-predicate (plist-get plist :predicate))
1921 (completion-in-region-mode-predicate 1939 (completion-extra-properties plist)
1922 (lambda () 1940 (completion-in-region-mode-predicate
1923 ;; We're still in the same completion field. 1941 (lambda ()
1924 (eq (car-safe (funcall hookfun)) start))) 1942 ;; We're still in the same completion field.
1925 (ol (make-overlay start end nil nil t))) 1943 (let ((newstart (car-safe (funcall hookfun))))
1926 ;; FIXME: We should somehow (ab)use completion-in-region-function or 1944 (and newstart (= newstart start)))))
1927 ;; introduce a corresponding hook (plus another for word-completion, 1945 (ol (make-overlay start end nil nil t)))
1928 ;; and another for force-completion, maybe?). 1946 ;; FIXME: We should somehow (ab)use completion-in-region-function or
1929 (overlay-put ol 'field 'completion) 1947 ;; introduce a corresponding hook (plus another for word-completion,
1930 (overlay-put ol 'priority 100) 1948 ;; and another for force-completion, maybe?).
1931 (completion-in-region-mode 1) 1949 (overlay-put ol 'field 'completion)
1932 (setq completion-in-region--data 1950 (overlay-put ol 'priority 100)
1933 (list (current-buffer) start end collection)) 1951 (completion-in-region-mode 1)
1934 (unwind-protect 1952 (setq completion-in-region--data
1935 (call-interactively 'minibuffer-completion-help) 1953 (list start (copy-marker end) collection))
1936 (delete-overlay ol)))) 1954 (unwind-protect
1937 (`(,hookfun . ,_) 1955 (call-interactively 'minibuffer-completion-help)
1938 ;; The hook function already performed completion :-( 1956 (delete-overlay ol))))
1939 ;; Not much we can do at this point. 1957 (`(,hookfun . ,_)
1940 (message "%s already performed completion!" hookfun) 1958 ;; The hook function already performed completion :-(
1941 nil) 1959 ;; Not much we can do at this point.
1942 (_ (message "Nothing to complete at point"))))) 1960 (message "%s already performed completion!" hookfun)
1961 nil)
1962 (_ (message "Nothing to complete at point")))))
1943 1963
1944;;; Key bindings. 1964;;; Key bindings.
1945 1965
@@ -2147,53 +2167,49 @@ same as `substitute-in-file-name'."
2147 "use the regular PRED argument" "23.2") 2167 "use the regular PRED argument" "23.2")
2148 2168
2149(defun completion--sifn-requote (upos qstr) 2169(defun completion--sifn-requote (upos qstr)
2150 ;; We're looking for `qupos' such that: 2170 ;; We're looking for `qpos' such that:
2151 ;; (equal (substring (substitute-in-file-name qstr) 0 upos) 2171 ;; (equal (substring (substitute-in-file-name qstr) 0 upos)
2152 ;; (substitute-in-file-name (substring qstr 0 qupos))) 2172 ;; (substitute-in-file-name (substring qstr 0 qpos)))
2153 ;; Big problem here: we have to reverse engineer substitute-in-file-name to 2173 ;; Big problem here: we have to reverse engineer substitute-in-file-name to
2154 ;; find the position corresponding to UPOS in QSTR, but 2174 ;; find the position corresponding to UPOS in QSTR, but
2155 ;; substitute-in-file-name can do anything, depending on file-name-handlers. 2175 ;; substitute-in-file-name can do anything, depending on file-name-handlers.
2176 ;; substitute-in-file-name does the following kind of things:
2177 ;; - expand env-var references.
2178 ;; - turn backslashes into slashes.
2179 ;; - truncate some prefix of the input.
2180 ;; - rewrite some prefix.
2181 ;; Some of these operations are written in external libraries and we'd rather
2182 ;; not hard code any assumptions here about what they actually do. IOW, we
2183 ;; want to treat substitute-in-file-name as a black box, as much as possible.
2156 ;; Kind of like in rfn-eshadow-update-overlay, only worse. 2184 ;; Kind of like in rfn-eshadow-update-overlay, only worse.
2157 ;; FIXME: example of thing we do not handle: Tramp's makes 2185 ;; Example of things we need to handle:
2158 ;; (substitute-in-file-name "/foo:~/bar//baz") -> "/scpc:foo:/baz". 2186 ;; - Tramp (substitute-in-file-name "/foo:~/bar//baz") => "/scpc:foo:/baz".
2159 ;; FIXME: One way to try and handle "all" cases is to require 2187 ;; - Cygwin (substitute-in-file-name "C:\bin") => "/usr/bin"
2160 ;; substitute-in-file-name to preserve text-properties, so we could 2188 ;; (substitute-in-file-name "C:\") => "/"
2161 ;; apply text-properties to the input string and then look for them in 2189 ;; (substitute-in-file-name "C:\bi") => "/bi"
2162 ;; the output to understand what comes from where. 2190 (let* ((ustr (substitute-in-file-name qstr))
2163 (let ((qpos 0)) 2191 (uprefix (substring ustr 0 upos))
2164 ;; Handle substitute-in-file-name's truncation behavior. 2192 qprefix)
2165 (let (tpos) 2193 ;; Main assumption: nothing after qpos should affect the text before upos,
2166 (while (and (string-match "[\\/][~/\\]" qstr qpos) 2194 ;; so we can work our way backward from the end of qstr, one character
2167 ;; Hopefully our regexp covers all truncation cases. 2195 ;; at a time.
2168 ;; Also let's make sure sifn indeed truncates here. 2196 ;; Second assumptions: If qpos is far from the end this can be a bit slow,
2197 ;; so we speed it up by doing a first loop that skips a word at a time.
2198 ;; This word-sized loop is careful not to cut in the middle of env-vars.
2199 (while (let ((boundary (string-match "\\(\\$+{?\\)?\\w+\\W*\\'" qstr)))
2200 (and boundary
2169 (progn 2201 (progn
2170 (setq tpos (1+ (match-beginning 0))) 2202 (setq qprefix (substring qstr 0 boundary))
2171 (equal (substitute-in-file-name qstr) 2203 (string-prefix-p uprefix
2172 (substitute-in-file-name (substring qstr tpos))))) 2204 (substitute-in-file-name qprefix)))))
2173 (setq qpos tpos))) 2205 (setq qstr qprefix))
2174 ;; `upos' is relative to the position corresponding to `qpos' in 2206 (let ((qpos (length qstr)))
2175 ;; (substitute-in-file-name qstr), so as qpos moves forward, upos 2207 (while (and (> qpos 0)
2176 ;; gets smaller. 2208 (string-prefix-p uprefix
2177 (while (and (> upos 0) 2209 (substitute-in-file-name
2178 (string-match "\\$\\(\\$\\|\\([[:alnum:]_]+\\|{[^}]*}\\)\\)?" 2210 (substring qstr 0 (1- qpos)))))
2179 qstr qpos)) 2211 (setq qpos (1- qpos)))
2180 (cond 2212 (cons qpos #'minibuffer--double-dollars))))
2181 ((>= (- (match-beginning 0) qpos) upos) ; UPOS is before current match.
2182 (setq qpos (+ qpos upos))
2183 (setq upos 0))
2184 ((not (match-end 1)) ;A sole $: probably an error.
2185 (setq upos (- upos (- (match-end 0) qpos)))
2186 (setq qpos (match-end 0)))
2187 (t
2188 (setq upos (- upos (- (match-beginning 0) qpos)))
2189 (setq qpos (match-end 0))
2190 (setq upos (- upos (length (substitute-in-file-name
2191 (match-string 0 qstr))))))))
2192 ;; If `upos' is negative, it's because it's within the expansion of an
2193 ;; envvar, i.e. there is no exactly matching qpos, so we just use the next
2194 ;; available qpos right after the envvar.
2195 (cons (if (>= upos 0) (+ qpos upos) qpos)
2196 #'minibuffer--double-dollars)))
2197 2213
2198(defalias 'completion--file-name-table 2214(defalias 'completion--file-name-table
2199 (completion-table-with-quoting #'completion-file-name-table 2215 (completion-table-with-quoting #'completion-file-name-table
diff --git a/lisp/mouse.el b/lisp/mouse.el
index fa5c69281de..61d70404bd6 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -517,8 +517,8 @@ must be one of the symbols `header', `mode', or `vertical'."
517 ;; If mouse-2 has never been done by the user, it doesn't have 517 ;; If mouse-2 has never been done by the user, it doesn't have
518 ;; the necessary property to be interpreted correctly. 518 ;; the necessary property to be interpreted correctly.
519 (put 'mouse-2 'event-kind 'mouse-click) 519 (put 'mouse-2 'event-kind 'mouse-click)
520 (setcar event 'mouse-2)) 520 (setcar event 'mouse-2)
521 (push event unread-command-events))) 521 (push event unread-command-events))))
522 522
523(defun mouse-drag-mode-line (start-event) 523(defun mouse-drag-mode-line (start-event)
524 "Change the height of a window by dragging on the mode line." 524 "Change the height of a window by dragging on the mode line."
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index eb696798b6f..6ef713de93d 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -604,6 +604,7 @@ an alist of attribute/value pairs."
604 ;; Skip error message when retrieving attribute list 604 ;; Skip error message when retrieving attribute list
605 (if (looking-at "Size limit exceeded") 605 (if (looking-at "Size limit exceeded")
606 (forward-line 1)) 606 (forward-line 1))
607 (if (looking-at "version:") (forward-line 1)) ;bug#12724.
607 (while (progn 608 (while (progn
608 (skip-chars-forward " \t\n") 609 (skip-chars-forward " \t\n")
609 (not (eobp))) 610 (not (eobp)))
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index ef40c9316cf..9bf731fb6b2 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,300 @@
12012-10-26 Achim Gratz <stromeko@stromeko.de>
2
3 * ob-ditaa.el: Needs to (require 'org-compat) for
4 org-find-library-dir.
5
6 * org.el: Remove utf-8 codepoints in docstrings, bytecode doesn't
7 work when loaded from compressed files.
8
9 * org-compat.el: Make sure that file-name-directory is getting a
10 stringp. This avoids a possible " (wrong-type-argument stringp
11 nil)" error when the library in question does not exist.
12
13 * org-odt.el: Replace arc-mode.el by arc-mode.
14
15 * org.el: Replace org-macs.el by org-macs.
16
17 * org-install.el: Provide an empty file that prints a warning
18 about an outdated configuration.
19
202012-10-26 Bastien Guerry <bzg@gnu.org>
21
22 * org-latex.el (org-export-as-latex): Remove obsolete argument
23 `hidden'. Also fix the docstring: using 'string as the value
24 for `to-buffer' outputs a string with no LaTeX header.
25 (org-export-as-latex-batch)
26 (org-export-as-latex-to-buffer, org-export-region-as-latex)
27 (org-export-as-pdf): Don't use the obsoleted argument.
28
29 * ob-haskell.el (org-export-as-latex): Don't use the obsoleted
30 argument `hidden'.
31
32 * org.el (org-refile): Run within `with-demoted-errors' so
33 that a corrupted bookmark file does not stop the refile
34 process.
35
36 * org-capture.el (org-capture-bookmark-last-stored-position):
37 Ditto for the capture process.
38
39 * org-src.el (org-edit-src-exit): Fix bug when saving an empty
40 source buffer.
41
42 * org-lparse.el (org-lparse): Fix bug by returning the output
43 of `org-do-lparse'.
44
45 * org.el (org-refile-check-position): Throw an error when the
46 refile target is the current buffer and is not a file.
47 (org-agenda-file-to-front, org-remove-file): Throw an error
48 when the current buffer is not a file.
49 (org-check-agenda-file): Enhance the message.
50 (org-element-type): Autoload.
51 (org-element-context, org-element-paragraph-parser): Don't
52 declare as these two functions are not used in org.el.
53
54 * org-lparse.el (browse-url-file-url): Declare.
55
56 * org.el (org-refile-check-position): Fix typo in docstring.
57
58 * org-clock.el (org-clock-modeline-total): Make obsolete.
59 (org-clock-mode-line-total): Rename from
60 `org-clock-modeline-total'.
61 (org-clock-get-sum-start): Fix references to
62 `org-clock-modeline-total'.
63
64 * org-faces.el (org-agenda-filter-tags)
65 (org-agenda-filter-category, mode-line): Use the 'mode-line
66 face instead of the obsolete 'modeline.
67
68 * org-odt.el (org-odt-styles-dir): Try more directories.
69 Don't throw an error, just send a message.
70
71 * org-odt.el (org-odt-lib-dir, org-odt-data-dir)
72 (org-odt-schema-dir-list, org-odt-styles-dir-list): Delete.
73 (org-export-odt-schema-dir, org-odt-styles-dir): Infer the
74 correct directories without requiring other variables.
75
76 * org-fixup.el (org-make-org-version, org-make-autoloads):
77 Don't define `org-odt-data-dir' in org-version.el.
78
79 * org-loaddefs.el: New file.
80
81 * org.el ("org-loaddefs.el"): Don't throw an error if the file
82 cannot be fund.
83 (org-version): Use org-loaddefs.el instead of org-install.el.
84
85 * org.el: Don't dynamically autoload already autoloaded
86 functions.
87 (org-clock-update-time-maybe): Move to org-clock.el.
88
89 * org-exp.el (org-insert-export-options-template): Remove
90 autoload cookie.
91
92 * org-clock.el (org-resolve-clocks, org-clock-in)
93 (org-clock-out, org-clock-cancel, org-clock-goto)
94 (org-clock-sum, org-clock-display, org-clock-report)
95 (org-dblock-write:clocktable): Add autoload cookie.
96 (org-clock-update-time-maybe): Moved from org.el.
97
98 * org-beamer.el (org-beamer-sectioning, org-beamer-mode): Ditto.
99
100 * org-ascii.el (org-export-ascii-preprocess): Ditto.
101
102 * org-archive.el (org-archive-subtree)
103 (org-archive-to-archive-sibling, org-toggle-archive-tag): Add
104 autoload cookie.
105
106 * org-colview.el (org-columns, org-dblock-write:columnview)
107 (org-insert-columns-dblock, org-agenda-columns): Ditto.
108
109 * org-table.el (org-table-create-with-table.el)
110 (org-table-create-or-convert-from-region, org-table-create)
111 (org-table-convert-region, org-table-import)
112 (org-table-export, org-table-align)
113 (org-table-justify-field-maybe, org-table-next-field)
114 (org-table-previous-field, org-table-next-row)
115 (org-table-copy-down, org-table-field-info)
116 (org-table-current-dline, org-table-goto-column)
117 (org-table-insert-column, org-table-delete-column)
118 (org-table-move-column-right, org-table-move-column-left)
119 (org-table-move-column, org-table-move-row-down)
120 (org-table-move-row-up, org-table-move-row)
121 (org-table-insert-row, org-table-insert-hline)
122 (org-table-hline-and-move, org-table-kill-row)
123 (org-table-sort-lines, org-table-cut-region)
124 (org-table-copy-region, org-table-paste-rectangle)
125 (org-table-convert, org-table-wrap-region)
126 (org-table-edit-field, org-table-sum)
127 (org-table-get-stored-formulas)
128 (org-table-maybe-eval-formula)
129 (org-table-rotate-recalc-marks)
130 (org-table-maybe-recalculate-line, org-table-eval-formula)
131 (org-table-recalculate, org-table-iterate)
132 (org-table-edit-formulas)
133 (org-table-toggle-coordinate-overlays)
134 (org-table-toggle-formula-debugger, orgtbl-to-generic)
135 (orgtbl-to-tsv, orgtbl-to-csv, orgtbl-to-latex)
136 (orgtbl-to-html, orgtbl-to-texinfo, orgtbl-to-orgtbl): Ditto.
137
138 * org.el (turn-on-orgtbl): Moved here from org-table.el.
139 (org-clock-persistence-insinuate): Moved here from org-clock.el.
140 (org-update-all-dblocks, org-map-entries)
141 (org-require-autoloaded-modules, org-forward-element)
142 (org-backward-element, org-up-element)
143 (org-element-greater-elements, org-drag-element-backward)
144 (org-drag-element-forward, org-mark-element)
145 (org-narrow-to-element, org-transpose-element)
146 (org-unindent-buffer): Don't autoload.
147
148 * org-clock.el (org-clock-get-clocktable): Rename from
149 `org-get-clocktable'.
150 (org-clock-persistence-insinuate): Move to org.el.
151
152 * org-capture.el: Do no set `generated-autoload-file' locally.
153 Minor code clean up.
154
155 * org-agenda.el (org-agenda-list): Use
156 `org-clock-get-clocktable'. Do no set
157 `generated-autoload-file' locally.
158
159 * org-table.el (org-table-iterate-buffer-tables): Minor
160 reformatting.
161 (turn-on-orgtbl): Move to org.el.
162
163 * org-html.el (org-export-htmlize-generate-css): Don't autoload.
164
165 * org-timer.el (org-timer-pause-or-continue, org-timer-stop):
166 Ditto.
167
168 * ob-tangle.el (org-babel-tangle-lang-exts): Ditto.
169
170 * ob-lob.el (org-babel-lob-ingest): Ditto.
171
172 * org-id.el (org-id-copy)
173 (org-id-get-with-outline-path-completion)
174 (org-id-get-with-outline-drilling): Ditto.
175
176 * org-lparse.el (org-lparse-and-open, org-lparse-batch)
177 (org-lparse-to-buffer, org-replace-region-by)
178 (org-lparse-region): Ditto.
179
180 * org-mobile.el (org-mobile-create-sumo-agenda): Ditto.
181
182 * org.el (org-cycle): Fix misplaced autoload cookie.
183
184 * org-agenda.el (org-agenda-get-timestamps): Check if the item
185 is an habit when formatting it with `org-agenda-format-item'.
186 (org-agenda-get-blocks): Fix bug: don't assume the item is an
187 habit when formatting with `org-agenda-format-item'.
188
189 * org.el (org-calendar-agenda-action-key): Delete an option.
190 (org-mode-map): Delete its keybinding.
191 (org-agenda-action-marker, org-mark-entry-for-agenda-action):
192 Delete.
193
194 * org-agenda.el (org-agenda-diary-entry): Don't prevent from
195 being used outside of Org agendas, as it can be used in
196 calendar buffers too.
197
1982012-10-26 Caio Tiago Oliveira <asrail@gmail.com> (tiny change)
199
200 * ob-scala.el (org-babel-scala-wrapper-method): Use a Scala
201 block enclosing the submitted code.
202
2032012-10-26 Myles English <mylesenglish@gmail.com> (tiny change)
204
205 * org-clock.el (org-clock-in): Moved the call to
206 org-clock-in-prepare-hook until the task's properties
207 can be accessed.
208
2092012-10-26 Nicolas Goaziou <n.goaziou@gmail.com>
210
211 * org.el (org-auto-fill-function): Make sure `adaptive-fill-mode'
212 mode is nil when pre-computed `fill-prefix' is the empty string.
213 Otherwise filling functions from fill.el think it has to be computed
214 again and overwrite it.
215
216 * org.el: Make `org-closest-date' aware of hours repeaters.
217
218 * org.el (org-end-of-line): Do not call `end-of-visual-line' when
219 moving to the end of line. Also improve behaviour on elements that
220 can be hidden.
221
222 * org.el (org-sparse-tree): Allow to call `org-show-todo-tree'
223 with an argument.
224
225 * org-element.el (org-element--get-next-object-candidates): Fix
226 parsing of objects of the same type in a single paragraph.
227
228 * org-element.el (org-element-sub/superscript-successor): Fix
229 parsing of sub/superscript at beginning of item.
230 (org-element-latex-or-entity-successor): Fix parsing of latex
231 fragments at beginning of item.
232
233 * org-agenda.el (org-agenda-later): Fix function when span is
234 a number and an argument was provided. Also fix typo in docstring.
235
236 * org.el (org-read-date-analyze): Fix analyzing for dates like
237 "29.03 16:40".
238
239 * org-element.el (org-element-center-block-parser)
240 (org-element-drawer-parser, , org-element-footnote-definition-parser)
241 (org-element-inlinetask-parser, org-element-plain-list-parser)
242 (org-element-quote-block-parser, org-element-special-block-parser)
243 (org-element-babel-call-parser, org-element-clock-parser)
244 (org-element-comment-parser, org-element-comment-block-parser)
245 (org-element-example-block-parser, org-element-export-block-parser)
246 (org-element-fixed-width-parser, org-element-horizontal-rule-parser)
247 (org-element-keyword-parser, org-element-latex-environment-parser)
248 (org-element-paragraph-parser, org-element-planning-parser)
249 (org-element-property-drawer-parser, org-element-src-block-parser)
250 (org-element-table-parser)
251 (org-element-verse-block-parserorg-element-dynamic-block-parser):
252 Make sure element never ends at the end of a blank non-empty line.
253
254 * org-element.el (org-element-context)
255 (org-element--get-next-object-candidates): Fix `org-element-context'.
256 In particular, the restrictions for an object may be different from
257 those of its container (i.e. table rows and table cells).
258
259 * org-element.el (org-element-example-block-parser)
260 (org-element-src-block-parser): Store value of example-blocks and
261 src-blocks unescaped.
262 (org-element-example-block-interpreter)
263 (org-element-src-block-interpreter): Escape value again when storing
264 it.
265
266 * org-src.el (org-escape-code-in-string)
267 (org-unescape-code-in-string, org-escape-code-in-region)
268 (org-unescape-code-in-region): New functions.
269 (org-edit-src-code, org-edit-src-exit): Use new functions.
270
271 * org.el (org-strip-protective-commas): Removed function.
272
273 * org-exp.el (org-export-select-backend-specific-text): Use new
274 function.
275
276 * ob.el (org-babel-parse-src-block-match)
277 (org-babel-parse-inline-src-block-match, org-babel-insert-result):
278 Always escape produced blocks, independently on the language of the
279 block, if any. Use new functions.
280
281 * org-element.el (org-element-paragraph-parser): Fix regexp
282 starting a block.
283
284 * org-element.el (org-element-center-block-parser):
285 (org-element-drawer-parser, org-element-dynamic-block-parser)
286 (org-element-example-block-parser, org-element-export-block-parser)
287 (org-element-latex-environment-parser, org-element-paragraph-parser)
288 (org-element-property-drawer-parser, org-element-src-block-parser)
289 (org-element-verse-block-parser): Use stricter regexps for boundaries
290 of elements.
291
2922012-10-26 Toby S. Cubitt <tsc25@cantab.net>
293
294 * org-agenda.el (org-agenda-get-sexps): Reset `extra' to nil at
295 beginning of re-search-forward loop, otherwise next iteration picks up
296 `extra' value from previous entry.
297
12012-09-30 Abdó Roig-Maranges <abdo.roig@gmail.com> 2982012-09-30 Abdó Roig-Maranges <abdo.roig@gmail.com>
2 299
3 * org-html.el (org-export-html-preprocess) 300 * org-html.el (org-export-html-preprocess)
diff --git a/lisp/org/ob-ditaa.el b/lisp/org/ob-ditaa.el
index ae7794b659c..7c545c47437 100644
--- a/lisp/org/ob-ditaa.el
+++ b/lisp/org/ob-ditaa.el
@@ -40,6 +40,7 @@
40 40
41;;; Code: 41;;; Code:
42(require 'ob) 42(require 'ob)
43(require 'org-compat)
43 44
44(defvar org-ditaa-jar-path) ;; provided by org-exp-blocks 45(defvar org-ditaa-jar-path) ;; provided by org-exp-blocks
45 46
diff --git a/lisp/org/ob-haskell.el b/lisp/org/ob-haskell.el
index 1588f99f1e4..03972efeec1 100644
--- a/lisp/org/ob-haskell.el
+++ b/lisp/org/ob-haskell.el
@@ -147,6 +147,8 @@ specifying a variable of the same value."
147 (format "%S" var))) 147 (format "%S" var)))
148 148
149(defvar org-src-preserve-indentation) 149(defvar org-src-preserve-indentation)
150(declare-function org-export-as-latex "org-latex"
151 (arg &optional ext-plist to-buffer body-only pub-dir))
150(defun org-babel-haskell-export-to-lhs (&optional arg) 152(defun org-babel-haskell-export-to-lhs (&optional arg)
151 "Export to a .lhs file with all haskell code blocks escaped. 153 "Export to a .lhs file with all haskell code blocks escaped.
152When called with a prefix argument the resulting 154When called with a prefix argument the resulting
diff --git a/lisp/org/ob-io.el b/lisp/org/ob-io.el
index 20648266056..881f35afbda 100644
--- a/lisp/org/ob-io.el
+++ b/lisp/org/ob-io.el
@@ -38,12 +38,12 @@
38(require 'ob-eval) 38(require 'ob-eval)
39(eval-when-compile (require 'cl)) 39(eval-when-compile (require 'cl))
40 40
41(defvar org-babel-tangle-lang-exts) ;; Autoloaded
41(add-to-list 'org-babel-tangle-lang-exts '("io" . "io")) 42(add-to-list 'org-babel-tangle-lang-exts '("io" . "io"))
42(defvar org-babel-default-header-args:io '()) 43(defvar org-babel-default-header-args:io '())
43(defvar org-babel-io-command "io" 44(defvar org-babel-io-command "io"
44 "Name of the command to use for executing Io code.") 45 "Name of the command to use for executing Io code.")
45 46
46
47(defun org-babel-execute:io (body params) 47(defun org-babel-execute:io (body params)
48 "Execute a block of Io code with org-babel. This function is 48 "Execute a block of Io code with org-babel. This function is
49called by `org-babel-execute-src-block'" 49called by `org-babel-execute-src-block'"
diff --git a/lisp/org/ob-keys.el b/lisp/org/ob-keys.el
index 759bef3905f..3e3f496ff35 100644
--- a/lisp/org/ob-keys.el
+++ b/lisp/org/ob-keys.el
@@ -98,6 +98,8 @@ a-list placed behind the generic `org-babel-key-prefix'.")
98 98
99(provide 'ob-keys) 99(provide 'ob-keys)
100 100
101 101;; Local variables:
102;; generated-autoload-file: "org-loaddefs.el"
103;; End:
102 104
103;;; ob-keys.el ends here 105;;; ob-keys.el ends here
diff --git a/lisp/org/ob-lob.el b/lisp/org/ob-lob.el
index 6aafe34dcd3..8b5f14d0252 100644
--- a/lisp/org/ob-lob.el
+++ b/lisp/org/ob-lob.el
@@ -45,7 +45,6 @@ To add files to this list use the `org-babel-lob-ingest' command."
45(defvar org-babel-default-lob-header-args '((:exports . "results")) 45(defvar org-babel-default-lob-header-args '((:exports . "results"))
46 "Default header arguments to use when exporting #+lob/call lines.") 46 "Default header arguments to use when exporting #+lob/call lines.")
47 47
48;;;###autoload
49(defun org-babel-lob-ingest (&optional file) 48(defun org-babel-lob-ingest (&optional file)
50 "Add all named source-blocks defined in FILE to 49 "Add all named source-blocks defined in FILE to
51`org-babel-library-of-babel'." 50`org-babel-library-of-babel'."
@@ -143,6 +142,8 @@ if so then run the appropriate source block from the Library."
143 142
144(provide 'ob-lob) 143(provide 'ob-lob)
145 144
146 145;; Local variables:
146;; generated-autoload-file: "org-loaddefs.el"
147;; End:
147 148
148;;; ob-lob.el ends here 149;;; ob-lob.el ends here
diff --git a/lisp/org/ob-picolisp.el b/lisp/org/ob-picolisp.el
index dd0704fc14e..025993c5847 100644
--- a/lisp/org/ob-picolisp.el
+++ b/lisp/org/ob-picolisp.el
@@ -60,6 +60,7 @@
60(eval-when-compile (require 'cl)) 60(eval-when-compile (require 'cl))
61 61
62(declare-function run-picolisp "ext:inferior-picolisp" (cmd)) 62(declare-function run-picolisp "ext:inferior-picolisp" (cmd))
63(defvar org-babel-tangle-lang-exts) ;; Autoloaded
63 64
64;; optionally define a file extension for this language 65;; optionally define a file extension for this language
65(add-to-list 'org-babel-tangle-lang-exts '("picolisp" . "l")) 66(add-to-list 'org-babel-tangle-lang-exts '("picolisp" . "l"))
diff --git a/lisp/org/ob-ref.el b/lisp/org/ob-ref.el
index 79861f1b78a..af4ee6a1a4d 100644
--- a/lisp/org/ob-ref.el
+++ b/lisp/org/ob-ref.el
@@ -59,6 +59,7 @@
59(declare-function org-at-item-p "org-list" ()) 59(declare-function org-at-item-p "org-list" ())
60(declare-function org-narrow-to-subtree "org" ()) 60(declare-function org-narrow-to-subtree "org" ())
61(declare-function org-id-find-id-in-file "org-id" (id file &optional markerp)) 61(declare-function org-id-find-id-in-file "org-id" (id file &optional markerp))
62(declare-function org-id-find-id-file "org-id" (id))
62(declare-function org-show-context "org" (&optional key)) 63(declare-function org-show-context "org" (&optional key))
63(declare-function org-pop-to-buffer-same-window 64(declare-function org-pop-to-buffer-same-window
64 "org-compat" (&optional buffer-or-name norecord label)) 65 "org-compat" (&optional buffer-or-name norecord label))
diff --git a/lisp/org/ob-scala.el b/lisp/org/ob-scala.el
index b5eb18484b9..ea3c3f28112 100644
--- a/lisp/org/ob-scala.el
+++ b/lisp/org/ob-scala.el
@@ -36,12 +36,12 @@
36(require 'ob-eval) 36(require 'ob-eval)
37(eval-when-compile (require 'cl)) 37(eval-when-compile (require 'cl))
38 38
39(defvar org-babel-tangle-lang-exts) ;; Autoloaded
39(add-to-list 'org-babel-tangle-lang-exts '("scala" . "scala")) 40(add-to-list 'org-babel-tangle-lang-exts '("scala" . "scala"))
40(defvar org-babel-default-header-args:scala '()) 41(defvar org-babel-default-header-args:scala '())
41(defvar org-babel-scala-command "scala" 42(defvar org-babel-scala-command "scala"
42 "Name of the command to use for executing Scala code.") 43 "Name of the command to use for executing Scala code.")
43 44
44
45(defun org-babel-execute:scala (body params) 45(defun org-babel-execute:scala (body params)
46 "Execute a block of Scala code with org-babel. This function is 46 "Execute a block of Scala code with org-babel. This function is
47called by `org-babel-execute-src-block'" 47called by `org-babel-execute-src-block'"
@@ -72,9 +72,17 @@ Emacs-lisp table, otherwise return the results as a string."
72 72
73 73
74(defvar org-babel-scala-wrapper-method 74(defvar org-babel-scala-wrapper-method
75 "( 75
76"var str_result :String = null;
77
78Console.withOut(new java.io.OutputStream() {def write(b: Int){
79}}) {
80 str_result = {
76%s 81%s
77) asString print 82 }.toString
83}
84
85print(str_result)
78") 86")
79 87
80 88
diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el
index ad7b1e29a93..20a136a80fb 100644
--- a/lisp/org/ob-sql.el
+++ b/lisp/org/ob-sql.el
@@ -47,7 +47,8 @@
47(eval-when-compile (require 'cl)) 47(eval-when-compile (require 'cl))
48 48
49(declare-function org-table-import "org-table" (file arg)) 49(declare-function org-table-import "org-table" (file arg))
50(declare-function orgtbl-to-csv "org-table" (TABLE PARAMS)) 50(declare-function orgtbl-to-csv "org-table" (table params))
51(declare-function org-table-to-lisp "org-table" (&optional txt))
51 52
52(defvar org-babel-default-header-args:sql '()) 53(defvar org-babel-default-header-args:sql '())
53 54
diff --git a/lisp/org/ob-sqlite.el b/lisp/org/ob-sqlite.el
index 24a7dd58c2c..b1696d94d3c 100644
--- a/lisp/org/ob-sqlite.el
+++ b/lisp/org/ob-sqlite.el
@@ -33,7 +33,8 @@
33(declare-function org-fill-template "org" (template alist)) 33(declare-function org-fill-template "org" (template alist))
34(declare-function org-table-convert-region "org-table" 34(declare-function org-table-convert-region "org-table"
35 (beg0 end0 &optional separator)) 35 (beg0 end0 &optional separator))
36(declare-function orgtbl-to-csv "org-table" (TABLE PARAMS)) 36(declare-function orgtbl-to-csv "org-table" (table params))
37(declare-function org-table-to-lisp "org-table" (&optional txt))
37 38
38(defvar org-babel-default-header-args:sqlite '()) 39(defvar org-babel-default-header-args:sqlite '())
39 40
diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el
index 7077a1571eb..7e25b2cd1bc 100644
--- a/lisp/org/ob-tangle.el
+++ b/lisp/org/ob-tangle.el
@@ -38,7 +38,6 @@
38(declare-function org-babel-update-block-body "org" (new-body)) 38(declare-function org-babel-update-block-body "org" (new-body))
39(declare-function make-directory "files" (dir &optional parents)) 39(declare-function make-directory "files" (dir &optional parents))
40 40
41;;;###autoload
42(defcustom org-babel-tangle-lang-exts 41(defcustom org-babel-tangle-lang-exts
43 '(("emacs-lisp" . "el")) 42 '(("emacs-lisp" . "el"))
44 "Alist mapping languages to their file extensions. 43 "Alist mapping languages to their file extensions.
@@ -514,6 +513,8 @@ which enable the original code blocks to be found."
514 513
515(provide 'ob-tangle) 514(provide 'ob-tangle)
516 515
517 516;; Local variables:
517;; generated-autoload-file: "org-loaddefs.el"
518;; End:
518 519
519;;; ob-tangle.el ends here 520;;; ob-tangle.el ends here
diff --git a/lisp/org/ob.el b/lisp/org/ob.el
index f15457d68e2..b06aac11f69 100644
--- a/lisp/org/ob.el
+++ b/lisp/org/ob.el
@@ -39,7 +39,6 @@
39(declare-function show-all "outline" ()) 39(declare-function show-all "outline" ())
40(declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS)) 40(declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS))
41(declare-function org-mark-ring-push "org" (&optional pos buffer)) 41(declare-function org-mark-ring-push "org" (&optional pos buffer))
42(declare-function org-strip-protective-commas "org" (beg end))
43(declare-function tramp-compat-make-temp-file "tramp-compat" 42(declare-function tramp-compat-make-temp-file "tramp-compat"
44 (filename &optional dir-flag)) 43 (filename &optional dir-flag))
45(declare-function tramp-dissect-file-name "tramp" (name &optional nodefault)) 44(declare-function tramp-dissect-file-name "tramp" (name &optional nodefault))
@@ -64,7 +63,6 @@
64(declare-function org-cycle "org" (&optional arg)) 63(declare-function org-cycle "org" (&optional arg))
65(declare-function org-uniquify "org" (list)) 64(declare-function org-uniquify "org" (list))
66(declare-function org-current-level "org" ()) 65(declare-function org-current-level "org" ())
67(declare-function org-strip-protective-commas "org" (beg end))
68(declare-function org-table-import "org-table" (file arg)) 66(declare-function org-table-import "org-table" (file arg))
69(declare-function org-add-hook "org-compat" 67(declare-function org-add-hook "org-compat"
70 (hook function &optional append local)) 68 (hook function &optional append local))
@@ -87,10 +85,11 @@
87(declare-function org-list-struct "org-list" ()) 85(declare-function org-list-struct "org-list" ())
88(declare-function org-list-prevs-alist "org-list" (struct)) 86(declare-function org-list-prevs-alist "org-list" (struct))
89(declare-function org-list-get-list-end "org-list" (item struct prevs)) 87(declare-function org-list-get-list-end "org-list" (item struct prevs))
90(declare-function org-strip-protective-commas "org" (beg end))
91(declare-function org-remove-if "org" (predicate seq)) 88(declare-function org-remove-if "org" (predicate seq))
92(declare-function org-completing-read "org" (&rest args)) 89(declare-function org-completing-read "org" (&rest args))
93(declare-function org-add-protective-commas "org-src" (beg end)) 90(declare-function org-escape-code-in-region "org-src" (beg end))
91(declare-function org-unescape-code-in-string "org-src" (s))
92(declare-function org-table-to-lisp "org-table" (&optional txt))
94 93
95(defgroup org-babel nil 94(defgroup org-babel nil
96 "Code block evaluation and management in `org-mode' documents." 95 "Code block evaluation and management in `org-mode' documents."
@@ -494,8 +493,8 @@ can not be resolved.")
494 493
495;;; functions 494;;; functions
496(defvar call-process-region) 495(defvar call-process-region)
497;;;###autoload
498 496
497;;;###autoload
499(defun org-babel-execute-src-block (&optional arg info params) 498(defun org-babel-execute-src-block (&optional arg info params)
500 "Execute the current source code block. 499 "Execute the current source code block.
501Insert the results of execution into the buffer. Source code 500Insert the results of execution into the buffer. Source code
@@ -838,6 +837,7 @@ evaluation mechanisms."
838 (key-binding (or key (read-key-sequence nil)))))) 837 (key-binding (or key (read-key-sequence nil))))))
839 838
840(defvar org-bracket-link-regexp) 839(defvar org-bracket-link-regexp)
840
841;;;###autoload 841;;;###autoload
842(defun org-babel-open-src-block-result (&optional re-run) 842(defun org-babel-open-src-block-result (&optional re-run)
843 "If `point' is on a src block then open the results of the 843 "If `point' is on a src block then open the results of the
@@ -944,6 +944,7 @@ buffer."
944(def-edebug-spec org-babel-map-inline-src-blocks (form body)) 944(def-edebug-spec org-babel-map-inline-src-blocks (form body))
945 945
946(defvar org-babel-lob-one-liner-regexp) 946(defvar org-babel-lob-one-liner-regexp)
947
947;;;###autoload 948;;;###autoload
948(defmacro org-babel-map-call-lines (file &rest body) 949(defmacro org-babel-map-call-lines (file &rest body)
949 "Evaluate BODY forms on each call line in FILE. 950 "Evaluate BODY forms on each call line in FILE.
@@ -1241,7 +1242,7 @@ may be specified in the properties of the current outline entry."
1241 ;; get block body less properties, protective commas, and indentation 1242 ;; get block body less properties, protective commas, and indentation
1242 (with-temp-buffer 1243 (with-temp-buffer
1243 (save-match-data 1244 (save-match-data
1244 (insert (org-babel-strip-protective-commas body lang)) 1245 (insert (org-unescape-code-in-string body))
1245 (unless preserve-indentation (org-do-remove-indentation)) 1246 (unless preserve-indentation (org-do-remove-indentation))
1246 (buffer-string))) 1247 (buffer-string)))
1247 (org-babel-merge-params 1248 (org-babel-merge-params
@@ -1258,8 +1259,7 @@ may be specified in the properties of the current outline entry."
1258 (let* ((lang (org-no-properties (match-string 2))) 1259 (let* ((lang (org-no-properties (match-string 2)))
1259 (lang-headers (intern (concat "org-babel-default-header-args:" lang)))) 1260 (lang-headers (intern (concat "org-babel-default-header-args:" lang))))
1260 (list lang 1261 (list lang
1261 (org-babel-strip-protective-commas 1262 (org-unescape-code-in-string (org-no-properties (match-string 5)))
1262 (org-no-properties (match-string 5)) lang)
1263 (org-babel-merge-params 1263 (org-babel-merge-params
1264 org-babel-default-inline-header-args 1264 org-babel-default-inline-header-args
1265 (org-babel-params-from-properties lang) 1265 (org-babel-params-from-properties lang)
@@ -1937,10 +1937,10 @@ code ---- the results are extracted in the syntax of the source
1937 ((member "prepend" result-params)))) ; already there 1937 ((member "prepend" result-params)))) ; already there
1938 (setq results-switches 1938 (setq results-switches
1939 (if results-switches (concat " " results-switches) "")) 1939 (if results-switches (concat " " results-switches) ""))
1940 (let ((wrap (lambda (start finish &optional escape) 1940 (let ((wrap (lambda (start finish)
1941 (goto-char end) (insert (concat finish "\n")) 1941 (goto-char end) (insert (concat finish "\n"))
1942 (goto-char beg) (insert (concat start "\n")) 1942 (goto-char beg) (insert (concat start "\n"))
1943 (if escape (org-add-protective-commas (point) end)) 1943 (org-escape-code-in-region (point) end)
1944 (goto-char end) (goto-char (point-at-eol)) 1944 (goto-char end) (goto-char (point-at-eol))
1945 (setq end (point-marker)))) 1945 (setq end (point-marker))))
1946 (proper-list-p (lambda (it) (and (listp it) (null (cdr (last it))))))) 1946 (proper-list-p (lambda (it) (and (listp it) (null (cdr (last it)))))))
@@ -1987,7 +1987,7 @@ code ---- the results are extracted in the syntax of the source
1987 ((member "latex" result-params) 1987 ((member "latex" result-params)
1988 (funcall wrap "#+BEGIN_LaTeX" "#+END_LaTeX")) 1988 (funcall wrap "#+BEGIN_LaTeX" "#+END_LaTeX"))
1989 ((member "org" result-params) 1989 ((member "org" result-params)
1990 (funcall wrap "#+BEGIN_SRC org" "#+END_SRC" 'escape)) 1990 (funcall wrap "#+BEGIN_SRC org" "#+END_SRC"))
1991 ((member "code" result-params) 1991 ((member "code" result-params)
1992 (funcall wrap (format "#+BEGIN_SRC %s%s" (or lang "none") results-switches) 1992 (funcall wrap (format "#+BEGIN_SRC %s%s" (or lang "none") results-switches)
1993 "#+END_SRC")) 1993 "#+END_SRC"))
@@ -2370,17 +2370,6 @@ block but are passed literally to the \"example-block\"."
2370 (funcall nb-add (buffer-substring index (point-max)))) 2370 (funcall nb-add (buffer-substring index (point-max))))
2371 new-body)) 2371 new-body))
2372 2372
2373(defun org-babel-strip-protective-commas (body &optional lang)
2374 "Strip protective commas from bodies of source blocks."
2375 (with-temp-buffer
2376 (insert body)
2377 (if (and lang (string= lang "org"))
2378 (progn (goto-char (point-min))
2379 (while (re-search-forward "^[ \t]*\\(,\\)" nil t)
2380 (replace-match "" nil nil nil 1)))
2381 (org-strip-protective-commas (point-min) (point-max)))
2382 (buffer-string)))
2383
2384(defun org-babel-script-escape (str &optional force) 2373(defun org-babel-script-escape (str &optional force)
2385 "Safely convert tables into elisp lists." 2374 "Safely convert tables into elisp lists."
2386 (let (in-single in-double out) 2375 (let (in-single in-double out)
@@ -2599,6 +2588,8 @@ of `org-babel-temporary-directory'."
2599 2588
2600(provide 'ob) 2589(provide 'ob)
2601 2590
2602 2591;; Local variables:
2592;; generated-autoload-file: "org-loaddefs.el"
2593;; End:
2603 2594
2604;;; ob.el ends here 2595;;; ob.el ends here
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 32fecde2af0..36f3fcb9974 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -1871,6 +1871,7 @@ When nil, `q' will kill the single agenda buffer."
1871 :version "24.3" 1871 :version "24.3"
1872 :type 'boolean) 1872 :type 'boolean)
1873 1873
1874
1874;;;###autoload 1875;;;###autoload
1875(defun org-toggle-sticky-agenda (&optional arg) 1876(defun org-toggle-sticky-agenda (&optional arg)
1876 "Toggle `org-agenda-sticky'." 1877 "Toggle `org-agenda-sticky'."
@@ -1888,6 +1889,11 @@ When nil, `q' will kill the single agenda buffer."
1888 (message "Sticky agenda was %s" 1889 (message "Sticky agenda was %s"
1889 (if org-agenda-sticky "enabled" "disabled")))))) 1890 (if org-agenda-sticky "enabled" "disabled"))))))
1890 1891
1892(autoload 'org-toggle-sticky-agenda "org-agenda" "\
1893Toggle `org-agenda-sticky'.
1894
1895\(fn &optional ARG)" t nil)
1896
1891(defvar org-agenda-buffer nil 1897(defvar org-agenda-buffer nil
1892 "Agenda buffer currently being generated.") 1898 "Agenda buffer currently being generated.")
1893 1899
@@ -2563,6 +2569,43 @@ Pressing `<' twice means to restrict to the current subtree or region
2563 ((equal org-keys "!") (customize-variable 'org-stuck-projects)) 2569 ((equal org-keys "!") (customize-variable 'org-stuck-projects))
2564 (t (error "Invalid agenda key")))))) 2570 (t (error "Invalid agenda key"))))))
2565 2571
2572(autoload 'org-agenda "org-agenda" "\
2573Dispatch agenda commands to collect entries to the agenda buffer.
2574Prompts for a command to execute. Any prefix arg will be passed
2575on to the selected command. The default selections are:
2576
2577a Call `org-agenda-list' to display the agenda for current day or week.
2578t Call `org-todo-list' to display the global todo list.
2579T Call `org-todo-list' to display the global todo list, select only
2580 entries with a specific TODO keyword (the user gets a prompt).
2581m Call `org-tags-view' to display headlines with tags matching
2582 a condition (the user is prompted for the condition).
2583M Like `m', but select only TODO entries, no ordinary headlines.
2584L Create a timeline for the current buffer.
2585e Export views to associated files.
2586s Search entries for keywords.
2587S Search entries for keywords, only with TODO keywords.
2588/ Multi occur across all agenda files and also files listed
2589 in `org-agenda-text-search-extra-files'.
2590< Restrict agenda commands to buffer, subtree, or region.
2591 Press several times to get the desired effect.
2592> Remove a previous restriction.
2593# List \"stuck\" projects.
2594! Configure what \"stuck\" means.
2595C Configure custom agenda commands.
2596
2597More commands can be added by configuring the variable
2598`org-agenda-custom-commands'. In particular, specific tags and TODO keyword
2599searches can be pre-defined in this way.
2600
2601If the current buffer is in Org-mode and visiting a file, you can also
2602first press `<' once to indicate that the agenda should be temporarily
2603\(until the next use of \\[org-agenda]) restricted to the current file.
2604Pressing `<' twice means to restrict to the current subtree or region
2605\(if active).
2606
2607\(fn &optional ARG ORG-KEYS RESTRICTION)" t nil)
2608
2566(defun org-agenda-append-agenda () 2609(defun org-agenda-append-agenda ()
2567 "Append another agenda view to the current one. 2610 "Append another agenda view to the current one.
2568This function allows interactive building of block agendas. 2611This function allows interactive building of block agendas.
@@ -2857,6 +2900,16 @@ before running the agenda command."
2857 (org-agenda nil cmd-key))) 2900 (org-agenda nil cmd-key)))
2858 (set-buffer org-agenda-buffer-name) 2901 (set-buffer org-agenda-buffer-name)
2859 (princ (buffer-string))) 2902 (princ (buffer-string)))
2903
2904(autoload 'org-batch-agenda "org-agenda" "\
2905Run an agenda command in batch mode and send the result to STDOUT.
2906If CMD-KEY is a string of length 1, it is used as a key in
2907`org-agenda-custom-commands' and triggers this command. If it is a
2908longer string it is used as a tags/todo match string.
2909Parameters are alternating variable names and values that will be bound
2910before running the agenda command.
2911
2912\(fn CMD-KEY &rest PARAMETERS)" nil t)
2860(def-edebug-spec org-batch-agenda (form &rest sexp)) 2913(def-edebug-spec org-batch-agenda (form &rest sexp))
2861 2914
2862(defvar org-agenda-info nil) 2915(defvar org-agenda-info nil)
@@ -2915,6 +2968,43 @@ agenda-day The day in the agenda where this is listed"
2915 priority-letter priority agenda-day) 2968 priority-letter priority agenda-day)
2916 ",")) 2969 ","))
2917 (princ "\n"))))) 2970 (princ "\n")))))
2971
2972(autoload 'org-batch-agenda-csv "org-agenda" "\
2973Run an agenda command in batch mode and send the result to STDOUT.
2974If CMD-KEY is a string of length 1, it is used as a key in
2975`org-agenda-custom-commands' and triggers this command. If it is a
2976longer string it is used as a tags/todo match string.
2977Parameters are alternating variable names and values that will be bound
2978before running the agenda command.
2979
2980The output gives a line for each selected agenda item. Each
2981item is a list of comma-separated values, like this:
2982
2983category,head,type,todo,tags,date,time,extra,priority-l,priority-n
2984
2985category The category of the item
2986head The headline, without TODO kwd, TAGS and PRIORITY
2987type The type of the agenda entry, can be
2988 todo selected in TODO match
2989 tagsmatch selected in tags match
2990 diary imported from diary
2991 deadline a deadline on given date
2992 scheduled scheduled on given date
2993 timestamp entry has timestamp on given date
2994 closed entry was closed on given date
2995 upcoming-deadline warning about deadline
2996 past-scheduled forwarded scheduled item
2997 block entry has date block including g. date
2998todo The todo keyword, if any
2999tags All tags including inherited ones, separated by colons
3000date The relevant date, like 2007-2-14
3001time The time, like 15:00-16:50
3002extra Sting with extra planning info
3003priority-l The priority letter if any was given
3004priority-n The computed numerical priority
3005agenda-day The day in the agenda where this is listed
3006
3007\(fn CMD-KEY &rest PARAMETERS)" nil t)
2918(def-edebug-spec org-batch-agenda-csv (form &rest sexp)) 3008(def-edebug-spec org-batch-agenda-csv (form &rest sexp))
2919 3009
2920(defun org-fix-agenda-info (props) 3010(defun org-fix-agenda-info (props)
@@ -2964,6 +3054,11 @@ This ensures the export commands can easily use it."
2964 (interactive) 3054 (interactive)
2965 (eval (list 'org-batch-store-agenda-views))) 3055 (eval (list 'org-batch-store-agenda-views)))
2966 3056
3057(autoload 'org-store-agenda-views "org-agenda" "\
3058
3059
3060\(fn &rest PARAMETERS)" t nil)
3061
2967;;;###autoload 3062;;;###autoload
2968(defmacro org-batch-store-agenda-views (&rest parameters) 3063(defmacro org-batch-store-agenda-views (&rest parameters)
2969 "Run all custom agenda commands that have a file argument." 3064 "Run all custom agenda commands that have a file argument."
@@ -2998,6 +3093,11 @@ This ensures the export commands can easily use it."
2998 (org-agenda-write (expand-file-name (pop files) dir) nil t bufname))) 3093 (org-agenda-write (expand-file-name (pop files) dir) nil t bufname)))
2999 (and (get-buffer bufname) 3094 (and (get-buffer bufname)
3000 (kill-buffer bufname))))))) 3095 (kill-buffer bufname)))))))
3096
3097(autoload 'org-batch-store-agenda-views "org-agenda" "\
3098Run all custom agenda commands that have a file argument.
3099
3100\(fn &rest PARAMETERS)" nil t)
3001(def-edebug-spec org-batch-store-agenda-views (&rest sexp)) 3101(def-edebug-spec org-batch-store-agenda-views (&rest sexp))
3002 3102
3003(defvar org-agenda-current-span nil 3103(defvar org-agenda-current-span nil
@@ -4002,7 +4102,7 @@ given in `org-agenda-start-on-weekday'."
4002 "" 4102 ""
4003 x)) 4103 x))
4004 filter "")))) 4104 filter ""))))
4005 (setq tbl (apply 'org-get-clocktable p)) 4105 (setq tbl (apply 'org-clock-get-clocktable p))
4006 (insert tbl))) 4106 (insert tbl)))
4007 (goto-char (point-min)) 4107 (goto-char (point-min))
4008 (or org-agenda-multi (org-agenda-fit-window-to-buffer)) 4108 (or org-agenda-multi (org-agenda-fit-window-to-buffer))
@@ -4026,6 +4126,20 @@ given in `org-agenda-start-on-weekday'."
4026 (setq buffer-read-only t) 4126 (setq buffer-read-only t)
4027 (message "")))) 4127 (message ""))))
4028 4128
4129(autoload 'org-agenda-list "org-agenda" "\
4130Produce a daily/weekly view from all files in variable `org-agenda-files'.
4131The view will be for the current day or week, but from the overview buffer
4132you will be able to go to other days/weeks.
4133
4134With a numeric prefix argument in an interactive call, the agenda will
4135span ARG days. Lisp programs should instead specify SPAN to change
4136the number of days. SPAN defaults to `org-agenda-span'.
4137
4138START-DAY defaults to TODAY, or to the most recent match for the weekday
4139given in `org-agenda-start-on-weekday'.
4140
4141\(fn &optional ARG START-DAY SPAN)" t nil)
4142
4029(defun org-agenda-ndays-to-span (n) 4143(defun org-agenda-ndays-to-span (n)
4030 "Return a span symbol for a span of N days, or N if none matches." 4144 "Return a span symbol for a span of N days, or N if none matches."
4031 (cond ((symbolp n) n) 4145 (cond ((symbolp n) n)
@@ -4328,6 +4442,52 @@ in `org-agenda-text-search-extra-files'."
4328 (org-agenda-finalize) 4442 (org-agenda-finalize)
4329 (setq buffer-read-only t)))) 4443 (setq buffer-read-only t))))
4330 4444
4445(autoload 'org-search-view "org-agenda" "\
4446Show all entries that contain a phrase or words or regular expressions.
4447
4448With optional prefix argument TODO-ONLY, only consider entries that are
4449TODO entries. The argument STRING can be used to pass a default search
4450string into this function. If EDIT-AT is non-nil, it means that the
4451user should get a chance to edit this string, with cursor at position
4452EDIT-AT.
4453
4454The search string can be viewed either as a phrase that should be found as
4455is, or it can be broken into a number of snippets, each of which must match
4456in a Boolean way to select an entry. The default depends on the variable
4457`org-agenda-search-view-always-boolean'.
4458Even if this is turned off (the default) you can always switch to
4459Boolean search dynamically by preceding the first word with \"+\" or \"-\".
4460
4461The default is a direct search of the whole phrase, where each space in
4462the search string can expand to an arbitrary amount of whitespace,
4463including newlines.
4464
4465If using a Boolean search, the search string is split on whitespace and
4466each snippet is searched separately, with logical AND to select an entry.
4467Words prefixed with a minus must *not* occur in the entry. Words without
4468a prefix or prefixed with a plus must occur in the entry. Matching is
4469case-insensitive. Words are enclosed by word delimiters (i.e. they must
4470match whole words, not parts of a word) if
4471`org-agenda-search-view-force-full-words' is set (default is nil).
4472
4473Boolean search snippets enclosed by curly braces are interpreted as
4474regular expressions that must or (when preceded with \"-\") must not
4475match in the entry. Snippets enclosed into double quotes will be taken
4476as a whole, to include whitespace.
4477
4478- If the search string starts with an asterisk, search only in headlines.
4479- If (possibly after the leading star) the search string starts with an
4480 exclamation mark, this also means to look at TODO entries only, an effect
4481 that can also be achieved with a prefix argument.
4482- If (possibly after star and exclamation mark) the search string starts
4483 with a colon, this will mean that the (non-regexp) snippets of the
4484 Boolean search must match as full words.
4485
4486This command searches the agenda files, and in addition the files listed
4487in `org-agenda-text-search-extra-files'.
4488
4489\(fn &optional TODO-ONLY STRING EDIT-AT)" t nil)
4490
4331;;; Agenda TODO list 4491;;; Agenda TODO list
4332 4492
4333(defvar org-select-this-todo-keyword nil) 4493(defvar org-select-this-todo-keyword nil)
@@ -4418,6 +4578,15 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
4418 (org-agenda-finalize) 4578 (org-agenda-finalize)
4419 (setq buffer-read-only t)))) 4579 (setq buffer-read-only t))))
4420 4580
4581(autoload 'org-todo-list "org-agenda" "\
4582Show all (not done) TODO entries from all agenda file in a single list.
4583The prefix arg can be used to select a specific TODO keyword and limit
4584the list to these. When using \\[universal-argument], you will be prompted
4585for a keyword. A numeric prefix directly selects the Nth keyword in
4586`org-todo-keywords-1'.
4587
4588\(fn &optional ARG)" t nil)
4589
4421;;; Agenda tags match 4590;;; Agenda tags match
4422 4591
4423;;;###autoload 4592;;;###autoload
@@ -4503,6 +4672,12 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
4503 (org-agenda-finalize) 4672 (org-agenda-finalize)
4504 (setq buffer-read-only t)))) 4673 (setq buffer-read-only t))))
4505 4674
4675(autoload 'org-tags-view "org-agenda" "\
4676Show all headlines for all `org-agenda-files' matching a TAGS criterion.
4677The prefix arg TODO-ONLY limits the search to TODO entries.
4678
4679\(fn &optional TODO-ONLY MATCH)" t nil)
4680
4506;;; Agenda Finding stuck projects 4681;;; Agenda Finding stuck projects
4507 4682
4508(defvar org-agenda-skip-regexp nil 4683(defvar org-agenda-skip-regexp nil
@@ -4731,6 +4906,14 @@ of what a project is and how to check if it stuck, customize the variable
4731 (setq org-agenda-redo-command 4906 (setq org-agenda-redo-command
4732 `(org-agenda-list-stuck-projects ,current-prefix-arg))))) 4907 `(org-agenda-list-stuck-projects ,current-prefix-arg)))))
4733 4908
4909(autoload 'org-agenda-list-stuck-projects "org-agenda" "\
4910Create agenda view for projects that are stuck.
4911Stuck projects are project that have no next actions. For the definitions
4912of what a project is and how to check if it stuck, customize the variable
4913`org-stuck-projects'.
4914
4915\(fn &rest IGNORE)" t nil)
4916
4734;;; Diary integration 4917;;; Diary integration
4735 4918
4736(defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param. 4919(defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param.
@@ -4909,6 +5092,35 @@ function from a program - use `org-agenda-get-day-entries' instead."
4909 (if results 5092 (if results
4910 (concat (org-agenda-finalize-entries results) "\n")))) 5093 (concat (org-agenda-finalize-entries results) "\n"))))
4911 5094
5095(autoload 'org-diary "org-agenda" "\
5096Return diary information from org files.
5097This function can be used in a \"sexp\" diary entry in the Emacs calendar.
5098It accesses org files and extracts information from those files to be
5099listed in the diary. The function accepts arguments specifying what
5100items should be listed. For a list of arguments allowed here, see the
5101variable `org-agenda-entry-types'.
5102
5103The call in the diary file should look like this:
5104
5105 &%%(org-diary) ~/path/to/some/orgfile.org
5106
5107Use a separate line for each org file to check. Or, if you omit the file name,
5108all files listed in `org-agenda-files' will be checked automatically:
5109
5110 &%%(org-diary)
5111
5112If you don't give any arguments (as in the example above), the default
5113arguments (:deadline :scheduled :timestamp :sexp) are used.
5114So the example above may also be written as
5115
5116 &%%(org-diary :deadline :timestamp :sexp :scheduled)
5117
5118The function expects the lisp variables `entry' and `date' to be provided
5119by the caller, because this is how the calendar works. Don't use this
5120function from a program - use `org-agenda-get-day-entries' instead.
5121
5122\(fn &rest ARGS)" nil nil)
5123
4912;;; Agenda entry finders 5124;;; Agenda entry finders
4913 5125
4914(defun org-agenda-get-day-entries (file date &rest args) 5126(defun org-agenda-get-day-entries (file date &rest args)
@@ -5035,7 +5247,6 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
5035 (>= days n) 5247 (>= days n)
5036 (<= days n)))) 5248 (<= days n))))
5037 5249
5038;;;###autoload
5039(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item 5250(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
5040 (&optional end) 5251 (&optional end)
5041 "Do we have a reason to ignore this TODO entry because it has a time stamp?" 5252 "Do we have a reason to ignore this TODO entry because it has a time stamp?"
@@ -5098,6 +5309,11 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
5098 (match-string 1) org-agenda-todo-ignore-timestamp)) 5309 (match-string 1) org-agenda-todo-ignore-timestamp))
5099 (t)))))))))) 5310 (t))))))))))
5100 5311
5312(autoload 'org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item "org-agenda" "\
5313Do we have a reason to ignore this TODO entry because it has a time stamp?
5314
5315\(fn &optional END)" nil nil)
5316
5101(defconst org-agenda-no-heading-message 5317(defconst org-agenda-no-heading-message
5102 "No heading for this item in buffer or region.") 5318 "No heading for this item in buffer or region.")
5103 5319
@@ -5133,12 +5349,13 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
5133 "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) 5349 "\\|\\(<%%\\(([^>\n]+)\\)>\\)"))
5134 marker hdmarker deadlinep scheduledp clockp closedp inactivep 5350 marker hdmarker deadlinep scheduledp clockp closedp inactivep
5135 donep tmp priority category category-pos ee txt timestr tags 5351 donep tmp priority category category-pos ee txt timestr tags
5136 b0 b3 e3 head todo-state end-of-match show-all warntime) 5352 b0 b3 e3 head todo-state end-of-match show-all warntime habitp)
5137 (goto-char (point-min)) 5353 (goto-char (point-min))
5138 (while (setq end-of-match (re-search-forward regexp nil t)) 5354 (while (setq end-of-match (re-search-forward regexp nil t))
5139 (setq b0 (match-beginning 0) 5355 (setq b0 (match-beginning 0)
5140 b3 (match-beginning 3) e3 (match-end 3) 5356 b3 (match-beginning 3) e3 (match-end 3)
5141 todo-state (save-match-data (ignore-errors (org-get-todo-state))) 5357 todo-state (save-match-data (ignore-errors (org-get-todo-state)))
5358 habitp (and (functionp 'org-is-habit-p) (save-match-data (org-is-habit-p)))
5142 show-all (or (eq org-agenda-repeating-timestamp-show-all t) 5359 show-all (or (eq org-agenda-repeating-timestamp-show-all t)
5143 (member todo-state 5360 (member todo-state
5144 org-agenda-repeating-timestamp-show-all))) 5361 org-agenda-repeating-timestamp-show-all)))
@@ -5190,7 +5407,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
5190 (setq txt (org-agenda-format-item 5407 (setq txt (org-agenda-format-item
5191 (if inactivep org-agenda-inactive-leader nil) 5408 (if inactivep org-agenda-inactive-leader nil)
5192 head category tags timestr 5409 head category tags timestr
5193 remove-re t))) 5410 remove-re habitp)))
5194 (setq priority (org-get-priority txt)) 5411 (setq priority (org-get-priority txt))
5195 (org-add-props txt props 5412 (org-add-props txt props
5196 'org-marker marker 'org-hd-marker hdmarker) 5413 'org-marker marker 'org-hd-marker hdmarker)
@@ -5237,7 +5454,8 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
5237 tags (save-excursion (org-backward-heading-same-level 0) 5454 tags (save-excursion (org-backward-heading-same-level 0)
5238 (org-get-tags-at)) 5455 (org-get-tags-at))
5239 todo-state (org-get-todo-state) 5456 todo-state (org-get-todo-state)
5240 warntime (org-entry-get (point) "APPT_WARNTIME")) 5457 warntime (org-entry-get (point) "APPT_WARNTIME")
5458 extra nil)
5241 5459
5242 (dolist (r (if (stringp result) 5460 (dolist (r (if (stringp result)
5243 (list result) 5461 (list result)
@@ -5848,7 +6066,7 @@ FRACTION is what fraction of the head-warning time has passed."
5848 (concat "<" start-time ">")) 6066 (concat "<" start-time ">"))
5849 ((= d2 d0) 6067 ((= d2 d0)
5850 (concat "<" end-time ">"))) 6068 (concat "<" end-time ">")))
5851 remove-re t)))) 6069 remove-re))))
5852 (org-add-props txt props 6070 (org-add-props txt props
5853 'org-marker marker 'org-hd-marker hdmarker 6071 'org-marker marker 'org-hd-marker hdmarker
5854 'type "block" 'date date 6072 'type "block" 'date date
@@ -7059,7 +7277,7 @@ Negative selection means regexp must not match for selection of an entry."
7059 (move-beginning-of-line 1))))) 7277 (move-beginning-of-line 1)))))
7060 7278
7061(defun org-agenda-later (arg) 7279(defun org-agenda-later (arg)
7062 "Go forward in time by thee current span. 7280 "Go forward in time by the current span.
7063With prefix ARG, go forward that many times the current span." 7281With prefix ARG, go forward that many times the current span."
7064 (interactive "p") 7282 (interactive "p")
7065 (org-agenda-check-type t 'agenda) 7283 (org-agenda-check-type t 'agenda)
@@ -7071,7 +7289,7 @@ With prefix ARG, go forward that many times the current span."
7071 greg2) 7289 greg2)
7072 (cond 7290 (cond
7073 ((numberp span) 7291 ((numberp span)
7074 (setq sd (+ span sd))) 7292 (setq sd (+ (* span arg) sd)))
7075 ((eq span 'day) 7293 ((eq span 'day)
7076 (setq sd (+ arg sd))) 7294 (setq sd (+ arg sd)))
7077 ((eq span 'week) 7295 ((eq span 'week)
@@ -8654,7 +8872,6 @@ When `org-agenda-diary-file' points to a file,
8654`org-agenda-diary-entry-in-org-file' is called instead to create 8872`org-agenda-diary-entry-in-org-file' is called instead to create
8655entries in that Org-mode file." 8873entries in that Org-mode file."
8656 (interactive) 8874 (interactive)
8657 (org-agenda-check-type t 'agenda 'timeline)
8658 (if (not (eq org-agenda-diary-file 'diary-file)) 8875 (if (not (eq org-agenda-diary-file 'diary-file))
8659 (org-agenda-diary-entry-in-org-file) 8876 (org-agenda-diary-entry-in-org-file)
8660 (require 'diary-lib) 8877 (require 'diary-lib)
@@ -8765,6 +8982,12 @@ This is a command that has to be installed in `calendar-mode-map'."
8765 (calendar-cursor-to-date)) 8982 (calendar-cursor-to-date))
8766 nil)) 8983 nil))
8767 8984
8985(autoload 'org-calendar-goto-agenda "org-agenda" "\
8986Compute the Org-mode agenda for the calendar date displayed at the cursor.
8987This is a command that has to be installed in `calendar-mode-map'.
8988
8989\(fn)" t nil)
8990
8768(defun org-agenda-convert-date () 8991(defun org-agenda-convert-date ()
8769 (interactive) 8992 (interactive)
8770 (org-agenda-check-type t 'agenda 'timeline) 8993 (org-agenda-check-type t 'agenda 'timeline)
@@ -9207,6 +9430,40 @@ to override `appt-message-warning-time'."
9207 (message "No event to add") 9430 (message "No event to add")
9208 (message "Added %d event%s for today" cnt (if (> cnt 1) "s" ""))))) 9431 (message "Added %d event%s for today" cnt (if (> cnt 1) "s" "")))))
9209 9432
9433(autoload 'org-agenda-to-appt "org-agenda" "\
9434Activate appointments found in `org-agenda-files'.
9435With a \\[universal-argument] prefix, refresh the list of
9436appointments.
9437
9438If FILTER is t, interactively prompt the user for a regular
9439expression, and filter out entries that don't match it.
9440
9441If FILTER is a string, use this string as a regular expression
9442for filtering entries out.
9443
9444If FILTER is a function, filter out entries against which
9445calling the function returns nil. This function takes one
9446argument: an entry from `org-agenda-get-day-entries'.
9447
9448FILTER can also be an alist with the car of each cell being
9449either 'headline or 'category. For example:
9450
9451 '((headline \"IMPORTANT\")
9452 (category \"Work\"))
9453
9454will only add headlines containing IMPORTANT or headlines
9455belonging to the \"Work\" category.
9456
9457ARGS are symbols indicating what kind of entries to consider.
9458By default `org-agenda-to-appt' will use :deadline, :scheduled
9459and :timestamp entries. See the docstring of `org-diary' for
9460details and examples.
9461
9462If an entry as a APPT_WARNTIME property, its value will be used
9463to override `appt-message-warning-time'.
9464
9465\(fn &optional REFRESH FILTER &rest ARGS)" t nil)
9466
9210(defun org-agenda-todayp (date) 9467(defun org-agenda-todayp (date)
9211 "Does DATE mean today, when considering `org-extend-today-until'?" 9468 "Does DATE mean today, when considering `org-extend-today-until'?"
9212 (let ((today (org-today)) 9469 (let ((today (org-today))
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index 29b883824ef..d41a1d38a89 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -181,6 +181,7 @@ if LOCATION is not given, the value of `org-archive-location' is used."
181 (file-name-nondirectory 181 (file-name-nondirectory
182 (buffer-file-name (buffer-base-buffer)))))) 182 (buffer-file-name (buffer-base-buffer))))))
183 183
184;;;###autoload
184(defun org-archive-subtree (&optional find-done) 185(defun org-archive-subtree (&optional find-done)
185 "Move the current subtree to the archive. 186 "Move the current subtree to the archive.
186The archive can be a certain top-level heading in the current file, or in 187The archive can be a certain top-level heading in the current file, or in
@@ -369,6 +370,7 @@ this heading."
369 (if (looking-at "^[ \t]*$") 370 (if (looking-at "^[ \t]*$")
370 (outline-next-visible-heading 1)))) 371 (outline-next-visible-heading 1))))
371 372
373;;;###autoload
372(defun org-archive-to-archive-sibling () 374(defun org-archive-to-archive-sibling ()
373 "Archive the current heading by moving it under the archive sibling. 375 "Archive the current heading by moving it under the archive sibling.
374The archive sibling is a sibling of the heading with the heading name 376The archive sibling is a sibling of the heading with the heading name
@@ -483,6 +485,7 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
483 (goto-char end))))) 485 (goto-char end)))))
484 (message "%d trees archived" cntarch))) 486 (message "%d trees archived" cntarch)))
485 487
488;;;###autoload
486(defun org-toggle-archive-tag (&optional find-done) 489(defun org-toggle-archive-tag (&optional find-done)
487 "Toggle the archive tag for the current headline. 490 "Toggle the archive tag for the current headline.
488With prefix ARG, check all children of current headline and offer tagging 491With prefix ARG, check all children of current headline and offer tagging
@@ -537,4 +540,8 @@ This command is set with the variable `org-archive-default-command'."
537 540
538(provide 'org-archive) 541(provide 'org-archive)
539 542
543;; Local variables:
544;; generated-autoload-file: "org-loaddefs.el"
545;; End:
546
540;;; org-archive.el ends here 547;;; org-archive.el ends here
diff --git a/lisp/org/org-ascii.el b/lisp/org/org-ascii.el
index 655b8db668d..575b830f2c0 100644
--- a/lisp/org/org-ascii.el
+++ b/lisp/org/org-ascii.el
@@ -553,6 +553,7 @@ publishing directory."
553 (kill-buffer (current-buffer))) 553 (kill-buffer (current-buffer)))
554 (current-buffer)))) 554 (current-buffer))))
555 555
556;;;###autoload
556(defun org-export-ascii-preprocess (parameters) 557(defun org-export-ascii-preprocess (parameters)
557 "Do extra work for ASCII export." 558 "Do extra work for ASCII export."
558 ;; 559 ;;
@@ -726,4 +727,8 @@ publishing directory."
726 727
727(provide 'org-ascii) 728(provide 'org-ascii)
728 729
730;; Local variables:
731;; generated-autoload-file: "org-loaddefs.el"
732;; End:
733
729;;; org-ascii.el ends here 734;;; org-ascii.el ends here
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el
index e02d7e07a4c..25bd6e89d97 100644
--- a/lisp/org/org-attach.el
+++ b/lisp/org/org-attach.el
@@ -451,4 +451,8 @@ prefix."
451 451
452(provide 'org-attach) 452(provide 'org-attach)
453 453
454;; Local variables:
455;; generated-autoload-file: "org-loaddefs.el"
456;; End:
457
454;;; org-attach.el ends here 458;;; org-attach.el ends here
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el
index be395ad3927..0fcf27565d5 100644
--- a/lisp/org/org-bbdb.el
+++ b/lisp/org/org-bbdb.el
@@ -338,7 +338,7 @@ This is used by Org to re-create the anniversary hash table."
338(add-hook 'bbdb-after-change-hook 'org-bbdb-updated) 338(add-hook 'bbdb-after-change-hook 'org-bbdb-updated)
339 339
340;;;###autoload 340;;;###autoload
341(defun org-bbdb-anniversaries() 341(defun org-bbdb-anniversaries ()
342 "Extract anniversaries from BBDB for display in the agenda." 342 "Extract anniversaries from BBDB for display in the agenda."
343 (require 'bbdb) 343 (require 'bbdb)
344 (require 'diary-lib) 344 (require 'diary-lib)
@@ -433,4 +433,8 @@ END:VEVENT\n"
433 433
434(provide 'org-bbdb) 434(provide 'org-bbdb)
435 435
436;; Local variables:
437;; generated-autoload-file: "org-loaddefs.el"
438;; End:
439
436;;; org-bbdb.el ends here 440;;; org-bbdb.el ends here
diff --git a/lisp/org/org-beamer.el b/lisp/org/org-beamer.el
index b5f3013e000..73d15416e60 100644
--- a/lisp/org/org-beamer.el
+++ b/lisp/org/org-beamer.el
@@ -228,7 +228,7 @@ the tag does not have any semantic meaning."
228 (org-entry-put nil "BEAMER_env" (match-string 1 tags))) 228 (org-entry-put nil "BEAMER_env" (match-string 1 tags)))
229 (t (org-entry-delete nil "BEAMER_env")))))) 229 (t (org-entry-delete nil "BEAMER_env"))))))
230 230
231 231;;;###autoload
232(defun org-beamer-sectioning (level text) 232(defun org-beamer-sectioning (level text)
233 "Return the sectioning entry for the current headline. 233 "Return the sectioning entry for the current headline.
234LEVEL is the reduced level of the headline. 234LEVEL is the reduced level of the headline.
@@ -370,6 +370,7 @@ org-beamer-extra are all scoped into this function dynamically."
370 "The keymap for `org-beamer-mode'.") 370 "The keymap for `org-beamer-mode'.")
371(define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment) 371(define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment)
372 372
373;;;###autoload
373(define-minor-mode org-beamer-mode 374(define-minor-mode org-beamer-mode
374 "Special support for editing Org-mode files made to export to beamer." 375 "Special support for editing Org-mode files made to export to beamer."
375 nil " Bm" nil) 376 nil " Bm" nil)
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index 9d20814a2ca..1dfffc6fe1d 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -434,9 +434,10 @@ Turning on this mode runs the normal hook `org-capture-mode-hook'."
434 434
435;;; The main commands 435;;; The main commands
436 436
437;;;###autoload
438(defvar org-capture-initial nil) 437(defvar org-capture-initial nil)
439(defvar org-capture-entry nil) 438(defvar org-capture-entry nil)
439
440;;;###autoload
440(defun org-capture-string (string &optional keys) 441(defun org-capture-string (string &optional keys)
441 (interactive "sInitial text: \n") 442 (interactive "sInitial text: \n")
442 (let ((org-capture-initial string) 443 (let ((org-capture-initial string)
@@ -1249,7 +1250,8 @@ Of course, if exact position has been required, just put it there."
1249 (save-restriction 1250 (save-restriction
1250 (widen) 1251 (widen)
1251 (goto-char pos) 1252 (goto-char pos)
1252 (bookmark-set "org-capture-last-stored") 1253 (with-demoted-errors
1254 (bookmark-set "org-capture-last-stored"))
1253 (move-marker org-capture-last-stored-marker (point))))))) 1255 (move-marker org-capture-last-stored-marker (point)))))))
1254 1256
1255(defun org-capture-narrow (beg end) 1257(defun org-capture-narrow (beg end)
@@ -1280,7 +1282,7 @@ Point will remain at the first line after the inserted text."
1280 (goto-char pos))) 1282 (goto-char pos)))
1281 1283
1282(defvar org-clock-marker) ; Defined in org.el 1284(defvar org-clock-marker) ; Defined in org.el
1283;;;###autoload 1285
1284(defun org-capture-insert-template-here () 1286(defun org-capture-insert-template-here ()
1285 (let* ((template (org-capture-get :template)) 1287 (let* ((template (org-capture-get :template))
1286 (type (org-capture-get :type)) 1288 (type (org-capture-get :type))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index bb6f2b955b3..3f252fd8c32 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -201,7 +201,10 @@ file name play this sound file. If not possible, fall back to beep"
201 (const :tag "Standard beep" t) 201 (const :tag "Standard beep" t)
202 (file :tag "Play sound file"))) 202 (file :tag "Play sound file")))
203 203
204(defcustom org-clock-modeline-total 'auto 204(define-obsolete-variable-alias 'org-clock-modeline-total
205 'org-clock-mode-line-total "24.3")
206
207(defcustom org-clock-mode-line-total 'auto
205 "Default setting for the time included for the mode line clock. 208 "Default setting for the time included for the mode line clock.
206This can be overruled locally using the CLOCK_MODELINE_TOTAL property. 209This can be overruled locally using the CLOCK_MODELINE_TOTAL property.
207Allowed values are: 210Allowed values are:
@@ -962,6 +965,7 @@ to be CLOCKED OUT.")))
962 (not (memq ch '(?K ?G ?S ?C)))) 965 (not (memq ch '(?K ?G ?S ?C))))
963 fail-quietly))))) 966 fail-quietly)))))
964 967
968;;;###autoload
965(defun org-resolve-clocks (&optional only-dangling-p prompt-fn last-valid) 969(defun org-resolve-clocks (&optional only-dangling-p prompt-fn last-valid)
966 "Resolve all currently open org-mode clocks. 970 "Resolve all currently open org-mode clocks.
967If `only-dangling-p' is non-nil, only ask to resolve dangling 971If `only-dangling-p' is non-nil, only ask to resolve dangling
@@ -1059,6 +1063,8 @@ so long."
1059 (setq org-clock-current-task nil)) 1063 (setq org-clock-current-task nil))
1060 1064
1061(defvar org-clock-out-time nil) ; store the time of the last clock-out 1065(defvar org-clock-out-time nil) ; store the time of the last clock-out
1066
1067;;;###autoload
1062(defun org-clock-in (&optional select start-time) 1068(defun org-clock-in (&optional select start-time)
1063 "Start the clock on the current item. 1069 "Start the clock on the current item.
1064If necessary, clock-out of the currently active clock. 1070If necessary, clock-out of the currently active clock.
@@ -1132,7 +1138,6 @@ make this the default behavior.)"
1132 (if (and (eobp) (not (org-at-heading-p))) 1138 (if (and (eobp) (not (org-at-heading-p)))
1133 (point-at-bol 0) 1139 (point-at-bol 0)
1134 (point))) 1140 (point)))
1135 (run-hooks 'org-clock-in-prepare-hook)
1136 (save-excursion 1141 (save-excursion
1137 (when (and selected-task (marker-buffer selected-task)) 1142 (when (and selected-task (marker-buffer selected-task))
1138 ;; There is a selected task, move to the correct buffer 1143 ;; There is a selected task, move to the correct buffer
@@ -1151,6 +1156,7 @@ make this the default behavior.)"
1151 ;; beginning of the heading, since the 1156 ;; beginning of the heading, since the
1152 ;; user is liking to insert stuff here 1157 ;; user is liking to insert stuff here
1153 ;; manually 1158 ;; manually
1159 (run-hooks 'org-clock-in-prepare-hook)
1154 (org-clock-history-push)) 1160 (org-clock-history-push))
1155 (org-clock-set-current) 1161 (org-clock-set-current)
1156 (cond ((functionp org-clock-in-switch-to-state) 1162 (cond ((functionp org-clock-in-switch-to-state)
@@ -1310,10 +1316,10 @@ for a todo state to switch to, overriding the existing value
1310This is for the currently running clock as it is displayed 1316This is for the currently running clock as it is displayed
1311in the mode line. This function looks at the properties 1317in the mode line. This function looks at the properties
1312LAST_REPEAT and in particular CLOCK_MODELINE_TOTAL and the 1318LAST_REPEAT and in particular CLOCK_MODELINE_TOTAL and the
1313corresponding variable `org-clock-modeline-total' and then 1319corresponding variable `org-clock-mode-line-total' and then
1314decides which time to use." 1320decides which time to use."
1315 (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL") 1321 (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL")
1316 (symbol-name org-clock-modeline-total))) 1322 (symbol-name org-clock-mode-line-total)))
1317 (lr (org-entry-get nil "LAST_REPEAT"))) 1323 (lr (org-entry-get nil "LAST_REPEAT")))
1318 (cond 1324 (cond
1319 ((equal cmt "current") 1325 ((equal cmt "current")
@@ -1428,6 +1434,7 @@ line and position cursor in that line."
1428 (and (re-search-forward org-property-end-re nil t) 1434 (and (re-search-forward org-property-end-re nil t)
1429 (goto-char (match-beginning 0)))))))) 1435 (goto-char (match-beginning 0))))))))
1430 1436
1437;;;###autoload
1431(defun org-clock-out (&optional switch-to-state fail-quietly at-time) 1438(defun org-clock-out (&optional switch-to-state fail-quietly at-time)
1432 "Stop the currently running clock. 1439 "Stop the currently running clock.
1433Throw an error if there is no running clock and FAIL-QUIETLY is nil. 1440Throw an error if there is no running clock and FAIL-QUIETLY is nil.
@@ -1587,6 +1594,7 @@ UPDOWN tells whether to change 'up or 'down."
1587 ((eq org-ts-what 'year) (* 24 3600 365.2))))) 1594 ((eq org-ts-what 'year) (* 24 3600 365.2)))))
1588 org-ts-what 'updown))))))) 1595 org-ts-what 'updown)))))))
1589 1596
1597;;;###autoload
1590(defun org-clock-cancel () 1598(defun org-clock-cancel ()
1591 "Cancel the running clock by removing the start timestamp." 1599 "Cancel the running clock by removing the start timestamp."
1592 (interactive) 1600 (interactive)
@@ -1613,6 +1621,7 @@ UPDOWN tells whether to change 'up or 'down."
1613 (message "Clock canceled") 1621 (message "Clock canceled")
1614 (run-hooks 'org-clock-cancel-hook)) 1622 (run-hooks 'org-clock-cancel-hook))
1615 1623
1624;;;###autoload
1616(defun org-clock-goto (&optional select) 1625(defun org-clock-goto (&optional select)
1617 "Go to the currently clocked-in entry, or to the most recently clocked one. 1626 "Go to the currently clocked-in entry, or to the most recently clocked one.
1618With prefix arg SELECT, offer recently clocked tasks for selection." 1627With prefix arg SELECT, offer recently clocked tasks for selection."
@@ -1651,6 +1660,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
1651 (let ((range (org-clock-special-range 'today))) 1660 (let ((range (org-clock-special-range 'today)))
1652 (org-clock-sum (car range) (cadr range) nil :org-clock-minutes-today))) 1661 (org-clock-sum (car range) (cadr range) nil :org-clock-minutes-today)))
1653 1662
1663;;;###autoload
1654(defun org-clock-sum (&optional tstart tend headline-filter propname) 1664(defun org-clock-sum (&optional tstart tend headline-filter propname)
1655 "Sum the times for each subtree. 1665 "Sum the times for each subtree.
1656Puts the resulting times in minutes as a text property on each headline. 1666Puts the resulting times in minutes as a text property on each headline.
@@ -1749,6 +1759,7 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
1749 (org-clock-sum tstart) 1759 (org-clock-sum tstart)
1750 org-clock-file-total-minutes))) 1760 org-clock-file-total-minutes)))
1751 1761
1762;;;###autoload
1752(defun org-clock-display (&optional total-only) 1763(defun org-clock-display (&optional total-only)
1753 "Show subtree times in the entire buffer. 1764 "Show subtree times in the entire buffer.
1754If TOTAL-ONLY is non-nil, only show the total time for the entire file 1765If TOTAL-ONLY is non-nil, only show the total time for the entire file
@@ -1859,7 +1870,7 @@ and is only done if the variable `org-clock-out-when-done' is not nil."
1859 'org-clock-out-if-current) 1870 'org-clock-out-if-current)
1860 1871
1861;;;###autoload 1872;;;###autoload
1862(defun org-get-clocktable (&rest props) 1873(defun org-clock-get-clocktable (&rest props)
1863 "Get a formatted clocktable with parameters according to PROPS. 1874 "Get a formatted clocktable with parameters according to PROPS.
1864The table is created in a temporary buffer, fully formatted and 1875The table is created in a temporary buffer, fully formatted and
1865fontified, and then returned." 1876fontified, and then returned."
@@ -1879,6 +1890,7 @@ fontified, and then returned."
1879 (re-search-forward "^[ \t]*#\\+END" nil t) 1890 (re-search-forward "^[ \t]*#\\+END" nil t)
1880 (point-at-bol))))) 1891 (point-at-bol)))))
1881 1892
1893;;;###autoload
1882(defun org-clock-report (&optional arg) 1894(defun org-clock-report (&optional arg)
1883 "Create a table containing a report about clocked time. 1895 "Create a table containing a report about clocked time.
1884If the cursor is inside an existing clocktable block, then the table 1896If the cursor is inside an existing clocktable block, then the table
@@ -2165,6 +2177,7 @@ the currently selected interval size."
2165 (org-update-dblock) 2177 (org-update-dblock)
2166 t))))) 2178 t)))))
2167 2179
2180;;;###autoload
2168(defun org-dblock-write:clocktable (params) 2181(defun org-dblock-write:clocktable (params)
2169 "Write the standard clocktable." 2182 "Write the standard clocktable."
2170 (setq params (org-combine-plists org-clocktable-defaults params)) 2183 (setq params (org-combine-plists org-clocktable-defaults params))
@@ -2675,6 +2688,48 @@ This function is made for clock tables."
2675(defvar org-clock-loaded nil 2688(defvar org-clock-loaded nil
2676 "Was the clock file loaded?") 2689 "Was the clock file loaded?")
2677 2690
2691(defun org-clock-update-time-maybe ()
2692 "If this is a CLOCK line, update it and return t.
2693Otherwise, return nil."
2694 (interactive)
2695 (save-excursion
2696 (beginning-of-line 1)
2697 (skip-chars-forward " \t")
2698 (when (looking-at org-clock-string)
2699 (let ((re (concat "[ \t]*" org-clock-string
2700 " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]"
2701 "\\([ \t]*=>.*\\)?\\)?"))
2702 ts te h m s neg)
2703 (cond
2704 ((not (looking-at re))
2705 nil)
2706 ((not (match-end 2))
2707 (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
2708 (> org-clock-marker (point))
2709 (<= org-clock-marker (point-at-eol)))
2710 ;; The clock is running here
2711 (setq org-clock-start-time
2712 (apply 'encode-time
2713 (org-parse-time-string (match-string 1))))
2714 (org-clock-update-mode-line)))
2715 (t
2716 (and (match-end 4) (delete-region (match-beginning 4) (match-end 4)))
2717 (end-of-line 1)
2718 (setq ts (match-string 1)
2719 te (match-string 3))
2720 (setq s (- (org-float-time
2721 (apply 'encode-time (org-parse-time-string te)))
2722 (org-float-time
2723 (apply 'encode-time (org-parse-time-string ts))))
2724 neg (< s 0)
2725 s (abs s)
2726 h (floor (/ s 3600))
2727 s (- s (* 3600 h))
2728 m (floor (/ s 60))
2729 s (- s (* 60 s)))
2730 (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m))
2731 t))))))
2732
2678(defun org-clock-save () 2733(defun org-clock-save ()
2679 "Persist various clock-related data to disk. 2734 "Persist various clock-related data to disk.
2680The details of what will be saved are regulated by the variable 2735The details of what will be saved are regulated by the variable
@@ -2766,15 +2821,13 @@ The details of what will be saved are regulated by the variable
2766 (if (outline-invisible-p) 2821 (if (outline-invisible-p)
2767 (org-show-context)))))))))) 2822 (org-show-context))))))))))
2768 2823
2769;;;###autoload
2770(defun org-clock-persistence-insinuate ()
2771 "Set up hooks for clock persistence."
2772 (add-hook 'org-mode-hook 'org-clock-load)
2773 (add-hook 'kill-emacs-hook 'org-clock-save))
2774
2775;; Suggested bindings 2824;; Suggested bindings
2776(org-defkey org-mode-map "\C-c\C-x\C-e" 'org-clock-modify-effort-estimate) 2825(org-defkey org-mode-map "\C-c\C-x\C-e" 'org-clock-modify-effort-estimate)
2777 2826
2778(provide 'org-clock) 2827(provide 'org-clock)
2779 2828
2829;; Local variables:
2830;; generated-autoload-file: "org-loaddefs.el"
2831;; End:
2832
2780;;; org-clock.el ends here 2833;;; org-clock.el ends here
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index e17210b7ff5..1be105d44fb 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -686,6 +686,7 @@ around it."
686 (move-marker org-columns-top-level-marker org-entry-property-inherited-from) 686 (move-marker org-columns-top-level-marker org-entry-property-inherited-from)
687 (move-marker org-columns-top-level-marker (point)))) 687 (move-marker org-columns-top-level-marker (point))))
688 688
689;;;###autoload
689(defun org-columns (&optional columns-fmt-string) 690(defun org-columns (&optional columns-fmt-string)
690 "Turn on column view on an org-mode file. 691 "Turn on column view on an org-mode file.
691When COLUMNS-FMT-STRING is non-nil, use it as the column format." 692When COLUMNS-FMT-STRING is non-nil, use it as the column format."
@@ -1222,6 +1223,7 @@ of fields."
1222 (push row tbl))))) 1223 (push row tbl)))))
1223 (append (list title 'hline) (nreverse tbl))))) 1224 (append (list title 'hline) (nreverse tbl)))))
1224 1225
1226;;;###autoload
1225(defun org-dblock-write:columnview (params) 1227(defun org-dblock-write:columnview (params)
1226 "Write the column view table. 1228 "Write the column view table.
1227PARAMS is a property list of parameters: 1229PARAMS is a property list of parameters:
@@ -1334,6 +1336,7 @@ and tailing newline characters."
1334 (t (error "Garbage in listtable: %s" x)))) 1336 (t (error "Garbage in listtable: %s" x))))
1335 tbl "\n")) 1337 tbl "\n"))
1336 1338
1339;;;###autoload
1337(defun org-insert-columns-dblock () 1340(defun org-insert-columns-dblock ()
1338 "Create a dynamic block capturing a column view table." 1341 "Create a dynamic block capturing a column view table."
1339 (interactive) 1342 (interactive)
@@ -1357,6 +1360,7 @@ and tailing newline characters."
1357(defvar org-agenda-columns-compute-summary-properties); defined in org-agenda.el 1360(defvar org-agenda-columns-compute-summary-properties); defined in org-agenda.el
1358(defvar org-agenda-columns-add-appointments-to-effort-sum); as well 1361(defvar org-agenda-columns-add-appointments-to-effort-sum); as well
1359 1362
1363;;;###autoload
1360(defun org-agenda-columns () 1364(defun org-agenda-columns ()
1361 "Turn on or update column view in the agenda." 1365 "Turn on or update column view in the agenda."
1362 (interactive) 1366 (interactive)
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 76042849663..6e582b8c1d6 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -327,7 +327,7 @@ Works on both Emacs and XEmacs."
327 (apply 'propertize string properties))) 327 (apply 'propertize string properties)))
328 328
329(defmacro org-find-library-dir (library) 329(defmacro org-find-library-dir (library)
330 `(file-name-directory (locate-library ,library))) 330 `(file-name-directory (or (locate-library ,library) "")))
331 331
332(defun org-count-lines (s) 332(defun org-count-lines (s)
333 "How many lines in string S?" 333 "How many lines in string S?"
diff --git a/lisp/org/org-datetree.el b/lisp/org/org-datetree.el
index 4ff8e7d00d0..a2b2e5621da 100644
--- a/lisp/org/org-datetree.el
+++ b/lisp/org/org-datetree.el
@@ -207,4 +207,8 @@ before running this command, even though the command tries to be smart."
207 207
208(provide 'org-datetree) 208(provide 'org-datetree)
209 209
210;; Local variables:
211;; generated-autoload-file: "org-loaddefs.el"
212;; End:
213
210;;; org-datetree.el ends here 214;;; org-datetree.el ends here
diff --git a/lisp/org/org-docbook.el b/lisp/org/org-docbook.el
index 22cc5a7cdac..a40d5b969f3 100644
--- a/lisp/org/org-docbook.el
+++ b/lisp/org/org-docbook.el
@@ -1451,4 +1451,8 @@ the alist of previous items."
1451 1451
1452(provide 'org-docbook) 1452(provide 'org-docbook)
1453 1453
1454;; Local variables:
1455;; generated-autoload-file: "org-loaddefs.el"
1456;; End:
1457
1454;;; org-docbook.el ends here 1458;;; org-docbook.el ends here
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index 8b44d4936f5..5da2dec3fb3 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -478,7 +478,7 @@ containing `:begin', `:end', `:hiddenp', `:contents-begin',
478Assume point is at the beginning of the block." 478Assume point is at the beginning of the block."
479 (let ((case-fold-search t)) 479 (let ((case-fold-search t))
480 (if (not (save-excursion 480 (if (not (save-excursion
481 (re-search-forward "^[ \t]*#\\+END_CENTER" limit t))) 481 (re-search-forward "^[ \t]*#\\+END_CENTER[ \t]*$" limit t)))
482 ;; Incomplete block: parse it as a paragraph. 482 ;; Incomplete block: parse it as a paragraph.
483 (org-element-paragraph-parser limit) 483 (org-element-paragraph-parser limit)
484 (let ((block-end-line (match-beginning 0))) 484 (let ((block-end-line (match-beginning 0)))
@@ -494,7 +494,8 @@ Assume point is at the beginning of the block."
494 (forward-line) 494 (forward-line)
495 (point))) 495 (point)))
496 (end (save-excursion (skip-chars-forward " \r\t\n" limit) 496 (end (save-excursion (skip-chars-forward " \r\t\n" limit)
497 (if (eobp) (point) (point-at-bol))))) 497 (skip-chars-backward " \t")
498 (if (bolp) (point) (line-end-position)))))
498 (list 'center-block 499 (list 'center-block
499 (nconc 500 (nconc
500 (list :begin begin 501 (list :begin begin
@@ -524,7 +525,7 @@ Return a list whose CAR is `drawer' and CDR is a plist containing
524 525
525Assume point is at beginning of drawer." 526Assume point is at beginning of drawer."
526 (let ((case-fold-search t)) 527 (let ((case-fold-search t))
527 (if (not (save-excursion (re-search-forward "^[ \t]*:END:" limit t))) 528 (if (not (save-excursion (re-search-forward "^[ \t]*:END:[ \t]*$" limit t)))
528 ;; Incomplete drawer: parse it as a paragraph. 529 ;; Incomplete drawer: parse it as a paragraph.
529 (org-element-paragraph-parser limit) 530 (org-element-paragraph-parser limit)
530 (let ((drawer-end-line (match-beginning 0))) 531 (let ((drawer-end-line (match-beginning 0)))
@@ -544,7 +545,8 @@ Assume point is at beginning of drawer."
544 (forward-line) 545 (forward-line)
545 (point))) 546 (point)))
546 (end (progn (skip-chars-forward " \r\t\n" limit) 547 (end (progn (skip-chars-forward " \r\t\n" limit)
547 (if (eobp) (point) (point-at-bol))))) 548 (skip-chars-backward " \t")
549 (if (bolp) (point) (line-end-position)))))
548 (list 'drawer 550 (list 'drawer
549 (nconc 551 (nconc
550 (list :begin begin 552 (list :begin begin
@@ -578,7 +580,8 @@ containing `:block-name', `:begin', `:end', `:hiddenp',
578 580
579Assume point is at beginning of dynamic block." 581Assume point is at beginning of dynamic block."
580 (let ((case-fold-search t)) 582 (let ((case-fold-search t))
581 (if (not (save-excursion (re-search-forward org-dblock-end-re limit t))) 583 (if (not (save-excursion
584 (re-search-forward "^[ \t]*#\\+END:?[ \t]*$" limit t)))
582 ;; Incomplete block: parse it as a paragraph. 585 ;; Incomplete block: parse it as a paragraph.
583 (org-element-paragraph-parser limit) 586 (org-element-paragraph-parser limit)
584 (let ((block-end-line (match-beginning 0))) 587 (let ((block-end-line (match-beginning 0)))
@@ -598,7 +601,8 @@ Assume point is at beginning of dynamic block."
598 (forward-line) 601 (forward-line)
599 (point))) 602 (point)))
600 (end (progn (skip-chars-forward " \r\t\n" limit) 603 (end (progn (skip-chars-forward " \r\t\n" limit)
601 (if (eobp) (point) (point-at-bol))))) 604 (skip-chars-backward " \t")
605 (if (bolp) (point) (line-end-position)))))
602 (list 'dynamic-block 606 (list 'dynamic-block
603 (nconc 607 (nconc
604 (list :begin begin 608 (list :begin begin
@@ -653,7 +657,8 @@ Assume point is at the beginning of the footnote definition."
653 (contents-end (and contents-begin ending)) 657 (contents-end (and contents-begin ending))
654 (end (progn (goto-char ending) 658 (end (progn (goto-char ending)
655 (skip-chars-forward " \r\t\n" limit) 659 (skip-chars-forward " \r\t\n" limit)
656 (if (eobp) (point) (point-at-bol))))) 660 (skip-chars-backward " \t")
661 (if (bolp) (point) (line-end-position)))))
657 (list 'footnote-definition 662 (list 'footnote-definition
658 (nconc 663 (nconc
659 (list :label label 664 (list :label label
@@ -904,7 +909,8 @@ Assume point is at beginning of the inline task."
904 (forward-line) 909 (forward-line)
905 (point))) 910 (point)))
906 (end (progn (skip-chars-forward " \r\t\n" limit) 911 (end (progn (skip-chars-forward " \r\t\n" limit)
907 (if (eobp) (point) (point-at-bol)))) 912 (skip-chars-backward " \t")
913 (if (bolp) (point) (line-end-position))))
908 (inlinetask 914 (inlinetask
909 (list 'inlinetask 915 (list 'inlinetask
910 (nconc 916 (nconc
@@ -1108,7 +1114,8 @@ Assume point is at the beginning of the list."
1108 (unless (bolp) (forward-line)) 1114 (unless (bolp) (forward-line))
1109 (point))) 1115 (point)))
1110 (end (progn (skip-chars-forward " \r\t\n" limit) 1116 (end (progn (skip-chars-forward " \r\t\n" limit)
1111 (if (eobp) (point) (point-at-bol))))) 1117 (skip-chars-backward " \t")
1118 (if (bolp) (point) (line-end-position)))))
1112 ;; Return value. 1119 ;; Return value.
1113 (list 'plain-list 1120 (list 'plain-list
1114 (nconc 1121 (nconc
@@ -1145,7 +1152,7 @@ containing `:begin', `:end', `:hiddenp', `:contents-begin',
1145Assume point is at the beginning of the block." 1152Assume point is at the beginning of the block."
1146 (let ((case-fold-search t)) 1153 (let ((case-fold-search t))
1147 (if (not (save-excursion 1154 (if (not (save-excursion
1148 (re-search-forward "^[ \t]*#\\+END_QUOTE" limit t))) 1155 (re-search-forward "^[ \t]*#\\+END_QUOTE[ \t]*$" limit t)))
1149 ;; Incomplete block: parse it as a paragraph. 1156 ;; Incomplete block: parse it as a paragraph.
1150 (org-element-paragraph-parser limit) 1157 (org-element-paragraph-parser limit)
1151 (let ((block-end-line (match-beginning 0))) 1158 (let ((block-end-line (match-beginning 0)))
@@ -1162,7 +1169,8 @@ Assume point is at the beginning of the block."
1162 (forward-line) 1169 (forward-line)
1163 (point))) 1170 (point)))
1164 (end (progn (skip-chars-forward " \r\t\n" limit) 1171 (end (progn (skip-chars-forward " \r\t\n" limit)
1165 (if (eobp) (point) (point-at-bol))))) 1172 (skip-chars-backward " \t")
1173 (if (bolp) (point) (line-end-position)))))
1166 (list 'quote-block 1174 (list 'quote-block
1167 (nconc 1175 (nconc
1168 (list :begin begin 1176 (list :begin begin
@@ -1227,7 +1235,8 @@ Assume point is at the beginning of the block."
1227 (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(S-+\\)") 1235 (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(S-+\\)")
1228 (upcase (match-string-no-properties 1))))) 1236 (upcase (match-string-no-properties 1)))))
1229 (if (not (save-excursion 1237 (if (not (save-excursion
1230 (re-search-forward (concat "^[ \t]*#\\+END_" type) limit t))) 1238 (re-search-forward
1239 (format "^[ \t]*#\\+END_%s[ \t]*$" type) limit t)))
1231 ;; Incomplete block: parse it as a paragraph. 1240 ;; Incomplete block: parse it as a paragraph.
1232 (org-element-paragraph-parser limit) 1241 (org-element-paragraph-parser limit)
1233 (let ((block-end-line (match-beginning 0))) 1242 (let ((block-end-line (match-beginning 0)))
@@ -1243,8 +1252,9 @@ Assume point is at the beginning of the block."
1243 (pos-before-blank (progn (goto-char block-end-line) 1252 (pos-before-blank (progn (goto-char block-end-line)
1244 (forward-line) 1253 (forward-line)
1245 (point))) 1254 (point)))
1246 (end (progn (org-skip-whitespace) 1255 (end (progn (skip-chars-forward " \r\t\n" limit)
1247 (if (eobp) (point) (point-at-bol))))) 1256 (skip-chars-backward " \t")
1257 (if (bolp) (point) (line-end-position)))))
1248 (list 'special-block 1258 (list 'special-block
1249 (nconc 1259 (nconc
1250 (list :type type 1260 (list :type type
@@ -1295,7 +1305,8 @@ keywords."
1295 (begin (point-at-bol)) 1305 (begin (point-at-bol))
1296 (pos-before-blank (progn (forward-line) (point))) 1306 (pos-before-blank (progn (forward-line) (point)))
1297 (end (progn (skip-chars-forward " \r\t\n" limit) 1307 (end (progn (skip-chars-forward " \r\t\n" limit)
1298 (if (eobp) (point) (point-at-bol))))) 1308 (skip-chars-backward " \t")
1309 (if (bolp) (point) (line-end-position)))))
1299 (list 'babel-call 1310 (list 'babel-call
1300 (list :begin begin 1311 (list :begin begin
1301 :end end 1312 :end end
@@ -1338,7 +1349,8 @@ as keywords."
1338 (status (if time 'closed 'running)) 1349 (status (if time 'closed 'running))
1339 (post-blank (let ((before-blank (progn (forward-line) (point)))) 1350 (post-blank (let ((before-blank (progn (forward-line) (point))))
1340 (skip-chars-forward " \r\t\n" limit) 1351 (skip-chars-forward " \r\t\n" limit)
1341 (unless (eobp) (beginning-of-line)) 1352 (skip-chars-backward " \t")
1353 (unless (bolp) (end-of-line))
1342 (count-lines before-blank (point)))) 1354 (count-lines before-blank (point))))
1343 (end (point))) 1355 (end (point)))
1344 (list 'clock 1356 (list 'clock
@@ -1396,7 +1408,8 @@ Assume point is at comment beginning."
1396 (point))) 1408 (point)))
1397 (end (progn (goto-char com-end) 1409 (end (progn (goto-char com-end)
1398 (skip-chars-forward " \r\t\n" limit) 1410 (skip-chars-forward " \r\t\n" limit)
1399 (if (eobp) (point) (point-at-bol))))) 1411 (skip-chars-backward " \t")
1412 (if (bolp) (point) (line-end-position)))))
1400 (list 'comment 1413 (list 'comment
1401 (nconc 1414 (nconc
1402 (list :begin begin 1415 (list :begin begin
@@ -1425,7 +1438,7 @@ containing `:begin', `:end', `:hiddenp', `:value' and
1425Assume point is at comment block beginning." 1438Assume point is at comment block beginning."
1426 (let ((case-fold-search t)) 1439 (let ((case-fold-search t))
1427 (if (not (save-excursion 1440 (if (not (save-excursion
1428 (re-search-forward "^[ \t]*#\\+END_COMMENT" limit t))) 1441 (re-search-forward "^[ \t]*#\\+END_COMMENT[ \t]*$" limit t)))
1429 ;; Incomplete block: parse it as a paragraph. 1442 ;; Incomplete block: parse it as a paragraph.
1430 (org-element-paragraph-parser limit) 1443 (org-element-paragraph-parser limit)
1431 (let ((contents-end (match-beginning 0))) 1444 (let ((contents-end (match-beginning 0)))
@@ -1438,7 +1451,8 @@ Assume point is at comment block beginning."
1438 (forward-line) 1451 (forward-line)
1439 (point))) 1452 (point)))
1440 (end (progn (skip-chars-forward " \r\t\n" limit) 1453 (end (progn (skip-chars-forward " \r\t\n" limit)
1441 (if (eobp) (point) (point-at-bol)))) 1454 (skip-chars-backward " \t")
1455 (if (bolp) (point) (line-end-position))))
1442 (value (buffer-substring-no-properties 1456 (value (buffer-substring-no-properties
1443 contents-begin contents-end))) 1457 contents-begin contents-end)))
1444 (list 'comment-block 1458 (list 'comment-block
@@ -1470,7 +1484,7 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent',
1470`:switches', `:value' and `:post-blank' keywords." 1484`:switches', `:value' and `:post-blank' keywords."
1471 (let ((case-fold-search t)) 1485 (let ((case-fold-search t))
1472 (if (not (save-excursion 1486 (if (not (save-excursion
1473 (re-search-forward "^[ \t]*#\\+END_EXAMPLE" limit t))) 1487 (re-search-forward "^[ \t]*#\\+END_EXAMPLE[ \t]*$" limit t)))
1474 ;; Incomplete block: parse it as a paragraph. 1488 ;; Incomplete block: parse it as a paragraph.
1475 (org-element-paragraph-parser limit) 1489 (org-element-paragraph-parser limit)
1476 (let ((contents-end (match-beginning 0))) 1490 (let ((contents-end (match-beginning 0)))
@@ -1502,12 +1516,15 @@ containing `:begin', `:end', `:number-lines', `:preserve-indent',
1502 (begin (car keywords)) 1516 (begin (car keywords))
1503 (contents-begin (progn (forward-line) (point))) 1517 (contents-begin (progn (forward-line) (point)))
1504 (hidden (org-invisible-p2)) 1518 (hidden (org-invisible-p2))
1505 (value (buffer-substring-no-properties contents-begin contents-end)) 1519 (value (org-unescape-code-in-string
1520 (buffer-substring-no-properties
1521 contents-begin contents-end)))
1506 (pos-before-blank (progn (goto-char contents-end) 1522 (pos-before-blank (progn (goto-char contents-end)
1507 (forward-line) 1523 (forward-line)
1508 (point))) 1524 (point)))
1509 (end (progn (skip-chars-forward " \r\t\n" limit) 1525 (end (progn (skip-chars-forward " \r\t\n" limit)
1510 (if (eobp) (point) (point-at-bol))))) 1526 (skip-chars-backward " \t")
1527 (if (bolp) (point) (line-end-position)))))
1511 (list 'example-block 1528 (list 'example-block
1512 (nconc 1529 (nconc
1513 (list :begin begin 1530 (list :begin begin
@@ -1529,7 +1546,8 @@ CONTENTS is nil."
1529 (let ((switches (org-element-property :switches example-block))) 1546 (let ((switches (org-element-property :switches example-block)))
1530 (concat "#+BEGIN_EXAMPLE" (and switches (concat " " switches)) "\n" 1547 (concat "#+BEGIN_EXAMPLE" (and switches (concat " " switches)) "\n"
1531 (org-remove-indentation 1548 (org-remove-indentation
1532 (org-element-property :value example-block)) 1549 (org-escape-code-in-string
1550 (org-element-property :value example-block)))
1533 "#+END_EXAMPLE"))) 1551 "#+END_EXAMPLE")))
1534 1552
1535 1553
@@ -1549,7 +1567,8 @@ Assume point is at export-block beginning."
1549 (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)") 1567 (type (progn (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)")
1550 (upcase (org-match-string-no-properties 1))))) 1568 (upcase (org-match-string-no-properties 1)))))
1551 (if (not (save-excursion 1569 (if (not (save-excursion
1552 (re-search-forward (concat "^[ \t]*#\\+END_" type) limit t))) 1570 (re-search-forward
1571 (format "^[ \t]*#\\+END_%s[ \t]*$" type) limit t)))
1553 ;; Incomplete block: parse it as a paragraph. 1572 ;; Incomplete block: parse it as a paragraph.
1554 (org-element-paragraph-parser limit) 1573 (org-element-paragraph-parser limit)
1555 (let ((contents-end (match-beginning 0))) 1574 (let ((contents-end (match-beginning 0)))
@@ -1562,7 +1581,8 @@ Assume point is at export-block beginning."
1562 (forward-line) 1581 (forward-line)
1563 (point))) 1582 (point)))
1564 (end (progn (skip-chars-forward " \r\t\n" limit) 1583 (end (progn (skip-chars-forward " \r\t\n" limit)
1565 (if (eobp) (point) (point-at-bol)))) 1584 (skip-chars-backward " \t")
1585 (if (bolp) (point) (line-end-position))))
1566 (value (buffer-substring-no-properties contents-begin 1586 (value (buffer-substring-no-properties contents-begin
1567 contents-end))) 1587 contents-end)))
1568 (list 'export-block 1588 (list 'export-block
@@ -1612,7 +1632,8 @@ Assume point is at the beginning of the fixed-width area."
1612 (forward-line)) 1632 (forward-line))
1613 (point))) 1633 (point)))
1614 (end (progn (skip-chars-forward " \r\t\n" limit) 1634 (end (progn (skip-chars-forward " \r\t\n" limit)
1615 (if (eobp) (point) (point-at-bol))))) 1635 (skip-chars-backward " \t")
1636 (if (bolp) (point) (line-end-position)))))
1616 (list 'fixed-width 1637 (list 'fixed-width
1617 (nconc 1638 (nconc
1618 (list :begin begin 1639 (list :begin begin
@@ -1642,7 +1663,8 @@ containing `:begin', `:end' and `:post-blank' keywords."
1642 (begin (car keywords)) 1663 (begin (car keywords))
1643 (post-hr (progn (forward-line) (point))) 1664 (post-hr (progn (forward-line) (point)))
1644 (end (progn (skip-chars-forward " \r\t\n" limit) 1665 (end (progn (skip-chars-forward " \r\t\n" limit)
1645 (if (eobp) (point) (point-at-bol))))) 1666 (skip-chars-backward " \t")
1667 (if (bolp) (point) (line-end-position)))))
1646 (list 'horizontal-rule 1668 (list 'horizontal-rule
1647 (nconc 1669 (nconc
1648 (list :begin begin 1670 (list :begin begin
@@ -1675,7 +1697,8 @@ keywords."
1675 (match-end 0) (point-at-eol)))) 1697 (match-end 0) (point-at-eol))))
1676 (pos-before-blank (progn (forward-line) (point))) 1698 (pos-before-blank (progn (forward-line) (point)))
1677 (end (progn (skip-chars-forward " \r\t\n" limit) 1699 (end (progn (skip-chars-forward " \r\t\n" limit)
1678 (if (eobp) (point) (point-at-bol))))) 1700 (skip-chars-backward " \t")
1701 (if (bolp) (point) (line-end-position)))))
1679 (list 'keyword 1702 (list 'keyword
1680 (list :key key 1703 (list :key key
1681 :value value 1704 :value value
@@ -1711,12 +1734,14 @@ Assume point is at the beginning of the latex environment."
1711 (env (progn (looking-at "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}") 1734 (env (progn (looking-at "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}")
1712 (regexp-quote (match-string 1)))) 1735 (regexp-quote (match-string 1))))
1713 (code-end 1736 (code-end
1714 (progn (re-search-forward (format "^[ \t]*\\\\end{%s}" env) limit t) 1737 (progn (re-search-forward
1738 (format "^[ \t]*\\\\end{%s}[ \t]*$" env) limit t)
1715 (forward-line) 1739 (forward-line)
1716 (point))) 1740 (point)))
1717 (value (buffer-substring-no-properties code-begin code-end)) 1741 (value (buffer-substring-no-properties code-begin code-end))
1718 (end (progn (skip-chars-forward " \r\t\n" limit) 1742 (end (progn (skip-chars-forward " \r\t\n" limit)
1719 (if (eobp) (point) (point-at-bol))))) 1743 (skip-chars-backward " \t")
1744 (if (bolp) (point) (line-end-position)))))
1720 (list 'latex-environment 1745 (list 'latex-environment
1721 (nconc 1746 (nconc
1722 (list :begin begin 1747 (list :begin begin
@@ -1744,69 +1769,80 @@ containing `:begin', `:end', `:contents-begin' and
1744 1769
1745Assume point is at the beginning of the paragraph." 1770Assume point is at the beginning of the paragraph."
1746 (save-excursion 1771 (save-excursion
1747 (let* (;; INNER-PAR-P is non-nil when paragraph is at the 1772 (let* ((contents-begin (point))
1773 ;; INNER-PAR-P is non-nil when paragraph is at the
1748 ;; beginning of an item or a footnote reference. In that 1774 ;; beginning of an item or a footnote reference. In that
1749 ;; case, we mustn't look for affiliated keywords since they 1775 ;; case, we mustn't look for affiliated keywords since they
1750 ;; belong to the container. 1776 ;; belong to the container.
1751 (inner-par-p (not (bolp))) 1777 (inner-par-p (not (bolp)))
1752 (contents-begin (point))
1753 (keywords (unless inner-par-p 1778 (keywords (unless inner-par-p
1754 (org-element--collect-affiliated-keywords))) 1779 (org-element--collect-affiliated-keywords)))
1755 (begin (if inner-par-p contents-begin (car keywords))) 1780 (begin (if inner-par-p contents-begin (car keywords)))
1756 (before-blank 1781 (before-blank
1757 (let ((case-fold-search t)) 1782 (let ((case-fold-search t))
1758 (end-of-line) 1783 (end-of-line)
1759 (re-search-forward org-element-paragraph-separate limit 'm) 1784 (if (not (re-search-forward
1760 (while (and (/= (point) limit) 1785 org-element-paragraph-separate limit 'm))
1761 (cond 1786 limit
1762 ;; Skip non-existent or incomplete drawer. 1787 ;; A matching `org-element-paragraph-separate' is not
1763 ((save-excursion 1788 ;; necessarily the end of the paragraph. In
1764 (beginning-of-line) 1789 ;; particular, lines starting with # or : as a first
1765 (and (looking-at "[ \t]*:\\S-") 1790 ;; non-space character are ambiguous. We have check
1766 (or (not (looking-at org-drawer-regexp)) 1791 ;; if they are valid Org syntax (i.e. not an
1767 (not (save-excursion 1792 ;; incomplete keyword).
1768 (re-search-forward 1793 (beginning-of-line)
1769 "^[ \t]*:END:" limit t))))))) 1794 (while (not
1770 ;; Stop at comments. 1795 (or
1771 ((save-excursion 1796 ;; There's no ambiguity for other symbols or
1772 (beginning-of-line) 1797 ;; empty lines: stop here.
1773 (not (looking-at "[ \t]*#\\S-"))) nil) 1798 (looking-at "[ \t]*\\(?:[^:#]\\|$\\)")
1774 ;; Skip incomplete dynamic blocks. 1799 ;; Stop at valid fixed-width areas.
1775 ((save-excursion 1800 (looking-at "[ \t]*:\\(?: \\|$\\)")
1776 (beginning-of-line) 1801 ;; Stop at drawers.
1777 (looking-at "[ \t]*#\\+BEGIN: ")) 1802 (and (looking-at org-drawer-regexp)
1778 (not (save-excursion 1803 (save-excursion
1779 (re-search-forward 1804 (re-search-forward
1780 "^[ \t]*\\+END:" limit t)))) 1805 "^[ \t]*:END:[ \t]*$" limit t)))
1781 ;; Skip incomplete blocks. 1806 ;; Stop at valid comments.
1782 ((save-excursion 1807 (looking-at "[ \t]*#\\(?: \\|$\\)")
1783 (beginning-of-line) 1808 ;; Stop at valid dynamic blocks.
1784 (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)")) 1809 (and (looking-at org-dblock-start-re)
1785 (not (save-excursion 1810 (save-excursion
1786 (re-search-forward 1811 (re-search-forward
1787 (concat "^[ \t]*#\\+END_" 1812 "^[ \t]*#\\+END:?[ \t]*$" limit t)))
1788 (match-string 1)) 1813 ;; Stop at valid blocks.
1789 limit t)))) 1814 (and (looking-at
1790 ;; Skip incomplete latex environments. 1815 "[ \t]*#\\+BEGIN_\\(\\S-+\\)")
1791 ((save-excursion 1816 (save-excursion
1792 (beginning-of-line) 1817 (re-search-forward
1793 (looking-at "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}")) 1818 (format "^[ \t]*#\\+END_%s[ \t]*$"
1794 (not (save-excursion 1819 (match-string 1))
1795 (re-search-forward 1820 limit t)))
1796 (format "^[ \t]*\\\\end{%s}" 1821 ;; Stop at valid latex environments.
1797 (match-string 1)) 1822 (and (looking-at
1798 limit t)))) 1823 "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}[ \t]*$")
1799 ;; Skip ill-formed keywords. 1824 (save-excursion
1800 ((not (save-excursion 1825 (re-search-forward
1801 (beginning-of-line) 1826 (format "^[ \t]*\\\\end{%s}[ \t]*$"
1802 (looking-at "[ \t]*#\\+\\S-+:")))))) 1827 (match-string 1))
1803 (re-search-forward org-element-paragraph-separate limit 'm)) 1828 limit t)))
1804 (if (eobp) (point) (goto-char (line-beginning-position))))) 1829 ;; Stop at valid keywords.
1830 (looking-at "[ \t]*#\\+\\S-+:")
1831 ;; Skip everything else.
1832 (not
1833 (progn
1834 (end-of-line)
1835 (re-search-forward org-element-paragraph-separate
1836 limit 'm)))))
1837 (beginning-of-line)))
1838 (if (= (point) limit) limit
1839 (goto-char (line-beginning-position)))))
1805 (contents-end (progn (skip-chars-backward " \r\t\n" contents-begin) 1840 (contents-end (progn (skip-chars-backward " \r\t\n" contents-begin)
1806 (forward-line) 1841 (forward-line)
1807 (point))) 1842 (point)))
1808 (end (progn (skip-chars-forward " \r\t\n" limit) 1843 (end (progn (skip-chars-forward " \r\t\n" limit)
1809 (if (eobp) (point) (point-at-bol))))) 1844 (skip-chars-backward " \t")
1845 (if (bolp) (point) (line-end-position)))))
1810 (list 'paragraph 1846 (list 'paragraph
1811 (nconc 1847 (nconc
1812 (list :begin begin 1848 (list :begin begin
@@ -1837,7 +1873,8 @@ and `:post-blank' keywords."
1837 (begin (point)) 1873 (begin (point))
1838 (post-blank (let ((before-blank (progn (forward-line) (point)))) 1874 (post-blank (let ((before-blank (progn (forward-line) (point))))
1839 (skip-chars-forward " \r\t\n" limit) 1875 (skip-chars-forward " \r\t\n" limit)
1840 (unless (eobp) (beginning-of-line)) 1876 (skip-chars-backward " \t")
1877 (unless (bolp) (end-of-line))
1841 (count-lines before-blank (point)))) 1878 (count-lines before-blank (point))))
1842 (end (point)) 1879 (end (point))
1843 closed deadline scheduled) 1880 closed deadline scheduled)
@@ -1895,7 +1932,7 @@ Assume point is at the beginning of the property drawer."
1895 (hidden (org-invisible-p2)) 1932 (hidden (org-invisible-p2))
1896 (properties 1933 (properties
1897 (let (val) 1934 (let (val)
1898 (while (not (looking-at "^[ \t]*:END:")) 1935 (while (not (looking-at "^[ \t]*:END:[ \t]*$"))
1899 (when (looking-at "[ \t]*:\\([A-Za-z][-_A-Za-z0-9]*\\):") 1936 (when (looking-at "[ \t]*:\\([A-Za-z][-_A-Za-z0-9]*\\):")
1900 (push (cons (org-match-string-no-properties 1) 1937 (push (cons (org-match-string-no-properties 1)
1901 (org-trim 1938 (org-trim
@@ -1908,7 +1945,8 @@ Assume point is at the beginning of the property drawer."
1908 (point-at-bol))) 1945 (point-at-bol)))
1909 (pos-before-blank (progn (forward-line) (point))) 1946 (pos-before-blank (progn (forward-line) (point)))
1910 (end (progn (skip-chars-forward " \r\t\n" limit) 1947 (end (progn (skip-chars-forward " \r\t\n" limit)
1911 (if (eobp) (point) (point-at-bol))))) 1948 (skip-chars-backward " \t")
1949 (if (bolp) (point) (line-end-position)))))
1912 (list 'property-drawer 1950 (list 'property-drawer
1913 (list :begin begin 1951 (list :begin begin
1914 :end end 1952 :end end
@@ -1974,7 +2012,8 @@ containing `:language', `:switches', `:parameters', `:begin',
1974 2012
1975Assume point is at the beginning of the block." 2013Assume point is at the beginning of the block."
1976 (let ((case-fold-search t)) 2014 (let ((case-fold-search t))
1977 (if (not (save-excursion (re-search-forward "^[ \t]*#\\+END_SRC" limit t))) 2015 (if (not (save-excursion (re-search-forward "^[ \t]*#\\+END_SRC[ \t]*$"
2016 limit t)))
1978 ;; Incomplete block: parse it as a paragraph. 2017 ;; Incomplete block: parse it as a paragraph.
1979 (org-element-paragraph-parser limit) 2018 (org-element-paragraph-parser limit)
1980 (let ((contents-end (match-beginning 0))) 2019 (let ((contents-end (match-beginning 0)))
@@ -2017,13 +2056,15 @@ Assume point is at the beginning of the block."
2017 ;; Get visibility status. 2056 ;; Get visibility status.
2018 (hidden (progn (forward-line) (org-invisible-p2))) 2057 (hidden (progn (forward-line) (org-invisible-p2)))
2019 ;; Retrieve code. 2058 ;; Retrieve code.
2020 (value (buffer-substring-no-properties (point) contents-end)) 2059 (value (org-unescape-code-in-string
2060 (buffer-substring-no-properties (point) contents-end)))
2021 (pos-before-blank (progn (goto-char contents-end) 2061 (pos-before-blank (progn (goto-char contents-end)
2022 (forward-line) 2062 (forward-line)
2023 (point))) 2063 (point)))
2024 ;; Get position after ending blank lines. 2064 ;; Get position after ending blank lines.
2025 (end (progn (skip-chars-forward " \r\t\n" limit) 2065 (end (progn (skip-chars-forward " \r\t\n" limit)
2026 (if (eobp) (point) (point-at-bol))))) 2066 (skip-chars-backward " \t")
2067 (if (bolp) (point) (line-end-position)))))
2027 (list 'src-block 2068 (list 'src-block
2028 (nconc 2069 (nconc
2029 (list :language language 2070 (list :language language
@@ -2051,7 +2092,6 @@ CONTENTS is nil."
2051 (params (org-element-property :parameters src-block)) 2092 (params (org-element-property :parameters src-block))
2052 (value (let ((val (org-element-property :value src-block))) 2093 (value (let ((val (org-element-property :value src-block)))
2053 (cond 2094 (cond
2054
2055 (org-src-preserve-indentation val) 2095 (org-src-preserve-indentation val)
2056 ((zerop org-edit-src-content-indentation) 2096 ((zerop org-edit-src-content-indentation)
2057 (org-remove-indentation val)) 2097 (org-remove-indentation val))
@@ -2065,7 +2105,7 @@ CONTENTS is nil."
2065 (concat (and lang (concat " " lang)) 2105 (concat (and lang (concat " " lang))
2066 (and switches (concat " " switches)) 2106 (and switches (concat " " switches))
2067 (and params (concat " " params)))) 2107 (and params (concat " " params))))
2068 value 2108 (org-escape-code-in-string value)
2069 "#+END_SRC"))) 2109 "#+END_SRC")))
2070 2110
2071 2111
@@ -2087,7 +2127,10 @@ Assume point is at the beginning of the table."
2087 (type (if (org-at-table.el-p) 'table.el 'org)) 2127 (type (if (org-at-table.el-p) 'table.el 'org))
2088 (keywords (org-element--collect-affiliated-keywords)) 2128 (keywords (org-element--collect-affiliated-keywords))
2089 (begin (car keywords)) 2129 (begin (car keywords))
2090 (table-end (goto-char (marker-position (org-table-end t)))) 2130 (table-end
2131 (if (re-search-forward org-table-any-border-regexp limit 'm)
2132 (goto-char (match-beginning 0))
2133 (point)))
2091 (tblfm (let (acc) 2134 (tblfm (let (acc)
2092 (while (looking-at "[ \t]*#\\+TBLFM: +\\(.*\\)[ \t]*$") 2135 (while (looking-at "[ \t]*#\\+TBLFM: +\\(.*\\)[ \t]*$")
2093 (push (org-match-string-no-properties 1) acc) 2136 (push (org-match-string-no-properties 1) acc)
@@ -2095,7 +2138,8 @@ Assume point is at the beginning of the table."
2095 acc)) 2138 acc))
2096 (pos-before-blank (point)) 2139 (pos-before-blank (point))
2097 (end (progn (skip-chars-forward " \r\t\n" limit) 2140 (end (progn (skip-chars-forward " \r\t\n" limit)
2098 (if (eobp) (point) (point-at-bol))))) 2141 (skip-chars-backward " \t")
2142 (if (bolp) (point) (line-end-position)))))
2099 (list 'table 2143 (list 'table
2100 (nconc 2144 (nconc
2101 (list :begin begin 2145 (list :begin begin
@@ -2179,7 +2223,7 @@ containing `:begin', `:end', `:contents-begin', `:contents-end',
2179Assume point is at beginning of the block." 2223Assume point is at beginning of the block."
2180 (let ((case-fold-search t)) 2224 (let ((case-fold-search t))
2181 (if (not (save-excursion 2225 (if (not (save-excursion
2182 (re-search-forward "^[ \t]*#\\+END_VERSE" limit t))) 2226 (re-search-forward "^[ \t]*#\\+END_VERSE[ \t]*$" limit t)))
2183 ;; Incomplete block: parse it as a paragraph. 2227 ;; Incomplete block: parse it as a paragraph.
2184 (org-element-paragraph-parser limit) 2228 (org-element-paragraph-parser limit)
2185 (let ((contents-end (match-beginning 0))) 2229 (let ((contents-end (match-beginning 0)))
@@ -2192,7 +2236,8 @@ Assume point is at beginning of the block."
2192 (forward-line) 2236 (forward-line)
2193 (point))) 2237 (point)))
2194 (end (progn (skip-chars-forward " \r\t\n" limit) 2238 (end (progn (skip-chars-forward " \r\t\n" limit)
2195 (if (eobp) (point) (point-at-bol))))) 2239 (skip-chars-backward " \t")
2240 (if (bolp) (point) (line-end-position)))))
2196 (list 'verse-block 2241 (list 'verse-block
2197 (nconc 2242 (nconc
2198 (list :begin begin 2243 (list :begin begin
@@ -2367,6 +2412,7 @@ LIMIT bounds the search.
2367Return value is a cons cell whose CAR is `entity' or 2412Return value is a cons cell whose CAR is `entity' or
2368`latex-fragment' and CDR is beginning position." 2413`latex-fragment' and CDR is beginning position."
2369 (save-excursion 2414 (save-excursion
2415 (unless (bolp) (backward-char))
2370 (let ((matchers 2416 (let ((matchers
2371 (remove "begin" (plist-get org-format-latex-options :matchers))) 2417 (remove "begin" (plist-get org-format-latex-options :matchers)))
2372 ;; ENTITY-RE matches both LaTeX commands and Org entities. 2418 ;; ENTITY-RE matches both LaTeX commands and Org entities.
@@ -3044,6 +3090,7 @@ LIMIT bounds the search.
3044Return value is a cons cell whose CAR is either `subscript' or 3090Return value is a cons cell whose CAR is either `subscript' or
3045`superscript' and CDR is beginning position." 3091`superscript' and CDR is beginning position."
3046 (save-excursion 3092 (save-excursion
3093 (unless (bolp) (backward-char))
3047 (when (re-search-forward org-match-substring-regexp limit t) 3094 (when (re-search-forward org-match-substring-regexp limit t)
3048 (cons (if (string= (match-string 2) "_") 'subscript 'superscript) 3095 (cons (if (string= (match-string 2) "_") 'subscript 'superscript)
3049 (match-beginning 2))))) 3096 (match-beginning 2)))))
@@ -3838,6 +3885,15 @@ Return value is an alist whose CAR is position and CDR the object
3838type, as a symbol. 3885type, as a symbol.
3839 3886
3840OBJECTS is the previous candidates alist." 3887OBJECTS is the previous candidates alist."
3888 ;; Filter out any object found but not belonging to RESTRICTION.
3889 (setq objects
3890 (org-remove-if-not
3891 (lambda (obj)
3892 (let ((type (car obj)))
3893 (memq (or (cdr (assq type org-element-object-successor-alist))
3894 type)
3895 restriction)))
3896 objects))
3841 (let (next-candidates types-to-search) 3897 (let (next-candidates types-to-search)
3842 ;; If no previous result, search every object type in RESTRICTION. 3898 ;; If no previous result, search every object type in RESTRICTION.
3843 ;; Otherwise, keep potential candidates (old objects located after 3899 ;; Otherwise, keep potential candidates (old objects located after
@@ -4235,7 +4291,7 @@ and :post-blank properties."
4235 (progn (beginning-of-line) 4291 (progn (beginning-of-line)
4236 (skip-chars-forward "* ") 4292 (skip-chars-forward "* ")
4237 (setq end (point-at-eol)))) 4293 (setq end (point-at-eol))))
4238 (and (memq type '(paragraph table-cell verse-block)) 4294 (and (memq type '(paragraph table-row verse-block))
4239 (let ((cbeg (org-element-property 4295 (let ((cbeg (org-element-property
4240 :contents-begin element)) 4296 :contents-begin element))
4241 (cend (org-element-property 4297 (cend (org-element-property
@@ -4254,7 +4310,7 @@ and :post-blank properties."
4254 candidates))) 4310 candidates)))
4255 ;; If ORIGIN is before next object in element, there's 4311 ;; If ORIGIN is before next object in element, there's
4256 ;; no point in looking further. 4312 ;; no point in looking further.
4257 (if (> (cdr closest-cand) origin) (throw 'exit element) 4313 (if (> (cdr closest-cand) origin) (throw 'exit parent)
4258 (let* ((object 4314 (let* ((object
4259 (progn (goto-char (cdr closest-cand)) 4315 (progn (goto-char (cdr closest-cand))
4260 (funcall (intern (format "org-element-%s-parser" 4316 (funcall (intern (format "org-element-%s-parser"
@@ -4274,7 +4330,9 @@ and :post-blank properties."
4274 ;; search to the end of its contents. 4330 ;; search to the end of its contents.
4275 (t (goto-char cbeg) 4331 (t (goto-char cbeg)
4276 (org-element-put-property object :parent parent) 4332 (org-element-put-property object :parent parent)
4277 (setq parent object end cend))))))) 4333 (setq parent object
4334 restriction (org-element-restriction object)
4335 end cend)))))))
4278 parent)))))) 4336 parent))))))
4279 4337
4280(defsubst org-element-nested-p (elem-A elem-B) 4338(defsubst org-element-nested-p (elem-A elem-B)
@@ -4351,6 +4409,10 @@ end of ELEM-A."
4351 (cdr overlays))) 4409 (cdr overlays)))
4352 (goto-char (org-element-property :end elem-B))))) 4410 (goto-char (org-element-property :end elem-B)))))
4353 4411
4354
4355(provide 'org-element) 4412(provide 'org-element)
4413
4414;; Local variables:
4415;; generated-autoload-file: "org-loaddefs.el"
4416;; End:
4417
4356;;; org-element.el ends here 4418;;; org-element.el ends here
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el
index 6b506cd1275..a578fe70f07 100644
--- a/lisp/org/org-exp.el
+++ b/lisp/org/org-exp.el
@@ -48,6 +48,7 @@
48(declare-function org-table-colgroup-line-p "org-table" (line)) 48(declare-function org-table-colgroup-line-p "org-table" (line))
49(declare-function org-pop-to-buffer-same-window "org-compat" 49(declare-function org-pop-to-buffer-same-window "org-compat"
50 (&optional buffer-or-name norecord label)) 50 (&optional buffer-or-name norecord label))
51(declare-function org-unescape-code-in-region "org-src" (beg end))
51 52
52(autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t) 53(autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t)
53 54
@@ -1790,7 +1791,7 @@ from the buffer."
1790 beg-content end-content 1791 beg-content end-content
1791 `(org-protected t original-indentation ,ind org-native-text t)) 1792 `(org-protected t original-indentation ,ind org-native-text t))
1792 ;; strip protective commas 1793 ;; strip protective commas
1793 (org-strip-protective-commas beg-content end-content) 1794 (org-unescape-code-in-region beg-content end-content)
1794 (delete-region (match-beginning 0) (match-end 0)) 1795 (delete-region (match-beginning 0) (match-end 0))
1795 (save-excursion 1796 (save-excursion
1796 (goto-char beg) 1797 (goto-char beg)
@@ -3230,7 +3231,6 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
3230 org-archive-location 3231 org-archive-location
3231 "org file:~/org/%s.org")) 3232 "org file:~/org/%s.org"))
3232 3233
3233;;;###autoload
3234(defun org-insert-export-options-template () 3234(defun org-insert-export-options-template ()
3235 "Insert into the buffer a template with information for exporting." 3235 "Insert into the buffer a template with information for exporting."
3236 (interactive) 3236 (interactive)
@@ -3348,4 +3348,8 @@ The depends on the variable `org-export-copy-to-kill-ring'."
3348 3348
3349(provide 'org-exp) 3349(provide 'org-exp)
3350 3350
3351;; Local variables:
3352;; generated-autoload-file: "org-loaddefs.el"
3353;; End:
3354
3351;;; org-exp.el ends here 3355;;; org-exp.el ends here
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 51aead1b8bb..58be52d9e28 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -692,13 +692,13 @@ month and 365.24 days for a year)."
692 :group 'org-faces) 692 :group 'org-faces)
693 693
694(defface org-agenda-filter-tags 694(defface org-agenda-filter-tags
695 (org-compatible-face 'modeline 695 (org-compatible-face 'mode-line
696 nil) 696 nil)
697 "Face for tag(s) in the mode-line when filtering the agenda." 697 "Face for tag(s) in the mode-line when filtering the agenda."
698 :group 'org-faces) 698 :group 'org-faces)
699 699
700(defface org-agenda-filter-category 700(defface org-agenda-filter-category
701 (org-compatible-face 'modeline 701 (org-compatible-face 'mode-line
702 nil) 702 nil)
703 "Face for tag(s) in the mode-line when filtering the agenda." 703 "Face for tag(s) in the mode-line when filtering the agenda."
704 :group 'org-faces) 704 :group 'org-faces)
@@ -770,9 +770,9 @@ level org-n-level-faces"
770 "Face used to highlight math latex and other special exporter stuff." 770 "Face used to highlight math latex and other special exporter stuff."
771 :group 'org-faces) 771 :group 'org-faces)
772 772
773(org-copy-face 'modeline 'org-mode-line-clock 773(org-copy-face 'mode-line 'org-mode-line-clock
774 "Face used for clock display in mode line.") 774 "Face used for clock display in mode line.")
775(org-copy-face 'modeline 'org-mode-line-clock-overrun 775(org-copy-face 'mode-line 'org-mode-line-clock-overrun
776 "Face used for clock display for overrun tasks in mode line." 776 "Face used for clock display for overrun tasks in mode line."
777 :background "red") 777 :background "red")
778 778
diff --git a/lisp/org/org-feed.el b/lisp/org/org-feed.el
index 91bf3347953..7724578ae58 100644
--- a/lisp/org/org-feed.el
+++ b/lisp/org/org-feed.el
@@ -695,4 +695,8 @@ formatted as a string, not the original XML data."
695 695
696(provide 'org-feed) 696(provide 'org-feed)
697 697
698;; Local variables:
699;; generated-autoload-file: "org-loaddefs.el"
700;; End:
701
698;;; org-feed.el ends here 702;;; org-feed.el ends here
diff --git a/lisp/org/org-footnote.el b/lisp/org/org-footnote.el
index 3aaa44b7ac3..c598965f4c7 100644
--- a/lisp/org/org-footnote.el
+++ b/lisp/org/org-footnote.el
@@ -948,4 +948,8 @@ If LABEL is non-nil, delete that footnote instead."
948 948
949(provide 'org-footnote) 949(provide 'org-footnote)
950 950
951;; Local variables:
952;; generated-autoload-file: "org-loaddefs.el"
953;; End:
954
951;;; org-footnote.el ends here 955;;; org-footnote.el ends here
diff --git a/lisp/org/org-freemind.el b/lisp/org/org-freemind.el
index a05cb554d4b..afc925d5426 100644
--- a/lisp/org/org-freemind.el
+++ b/lisp/org/org-freemind.el
@@ -1219,8 +1219,8 @@ PATH should be a list of steps, where each step has the form
1219 1219
1220(provide 'org-freemind) 1220(provide 'org-freemind)
1221 1221
1222 1222;; Local variables:
1223 1223;; generated-autoload-file: "org-loaddefs.el"
1224;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1224;; End:
1225 1225
1226;;; org-freemind.el ends here 1226;;; org-freemind.el ends here
diff --git a/lisp/org/org-html.el b/lisp/org/org-html.el
index 79b028638a1..a6ca2d2a03b 100644
--- a/lisp/org/org-html.el
+++ b/lisp/org/org-html.el
@@ -210,6 +210,7 @@ not be modified. Use the variables `org-export-html-style' to add
210your own style information." 210your own style information."
211 :group 'org-export-html 211 :group 'org-export-html
212 :type 'boolean) 212 :type 'boolean)
213
213;;;###autoload 214;;;###autoload
214(put 'org-export-html-style-include-default 'safe-local-variable 'booleanp) 215(put 'org-export-html-style-include-default 'safe-local-variable 'booleanp)
215 216
@@ -2380,7 +2381,6 @@ the settings define in the org-... variables."
2380 (plist-get htmlize-buffer-places 'content-end))) 2381 (plist-get htmlize-buffer-places 'content-end)))
2381 (kill-buffer htmlbuf)))) 2382 (kill-buffer htmlbuf))))
2382 2383
2383;;;###autoload
2384(defun org-export-htmlize-generate-css () 2384(defun org-export-htmlize-generate-css ()
2385 "Create the CSS for all font definitions in the current Emacs session. 2385 "Create the CSS for all font definitions in the current Emacs session.
2386Use this to create face definitions in your CSS style file that can then 2386Use this to create face definitions in your CSS style file that can then
@@ -2749,4 +2749,8 @@ the alist of previous items."
2749 2749
2750(provide 'org-html) 2750(provide 'org-html)
2751 2751
2752;; Local variables:
2753;; generated-autoload-file: "org-loaddefs.el"
2754;; End:
2755
2752;;; org-html.el ends here 2756;;; org-html.el ends here
diff --git a/lisp/org/org-icalendar.el b/lisp/org/org-icalendar.el
index 8523b442583..a2d2117dcb4 100644
--- a/lisp/org/org-icalendar.el
+++ b/lisp/org/org-icalendar.el
@@ -684,4 +684,8 @@ a time), or the day by one (if it does not contain a time)."
684 684
685(provide 'org-icalendar) 685(provide 'org-icalendar)
686 686
687;; Local variables:
688;; generated-autoload-file: "org-loaddefs.el"
689;; End:
690
687;;; org-icalendar.el ends here 691;;; org-icalendar.el ends here
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index c156e240dbf..f870ccc5a52 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -233,7 +233,6 @@ With optional argument FORCE, force the creation of a new ID."
233 (org-entry-put (point) "ID" nil)) 233 (org-entry-put (point) "ID" nil))
234 (org-id-get (point) 'create)) 234 (org-id-get (point) 'create))
235 235
236;;;###autoload
237(defun org-id-copy () 236(defun org-id-copy ()
238 "Copy the ID of the entry at point to the kill ring. 237 "Copy the ID of the entry at point to the kill ring.
239Create an ID if necessary." 238Create an ID if necessary."
@@ -259,7 +258,6 @@ In any case, the ID of the entry is returned."
259 (org-id-add-location id (buffer-file-name (buffer-base-buffer))) 258 (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
260 id))))) 259 id)))))
261 260
262;;;###autoload
263(defun org-id-get-with-outline-path-completion (&optional targets) 261(defun org-id-get-with-outline-path-completion (&optional targets)
264 "Use outline-path-completion to retrieve the ID of an entry. 262 "Use outline-path-completion to retrieve the ID of an entry.
265TARGETS may be a setting for `org-refile-targets' to define the eligible 263TARGETS may be a setting for `org-refile-targets' to define the eligible
@@ -276,7 +274,6 @@ It returns the ID of the entry. If necessary, the ID is created."
276 (prog1 (org-id-get pom 'create) 274 (prog1 (org-id-get pom 'create)
277 (move-marker pom nil)))) 275 (move-marker pom nil))))
278 276
279;;;###autoload
280(defun org-id-get-with-outline-drilling (&optional targets) 277(defun org-id-get-with-outline-drilling (&optional targets)
281 "Use an outline-cycling interface to retrieve the ID of an entry. 278 "Use an outline-cycling interface to retrieve the ID of an entry.
282This only finds entries in the current buffer, using `org-get-location'. 279This only finds entries in the current buffer, using `org-get-location'.
@@ -681,4 +678,8 @@ optional argument MARKERP, return the position as a new marker."
681 678
682(provide 'org-id) 679(provide 'org-id)
683 680
681;; Local variables:
682;; generated-autoload-file: "org-loaddefs.el"
683;; End:
684
684;;; org-id.el ends here 685;;; org-id.el ends here
diff --git a/lisp/org/org-indent.el b/lisp/org/org-indent.el
index d006df86747..c4d74fbb2fa 100644
--- a/lisp/org/org-indent.el
+++ b/lisp/org/org-indent.el
@@ -431,4 +431,8 @@ This function is meant to be called by `after-change-functions'."
431 431
432(provide 'org-indent) 432(provide 'org-indent)
433 433
434;; Local variables:
435;; generated-autoload-file: "org-loaddefs.el"
436;; End:
437
434;;; org-indent.el ends here 438;;; org-indent.el ends here
diff --git a/lisp/org/org-install.el b/lisp/org/org-install.el
index 8df78b6b68d..a31d8b79209 100644
--- a/lisp/org/org-install.el
+++ b/lisp/org/org-install.el
@@ -1,37 +1,13 @@
1;;; org-install.el --- Outline-based notes management and organizer 1;;; org-install.el --- autogenerated file, do not edit
2;; Carstens outline-mode for keeping track of everything.
3;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
4;; 2;;
5;; Author: Carsten Dominik <carsten at orgmode dot org> 3;;; Code:
6;; Keywords: outlines, hypermedia, calendar, wp 4(warn "The file org-install is obsolete.
7;; Homepage: http://orgmode.org 5Please change your configuration to (require 'org) instead.")
8;; Version: 6.06b 6
9;;
10;; This file is part of GNU Emacs.
11;;
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25;;
26;;; Commentary:
27;;
28;; When Org-mode is distributed with Emacs, this is just a dummy file.
29;; In an Org-mode distribution outside Emacs, this file would provide
30;; the autoloads. We include this dummy version in Emacs, so that people
31;; can leave a (require 'org-install) in .emacs, independently of
32;; which kind of distribution they use.
33;;
34
35(provide 'org-install) 7(provide 'org-install)
36 8
9;; Local Variables:
10;; no-byte-compile: t
11;; coding: utf-8
12;; End:
37;;; org-install.el ends here 13;;; org-install.el ends here
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el
index 787eed7950f..d31b1828ddd 100644
--- a/lisp/org/org-irc.el
+++ b/lisp/org/org-irc.el
@@ -252,4 +252,8 @@ default."
252 252
253(provide 'org-irc) 253(provide 'org-irc)
254 254
255;; Local variables:
256;; generated-autoload-file: "org-loaddefs.el"
257;; End:
258
255;;; org-irc.el ends here 259;;; org-irc.el ends here
diff --git a/lisp/org/org-latex.el b/lisp/org/org-latex.el
index 933fa56b8dd..9ce84f14e92 100644
--- a/lisp/org/org-latex.el
+++ b/lisp/org/org-latex.el
@@ -787,14 +787,14 @@ emacs --batch
787 --load=$HOME/lib/emacs/org.el 787 --load=$HOME/lib/emacs/org.el
788 --eval \"(setq org-export-headline-levels 2)\" 788 --eval \"(setq org-export-headline-levels 2)\"
789 --visit=MyFile --funcall org-export-as-latex-batch" 789 --visit=MyFile --funcall org-export-as-latex-batch"
790 (org-export-as-latex org-export-headline-levels 'hidden)) 790 (org-export-as-latex org-export-headline-levels))
791 791
792;;;###autoload 792;;;###autoload
793(defun org-export-as-latex-to-buffer (arg) 793(defun org-export-as-latex-to-buffer (arg)
794 "Call `org-export-as-latex` with output to a temporary buffer. 794 "Call `org-export-as-latex` with output to a temporary buffer.
795No file is created. The prefix ARG is passed through to `org-export-as-latex'." 795No file is created. The prefix ARG is passed through to `org-export-as-latex'."
796 (interactive "P") 796 (interactive "P")
797 (org-export-as-latex arg nil nil "*Org LaTeX Export*") 797 (org-export-as-latex arg nil "*Org LaTeX Export*")
798 (when org-export-show-temporary-export-buffer 798 (when org-export-show-temporary-export-buffer
799 (switch-to-buffer-other-window "*Org LaTeX Export*"))) 799 (switch-to-buffer-other-window "*Org LaTeX Export*")))
800 800
@@ -848,7 +848,7 @@ in a window. A non-interactive call will only return the buffer."
848 (set-mark (point)) ;; to activate the region 848 (set-mark (point)) ;; to activate the region
849 (goto-char beg) 849 (goto-char beg)
850 (setq rtn (org-export-as-latex 850 (setq rtn (org-export-as-latex
851 nil nil ext-plist 851 nil ext-plist
852 buffer body-only)) 852 buffer body-only))
853 (if (fboundp 'deactivate-mark) (deactivate-mark)) 853 (if (fboundp 'deactivate-mark) (deactivate-mark))
854 (if (and (org-called-interactively-p 'any) (bufferp rtn)) 854 (if (and (org-called-interactively-p 'any) (bufferp rtn))
@@ -856,21 +856,19 @@ in a window. A non-interactive call will only return the buffer."
856 rtn))) 856 rtn)))
857 857
858;;;###autoload 858;;;###autoload
859(defun org-export-as-latex (arg &optional hidden ext-plist 859(defun org-export-as-latex (arg &optional ext-plist to-buffer body-only pub-dir)
860 to-buffer body-only pub-dir)
861 "Export current buffer to a LaTeX file. 860 "Export current buffer to a LaTeX file.
862If there is an active region, export only the region. The prefix 861If there is an active region, export only the region. The prefix
863ARG specifies how many levels of the outline should become 862ARG specifies how many levels of the outline should become
864headlines. The default is 3. Lower levels will be exported 863headlines. The default is 3. Lower levels will be exported
865depending on `org-export-latex-low-levels'. The default is to 864depending on `org-export-latex-low-levels'. The default is to
866convert them as description lists. 865convert them as description lists.
867HIDDEN is obsolete and does nothing. 866EXT-PLIST is a property list with external parameters overriding
868EXT-PLIST is a property list with 867org-mode's default settings, but still inferior to file-local settings.
869external parameters overriding org-mode's default settings, but 868When TO-BUFFER is non-nil, create a buffer with that name and export
870still inferior to file-local settings. When TO-BUFFER is 869to that buffer. If TO-BUFFER is the symbol `string', don't leave any
871non-nil, create a buffer with that name and export to that 870buffer behind and just return the resulting LaTeX as a string, with
872buffer. If TO-BUFFER is the symbol `string', don't leave any 871no LaTeX header.
873buffer behind but just return the resulting LaTeX as a string.
874When BODY-ONLY is set, don't produce the file header and footer, 872When BODY-ONLY is set, don't produce the file header and footer,
875simply return the content of \\begin{document}...\\end{document}, 873simply return the content of \\begin{document}...\\end{document},
876without even the \\begin{document} and \\end{document} commands. 874without even the \\begin{document} and \\end{document} commands.
@@ -957,10 +955,9 @@ when PUB-DIR is set, use this as the publishing directory."
957 (auto-insert nil); Avoid any auto-insert stuff for the new file 955 (auto-insert nil); Avoid any auto-insert stuff for the new file
958 (TeX-master (boundp 'TeX-master)) 956 (TeX-master (boundp 'TeX-master))
959 (buffer (if to-buffer 957 (buffer (if to-buffer
960 (cond 958 (if (eq to-buffer 'string)
961 ((eq to-buffer 'string) (get-buffer-create 959 (get-buffer-create "*Org LaTeX Export*")
962 "*Org LaTeX Export*")) 960 (get-buffer-create to-buffer))
963 (t (get-buffer-create to-buffer)))
964 (find-file-noselect filename))) 961 (find-file-noselect filename)))
965 (odd org-odd-levels-only) 962 (odd org-odd-levels-only)
966 (header (org-export-latex-make-header title opt-plist)) 963 (header (org-export-latex-make-header title opt-plist))
@@ -1120,8 +1117,7 @@ when PUB-DIR is set, use this as the publishing directory."
1120 (interactive "P") 1117 (interactive "P")
1121 (message "Exporting to PDF...") 1118 (message "Exporting to PDF...")
1122 (let* ((wconfig (current-window-configuration)) 1119 (let* ((wconfig (current-window-configuration))
1123 (lbuf (org-export-as-latex arg hidden ext-plist 1120 (lbuf (org-export-as-latex arg ext-plist to-buffer body-only pub-dir))
1124 to-buffer body-only pub-dir))
1125 (file (buffer-file-name lbuf)) 1121 (file (buffer-file-name lbuf))
1126 (base (file-name-sans-extension (buffer-file-name lbuf))) 1122 (base (file-name-sans-extension (buffer-file-name lbuf)))
1127 (pdffile (concat base ".pdf")) 1123 (pdffile (concat base ".pdf"))
@@ -2899,4 +2895,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
2899(provide 'org-export-latex) 2895(provide 'org-export-latex)
2900(provide 'org-latex) 2896(provide 'org-latex)
2901 2897
2898;; Local variables:
2899;; generated-autoload-file: "org-loaddefs.el"
2900;; End:
2901
2902;;; org-latex.el ends here 2902;;; org-latex.el ends here
diff --git a/lisp/org/org-lparse.el b/lisp/org/org-lparse.el
index 7024912050a..c5ced3ef01c 100644
--- a/lisp/org/org-lparse.el
+++ b/lisp/org/org-lparse.el
@@ -50,7 +50,6 @@
50(require 'org-list) 50(require 'org-list)
51(require 'format-spec) 51(require 'format-spec)
52 52
53;;;###autoload
54(defun org-lparse-and-open (target-backend native-backend arg 53(defun org-lparse-and-open (target-backend native-backend arg
55 &optional file-or-buf) 54 &optional file-or-buf)
56 "Export outline to TARGET-BACKEND via NATIVE-BACKEND and open exported file. 55 "Export outline to TARGET-BACKEND via NATIVE-BACKEND and open exported file.
@@ -71,7 +70,6 @@ lists."
71 (when org-export-kill-product-buffer-when-displayed 70 (when org-export-kill-product-buffer-when-displayed
72 (kill-buffer (current-buffer)))))) 71 (kill-buffer (current-buffer))))))
73 72
74;;;###autoload
75(defun org-lparse-batch (target-backend &optional native-backend) 73(defun org-lparse-batch (target-backend &optional native-backend)
76 "Call the function `org-lparse'. 74 "Call the function `org-lparse'.
77This function can be used in batch processing as: 75This function can be used in batch processing as:
@@ -83,7 +81,6 @@ emacs --batch
83 (org-lparse target-backend native-backend 81 (org-lparse target-backend native-backend
84 org-export-headline-levels 'hidden)) 82 org-export-headline-levels 'hidden))
85 83
86;;;###autoload
87(defun org-lparse-to-buffer (backend arg) 84(defun org-lparse-to-buffer (backend arg)
88 "Call `org-lparse' with output to a temporary buffer. 85 "Call `org-lparse' with output to a temporary buffer.
89No file is created. The prefix ARG is passed through to 86No file is created. The prefix ARG is passed through to
@@ -93,7 +90,6 @@ No file is created. The prefix ARG is passed through to
93 (when org-export-show-temporary-export-buffer 90 (when org-export-show-temporary-export-buffer
94 (switch-to-buffer-other-window tempbuf)))) 91 (switch-to-buffer-other-window tempbuf))))
95 92
96;;;###autoload
97(defun org-replace-region-by (backend beg end) 93(defun org-replace-region-by (backend beg end)
98 "Assume the current region has org-mode syntax, and convert it to HTML. 94 "Assume the current region has org-mode syntax, and convert it to HTML.
99This can be used in any buffer. For example, you could write an 95This can be used in any buffer. For example, you could write an
@@ -115,7 +111,6 @@ this command to convert it."
115 (delete-region beg end) 111 (delete-region beg end)
116 (insert backend-string))) 112 (insert backend-string)))
117 113
118;;;###autoload
119(defun org-lparse-region (backend beg end &optional body-only buffer) 114(defun org-lparse-region (backend beg end &optional body-only buffer)
120 "Convert region from BEG to END in org-mode buffer to HTML. 115 "Convert region from BEG to END in org-mode buffer to HTML.
121If prefix arg BODY-ONLY is set, omit file header, footer, and table of 116If prefix arg BODY-ONLY is set, omit file header, footer, and table of
@@ -447,11 +442,12 @@ PUB-DIR specifies the publishing directory."
447 (error "Don't know how to export to backend %s %s" target-backend 442 (error "Don't know how to export to backend %s %s" target-backend
448 (format "via %s" native-backend))) 443 (format "via %s" native-backend)))
449 (run-hooks 'org-export-first-hook) 444 (run-hooks 'org-export-first-hook)
450 (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir) 445 (prog1
451 (remove-hook 'org-export-preprocess-hook 446 (org-do-lparse arg hidden ext-plist to-buffer body-only pub-dir)
452 'org-lparse-strip-experimental-blocks-maybe) 447 (remove-hook 'org-export-preprocess-hook
453 (remove-hook 'org-export-preprocess-after-blockquote-hook 448 'org-lparse-strip-experimental-blocks-maybe)
454 'org-lparse-preprocess-after-blockquote))) 449 (remove-hook 'org-export-preprocess-after-blockquote-hook
450 'org-lparse-preprocess-after-blockquote))))
455 451
456(defcustom org-lparse-use-flashy-warning nil 452(defcustom org-lparse-use-flashy-warning nil
457 "Control flashing of messages logged with `org-lparse-warn'. 453 "Control flashing of messages logged with `org-lparse-warn'.
@@ -480,6 +476,8 @@ This is a helper routine for interactive use."
480(eval-when-compile 476(eval-when-compile
481 (require 'browse-url)) 477 (require 'browse-url))
482 478
479(declare-function browse-url-file-url "browse-url" (file))
480
483(defun org-lparse-do-convert (in-file out-fmt &optional prefix-arg) 481(defun org-lparse-do-convert (in-file out-fmt &optional prefix-arg)
484 "Workhorse routine for `org-export-odt-convert'." 482 "Workhorse routine for `org-export-odt-convert'."
485 (require 'browse-url) 483 (require 'browse-url)
@@ -2298,4 +2296,8 @@ Replaces invalid characters with \"_\"."
2298 2296
2299(provide 'org-lparse) 2297(provide 'org-lparse)
2300 2298
2299;; Local variables:
2300;; generated-autoload-file: "org-loaddefs.el"
2301;; End:
2302
2301;;; org-lparse.el ends here 2303;;; org-lparse.el ends here
diff --git a/lisp/org/org-mobile.el b/lisp/org/org-mobile.el
index d2c9c17367f..ffdd66513be 100644
--- a/lisp/org/org-mobile.el
+++ b/lisp/org/org-mobile.el
@@ -680,7 +680,6 @@ The table of checksums is written to the file mobile-checksums."
680 (let ((table '(?: ?/))) 680 (let ((table '(?: ?/)))
681 (org-link-escape s table))) 681 (org-link-escape s table)))
682 682
683;;;###autoload
684(defun org-mobile-create-sumo-agenda () 683(defun org-mobile-create-sumo-agenda ()
685 "Create a file that contains all custom agenda views." 684 "Create a file that contains all custom agenda views."
686 (interactive) 685 (interactive)
@@ -1129,4 +1128,8 @@ A and B must be strings or nil."
1129 1128
1130(provide 'org-mobile) 1129(provide 'org-mobile)
1131 1130
1131;; Local variables:
1132;; generated-autoload-file: "org-loaddefs.el"
1133;; End:
1134
1132;;; org-mobile.el ends here 1135;;; org-mobile.el ends here
diff --git a/lisp/org/org-odt.el b/lisp/org/org-odt.el
index 7de4b5de853..2dc3af39b09 100644
--- a/lisp/org/org-odt.el
+++ b/lisp/org/org-odt.el
@@ -2718,7 +2718,7 @@ Do this when translation to MathML fails."
2718(defun org-export-odt-preprocess (parameters) 2718(defun org-export-odt-preprocess (parameters)
2719 (org-export-odt-preprocess-label-references)) 2719 (org-export-odt-preprocess-label-references))
2720 2720
2721(declare-function archive-zip-extract "arc-mode.el" (archive name)) 2721(declare-function archive-zip-extract "arc-mode" (archive name))
2722(defun org-odt-zip-extract-one (archive member &optional target) 2722(defun org-odt-zip-extract-one (archive member &optional target)
2723 (require 'arc-mode) 2723 (require 'arc-mode)
2724 (let* ((target (or target default-directory)) 2724 (let* ((target (or target default-directory))
@@ -2847,4 +2847,8 @@ formula file."
2847 2847
2848(provide 'org-odt) 2848(provide 'org-odt)
2849 2849
2850;; Local variables:
2851;; generated-autoload-file: "org-loaddefs.el"
2852;; End:
2853
2850;;; org-odt.el ends here 2854;;; org-odt.el ends here
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el
index 48d72ac2810..5dec304363f 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -351,4 +351,8 @@ line directly before or after the table."
351 351
352(provide 'org-plot) 352(provide 'org-plot)
353 353
354;; Local variables:
355;; generated-autoload-file: "org-loaddefs.el"
356;; End:
357
354;;; org-plot.el ends here 358;;; org-plot.el ends here
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el
index 947d52b9200..d10514255b6 100644
--- a/lisp/org/org-publish.el
+++ b/lisp/org/org-publish.el
@@ -916,7 +916,6 @@ directory and force publishing all files."
916 (if force nil org-publish-use-timestamps-flag))) 916 (if force nil org-publish-use-timestamps-flag)))
917 (org-publish-projects org-publish-project-alist)))) 917 (org-publish-projects org-publish-project-alist))))
918 918
919
920;;;###autoload 919;;;###autoload
921(defun org-publish-current-file (&optional force) 920(defun org-publish-current-file (&optional force)
922 "Publish the current file. 921 "Publish the current file.
@@ -1192,4 +1191,8 @@ Returns value on success, else nil."
1192 1191
1193(provide 'org-publish) 1192(provide 'org-publish)
1194 1193
1194;; Local variables:
1195;; generated-autoload-file: "org-loaddefs.el"
1196;; End:
1197
1195;;; org-publish.el ends here 1198;;; org-publish.el ends here
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el
index dd493749295..d555ca65d21 100644
--- a/lisp/org/org-remember.el
+++ b/lisp/org/org-remember.el
@@ -1149,4 +1149,8 @@ See also the variable `org-reverse-note-order'."
1149 1149
1150(provide 'org-remember) 1150(provide 'org-remember)
1151 1151
1152;; Local variables:
1153;; generated-autoload-file: "org-loaddefs.el"
1154;; End:
1155
1152;;; org-remember.el ends here 1156;;; org-remember.el ends here
diff --git a/lisp/org/org-src.el b/lisp/org/org-src.el
index 9d6bc1aa2c8..b4d4c0489a9 100644
--- a/lisp/org/org-src.el
+++ b/lisp/org/org-src.el
@@ -41,10 +41,8 @@
41(declare-function org-at-table.el-p "org" ()) 41(declare-function org-at-table.el-p "org" ())
42(declare-function org-get-indentation "org" (&optional line)) 42(declare-function org-get-indentation "org" (&optional line))
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-strip-protective-commas "org" (beg end))
45(declare-function org-pop-to-buffer-same-window 44(declare-function org-pop-to-buffer-same-window
46 "org-compat" (&optional buffer-or-name norecord label)) 45 "org-compat" (&optional buffer-or-name norecord label))
47(declare-function org-strip-protective-commas "org" (beg end))
48(declare-function org-base-buffer "org" (buffer)) 46(declare-function org-base-buffer "org" (buffer))
49 47
50(defcustom org-edit-src-region-extra nil 48(defcustom org-edit-src-region-extra nil
@@ -311,13 +309,8 @@ buffer."
311 (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)))))
312 (dolist (pair transmitted-variables) 310 (dolist (pair transmitted-variables)
313 (org-set-local (car pair) (cadr pair))) 311 (org-set-local (car pair) (cadr pair)))
314 (if (derived-mode-p 'org-mode) 312 ;; Remove protecting commas from visible part of buffer.
315 (progn 313 (org-unescape-code-in-region (point-min) (point-max))
316 (goto-char (point-min))
317 (while (re-search-forward "^," nil t)
318 (if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent)))
319 (replace-match "")))
320 (org-strip-protective-commas (point-min) (point-max)))
321 (when markline 314 (when markline
322 (org-goto-line (1+ (- markline begline))) 315 (org-goto-line (1+ (- markline begline)))
323 (org-move-to-column 316 (org-move-to-column
@@ -590,20 +583,38 @@ the language, a switch telling if the content should be in a single line."
590 (goto-char pos) 583 (goto-char pos)
591 (org-get-indentation))) 584 (org-get-indentation)))
592 585
593(defun org-add-protective-commas (beg end &optional line) 586(defun org-escape-code-in-region (beg end)
594 "Add protective commas in region. 587 "Escape lines between BEG and END.
595Return the delta in size of the region." 588Escaping happens when a line starts with \"*\", \"#+\", \",*\" or
589\",#+\" by appending a comma to it."
596 (interactive "r") 590 (interactive "r")
597 (let ((org-re "^\\(.\\)") 591 (save-excursion
598 (other-re "^\\([*]\\|[ \t]*#\\+\\)") 592 (goto-char beg)
599 (delta 0)) 593 (while (re-search-forward "^[ \t]*,?\\(\\*\\|#\\+\\)" end t)
600 (save-excursion 594 (replace-match ",\\1" nil nil nil 1))))
601 (goto-char beg) 595
602 (while (re-search-forward (if (derived-mode-p 'org-mode) org-re other-re) 596(defun org-escape-code-in-string (s)
603 end t) 597 "Escape lines in string S.
604 (if (and line (eq (org-current-line) line)) (setq delta (1+ delta))) 598Escaping happens when a line starts with \"*\", \"#+\", \",*\" or
605 (replace-match ",\\1"))) 599\",#+\" by appending a comma to it."
606 delta)) 600 (replace-regexp-in-string "^[ \t]*,?\\(\\*\\|#\\+\\)" ",\\1" s nil nil 1))
601
602(defun org-unescape-code-in-region (beg end)
603 "Un-escape lines between BEG and END.
604Un-escaping happens by removing the first comma on lines starting
605with \",*\", \",#+\", \",,*\" and \",,#+\"."
606 (interactive "r")
607 (save-excursion
608 (goto-char beg)
609 (while (re-search-forward "^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" end t)
610 (replace-match "" nil nil nil 1))))
611
612(defun org-unescape-code-in-string (s)
613 "Un-escape lines in string S.
614Un-escaping happens by removing the first comma on lines starting
615with \",*\", \",#+\", \",,*\" and \",,#+\"."
616 (replace-regexp-in-string
617 "^[ \t]*,?\\(,\\)\\(?:\\*\\|#\\+\\)" "" s nil nil 1))
607 618
608(defun org-edit-src-exit (&optional context) 619(defun org-edit-src-exit (&optional context)
609 "Exit special edit and protect problematic lines." 620 "Exit special edit and protect problematic lines."
@@ -649,8 +660,12 @@ Return the delta in size of the region."
649 (goto-char (point-min)) 660 (goto-char (point-min))
650 (if (looking-at "\\s-*") (replace-match " "))) 661 (if (looking-at "\\s-*") (replace-match " ")))
651 (when (org-bound-and-true-p org-edit-src-from-org-mode) 662 (when (org-bound-and-true-p org-edit-src-from-org-mode)
652 (setq delta (+ delta (org-add-protective-commas 663 (org-escape-code-in-region (point-min) (point-max))
653 (point-min) (point-max) line)))) 664 (setq delta (+ delta
665 (save-excursion
666 (org-goto-line line)
667 (if (looking-at "[ \t]*\\(,,\\)?\\(\\*\\|#+\\)") 1
668 0)))))
654 (when (org-bound-and-true-p org-edit-src-picture) 669 (when (org-bound-and-true-p org-edit-src-picture)
655 (setq preserve-indentation nil) 670 (setq preserve-indentation nil)
656 (untabify (point-min) (point-max)) 671 (untabify (point-min) (point-max))
@@ -674,9 +689,10 @@ Return the delta in size of the region."
674 (kill-buffer buffer)) 689 (kill-buffer buffer))
675 (goto-char beg) 690 (goto-char beg)
676 (when allow-write-back-p 691 (when allow-write-back-p
677 (delete-region beg (1- end)) 692 (delete-region beg (max beg (1- end)))
678 (insert code) 693 (unless (string-match "^[ \t]*$" code)
679 (delete-char 1) 694 (insert code)
695 (delete-char 1))
680 (goto-char beg) 696 (goto-char beg)
681 (if single (just-one-space))) 697 (if single (just-one-space)))
682 (if (memq t (mapcar (lambda (overlay) 698 (if (memq t (mapcar (lambda (overlay)
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 3eb63b6e53c..0555041231b 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -423,6 +423,7 @@ available parameters."
423 (concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)") 423 (concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)")
424 "Match a reference that needs translation, for reference display.") 424 "Match a reference that needs translation, for reference display.")
425 425
426;;;###autoload
426(defun org-table-create-with-table.el () 427(defun org-table-create-with-table.el ()
427 "Use the table.el package to insert a new table. 428 "Use the table.el package to insert a new table.
428If there is already a table at point, convert between Org-mode tables 429If there is already a table at point, convert between Org-mode tables
@@ -439,6 +440,7 @@ and table.el tables."
439 (org-table-convert))) 440 (org-table-convert)))
440 (t (call-interactively 'table-insert)))) 441 (t (call-interactively 'table-insert))))
441 442
443;;;###autoload
442(defun org-table-create-or-convert-from-region (arg) 444(defun org-table-create-or-convert-from-region (arg)
443 "Convert region to table, or create an empty table. 445 "Convert region to table, or create an empty table.
444If there is an active region, convert it to a table, using the function 446If there is an active region, convert it to a table, using the function
@@ -451,6 +453,7 @@ If there is no such region, create an empty table with `org-table-create'."
451 (org-table-convert-region (region-beginning) (region-end) arg) 453 (org-table-convert-region (region-beginning) (region-end) arg)
452 (org-table-create arg))) 454 (org-table-create arg)))
453 455
456;;;###autoload
454(defun org-table-create (&optional size) 457(defun org-table-create (&optional size)
455 "Query for a size and insert a table skeleton. 458 "Query for a size and insert a table skeleton.
456SIZE is a string Columns x Rows like for example \"3x2\"." 459SIZE is a string Columns x Rows like for example \"3x2\"."
@@ -483,6 +486,7 @@ SIZE is a string Columns x Rows like for example \"3x2\"."
483 (goto-char pos))) 486 (goto-char pos)))
484 (org-table-align))) 487 (org-table-align)))
485 488
489;;;###autoload
486(defun org-table-convert-region (beg0 end0 &optional separator) 490(defun org-table-convert-region (beg0 end0 &optional separator)
487 "Convert region to a table. 491 "Convert region to a table.
488The region goes from BEG0 to END0, but these borders will be moved 492The region goes from BEG0 to END0, but these borders will be moved
@@ -543,6 +547,7 @@ nil When nil, the command tries to be smart and figure out the
543 (goto-char beg) 547 (goto-char beg)
544 (org-table-align))) 548 (org-table-align)))
545 549
550;;;###autoload
546(defun org-table-import (file arg) 551(defun org-table-import (file arg)
547 "Import FILE as a table. 552 "Import FILE as a table.
548The file is assumed to be tab-separated. Such files can be produced by most 553The file is assumed to be tab-separated. Such files can be produced by most
@@ -558,6 +563,7 @@ are found, lines will be split on whitespace into fields."
558 563
559(defvar org-table-last-alignment) 564(defvar org-table-last-alignment)
560(defvar org-table-last-column-widths) 565(defvar org-table-last-column-widths)
566;;;###autoload
561(defun org-table-export (&optional file format) 567(defun org-table-export (&optional file format)
562 "Export table to a file, with configurable format. 568 "Export table to a file, with configurable format.
563Such a file can be imported into usual spreadsheet programs. 569Such a file can be imported into usual spreadsheet programs.
@@ -673,6 +679,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
673(defconst org-narrow-column-arrow "=>" 679(defconst org-narrow-column-arrow "=>"
674 "Used as display property in narrowed table columns.") 680 "Used as display property in narrowed table columns.")
675 681
682;;;###autoload
676(defun org-table-align () 683(defun org-table-align ()
677 "Align the table at point by aligning all vertical bars." 684 "Align the table at point by aligning all vertical bars."
678 (interactive) 685 (interactive)
@@ -884,6 +891,7 @@ With argument TABLE-TYPE, go to the end of a table.el-type table."
884 (goto-char (match-beginning 0))) 891 (goto-char (match-beginning 0)))
885 (point-marker))) 892 (point-marker)))
886 893
894;;;###autoload
887(defun org-table-justify-field-maybe (&optional new) 895(defun org-table-justify-field-maybe (&optional new)
888 "Justify the current field, text to left, number to right. 896 "Justify the current field, text to left, number to right.
889Optional argument NEW may specify text to replace the current field content." 897Optional argument NEW may specify text to replace the current field content."
@@ -924,6 +932,7 @@ Optional argument NEW may specify text to replace the current field content."
924 (setq org-table-may-need-update t)) 932 (setq org-table-may-need-update t))
925 (goto-char pos)))))) 933 (goto-char pos))))))
926 934
935;;;###autoload
927(defun org-table-next-field () 936(defun org-table-next-field ()
928 "Go to the next field in the current table, creating new lines as needed. 937 "Go to the next field in the current table, creating new lines as needed.
929Before doing so, re-align the table if necessary." 938Before doing so, re-align the table if necessary."
@@ -953,6 +962,7 @@ Before doing so, re-align the table if necessary."
953 (error 962 (error
954 (org-table-insert-row 'below))))) 963 (org-table-insert-row 'below)))))
955 964
965;;;###autoload
956(defun org-table-previous-field () 966(defun org-table-previous-field ()
957 "Go to the previous field in the table. 967 "Go to the previous field in the table.
958Before doing so, re-align the table if necessary." 968Before doing so, re-align the table if necessary."
@@ -1006,6 +1016,7 @@ With numeric argument N, move N-1 fields backward first."
1006 (forward-char 1))) 1016 (forward-char 1)))
1007 (if (<= (point) pos) (org-table-end-of-field 2)))) 1017 (if (<= (point) pos) (org-table-end-of-field 2))))
1008 1018
1019;;;###autoload
1009(defun org-table-next-row () 1020(defun org-table-next-row ()
1010 "Go to the next row (same column) in the current table. 1021 "Go to the next row (same column) in the current table.
1011Before doing so, re-align the table if necessary." 1022Before doing so, re-align the table if necessary."
@@ -1029,6 +1040,7 @@ Before doing so, re-align the table if necessary."
1029 (skip-chars-backward "^|\n\r") 1040 (skip-chars-backward "^|\n\r")
1030 (if (looking-at " ") (forward-char 1))))) 1041 (if (looking-at " ") (forward-char 1)))))
1031 1042
1043;;;###autoload
1032(defun org-table-copy-down (n) 1044(defun org-table-copy-down (n)
1033 "Copy a field down in the current column. 1045 "Copy a field down in the current column.
1034If the field at the cursor is empty, copy into it the content of 1046If the field at the cursor is empty, copy into it the content of
@@ -1173,6 +1185,7 @@ is always the old value."
1173 val) 1185 val)
1174 (forward-char 1) "")) 1186 (forward-char 1) ""))
1175 1187
1188;;;###autoload
1176(defun org-table-field-info (arg) 1189(defun org-table-field-info (arg)
1177 "Show info about the current field, and highlight any reference at point." 1190 "Show info about the current field, and highlight any reference at point."
1178 (interactive "P") 1191 (interactive "P")
@@ -1228,6 +1241,7 @@ is always the old value."
1228 (message "In table column %d" cnt)) 1241 (message "In table column %d" cnt))
1229 cnt))) 1242 cnt)))
1230 1243
1244;;;###autoload
1231(defun org-table-current-dline () 1245(defun org-table-current-dline ()
1232 "Find out what table data line we are in. 1246 "Find out what table data line we are in.
1233Only data lines count for this." 1247Only data lines count for this."
@@ -1244,6 +1258,7 @@ Only data lines count for this."
1244 (message "This is table line %d" cnt)) 1258 (message "This is table line %d" cnt))
1245 cnt))) 1259 cnt)))
1246 1260
1261;;;###autoload
1247(defun org-table-goto-column (n &optional on-delim force) 1262(defun org-table-goto-column (n &optional on-delim force)
1248 "Move the cursor to the Nth column in the current table line. 1263 "Move the cursor to the Nth column in the current table line.
1249With optional argument ON-DELIM, stop with point before the left delimiter 1264With optional argument ON-DELIM, stop with point before the left delimiter
@@ -1266,6 +1281,7 @@ However, when FORCE is non-nil, create new columns if necessary."
1266 (backward-char 1) 1281 (backward-char 1)
1267 (if (looking-at " ") (forward-char 1))))) 1282 (if (looking-at " ") (forward-char 1)))))
1268 1283
1284;;;###autoload
1269(defun org-table-insert-column () 1285(defun org-table-insert-column ()
1270 "Insert a new column into the table." 1286 "Insert a new column into the table."
1271 (interactive) 1287 (interactive)
@@ -1335,6 +1351,7 @@ first dline below it is used. When ABOVE is non-nil, the one above is used."
1335 (setq i (1+ i))))) 1351 (setq i (1+ i)))))
1336 nil)) 1352 nil))
1337 1353
1354;;;###autoload
1338(defun org-table-delete-column () 1355(defun org-table-delete-column ()
1339 "Delete a column from the table." 1356 "Delete a column from the table."
1340 (interactive) 1357 (interactive)
@@ -1367,15 +1384,18 @@ first dline below it is used. When ABOVE is non-nil, the one above is used."
1367 (org-table-fix-formulas "$LR" (list (cons (number-to-string col) "INVALID")) 1384 (org-table-fix-formulas "$LR" (list (cons (number-to-string col) "INVALID"))
1368 col -1 col)))) 1385 col -1 col))))
1369 1386
1387;;;###autoload
1370(defun org-table-move-column-right () 1388(defun org-table-move-column-right ()
1371 "Move column to the right." 1389 "Move column to the right."
1372 (interactive) 1390 (interactive)
1373 (org-table-move-column nil)) 1391 (org-table-move-column nil))
1392;;;###autoload
1374(defun org-table-move-column-left () 1393(defun org-table-move-column-left ()
1375 "Move column to the left." 1394 "Move column to the left."
1376 (interactive) 1395 (interactive)
1377 (org-table-move-column 'left)) 1396 (org-table-move-column 'left))
1378 1397
1398;;;###autoload
1379(defun org-table-move-column (&optional left) 1399(defun org-table-move-column (&optional left)
1380 "Move the current column to the right. With arg LEFT, move to the left." 1400 "Move the current column to the right. With arg LEFT, move to the left."
1381 (interactive "P") 1401 (interactive "P")
@@ -1415,15 +1435,18 @@ first dline below it is used. When ABOVE is non-nil, the one above is used."
1415 "$LR" (list (cons (number-to-string col) (number-to-string colpos)) 1435 "$LR" (list (cons (number-to-string col) (number-to-string colpos))
1416 (cons (number-to-string colpos) (number-to-string col))))))) 1436 (cons (number-to-string colpos) (number-to-string col)))))))
1417 1437
1438;;;###autoload
1418(defun org-table-move-row-down () 1439(defun org-table-move-row-down ()
1419 "Move table row down." 1440 "Move table row down."
1420 (interactive) 1441 (interactive)
1421 (org-table-move-row nil)) 1442 (org-table-move-row nil))
1443;;;###autoload
1422(defun org-table-move-row-up () 1444(defun org-table-move-row-up ()
1423 "Move table row up." 1445 "Move table row up."
1424 (interactive) 1446 (interactive)
1425 (org-table-move-row 'up)) 1447 (org-table-move-row 'up))
1426 1448
1449;;;###autoload
1427(defun org-table-move-row (&optional up) 1450(defun org-table-move-row (&optional up)
1428 "Move the current table line down. With arg UP, move it up." 1451 "Move the current table line down. With arg UP, move it up."
1429 (interactive "P") 1452 (interactive "P")
@@ -1457,6 +1480,7 @@ first dline below it is used. When ABOVE is non-nil, the one above is used."
1457 "@" (list (cons (number-to-string dline1) (number-to-string dline2)) 1480 "@" (list (cons (number-to-string dline1) (number-to-string dline2))
1458 (cons (number-to-string dline2) (number-to-string dline1))))))) 1481 (cons (number-to-string dline2) (number-to-string dline1)))))))
1459 1482
1483;;;###autoload
1460(defun org-table-insert-row (&optional arg) 1484(defun org-table-insert-row (&optional arg)
1461 "Insert a new row above the current line into the table. 1485 "Insert a new row above the current line into the table.
1462With prefix ARG, insert below the current line." 1486With prefix ARG, insert below the current line."
@@ -1478,6 +1502,7 @@ With prefix ARG, insert below the current line."
1478 (funcall org-table-fix-formulas-confirm "Fix formulas? ")) 1502 (funcall org-table-fix-formulas-confirm "Fix formulas? "))
1479 (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1)))) 1503 (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1))))
1480 1504
1505;;;###autoload
1481(defun org-table-insert-hline (&optional above) 1506(defun org-table-insert-hline (&optional above)
1482 "Insert a horizontal-line below the current line into the table. 1507 "Insert a horizontal-line below the current line into the table.
1483With prefix ABOVE, insert above the current line." 1508With prefix ABOVE, insert above the current line."
@@ -1501,6 +1526,7 @@ With prefix ABOVE, insert above the current line."
1501 (org-move-to-column col) 1526 (org-move-to-column col)
1502 (and org-table-overlay-coordinates (org-table-align)))) 1527 (and org-table-overlay-coordinates (org-table-align))))
1503 1528
1529;;;###autoload
1504(defun org-table-hline-and-move (&optional same-column) 1530(defun org-table-hline-and-move (&optional same-column)
1505 "Insert a hline and move to the row below that line." 1531 "Insert a hline and move to the row below that line."
1506 (interactive "P") 1532 (interactive "P")
@@ -1527,6 +1553,7 @@ In particular, this does handle wide and invisible characters."
1527 t t s))) 1553 t t s)))
1528 s)) 1554 s))
1529 1555
1556;;;###autoload
1530(defun org-table-kill-row () 1557(defun org-table-kill-row ()
1531 "Delete the current row or horizontal line from the table." 1558 "Delete the current row or horizontal line from the table."
1532 (interactive) 1559 (interactive)
@@ -1542,6 +1569,7 @@ In particular, this does handle wide and invisible characters."
1542 (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID")) 1569 (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))
1543 dline -1 dline)))) 1570 dline -1 dline))))
1544 1571
1572;;;###autoload
1545(defun org-table-sort-lines (with-case &optional sorting-type) 1573(defun org-table-sort-lines (with-case &optional sorting-type)
1546 "Sort table lines according to the column at point. 1574 "Sort table lines according to the column at point.
1547 1575
@@ -1622,7 +1650,7 @@ should be done in reverse order."
1622 (org-table-goto-column thiscol) 1650 (org-table-goto-column thiscol)
1623 (message "%d lines sorted, based on column %d" (length lns) column))) 1651 (message "%d lines sorted, based on column %d" (length lns) column)))
1624 1652
1625 1653;;;###autoload
1626(defun org-table-cut-region (beg end) 1654(defun org-table-cut-region (beg end)
1627 "Copy region in table to the clipboard and blank all relevant fields. 1655 "Copy region in table to the clipboard and blank all relevant fields.
1628If there is no active region, use just the field at point." 1656If there is no active region, use just the field at point."
@@ -1631,6 +1659,7 @@ If there is no active region, use just the field at point."
1631 (if (org-region-active-p) (region-end) (point)))) 1659 (if (org-region-active-p) (region-end) (point))))
1632 (org-table-copy-region beg end 'cut)) 1660 (org-table-copy-region beg end 'cut))
1633 1661
1662;;;###autoload
1634(defun org-table-copy-region (beg end &optional cut) 1663(defun org-table-copy-region (beg end &optional cut)
1635 "Copy rectangular region in table to clipboard. 1664 "Copy rectangular region in table to clipboard.
1636A special clipboard is used which can only be accessed 1665A special clipboard is used which can only be accessed
@@ -1668,6 +1697,7 @@ with `org-table-paste-rectangle'."
1668 (if cut (org-table-align)) 1697 (if cut (org-table-align))
1669 org-table-clip)) 1698 org-table-clip))
1670 1699
1700;;;###autoload
1671(defun org-table-paste-rectangle () 1701(defun org-table-paste-rectangle ()
1672 "Paste a rectangular region into a table. 1702 "Paste a rectangular region into a table.
1673The upper right corner ends up in the current field. All involved fields 1703The upper right corner ends up in the current field. All involved fields
@@ -1698,6 +1728,7 @@ lines."
1698 (org-table-goto-column col) 1728 (org-table-goto-column col)
1699 (org-table-align))) 1729 (org-table-align)))
1700 1730
1731;;;###autoload
1701(defun org-table-convert () 1732(defun org-table-convert ()
1702 "Convert from `org-mode' table to table.el and back. 1733 "Convert from `org-mode' table to table.el and back.
1703Obviously, this only works within limits. When an Org-mode table is 1734Obviously, this only works within limits. When an Org-mode table is
@@ -1771,6 +1802,7 @@ Note that horizontal lines disappeared."
1771 contents "")) 1802 contents ""))
1772 (org-table-align))) 1803 (org-table-align)))
1773 1804
1805;;;###autoload
1774(defun org-table-wrap-region (arg) 1806(defun org-table-wrap-region (arg)
1775 "Wrap several fields in a column like a paragraph. 1807 "Wrap several fields in a column like a paragraph.
1776This is useful if you'd like to spread the contents of a field over several 1808This is useful if you'd like to spread the contents of a field over several
@@ -1841,6 +1873,7 @@ blank, and the content is appended to the field above."
1841 1873
1842(defvar org-field-marker nil) 1874(defvar org-field-marker nil)
1843 1875
1876;;;###autoload
1844(defun org-table-edit-field (arg) 1877(defun org-table-edit-field (arg)
1845 "Edit table field in a different window. 1878 "Edit table field in a different window.
1846This is mainly useful for fields that contain hidden parts. 1879This is mainly useful for fields that contain hidden parts.
@@ -1944,6 +1977,7 @@ table (but see `org-table-exit-follow-field-mode-when-leaving-table')."
1944 1977
1945(defvar org-timecnt) ; dynamically scoped parameter 1978(defvar org-timecnt) ; dynamically scoped parameter
1946 1979
1980;;;###autoload
1947(defun org-table-sum (&optional beg end nlast) 1981(defun org-table-sum (&optional beg end nlast)
1948 "Sum numbers in region of current table column. 1982 "Sum numbers in region of current table column.
1949The result will be displayed in the echo area, and will be available 1983The result will be displayed in the echo area, and will be available
@@ -2144,9 +2178,10 @@ When NAMED is non-nil, look for a named equation."
2144 (bs (org-table-formula-make-cmp-string (car b)))) 2178 (bs (org-table-formula-make-cmp-string (car b))))
2145 (and as bs (string< as bs)))) 2179 (and as bs (string< as bs))))
2146 2180
2181;;;###autoload
2147(defun org-table-get-stored-formulas (&optional noerror) 2182(defun org-table-get-stored-formulas (&optional noerror)
2148 "Return an alist with the stored formulas directly after current table." 2183 "Return an alist with the stored formulas directly after current table."
2149 (interactive) 2184 (interactive) ;; FIXME interactive?
2150 (let ((case-fold-search t) scol eq eq-alist strings string seen) 2185 (let ((case-fold-search t) scol eq eq-alist strings string seen)
2151 (save-excursion 2186 (save-excursion
2152 (goto-char (org-table-end)) 2187 (goto-char (org-table-end))
@@ -2283,6 +2318,7 @@ For all numbers larger than LIMIT, shift them by DELTA."
2283 (setq org-table-local-parameters 2318 (setq org-table-local-parameters
2284 (append org-table-local-parameters al2)))))) 2319 (append org-table-local-parameters al2))))))
2285 2320
2321;;;###autoload
2286(defun org-table-maybe-eval-formula () 2322(defun org-table-maybe-eval-formula ()
2287 "Check if the current field starts with \"=\" or \":=\". 2323 "Check if the current field starts with \"=\" or \":=\".
2288If yes, store the formula and apply it." 2324If yes, store the formula and apply it."
@@ -2313,6 +2349,7 @@ Will be filled automatically during use.")
2313 ("_" . "Names for values in row below this one.") 2349 ("_" . "Names for values in row below this one.")
2314 ("^" . "Names for values in row above this one."))) 2350 ("^" . "Names for values in row above this one.")))
2315 2351
2352;;;###autoload
2316(defun org-table-rotate-recalc-marks (&optional newchar) 2353(defun org-table-rotate-recalc-marks (&optional newchar)
2317 "Rotate the recalculation mark in the first column. 2354 "Rotate the recalculation mark in the first column.
2318If in any row, the first field is not consistent with a mark, 2355If in any row, the first field is not consistent with a mark,
@@ -2374,6 +2411,7 @@ of the new mark."
2374 (and (org-called-interactively-p 'interactive) 2411 (and (org-called-interactively-p 'interactive)
2375 (message "%s" (cdr (assoc new org-recalc-marks)))))) 2412 (message "%s" (cdr (assoc new org-recalc-marks))))))
2376 2413
2414;;;###autoload
2377(defun org-table-maybe-recalculate-line () 2415(defun org-table-maybe-recalculate-line ()
2378 "Recompute the current line if marked for it, and if we haven't just done it." 2416 "Recompute the current line if marked for it, and if we haven't just done it."
2379 (interactive) 2417 (interactive)
@@ -2397,6 +2435,7 @@ of the new mark."
2397 (cons var (cons value org-tbl-calc-modes))) 2435 (cons var (cons value org-tbl-calc-modes)))
2398 org-tbl-calc-modes) 2436 org-tbl-calc-modes)
2399 2437
2438;;;###autoload
2400(defun org-table-eval-formula (&optional arg equation 2439(defun org-table-eval-formula (&optional arg equation
2401 suppress-align suppress-const 2440 suppress-align suppress-const
2402 suppress-store suppress-analysis) 2441 suppress-store suppress-analysis)
@@ -2823,6 +2862,7 @@ LISPP means to return something appropriate for a Lisp list."
2823 elements 2862 elements
2824 ",") "]")))) 2863 ",") "]"))))
2825 2864
2865;;;###autoload
2826(defun org-table-recalculate (&optional all noalign) 2866(defun org-table-recalculate (&optional all noalign)
2827 "Recalculate the current table line by applying all stored formulas. 2867 "Recalculate the current table line by applying all stored formulas.
2828With prefix arg ALL, do this for all lines in the table. 2868With prefix arg ALL, do this for all lines in the table.
@@ -2961,6 +3001,7 @@ known that the table will be realigned a little later anyway."
2961 (or noalign (and org-table-may-need-update (org-table-align)) 3001 (or noalign (and org-table-may-need-update (org-table-align))
2962 (and all (message "Re-applying formulas...done")))))) 3002 (and all (message "Re-applying formulas...done"))))))
2963 3003
3004;;;###autoload
2964(defun org-table-iterate (&optional arg) 3005(defun org-table-iterate (&optional arg)
2965 "Recalculate the table until it does not change anymore. 3006 "Recalculate the table until it does not change anymore.
2966The maximum number of iterations is 10, but you can choose a different value 3007The maximum number of iterations is 10, but you can choose a different value
@@ -2997,10 +3038,9 @@ with the prefix ARG."
2997 "Iterate all tables in the buffer, to converge inter-table dependencies." 3038 "Iterate all tables in the buffer, to converge inter-table dependencies."
2998 (interactive) 3039 (interactive)
2999 (let* ((imax 10) 3040 (let* ((imax 10)
3041 (i imax)
3000 (checksum (md5 (buffer-string))) 3042 (checksum (md5 (buffer-string)))
3001 3043 c1)
3002 c1
3003 (i imax))
3004 (save-excursion 3044 (save-excursion
3005 (save-restriction 3045 (save-restriction
3006 (widen) 3046 (widen)
@@ -3164,6 +3204,7 @@ Parameters get priority."
3164 3204
3165(defvar org-pos) 3205(defvar org-pos)
3166 3206
3207;;;###autoload
3167(defun org-table-edit-formulas () 3208(defun org-table-edit-formulas ()
3168 "Edit the formulas of the current table in a separate buffer." 3209 "Edit the formulas of the current table in a separate buffer."
3169 (interactive) 3210 (interactive)
@@ -3801,6 +3842,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
3801 (org-overlay-display ov str 'org-special-keyword 'evaporate))) 3842 (org-overlay-display ov str 'org-special-keyword 'evaporate)))
3802 (beginning-of-line 2))))) 3843 (beginning-of-line 2)))))
3803 3844
3845;;;###autoload
3804(defun org-table-toggle-coordinate-overlays () 3846(defun org-table-toggle-coordinate-overlays ()
3805 "Toggle the display of Row/Column numbers in tables." 3847 "Toggle the display of Row/Column numbers in tables."
3806 (interactive) 3848 (interactive)
@@ -3813,6 +3855,7 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
3813 (mapc 'delete-overlay org-table-coordinate-overlays) 3855 (mapc 'delete-overlay org-table-coordinate-overlays)
3814 (setq org-table-coordinate-overlays nil))) 3856 (setq org-table-coordinate-overlays nil)))
3815 3857
3858;;;###autoload
3816(defun org-table-toggle-formula-debugger () 3859(defun org-table-toggle-formula-debugger ()
3817 "Toggle the formula debugger in tables." 3860 "Toggle the formula debugger in tables."
3818 (interactive) 3861 (interactive)
@@ -3852,11 +3895,6 @@ Use COMMAND to do the motion, repeat if necessary to end up in a data line."
3852(defvar orgtbl-mode-map (make-keymap) 3895(defvar orgtbl-mode-map (make-keymap)
3853 "Keymap for `orgtbl-mode'.") 3896 "Keymap for `orgtbl-mode'.")
3854 3897
3855;;;###autoload
3856(defun turn-on-orgtbl ()
3857 "Unconditionally turn on `orgtbl-mode'."
3858 (orgtbl-mode 1))
3859
3860(defvar org-old-auto-fill-inhibit-regexp nil 3898(defvar org-old-auto-fill-inhibit-regexp nil
3861 "Local variable used by `orgtbl-mode'.") 3899 "Local variable used by `orgtbl-mode'.")
3862 3900
@@ -4480,6 +4518,7 @@ First element has index 0, or I0 if given."
4480 (*orgtbl-lfmt* *orgtbl-llfmt*)) 4518 (*orgtbl-lfmt* *orgtbl-llfmt*))
4481 (orgtbl-format-line prevline)))))) 4519 (orgtbl-format-line prevline))))))
4482 4520
4521;;;###autoload
4483(defun orgtbl-to-generic (table params) 4522(defun orgtbl-to-generic (table params)
4484 "Convert the orgtbl-mode TABLE to some other format. 4523 "Convert the orgtbl-mode TABLE to some other format.
4485This generic routine can be used for many standard cases. 4524This generic routine can be used for many standard cases.
@@ -4606,9 +4645,11 @@ directly by `orgtbl-send-table'. See manual."
4606 (remq nil *orgtbl-rtn*) 4645 (remq nil *orgtbl-rtn*)
4607 *orgtbl-rtn*)) "\n"))) 4646 *orgtbl-rtn*)) "\n")))
4608 4647
4648;;;###autoload
4609(defun orgtbl-to-tsv (table params) 4649(defun orgtbl-to-tsv (table params)
4610 "Convert the orgtbl-mode table to TAB separated material." 4650 "Convert the orgtbl-mode table to TAB separated material."
4611 (orgtbl-to-generic table (org-combine-plists '(:sep "\t") params))) 4651 (orgtbl-to-generic table (org-combine-plists '(:sep "\t") params)))
4652;;;###autoload
4612(defun orgtbl-to-csv (table params) 4653(defun orgtbl-to-csv (table params)
4613 "Convert the orgtbl-mode table to CSV material. 4654 "Convert the orgtbl-mode table to CSV material.
4614This does take care of the proper quoting of fields with comma or quotes." 4655This does take care of the proper quoting of fields with comma or quotes."
@@ -4616,6 +4657,7 @@ This does take care of the proper quoting of fields with comma or quotes."
4616 '(:sep "," :fmt org-quote-csv-field) 4657 '(:sep "," :fmt org-quote-csv-field)
4617 params))) 4658 params)))
4618 4659
4660;;;###autoload
4619(defun orgtbl-to-latex (table params) 4661(defun orgtbl-to-latex (table params)
4620 "Convert the orgtbl-mode TABLE to LaTeX. 4662 "Convert the orgtbl-mode TABLE to LaTeX.
4621TABLE is a list, each entry either the symbol `hline' for a horizontal 4663TABLE is a list, each entry either the symbol `hline' for a horizontal
@@ -4654,6 +4696,7 @@ this function is called."
4654 :efmt "%s\\,(%s)" :hline "\\hline"))) 4696 :efmt "%s\\,(%s)" :hline "\\hline")))
4655 (orgtbl-to-generic table (org-combine-plists params2 params)))) 4697 (orgtbl-to-generic table (org-combine-plists params2 params))))
4656 4698
4699;;;###autoload
4657(defun orgtbl-to-html (table params) 4700(defun orgtbl-to-html (table params)
4658 "Convert the orgtbl-mode TABLE to HTML. 4701 "Convert the orgtbl-mode TABLE to HTML.
4659TABLE is a list, each entry either the symbol `hline' for a horizontal 4702TABLE is a list, each entry either the symbol `hline' for a horizontal
@@ -4684,6 +4727,7 @@ so you cannot specify parameters for it."
4684 (setq html (replace-match "" t t html))) 4727 (setq html (replace-match "" t t html)))
4685 html)) 4728 html))
4686 4729
4730;;;###autoload
4687(defun orgtbl-to-texinfo (table params) 4731(defun orgtbl-to-texinfo (table params)
4688 "Convert the orgtbl-mode TABLE to TeXInfo. 4732 "Convert the orgtbl-mode TABLE to TeXInfo.
4689TABLE is a list, each entry either the symbol `hline' for a horizontal 4733TABLE is a list, each entry either the symbol `hline' for a horizontal
@@ -4722,6 +4766,7 @@ this function is called."
4722 :hlstart "@headitem "))) 4766 :hlstart "@headitem ")))
4723 (orgtbl-to-generic table (org-combine-plists params2 params)))) 4767 (orgtbl-to-generic table (org-combine-plists params2 params))))
4724 4768
4769;;;###autoload
4725(defun orgtbl-to-orgtbl (table params) 4770(defun orgtbl-to-orgtbl (table params)
4726 "Convert the orgtbl-mode TABLE into another orgtbl-mode table. 4771 "Convert the orgtbl-mode TABLE into another orgtbl-mode table.
4727Useful when slicing one table into many. The :hline, :sep, 4772Useful when slicing one table into many. The :hline, :sep,
@@ -4832,4 +4877,8 @@ list of the fields in the rectangle ."
4832 4877
4833(provide 'org-table) 4878(provide 'org-table)
4834 4879
4880;; Local variables:
4881;; generated-autoload-file: "org-loaddefs.el"
4882;; End:
4883
4835;;; org-table.el ends here 4884;;; org-table.el ends here
diff --git a/lisp/org/org-taskjuggler.el b/lisp/org/org-taskjuggler.el
index aa645d296e8..a3de6e41239 100644
--- a/lisp/org/org-taskjuggler.el
+++ b/lisp/org/org-taskjuggler.el
@@ -692,4 +692,8 @@ org-mode priority string."
692 692
693(provide 'org-taskjuggler) 693(provide 'org-taskjuggler)
694 694
695;; Local variables:
696;; generated-autoload-file: "org-loaddefs.el"
697;; End:
698
695;;; org-taskjuggler.el ends here 699;;; org-taskjuggler.el ends here
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index 92aaf1c7bb8..a314564b94a 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.el
@@ -130,7 +130,6 @@ the region 0:00:00."
130 (org-timer-secs-to-hms (or delta 0))) 130 (org-timer-secs-to-hms (or delta 0)))
131 (run-hooks 'org-timer-start-hook)))) 131 (run-hooks 'org-timer-start-hook))))
132 132
133;;;###autoload
134(defun org-timer-pause-or-continue (&optional stop) 133(defun org-timer-pause-or-continue (&optional stop)
135 "Pause or continue the relative timer. 134 "Pause or continue the relative timer.
136With prefix arg STOP, stop it entirely." 135With prefix arg STOP, stop it entirely."
@@ -157,7 +156,6 @@ With prefix arg STOP, stop it entirely."
157 (org-timer-set-mode-line 'pause) 156 (org-timer-set-mode-line 'pause)
158 (message "Timer paused at %s" (org-timer-value-string))))) 157 (message "Timer paused at %s" (org-timer-value-string)))))
159 158
160;;;###autoload
161(defun org-timer-stop () 159(defun org-timer-stop ()
162 "Stop the relative timer." 160 "Stop the relative timer."
163 (interactive) 161 (interactive)
@@ -443,4 +441,8 @@ replace any running timer."
443 441
444(provide 'org-timer) 442(provide 'org-timer)
445 443
444;; Local variables:
445;; generated-autoload-file: "org-loaddefs.el"
446;; End:
447
446;;; org-timer.el ends here 448;;; org-timer.el ends here
diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el
index 688947def52..564b49a5cea 100644
--- a/lisp/org/org-version.el
+++ b/lisp/org/org-version.el
@@ -5,16 +5,16 @@
5(defun org-release () 5(defun org-release ()
6 "The release version of org-mode. 6 "The release version of org-mode.
7 Inserted by installing org-mode or when a release is made." 7 Inserted by installing org-mode or when a release is made."
8 (let ((org-release "7.9.2")) 8 (let ((org-release "7.9.2+"))
9 org-release)) 9 org-release))
10;;;###autoload 10;;;###autoload
11(defun org-git-version () 11(defun org-git-version ()
12 "The Git version of org-mode. 12 "The Git version of org-mode.
13 Inserted by installing org-mode or when a release is made." 13 Inserted by installing org-mode or when a release is made."
14 (let ((org-git-version "7.9.2-GNU-Emacs-24-3")) 14 (let ((org-git-version "7.9.2+-GNU-Emacs-24-3"))
15 org-git-version)) 15 org-git-version))
16;;;###autoload 16;;;###autoload
17(defconst org-odt-data-dir "/usr/share/emacs/etc/org" 17(defvar org-odt-data-dir "/usr/share/emacs/etc/org"
18 "The location of ODT styles.") 18 "The location of ODT styles.")
19 19
20(provide 'org-version) 20(provide 'org-version)
diff --git a/lisp/org/org-xoxo.el b/lisp/org/org-xoxo.el
index ee549627a85..6ff78b56839 100644
--- a/lisp/org/org-xoxo.el
+++ b/lisp/org/org-xoxo.el
@@ -122,4 +122,8 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
122 122
123(provide 'org-xoxo) 123(provide 'org-xoxo)
124 124
125;; Local variables:
126;; generated-autoload-file: "org-loaddefs.el"
127;; End:
128
125;;; org-xoxo.el ends here 129;;; org-xoxo.el ends here
diff --git a/lisp/org/org.el b/lisp/org/org.el
index cfd86513fbc..45dbe2754e8 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -78,6 +78,8 @@
78(require 'find-func) 78(require 'find-func)
79(require 'format-spec) 79(require 'format-spec)
80 80
81(load "org-loaddefs.el" t t)
82
81;; `org-outline-regexp' ought to be a defconst but is let-binding in 83;; `org-outline-regexp' ought to be a defconst but is let-binding in
82;; some places -- e.g. see the macro org-with-limited-levels. 84;; some places -- e.g. see the macro org-with-limited-levels.
83;; 85;;
@@ -117,8 +119,23 @@ Stars are put in group 1 and the trimmed body in group 2.")
117(declare-function org-clock-timestamps-down "org-clock" ()) 119(declare-function org-clock-timestamps-down "org-clock" ())
118(declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) 120(declare-function org-clock-sum-current-item "org-clock" (&optional tstart))
119 121
122(declare-function orgtbl-mode "org-table" (&optional arg))
123(declare-function org-clock-out "org-clock" (&optional switch-to-state fail-quietly at-time))
124(declare-function org-beamer-mode "org-beamer" ())
125(declare-function org-table-edit-field "org-table" (arg))
126(declare-function org-table-justify-field-maybe "org-table" (&optional new))
127(declare-function org-id-get-create "org-id" (&optional force))
128(declare-function org-id-find-id-file "org-id" (id))
129(declare-function org-tags-view "org-agenda" (&optional todo-only match))
130(declare-function org-agenda-list "org-agenda" (&optional arg start-day span))
131(declare-function org-table-align "org-table" ())
132(declare-function org-table-paste-rectangle "org-table" ())
133(declare-function org-table-maybe-eval-formula "org-table" ())
134(declare-function org-table-maybe-recalculate-line "org-table" ())
135
120;; load languages based on value of `org-babel-load-languages' 136;; load languages based on value of `org-babel-load-languages'
121(defvar org-babel-load-languages) 137(defvar org-babel-load-languages)
138
122;;;###autoload 139;;;###autoload
123(defun org-babel-do-load-languages (sym value) 140(defun org-babel-do-load-languages (sym value)
124 "Load the languages defined in `org-babel-load-languages'." 141 "Load the languages defined in `org-babel-load-languages'."
@@ -206,6 +223,7 @@ identifier."
206;;; Version 223;;; Version
207(require 'org-compat) 224(require 'org-compat)
208(org-check-version) 225(org-check-version)
226
209;;;###autoload 227;;;###autoload
210(defun org-version (&optional here full message) 228(defun org-version (&optional here full message)
211 "Show the org-mode version in the echo area. 229 "Show the org-mode version in the echo area.
@@ -214,7 +232,7 @@ When FULL is non-nil, use a verbose version string.
214When MESSAGE is non-nil, display a message with the version." 232When MESSAGE is non-nil, display a message with the version."
215 (interactive "P") 233 (interactive "P")
216 (let* ((org-dir (ignore-errors (org-find-library-dir "org"))) 234 (let* ((org-dir (ignore-errors (org-find-library-dir "org")))
217 (org-install-dir (ignore-errors (org-find-library-dir "org-install.el"))) 235 (org-install-dir (ignore-errors (org-find-library-dir "org-loaddefs.el")))
218 (org-trash (or 236 (org-trash (or
219 (and (fboundp 'org-release) (fboundp 'org-git-version)) 237 (and (fboundp 'org-release) (fboundp 'org-git-version))
220 (load (concat org-dir "org-version.el") 238 (load (concat org-dir "org-version.el")
@@ -228,7 +246,7 @@ When MESSAGE is non-nil, display a message with the version."
228 (if (string= org-dir org-install-dir) 246 (if (string= org-dir org-install-dir)
229 org-install-dir 247 org-install-dir
230 (concat "mixed installation! " org-install-dir " and " org-dir)) 248 (concat "mixed installation! " org-install-dir " and " org-dir))
231 "org-install.el can not be found!"))) 249 "org-loaddefs.el can not be found!")))
232 (_version (if full version org-version))) 250 (_version (if full version org-version)))
233 (if (org-called-interactively-p 'interactive) 251 (if (org-called-interactively-p 'interactive)
234 (if here 252 (if here
@@ -3264,13 +3282,6 @@ forth between agenda and calendar."
3264 :group 'org-agenda 3282 :group 'org-agenda
3265 :type 'sexp) 3283 :type 'sexp)
3266 3284
3267(defcustom org-calendar-agenda-action-key [?k]
3268 "The key to be installed in `calendar-mode-map' for agenda-action.
3269The command `org-agenda-action' will be bound to this key. The
3270default is the character `k' because we use the same key in the agenda."
3271 :group 'org-agenda
3272 :type 'sexp)
3273
3274(defcustom org-calendar-insert-diary-entry-key [?i] 3285(defcustom org-calendar-insert-diary-entry-key [?i]
3275 "The key to be installed in `calendar-mode-map' for adding diary entries. 3286 "The key to be installed in `calendar-mode-map' for adding diary entries.
3276This option is irrelevant until `org-agenda-diary-file' has been configured 3287This option is irrelevant until `org-agenda-diary-file' has been configured
@@ -3296,8 +3307,6 @@ points to a file, `org-agenda-diary-entry' will be used instead."
3296 '(progn 3307 '(progn
3297 (org-defkey calendar-mode-map org-calendar-to-agenda-key 3308 (org-defkey calendar-mode-map org-calendar-to-agenda-key
3298 'org-calendar-goto-agenda) 3309 'org-calendar-goto-agenda)
3299 (org-defkey calendar-mode-map org-calendar-agenda-action-key
3300 'org-agenda-action)
3301 (add-hook 'calendar-mode-hook 3310 (add-hook 'calendar-mode-hook
3302 (lambda () 3311 (lambda ()
3303 (unless (eq org-agenda-diary-file 'diary-file) 3312 (unless (eq org-agenda-diary-file 'diary-file)
@@ -3869,30 +3878,13 @@ This works for both table types.")
3869 3878
3870(eval-and-compile 3879(eval-and-compile
3871 (org-autoload "org-table" 3880 (org-autoload "org-table"
3872 '(org-table-align org-table-begin org-table-blank-field 3881 '(org-table-begin org-table-blank-field org-table-end)))
3873 org-table-convert org-table-convert-region org-table-copy-down 3882
3874 org-table-copy-region org-table-create 3883;;;###autoload
3875 org-table-create-or-convert-from-region 3884(defun turn-on-orgtbl ()
3876 org-table-create-with-table.el org-table-current-dline 3885 "Unconditionally turn on `orgtbl-mode'."
3877 org-table-cut-region org-table-delete-column org-table-edit-field 3886 (require 'org-table)
3878 org-table-edit-formulas org-table-end org-table-eval-formula 3887 (orgtbl-mode 1))
3879 org-table-export org-table-field-info
3880 org-table-get-stored-formulas org-table-goto-column
3881 org-table-hline-and-move org-table-import org-table-insert-column
3882 org-table-insert-hline org-table-insert-row org-table-iterate
3883 org-table-justify-field-maybe org-table-kill-row
3884 org-table-maybe-eval-formula org-table-maybe-recalculate-line
3885 org-table-move-column org-table-move-column-left
3886 org-table-move-column-right org-table-move-row
3887 org-table-move-row-down org-table-move-row-up
3888 org-table-next-field org-table-next-row org-table-paste-rectangle
3889 org-table-previous-field org-table-recalculate
3890 org-table-rotate-recalc-marks org-table-sort-lines org-table-sum
3891 org-table-toggle-coordinate-overlays
3892 org-table-toggle-formula-debugger org-table-wrap-region
3893 orgtbl-mode turn-on-orgtbl org-table-to-lisp
3894 orgtbl-to-generic orgtbl-to-tsv orgtbl-to-csv orgtbl-to-latex
3895 orgtbl-to-orgtbl orgtbl-to-html orgtbl-to-texinfo)))
3896 3888
3897(defun org-at-table-p (&optional table-type) 3889(defun org-at-table-p (&optional table-type)
3898 "Return t if the cursor is inside an org-type table. 3890 "Return t if the cursor is inside an org-type table.
@@ -3971,62 +3963,14 @@ If TABLE-TYPE is non-nil, also check for table.el-type tables."
3971(declare-function org-default-export-plist "org-exp") 3963(declare-function org-default-export-plist "org-exp")
3972(declare-function org-infile-export-plist "org-exp") 3964(declare-function org-infile-export-plist "org-exp")
3973(declare-function org-get-current-options "org-exp") 3965(declare-function org-get-current-options "org-exp")
3974(eval-and-compile
3975 (org-autoload "org-exp"
3976 '(org-export org-export-visible
3977 org-insert-export-options-template
3978 org-table-clean-before-export))
3979 (org-autoload "org-ascii"
3980 '(org-export-as-ascii org-export-ascii-preprocess
3981 org-export-as-ascii-to-buffer org-replace-region-by-ascii
3982 org-export-region-as-ascii))
3983 (org-autoload "org-latex"
3984 '(org-export-as-latex-batch org-export-as-latex-to-buffer
3985 org-replace-region-by-latex org-export-region-as-latex
3986 org-export-as-latex org-export-as-pdf
3987 org-export-as-pdf-and-open))
3988 (org-autoload "org-html"
3989 '(org-export-as-html-and-open
3990 org-export-as-html-batch org-export-as-html-to-buffer
3991 org-replace-region-by-html org-export-region-as-html
3992 org-export-as-html))
3993 (org-autoload "org-docbook"
3994 '(org-export-as-docbook-batch org-export-as-docbook-to-buffer
3995 org-replace-region-by-docbook org-export-region-as-docbook
3996 org-export-as-docbook-pdf org-export-as-docbook-pdf-and-open
3997 org-export-as-docbook))
3998 (org-autoload "org-icalendar"
3999 '(org-export-icalendar-this-file
4000 org-export-icalendar-all-agenda-files
4001 org-export-icalendar-combine-agenda-files))
4002 (org-autoload "org-xoxo" '(org-export-as-xoxo))
4003 (org-autoload "org-beamer" '(org-beamer-mode org-beamer-sectioning)))
4004 3966
4005;; Declare and autoload functions from org-agenda.el 3967;; Declare and autoload functions from org-agenda.el
4006 3968
4007(eval-and-compile 3969(eval-and-compile
4008 (org-autoload "org-agenda" 3970 (org-autoload "org-agenda"
4009 '(org-agenda org-agenda-list org-search-view 3971 '(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))
4010 org-todo-list org-tags-view org-agenda-list-stuck-projects
4011 org-diary org-agenda-to-appt
4012 org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))
4013
4014;; Autoload org-remember
4015 3972
4016(eval-and-compile 3973(declare-function org-clock-save-markers-for-cut-and-paste "org-clock" (beg end))
4017 (org-autoload "org-remember"
4018 '(org-remember-insinuate org-remember-annotation
4019 org-remember-apply-template org-remember org-remember-handler)))
4020
4021(eval-and-compile
4022 (org-autoload "org-capture"
4023 '(org-capture org-capture-insert-template-here
4024 org-capture-import-remember-templates)))
4025
4026;; Autoload org-clock.el
4027
4028(declare-function org-clock-save-markers-for-cut-and-paste "org-clock"
4029 (beg end))
4030(declare-function org-clock-update-mode-line "org-clock" ()) 3974(declare-function org-clock-update-mode-line "org-clock" ())
4031(declare-function org-resolve-clocks "org-clock" 3975(declare-function org-resolve-clocks "org-clock"
4032 (&optional also-non-dangling-p prompt last-valid)) 3976 (&optional also-non-dangling-p prompt last-valid))
@@ -4043,55 +3987,9 @@ The return value is actually the clock marker."
4043 (marker-buffer org-clock-marker)) 3987 (marker-buffer org-clock-marker))
4044 3988
4045(eval-and-compile 3989(eval-and-compile
4046 (org-autoload 3990 (org-autoload "org-clock" '(org-clock-remove-overlays
4047 "org-clock" 3991 org-clock-update-time-maybe
4048 '(org-clock-in org-clock-out org-clock-cancel 3992 org-clocktable-shift)))
4049 org-clock-goto org-clock-sum org-clock-display
4050 org-clock-remove-overlays org-clock-report
4051 org-clocktable-shift org-dblock-write:clocktable
4052 org-get-clocktable org-resolve-clocks)))
4053
4054(defun org-clock-update-time-maybe ()
4055 "If this is a CLOCK line, update it and return t.
4056Otherwise, return nil."
4057 (interactive)
4058 (save-excursion
4059 (beginning-of-line 1)
4060 (skip-chars-forward " \t")
4061 (when (looking-at org-clock-string)
4062 (let ((re (concat "[ \t]*" org-clock-string
4063 " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]"
4064 "\\([ \t]*=>.*\\)?\\)?"))
4065 ts te h m s neg)
4066 (cond
4067 ((not (looking-at re))
4068 nil)
4069 ((not (match-end 2))
4070 (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
4071 (> org-clock-marker (point))
4072 (<= org-clock-marker (point-at-eol)))
4073 ;; The clock is running here
4074 (setq org-clock-start-time
4075 (apply 'encode-time
4076 (org-parse-time-string (match-string 1))))
4077 (org-clock-update-mode-line)))
4078 (t
4079 (and (match-end 4) (delete-region (match-beginning 4) (match-end 4)))
4080 (end-of-line 1)
4081 (setq ts (match-string 1)
4082 te (match-string 3))
4083 (setq s (- (org-float-time
4084 (apply 'encode-time (org-parse-time-string te)))
4085 (org-float-time
4086 (apply 'encode-time (org-parse-time-string ts))))
4087 neg (< s 0)
4088 s (abs s)
4089 h (floor (/ s 3600))
4090 s (- s (* 3600 h))
4091 m (floor (/ s 60))
4092 s (- s (* 60 s)))
4093 (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m))
4094 t))))))
4095 3993
4096(defun org-check-running-clock () 3994(defun org-check-running-clock ()
4097 "Check if the current buffer contains the running clock. 3995 "Check if the current buffer contains the running clock.
@@ -4108,44 +4006,18 @@ If yes, offer to stop it and to save the buffer with the changes."
4108 (when (org-match-line "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>") 4006 (when (org-match-line "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>")
4109 (org-clocktable-shift dir n))) 4007 (org-clocktable-shift dir n)))
4110 4008
4111;; Autoload org-timer.el 4009;;;###autoload
4112 4010(defun org-clock-persistence-insinuate ()
4113(eval-and-compile 4011 "Set up hooks for clock persistence."
4114 (org-autoload 4012 (require 'org-clock)
4115 "org-timer" 4013 (add-hook 'org-mode-hook 'org-clock-load)
4116 '(org-timer-start org-timer org-timer-item 4014 (add-hook 'kill-emacs-hook 'org-clock-save))
4117 org-timer-change-times-in-region
4118 org-timer-set-timer
4119 org-timer-reset-timers
4120 org-timer-show-remaining-time)))
4121
4122;; Autoload org-feed.el
4123
4124(eval-and-compile
4125 (org-autoload
4126 "org-feed"
4127 '(org-feed-update org-feed-update-all org-feed-goto-inbox)))
4128
4129
4130;; Autoload org-indent.el
4131 4015
4132;; Define the variable already here, to make sure we have it. 4016;; Define the variable already here, to make sure we have it.
4133(defvar org-indent-mode nil 4017(defvar org-indent-mode nil
4134 "Non-nil if Org-Indent mode is enabled. 4018 "Non-nil if Org-Indent mode is enabled.
4135Use the command `org-indent-mode' to change this variable.") 4019Use the command `org-indent-mode' to change this variable.")
4136 4020
4137(eval-and-compile
4138 (org-autoload
4139 "org-indent"
4140 '(org-indent-mode)))
4141
4142;; Autoload org-mobile.el
4143
4144(eval-and-compile
4145 (org-autoload
4146 "org-mobile"
4147 '(org-mobile-push org-mobile-pull org-mobile-create-sumo-agenda)))
4148
4149;; Autoload archiving code 4021;; Autoload archiving code
4150;; The stuff that is needed for cycling and tags has to be defined here. 4022;; The stuff that is needed for cycling and tags has to be defined here.
4151 4023
@@ -4319,10 +4191,7 @@ Otherwise, these types are allowed:
4319 4191
4320(eval-and-compile 4192(eval-and-compile
4321 (org-autoload "org-archive" 4193 (org-autoload "org-archive"
4322 '(org-add-archive-files org-archive-subtree 4194 '(org-add-archive-files)))
4323 org-archive-to-archive-sibling org-toggle-archive-tag
4324 org-archive-subtree-default
4325 org-archive-subtree-default-with-confirmation)))
4326 4195
4327;; Autoload Column View Code 4196;; Autoload Column View Code
4328 4197
@@ -4331,9 +4200,10 @@ Otherwise, these types are allowed:
4331(declare-function org-columns-compute "org-colview" (property)) 4200(declare-function org-columns-compute "org-colview" (property))
4332 4201
4333(org-autoload (if (featurep 'xemacs) "org-colview-xemacs" "org-colview") 4202(org-autoload (if (featurep 'xemacs) "org-colview-xemacs" "org-colview")
4334 '(org-columns-number-to-string org-columns-get-format-and-top-level 4203 '(org-columns-number-to-string
4335 org-columns-compute org-agenda-columns org-columns-remove-overlays 4204 org-columns-get-format-and-top-level
4336 org-columns org-insert-columns-dblock org-dblock-write:columnview)) 4205 org-columns-compute
4206 org-columns-remove-overlays))
4337 4207
4338;; Autoload ID code 4208;; Autoload ID code
4339 4209
@@ -4342,15 +4212,10 @@ Otherwise, these types are allowed:
4342(declare-function org-id-locations-save "org-id") 4212(declare-function org-id-locations-save "org-id")
4343(defvar org-id-track-globally) 4213(defvar org-id-track-globally)
4344(org-autoload "org-id" 4214(org-autoload "org-id"
4345 '(org-id-get-create org-id-new org-id-copy org-id-get 4215 '(org-id-new
4346 org-id-get-with-outline-path-completion 4216 org-id-copy
4347 org-id-get-with-outline-drilling org-id-store-link 4217 org-id-get-with-outline-path-completion
4348 org-id-goto org-id-find org-id-store-link)) 4218 org-id-get-with-outline-drilling))
4349
4350;; Autoload Plotting Code
4351
4352(org-autoload "org-plot"
4353 '(org-plot/gnuplot))
4354 4219
4355;;; Variables for pre-computed regular expressions, all buffer local 4220;;; Variables for pre-computed regular expressions, all buffer local
4356 4221
@@ -5096,7 +4961,7 @@ The following commands are available:
5096 (lambda (&rest ignore) (org-show-context 'isearch)))) 4961 (lambda (&rest ignore) (org-show-context 'isearch))))
5097 4962
5098 ;; Turn on org-beamer-mode? 4963 ;; Turn on org-beamer-mode?
5099 (and org-startup-with-beamer-mode (org-beamer-mode 1)) 4964 (and org-startup-with-beamer-mode (org-beamer-mode))
5100 4965
5101 ;; Setup the pcomplete hooks 4966 ;; Setup the pcomplete hooks
5102 (set (make-local-variable 'pcomplete-command-completion-function) 4967 (set (make-local-variable 'pcomplete-command-completion-function)
@@ -5569,22 +5434,6 @@ by a #."
5569 t) 5434 t)
5570 (t nil)))))) 5435 (t nil))))))
5571 5436
5572(defun org-strip-protective-commas (beg end)
5573 "Strip protective commas between BEG and END in the current buffer."
5574 (interactive "r")
5575 (save-excursion
5576 (save-match-data
5577 (goto-char beg)
5578 (let ((front-line (save-excursion
5579 (re-search-forward
5580 "[^[:space:]]" end t)
5581 (goto-char (match-beginning 0))
5582 (current-column))))
5583 (while (re-search-forward "^[ \t]*\\(,\\)\\([*]\\|#\\)" end t)
5584 (goto-char (match-beginning 1))
5585 (when (= (current-column) front-line)
5586 (replace-match "" nil nil nil 1)))))))
5587
5588(defun org-activate-angle-links (limit) 5437(defun org-activate-angle-links (limit)
5589 "Run through the buffer and add overlays to links." 5438 "Run through the buffer and add overlays to links."
5590 (if (re-search-forward org-angle-link-re limit t) 5439 (if (re-search-forward org-angle-link-re limit t)
@@ -6188,10 +6037,9 @@ and subscripts."
6188(defvar org-cycle-subtree-status nil) 6037(defvar org-cycle-subtree-status nil)
6189(make-variable-buffer-local 'org-cycle-subtree-status) 6038(make-variable-buffer-local 'org-cycle-subtree-status)
6190 6039
6191;;;###autoload
6192
6193(defvar org-inlinetask-min-level) 6040(defvar org-inlinetask-min-level)
6194 6041
6042;;;###autoload
6195(defun org-cycle (&optional arg) 6043(defun org-cycle (&optional arg)
6196 "TAB-action and visibility cycling for Org-mode. 6044 "TAB-action and visibility cycling for Org-mode.
6197 6045
@@ -9205,7 +9053,7 @@ If optional argument MERGE is set, merge TABLE into
9205 9053
9206(defun org-link-unescape (str) 9054(defun org-link-unescape (str)
9207 "Unhex hexified Unicode strings as returned from the JavaScript function 9055 "Unhex hexified Unicode strings as returned from the JavaScript function
9208encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'." 9056encodeURIComponent. E.g. `%C3%B6' is the german o-Umlaut."
9209 (unless (and (null str) (string= "" str)) 9057 (unless (and (null str) (string= "" str))
9210 (let ((pos 0) (case-fold-search t) unhexed) 9058 (let ((pos 0) (case-fold-search t) unhexed)
9211 (while (setq pos (string-match "\\(%[0-9a-f][0-9a-f]\\)+" str pos)) 9059 (while (setq pos (string-match "\\(%[0-9a-f][0-9a-f]\\)+" str pos))
@@ -9215,9 +9063,9 @@ encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ö'."
9215 str) 9063 str)
9216 9064
9217(defun org-link-unescape-compound (hex) 9065(defun org-link-unescape-compound (hex)
9218 "Unhexify Unicode hex-chars. E.g. `%C3%B6' is the German Umlaut `ö'. 9066 "Unhexify Unicode hex-chars. E.g. `%C3%B6' is the German o-Umlaut.
9219Note: this function also decodes single byte encodings like 9067Note: this function also decodes single byte encodings like
9220`%E1' (\"á\") if not followed by another `%[A-F0-9]{2}' group." 9068`%E1' (a-acute) if not followed by another `%[A-F0-9]{2}' group."
9221 (save-match-data 9069 (save-match-data
9222 (let* ((bytes (cdr (split-string hex "%"))) 9070 (let* ((bytes (cdr (split-string hex "%")))
9223 (ret "") 9071 (ret "")
@@ -11028,11 +10876,13 @@ prefix argument (`C-u C-u C-u C-c C-w')."
11028 (and org-auto-align-tags 10876 (and org-auto-align-tags
11029 (let ((org-loop-over-headlines-in-active-region nil)) 10877 (let ((org-loop-over-headlines-in-active-region nil))
11030 (org-set-tags nil t))) 10878 (org-set-tags nil t)))
11031 (bookmark-set "org-refile-last-stored") 10879 (with-demoted-errors
10880 (bookmark-set "org-refile-last-stored"))
11032 ;; If we are refiling for capture, make sure that the 10881 ;; If we are refiling for capture, make sure that the
11033 ;; last-capture pointers point here 10882 ;; last-capture pointers point here
11034 (when (org-bound-and-true-p org-refile-for-capture) 10883 (when (org-bound-and-true-p org-refile-for-capture)
11035 (bookmark-set "org-capture-last-stored-marker") 10884 (with-demoted-errors
10885 (bookmark-set "org-capture-last-stored-marker"))
11036 (move-marker org-capture-last-stored-marker (point))) 10886 (move-marker org-capture-last-stored-marker (point)))
11037 (if (fboundp 'deactivate-mark) (deactivate-mark)) 10887 (if (fboundp 'deactivate-mark) (deactivate-mark))
11038 (run-hooks 'org-after-refile-insert-hook)))) 10888 (run-hooks 'org-after-refile-insert-hook))))
@@ -11128,26 +10978,28 @@ this is used for the GOTO interface."
11128 (org-refile-new-child parent-target child))) 10978 (org-refile-new-child parent-target child)))
11129 (error "Invalid target location"))))) 10979 (error "Invalid target location")))))
11130 10980
11131(declare-function org-string-nw-p "org-macs.el" (s)) 10981(declare-function org-string-nw-p "org-macs" (s))
11132(defun org-refile-check-position (refile-pointer) 10982(defun org-refile-check-position (refile-pointer)
11133 "Check if the refile pointer matches the readline to which it points." 10983 "Check if the refile pointer matches the headline to which it points."
11134 (let* ((file (nth 1 refile-pointer)) 10984 (let* ((file (nth 1 refile-pointer))
11135 (re (nth 2 refile-pointer)) 10985 (re (nth 2 refile-pointer))
11136 (pos (nth 3 refile-pointer)) 10986 (pos (nth 3 refile-pointer))
11137 buffer) 10987 buffer)
11138 (when (org-string-nw-p re) 10988 (if (and (not (markerp pos)) (not file))
11139 (setq buffer (if (markerp pos) 10989 (error "Please save the buffer to a file before refiling")
11140 (marker-buffer pos) 10990 (when (org-string-nw-p re)
11141 (or (find-buffer-visiting file) 10991 (setq buffer (if (markerp pos)
11142 (find-file-noselect file)))) 10992 (marker-buffer pos)
11143 (with-current-buffer buffer 10993 (or (find-buffer-visiting file)
11144 (save-excursion 10994 (find-file-noselect file))))
11145 (save-restriction 10995 (with-current-buffer buffer
11146 (widen) 10996 (save-excursion
11147 (goto-char pos) 10997 (save-restriction
11148 (beginning-of-line 1) 10998 (widen)
11149 (unless (org-looking-at-p re) 10999 (goto-char pos)
11150 (error "Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling")))))))) 11000 (beginning-of-line 1)
11001 (unless (org-looking-at-p re)
11002 (error "Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling")))))))))
11151 11003
11152(defun org-refile-new-child (parent-target child) 11004(defun org-refile-new-child (parent-target child)
11153 "Use refile target PARENT-TARGET to add new CHILD below it." 11005 "Use refile target PARENT-TARGET to add new CHILD below it."
@@ -11337,7 +11189,6 @@ Error if there is no such block at point."
11337 (goto-char pos) 11189 (goto-char pos)
11338 (error "Not in a dynamic block")))) 11190 (error "Not in a dynamic block"))))
11339 11191
11340;;;###autoload
11341(defun org-update-all-dblocks () 11192(defun org-update-all-dblocks ()
11342 "Update all dynamic blocks in the buffer. 11193 "Update all dynamic blocks in the buffer.
11343This function can be used in a hook." 11194This function can be used in a hook."
@@ -12821,7 +12672,7 @@ D Show deadlines and scheduled items between a date range."
12821 ((equal ans ?D) 12672 ((equal ans ?D)
12822 (call-interactively 'org-check-dates-range)) 12673 (call-interactively 'org-check-dates-range))
12823 ((equal ans ?t) 12674 ((equal ans ?t)
12824 (org-show-todo-tree nil)) 12675 (call-interactively 'org-show-todo-tree))
12825 ((equal ans ?T) 12676 ((equal ans ?T)
12826 (org-show-todo-tree '(4))) 12677 (org-show-todo-tree '(4)))
12827 ((member ans '(?T ?m)) 12678 ((member ans '(?T ?m))
@@ -14157,7 +14008,6 @@ Returns the new tags string, or nil to not change the current settings."
14157 14008
14158;;;; The mapping API 14009;;;; The mapping API
14159 14010
14160;;;###autoload
14161(defun org-map-entries (func &optional match scope &rest skip) 14011(defun org-map-entries (func &optional match scope &rest skip)
14162 "Call FUNC at each headline selected by MATCH in SCOPE. 14012 "Call FUNC at each headline selected by MATCH in SCOPE.
14163 14013
@@ -15656,14 +15506,13 @@ user."
15656 15506
15657 ;; Help matching dotted european dates 15507 ;; Help matching dotted european dates
15658 (when (string-match 15508 (when (string-match
15659 "^ *\\(3[01]\\|0?[1-9]\\|[12][0-9]\\)\\. ?\\(0?[1-9]\\|1[012]\\)\\. ?\\([1-9][0-9][0-9][0-9]\\)?" ans) 15509 "^ *\\(3[01]\\|0?[1-9]\\|[12][0-9]\\)\\. ?\\(0?[1-9]\\|1[012]\\)\\.\\( ?[1-9][0-9]\\{3\\}\\)?" ans)
15660 (setq year (if (match-end 3) 15510 (setq year (if (match-end 3) (string-to-number (match-string 3 ans))
15661 (string-to-number (match-string 3 ans)) 15511 (setq kill-year t)
15662 (progn (setq kill-year t) 15512 (string-to-number (format-time-string "%Y")))
15663 (string-to-number (format-time-string "%Y"))))
15664 day (string-to-number (match-string 1 ans)) 15513 day (string-to-number (match-string 1 ans))
15665 month (string-to-number (match-string 2 ans)) 15514 month (string-to-number (match-string 2 ans))
15666 ans (replace-match (format "%04d-%02d-%02d\\5" year month day) 15515 ans (replace-match (format "%04d-%02d-%02d" year month day)
15667 t nil ans))) 15516 t nil ans)))
15668 15517
15669 ;; Help matching american dates, like 5/30 or 5/30/7 15518 ;; Help matching american dates, like 5/30 or 5/30/7
@@ -16311,7 +16160,12 @@ When PREFER is `future', return a date that is either CURRENT or future.
16311When SHOW-ALL is nil, only return the current occurrence of a time stamp." 16160When SHOW-ALL is nil, only return the current occurrence of a time stamp."
16312 ;; Make the proper lists from the dates 16161 ;; Make the proper lists from the dates
16313 (catch 'exit 16162 (catch 'exit
16314 (let ((a1 '(("d" . day) ("w" . week) ("m" . month) ("y" . year))) 16163 (let ((a1 '(("h" . hour)
16164 ("d" . day)
16165 ("w" . week)
16166 ("m" . month)
16167 ("y" . year)))
16168 (shour (nth 2 (org-parse-time-string start)))
16315 dn dw sday cday n1 n2 n0 16169 dn dw sday cday n1 n2 n0
16316 d m y y1 y2 date1 date2 nmonths nm ny m2) 16170 d m y y1 y2 date1 date2 nmonths nm ny m2)
16317 16171
@@ -16331,6 +16185,13 @@ When SHOW-ALL is nil, only return the current occurrence of a time stamp."
16331 (error "Invalid change specifier: %s" change)) 16185 (error "Invalid change specifier: %s" change))
16332 (if (eq dw 'week) (setq dw 'day dn (* 7 dn))) 16186 (if (eq dw 'week) (setq dw 'day dn (* 7 dn)))
16333 (cond 16187 (cond
16188 ((eq dw 'hour)
16189 (let ((missing-hours
16190 (mod (+ (- (* 24 (- cday sday)) shour) org-extend-today-until)
16191 dn)))
16192 (setq n1 (if (zerop missing-hours) cday
16193 (- cday (1+ (floor (/ missing-hours 24)))))
16194 n2 (+ cday (floor (/ (- dn missing-hours) 24))))))
16334 ((eq dw 'day) 16195 ((eq dw 'day)
16335 (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn)))) 16196 (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn))))
16336 n2 (+ n1 dn))) 16197 n2 (+ n1 dn)))
@@ -16993,7 +16854,9 @@ end of the list."
16993 (file-alist (mapcar (lambda (x) 16854 (file-alist (mapcar (lambda (x)
16994 (cons (file-truename x) x)) 16855 (cons (file-truename x) x))
16995 (org-agenda-files t))) 16856 (org-agenda-files t)))
16996 (ctf (file-truename buffer-file-name)) 16857 (ctf (file-truename
16858 (or buffer-file-name
16859 (error "Please save the current buffer to a file"))))
16997 x had) 16860 x had)
16998 (setq x (assoc ctf file-alist) had x) 16861 (setq x (assoc ctf file-alist) had x)
16999 16862
@@ -17012,7 +16875,8 @@ These are the files which are being checked for agenda entries.
17012Optional argument FILE means use this file instead of the current." 16875Optional argument FILE means use this file instead of the current."
17013 (interactive) 16876 (interactive)
17014 (let* ((org-agenda-skip-unavailable-files nil) 16877 (let* ((org-agenda-skip-unavailable-files nil)
17015 (file (or file buffer-file-name)) 16878 (file (or file buffer-file-name
16879 (error "Current buffer does not visit a file")))
17016 (true-file (file-truename file)) 16880 (true-file (file-truename file))
17017 (afile (abbreviate-file-name file)) 16881 (afile (abbreviate-file-name file))
17018 (files (delq nil (mapcar 16882 (files (delq nil (mapcar
@@ -17034,7 +16898,7 @@ Optional argument FILE means use this file instead of the current."
17034(defun org-check-agenda-file (file) 16898(defun org-check-agenda-file (file)
17035 "Make sure FILE exists. If not, ask user what to do." 16899 "Make sure FILE exists. If not, ask user what to do."
17036 (when (not (file-exists-p file)) 16900 (when (not (file-exists-p file))
17037 (message "non-existent agenda file %s. [R]emove from list or [A]bort?" 16901 (message "Non-existent agenda file %s. [R]emove from list or [A]bort?"
17038 (abbreviate-file-name file)) 16902 (abbreviate-file-name file))
17039 (let ((r (downcase (read-char-exclusive)))) 16903 (let ((r (downcase (read-char-exclusive))))
17040 (cond 16904 (cond
@@ -18113,7 +17977,6 @@ BEG and END default to the buffer boundaries."
18113(org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree) 17977(org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree)
18114;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree) 17978;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree)
18115 17979
18116(org-defkey org-mode-map "\C-c\C-x\C-k" 'org-mark-entry-for-agenda-action)
18117(org-defkey org-mode-map "\C-c\C-x\C-w" 'org-cut-special) 17980(org-defkey org-mode-map "\C-c\C-x\C-w" 'org-cut-special)
18118(org-defkey org-mode-map "\C-c\C-x\M-w" 'org-copy-special) 17981(org-defkey org-mode-map "\C-c\C-x\M-w" 'org-copy-special)
18119(org-defkey org-mode-map "\C-c\C-x\C-y" 'org-paste-special) 17982(org-defkey org-mode-map "\C-c\C-x\C-y" 'org-paste-special)
@@ -18801,13 +18664,12 @@ this function returns t, nil otherwise."
18801 nil)))) 18664 nil))))
18802 18665
18803(autoload 'org-element-at-point "org-element") 18666(autoload 'org-element-at-point "org-element")
18667(autoload 'org-element-type "org-element")
18804 18668
18805(declare-function org-element-at-point "org-element" (&optional keep-trail)) 18669(declare-function org-element-at-point "org-element" (&optional keep-trail))
18806(declare-function org-element-type "org-element" (element)) 18670(declare-function org-element-type "org-element" (element))
18807(declare-function org-element-context "org-element" ())
18808(declare-function org-element-contents "org-element" (element)) 18671(declare-function org-element-contents "org-element" (element))
18809(declare-function org-element-property "org-element" (property element)) 18672(declare-function org-element-property "org-element" (property element))
18810(declare-function org-element-paragraph-parser "org-element" (limit))
18811(declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion)) 18673(declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion))
18812(declare-function org-element-nested-p "org-element" (elem-a elem-b)) 18674(declare-function org-element-nested-p "org-element" (elem-a elem-b))
18813(declare-function org-element-swap-A-B "org-element" (elem-a elem-b)) 18675(declare-function org-element-swap-A-B "org-element" (elem-a elem-b))
@@ -19985,7 +19847,6 @@ Your bug report will be posted to the Org-mode mailing list.
19985 19847
19986;;;; Documentation 19848;;;; Documentation
19987 19849
19988;;;###autoload
19989(defun org-require-autoloaded-modules () 19850(defun org-require-autoloaded-modules ()
19990 (interactive) 19851 (interactive)
19991 (mapc 'require 19852 (mapc 'require
@@ -20813,20 +20674,6 @@ returns the current time."
20813 (nth 2 date)))))) 20674 (nth 2 date))))))
20814 (or defd (current-time)))) 20675 (or defd (current-time))))
20815 20676
20816(defvar org-agenda-action-marker (make-marker)
20817 "Marker pointing to the entry for the next agenda action.")
20818
20819(defun org-mark-entry-for-agenda-action ()
20820 "Mark the current entry as target of an agenda action.
20821Agenda actions are actions executed from the agenda with the key `k',
20822which make use of the date at the cursor."
20823 (interactive)
20824 (move-marker org-agenda-action-marker
20825 (save-excursion (org-back-to-heading t) (point))
20826 (current-buffer))
20827 (message
20828 "Entry marked for action; press `k' at desired date in agenda or calendar"))
20829
20830(defun org-mark-subtree (&optional up) 20677(defun org-mark-subtree (&optional up)
20831 "Mark the current subtree. 20678 "Mark the current subtree.
20832This puts point at the start of the current subtree, and mark at 20679This puts point at the start of the current subtree, and mark at
@@ -21224,7 +21071,10 @@ a footnote definition, try to fill the first paragraph within."
21224 ;; Check if auto-filling is meaningful. 21071 ;; Check if auto-filling is meaningful.
21225 (let ((fc (current-fill-column))) 21072 (let ((fc (current-fill-column)))
21226 (when (and fc (> (current-column) fc)) 21073 (when (and fc (> (current-column) fc))
21227 (let ((fill-prefix (org-adaptive-fill-function))) 21074 (let* ((fill-prefix (org-adaptive-fill-function))
21075 ;; Enforce empty fill prefix, if required. Otherwise, it
21076 ;; will be computed again.
21077 (adaptive-fill-mode (not (equal fill-prefix ""))))
21228 (when fill-prefix (do-auto-fill)))))) 21078 (when fill-prefix (do-auto-fill))))))
21229 21079
21230(defun org-comment-line-break-function (&optional soft) 21080(defun org-comment-line-break-function (&optional soft)
@@ -21475,45 +21325,43 @@ beyond the end of the headline."
21475 21325
21476(defun org-end-of-line (&optional arg) 21326(defun org-end-of-line (&optional arg)
21477 "Go to the end of the line. 21327 "Go to the end of the line.
21478If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the 21328If this is a headline, and `org-special-ctrl-a/e' is set, ignore
21479first attempt, and only move to after the tags when the cursor is already 21329tags on the first attempt, and only move to after the tags when
21480beyond the end of the headline." 21330the cursor is already beyond the end of the headline."
21481 (interactive "P") 21331 (interactive "P")
21482 (let ((special (if (consp org-special-ctrl-a/e) 21332 (let ((special (if (consp org-special-ctrl-a/e) (cdr org-special-ctrl-a/e)
21483 (cdr org-special-ctrl-a/e) 21333 org-special-ctrl-a/e))
21484 org-special-ctrl-a/e))) 21334 (type (org-element-type
21335 (save-excursion (beginning-of-line) (org-element-at-point)))))
21485 (cond 21336 (cond
21486 ((or (not special) arg 21337 ((or (not special) arg)
21487 (not (or (org-at-heading-p) (org-at-item-p) (org-at-drawer-p))))
21488 (call-interactively 21338 (call-interactively
21489 (cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line) 21339 (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line)))
21490 ((fboundp 'move-end-of-line) 'move-end-of-line) 21340 ((memq type '(headline inlinetask))
21491 (t 'end-of-line))))
21492 ((org-at-heading-p)
21493 (let ((pos (point))) 21341 (let ((pos (point)))
21494 (beginning-of-line 1) 21342 (beginning-of-line 1)
21495 (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$")) 21343 (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$"))
21496 (if (eq special t) 21344 (if (eq special t)
21497 (if (or (< pos (match-beginning 1)) 21345 (if (or (< pos (match-beginning 1)) (= pos (match-end 0)))
21498 (= pos (match-end 0))) 21346 (goto-char (match-beginning 1))
21499 (goto-char (match-beginning 1)) 21347 (goto-char (match-end 0)))
21500 (goto-char (match-end 0))) 21348 (if (or (< pos (match-end 0))
21501 (if (or (< pos (match-end 0)) (not (eq this-command last-command))) 21349 (not (eq this-command last-command)))
21502 (goto-char (match-end 0)) 21350 (goto-char (match-end 0))
21503 (goto-char (match-beginning 1)))) 21351 (goto-char (match-beginning 1))))
21504 (call-interactively (if (fboundp 'move-end-of-line) 21352 (call-interactively
21505 'move-end-of-line 21353 (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line)))))
21506 'end-of-line))))) 21354 ((memq type
21507 ((org-at-drawer-p) 21355 '(center-block comment-block drawer dynamic-block example-block
21508 (move-end-of-line 1) 21356 export-block item plain-list property-drawer
21509 (when (overlays-at (1- (point))) (backward-char 1))) 21357 quote-block special-block src-block verse-block))
21510 ;; At an item: Move before any hidden text. 21358 ;; Never move past the ellipsis.
21511 (t (call-interactively 21359 (or (eolp) (move-end-of-line 1))
21512 (cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line) 21360 (when (org-invisible-p2) (backward-char)))
21513 ((fboundp 'move-end-of-line) 'move-end-of-line) 21361 (t
21514 (t 'end-of-line))))) 21362 (call-interactively
21515 (org-no-warnings 21363 (if (fboundp 'move-end-of-line) 'move-end-of-line 'end-of-line))))
21516 (and (featurep 'xemacs) (setq zmacs-region-stays t))))) 21364 (org-no-warnings (and (featurep 'xemacs) (setq zmacs-region-stays t)))))
21517 21365
21518(define-key org-mode-map "\C-a" 'org-beginning-of-line) 21366(define-key org-mode-map "\C-a" 'org-beginning-of-line)
21519(define-key org-mode-map "\C-e" 'org-end-of-line) 21367(define-key org-mode-map "\C-e" 'org-end-of-line)
@@ -21966,7 +21814,6 @@ Stop at the first and last subheadings of a superior heading."
21966 (if (< l level) (setq arg 1))) 21814 (if (< l level) (setq arg 1)))
21967 (setq arg (1- arg))))) 21815 (setq arg (1- arg)))))
21968 21816
21969;;;###autoload
21970(defun org-forward-element () 21817(defun org-forward-element ()
21971 "Move forward by one element. 21818 "Move forward by one element.
21972Move to the next element at the same level, when possible." 21819Move to the next element at the same level, when possible."
@@ -21986,7 +21833,6 @@ Move to the next element at the same level, when possible."
21986 (goto-char (org-element-property :end parent)) 21833 (goto-char (org-element-property :end parent))
21987 (goto-char end)))))) 21834 (goto-char end))))))
21988 21835
21989;;;###autoload
21990(defun org-backward-element () 21836(defun org-backward-element ()
21991 "Move backward by one element. 21837 "Move backward by one element.
21992Move to the previous element at the same level, when possible." 21838Move to the previous element at the same level, when possible."
@@ -22013,7 +21859,6 @@ Move to the previous element at the same level, when possible."
22013 ((org-before-first-heading-p) (goto-char (point-min))) 21859 ((org-before-first-heading-p) (goto-char (point-min)))
22014 (t (org-back-to-heading))))))) 21860 (t (org-back-to-heading)))))))
22015 21861
22016;;;###autoload
22017(defun org-up-element () 21862(defun org-up-element ()
22018 "Move to upper element." 21863 "Move to upper element."
22019 (interactive) 21864 (interactive)
@@ -22026,7 +21871,6 @@ Move to the previous element at the same level, when possible."
22026 (error "No surrounding element") 21871 (error "No surrounding element")
22027 (org-with-limited-levels (org-back-to-heading))))))) 21872 (org-with-limited-levels (org-back-to-heading)))))))
22028 21873
22029;;;###autoload
22030(defvar org-element-greater-elements) 21874(defvar org-element-greater-elements)
22031(defun org-down-element () 21875(defun org-down-element ()
22032 "Move to inner element." 21876 "Move to inner element."
@@ -22043,7 +21887,6 @@ Move to the previous element at the same level, when possible."
22043 (error "No content for this element")))) 21887 (error "No content for this element"))))
22044 (t (error "No inner element"))))) 21888 (t (error "No inner element")))))
22045 21889
22046;;;###autoload
22047(defun org-drag-element-backward () 21890(defun org-drag-element-backward ()
22048 "Move backward element at point." 21891 "Move backward element at point."
22049 (interactive) 21892 (interactive)
@@ -22060,7 +21903,6 @@ Move to the previous element at the same level, when possible."
22060 (goto-char (+ (org-element-property :begin prev-elem) 21903 (goto-char (+ (org-element-property :begin prev-elem)
22061 (- pos (org-element-property :begin elem))))))))) 21904 (- pos (org-element-property :begin elem)))))))))
22062 21905
22063;;;###autoload
22064(defun org-drag-element-forward () 21906(defun org-drag-element-forward ()
22065 "Move forward element at point." 21907 "Move forward element at point."
22066 (interactive) 21908 (interactive)
@@ -22095,7 +21937,6 @@ Move to the previous element at the same level, when possible."
22095 (org-element-swap-A-B elem next-elem) 21937 (org-element-swap-A-B elem next-elem)
22096 (goto-char (+ pos size-next size-blank)))))) 21938 (goto-char (+ pos size-next size-blank))))))
22097 21939
22098;;;###autoload
22099(defun org-mark-element () 21940(defun org-mark-element ()
22100 "Put point at beginning of this element, mark at end. 21941 "Put point at beginning of this element, mark at end.
22101 21942
@@ -22116,7 +21957,6 @@ ones already marked."
22116 (push-mark (org-element-property :end element) t t) 21957 (push-mark (org-element-property :end element) t t)
22117 (goto-char (org-element-property :begin element)))))) 21958 (goto-char (org-element-property :begin element))))))
22118 21959
22119;;;###autoload
22120(defun org-narrow-to-element () 21960(defun org-narrow-to-element ()
22121 "Narrow buffer to current element." 21961 "Narrow buffer to current element."
22122 (interactive) 21962 (interactive)
@@ -22135,7 +21975,6 @@ ones already marked."
22135 (org-element-property :begin elem) 21975 (org-element-property :begin elem)
22136 (org-element-property :end elem)))))) 21976 (org-element-property :end elem))))))
22137 21977
22138;;;###autoload
22139(defun org-transpose-element () 21978(defun org-transpose-element ()
22140 "Transpose current and previous elements, keeping blank lines between. 21979 "Transpose current and previous elements, keeping blank lines between.
22141Point is moved after both elements." 21980Point is moved after both elements."
@@ -22145,7 +21984,6 @@ Point is moved after both elements."
22145 (org-drag-element-backward) 21984 (org-drag-element-backward)
22146 (goto-char end))) 21985 (goto-char end)))
22147 21986
22148;;;###autoload
22149(defun org-unindent-buffer () 21987(defun org-unindent-buffer ()
22150 "Un-indent the visible part of the buffer. 21988 "Un-indent the visible part of the buffer.
22151Relative indentation (between items, inside blocks, etc.) isn't 21989Relative indentation (between items, inside blocks, etc.) isn't
diff --git a/lisp/profiler.el b/lisp/profiler.el
index e9261eb1af7..38c0c0b83a7 100644
--- a/lisp/profiler.el
+++ b/lisp/profiler.el
@@ -353,7 +353,9 @@ this variable directly.")
353 (propertize (symbol-name entry) 353 (propertize (symbol-name entry)
354 'face 'link 354 'face 'link
355 'mouse-face 'highlight 355 'mouse-face 'highlight
356 'help-echo "mouse-2 or RET jumps to definition")) 356 'help-echo "\
357mouse-2: jump to definition\n\
358RET: expand or collapse"))
357 (t 359 (t
358 (profiler-format-entry entry))))) 360 (profiler-format-entry entry)))))
359 (propertize string 'profiler-entry entry))) 361 (propertize string 'profiler-entry entry)))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 10fd7a75eaa..06525b354b1 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1568,12 +1568,20 @@ Returns the compilation buffer created."
1568 ;; Then evaluate a cd command if any, but don't perform it yet, else 1568 ;; Then evaluate a cd command if any, but don't perform it yet, else
1569 ;; start-command would do it again through the shell: (cd "..") AND 1569 ;; start-command would do it again through the shell: (cd "..") AND
1570 ;; sh -c "cd ..; make" 1570 ;; sh -c "cd ..; make"
1571 (cd (if (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" 1571 (cd (cond
1572 command) 1572 ((not (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\|'[^']*'\\|\"\\(?:[^\"`$\\]\\|\\\\.\\)*\"\\)\\)?\\s *[;&\n]"
1573 (if (match-end 1) 1573 command))
1574 (substitute-env-vars (match-string 1 command)) 1574 default-directory)
1575 "~") 1575 ((not (match-end 1)) "~")
1576 default-directory)) 1576 ((eq (aref command (match-beginning 1)) ?\')
1577 (substring command (1+ (match-beginning 1))
1578 (1- (match-end 1))))
1579 ((eq (aref command (match-beginning 1)) ?\")
1580 (replace-regexp-in-string
1581 "\\\\\\(.\\)" "\\1"
1582 (substring command (1+ (match-beginning 1))
1583 (1- (match-end 1)))))
1584 (t (substitute-env-vars (match-string 1 command)))))
1577 (erase-buffer) 1585 (erase-buffer)
1578 ;; Select the desired mode. 1586 ;; Select the desired mode.
1579 (if (not (eq mode t)) 1587 (if (not (eq mode t))
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 719471278a8..13eac8392a2 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -148,7 +148,8 @@ Used to gray out relevant toolbar icons.")
148 ([run] menu-item "Run" gud-run 148 ([run] menu-item "Run" gud-run
149 :enable (not gud-running) 149 :enable (not gud-running)
150 :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb))) 150 :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb)))
151 ([go] menu-item (if gdb-active-process "Continue" "Run") gud-go 151 ([go] menu-item (if (bound-and-true-p gdb-active-process)
152 "Continue" "Run") gud-go
152 :visible (and (eq gud-minor-mode 'gdbmi) 153 :visible (and (eq gud-minor-mode 'gdbmi)
153 (gdb-show-run-p))) 154 (gdb-show-run-p)))
154 ([stop] menu-item "Stop" gud-stop-subjob 155 ([stop] menu-item "Stop" gud-stop-subjob
@@ -178,7 +179,7 @@ Used to gray out relevant toolbar icons.")
178 '(gdbmi gdb dbx xdb jdb pdb))) 179 '(gdbmi gdb dbx xdb jdb pdb)))
179 ([pp] menu-item "Print S-expression" gud-pp 180 ([pp] menu-item "Print S-expression" gud-pp
180 :enable (and (not gud-running) 181 :enable (and (not gud-running)
181 gdb-active-process) 182 (bound-and-true-p gdb-active-process))
182 :visible (and (string-equal 183 :visible (and (string-equal
183 (buffer-local-value 184 (buffer-local-value
184 'gud-target-name gud-comint-buffer) "emacs") 185 'gud-target-name gud-comint-buffer) "emacs")
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 06ded5fb53d..daa83620051 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1033,51 +1033,57 @@ subshells can nest."
1033(defun sh-font-lock-paren (start) 1033(defun sh-font-lock-paren (start)
1034 (unless (nth 8 (syntax-ppss)) 1034 (unless (nth 8 (syntax-ppss))
1035 (save-excursion 1035 (save-excursion
1036 (goto-char start) 1036 (let ((open nil))
1037 ;; Skip through all patterns 1037 (goto-char start)
1038 (while 1038 ;; Skip through all patterns
1039 (progn 1039 (while
1040 (while 1040 (progn
1041 (progn 1041 (while
1042 (forward-comment (- (point-max))) 1042 (progn
1043 (when (and (eolp) (sh-is-quoted-p (point))) 1043 (forward-comment (- (point-max)))
1044 (forward-char -1) 1044 (when (and (eolp) (sh-is-quoted-p (point)))
1045 t))) 1045 (forward-char -1)
1046 ;; Skip through one pattern 1046 t)))
1047 (while 1047 ;; Skip through one pattern
1048 (or (/= 0 (skip-syntax-backward "w_")) 1048 (while
1049 (/= 0 (skip-chars-backward "-$=?[]*@/\\\\")) 1049 (or (/= 0 (skip-syntax-backward "w_"))
1050 (and (sh-is-quoted-p (1- (point))) 1050 (/= 0 (skip-chars-backward "-$=?[]*@/\\\\"))
1051 (goto-char (- (point) 2))) 1051 (and (sh-is-quoted-p (1- (point)))
1052 (when (memq (char-before) '(?\" ?\' ?\})) 1052 (goto-char (- (point) 2)))
1053 (condition-case nil (progn (backward-sexp 1) t) 1053 (when (memq (char-before) '(?\" ?\' ?\}))
1054 (error nil))))) 1054 (condition-case nil (progn (backward-sexp 1) t)
1055 ;; Patterns can be preceded by an open-paren (Bug#1320). 1055 (error nil)))))
1056 (if (eq (char-before (point)) ?\() 1056 ;; Patterns can be preceded by an open-paren (bug#1320).
1057 (when (eq (char-before (point)) ?\()
1058 (backward-char 1)
1059 (setq open (point)))
1060 (while (progn
1061 (forward-comment (- (point-max)))
1062 ;; Maybe we've bumped into an escaped newline.
1063 (sh-is-quoted-p (point)))
1057 (backward-char 1)) 1064 (backward-char 1))
1058 (while (progn 1065 (when (eq (char-before) ?|)
1059 (forward-comment (- (point-max))) 1066 (backward-char 1) t)))
1060 ;; Maybe we've bumped into an escaped newline. 1067 (and (> (point) (1+ (point-min)))
1061 (sh-is-quoted-p (point))) 1068 (progn (backward-char 2)
1062 (backward-char 1)) 1069 (if (> start (line-end-position))
1063 (when (eq (char-before) ?|) 1070 (put-text-property (point) (1+ start)
1064 (backward-char 1) t))) 1071 'syntax-multiline t))
1065 (and (> (point) (1+ (point-min))) 1072 ;; FIXME: The `in' may just be a random argument to
1066 (progn (backward-char 2) 1073 ;; a normal command rather than the real `in' keyword.
1067 (if (> start (line-end-position)) 1074 ;; I.e. we should look back to try and find the
1068 (put-text-property (point) (1+ start) 1075 ;; corresponding `case'.
1069 'syntax-multiline t)) 1076 (and (looking-at ";[;&]\\|\\_<in")
1070 ;; FIXME: The `in' may just be a random argument to 1077 ;; ";; esac )" is a case that looks
1071 ;; a normal command rather than the real `in' keyword. 1078 ;; like a case-pattern but it's really just a close
1072 ;; I.e. we should look back to try and find the 1079 ;; paren after a case statement. I.e. if we skipped
1073 ;; corresponding `case'. 1080 ;; over `esac' just now, we're not looking
1074 (and (looking-at ";[;&]\\|\\_<in") 1081 ;; at a case-pattern.
1075 ;; ";; esac )" is a case that looks like a case-pattern 1082 (not (looking-at "..[ \t\n]+esac[^[:word:]_]"))))
1076 ;; but it's really just a close paren after a case 1083 (progn
1077 ;; statement. I.e. if we skipped over `esac' just now, 1084 (when open
1078 ;; we're not looking at a case-pattern. 1085 (put-text-property open (1+ open) 'syntax-table sh-st-punc))
1079 (not (looking-at "..[ \t\n]+esac[^[:word:]_]")))) 1086 sh-st-punc))))))
1080 sh-st-punc))))
1081 1087
1082(defun sh-font-lock-backslash-quote () 1088(defun sh-font-lock-backslash-quote ()
1083 (if (eq (save-excursion (nth 3 (syntax-ppss (match-beginning 0)))) ?\') 1089 (if (eq (save-excursion (nth 3 (syntax-ppss (match-beginning 0)))) ?\')
@@ -1629,7 +1635,8 @@ before the newline and in that case point should be just before the token."
1629 (cmd "|" cmd) (cmd "|&" cmd) 1635 (cmd "|" cmd) (cmd "|&" cmd)
1630 (cmd "&&" cmd) (cmd "||" cmd) 1636 (cmd "&&" cmd) (cmd "||" cmd)
1631 (cmd ";" cmd) (cmd "&" cmd)) 1637 (cmd ";" cmd) (cmd "&" cmd))
1632 (pattern (pattern "|" pattern)) 1638 (rpattern (rpattern "|" rpattern))
1639 (pattern (rpattern) ("case-(" rpattern))
1633 (branches (branches ";;" branches) 1640 (branches (branches ";;" branches)
1634 (branches ";&" branches) (branches ";;&" branches) ;bash. 1641 (branches ";&" branches) (branches ";;&" branches) ;bash.
1635 (pattern "case-)" cmd))) 1642 (pattern "case-)" cmd)))
@@ -1715,6 +1722,7 @@ Does not preserve point."
1715 (tok (smie-default-forward-token))) 1722 (tok (smie-default-forward-token)))
1716 (cond 1723 (cond
1717 ((equal tok ")") "case-)") 1724 ((equal tok ")") "case-)")
1725 ((equal tok "(") "case-(")
1718 ((and tok (string-match "\\`[a-z]" tok) 1726 ((and tok (string-match "\\`[a-z]" tok)
1719 (assoc tok smie-grammar) 1727 (assoc tok smie-grammar)
1720 (not 1728 (not
@@ -1759,6 +1767,7 @@ Does not preserve point."
1759 (let ((tok (smie-default-backward-token))) 1767 (let ((tok (smie-default-backward-token)))
1760 (cond 1768 (cond
1761 ((equal tok ")") "case-)") 1769 ((equal tok ")") "case-)")
1770 ((equal tok "(") "case-(")
1762 ((and tok (string-match "\\`[a-z]" tok) 1771 ((and tok (string-match "\\`[a-z]" tok)
1763 (assoc tok smie-grammar) 1772 (assoc tok smie-grammar)
1764 (not (save-excursion (sh-smie--sh-keyword-p tok)))) 1773 (not (save-excursion (sh-smie--sh-keyword-p tok))))
diff --git a/lisp/repeat.el b/lisp/repeat.el
index e38442a434b..a6c803ae773 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -289,6 +289,10 @@ recently executed command not bound to an input event\"."
289 (interactive) 289 (interactive)
290 (let ((repeat-message-function fun)) 290 (let ((repeat-message-function fun))
291 (setq this-command 'repeat) 291 (setq this-command 'repeat)
292 ;; Beware: messing with `real-this-command' is *bad*, but we
293 ;; need it so `last-repeatable-command' can be recognized
294 ;; later (bug#12232).
295 (setq real-this-command 'repeat)
292 (call-interactively 'repeat)))))) 296 (call-interactively 'repeat))))))
293 map))))) 297 map)))))
294 298
diff --git a/lisp/startup.el b/lisp/startup.el
index 56281a6b164..2e8b6b7f8c4 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1693,7 +1693,6 @@ splash screen in another window."
1693 (force-mode-line-update)) 1693 (force-mode-line-update))
1694 (use-local-map splash-screen-keymap) 1694 (use-local-map splash-screen-keymap)
1695 (setq tab-width 22) 1695 (setq tab-width 22)
1696 (message "%s" (startup-echo-area-message))
1697 (setq buffer-read-only t) 1696 (setq buffer-read-only t)
1698 (goto-char (point-min)) 1697 (goto-char (point-min))
1699 (forward-line 3)))) 1698 (forward-line 3))))
diff --git a/lisp/subr.el b/lisp/subr.el
index 94012fc47de..d328b7cddf5 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2949,8 +2949,8 @@ They default to the values of (point-min) and (point-max) in BUFFER."
2949BUFFER may be a buffer or a buffer name. 2949BUFFER may be a buffer or a buffer name.
2950Arguments START and END are character positions specifying the substring. 2950Arguments START and END are character positions specifying the substring.
2951They default to the values of (point-min) and (point-max) in BUFFER. 2951They default to the values of (point-min) and (point-max) in BUFFER.
2952Strip text properties from the inserted text according to 2952Before insertion, process text properties according to
2953`yank-excluded-properties'." 2953`yank-handled-properties' and `yank-excluded-properties'."
2954 ;; Since the buffer text should not normally have yank-handler properties, 2954 ;; Since the buffer text should not normally have yank-handler properties,
2955 ;; there is no need to handle them here. 2955 ;; there is no need to handle them here.
2956 (let ((opoint (point))) 2956 (let ((opoint (point)))
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 57bbdf9d94a..50e3b785696 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -133,7 +133,7 @@ positions of the thing found."
133THING should be a symbol specifying a type of syntactic entity. 133THING should be a symbol specifying a type of syntactic entity.
134Possibilities include `symbol', `list', `sexp', `defun', 134Possibilities include `symbol', `list', `sexp', `defun',
135`filename', `url', `email', `word', `sentence', `whitespace', 135`filename', `url', `email', `word', `sentence', `whitespace',
136`line', and `page'. 136`line', `number', and `page'.
137 137
138See the file `thingatpt.el' for documentation on how to define 138See the file `thingatpt.el' for documentation on how to define
139a symbol as a valid THING." 139a symbol as a valid THING."
@@ -509,6 +509,7 @@ Signal an error if the entire string was not used."
509(defun number-at-point () 509(defun number-at-point ()
510 "Return the number at point, or nil if none is found." 510 "Return the number at point, or nil if none is found."
511 (form-at-point 'sexp 'numberp)) 511 (form-at-point 'sexp 'numberp))
512(put 'number 'thing-at-point 'number-at-point)
512;;;###autoload 513;;;###autoload
513(defun list-at-point () 514(defun list-at-point ()
514 "Return the Lisp list at point, or nil if none is found." 515 "Return the Lisp list at point, or nil if none is found."
diff --git a/lisp/time.el b/lisp/time.el
index fe3cdbb57be..a3bbee0c893 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -206,12 +206,6 @@ a string to display as the label of that TIMEZONE's time."
206 :type 'integer 206 :type 'integer
207 :version "23.1") 207 :version "23.1")
208 208
209(defvar display-time-world-mode-map
210 (let ((map (make-sparse-keymap)))
211 (define-key map "q" 'kill-this-buffer)
212 map)
213 "Keymap of Display Time World mode.")
214
215;;;###autoload 209;;;###autoload
216(defun display-time () 210(defun display-time ()
217 "Enable display of time, load level, and mail flag in mode lines. 211 "Enable display of time, load level, and mail flag in mode lines.
@@ -523,7 +517,7 @@ runs the normal hook `display-time-hook' after each update."
523 'display-time-event-handler))) 517 'display-time-event-handler)))
524 518
525 519
526(define-derived-mode display-time-world-mode nil "World clock" 520(define-derived-mode display-time-world-mode special-mode "World clock"
527 "Major mode for buffer that displays times in various time zones. 521 "Major mode for buffer that displays times in various time zones.
528See `display-time-world'." 522See `display-time-world'."
529 (setq show-trailing-whitespace nil)) 523 (setq show-trailing-whitespace nil))
@@ -549,8 +543,8 @@ See `display-time-world'."
549 (setenv "TZ" old-tz)) 543 (setenv "TZ" old-tz))
550 (setq fmt (concat "%-" (int-to-string max-width) "s %s\n")) 544 (setq fmt (concat "%-" (int-to-string max-width) "s %s\n"))
551 (dolist (timedata (nreverse result)) 545 (dolist (timedata (nreverse result))
552 (insert (format fmt (car timedata) (cdr timedata))))) 546 (insert (format fmt (car timedata) (cdr timedata))))
553 (delete-char -1)) 547 (delete-char -1)))
554 548
555;;;###autoload 549;;;###autoload
556(defun display-time-world () 550(defun display-time-world ()
@@ -562,10 +556,10 @@ To turn off the world time display, go to that window and type `q'."
562 (not (get-buffer display-time-world-buffer-name))) 556 (not (get-buffer display-time-world-buffer-name)))
563 (run-at-time t display-time-world-timer-second 'display-time-world-timer)) 557 (run-at-time t display-time-world-timer-second 'display-time-world-timer))
564 (with-current-buffer (get-buffer-create display-time-world-buffer-name) 558 (with-current-buffer (get-buffer-create display-time-world-buffer-name)
565 (display-time-world-display display-time-world-list)) 559 (display-time-world-display display-time-world-list)
566 (pop-to-buffer display-time-world-buffer-name) 560 (display-buffer display-time-world-buffer-name
567 (fit-window-to-buffer) 561 (cons nil '((window-height . fit-window-to-buffer))))
568 (display-time-world-mode)) 562 (display-time-world-mode)))
569 563
570(defun display-time-world-timer () 564(defun display-time-world-timer ()
571 (if (get-buffer display-time-world-buffer-name) 565 (if (get-buffer display-time-world-buffer-name)
diff --git a/lisp/tmm.el b/lisp/tmm.el
index 4bc1c9af99a..6c2adf6837a 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -165,13 +165,15 @@ Its value should be an event that has a binding in MENU."
165 ;; tmm-km-list is an alist of (STRING . MEANING). 165 ;; tmm-km-list is an alist of (STRING . MEANING).
166 ;; It has no other elements. 166 ;; It has no other elements.
167 ;; The order of elements in tmm-km-list is the order of the menu bar. 167 ;; The order of elements in tmm-km-list is the order of the menu bar.
168 (dolist (elt menu) 168 (if (not not-menu)
169 (cond 169 (map-keymap (lambda (k v) (tmm-get-keymap (cons k v))) menu)
170 ((stringp elt) (setq gl-str elt)) 170 (dolist (elt menu)
171 ((listp elt) (tmm-get-keymap elt not-menu)) 171 (cond
172 ((vectorp elt) 172 ((stringp elt) (setq gl-str elt))
173 (dotimes (i (length elt)) 173 ((listp elt) (tmm-get-keymap elt not-menu))
174 (tmm-get-keymap (cons i (aref elt i)) not-menu))))) 174 ((vectorp elt)
175 (dotimes (i (length elt))
176 (tmm-get-keymap (cons i (aref elt i)) not-menu))))))
175 ;; Choose an element of tmm-km-list; put it in choice. 177 ;; Choose an element of tmm-km-list; put it in choice.
176 (if (and not-menu (= 1 (length tmm-km-list))) 178 (if (and not-menu (= 1 (length tmm-km-list)))
177 ;; If this is the top-level of an x-popup-menu menu, 179 ;; If this is the top-level of an x-popup-menu menu,
@@ -432,7 +434,7 @@ It uses the free variable `tmm-table-undef' to keep undefined keys."
432 (or (keymapp (cdr-safe (cdr-safe elt))) 434 (or (keymapp (cdr-safe (cdr-safe elt)))
433 (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) 435 (eq (car (cdr-safe (cdr-safe elt))) 'lambda))
434 (and (symbolp (cdr-safe (cdr-safe elt))) 436 (and (symbolp (cdr-safe (cdr-safe elt)))
435 (fboundp (cdr-safe (cdr-safe elt))))) 437 (fboundp (cdr-safe (cdr-safe elt)))))
436 (setq km (cddr elt)) 438 (setq km (cddr elt))
437 (and (stringp (car elt)) (setq str (car elt)))) 439 (and (stringp (car elt)) (setq str (car elt))))
438 440
@@ -458,14 +460,15 @@ It uses the free variable `tmm-table-undef' to keep undefined keys."
458 (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) 460 (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda))
459 (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt)))) 461 (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt))))
460 (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) 462 (fboundp (cdr-safe (cdr-safe (cdr-safe elt))))))
461 ; New style of easy-menu 463 ; New style of easy-menu
462 (setq km (cdr (cddr elt))) 464 (setq km (cdr (cddr elt)))
463 (and (stringp (car elt)) (setq str (car elt)))) 465 (and (stringp (car elt)) (setq str (car elt))))
464 466
465 ((stringp event) ; x-popup or x-popup element 467 ((stringp event) ; x-popup or x-popup element
466 (if (or in-x-menu (stringp (car-safe elt))) 468 (setq str event)
467 (setq str event event nil km elt) 469 (setq event nil)
468 (setq str event event nil km (cons 'keymap elt))))) 470 (setq km (if (or in-x-menu (stringp (car-safe elt)))
471 elt (cons 'keymap elt)))))
469 (unless (or (eq km 'ignore) (null str)) 472 (unless (or (eq km 'ignore) (null str))
470 (let ((binding (where-is-internal km nil t))) 473 (let ((binding (where-is-internal km nil t)))
471 (when binding 474 (when binding
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 0e79c962b47..49b76a8e3bc 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -478,11 +478,13 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html")
478 (let* ((nold (string-to-number (or (match-string 2) "1"))) 478 (let* ((nold (string-to-number (or (match-string 2) "1")))
479 (nnew (string-to-number (or (match-string 4) "1"))) 479 (nnew (string-to-number (or (match-string 4) "1")))
480 (endold 480 (endold
481 (save-excursion 481 (save-excursion
482 (re-search-forward (if diff-valid-unified-empty-line 482 (re-search-forward (if diff-valid-unified-empty-line
483 "^[- \n]" "^[- ]") 483 "^[- \n]" "^[- ]")
484 nil t nold) 484 nil t nold)
485 (line-beginning-position 2))) 485 (line-beginning-position
486 ;; Skip potential "\ No newline at end of file".
487 (if (looking-at ".*\n\\\\") 3 2))))
486 (endnew 488 (endnew
487 ;; The hunk may end with a bunch of "+" lines, so the `end' is 489 ;; The hunk may end with a bunch of "+" lines, so the `end' is
488 ;; then further than computed above. 490 ;; then further than computed above.
@@ -490,7 +492,9 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html")
490 (re-search-forward (if diff-valid-unified-empty-line 492 (re-search-forward (if diff-valid-unified-empty-line
491 "^[+ \n]" "^[+ ]") 493 "^[+ \n]" "^[+ ]")
492 nil t nnew) 494 nil t nnew)
493 (line-beginning-position 2)))) 495 (line-beginning-position
496 ;; Skip potential "\ No newline at end of file".
497 (if (looking-at ".*\n\\\\") 3 2)))))
494 (setq end (max endold endnew))))) 498 (setq end (max endold endnew)))))
495 ;; We may have a first evaluation of `end' thanks to the hunk header. 499 ;; We may have a first evaluation of `end' thanks to the hunk header.
496 (unless end 500 (unless end
@@ -581,8 +585,9 @@ next hunk if TRY-HARDER is non-nil; otherwise signal an error."
581 (with-local-quit 585 (with-local-quit
582 (when (buffer-live-p buffer) 586 (when (buffer-live-p buffer)
583 (with-current-buffer buffer 587 (with-current-buffer buffer
584 (goto-char point) 588 (save-excursion
585 (diff-refine-hunk)))))))))) 589 (goto-char point)
590 (diff-refine-hunk)))))))))))
586 591
587(easy-mmode-define-navigation 592(easy-mmode-define-navigation
588 diff-file diff-file-header-re "file" diff-end-of-file) 593 diff-file diff-file-header-re "file" diff-end-of-file)
@@ -906,7 +911,7 @@ PREFIX is only used internally: don't use it."
906 "Convert unified diffs to context diffs. 911 "Convert unified diffs to context diffs.
907START and END are either taken from the region (if a prefix arg is given) or 912START and END are either taken from the region (if a prefix arg is given) or
908else cover the whole buffer." 913else cover the whole buffer."
909 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) 914 (interactive (if (or current-prefix-arg (use-region-p))
910 (list (region-beginning) (region-end)) 915 (list (region-beginning) (region-end))
911 (list (point-min) (point-max)))) 916 (list (point-min) (point-max))))
912 (unless (markerp end) (setq end (copy-marker end t))) 917 (unless (markerp end) (setq end (copy-marker end t)))
@@ -1030,7 +1035,7 @@ else cover the whole buffer."
1030START and END are either taken from the region 1035START and END are either taken from the region
1031\(when it is highlighted) or else cover the whole buffer. 1036\(when it is highlighted) or else cover the whole buffer.
1032With a prefix argument, convert unified format to context format." 1037With a prefix argument, convert unified format to context format."
1033 (interactive (if (and transient-mark-mode mark-active) 1038 (interactive (if (use-region-p)
1034 (list (region-beginning) (region-end) current-prefix-arg) 1039 (list (region-beginning) (region-end) current-prefix-arg)
1035 (list (point-min) (point-max) current-prefix-arg))) 1040 (list (point-min) (point-max) current-prefix-arg)))
1036 (if to-context 1041 (if to-context
@@ -1040,7 +1045,7 @@ With a prefix argument, convert unified format to context format."
1040 (inhibit-read-only t)) 1045 (inhibit-read-only t))
1041 (save-excursion 1046 (save-excursion
1042 (goto-char start) 1047 (goto-char start)
1043 (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) 1048 (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)\\(?: \\(.*\\)\\|$\\)" nil t)
1044 (< (point) end)) 1049 (< (point) end))
1045 (combine-after-change-calls 1050 (combine-after-change-calls
1046 (if (match-beginning 2) 1051 (if (match-beginning 2)
@@ -1056,7 +1061,9 @@ With a prefix argument, convert unified format to context format."
1056 ;; Variables to use the special undo function. 1061 ;; Variables to use the special undo function.
1057 (old-undo buffer-undo-list) 1062 (old-undo buffer-undo-list)
1058 (old-end (marker-position end)) 1063 (old-end (marker-position end))
1059 (reversible t)) 1064 ;; We currently throw away the comment that can follow
1065 ;; the hunk header. FIXME: Preserve it instead!
1066 (reversible (not (match-end 6))))
1060 (replace-match "") 1067 (replace-match "")
1061 (unless (re-search-forward 1068 (unless (re-search-forward
1062 diff-context-mid-hunk-header-re nil t) 1069 diff-context-mid-hunk-header-re nil t)
@@ -1126,7 +1133,7 @@ With a prefix argument, convert unified format to context format."
1126 "Reverse the direction of the diffs. 1133 "Reverse the direction of the diffs.
1127START and END are either taken from the region (if a prefix arg is given) or 1134START and END are either taken from the region (if a prefix arg is given) or
1128else cover the whole buffer." 1135else cover the whole buffer."
1129 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) 1136 (interactive (if (or current-prefix-arg (use-region-p))
1130 (list (region-beginning) (region-end)) 1137 (list (region-beginning) (region-end))
1131 (list (point-min) (point-max)))) 1138 (list (point-min) (point-max))))
1132 (unless (markerp end) (setq end (copy-marker end t))) 1139 (unless (markerp end) (setq end (copy-marker end t)))
@@ -1192,7 +1199,7 @@ else cover the whole buffer."
1192 "Fixup the hunk headers (in case the buffer was modified). 1199 "Fixup the hunk headers (in case the buffer was modified).
1193START and END are either taken from the region (if a prefix arg is given) or 1200START and END are either taken from the region (if a prefix arg is given) or
1194else cover the whole buffer." 1201else cover the whole buffer."
1195 (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) 1202 (interactive (if (or current-prefix-arg (use-region-p))
1196 (list (region-beginning) (region-end)) 1203 (list (region-beginning) (region-end))
1197 (list (point-min) (point-max)))) 1204 (list (point-min) (point-max))))
1198 (let ((inhibit-read-only t)) 1205 (let ((inhibit-read-only t))
@@ -1971,8 +1978,13 @@ For use in `add-log-current-defun-function'."
1971 (goto-char beg) 1978 (goto-char beg)
1972 (pcase style 1979 (pcase style
1973 (`unified 1980 (`unified
1974 (while (re-search-forward "^\\(?:-.*\n\\)+\\(\\)\\(?:\\+.*\n\\)+" 1981 (while (re-search-forward
1975 end t) 1982 (eval-when-compile
1983 (let ((no-LF-at-eol-re "\\(?:\\\\.*\n\\)?"))
1984 (concat "^\\(?:-.*\n\\)+" no-LF-at-eol-re
1985 "\\(\\)"
1986 "\\(?:\\+.*\n\\)+" no-LF-at-eol-re)))
1987 end t)
1976 (smerge-refine-subst (match-beginning 0) (match-end 1) 1988 (smerge-refine-subst (match-beginning 0) (match-end 1)
1977 (match-end 1) (match-end 0) 1989 (match-end 1) (match-end 0)
1978 nil 'diff-refine-preproc props-r props-a))) 1990 nil 'diff-refine-preproc props-r props-a)))
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index cac3eb559a1..07a292ae435 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -224,6 +224,8 @@ VC commands are globally reachable under the prefix `\\[vc-prefix-map]':
224 224
225(defun vc-file-clearprops (file) 225(defun vc-file-clearprops (file)
226 "Clear all VC properties of FILE." 226 "Clear all VC properties of FILE."
227 (if (boundp 'vc-parent-buffer)
228 (kill-local-variable 'vc-parent-buffer))
227 (setplist (intern file vc-file-prop-obarray) nil)) 229 (setplist (intern file vc-file-prop-obarray) nil))
228 230
229 231
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 266d1993389..9851b2046d9 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -140,6 +140,20 @@ program `dired-chmod-program', which must exist."
140 (other :tag "Bits freely editable" advanced)) 140 (other :tag "Bits freely editable" advanced))
141 :group 'wdired) 141 :group 'wdired)
142 142
143(defcustom wdired-keep-marker-rename t
144 ;; Use t as default so that renamed files "take their markers with them".
145 "Controls marking of files renamed in WDired.
146If t, files keep their previous marks when they are renamed.
147If a character, renamed files (whether previously marked or not)
148are afterward marked with that character.
149This option affects only files renamed by `wdired-finish-edit'.
150See `dired-keep-marker-rename' if you want to do the same for files
151renamed by `dired-do-rename' and `dired-do-rename-regexp'."
152 :type '(choice (const :tag "Keep" t)
153 (character :tag "Mark" :value ?R))
154 :version "24.3"
155 :group 'wdired)
156
143(defvar wdired-mode-map 157(defvar wdired-mode-map
144 (let ((map (make-sparse-keymap))) 158 (let ((map (make-sparse-keymap)))
145 (define-key map "\C-x\C-s" 'wdired-finish-edit) 159 (define-key map "\C-x\C-s" 'wdired-finish-edit)
@@ -416,6 +430,8 @@ non-nil means return old filename."
416 (set-buffer-modified-p nil) 430 (set-buffer-modified-p nil)
417 (setq buffer-undo-list nil)) 431 (setq buffer-undo-list nil))
418 432
433(declare-function dired-add-entry "dired-aux" (filename &optional marker-char relative))
434
419(defun wdired-do-renames (renames) 435(defun wdired-do-renames (renames)
420 "Perform RENAMES in parallel." 436 "Perform RENAMES in parallel."
421 (let ((residue ()) 437 (let ((residue ())
@@ -471,9 +487,12 @@ non-nil means return old filename."
471 (dired-rename-file file-ori file-new 487 (dired-rename-file file-ori file-new
472 overwrite) 488 overwrite)
473 (dired-remove-file file-ori) 489 (dired-remove-file file-ori)
474 (dired-add-file file-new (if (integerp dired-keep-marker-rename) 490 (dired-add-file
475 dired-keep-marker-rename 491 file-new
476 old-mark))) 492 (cond ((integerp wdired-keep-marker-rename)
493 wdired-keep-marker-rename)
494 (wdired-keep-marker-rename old-mark)
495 (t nil))))
477 (error 496 (error
478 (setq errors (1+ errors)) 497 (setq errors (1+ errors))
479 (dired-log (concat "Rename `" file-ori "' to `" 498 (dired-log (concat "Rename `" file-ori "' to `"
diff --git a/lisp/window.el b/lisp/window.el
index fa7b08375ce..bd043390d90 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5414,6 +5414,22 @@ Recognized alist entries include:
5414 parameters to give a new frame, if 5414 parameters to give a new frame, if
5415 one is created. 5415 one is created.
5416 5416
5417 `window-height' -- Value specifies either an integer (the number
5418 of lines of a new window), a floating point number (the
5419 fraction of a new window with respect to the height of the
5420 frame's root window) or a function to be called with one
5421 argument - a new window. The function is supposed to adjust
5422 the height of the window; its return value is ignored.
5423 Suitable functions are `shrink-window-if-larger-than-buffer'
5424 and `fit-window-to-buffer'.
5425
5426 `window-width' -- Value specifies either an integer (the number
5427 of columns of a new window), a floating point number (the
5428 fraction of a new window with respect to the width of the
5429 frame's root window) or a function to be called with one
5430 argument - a new window. The function is supposed to adjust
5431 the width of the window; its return value is ignored.
5432
5417The ACTION argument to `display-buffer' can also have a non-nil 5433The ACTION argument to `display-buffer' can also have a non-nil
5418and non-list value. This means to display the buffer in a window 5434and non-list value. This means to display the buffer in a window
5419other than the selected one, even if it is already displayed in 5435other than the selected one, even if it is already displayed in
diff --git a/lisp/woman.el b/lisp/woman.el
index c8cc7ea6766..e41c489dbfa 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -3632,7 +3632,9 @@ expression in parentheses. Leaves point after the value."
3632 ((looking-at "[mnuv]")) ; ignore for now 3632 ((looking-at "[mnuv]")) ; ignore for now
3633 ((looking-at "i") (setq n (* n 10))) ; inch 3633 ((looking-at "i") (setq n (* n 10))) ; inch
3634 ((looking-at "c") (setq n (* n 3.9))) ; cm 3634 ((looking-at "c") (setq n (* n 3.9))) ; cm
3635 ((looking-at "P") (setq n (* n 1.7))) ; Pica 3635 ((let ((case-fold-search nil))
3636 (looking-at "P"))
3637 (setq n (* n 1.7))) ; Pica
3636 ((looking-at "p") (setq n (* n 0.14))) ; point 3638 ((looking-at "p") (setq n (* n 0.14))) ; point
3637 ;; NB: May be immediately followed by + or -, etc., 3639 ;; NB: May be immediately followed by + or -, etc.,
3638 ;; in which case do nothing and return nil. 3640 ;; in which case do nothing and return nil.