aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog.102
-rw-r--r--lisp/ChangeLog.129
-rw-r--r--lisp/ChangeLog.310
-rw-r--r--lisp/ChangeLog.trunk888
-rw-r--r--lisp/allout-widgets.el2
-rw-r--r--lisp/allout.el16
-rw-r--r--lisp/bookmark.el3
-rw-r--r--lisp/calc/calc-ext.el19
-rw-r--r--lisp/calc/calc-math.el2
-rw-r--r--lisp/calc/calc-units.el276
-rw-r--r--lisp/calc/calc-vec.el13
-rw-r--r--lisp/calc/calc.el5
-rw-r--r--lisp/calendar/cal-hebrew.el47
-rw-r--r--lisp/cedet/semantic/analyze.el2
-rw-r--r--lisp/cedet/semantic/complete.el2
-rw-r--r--lisp/cedet/semantic/edit.el4
-rw-r--r--lisp/cedet/semantic/format.el2
-rw-r--r--lisp/cedet/semantic/java.el2
-rw-r--r--lisp/cus-edit.el8
-rw-r--r--lisp/desktop.el3
-rw-r--r--lisp/dired-aux.el6
-rw-r--r--lisp/dired-x.el251
-rw-r--r--lisp/dired.el31
-rw-r--r--lisp/emacs-lisp/assoc.el10
-rw-r--r--lisp/emacs-lisp/autoload.el16
-rw-r--r--lisp/emacs-lisp/bytecomp.el1
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el18
-rw-r--r--lisp/emacs-lisp/cl-macs.el2
-rw-r--r--lisp/emacs-lisp/elp.el2
-rw-r--r--lisp/emacs-lisp/ert.el62
-rw-r--r--lisp/emacs-lisp/ewoc.el2
-rw-r--r--lisp/emacs-lisp/package-x.el89
-rw-r--r--lisp/emacs-lisp/package.el124
-rw-r--r--lisp/emacs-lisp/pcase.el129
-rw-r--r--lisp/emacs-lock.el3
-rw-r--r--lisp/emulation/viper-cmd.el4
-rw-r--r--lisp/erc/ChangeLog4
-rw-r--r--lisp/erc/ChangeLog.016
-rw-r--r--lisp/erc/erc-track.el4
-rw-r--r--lisp/eshell/em-alias.el7
-rw-r--r--lisp/eshell/em-banner.el11
-rw-r--r--lisp/eshell/em-cmpl.el3
-rw-r--r--lisp/eshell/em-dirs.el5
-rw-r--r--lisp/eshell/em-glob.el3
-rw-r--r--lisp/eshell/em-hist.el7
-rw-r--r--lisp/eshell/em-ls.el12
-rw-r--r--lisp/eshell/em-pred.el3
-rw-r--r--lisp/eshell/em-prompt.el3
-rw-r--r--lisp/eshell/em-rebind.el3
-rw-r--r--lisp/eshell/em-script.el3
-rw-r--r--lisp/eshell/em-smart.el3
-rw-r--r--lisp/eshell/em-term.el3
-rw-r--r--lisp/eshell/em-unix.el13
-rw-r--r--lisp/eshell/esh-arg.el3
-rw-r--r--lisp/eshell/esh-cmd.el45
-rw-r--r--lisp/eshell/esh-ext.el7
-rw-r--r--lisp/eshell/esh-io.el3
-rw-r--r--lisp/eshell/esh-mode.el114
-rw-r--r--lisp/eshell/esh-module.el6
-rw-r--r--lisp/eshell/esh-proc.el34
-rw-r--r--lisp/eshell/esh-test.el233
-rw-r--r--lisp/eshell/esh-util.el19
-rw-r--r--lisp/eshell/esh-var.el35
-rw-r--r--lisp/eshell/eshell.el20
-rw-r--r--lisp/facemenu.el24
-rw-r--r--lisp/files-x.el22
-rw-r--r--lisp/files.el147
-rw-r--r--lisp/find-file.el4
-rw-r--r--lisp/generic-x.el12
-rw-r--r--lisp/gnus/ChangeLog223
-rw-r--r--lisp/gnus/auth-source.el408
-rw-r--r--lisp/gnus/gnus-agent.el14
-rw-r--r--lisp/gnus/gnus-art.el48
-rw-r--r--lisp/gnus/gnus-demon.el2
-rw-r--r--lisp/gnus/gnus-gravatar.el3
-rw-r--r--lisp/gnus/gnus-group.el17
-rw-r--r--lisp/gnus/gnus-msg.el13
-rw-r--r--lisp/gnus/gnus-range.el8
-rw-r--r--lisp/gnus/gnus-start.el28
-rw-r--r--lisp/gnus/gnus-sum.el18
-rw-r--r--lisp/gnus/gnus-uu.el30
-rw-r--r--lisp/gnus/gnus.el11
-rw-r--r--lisp/gnus/message.el172
-rw-r--r--lisp/gnus/nnimap.el41
-rw-r--r--lisp/gnus/nnir.el26
-rw-r--r--lisp/gnus/nnmail.el3
-rw-r--r--lisp/gnus/nntp.el2
-rw-r--r--lisp/gnus/sieve.el103
-rw-r--r--lisp/help-fns.el23
-rw-r--r--lisp/help-mode.el15
-rw-r--r--lisp/ido.el8
-rw-r--r--lisp/image-dired.el2
-rw-r--r--lisp/international/ja-dic-cnv.el2
-rw-r--r--lisp/international/mule-cmds.el4
-rw-r--r--lisp/international/titdic-cnv.el7
-rw-r--r--lisp/isearch.el3
-rw-r--r--lisp/mail/mailclient.el2
-rw-r--r--lisp/mail/mailheader.el2
-rw-r--r--lisp/mail/rmail.el16
-rw-r--r--lisp/mail/rmailmm.el45
-rw-r--r--lisp/mail/sendmail.el8
-rw-r--r--lisp/man.el56
-rw-r--r--lisp/mh-e/ChangeLog5
-rw-r--r--lisp/mh-e/mh-funcs.el4
-rw-r--r--lisp/mh-e/mh-mime.el4
-rw-r--r--lisp/net/ange-ftp.el2
-rw-r--r--lisp/net/browse-url.el7
-rw-r--r--lisp/net/rcirc.el109
-rw-r--r--lisp/net/soap-client.el21
-rw-r--r--lisp/net/soap-inspect.el3
-rw-r--r--lisp/net/tramp-cache.el3
-rw-r--r--lisp/net/tramp-cmds.el6
-rw-r--r--lisp/net/tramp-gvfs.el2
-rw-r--r--lisp/obsolete/fast-lock.el3
-rw-r--r--lisp/obsolete/sym-comp.el2
-rw-r--r--lisp/org/ChangeLog422
-rw-r--r--lisp/org/org-id.el3
-rw-r--r--lisp/org/org.el44
-rw-r--r--lisp/outline.el5
-rw-r--r--lisp/password-cache.el7
-rw-r--r--lisp/printing.el8
-rw-r--r--lisp/progmodes/ada-prj.el2
-rw-r--r--lisp/progmodes/cc-engine.el2766
-rw-r--r--lisp/progmodes/cperl-mode.el16
-rw-r--r--lisp/progmodes/ebnf2ps.el16
-rw-r--r--lisp/progmodes/grep.el6
-rw-r--r--lisp/progmodes/gud.el2
-rw-r--r--lisp/progmodes/idlwave.el4
-rw-r--r--lisp/progmodes/prolog.el4
-rw-r--r--lisp/progmodes/sql.el5
-rw-r--r--lisp/progmodes/vhdl-mode.el8
-rw-r--r--lisp/ps-print.el3
-rw-r--r--lisp/recentf.el15
-rw-r--r--lisp/replace.el2
-rw-r--r--lisp/saveplace.el3
-rw-r--r--lisp/shell.el4
-rw-r--r--lisp/speedbar.el2
-rw-r--r--lisp/term/screen.el11
-rw-r--r--lisp/textmodes/artist.el50
-rw-r--r--lisp/textmodes/paragraphs.el2
-rw-r--r--lisp/textmodes/reftex.el7
-rw-r--r--lisp/textmodes/sgml-mode.el7
-rw-r--r--lisp/time.el2
-rw-r--r--lisp/vc/diff-mode.el2
-rw-r--r--lisp/vc/ediff-init.el4
-rw-r--r--lisp/vc/emerge.el8
-rw-r--r--lisp/vc/vc-bzr.el89
-rw-r--r--lisp/vc/vc-dir.el7
-rw-r--r--lisp/vc/vc-rcs.el12
-rw-r--r--lisp/vc/vc-svn.el4
-rw-r--r--lisp/vc/vc.el4
-rw-r--r--lisp/window.el23
152 files changed, 4535 insertions, 3464 deletions
diff --git a/lisp/ChangeLog.10 b/lisp/ChangeLog.10
index 83ee20fa497..1c2f2b5b015 100644
--- a/lisp/ChangeLog.10
+++ b/lisp/ChangeLog.10
@@ -20591,7 +20591,7 @@
20591 20591
20592 * viper-cmd.el (viper-change-state): Got rid of make-local-hook. 20592 * viper-cmd.el (viper-change-state): Got rid of make-local-hook.
20593 (viper-special-read-and-insert-char): Make C-m work right in the r 20593 (viper-special-read-and-insert-char): Make C-m work right in the r
20594 comand. 20594 command.
20595 (viper-buffer-search-enable): Fixed format string. 20595 (viper-buffer-search-enable): Fixed format string.
20596 20596
20597 * viper-ex.el (ex-token-alist): Use ex-set-visited-file-name 20597 * viper-ex.el (ex-token-alist): Use ex-set-visited-file-name
diff --git a/lisp/ChangeLog.12 b/lisp/ChangeLog.12
index d2f7cab27f0..35572bd6105 100644
--- a/lisp/ChangeLog.12
+++ b/lisp/ChangeLog.12
@@ -10699,9 +10699,6 @@
10699 output of the next command. Reported by M Jared Finder 10699 output of the next command. Reported by M Jared Finder
10700 <jared@hpalace.com>. 10700 <jared@hpalace.com>.
10701 10701
10702 * net/tramp-vc.el (vc-user-login-name): Wrap defadvice with a test
10703 for `process-file', in order to let it work for older Emacsen too.
10704
107052006-04-17 Ralf Angeli <angeli@iwi.uni-sb.de> 107022006-04-17 Ralf Angeli <angeli@iwi.uni-sb.de>
10706 10703
10707 * textmodes/tex-mode.el (tex-font-lock-match-suscript): New function. 10704 * textmodes/tex-mode.el (tex-font-lock-match-suscript): New function.
@@ -11678,7 +11675,7 @@
11678 make underlining work for wide characters. 11675 make underlining work for wide characters.
11679 (org-goto-map, org-agenda-mode-map, org-mode-map): Explicitly bind 11676 (org-goto-map, org-agenda-mode-map, org-mode-map): Explicitly bind
11680 TAB to `org-cycle', to make sure that no binding in 11677 TAB to `org-cycle', to make sure that no binding in
11681 `outline-mode-map' can supercede it. 11678 `outline-mode-map' can supersede it.
11682 11679
116832006-03-14 Ken Manheimer <ken.manheimer@gmail.com> 116802006-03-14 Ken Manheimer <ken.manheimer@gmail.com>
11684 11681
@@ -19139,7 +19136,7 @@
19139 * pgg.el (pgg-decrypt): Passing along PASSPHRASE in call to 19136 * pgg.el (pgg-decrypt): Passing along PASSPHRASE in call to
19140 pgg-decrypt-region. 19137 pgg-decrypt-region.
19141 (pgg-pending-timers): A new hash for tracking the passphrase cache 19138 (pgg-pending-timers): A new hash for tracking the passphrase cache
19142 timers, so that new ones supercede old ones. 19139 timers, so that new ones supersede old ones.
19143 (pgg-add-passphrase-to-cache): Rename from 19140 (pgg-add-passphrase-to-cache): Rename from
19144 `pgg-add-passphrase-cache' to reduce confusion (all callers 19141 `pgg-add-passphrase-cache' to reduce confusion (all callers
19145 changed). Modified to cancel old timers when new ones are added. 19142 changed). Modified to cancel old timers when new ones are added.
@@ -19225,7 +19222,7 @@
19225 * pgg.el (pgg-decrypt): Passing along PASSPHRASE in call to 19222 * pgg.el (pgg-decrypt): Passing along PASSPHRASE in call to
19226 pgg-decrypt-region. 19223 pgg-decrypt-region.
19227 (pgg-pending-timers): A new hash for tracking the passphrase cache 19224 (pgg-pending-timers): A new hash for tracking the passphrase cache
19228 timers, so that new ones supercede old ones. 19225 timers, so that new ones supersede old ones.
19229 (pgg-add-passphrase-to-cache): Rename from 19226 (pgg-add-passphrase-to-cache): Rename from
19230 `pgg-add-passphrase-cache' to reduce confusion (all callers 19227 `pgg-add-passphrase-cache' to reduce confusion (all callers
19231 changed). Modified to cancel old timers when new ones are added. 19228 changed). Modified to cancel old timers when new ones are added.
diff --git a/lisp/ChangeLog.3 b/lisp/ChangeLog.3
index b54580ff0bc..8cafac2c0c4 100644
--- a/lisp/ChangeLog.3
+++ b/lisp/ChangeLog.3
@@ -4906,7 +4906,7 @@
4906 * two-column.el: Doc fixes. 4906 * two-column.el: Doc fixes.
4907 4907
4908 * loaddefs.el (function-keymap): Definition deleted; this has been 4908 * loaddefs.el (function-keymap): Definition deleted; this has been
4909 superceded by function-key-map. 4909 superseded by function-key-map.
4910 4910
4911 * gomoku.el (gomoku-mode-map): Use function key symbols, instead 4911 * gomoku.el (gomoku-mode-map): Use function key symbols, instead
4912 of the keypad.el facilities. 4912 of the keypad.el facilities.
@@ -6056,7 +6056,7 @@
6056 and `fill-column'. Code now actually sets `left-margin' and 6056 and `fill-column'. Code now actually sets `left-margin' and
6057 `fill-column', as advertised. 6057 `fill-column', as advertised.
6058 * text-mode.el (change-log-mode): Function deleted, since it's 6058 * text-mode.el (change-log-mode): Function deleted, since it's
6059 been superceded by the one in add-log.el. 6059 been superseded by the one in add-log.el.
6060 6060
60611992-06-14 Richard Stallman (rms@mole.gnu.ai.mit.edu) 60611992-06-14 Richard Stallman (rms@mole.gnu.ai.mit.edu)
6062 6062
@@ -6070,7 +6070,7 @@
6070 6070
60711992-06-12 Jim Blandy (jimb@pogo.cs.oberlin.edu) 60711992-06-12 Jim Blandy (jimb@pogo.cs.oberlin.edu)
6072 6072
6073 * isearch-mode.el: New package, which will probably supercede 6073 * isearch-mode.el: New package, which will probably supersede
6074 isearch.el. 6074 isearch.el.
6075 (isearch-mode-map, isearch-mode-meta-map): When initializing 6075 (isearch-mode-map, isearch-mode-meta-map): When initializing
6076 these, remember that vectors are no longer keymaps. 6076 these, remember that vectors are no longer keymaps.
@@ -10009,7 +10009,7 @@
10009 display-time-string. 10009 display-time-string.
10010 (rmail-pop-up): Default display-time-hook to automatically retrieve 10010 (rmail-pop-up): Default display-time-hook to automatically retrieve
10011 new mail if the variable rmail-pop-up is non-nil. 10011 new mail if the variable rmail-pop-up is non-nil.
10012 (add-clock-handler): Removed; superceded by timer.el. 10012 (add-clock-handler): Removed; superseded by timer.el.
10013 10013
10014 * loaddefs.el: Removed add-clock-handler. 10014 * loaddefs.el: Removed add-clock-handler.
10015 10015
@@ -10032,7 +10032,7 @@
10032 10032
10033 * loaddefs.el: Autoload for diff. 10033 * loaddefs.el: Autoload for diff.
10034 10034
10035 * files.el (diff): Superceded by diff.el. 10035 * files.el (diff): Superseded by diff.el.
10036 (diff-switches-function): Still needs to be merged into diff.el. 10036 (diff-switches-function): Still needs to be merged into diff.el.
10037 10037
10038 * diff.el: New file. 10038 * diff.el: New file.
diff --git a/lisp/ChangeLog.trunk b/lisp/ChangeLog.trunk
index 05c765e0881..e4d402afa76 100644
--- a/lisp/ChangeLog.trunk
+++ b/lisp/ChangeLog.trunk
@@ -1,3 +1,530 @@
12011-03-06 Chong Yidong <cyd@stupidchicken.com>
2
3 * isearch.el (isearch-mode-map): Bind C-y to isearch-yank-kill,
4 and move isearch-yank-line to M-s C-e (Bug#8183).
5
62011-03-06 Alan Mackenzie <acm@muc.de>
7
8 * progmodes/cc-engine.el (c-guess-basic-syntax): Reindent.
9 (c-guess-basic-syntax): Move CASE 19 to a different place,
10 correctly to process template-args-cont lines.
11
122011-03-06 Jay Belanger <jay.p.belanger@gmail.com>
13
14 * calc/calc-ext.el (calc-init-extensions): Rename
15 calc-logunits-dblevel and calc-logunits-nplevel to calc-dblevel
16 and calc-nplevel, respectively. Add keybindings for calc-spn,
17 calc-midi and calc-freq. Add autoloads for calcFunc-spn,
18 calcFunc-midi, calcFunc-freq, calc-spn, calc-midi and calc-freq.
19
20 * calc/calc-units.el (calc-dblevel): Rename from
21 calc-logunits-dblevel.
22 (calc-nplevel): Rename from calc-logunits-nplevel.
23 (math-midi-round, math-freqp, math-midip, math-spnp)
24 (math-spn-to-midi, math-midi-to-spn, math-freq-to-spn)
25 (math-midi-to-freq, math-spn-to-freq, calcFunc-spn, calcFunc-midi)
26 (calcFunc-freq, calc-freq, calc-midi, calc-spn): New functions.
27 (math-notes): New variable.
28
29 * calc/calc.el (calc-note-threshold): New variable.
30
312011-03-06 Chong Yidong <cyd@stupidchicken.com>
32
33 * emacs-lisp/package.el (package-archives): Accept either ordinary
34 directory names, in addition to HTTP URLs.
35 (package--with-work-buffer): New macro. Handle normal directories.
36 (package-handle-response): Don't display the failing buffer.
37 (package-download-single, package-download-tar)
38 (package--download-one-archive): Use package--with-work-buffer.
39 (package-archive-base): Rename from package-archive-url.
40
412011-03-06 Glenn Morris <rgm@gnu.org>
42
43 * generic-x.el (generic-unix-modes): Add xmodmap-generic-mode.
44 (xmodmap-generic-mode): Respect generic-extras-enable-list.
45
462011-03-06 Daniel Clemente <dcl441-bugs@yahoo.com> (tiny change)
47
48 * generic-x.el (xmodmap-generic-mode): New. (Bug#2065)
49
502011-03-06 Juanma Barranquero <lekktu@gmail.com>
51
52 * allout.el (allout-init, allout-prefixed-keybindings)
53 (allout-unprefixed-keybindings):
54 * progmodes/prolog.el (prolog-find-term):
55 Fix typos in docstrings.
56
572011-03-06 Nikolaj Schumacher <me@nschum.de> (tiny change)
58
59 * emacs-lisp/elp.el (elp-results): Fix off-by-one in header. (Bug#2746)
60
612011-03-06 Kevin Ryde <user42@zip.com.au>
62
63 * textmodes/sgml-mode.el (sgml-fill-nobreak): Give it a doc. (Bug#5326)
64
652011-03-06 Michael Shields <shields@msrl.com> (tiny change)
66
67 * window.el (one-window-p, walk-windows, display-buffer):
68 Doc fixes. (Bug#5567)
69
702011-03-06 Jay Belanger <jay.p.belanger@gmail.com>
71
72 * cus-edit.el (custom-prompt-variable): Use the `custom-get' property
73 of the variable if it exists.
74
752011-03-06 Juanma Barranquero <lekktu@gmail.com>
76
77 * bookmark.el:
78 * desktop.el:
79 * emacs-lock.el:
80 * ps-print.el:
81 * saveplace.el:
82 * net/tramp-cache.el:
83 * obsolete/fast-lock.el:
84 * textmodes/reftex.el:
85 Don't set `kill-emacs-hook' on noninteractive sessions (bug#8137).
86
872011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
88
89 * files.el (delete-directory, copy-directory, list-directory):
90 Use read-directory-name.
91
92 * find-file.el (ff-find-the-other-file):
93 * net/ange-ftp.el (ange-ftp-make-directory):
94 * printing.el (pr-interactive-dir):
95 * progmodes/ada-prj.el (ada-prj-load-directory):
96 * progmodes/ebnf2ps.el (ebnf-print-directory)
97 (ebnf-spool-directory, ebnf-eps-directory)
98 (ebnf-syntax-directory):
99 * shell.el (shell):
100 * speedbar.el (speedbar-create-directory):
101 * vc/emerge.el (emerge-merge-directories):
102 * vc/vc-dir.el (vc-dir):
103 * vc/vc.el (vc-create-tag, vc-retrieve-tag): Likewise.
104
1052011-03-05 Chong Yidong <cyd@stupidchicken.com>
106
107 * help-mode.el (help-buffer): If we are to return the current
108 buffer, signal an error if it's not in Help mode (Bug#8147).
109
1102011-03-05 Reuben Thomas <rrt@sc3d.org>
111
112 * files.el (file-name-version-regexp): Handle backup files of the
113 form `foo.js.~HEAD~1~' (Bug#8159).
114
1152011-03-05 Glenn Morris <rgm@gnu.org>
116
117 * eshell/esh-var.el: Don't require esh-test when compiling.
118 * eshell/em-banner.el, eshell/esh-cmd.el, eshell/esh-mode.el:
119 * eshell/esh-var.el, eshell/eshell.el: Move tests to esh-test.
120 * eshell/esh-test.el: Move to ../../test/eshell.el.
121
1222011-03-05 David Engster <deng@randomsample.de>
123
124 * files.el (save-some-buffers): Report the names of buffers saved
125 automatically due to buffer-save-without-query (Bug#8134).
126
1272011-03-05 Deniz Dogan <deniz.a.m.dogan@gmail.com>
128
129 * net/rcirc.el: Add QuakeNet authentication support.
130 (rcirc-authinfo, rcirc-check-auth-status)
131 (rcirc-authenticate): Support QuakeNet.
132
1332011-03-05 Deniz Dogan <deniz.a.m.dogan@gmail.com>
134
135 * net/rcirc.el: Add functionality to authenticate before
136 autojoining channels.
137 (rcirc-authenticate-before-join): New option.
138 (rcirc-authenticated-hook): New variable.
139 (rcirc-connect): Make local variable rcirc-user-authenticated.
140 (rcirc-handler-001): Respect rcirc-authenticate-before-join.
141 (rcirc-check-auth-status, rcirc-join-channels-post-auth):
142 New functions.
143 (rcirc-handler-PRIVMSG, rcirc-handler-NOTICE):
144 Call rcirc-check-auth-status.
145
1462011-03-05 Alex Harsanyi <AlexHarsanyi@gmail.com>
147
148 * net/soap-client.el (soap-namespace-put-link): Check if the target
149 name is fully qualified -- use only the name part.
150 (soap-parse-complex-type, soap-parse-sequence): Recognize xsd:all
151 types, treated the same as xsd:sequence. (Bug#8166)
152
1532011-03-05 Eli Zaretskii <eliz@gnu.org>
154
155 * files.el (find-file-noselect): Don't ask about re-visiting
156 non-literally if the file is already visited in image-mode.
157 (Bug#8177)
158
1592011-03-05 Glenn Morris <rgm@gnu.org>
160
161 * eshell/esh-mode.el (eshell-kill-buffer-function): New function.
162 (eshell-mode): Use eshell-kill-buffer-function.
163 Run the -initialize functions independently of the -load-hooks.
164 * eshell/esh-proc.el (eshell-kill-process-function): New function.
165 (eshell-gather-process-output, eshell-sentinel)
166 (eshell-interrupt-process, eshell-kill-process, eshell-quit-process):
167 Use eshell-kill-process-function.
168 * eshell/em-alias.el (eshell-alias-load-hook):
169 * eshell/em-banner.el (eshell-banner-load-hook):
170 * eshell/em-cmpl.el (eshell-cmpl-load-hook):
171 * eshell/em-dirs.el (eshell-dirs-load-hook):
172 * eshell/em-glob.el (eshell-glob-load-hook):
173 * eshell/em-hist.el (eshell-hist-load-hook):
174 * eshell/em-pred.el (eshell-pred-load-hook):
175 * eshell/em-prompt.el (eshell-prompt-load-hook):
176 * eshell/em-rebind.el (eshell-rebind-load-hook):
177 * eshell/em-script.el (eshell-script-load-hook):
178 * eshell/em-smart.el (eshell-smart-load-hook):
179 * eshell/em-term.el (eshell-term-load-hook):
180 * eshell/em-unix.el (eshell-unix-load-hook):
181 * eshell/esh-arg.el (eshell-arg-load-hook):
182 * eshell/esh-cmd.el (eshell-cmd-load-hook):
183 * eshell/esh-ext.el (eshell-ext-load-hook):
184 * eshell/esh-io.el (eshell-io-load-hook):
185 * eshell/esh-mode.el (eshell-exit-hook):
186 * eshell/esh-proc.el (eshell-proc-load-hook, eshell-kill-hook):
187 * eshell/esh-var.el (eshell-var-load-hook):
188 Set default hook values to nil. (Bug#5375)
189
190 * eshell/esh-module.el (eshell-module-unload-hook)
191 (eshell-modules-list): Remove leading * from defcustom docs.
192
193 * eshell/esh-util.el (eshell-for): Make it obsolete.
194 * eshell/em-alias.el (eshell/alias, eshell-alias-completions):
195 * eshell/em-dirs.el (eshell-save-some-last-dir):
196 * eshell/em-hist.el (eshell-save-some-history)
197 (eshell-hist-parse-modifier):
198 * eshell/em-ls.el (eshell-ls-dir, eshell-ls-files)
199 (eshell-ls-entries):
200 * eshell/em-unix.el (eshell/cat, eshell/du, eshell/su):
201 * eshell/esh-cmd.el (eshell-invoke-directly, eshell-do-eval)
202 (eshell/which):
203 * eshell/esh-ext.el (eshell-find-interpreter):
204 * eshell/esh-mode.el (eshell-mode):
205 * eshell/esh-module.el (eshell-unload-extension-modules):
206 * eshell/esh-proc.el (eshell-process-interact):
207 * eshell/esh-test.el (eshell-test):
208 * eshell/esh-util.el (eshell-flatten-list, eshell-winnow-list):
209 * eshell/esh-var.el (eshell/env, eshell-environment-variables)
210 (eshell-variables-list):
211 * eshell/eshell.el (eshell-unload-all-modules):
212 Replace eshell-for with dolist.
213
2142011-03-04 Glenn Morris <rgm@gnu.org>
215
216 * vc/vc-bzr.el (vc-bzr-after-dir-status): Handle bzr 2.3.0. (Bug#8170)
217
2182011-03-04 Tom Tromey <tromey@redhat.com>
219
220 * progmodes/gud.el (gdb-script-mode): Derive from prog-mode.
221
2222011-03-04 Glenn Morris <rgm@gnu.org>
223
224 * outline.el (outline-regexp): No longer allow nil.
225 (outline-heading-end-regexp): Add safety predicate. (Bug#7619)
226
227 * net/browse-url.el (browse-url):
228 Handle deleted default-directory. (Bug#6077)
229
230 * recentf.el (recentf-include-p): In case of a buggy predicate,
231 err on the side of including, not excluding. (Bug#5843)
232
2332011-03-04 Jay Belanger <jay.p.belanger@gmail.com>
234
235 * calc/calc-units.el (math-to-standard-rec): Don't treat subscripted
236 variables as units.
237
2382011-03-04 Bob Rogers <rogers@rgrjr.dyndns.org>
239
240 * emacs-lisp/ewoc.el (ewoc-goto-next): Give a more explicit error
241 if there is no node. (Bug#3261)
242
2432011-03-04 Leo <sdl.web@gmail.com>
244
245 * vc/diff-mode.el (diff-mode): Fix whitespace-style. (Bug#8139)
246
247 * time.el (display-time-world-list): Fix typo. (Bug#7571)
248
2492011-03-04 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
250
251 * cus-edit.el (custom-buffer-create-internal):
252 Split search string before passing it to `customize-apropos' (bug#8136).
253
2542011-03-04 Drew Adams <drew.adams@oracle.com>
255
256 * image-dired.el (image-dired-cmd-read-exif-data-options):
257 Fix typo in docstring (bug#8156).
258
2592011-03-03 Deniz Dogan <deniz.a.m.dogan@gmail.com>
260
261 * net/rcirc.el (rcirc-cmd-join): Accept comma-separated input.
262
2632011-03-03 Christian Ohler <ohler@gnu.org>
264
265 * emacs-lisp/ert.el (ert--explain-equal): New function.
266 (ert--explain-equal-rec): Renamed from `ert--explain-not-equal'.
267 All callers changed.
268 (ert--explain-equal-including-properties): Renamed from
269 `ert--explain-not-equal-including-properties'. All callers
270 changed.
271
2722011-03-03 Christian Ohler <ohler@gnu.org>
273
274 * emacs-lisp/ert.el (ert--stats-set-test-and-result)
275 (ert-char-for-test-result, ert-string-for-test-result)
276 (ert-run-tests-batch, ert--print-test-for-ewoc):
277 Handle `ert-test-quit'.
278
2792011-03-03 David Abrahams <dave@boostpro.com> (tiny change)
280
281 * vc/ediff-init.el (ediff-use-faces, ediff-highlight-all-diffs):
282 Move ediff-defvar-local calls after defcustoms. (Bug#1821)
283
2842011-03-03 Glenn Morris <rgm@gnu.org>
285
286 * files.el (file-truename): Doc fix. (Bug#2341)
287
2882011-03-03 Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
289
290 * vc/vc-dir.el (vc-dir-mode-map): Bind vc-dir-find-file to e (Bug#7349).
291
2922011-03-03 Vagn Johansen <gonz808@hotmail.com> (tiny change)
293
294 * vc/vc-svn.el (vc-svn-after-dir-status): Some MS Windows svn client
295 programs output backslashes. (Bug#7663)
296
2972011-03-03 Glenn Morris <rgm@gnu.org>
298
299 * mail/sendmail.el (mail-mode-map): Remove mail-sent-via.
300 (mail-mode): Remove mail-sent-via from the doc.
301 (mail-sent-via): Make it obsolete. (Bug#1776)
302
303 * progmodes/grep.el (grep-highlight-matches): Doc fix.
304 (grep-process-setup): No highlighting without font-lock. (Bug#8084)
305
306 * vc/vc-bzr.el (vc-bzr-state-heuristic): Handle dirstate entries
307 with no parents. (Bug#8025)
308
3092011-03-02 Teodor Zlatanov <tzz@lifelogs.com>
310
311 * password-cache.el (password-in-cache-p): Add autoload.
312
3132011-03-02 Glenn Morris <rgm@gnu.org>
314
315 * man.el (Man-support-local-filenames): Also handle Red Hat's man.
316 * dired-x.el (Man-support-local-filenames): Autoload it.
317 (dired-guess-shell-alist-default): Also handle Red Hat's man.
318
319 * dired-x.el (dired-default-directory-alist, dired-default-directory):
320 Mark as obsolete.
321 (dired-smart-shell-command): Just call dired-current-directory.
322
323 * dired-x.el (dired-jump-other-window): Add autoload.
324 (dired-default-directory-alist, dired-default-directory): Doc fixes.
325 (dired-default-directory-alist): Mark as risky.
326
327 * dired-x.el (dired-omit-here-always): Make it obsolete.
328
3292011-03-02 Chong Yidong <cyd@stupidchicken.com>
330
331 * textmodes/artist.el (artist-curr-go): Default to pen-line.
332 (artist-select-op-pen-line): New function.
333 (artist-menu-map): New variable.
334 (artist-mode-map): Add a menu to the menu-bar.
335
3362011-03-02 Jay Belanger <jay.p.belanger@gmail.com>
337
338 * calc/calc-math.el (calcFunc-log10): Check for symbolic mode
339 when evaluating.
340
341 * calc/calc-units.el (math-conditional-apply, math-conditional-pow):
342 New function.
343 (math-logunits-add, math-logunits-mul, math-logunits-divide):
344 (math-logunits-quant, math-logunits-level):
345 Use `math-conditional-apply' and `math-conditional-pow' to evaluate
346 functions.
347 (math-logunits-level): Extract units from ratio.
348
3492011-03-01 Juanma Barranquero <lekktu@gmail.com>
350
351 * emacs-lisp/cl-macs.el (lexical-let*): Fix argument name in docstring.
352
3532011-03-01 Glenn Morris <rgm@gnu.org>
354
355 * calendar/cal-hebrew.el (calendar-hebrew-birthday)
356 (diary-hebrew-birthday): Rename and rework functions added
357 in previous change.
358
3592011-03-01 Ed Reingold <reingold@emr.cs.iit.edu>
360
361 * calendar/cal-hebrew.el (hebrew-calendar-birthday)
362 (diary-hebrew-birthday): New functions.
363
3642011-03-01 Glenn Morris <rgm@gnu.org>
365
366 * dired.el (dired-safe-switches-p): Beef it up.
367 (dired-actual-switches): Use it for the safe-local prop. (Bug#3230)
368
3692011-03-01 Stefan Monnier <monnier@iro.umontreal.ca>
370
371 * dired.el (dired-safe-switches-p): New function.
372
3732011-03-01 Glenn Morris <rgm@gnu.org>
374
375 * files.el (dir-locals-collect-variables):
376 Add the ability to exclude subdirectories. (Bug#8100)
377
378 * dired-x.el (dired-omit-here-always): Add `(subdirs . nil)' to locals.
379
3802011-02-28 Christoph Scholtes <cschol2112@googlemail.com>
381
382 * ido.el (ido-everywhere): Doc fix.
383 (ido-mode): Doc fix.
384
3852011-02-28 Glenn Morris <rgm@gnu.org>
386
387 * dired-x.el (dired-guess-shell-alist-default): Use \\', not $.
388
3892011-02-28 Michael Albinus <michael.albinus@gmx.de>
390
391 * net/tramp-cmds.el (tramp-append-tramp-buffers): Dump load-path
392 shadows.
393
3942011-02-28 Antoine Levitt <antoine.levitt@gmail.com>
395
396 * dired-x.el (dired-guess-shell-alist-default): Add rar and 7z.
397
3982011-02-28 Juanma Barranquero <lekktu@gmail.com>
399
400 * emacs-lisp/pcase.el (pcase, pcase--u1, pcase--q1):
401 Fix typos in docstrings.
402
4032011-02-28 Stephen Berman <stephen.berman@gmx.net>
404
405 * dired-aux.el (dired-update-file-line):
406 Fix 2010-11-09 change. (Bug#8131)
407
4082011-02-28 Eli Zaretskii <eliz@gnu.org>
409
410 * international/mule-cmds.el (set-default-coding-systems): Use the
411 -unix variant of encoding in default-keyboard-coding-system.
412 (Bug#8122)
413
4142011-02-27 Chong Yidong <cyd@stupidchicken.com>
415
416 * facemenu.el (list-colors-display): Use with-help-window (Bug#8048).
417
4182011-02-27 Prestoo Ten <prestooten@gmail.com> (tiny change)
419
420 * term/screen.el: New file (Bug#2650).
421
4222011-02-27 Stefan Monnier <monnier@iro.umontreal.ca>
423
424 * emacs-lisp/pcase.el (pcase--if): Try to invert test to reduce depth.
425 (pcase-mutually-exclusive-predicates): New var.
426 (pcase--split-consp, pcase--split-pred): Use it.
427 (pcase--split-equal, pcase--split-member): When splitting against
428 a pure predicate, run it to know the outcome.
429 (pcase--u1): Mark vars that are actually used.
430 (pcase--q1): Avoid introducing unused vars.
431
4322011-02-27 Jay Belanger <jay.p.belanger@gmail.com>
433
434 * calc/calc-ext.el (calc-init-extensions):
435 Autoload `calc-l-prefix-help' instead of `calc-ul-prefix-help'.
436
437 * calc/calc-math.el (calcFunc-log10): Don't signal an error in
438 symbolic mode.
439
440 * calc/calc-vec.el (calcFunc-subscr): Return nil if the first
441 argument is a variable.
442
4432011-02-26 Stefan Monnier <monnier@iro.umontreal.ca>
444
445 * emacs-lisp/assoc.el: Remove misleading `sort' (bug#8126).
446 (aput, adelete, amake): Replace `eval' -> `symbol-value'.
447 Suggested by Michael Heerdegen <michael_heerdegen@web.de>.
448
4492011-02-25 Teodor Zlatanov <tzz@lifelogs.com>
450
451 * password-cache.el (password-in-cache-p): Convenience function to
452 check if a key is in the cache, even if the value is nil.
453
4542011-02-25 Jambunathan K <kjambunathan@gmail.com>
455
456 * emacs-lisp/package-x.el (package--archive-contents-from-url)
457 (package--archive-contents-from-file): New functions.
458 (package-update-news-on-upload): New var.
459 (package-upload-buffer-internal): Extract archive-contents from
460 package-archive-upload-base if it is not found at archive-url.
461 Obey package-update-news-on-upload.
462 (package-upload-buffer, package-upload-file): Doc fix.
463
4642011-02-24 Glenn Morris <rgm@gnu.org>
465
466 * files-x.el (modify-dir-local-variable): Handle dir-locals from
467 the cache, and from non-file sources.
468
469 * help-fns.el (describe-variable): Return consistent results when a
470 dir-local from a file came from the cache or did not. (Bug#8095)
471 If a dir-local has no associated file, say it came from a "directory".
472
473 * files.el (hack-dir-local-variables): Fix setting of `dir-name'.
474 (hack-local-variables-confirm, hack-local-variables-filter): Doc fix.
475
476 * files.el (dir-locals-find-file): Doc fix.
477 Fix the check for cache elements that have no associated file,
478 and the mtime check for those that do. (Bug#8095)
479
480 * dired-x.el (dired-hack-local-variables):
481 Handle interrupts during hacking local variables. (Bug#5216)
482
483 * emacs-lisp/autoload.el (autoload-save-buffers)
484 (autoload-find-destination, update-directory-autoloads):
485 Avoid prompts when updating autoloads.
486
4872011-02-23 Stefan Monnier <monnier@iro.umontreal.ca>
488
489 * emacs-lisp/bytecomp.el (byte-compile-disable-print-circle): Obsolete.
490
4912011-02-23 Kenichi Handa <handa@m17n.org>
492
493 * mail/rmailmm.el (rmail-mime-process-multipart): Do not signal an
494 error when a multipart boundary in the nested multipart is found.
495
496 * mail/rmail.el (rmail-start-mail): Decode "encoded-words" of
497 header components.
498
4992011-02-23 Glenn Morris <rgm@gnu.org>
500
501 * dired.el (dired-mode): Call hack-dir-local-variables-non-file-buffer.
502 * dired-x.el (dired-omit-mode): Safe if boolean.
503 (dired-enable-local-variables): Fix doc and custom type.
504 (dired-enable-local-variables, dired-local-variables-file)
505 (dired-hack-local-variables): Make obsolete.
506 (dired-omit-here-always): Use dir-locals.el instead.
507
508 * files.el (safe-local-eval-forms): Add the write-file-hooks version.
509
5102011-02-22 Stefan Monnier <monnier@iro.umontreal.ca>
511
512 * help-fns.el (describe-function-1): Don't signal an error just because
513 the DOC file disappeared.
514
5152011-02-22 Seppo Sade <sepposade1@gmail.com> (tiny change)
516
517 * eshell/esh-ext.el (eshell-external-command): Do not restrict
518 remote check to "ftp". (Bug#8089)
519
5202011-02-21 Alan Mackenzie <acm@muc.de>
521
522 Fix bug #7930.
523 * progmodes/cc-engine.el (c-state-literal-at): Prevent positions
524 in macros finding their way into c-state-nonlit-pos-cache.
525 Strengthen the comments.
526 (c-state-dump): New commented out diagnostic routine.
527
12011-02-21 Michael Albinus <michael.albinus@gmx.de> 5282011-02-21 Michael Albinus <michael.albinus@gmx.de>
2 529
3 * net/tramp.el (tramp-rfn-eshadow-setup-minibuffer): Do not use 530 * net/tramp.el (tramp-rfn-eshadow-setup-minibuffer): Do not use
@@ -16,10 +543,10 @@
16 543
17 * faces.el (color-values): Use cond for clarity. Doc fix. 544 * faces.el (color-values): Use cond for clarity. Doc fix.
18 545
19 * facemenu.el (color-rgb-to-hsv): Deleted; use the version in 546 * facemenu.el (color-rgb-to-hsv): Delete; use the version in
20 color.el instead. 547 color.el instead.
21 (list-colors-sort-key, list-colors-print): Use 548 (list-colors-sort-key, list-colors-print):
22 color-normalized-values. 549 Use color-normalized-values.
23 550
242011-02-20 Drew Adams <drew.adams@oracle.com> 5512011-02-20 Drew Adams <drew.adams@oracle.com>
25 552
@@ -48,8 +575,8 @@
48 * autorevert.el (auto-revert-mode, auto-revert-tail-mode) 575 * autorevert.el (auto-revert-mode, auto-revert-tail-mode)
49 (global-auto-revert-ignore-buffer): Remove leading "*" from docs. 576 (global-auto-revert-ignore-buffer): Remove leading "*" from docs.
50 577
512011-02-19 Dmitry Bolshakov <dmitry.bolshakov@bridge-quest.com> 5782011-02-19 Dmitry Bolshakov <dmitry.bolshakov@bridge-quest.com>
52 Dima Kogan <dkogan@cds.caltech.edu> (tiny change) 579 Dima Kogan <dkogan@cds.caltech.edu> (tiny change)
53 580
54 * progmodes/hideshow.el (hs-find-block-beginning) 581 * progmodes/hideshow.el (hs-find-block-beginning)
55 (hs-hide-level-recursive): Ignore comments when parsing braces 582 (hs-hide-level-recursive): Ignore comments when parsing braces
@@ -69,8 +596,8 @@
69 (vc-bzr-error-regex-alist): New var. 596 (vc-bzr-error-regex-alist): New var.
70 (vc-bzr-merge-branch): Use it to highlight the pull/merge buffer. 597 (vc-bzr-merge-branch): Use it to highlight the pull/merge buffer.
71 598
72 * vc/vc-dispatcher.el (vc-do-async-command): Bind 599 * vc/vc-dispatcher.el (vc-do-async-command):
73 inhibit-read-only to t. 600 Bind inhibit-read-only to t.
74 601
75 * progmodes/compile.el (compilation--flush-directory-cache): 602 * progmodes/compile.el (compilation--flush-directory-cache):
76 Handle the case where cdr of compilation--flush-directory-cache 603 Handle the case where cdr of compilation--flush-directory-cache
@@ -134,8 +661,8 @@
134 * apropos.el (apropos-print): Call apropos-mode before setting up 661 * apropos.el (apropos-print): Call apropos-mode before setting up
135 buffer variables. Use inhibit-read-only. 662 buffer variables. Use inhibit-read-only.
136 663
137 * emacs-lisp/package.el (package--list-packages): Call 664 * emacs-lisp/package.el (package--list-packages):
138 package-menu-mode before setting up buffer variables. 665 Call package-menu-mode before setting up buffer variables.
139 666
140 * play/solitaire.el (solitaire): Call solitaire-mode before 667 * play/solitaire.el (solitaire): Call solitaire-mode before
141 setting up buffer variables. Use inhibit-read-only. 668 setting up buffer variables. Use inhibit-read-only.
@@ -204,13 +731,13 @@
204 731
2052011-02-17 Ken Manheimer <ken.manheimer@gmail.com> 7322011-02-17 Ken Manheimer <ken.manheimer@gmail.com>
206 733
207 * lisp/allout-widgets.el: (allout-widgets-icons-light-subdir) 734 * lisp/allout-widgets.el (allout-widgets-icons-light-subdir)
208 (allout-widgets-icons-dark-subdir): Track relocations of icons 735 (allout-widgets-icons-dark-subdir): Track relocations of icons
209 * lisp/allout.el: Remove commentary about remove encryption 736 * lisp/allout.el: Remove commentary about remove encryption
210 passphrase mnemonic support and verification. 737 passphrase mnemonic support and verification.
211 (allout-encrypt-string): (allout-encrypt-string): Recognize epg 738 (allout-encrypt-string): Recognize epg failure to decrypt gpg2
212 failure to decrypt gpg2 armored text using gpg1, and indicate that 739 armored text using gpg1, and indicate that the gpg version *might*
213 the gpg version *might* be the problem in the error message. 740 be the problem in the error message.
214 741
2152011-02-17 Deniz Dogan <deniz.a.m.dogan@gmail.com> 7422011-02-17 Deniz Dogan <deniz.a.m.dogan@gmail.com>
216 743
@@ -499,7 +1026,7 @@
499 1026
5002011-02-11 Deniz Dogan <deniz.a.m.dogan@gmail.com> 10272011-02-11 Deniz Dogan <deniz.a.m.dogan@gmail.com>
501 1028
502 * net/rcirc.el (defun-rcirc-join): Accept multiple channels. 1029 * net/rcirc.el (rcirc-cmd-join): Accept multiple channels.
503 1030
5042011-02-11 Glenn Morris <rgm@gnu.org> 10312011-02-11 Glenn Morris <rgm@gnu.org>
505 1032
@@ -542,7 +1069,7 @@
542 * play/pong.el (pong-mode-map): 1069 * play/pong.el (pong-mode-map):
543 * play/handwrite.el (menu-bar-handwrite-map): 1070 * play/handwrite.el (menu-bar-handwrite-map):
544 * play/gametree.el (gametree-mode-map): 1071 * play/gametree.el (gametree-mode-map):
545 * net/rcirc.el (rcirc-mode-map, rcirc-browse-url-map 1072 * net/rcirc.el (rcirc-mode-map, rcirc-browse-url-map)
546 (rcirc-multiline-minor-mode-map, rcirc-track-minor-mode-map): 1073 (rcirc-multiline-minor-mode-map, rcirc-track-minor-mode-map):
547 * net/newst-plainview.el (newsticker-menu, newsticker-mode-map) 1074 * net/newst-plainview.el (newsticker-menu, newsticker-mode-map)
548 (newsticker--url-keymap): 1075 (newsticker--url-keymap):
@@ -580,7 +1107,7 @@
580 auto-activation is controlled solely by customization 1107 auto-activation is controlled solely by customization
581 `allout-auto-activation'. 1108 `allout-auto-activation'.
582 1109
583 (allout-auto-activation-helper) (allout-setup): New autoloads 1110 (allout-auto-activation-helper, allout-setup): New autoloads
584 implement new custom set procedure for allout-auto-activation. 1111 implement new custom set procedure for allout-auto-activation.
585 Also, explicitly invoke 1112 Also, explicitly invoke
586 (allout-setup) after allout-auto-activation is custom-defined, to 1113 (allout-setup) after allout-auto-activation is custom-defined, to
@@ -592,7 +1119,7 @@
592 allout-auto-activation, and mark obsolete. 1119 allout-auto-activation, and mark obsolete.
593 (allout-mode): Respect string values for allout-auto-activation. 1120 (allout-mode): Respect string values for allout-auto-activation.
594 Run allout-after-copy-or-kill-hook without any args. 1121 Run allout-after-copy-or-kill-hook without any args.
595 (allout-mode) (allout-layout) (allout-default-layout) 1122 (allout-mode, allout-layout, allout-default-layout)
596 (outlineify-sticky): Adjust docstring for new scheme. 1123 (outlineify-sticky): Adjust docstring for new scheme.
597 (allout-after-copy-or-kill-hook): No arguments - hook implementers 1124 (allout-after-copy-or-kill-hook): No arguments - hook implementers
598 should concentrate on the kill ring. 1125 should concentrate on the kill ring.
@@ -633,7 +1160,7 @@
633 extension-specific processing of killed text. 1160 extension-specific processing of killed text.
634 (allout-mode): Include new allout-after-copy-or-kill-hook among 1161 (allout-mode): Include new allout-after-copy-or-kill-hook among
635 mentioned hooks. 1162 mentioned hooks.
636 (allout-kill-line) (allout-kill-topic): Ensure that processing 1163 (allout-kill-line, allout-kill-topic): Ensure that processing
637 after kill happens even if barf-if-buffer-read-only is raised. 1164 after kill happens even if barf-if-buffer-read-only is raised.
638 Include new allout-after-copy-or-kill-hook among that subsequent 1165 Include new allout-after-copy-or-kill-hook among that subsequent
639 processing. 1166 processing.
@@ -655,23 +1182,23 @@
655 * calc/calc.el (calc-logunits-field-reference): Rename from 1182 * calc/calc.el (calc-logunits-field-reference): Rename from
656 `calc-default-field-reference-level'. 1183 `calc-default-field-reference-level'.
657 (calc-logunits-power-reference): Rename from 1184 (calc-logunits-power-reference): Rename from
658 `calc-default-power-reference-level' 1185 `calc-default-power-reference-level'.
659 1186
660 * calc/calc-units.el (math-logunits-quant): Rename from 1187 * calc/calc-units.el (math-logunits-quant): Rename from
661 `math-logunits-level' 1188 `math-logunits-level'
662 (math-logunits-plus): Rename from math-logcombine. 1189 (math-logunits-plus): Rename from math-logcombine.
663 (calcFunc-luplus, calcFunc-luminus calc-luplus, calc-luminus): Remove. 1190 (calcFunc-luplus, calcFunc-luminus calc-luplus, calc-luminus): Remove.
664 (calcFunc-lufieldadd, calcFunc-lupoweradd, calcFunc-lufieldsub) 1191 (calcFunc-lufieldadd, calcFunc-lupoweradd, calcFunc-lufieldsub)
665 (calcFunc-lufieldsub,calc-logunits-add calc-logunits-sub): 1192 (calcFunc-lufieldsub, calc-logunits-add, calc-logunits-sub):
666 New functions. 1193 New functions.
667 (calcFunc-fieldquant): Rename from `calcFunc-fieldlevel'. 1194 (calcFunc-fieldquant): Rename from `calcFunc-fieldlevel'.
668 (calcFunc-powerquant): Rename from `calcFunc-powerlevel'. 1195 (calcFunc-powerquant): Rename from `calcFunc-powerlevel'.
669 (calc-logunits-quantity): Rename from `calc-level'. 1196 (calc-logunits-quantity): Rename from `calc-level'.
670 (calcFunc-dbfieldlevel, calcFunc-dbpowerlevel, calcFunc-npfieldlevel) 1197 (calcFunc-dbfieldlevel, calcFunc-dbpowerlevel, calcFunc-npfieldlevel)
671 (calcFunc-nppowerlevel,calc-logunits-dblevel, calc-logunits-nplevel) 1198 (calcFunc-nppowerlevel, calc-logunits-dblevel, calc-logunits-nplevel)
672 (math-logunits-mul, calcFunc-lufieldmul, calcFunc-lupowermul) 1199 (math-logunits-mul, calcFunc-lufieldmul, calcFunc-lupowermul)
673 (calc-logunits-mul, math-logunits-divide, calcFunc-lufielddiv) 1200 (calc-logunits-mul, math-logunits-divide, calcFunc-lufielddiv)
674 (calcFunc-lupowerdiv,calc-logunits-divide,math-logunits-level): 1201 (calcFunc-lupowerdiv, calc-logunits-divide, math-logunits-level):
675 New functions. 1202 New functions.
676 1203
677 * calc/calc-help.el (calc-u-prefix-help): Remove "L" reference. 1204 * calc/calc-help.el (calc-u-prefix-help): Remove "L" reference.
@@ -1394,11 +1921,10 @@
1394 (allout-institute-keymap): Take over the "setup" part of the former 1921 (allout-institute-keymap): Take over the "setup" part of the former
1395 allout-setup-mode-map. Reassign allout-mode-map-value value and 1922 allout-setup-mode-map. Reassign allout-mode-map-value value and
1396 update the defalias. 1923 update the defalias.
1397 (allout-command-prefix) (allout-prefixed-keybindings) 1924 (allout-command-prefix, allout-prefixed-keybindings)
1398 (allout-unprefixed-keybindings): 1925 (allout-unprefixed-keybindings):
1399 Use allout-compose-and-institute-keymap to process the bindings. 1926 Use allout-compose-and-institute-keymap to process the bindings.
1400 (allout-unprefixed-keybindings): Remove extraneous '?' question 1927 (allout-unprefixed-keybindings): Remove extraneous '?' question marks.
1401 marks.
1402 (allout-prefixed-keybindings): Elide binding to (prefixed) \C-h - 1928 (allout-prefixed-keybindings): Elide binding to (prefixed) \C-h -
1403 user can customize if they want to use that binding. 1929 user can customize if they want to use that binding.
1404 Bind allout-copy-topic-as-kill to (prefixed) \M-k. 1930 Bind allout-copy-topic-as-kill to (prefixed) \M-k.
@@ -1407,14 +1933,12 @@
1407 (allout-hotspot-key-handler): Remove attempt to resolve the key 1933 (allout-hotspot-key-handler): Remove attempt to resolve the key
1408 through the literal key-string lookup on allout-keybindings-list. 1934 through the literal key-string lookup on allout-keybindings-list.
1409 That probably hasn't worked for a Long Time, and removal of 1935 That probably hasn't worked for a Long Time, and removal of
1410 allout-keybindings-list further simplifies the keybindings 1936 allout-keybindings-list further simplifies the keybindings situation.
1411 situation.
1412 (allout-pre-command-business): Use allout-mode-map-value instead 1937 (allout-pre-command-business): Use allout-mode-map-value instead
1413 of allout-mode-map. 1938 of allout-mode-map.
1414 (allout-preempt-trailing-ctrl-h): Remove. The user can customize 1939 (allout-preempt-trailing-ctrl-h): Remove. The user can customize
1415 the bindings if they want to use a keybinding having a trailing 1940 the bindings if they want to use a keybinding having a trailing
1416 \C-h. No deprecation needed since this feature was never in a 1941 \C-h. No deprecation needed since this feature was never in a release.
1417 release.
1418 (allout-keybindings-list): Remove. It's not been useful for a 1942 (allout-keybindings-list): Remove. It's not been useful for a
1419 while. (See allout-hotspot-key-handler changes, above.) 1943 while. (See allout-hotspot-key-handler changes, above.)
1420 (produce-allout-mode-map): Remove. Consolidate into 1944 (produce-allout-mode-map): Remove. Consolidate into
@@ -2392,7 +2916,7 @@
2392 * loadup.el (symbol-file-load-history-loaded): Remove; unused. 2916 * loadup.el (symbol-file-load-history-loaded): Remove; unused.
2393 2917
23942010-12-15 Jari Aalto <jari.aalto@cante.net> 29182010-12-15 Jari Aalto <jari.aalto@cante.net>
2395 Scott Evans <gse@antisleep.com> 2919 Scott Evans <gse@antisleep.com>
2396 2920
2397 * rect.el (rectange--default-line-number-format) 2921 * rect.el (rectange--default-line-number-format)
2398 (rectangle-number-line-callback): New functions. 2922 (rectangle-number-line-callback): New functions.
@@ -2552,7 +3076,7 @@
2552 * dired.el (dired-pop-to-buffer): Bind pop-up-frames to nil 3076 * dired.el (dired-pop-to-buffer): Bind pop-up-frames to nil
2553 (Bug#7533). 3077 (Bug#7533).
2554 3078
25552010-12-13 W. Martin Borgert <debacle@debian.org> (tiny change) 30792010-12-13 W. Martin Borgert <debacle@debian.org> (tiny change)
2556 3080
2557 * files.el (auto-mode-alist): Handle .dbk (DocBook) with xml-mode. 3081 * files.el (auto-mode-alist): Handle .dbk (DocBook) with xml-mode.
2558 (Bug#7491). 3082 (Bug#7491).
@@ -2596,7 +3120,7 @@
2596 this original name from `bookmark-name-from-record' reverting part 3120 this original name from `bookmark-name-from-record' reverting part
2597 of 2010-12-08T08:09:27Z!kfogel@red-bean.com / kfogel@red-bean.com-20101208080927-5j9jqnb2xvcw4ogm. 3121 of 2010-12-08T08:09:27Z!kfogel@red-bean.com / kfogel@red-bean.com-20101208080927-5j9jqnb2xvcw4ogm.
2598 As Drew Adams pointed out, there was no reason to cause churn for 3122 As Drew Adams pointed out, there was no reason to cause churn for
2599 third-party callers. 3123 third-party callers. (Bug#7609)
2600 3124
26012010-12-12 Alan Mackenzie <acm@muc.de> 31252010-12-12 Alan Mackenzie <acm@muc.de>
2602 3126
@@ -2942,7 +3466,6 @@
2942 3466
2943 * net/tramp-cmds.el: Remove solved todo item. 3467 * net/tramp-cmds.el: Remove solved todo item.
2944 3468
2945 * net/tramp-efs.el:
2946 * net/tramp-ftp.el: 3469 * net/tramp-ftp.el:
2947 * net/tramp-gvfs.el: 3470 * net/tramp-gvfs.el:
2948 * net/tramp-gw.el: 3471 * net/tramp-gw.el:
@@ -3481,7 +4004,7 @@
3481 describe-prefix-bindings 4004 describe-prefix-bindings
3482 - adapt to new version of called-interactively-p, while 4005 - adapt to new version of called-interactively-p, while
3483 maintaining backwards compatibility with old version 4006 maintaining backwards compatibility with old version
3484 - fix hotspot navigation so i works properly with meta-modified keys 4007 - fix hotspot navigation so i works properly with meta-modified keys.
3485 4008
3486 * allout.el (allout-keybindings, allout-bind-keys) 4009 * allout.el (allout-keybindings, allout-bind-keys)
3487 (allout-keybindings-binding, allout-prefixed-keybindings) 4010 (allout-keybindings-binding, allout-prefixed-keybindings)
@@ -3608,7 +4131,7 @@
36082010-11-12 Glenn Morris <rgm@gnu.org> 41312010-11-12 Glenn Morris <rgm@gnu.org>
3609 4132
3610 * emacs-lisp/bytecomp.el (byte-compile-log-buffer): New constant. 4133 * emacs-lisp/bytecomp.el (byte-compile-log-buffer): New constant.
3611 Use it to replace all instances of "*Compile-Log*" 4134 Use it to replace all instances of "*Compile-Log*".
3612 4135
36132010-11-12 Stefan Monnier <monnier@iro.umontreal.ca> 41362010-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
3614 4137
@@ -4556,7 +5079,7 @@
4556 5079
45572010-10-24 Michael McNamara <mac@mail.brushroad.com> 50802010-10-24 Michael McNamara <mac@mail.brushroad.com>
4558 5081
4559 * verilog-mode.el (verilog-directive-re): Make this variable 5082 * progmodes/verilog-mode.el (verilog-directive-re): Make this variable
4560 auto-built for efficiency of execution and updating. 5083 auto-built for efficiency of execution and updating.
4561 (verilog-extended-complete-re): Support 'pure' fucntion & task 5084 (verilog-extended-complete-re): Support 'pure' fucntion & task
4562 declarations (these have no bodies). 5085 declarations (these have no bodies).
@@ -4590,7 +5113,7 @@
4590 5113
45912010-10-24 Wilson Snyder <wsnyder@wsnyder.org> 51142010-10-24 Wilson Snyder <wsnyder@wsnyder.org>
4592 5115
4593 * verilog-mode.el (verilog-auto-inst, verilog-gate-ios) 5116 * progmodes/verilog-mode.el (verilog-auto-inst, verilog-gate-ios)
4594 (verilog-gate-keywords, verilog-read-sub-decls) 5117 (verilog-gate-keywords, verilog-read-sub-decls)
4595 (verilog-read-sub-decls-gate, verilog-read-sub-decls-gate-ios) 5118 (verilog-read-sub-decls-gate, verilog-read-sub-decls-gate-ios)
4596 (verilog-read-sub-decls-line, verilog-read-sub-decls-sig): Support 5119 (verilog-read-sub-decls-line, verilog-read-sub-decls-sig): Support
@@ -5539,7 +6062,7 @@
5539 6062
55402010-10-03 Glenn Morris <rgm@gnu.org> 60632010-10-03 Glenn Morris <rgm@gnu.org>
5541 6064
5542 * obsolete/x-menu.el: Remove file, obsolete since 21.1 6065 * obsolete/x-menu.el: Remove file, obsolete since 21.1.
5543 6066
5544 * textmodes/rst.el (rst-font-lock-keywords-function): 6067 * textmodes/rst.el (rst-font-lock-keywords-function):
5545 Drop Emacs 20 code. 6068 Drop Emacs 20 code.
@@ -6187,8 +6710,8 @@
6187 Use `tramp-compat-funcall'. 6710 Use `tramp-compat-funcall'.
6188 6711
6189 * net/tramp.el (tramp-process-actions): 6712 * net/tramp.el (tramp-process-actions):
6190 * net/tramp-gvfs.el (tramp-handle-vc-registered): 6713 * net/tramp-gvfs.el (tramp-gvfs-handler-askquestion):
6191 * net/tramp-sh.el (tramp-gvfs-handler-askquestion) 6714 * net/tramp-sh.el (tramp-handle-vc-registered)
6192 (tramp-get-remote-stat, tramp-get-remote-readlink): 6715 (tramp-get-remote-stat, tramp-get-remote-readlink):
6193 Use `tramp-compat-with-temp-message'. 6716 Use `tramp-compat-with-temp-message'.
6194 6717
@@ -6253,7 +6776,7 @@
6253 6776
62542010-09-14 Sascha Wilde <wilde@sha-bang.de> 67772010-09-14 Sascha Wilde <wilde@sha-bang.de>
6255 6778
6256 * vc/vc-hg.el (vc-hg-state,vc-hg-working-revision): 6779 * vc/vc-hg.el (vc-hg-state, vc-hg-working-revision):
6257 Replace setting HGRCPATH to "" by some less invasive --config options. 6780 Replace setting HGRCPATH to "" by some less invasive --config options.
6258 6781
62592010-09-14 Stefan Monnier <monnier@iro.umontreal.ca> 67822010-09-14 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -7235,48 +7758,6 @@
7235 7758
7236 * whitespace.el (whitespace-style): Adjust type declaration. 7759 * whitespace.el (whitespace-style): Adjust type declaration.
7237 7760
72382010-08-26 Magnus Henoch <magnus.henoch@gmail.com>
7239
7240 * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
7241 empty argument to gvfs-copy.
7242
72432010-08-26 Chong Yidong <cyd@stupidchicken.com>
7244
7245 * net/tramp-compat.el (tramp-compat-delete-file): Rewrite to
7246 handle new TRASH arg of `delete-file'.
7247
72482010-08-26 Christian Lynbech <christian.lynbech@tieto.com> (tiny change)
7249
7250 * net/tramp.el (tramp-handle-insert-directory): Don't use
7251 `forward-word', its default syntax could be changed.
7252
72532010-08-26 Toru TSUNEYOSHI <t_tuneyosi@hotmail.com>
7254 Michael Albinus <michael.albinus@gmx.de>
7255
7256 Implement compression for inline methods.
7257
7258 * net/tramp.el (tramp-inline-compress-start-size): New defcustom.
7259 (tramp-copy-size-limit): Allow also nil.
7260 (tramp-inline-compress-commands): New defconst.
7261 (tramp-find-inline-compress, tramp-get-inline-compress)
7262 (tramp-get-inline-coding): New defuns.
7263 (tramp-get-remote-coding, tramp-get-local-coding): Remove,
7264 replaced by `tramp-get-inline-coding'.
7265 (tramp-handle-file-local-copy, tramp-handle-write-region)
7266 (tramp-method-out-of-band-p): Use `tramp-get-inline-coding'.
7267
72682010-08-26 Noah Lavine <noah549@gmail.com> (tiny change)
7269
7270 Detect ssh 'ControlMaster' argument automatically in some cases.
7271
7272 * net/tramp.el (tramp-detect-ssh-controlmaster): New defun.
7273 (tramp-default-method): Use it.
7274
72752010-08-26 Karel Klíč <kklic@redhat.com>
7276
7277 * net/tramp.el (tramp-file-name-for-operation):
7278 Add file-selinux-context.
7279
72802010-08-26 Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> (tiny change) 77612010-08-26 Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> (tiny change)
7281 7762
7282 * play/cookie1.el (read-cookie): Fix off-by-one error (bug#6921). 7763 * play/cookie1.el (read-cookie): Fix off-by-one error (bug#6921).
@@ -7308,210 +7789,14 @@
7308 7789
7309 Sync with Tramp 2.1.19. 7790 Sync with Tramp 2.1.19.
7310 7791
7311 * net/tramp-cmds.el (tramp-cleanup-all-connections) 7792 * net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Protect
7312 (tramp-reporter-dump-variable, tramp-load-report-modules) 7793 deleting tmpfile.
7313 (tramp-append-tramp-buffers): Use `tramp-compat-funcall'. 7794 (tramp-gvfs-maybe-open-connection): Use `tramp-compat-funcall'.
7314 (tramp-bug): Recommend setting of `tramp-verbose' to 9.
7315
7316 * net/tramp-compat.el (top): Do not autoload
7317 `tramp-handle-file-remote-p'. Load tramp-util.el and tramp-vc.el
7318 only when `start-file-process' is not bound.
7319 (byte-compile-not-obsolete-vars): Define if not bound.
7320 (tramp-compat-funcall): New defmacro.
7321 (tramp-compat-line-beginning-position)
7322 (tramp-compat-line-end-position)
7323 (tramp-compat-temporary-file-directory)
7324 (tramp-compat-make-temp-file, tramp-compat-file-attributes)
7325 (tramp-compat-copy-file, tramp-compat-copy-directory)
7326 (tramp-compat-delete-file, tramp-compat-delete-directory)
7327 (tramp-compat-number-sequence, tramp-compat-process-running-p):
7328 Use it.
7329 (tramp-advice-file-expand-wildcards): Do not use
7330 `tramp-handle-file-remote-p'.
7331 (tramp-compat-make-temp-file): Simplify fallback implementation.
7332 (tramp-compat-copy-file): Add PRESERVE-SELINUX-CONTEXT.
7333 (tramp-compat-copy-tree): Remove function.
7334 (tramp-compat-delete-file): New defun.
7335 (tramp-compat-delete-directory): Provide implementation for older
7336 Emacsen.
7337 (tramp-compat-file-attributes): Handle only
7338 `wrong-number-of-arguments' error.
7339
7340 * net/tramp-fish.el (tramp-fish-handle-copy-file):
7341 Add PRESERVE_SELINUX_CONTEXT.
7342 (tramp-fish-handle-delete-file): Add TRASH arg.
7343 (tramp-fish-handle-directory-files-and-attributes):
7344 Do not use `tramp-fish-handle-file-attributes.
7345 (tramp-fish-handle-file-local-copy)
7346 (tramp-fish-handle-insert-file-contents)
7347 (tramp-fish-maybe-open-connection): Use `with-progress-reporter'.
7348
7349 * net/tramp-gvfs.el (top): Require url-util.
7350 (tramp-gvfs-mount-point): Remove.
7351 (tramp-gvfs-file-name-handler-alist): Add `file-selinux-context'
7352 and `set-file-selinux-context'.
7353 (tramp-gvfs-stringify-dbus-message, tramp-gvfs-send-command)
7354 (tramp-gvfs-handle-file-selinux-context)
7355 (tramp-gvfs-handle-set-file-selinux-context): New defuns.
7356 (with-tramp-dbus-call-method): Format trace message.
7357 (tramp-gvfs-handle-copy-file): Handle PRESERVE-SELINUX-CONTEXT.
7358 (tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file):
7359 Implement backup call, when operation on local files fails.
7360 Use progress reporter. Flush properties of changed files.
7361 (tramp-gvfs-handle-delete-file): Add TRASH arg.
7362 Use `tramp-compat-delete-file'.
7363 (tramp-gvfs-handle-expand-file-name): Expand "~/".
7364 (tramp-gvfs-handle-make-directory): Make more traces.
7365 (tramp-gvfs-handle-write-region): Protect deleting tmpfile.
7366 (tramp-gvfs-url-file-name): Hexify file name in url.
7367 (tramp-gvfs-fuse-file-name): Take also prefix (like dav shares)
7368 into account for the resulting file name.
7369 (tramp-gvfs-handler-askquestion): Preserve current message, in
7370 order to let progress reporter continue afterwards. (Bug#6257)
7371 Return dummy mountpoint, when the answer is "no".
7372 See `tramp-gvfs-maybe-open-connection'.
7373 (tramp-gvfs-handler-mounted-unmounted)
7374 (tramp-gvfs-connection-mounted-p): Test also for new mountspec
7375 attribute "default_location". Set "prefix" property.
7376 Handle default-location.
7377 (tramp-gvfs-mount-spec): Return both prefix and mountspec.
7378 (tramp-gvfs-maybe-open-connection): Test, whether mountpoint
7379 exists. Raise an error, if not (due to a corresponding answer
7380 "no" in interactive questions, for example).
7381 Use `tramp-compat-funcall'.
7382
7383 * net/tramp-imap.el (top): Autoload `epg-make-context'.
7384 (tramp-imap-handle-copy-file): Add PRESERVE-SELINUX-CONTEXT.
7385 (tramp-imap-do-copy-or-rename-file)
7386 (tramp-imap-handle-insert-file-contents)
7387 (tramp-imap-handle-file-local-copy): Use `with-progress-reporter'.
7388 (tramp-imap-handle-delete-file): Add TRASH arg.
7389
7390 * net/tramp-smb.el (tramp-smb-handle-copy-file):
7391 Add PRESERVE-SELINUX-CONTEXT.
7392 (tramp-smb-handle-copy-file)
7393 (tramp-smb-handle-file-local-copy, tramp-smb-handle-rename-file)
7394 (tramp-smb-handle-write-region, tramp-smb-maybe-open-connection):
7395 Use `with-progress-reporter'.
7396 (tramp-smb-handle-delete-file): Add TRASH arg.
7397 7795
7398 * net/tramp.el (tramp-methods): Move hostname to the end in all 7796 * net/tramp.el (tramp-handle-expand-file-name)
7399 ssh `tramp-login-args'. Add `tramp-async-args' attribute where
7400 appropriate.
7401 (tramp-verbose): Describe verbose level 9.
7402 (tramp-completion-function-alist)
7403 (tramp-file-name-regexp, tramp-chunksize)
7404 (tramp-local-coding-commands, tramp-remote-coding-commands)
7405 (with-connection-property, tramp-completion-mode-p)
7406 (tramp-action-process-alive, tramp-action-out-of-band)
7407 (tramp-check-for-regexp, tramp-file-name-p, tramp-equal-remote)
7408 (tramp-exists-file-name-handler): Fix docstring.
7409 (tramp-remote-process-environment): Use `format' instead of
7410 `concat'. Protect version string by apostroph.
7411 (tramp-shell-prompt-pattern): Do not use a shy group in case of
7412 XEmacs.
7413 (tramp-file-name-regexp-unified)
7414 (tramp-completion-file-name-regexp-unified): On W32 systems, do
7415 not regard the volume letter as remote filename. (Bug#5447)
7416 (tramp-perl-file-attributes)
7417 (tramp-perl-directory-files-and-attributes): Don't pass "$3".
7418 (tramp-vc-registered-read-file-names): Read input as
7419 here-document, otherwise the command could exceed maximum length
7420 of command line.
7421 (tramp-file-name-handler-alist): Add `file-selinux-context' and
7422 `set-file-selinux-context'.
7423 (tramp-debug-message): Add `tramp-compat-funcall' to ignored
7424 backtrace functions.
7425 (tramp-error-with-buffer): Don't show the connection buffer when
7426 we are in completion mode.
7427 (tramp-progress-reporter-update, tramp-remote-selinux-p)
7428 (tramp-handle-file-selinux-context)
7429 (tramp-handle-set-file-selinux-context, tramp-process-sentinel)
7430 (tramp-connectable-p, tramp-open-shell, tramp-get-remote-trash):
7431 New defuns.
7432 (with-progress-reporter): New defmacro.
7433 (tramp-debug-outline-regexp): New defconst.
7434 (top, tramp-rfn-eshadow-setup-minibuffer)
7435 (tramp-rfn-eshadow-update-overlay, tramp-handle-set-file-times)
7436 (tramp-handle-dired-compress-file, tramp-handle-shell-command)
7437 (tramp-completion-mode-p, tramp-check-for-regexp)
7438 (tramp-open-connection-setup-interactive-shell)
7439 (tramp-compute-multi-hops, tramp-read-passwd, tramp-clear-passwd)
7440 (tramp-time-diff, tramp-coding-system-change-eol-conversion)
7441 (tramp-set-process-query-on-exit-flag, tramp-unload-tramp):
7442 Use `tramp-compat-funcall'.
7443 (tramp-handle-make-symbolic-link): Flush file properties.
7444 (tramp-handle-load, tramp-handle-file-local-copy)
7445 (tramp-handle-insert-file-contents, tramp-handle-write-region)
7446 (tramp-handle-vc-registered, tramp-maybe-send-script)
7447 (tramp-find-shell): Use `with-progress-reporter'.
7448 (tramp-do-file-attributes-with-stat): Add space in format string,
7449 in order to work around a bug in pdksh. Reported by Gilles Pion
7450 <gpion@lfdj.com>.
7451 (tramp-handle-verify-visited-file-modtime): Do not send a command
7452 when the connection is not established.
7453 (tramp-handle-set-file-times): Simplify the check for utc.
7454 (tramp-handle-directory-files-and-attributes)
7455 (tramp-get-remote-path): Use `copy-tree'.
7456 (tramp-completion-handle-file-name-all-completions): Ensure, that
7457 non remote files are still checked. Oops.
7458 (tramp-handle-copy-file, tramp-do-copy-or-rename-file):
7459 Handle PRESERVE-SELINUX-CONTEXT.
7460 (tramp-do-copy-or-rename-file): Add progress reporter.
7461 (tramp-do-copy-or-rename-file-directly): Do not use
7462 `tramp-handle-file-remote-p'.
7463 (tramp-do-copy-or-rename-file-out-of-band):
7464 Use `tramp-compat-delete-directory'.
7465 (tramp-do-copy-or-rename-file-out-of-band)
7466 (tramp-compute-multi-hops, tramp-maybe-open-connection):
7467 Use `format-spec-make'.
7468 (tramp-handle-delete-file): Add TRASH arg.
7469 (tramp-handle-dired-uncache): Flush directory cache, not only file
7470 cache.
7471 (tramp-handle-expand-file-name)
7472 (tramp-completion-handle-file-name-all-completions) 7797 (tramp-completion-handle-file-name-all-completions)
7473 (tramp-completion-handle-file-name-completion): 7798 (tramp-completion-handle-file-name-completion):
7474 Use `tramp-connectable-p'. 7799 Use `tramp-connectable-p'.
7475 (tramp-handle-start-file-process): Set connection property "vec".
7476 Use it, in order to invalidate file caches. Check only for
7477 `remote-tty' process property.
7478 Implement tty setting. (Bug#4604, Bug#6360)
7479 (tramp-file-name-for-operation): Add `call-process-region' and
7480 `set-file-selinux-context'.
7481 (tramp-find-foreign-file-name-handler)
7482 (tramp-advice-make-auto-save-file-name)
7483 (tramp-set-auto-save-file-modes): Remove superfluous check for
7484 `stringp'. This is done inside `tramp-tramp-file-p'.
7485 (tramp-file-name-handler): Trace 'quit. Catch the error for some
7486 operations when we are in completion mode. This gives the user
7487 the chance to correct the file name in the minibuffer.
7488 (tramp-completion-mode-p): Use `non-essential'.
7489 (tramp-handle-file-name-all-completions): Backward/ XEmacs
7490 compatibility: Use `completion-ignore-case' if
7491 `read-file-name-completion-ignore-case' does not exist.
7492 (tramp-get-debug-buffer): Use `tramp-debug-outline-regexp'.
7493 (tramp-find-shell, tramp-open-connection-setup-interactive-shell):
7494 `tramp-open-shell'.
7495 (tramp-action-password): Hide password prompt before next run.
7496 (tramp-process-actions): Widen connection buffer for the trace.
7497 (tramp-open-connection-setup-interactive-shell): Set `remote-tty'
7498 process property. Trace stty settings if `tramp-verbose' >= 9.
7499 Apply workaround for IRIX64 bug. Move argument of last
7500 `tramp-send-command' where it belongs to.
7501 (tramp-maybe-open-connection): Use `async-args' and `gw-args' in
7502 front of `login-args'.
7503 (tramp-get-ls-command, tramp-get-ls-command-with-dired): Run tests
7504 on "/dev/null" instead of "/".
7505 (tramp-get-ls-command-with-dired): Make test for "--dired"
7506 stronger.
7507 (tramp-set-auto-save-file-modes): Adapt version check.
7508 (tramp-set-process-query-on-exit-flag): Fix wrong parentheses.
7509 (tramp-handle-process-file): Call the program in a subshell, in
7510 order to preserve working directory.
7511 (tramp-handle-shell-command): Don't use hard-wired "/bin/sh" but
7512 `tramp-remote-sh' from `tramp-methods'.
7513 (tramp-get-ls-command): Make test for "--color=never" stronger.
7514 (tramp-check-for-regexp): Use (forward-line 1).
7515 7800
7516 * net/trampver.el: Update release number. 7801 * net/trampver.el: Update release number.
7517 7802
@@ -7607,7 +7892,7 @@
7607 7892
7608 * net/dbus.el: Accept UNIX domain sockets as bus address. 7893 * net/dbus.el: Accept UNIX domain sockets as bus address.
7609 (top): Don't initialize `dbus-registered-objects-table' anymore, 7894 (top): Don't initialize `dbus-registered-objects-table' anymore,
7610 this is done in dbusbind,c. 7895 this is done in dbusbind.c.
7611 (dbus-check-event): Adapt test for bus. 7896 (dbus-check-event): Adapt test for bus.
7612 (dbus-return-values-table, dbus-unregister-service) 7897 (dbus-return-values-table, dbus-unregister-service)
7613 (dbus-event-bus-name, dbus-introspect, dbus-register-property): 7898 (dbus-event-bus-name, dbus-introspect, dbus-register-property):
@@ -7944,7 +8229,7 @@
7944 * progmodes/octave-mod.el (octave-mode): Set comment-add. 8229 * progmodes/octave-mod.el (octave-mode): Set comment-add.
7945 (octave-mode-map): Use comment-dwim (bug#6829). 8230 (octave-mode-map): Use comment-dwim (bug#6829).
7946 8231
79472010-08-12 Antoine Levitt <antoine.levitt@gmail.com> (tiny change) 82322010-08-12 Antoine Levitt <antoine.levitt@gmail.com>
7948 8233
7949 * cus-edit.el (custom-save-variables, custom-save-faces): Fix up 8234 * cus-edit.el (custom-save-variables, custom-save-faces): Fix up
7950 indentation of inserted comment. 8235 indentation of inserted comment.
@@ -8123,7 +8408,7 @@
8123 8408
81242010-08-08 Jay Belanger <jay.p.belanger@gmail.com> 84092010-08-08 Jay Belanger <jay.p.belanger@gmail.com>
8125 8410
8126 * calc/calc.el (calc-trail-mode,calc-refresh): Use `face' property 8411 * calc/calc.el (calc-trail-mode, calc-refresh): Use `face' property
8127 to italicize headers. 8412 to italicize headers.
8128 (calc-highlight-selections-with-faces): New variable. 8413 (calc-highlight-selections-with-faces): New variable.
8129 (calc-selected-face, calc-nonselected-face): New faces. 8414 (calc-selected-face, calc-nonselected-face): New faces.
@@ -8168,7 +8453,7 @@
8168 8453
8169 * progmodes/cc-cmds.el (c-mask-paragraph, c-fill-paragraph): 8454 * progmodes/cc-cmds.el (c-mask-paragraph, c-fill-paragraph):
8170 Fix for the case that a C style comment has its delimiters alone on 8455 Fix for the case that a C style comment has its delimiters alone on
8171 their respective lines. 8456 their respective lines. (Bug#193)
8172 8457
81732010-08-06 Michael Albinus <michael.albinus@gmx.de> 84582010-08-06 Michael Albinus <michael.albinus@gmx.de>
8174 8459
@@ -8507,7 +8792,7 @@
8507 (sql-interactive-mode-menu): Add "Save Connection" item. 8792 (sql-interactive-mode-menu): Add "Save Connection" item.
8508 (sql-add-product): Fix menu item. 8793 (sql-add-product): Fix menu item.
8509 (sql-get-product-feature): Improved error handling. 8794 (sql-get-product-feature): Improved error handling.
8510 (sql--alt-buffer-part, sql--alt-if-not-empty): Removed. 8795 (sql--alt-buffer-part, sql--alt-if-not-empty): Remove.
8511 (sql-make-alternate-buffer-name): Simplified. 8796 (sql-make-alternate-buffer-name): Simplified.
8512 (sql-product-interactive): Handle missing product. 8797 (sql-product-interactive): Handle missing product.
8513 (sql-connect): Support string keys, minor improvements. 8798 (sql-connect): Support string keys, minor improvements.
@@ -8902,7 +9187,7 @@
8902 (delete-backward-char): Implement in Lisp. 9187 (delete-backward-char): Implement in Lisp.
8903 (delete-forward-char): New command. 9188 (delete-forward-char): New command.
8904 9189
8905 * mouse.el (mouse-region-delete-keys): Deleted. 9190 * mouse.el (mouse-region-delete-keys): Delete.
8906 (mouse-show-mark): Simplify. 9191 (mouse-show-mark): Simplify.
8907 9192
8908 * bindings.el (global-map): Bind delete and DEL, the former to 9193 * bindings.el (global-map): Bind delete and DEL, the former to
@@ -9018,7 +9303,7 @@
9018 * htmlfontify.el (hfy-face-attr-for-class): Use append instead 9303 * htmlfontify.el (hfy-face-attr-for-class): Use append instead
9019 of nconc to avoid pure storage error (Bug#6239). 9304 of nconc to avoid pure storage error (Bug#6239).
9020 9305
90212010-06-27 Christoph <cschol2112@googlemail.com> (tiny change) 93062010-06-27 Christoph Scholtes <cschol2112@googlemail.com>
9022 9307
9023 * bookmark.el (bookmark-bmenu-2-window, bookmark-bmenu-other-window) 9308 * bookmark.el (bookmark-bmenu-2-window, bookmark-bmenu-other-window)
9024 (bookmark-bmenu-other-window-with-mouse): Remove unnecessary 9309 (bookmark-bmenu-other-window-with-mouse): Remove unnecessary
@@ -9783,9 +10068,8 @@
9783 * net/tramp-ftp.el (tramp-ftp-file-name-handler): 10068 * net/tramp-ftp.el (tramp-ftp-file-name-handler):
9784 Use `delete-file' instead of `tramp-compat-delete-file'. 10069 Use `delete-file' instead of `tramp-compat-delete-file'.
9785 10070
9786 * net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): Rename arg. 10071 * net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Use
9787 (tramp-gvfs-handle-write-region): Use `delete-file' instead of 10072 `delete-file' instead of `tramp-compat-delete-file'.
9788 `tramp-compat-delete-file'.
9789 10073
9790 * net/tramp-imap.el (tramp-imap-do-copy-or-rename-file): 10074 * net/tramp-imap.el (tramp-imap-do-copy-or-rename-file):
9791 Use `delete-file' instead of `tramp-compat-delete-file'. 10075 Use `delete-file' instead of `tramp-compat-delete-file'.
@@ -10944,7 +11228,7 @@
10944 11228
10945 * textmodes/ispell.el (ispell-init-process): Fix personal dictionary 11229 * textmodes/ispell.el (ispell-init-process): Fix personal dictionary
10946 condition in default directory check. 11230 condition in default directory check.
10947 (ispell-init-process,ispell-kill-ispell,kill-buffer-hook): 11231 (ispell-init-process, ispell-kill-ispell, kill-buffer-hook):
10948 Kill ispell process when killing its associated buffer. 11232 Kill ispell process when killing its associated buffer.
10949 11233
109502010-04-27 Jan Djärv <jan.h.d@swipnet.se> 112342010-04-27 Jan Djärv <jan.h.d@swipnet.se>
@@ -11201,7 +11485,7 @@
11201 11485
11202 * ido.el (ido-file-internal): Fix 2009-12-02 change. 11486 * ido.el (ido-file-internal): Fix 2009-12-02 change.
11203 11487
112042010-04-19 Christoph <cschol2112@googlemail.com> (tiny change) 114882010-04-19 Christoph Scholtes <cschol2112@googlemail.com>
11205 11489
11206 * progmodes/grep.el (grep-compute-defaults): Fix handling of host 11490 * progmodes/grep.el (grep-compute-defaults): Fix handling of host
11207 default settings (Bug#5928). 11491 default settings (Bug#5928).
@@ -13211,7 +13495,7 @@
13211 (ada-goto-label-re): New; matches goto labels. 13495 (ada-goto-label-re): New; matches goto labels.
13212 (ada-block-label-re): New; matches block labels. 13496 (ada-block-label-re): New; matches block labels.
13213 (ada-label-re): New; matches both. 13497 (ada-label-re): New; matches both.
13214 (ada-named-block-re): Deleted; callers changed to use 13498 (ada-named-block-re): Delete; callers changed to use
13215 `ada-block-label-re' instead. 13499 `ada-block-label-re' instead.
13216 (ada-get-current-indent, ada-get-indent-noindent, ada-get-indent-loop): 13500 (ada-get-current-indent, ada-get-indent-noindent, ada-get-indent-loop):
13217 Use `ada-block-label-re'. 13501 Use `ada-block-label-re'.
@@ -15674,7 +15958,7 @@
15674 * vc-rcs.el (vc-rcs-print-log): 15958 * vc-rcs.el (vc-rcs-print-log):
15675 * vc-git.el (vc-git-print-log): 15959 * vc-git.el (vc-git-print-log):
15676 * vc-cvs.el (vc-cvs-print-log): Add new optional argument LIMIT, 15960 * vc-cvs.el (vc-cvs-print-log): Add new optional argument LIMIT,
15677 ignore it. Make the BUFFER argument non-optional 15961 ignore it. Make the BUFFER argument non-optional.
15678 15962
15679 * bindings.el (mode-line-buffer-identification): Do not purecopy. 15963 * bindings.el (mode-line-buffer-identification): Do not purecopy.
15680 15964
@@ -20428,12 +20712,12 @@
204282009-08-19 Magnus Henoch <magnus.henoch@gmail.com> 207122009-08-19 Magnus Henoch <magnus.henoch@gmail.com>
20429 20713
20430 * log-edit.el (log-edit-strip-single-file-name): New var. 20714 * log-edit.el (log-edit-strip-single-file-name): New var.
20431 (log-edit-insert-changelog): Use it. Bug#3571 20715 (log-edit-insert-changelog): Use it. Bug#3571.
20432 20716
204332009-08-19 Stefan Monnier <monnier@iro.umontreal.ca> 207172009-08-19 Stefan Monnier <monnier@iro.umontreal.ca>
20434 20718
20435 * subr.el (read-passwd): Use read-key so keypad keys work as well. 20719 * subr.el (read-passwd): Use read-key so keypad keys work as well.
20436 Bug#3287 20720 Bug#3287.
20437 20721
20438 * help.el (help-print-return-message): Rename from 20722 * help.el (help-print-return-message): Rename from
20439 print-help-return-message. 20723 print-help-return-message.
@@ -20831,7 +21115,7 @@
20831 (def-gdb-memory-format, def-gdb-memory-unit): Update memory buffer 21115 (def-gdb-memory-format, def-gdb-memory-unit): Update memory buffer
20832 after changing settings. 21116 after changing settings.
20833 (gdb-invalidate-disassembly): Update when first shown. 21117 (gdb-invalidate-disassembly): Update when first shown.
20834 (gdb-edit-locals-value): Fixed. 21118 (gdb-edit-locals-value): Fix.
20835 (gdb-registers-handler-custom): Print registers in right order and 21119 (gdb-registers-handler-custom): Print registers in right order and
20836 allow changing register values (only for current thread yet). 21120 allow changing register values (only for current thread yet).
20837 (gdb-breakpoints-mode-map): Don't assume threads buffer is present. 21121 (gdb-breakpoints-mode-map): Don't assume threads buffer is present.
@@ -20882,7 +21166,7 @@
20882 21166
208832009-08-06 Dmitry Dzhus <dima@sphinx.net.ru> 211672009-08-06 Dmitry Dzhus <dima@sphinx.net.ru>
20884 21168
20885 * progmodes/gdb-mi.el (gdb-var-create-regexp): Removed. 21169 * progmodes/gdb-mi.el (gdb-var-create-regexp): Remove.
20886 (gdb-var-create-handler): Rewritten using JSON parser. 21170 (gdb-var-create-handler): Rewritten using JSON parser.
20887 (gdb-propertize-header): Move earlier. 21171 (gdb-propertize-header): Move earlier.
20888 (gdb-set-header): Remove to avoid duplication. 21172 (gdb-set-header): Remove to avoid duplication.
@@ -22197,7 +22481,7 @@
22197 or shell command text during AUTO expansion. Suggested by Tad Truex. 22481 or shell command text during AUTO expansion. Suggested by Tad Truex.
22198 (verilog-read-sub-decls-expr, verilog-read-sub-decls-line) 22482 (verilog-read-sub-decls-expr, verilog-read-sub-decls-line)
22199 (verilog-read-sub-decls-sig, verilog-symbol-detick-text): 22483 (verilog-read-sub-decls-sig, verilog-symbol-detick-text):
22200 Fix dotted nets {a.b,c.d} and excaped identifiers being mis-included 22484 Fix dotted nets {a.b,c.d} and escaped identifiers being mis-included
22201 in AUTOINOUT. Reported by Matthew Lovell. 22485 in AUTOINOUT. Reported by Matthew Lovell.
22202 (verilog-read-always-signals-recurse): Fix AUTORESET "if (a<=b)" 22486 (verilog-read-always-signals-recurse): Fix AUTORESET "if (a<=b)"
22203 causing use of <= assignments. Reported by Alex Reed. 22487 causing use of <= assignments. Reported by Alex Reed.
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index 75e1e5882f6..cc5fd6d96fa 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -2013,7 +2013,7 @@ Optional FORCE means force reassignment of the region property."
2013 ;; item body), to bias the registered values. 2013 ;; item body), to bias the registered values.
2014 ;; 2014 ;;
2015 ;; This is not necessary/useful when the item is being decorated, because 2015 ;; This is not necessary/useful when the item is being decorated, because
2016 ;; that always must be preceeded by a fresh item parse. 2016 ;; that always must be preceded by a fresh item parse.
2017 2017
2018 (if (not (eq field :body-end)) 2018 (if (not (eq field :body-end))
2019 (widget-get item-widget :from) 2019 (widget-get item-widget :from)
diff --git a/lisp/allout.el b/lisp/allout.el
index 1a7d8cb1593..c75b7a22f9a 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -234,7 +234,7 @@ Use vector format for the keys:
234 - put literal keys after a '?' question mark, eg: '?a', '?.' 234 - put literal keys after a '?' question mark, eg: '?a', '?.'
235 - enclose control, shift, or meta-modified keys as sequences within 235 - enclose control, shift, or meta-modified keys as sequences within
236 parentheses, with the literal key, as above, preceded by the name(s) 236 parentheses, with the literal key, as above, preceded by the name(s)
237 of the modifers, eg: [(control ?a)] 237 of the modifiers, eg: [(control ?a)]
238See the existing keys for examples. 238See the existing keys for examples.
239 239
240Functions can be bound to multiple keys, but binding keys to 240Functions can be bound to multiple keys, but binding keys to
@@ -255,13 +255,13 @@ prevails."
255 255
256This is in contrast to the majority of allout-mode bindings on 256This is in contrast to the majority of allout-mode bindings on
257`allout-prefixed-bindings', whose bindings are created with a 257`allout-prefixed-bindings', whose bindings are created with a
258preceeding command key. 258preceding command key.
259 259
260Use vector format for the keys: 260Use vector format for the keys:
261 - put literal keys after a '?' question mark, eg: '?a', '?.' 261 - put literal keys after a '?' question mark, eg: '?a', '?.'
262 - enclose control, shift, or meta-modified keys as sequences within 262 - enclose control, shift, or meta-modified keys as sequences within
263 parentheses, with the literal key, as above, preceded by the name(s) 263 parentheses, with the literal key, as above, preceded by the name(s)
264 of the modifers, eg: [(control ?a)] 264 of the modifiers, eg: [(control ?a)]
265See the existing keys for examples." 265See the existing keys for examples."
266 :type 'allout-keybindings-binding 266 :type 'allout-keybindings-binding
267 :group 'allout-keybindings 267 :group 'allout-keybindings
@@ -339,7 +339,7 @@ The types of elements in the layout specification are:
339 -- positive numbers open to the relative depth indicated by the 339 -- positive numbers open to the relative depth indicated by the
340 number, but do not force already opened subtopics to be closed. 340 number, but do not force already opened subtopics to be closed.
341 -- 0 means to close topic -- hide all subitems. 341 -- 0 means to close topic -- hide all subitems.
342 : -- repeat spec -- apply the preceeding element to all siblings at 342 : -- repeat spec -- apply the preceding element to all siblings at
343 current level, *up to* those siblings that would be covered by specs 343 current level, *up to* those siblings that would be covered by specs
344 following the `:' on the list. Ie, apply to all topics at level but 344 following the `:' on the list. Ie, apply to all topics at level but
345 trailing ones accounted for by trailing specs. (Only the first of 345 trailing ones accounted for by trailing specs. (Only the first of
@@ -1642,7 +1642,7 @@ So `allout-post-command-business' should not reactivate it...")
1642(defun allout-init (mode) 1642(defun allout-init (mode)
1643 "DEPRECATED - configure allout activation by customizing 1643 "DEPRECATED - configure allout activation by customizing
1644`allout-auto-activation'. This function remains around, limited 1644`allout-auto-activation'. This function remains around, limited
1645from what it did before, for backwards compatability. 1645from what it did before, for backwards compatibility.
1646 1646
1647MODE is the activation mode - see `allout-auto-activation' for 1647MODE is the activation mode - see `allout-auto-activation' for
1648valid values." 1648valid values."
@@ -3125,7 +3125,7 @@ situation."
3125 nil) 3125 nil)
3126 ;; rationale: if any intervening items were at a lower depth, we 3126 ;; rationale: if any intervening items were at a lower depth, we
3127 ;; would now be on the first offspring at the target depth -- ie, 3127 ;; would now be on the first offspring at the target depth -- ie,
3128 ;; the preceeding item (per the search direction) must be at a 3128 ;; the preceding item (per the search direction) must be at a
3129 ;; lesser depth. that's all we need to check. 3129 ;; lesser depth. that's all we need to check.
3130 (if backward (allout-next-heading) (allout-previous-heading)) 3130 (if backward (allout-next-heading) (allout-previous-heading))
3131 (if (< allout-recent-depth target-depth) 3131 (if (< allout-recent-depth target-depth)
@@ -4246,7 +4246,7 @@ With a negative argument, the item is shifted out using
4246 4246
4247With an argument greater than one, shift-in the item but not its 4247With an argument greater than one, shift-in the item but not its
4248offspring, making the item into a sibling of its former children, 4248offspring, making the item into a sibling of its former children,
4249and a child of sibling that formerly preceeded it. 4249and a child of sibling that formerly preceded it.
4250 4250
4251You are not allowed to shift the first offspring of a topic 4251You are not allowed to shift the first offspring of a topic
4252inwards, because that would yield a \"containment 4252inwards, because that would yield a \"containment
@@ -5364,7 +5364,7 @@ header and body. The elements of that list are:
5364 5364
5365 (goto-char start) 5365 (goto-char start)
5366 (beginning-of-line) 5366 (beginning-of-line)
5367 ;; Goto initial topic, and register preceeding stuff, if any: 5367 ;; Goto initial topic, and register preceding stuff, if any:
5368 (if (> (allout-goto-prefix-doublechecked) start) 5368 (if (> (allout-goto-prefix-doublechecked) start)
5369 ;; First topic follows beginning point -- register preliminary stuff: 5369 ;; First topic follows beginning point -- register preliminary stuff:
5370 (setq result 5370 (setq result
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index cd946e46be9..d3db54c81d4 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -2181,7 +2181,8 @@ This also runs `bookmark-exit-hook'."
2181 (bookmark-time-to-save-p t) 2181 (bookmark-time-to-save-p t)
2182 (bookmark-save))) 2182 (bookmark-save)))
2183 2183
2184(add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal) 2184(unless noninteractive
2185 (add-hook 'kill-emacs-hook 'bookmark-exit-hook-internal))
2185 2186
2186(defun bookmark-unload-function () 2187(defun bookmark-unload-function ()
2187 "Unload the Bookmark library." 2188 "Unload the Bookmark library."
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index fcc3ecc1ab1..11a26d6d125 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -423,12 +423,16 @@
423 423
424 (define-key calc-mode-map "l" nil) 424 (define-key calc-mode-map "l" nil)
425 (define-key calc-mode-map "lq" 'calc-logunits-quantity) 425 (define-key calc-mode-map "lq" 'calc-logunits-quantity)
426 (define-key calc-mode-map "ld" 'calc-logunits-dblevel) 426 (define-key calc-mode-map "ld" 'calc-dblevel)
427 (define-key calc-mode-map "ln" 'calc-logunits-nplevel) 427 (define-key calc-mode-map "ln" 'calc-nplevel)
428 (define-key calc-mode-map "l+" 'calc-logunits-add) 428 (define-key calc-mode-map "l+" 'calc-logunits-add)
429 (define-key calc-mode-map "l-" 'calc-logunits-sub) 429 (define-key calc-mode-map "l-" 'calc-logunits-sub)
430 (define-key calc-mode-map "l*" 'calc-logunits-mul) 430 (define-key calc-mode-map "l*" 'calc-logunits-mul)
431 (define-key calc-mode-map "l/" 'calc-logunits-divide) 431 (define-key calc-mode-map "l/" 'calc-logunits-divide)
432 (define-key calc-mode-map "ls" 'calc-spn)
433 (define-key calc-mode-map "lm" 'calc-midi)
434 (define-key calc-mode-map "lf" 'calc-freq)
435
432 (define-key calc-mode-map "l?" 'calc-l-prefix-help) 436 (define-key calc-mode-map "l?" 'calc-l-prefix-help)
433 437
434 (define-key calc-mode-map "m" nil) 438 (define-key calc-mode-map "m" nil)
@@ -944,7 +948,7 @@ calcFunc-lupoweradd calcFunc-lufieldsub calcFunc-lupowersub
944calcFunc-lufieldmul calcFunc-lupowermul calcFunc-lufielddiv 948calcFunc-lufieldmul calcFunc-lupowermul calcFunc-lufielddiv
945calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant 949calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant
946calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel 950calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel
947calcFunc-nppowerlevel 951calcFunc-nppowerlevel calcFunc-spn calcFunc-midi calcFunc-freq
948math-build-units-table math-build-units-table-buffer 952math-build-units-table math-build-units-table-buffer
949math-check-unit-name math-convert-temperature math-convert-units 953math-check-unit-name math-convert-temperature math-convert-units
950math-extract-units math-remove-units math-simplify-units 954math-extract-units math-remove-units math-simplify-units
@@ -1061,7 +1065,7 @@ calc-full-help calc-g-prefix-help calc-help-prefix
1061calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help calc-option-prefix-help 1065calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help calc-option-prefix-help
1062calc-inverse-prefix-help calc-j-prefix-help calc-k-prefix-help 1066calc-inverse-prefix-help calc-j-prefix-help calc-k-prefix-help
1063calc-m-prefix-help calc-r-prefix-help calc-s-prefix-help 1067calc-m-prefix-help calc-r-prefix-help calc-s-prefix-help
1064calc-t-prefix-help calc-u-prefix-help calc-ul-prefix-help 1068calc-t-prefix-help calc-u-prefix-help calc-l-prefix-help
1065calc-v-prefix-help) 1069calc-v-prefix-help)
1066 1070
1067 ("calc-incom" calc-begin-complex calc-begin-vector calc-comma 1071 ("calc-incom" calc-begin-complex calc-begin-vector calc-comma
@@ -1176,9 +1180,10 @@ calc-convert-temperature calc-convert-units calc-define-unit
1176calc-enter-units-table calc-explain-units calc-extract-units 1180calc-enter-units-table calc-explain-units calc-extract-units
1177calc-get-unit-definition calc-permanent-units calc-quick-units 1181calc-get-unit-definition calc-permanent-units calc-quick-units
1178calc-remove-units calc-simplify-units calc-undefine-unit 1182calc-remove-units calc-simplify-units calc-undefine-unit
1179calc-view-units-table calc-logunits-quantity calc-logunits-dblevel 1183calc-view-units-table calc-logunits-quantity calc-dblevel
1180calc-logunits-nplevel calc-logunits-add calc-logunits-sub 1184calc-nplevel calc-logunits-add calc-logunits-sub
1181calc-logunits-mul calc-logunits-divide) 1185calc-logunits-mul calc-logunits-divide calc-spn calc-midi
1186calc-freq)
1182 1187
1183 ("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm 1188 ("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm
1184calc-conj-transpose calc-cons calc-cross calc-kron calc-diag 1189calc-conj-transpose calc-cons calc-cross calc-kron calc-diag
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index 185ed18ed42..076dab31fd9 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -1574,7 +1574,7 @@ If this can't be done, return NIL."
1574 (if calc-infinite-mode 1574 (if calc-infinite-mode
1575 '(neg (var inf var-inf)) 1575 '(neg (var inf var-inf))
1576 (math-reject-arg x "*Logarithm of zero"))) 1576 (math-reject-arg x "*Logarithm of zero")))
1577 (calc-symbolic-mode (signal 'inexact-result nil)) 1577 (calc-symbolic-mode (signal 'inexact-result nil))
1578 ((Math-numberp x) 1578 ((Math-numberp x)
1579 (math-with-extra-prec 2 1579 (math-with-extra-prec 2
1580 (let ((xf (math-float x))) 1580 (let ((xf (math-float x)))
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 569d5d3dc35..7f0adc9fe7e 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -960,7 +960,10 @@ If EXPR is nil, return nil."
960 (if (eq base 'pi) 960 (if (eq base 'pi)
961 (math-pi) 961 (math-pi)
962 expr))) 962 expr)))
963 (if (Math-primp expr) 963 (if (or
964 (Math-primp expr)
965 (and (eq (car-safe expr) 'calcFunc-subscr)
966 (eq (car-safe (nth 1 expr)) 'var)))
964 expr 967 expr
965 (cons (car expr) 968 (cons (car expr)
966 (mapcar 'math-to-standard-rec (cdr expr)))))) 969 (mapcar 'math-to-standard-rec (cdr expr))))))
@@ -1559,6 +1562,20 @@ If EXPR is nil, return nil."
1559(defvar math-logunits '((var dB var-dB) 1562(defvar math-logunits '((var dB var-dB)
1560 (var Np var-Np))) 1563 (var Np var-Np)))
1561 1564
1565(defun math-conditional-apply (fn &rest args)
1566 "Evaluate f(args) unless in symbolic mode.
1567In symbolic mode, return the list (fn args)."
1568 (if calc-symbolic-mode
1569 (cons fn args)
1570 (apply fn args)))
1571
1572(defun math-conditional-pow (a b)
1573 "Evaluate a^b unless in symbolic mode.
1574In symbolic mode, return the list (^ a b)."
1575 (if calc-symbolic-mode
1576 (list '^ a b)
1577 (math-pow a b)))
1578
1562(defun math-extract-logunits (expr) 1579(defun math-extract-logunits (expr)
1563 (if (memq (car-safe expr) '(* /)) 1580 (if (memq (car-safe expr) '(* /))
1564 (cons (car expr) 1581 (cons (car expr)
@@ -1585,24 +1602,24 @@ If EXPR is nil, return nil."
1585 (if (equal aunit '(var dB var-dB)) 1602 (if (equal aunit '(var dB var-dB))
1586 (let ((coef (if power 10 20))) 1603 (let ((coef (if power 10 20)))
1587 (math-mul coef 1604 (math-mul coef
1588 (calcFunc-log10 1605 (math-conditional-apply 'calcFunc-log10
1589 (if neg 1606 (if neg
1590 (math-sub 1607 (math-sub
1591 (math-pow 10 (math-div acoeff coef)) 1608 (math-conditional-pow 10 (math-div acoeff coef))
1592 (math-pow 10 (math-div bcoeff coef))) 1609 (math-conditional-pow 10 (math-div bcoeff coef)))
1593 (math-add 1610 (math-add
1594 (math-pow 10 (math-div acoeff coef)) 1611 (math-conditional-pow 10 (math-div acoeff coef))
1595 (math-pow 10 (math-div bcoeff coef))))))) 1612 (math-conditional-pow 10 (math-div bcoeff coef)))))))
1596 (let ((coef (if power 2 1))) 1613 (let ((coef (if power 2 1)))
1597 (math-div 1614 (math-div
1598 (calcFunc-ln 1615 (math-conditional-apply 'calcFunc-ln
1599 (if neg 1616 (if neg
1600 (math-sub 1617 (math-sub
1601 (calcFunc-exp (math-mul coef acoeff)) 1618 (math-conditional-apply 'calcFunc-exp (math-mul coef acoeff))
1602 (calcFunc-exp (math-mul coef bcoeff))) 1619 (math-conditional-apply 'calcFunc-exp (math-mul coef bcoeff)))
1603 (math-add 1620 (math-add
1604 (calcFunc-exp (math-mul coef acoeff)) 1621 (math-conditional-apply 'calcFunc-exp (math-mul coef acoeff))
1605 (calcFunc-exp (math-mul coef bcoeff))))) 1622 (math-conditional-apply 'calcFunc-exp (math-mul coef bcoeff)))))
1606 coef))) 1623 coef)))
1607 units))))))) 1624 units)))))))
1608 1625
@@ -1666,14 +1683,14 @@ If EXPR is nil, return nil."
1666 (math-add 1683 (math-add
1667 coef 1684 coef
1668 (math-mul (if power 10 20) 1685 (math-mul (if power 10 20)
1669 (calcFunc-log10 number))) 1686 (math-conditional-apply 'calcFunc-log10 number)))
1670 units))) 1687 units)))
1671 (t 1688 (t
1672 (math-simplify 1689 (math-simplify
1673 (math-mul 1690 (math-mul
1674 (math-add 1691 (math-add
1675 coef 1692 coef
1676 (math-div (calcFunc-ln number) (if power 2 1))) 1693 (math-div (math-conditional-apply 'calcFunc-ln number) (if power 2 1)))
1677 units)))) 1694 units))))
1678 (calc-record-why "*Improper units" nil)))) 1695 (calc-record-why "*Improper units" nil))))
1679 1696
@@ -1692,14 +1709,14 @@ If EXPR is nil, return nil."
1692 (math-sub 1709 (math-sub
1693 coef 1710 coef
1694 (math-mul (if power 10 20) 1711 (math-mul (if power 10 20)
1695 (calcFunc-log10 b))) 1712 (math-conditional-apply 'calcFunc-log10 b)))
1696 units))) 1713 units)))
1697 (t 1714 (t
1698 (math-simplify 1715 (math-simplify
1699 (math-mul 1716 (math-mul
1700 (math-sub 1717 (math-sub
1701 coef 1718 coef
1702 (math-div (calcFunc-ln b) (if power 2 1))) 1719 (math-div (math-conditional-apply 'calcFunc-ln b) (if power 2 1)))
1703 units))))))))) 1720 units)))))))))
1704 1721
1705(defun calcFunc-lufieldtimes (a b) 1722(defun calcFunc-lufieldtimes (a b)
@@ -1747,14 +1764,14 @@ If EXPR is nil, return nil."
1747 (if (equal lunit '(var dB var-dB)) 1764 (if (equal lunit '(var dB var-dB))
1748 (math-mul 1765 (math-mul
1749 ref 1766 ref
1750 (math-pow 1767 (math-conditional-pow
1751 10 1768 10
1752 (math-div 1769 (math-div
1753 coeff 1770 coeff
1754 (if power 10 20)))) 1771 (if power 10 20))))
1755 (math-mul 1772 (math-mul
1756 ref 1773 ref
1757 (calcFunc-exp 1774 (math-conditional-apply 'calcFunc-exp
1758 (if power 1775 (if power
1759 (math-mul 2 coeff) 1776 (math-mul 2 coeff)
1760 coeff)))) 1777 coeff))))
@@ -1787,15 +1804,16 @@ If EXPR is nil, return nil."
1787(defun math-logunits-level (val ref db power) 1804(defun math-logunits-level (val ref db power)
1788 "Compute the value of VAL in decibels or nepers." 1805 "Compute the value of VAL in decibels or nepers."
1789 (let* ((ratio (math-simplify-units (math-div val ref))) 1806 (let* ((ratio (math-simplify-units (math-div val ref)))
1807 (ratiou (math-simplify-units (math-remove-units ratio)))
1790 (units (math-simplify (math-extract-units ratio)))) 1808 (units (math-simplify (math-extract-units ratio))))
1791 (math-mul 1809 (math-mul
1792 (if db 1810 (if db
1793 (math-mul 1811 (math-mul
1794 (math-mul (if power 10 20) 1812 (math-mul (if power 10 20)
1795 (calcFunc-log10 ratio)) 1813 (math-conditional-apply 'calcFunc-log10 ratiou))
1796 '(var dB var-dB)) 1814 '(var dB var-dB))
1797 (math-mul 1815 (math-mul
1798 (math-div (calcFunc-ln ratio) (if power 2 1)) 1816 (math-div (math-conditional-apply 'calcFunc-ln ratiou) (if power 2 1))
1799 '(var Np var-Np))) 1817 '(var Np var-Np)))
1800 units))) 1818 units)))
1801 1819
@@ -1819,7 +1837,7 @@ If EXPR is nil, return nil."
1819 (setq ref (math-read-expr calc-logunits-power-reference))) 1837 (setq ref (math-read-expr calc-logunits-power-reference)))
1820 (math-logunits-level val ref nil t)) 1838 (math-logunits-level val ref nil t))
1821 1839
1822(defun calc-logunits-dblevel (arg) 1840(defun calc-dblevel (arg)
1823 (interactive "P") 1841 (interactive "P")
1824 (calc-slow-wrapper 1842 (calc-slow-wrapper
1825 (if (calc-is-hyperbolic) 1843 (if (calc-is-hyperbolic)
@@ -1830,7 +1848,7 @@ If EXPR is nil, return nil."
1830 (calc-binary-op "ludb" 'calcFunc-dbpowerlevel arg) 1848 (calc-binary-op "ludb" 'calcFunc-dbpowerlevel arg)
1831 (calc-unary-op "ludb" 'calcFunc-dbpowerlevel arg))))) 1849 (calc-unary-op "ludb" 'calcFunc-dbpowerlevel arg)))))
1832 1850
1833(defun calc-logunits-nplevel (arg) 1851(defun calc-nplevel (arg)
1834 (interactive "P") 1852 (interactive "P")
1835 (calc-slow-wrapper 1853 (calc-slow-wrapper
1836 (if (calc-is-hyperbolic) 1854 (if (calc-is-hyperbolic)
@@ -1841,6 +1859,222 @@ If EXPR is nil, return nil."
1841 (calc-binary-op "lunp" 'calcFunc-nppowerlevel arg) 1859 (calc-binary-op "lunp" 'calcFunc-nppowerlevel arg)
1842 (calc-unary-op "lunp" 'calcFunc-nppowerlevel arg))))) 1860 (calc-unary-op "lunp" 'calcFunc-nppowerlevel arg)))))
1843 1861
1862;;; Musical notes
1863
1864
1865(defvar calc-note-threshold)
1866
1867(defun math-midi-round (num)
1868 "Round NUM to an integer N if NUM is within calc-note-threshold cents of N."
1869 (let* ((n (math-round num))
1870 (diff (math-abs
1871 (math-sub num n))))
1872 (if (< (math-compare diff
1873 (math-div (math-read-expr calc-note-threshold) 100)) 0)
1874 n
1875 num)))
1876
1877(defconst math-notes
1878 '(((var C var-C) . 0)
1879 ((var Csharp var-Csharp) . 1)
1880; ((var C♯ var-C♯) . 1)
1881 ((var Dflat var-Dflat) . 1)
1882; ((var D♭ var-D♭) . 1)
1883 ((var D var-D) . 2)
1884 ((var Dsharp var-Dsharp) . 3)
1885; ((var D♯ var-D♯) . 3)
1886 ((var E var-E) . 4)
1887 ((var F var-F) . 5)
1888 ((var Fsharp var-Fsharp) . 6)
1889; ((var F♯ var-F♯) . 6)
1890 ((var Gflat var-Gflat) . 6)
1891; ((var G♭ var-G♭) . 6)
1892 ((var G var-G) . 7)
1893 ((var Gsharp var-Gsharp) . 8)
1894; ((var G♯ var-G♯) . 8)
1895 ((var A var-A) . 9)
1896 ((var Asharp var-Asharp) . 10)
1897; ((var A♯ var-A♯) . 10)
1898 ((var Bflat var-Bflat) . 10)
1899; ((var B♭ var-B♭) . 10)
1900 ((var B var-B) . 11))
1901 "An alist of notes with their number of semitones above C.")
1902
1903(defun math-freqp (freq)
1904 "Non-nil if FREQ is a positive number times the unit Hz.
1905If non-nil, return the coefficient of Hz."
1906 (let ((freqcoef (math-simplify-units
1907 (math-div freq '(var Hz var-Hz)))))
1908 (if (Math-posp freqcoef) freqcoef)))
1909
1910(defun math-midip (num)
1911 "Non-nil if NUM is a possible MIDI note number.
1912If non-nil, return NUM."
1913 (if (Math-numberp num) num))
1914
1915(defun math-spnp (spn)
1916 "Non-nil if NUM is a scientific pitch note (note + cents).
1917If non-nil, return a list consisting of the note and the cents coefficient."
1918 (let (note cents rnote rcents)
1919 (if (eq (car-safe spn) '+)
1920 (setq note (nth 1 spn)
1921 cents (nth 2 spn))
1922 (setq note spn
1923 cents nil))
1924 (cond
1925 ((and ;; NOTE is a note, CENTS is nil or cents.
1926 (eq (car-safe note) 'calcFunc-subscr)
1927 (assoc (nth 1 note) math-notes)
1928 (integerp (nth 2 note))
1929 (setq rnote note)
1930 (or
1931 (not cents)
1932 (Math-numberp (setq rcents
1933 (math-simplify
1934 (math-div cents '(var cents var-cents)))))))
1935 (list rnote rcents))
1936 ((and ;; CENTS is a note, NOTE is cents.
1937 (eq (car-safe cents) 'calcFunc-subscr)
1938 (assoc (nth 1 cents) math-notes)
1939 (integerp (nth 2 cents))
1940 (setq rnote cents)
1941 (or
1942 (not note)
1943 (Math-numberp (setq rcents
1944 (math-simplify
1945 (math-div note '(var cents var-cents)))))))
1946 (list rnote rcents)))))
1947
1948(defun math-freq-to-midi (freq)
1949 "Return the midi note number corresponding to FREQ Hz."
1950 (let ((midi (math-add
1951 69
1952 (math-mul
1953 12
1954 (calcFunc-log
1955 (math-div freq 440)
1956 2)))))
1957 (math-midi-round midi)))
1958
1959(defun math-spn-to-midi (spn)
1960 "Return the MIDI number corresponding to SPN."
1961 (let* ((note (cdr (assoc (nth 1 (car spn)) math-notes)))
1962 (octave (math-add (nth 2 (car spn)) 1))
1963 (cents (nth 1 spn))
1964 (midi (math-add
1965 (math-mul 12 octave)
1966 note)))
1967 (if cents
1968 (math-add midi (math-div cents 100))
1969 midi)))
1970
1971(defun math-midi-to-spn (midi)
1972 "Return the scientific pitch notation corresponding to midi number MIDI."
1973 (let (midin cents)
1974 (if (math-integerp midi)
1975 (setq midin midi
1976 cents nil)
1977 (setq midin (math-floor midi)
1978 cents (math-mul 100 (math-sub midi midin))))
1979 (let* ((nr ;; This should be (math-idivmod midin 12), but with
1980 ;; better behavior for negative midin.
1981 (if (Math-negp midin)
1982 (let ((dm (math-idivmod (math-neg midin) 12)))
1983 (if (= (cdr dm) 0)
1984 (cons (math-neg (car dm)) 0)
1985 (cons
1986 (math-sub (math-neg (car dm)) 1)
1987 (math-sub 12 (cdr dm)))))
1988 (math-idivmod midin 12)))
1989 (n (math-sub (car nr) 1))
1990 (note (car (rassoc (cdr nr) math-notes))))
1991 (if cents
1992 (list '+ (list 'calcFunc-subscr note n)
1993 (list '* cents '(var cents var-cents)))
1994 (list 'calcFunc-subscr note n)))))
1995
1996(defun math-freq-to-spn (freq)
1997 "Return the scientific pitch notation corresponding to FREQ Hz."
1998 (math-with-extra-prec 3
1999 (math-midi-to-spn (math-freq-to-midi freq))))
2000
2001(defun math-midi-to-freq (midi)
2002 "Return the frequency of the note with midi number MIDI."
2003 (list '*
2004 (math-mul
2005 440
2006 (math-pow
2007 2
2008 (math-div
2009 (math-sub
2010 midi
2011 69)
2012 12)))
2013 '(var Hz var-Hz)))
2014
2015(defun math-spn-to-freq (spn)
2016 "Return the frequency of the note with scientific pitch notation SPN."
2017 (math-midi-to-freq (math-spn-to-midi spn)))
2018
2019(defun calcFunc-spn (expr)
2020 "Return EXPR written as scientific pitch notation + cents."
2021 ;; Get the coeffecient of Hz
2022 (let (note)
2023 (cond
2024 ((setq note (math-freqp expr))
2025 (math-freq-to-spn note))
2026 ((setq note (math-midip expr))
2027 (math-midi-to-spn note))
2028 ((math-spnp expr)
2029 expr)
2030 (t
2031 (math-reject-arg expr "*Improper expression")))))
2032
2033(defun calcFunc-midi (expr)
2034 "Return EXPR written as a MIDI number."
2035 (let (note)
2036 (cond
2037 ((setq note (math-freqp expr))
2038 (math-freq-to-midi note))
2039 ((setq note (math-spnp expr))
2040 (math-spn-to-midi note))
2041 ((math-midip expr)
2042 expr)
2043 (t
2044 (math-reject-arg expr "*Improper expression")))))
2045
2046(defun calcFunc-freq (expr)
2047 "Return the frequency corresponding to EXPR."
2048 (let (note)
2049 (cond
2050 ((setq note (math-midip expr))
2051 (math-midi-to-freq note))
2052 ((setq note (math-spnp expr))
2053 (math-spn-to-freq note))
2054 ((math-freqp expr)
2055 expr)
2056 (t
2057 (math-reject-arg expr "*Improper expression")))))
2058
2059(defun calc-freq (arg)
2060 "Return the frequency corresponding to the expression on the stack."
2061 (interactive "P")
2062 (calc-slow-wrapper
2063 (calc-unary-op "freq" 'calcFunc-freq arg)))
2064
2065(defun calc-midi (arg)
2066 "Return the MIDI number corresponding to the expression on the stack."
2067 (interactive "P")
2068 (calc-slow-wrapper
2069 (calc-unary-op "midi" 'calcFunc-midi arg)))
2070
2071(defun calc-spn (arg)
2072 "Return the scientific pitch notation corresponding to the expression on the stack."
2073 (interactive "P")
2074 (calc-slow-wrapper
2075 (calc-unary-op "spn" 'calcFunc-spn arg)))
2076
2077
1844(provide 'calc-units) 2078(provide 'calc-units)
1845 2079
1846;; Local variables: 2080;; Local variables:
diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el
index 5dfbc2d51f5..47ef3241b3e 100644
--- a/lisp/calc/calc-vec.el
+++ b/lisp/calc/calc-vec.el
@@ -759,12 +759,13 @@
759 (math-reject-arg n "*Index out of range"))))) 759 (math-reject-arg n "*Index out of range")))))
760 760
761(defun calcFunc-subscr (mat n &optional m) 761(defun calcFunc-subscr (mat n &optional m)
762 (setq mat (calcFunc-mrow mat n)) 762 (if (eq (car-safe mat) 'var) nil
763 (if m 763 (setq mat (calcFunc-mrow mat n))
764 (if (math-num-integerp n) 764 (if m
765 (calcFunc-mrow mat m) 765 (if (math-num-integerp n)
766 (calcFunc-mcol mat m)) 766 (calcFunc-mrow mat m)
767 mat)) 767 (calcFunc-mcol mat m))
768 mat)))
768 769
769;;; Get the Nth column of a matrix. 770;;; Get the Nth column of a matrix.
770(defun math-mat-col (mat n) 771(defun math-mat-col (mat n)
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 72ddddeb32d..f4d8983eb88 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -446,6 +446,11 @@ by displaying the sub-formula in `calc-selected-face'."
446 :group 'calc 446 :group 'calc
447 :type '(string)) 447 :type '(string))
448 448
449(defcustom calc-note-threshold "1"
450 "The number of cents that a frequency should be near a note
451to be identified as that note."
452 :type 'string
453 :group 'calc)
449 454
450(defface calc-nonselected-face 455(defface calc-nonselected-face
451 '((t :inherit shadow 456 '((t :inherit shadow
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index f2dfc3c51fe..63e7484e127 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -792,6 +792,20 @@ from the cursor position."
792(define-obsolete-function-alias 'list-yahrzeit-dates 792(define-obsolete-function-alias 'list-yahrzeit-dates
793 'calendar-hebrew-list-yahrzeits "23.1") 793 'calendar-hebrew-list-yahrzeits "23.1")
794 794
795(defun calendar-hebrew-birthday (date year)
796 "Absolute date of the anniversary of Hebrew birth DATE, in Hebrew YEAR."
797 (let ((b-day (calendar-extract-day date))
798 (b-month (calendar-extract-month date))
799 (b-year (calendar-extract-year date)))
800 ;; If it's Adar in a normal Hebrew year or Adar II in a Hebrew leap year...
801 (if (= b-month (calendar-hebrew-last-month-of-year b-year))
802 ;; ...then use the same day in last month of Hebrew year.
803 (calendar-hebrew-to-absolute
804 (list (calendar-hebrew-last-month-of-year year) b-day year))
805 ;; Else use the normal anniversary of the birth date,
806 ;; or the corresponding day in years without that date.
807 (+ (calendar-hebrew-to-absolute (list b-month 1 year)) b-day -1))))
808
795(defvar date) 809(defvar date)
796 810
797;; To be called from diary-list-sexp-entries, where DATE is bound. 811;; To be called from diary-list-sexp-entries, where DATE is bound.
@@ -800,6 +814,37 @@ from the cursor position."
800 "Hebrew calendar equivalent of date diary entry." 814 "Hebrew calendar equivalent of date diary entry."
801 (format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date))) 815 (format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date)))
802 816
817(defvar entry)
818(declare-function diary-ordinal-suffix "diary-lib" (n))
819
820;;;###diary-autoload
821(defun diary-hebrew-birthday (month day year &optional after-sunset)
822 "Hebrew birthday diary entry.
823Entry applies if date is birthdate (MONTH DAY YEAR), or the day before.
824The order of the input parameters changes according to
825`calendar-date-style' (e.g. to DAY MONTH YEAR in the European style).
826
827Assumes the associated diary entry is the name of the person.
828
829Although the date of birth is specified by the *civil* calendar,
830this function determines the proper Hebrew calendar birthday.
831If the optional argument AFTER-SUNSET is non-nil, this means the
832birth occurred after local sunset on the given civil date.
833In this case, the following civil date corresponds to the Hebrew birthday."
834 (let* ((h-date (calendar-hebrew-from-absolute
835 (+ (calendar-absolute-from-gregorian
836 (diary-make-date month day year))
837 (if after-sunset 1 0))))
838 (h-year (calendar-extract-year h-date)) ; birth-day
839 (d (calendar-absolute-from-gregorian date)) ; today
840 (h-yr (calendar-extract-year (calendar-hebrew-from-absolute d)))
841 (age (- h-yr h-year)) ; current H year - birth H-year
842 (b-date (calendar-hebrew-birthday h-date h-yr)))
843 (and (> age 0) (memq b-date (list d (1+ d)))
844 (format "%s's %d%s Hebrew birthday%s" entry age
845 (diary-ordinal-suffix age)
846 (if (= b-date d) "" " (evening)")))))
847
803;;;###diary-autoload 848;;;###diary-autoload
804(defun diary-hebrew-omer (&optional mark) 849(defun diary-hebrew-omer (&optional mark)
805 "Omer count diary entry. 850 "Omer count diary entry.
@@ -829,8 +874,6 @@ use when highlighting the day in the calendar."
829;;;###diary-autoload 874;;;###diary-autoload
830(define-obsolete-function-alias 'diary-omer 'diary-hebrew-omer "23.1") 875(define-obsolete-function-alias 'diary-omer 'diary-hebrew-omer "23.1")
831 876
832(defvar entry)
833
834(autoload 'diary-make-date "diary-lib") 877(autoload 'diary-make-date "diary-lib")
835 878
836(declare-function diary-ordinal-suffix "diary-lib" (n)) 879(declare-function diary-ordinal-suffix "diary-lib" (n))
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el
index 8a0fbd5cc37..5cdd1577a6e 100644
--- a/lisp/cedet/semantic/analyze.el
+++ b/lisp/cedet/semantic/analyze.el
@@ -100,7 +100,7 @@ Usually bound to the dimension of a single symbol or command.")
100 :type list 100 :type list
101 :documentation "List of tags defining local text. 101 :documentation "List of tags defining local text.
102This can be nil, or a list where the last element can be a string 102This can be nil, or a list where the last element can be a string
103representing text that may be incomplete. Preceeding elements 103representing text that may be incomplete. Preceding elements
104must be semantic tags representing variables or functions 104must be semantic tags representing variables or functions
105called in a dereference sequence.") 105called in a dereference sequence.")
106 (prefixclass :initarg :prefixclass 106 (prefixclass :initarg :prefixclass
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index 31e92724a00..47cb722e005 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -1264,7 +1264,7 @@ inserted into the current context.")
1264;; generated by a collector. This format is in semanticdb search 1264;; generated by a collector. This format is in semanticdb search
1265;; form. This vaguely standard form is a bit challenging to navigate 1265;; form. This vaguely standard form is a bit challenging to navigate
1266;; because the tags do not contain buffer info, but the file associated 1266;; because the tags do not contain buffer info, but the file associated
1267;; with the tags preceed the tag in the list. 1267;; with the tags precedes the tag in the list.
1268;; 1268;;
1269;; Basic displayors don't care, and can strip the results. 1269;; Basic displayors don't care, and can strip the results.
1270;; Advanced highlighting displayors need to know when they need 1270;; Advanced highlighting displayors need to know when they need
diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el
index ef206fd3122..7f7e82a95c2 100644
--- a/lisp/cedet/semantic/edit.el
+++ b/lisp/cedet/semantic/edit.el
@@ -426,7 +426,7 @@ See `semantic-edits-change-leaf-tag' for details on parents."
426 ;; confirmed as the lineage of `overlapped-tags' 426 ;; confirmed as the lineage of `overlapped-tags'
427 ;; which must have a value by now. 427 ;; which must have a value by now.
428 428
429 ;; Loop over the search list to find the preceeding CDR. 429 ;; Loop over the search list to find the preceding CDR.
430 ;; Fortunatly, (car overlapped-tags) happens to be 430 ;; Fortunatly, (car overlapped-tags) happens to be
431 ;; the first tag positionally. 431 ;; the first tag positionally.
432 (let ((tokstart (semantic-tag-start (car overlapped-tags)))) 432 (let ((tokstart (semantic-tag-start (car overlapped-tags))))
@@ -874,7 +874,7 @@ pre-positioned to a convenient location."
874 )) 874 ))
875 (message "To Remove Middle Tag: (%s)" 875 (message "To Remove Middle Tag: (%s)"
876 (semantic-format-tag-name first))) 876 (semantic-format-tag-name first)))
877 ;; Find in the cache the preceeding tag 877 ;; Find in the cache the preceding tag
878 (while (and cachestart (not (eq first (car (cdr cachestart))))) 878 (while (and cachestart (not (eq first (car (cdr cachestart)))))
879 (setq cachestart (cdr cachestart))) 879 (setq cachestart (cdr cachestart)))
880 ;; Find the last tag 880 ;; Find the last tag
diff --git a/lisp/cedet/semantic/format.el b/lisp/cedet/semantic/format.el
index ecd03ccec73..fa6e7517624 100644
--- a/lisp/cedet/semantic/format.el
+++ b/lisp/cedet/semantic/format.el
@@ -296,7 +296,7 @@ local definitions."
296 296
297(define-overloadable-function semantic-format-tag-canonical-name (tag &optional parent color) 297(define-overloadable-function semantic-format-tag-canonical-name (tag &optional parent color)
298 "Return a canonical name for TAG. 298 "Return a canonical name for TAG.
299A canonical name includes the names of any parents or namespaces preceeding 299A canonical name includes the names of any parents or namespaces preceding
300the tag. 300the tag.
301Optional argument PARENT is the parent type if TAG is a detail. 301Optional argument PARENT is the parent type if TAG is a detail.
302Optional argument COLOR means highlight the prototype with font-lock colors.") 302Optional argument COLOR means highlight the prototype with font-lock colors.")
diff --git a/lisp/cedet/semantic/java.el b/lisp/cedet/semantic/java.el
index 4489d0ffae5..71a205386db 100644
--- a/lisp/cedet/semantic/java.el
+++ b/lisp/cedet/semantic/java.el
@@ -256,7 +256,7 @@ Optional argument COLOR indicates that color should be mixed in."
256(define-mode-local-override semantic-documentation-for-tag 256(define-mode-local-override semantic-documentation-for-tag
257 java-mode (&optional tag nosnarf) 257 java-mode (&optional tag nosnarf)
258 "Find documentation from TAG and return it as a clean string. 258 "Find documentation from TAG and return it as a clean string.
259Java have documentation set in a comment preceeding TAG's definition. 259Java has documentation set in a comment preceding TAG's definition.
260Attempt to strip out comment syntactic sugar, unless optional argument 260Attempt to strip out comment syntactic sugar, unless optional argument
261NOSNARF is non-nil. 261NOSNARF is non-nil.
262If NOSNARF is 'lex, then return the semantic lex token." 262If NOSNARF is 'lex, then return the semantic lex token."
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index d43d2607c9a..88821652784 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -920,6 +920,8 @@ it were the arg to `interactive' (which see) to interactively read the value.
920 920
921If the variable has a `custom-type' property, it must be a widget and the 921If the variable has a `custom-type' property, it must be a widget and the
922`:prompt-value' property of that widget will be used for reading the value. 922`:prompt-value' property of that widget will be used for reading the value.
923If the variable also has a `custom-get' property, that is used for finding
924the current value of the variable, otherwise `symbol-value' is used.
923 925
924If optional COMMENT argument is non-nil, also prompt for a comment and return 926If optional COMMENT argument is non-nil, also prompt for a comment and return
925it as the third element in the list." 927it as the third element in the list."
@@ -941,7 +943,9 @@ it as the third element in the list."
941 (widget-prompt-value type 943 (widget-prompt-value type
942 prompt 944 prompt
943 (if (boundp var) 945 (if (boundp var)
944 (symbol-value var)) 946 (funcall
947 (or (get var 'custom-get) 'symbol-value)
948 var))
945 (not (boundp var)))) 949 (not (boundp var))))
946 (t 950 (t
947 (eval-minibuffer prompt)))))) 951 (eval-minibuffer prompt))))))
@@ -1599,7 +1603,7 @@ Otherwise use brackets."
1599 'editable-field 1603 'editable-field
1600 :size 40 :help-echo echo 1604 :size 40 :help-echo echo
1601 :action `(lambda (widget &optional event) 1605 :action `(lambda (widget &optional event)
1602 (customize-apropos (widget-value widget)))))) 1606 (customize-apropos (split-string (widget-value widget)))))))
1603 (widget-insert " ") 1607 (widget-insert " ")
1604 (widget-create-child-and-convert 1608 (widget-create-child-and-convert
1605 search-widget 'push-button 1609 search-widget 'push-button
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 4ca4cec38ff..fd5baaf020f 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -611,7 +611,8 @@ Furthermore, it clears the variables listed in `desktop-globals-to-clear'."
611 (delete-other-windows)) 611 (delete-other-windows))
612 612
613;; ---------------------------------------------------------------------------- 613;; ----------------------------------------------------------------------------
614(add-hook 'kill-emacs-hook 'desktop-kill) 614(unless noninteractive
615 (add-hook 'kill-emacs-hook 'desktop-kill))
615 616
616(defun desktop-kill () 617(defun desktop-kill ()
617 "If `desktop-save-mode' is non-nil, do what `desktop-save' says to do. 618 "If `desktop-save-mode' is non-nil, do what `desktop-save' says to do.
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 986c9edfd2d..c533c81be0e 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1025,9 +1025,9 @@ See Info node `(emacs)Subdir switches' for more details."
1025 ;; Keeps any marks that may be present in column one (doing this 1025 ;; Keeps any marks that may be present in column one (doing this
1026 ;; here is faster than with dired-add-entry's optional arg). 1026 ;; here is faster than with dired-add-entry's optional arg).
1027 ;; Does not update other dired buffers. Use dired-relist-entry for that. 1027 ;; Does not update other dired buffers. Use dired-relist-entry for that.
1028 (let ((char (following-char)) 1028 (let* ((opoint (line-beginning-position))
1029 (opoint (line-beginning-position)) 1029 (char (char-after opoint))
1030 (buffer-read-only)) 1030 (buffer-read-only))
1031 (delete-region opoint (progn (forward-line 1) (point))) 1031 (delete-region opoint (progn (forward-line 1) (point)))
1032 (if file 1032 (if file
1033 (progn 1033 (progn
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 8b1dbb1ef83..a5063bb77dd 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -145,6 +145,8 @@ See Info node `(dired-x) Omitting Variables' for more information."
145 (let ((dired-omit-size-limit nil)) (dired-omit-expunge)) 145 (let ((dired-omit-size-limit nil)) (dired-omit-expunge))
146 (revert-buffer))) 146 (revert-buffer)))
147 147
148(put 'dired-omit-mode 'safe-local-variable 'booleanp)
149
148;; For backward compatibility 150;; For backward compatibility
149(define-obsolete-variable-alias 'dired-omit-files-p 'dired-omit-mode "22.1") 151(define-obsolete-variable-alias 'dired-omit-files-p 'dired-omit-mode "22.1")
150 152
@@ -185,15 +187,19 @@ If nil, there is no maximum size."
185 187
186(defcustom dired-enable-local-variables t 188(defcustom dired-enable-local-variables t
187 "Control use of local-variables lists in Dired. 189 "Control use of local-variables lists in Dired.
188The value can be t, nil or something else.
189A value of t means local-variables lists are obeyed;
190nil means they are ignored; anything else means query.
191
192This temporarily overrides the value of `enable-local-variables' when 190This temporarily overrides the value of `enable-local-variables' when
193listing a directory. See also `dired-local-variables-file'." 191listing a directory. See also `dired-local-variables-file'."
194 :type 'boolean 192 :risky t
193 :type '(choice (const :tag "Query Unsafe" t)
194 (const :tag "Safe Only" :safe)
195 (const :tag "Do all" :all)
196 (const :tag "Ignore" nil)
197 (other :tag "Query" other))
195 :group 'dired-x) 198 :group 'dired-x)
196 199
200(make-obsolete-variable 'dired-enable-local-variables
201 "use a standard `dir-locals-file' instead." "24.1")
202
197(defcustom dired-guess-shell-gnutar 203(defcustom dired-guess-shell-gnutar
198 (catch 'found 204 (catch 'found
199 (dolist (exe '("tar" "gtar")) 205 (dolist (exe '("tar" "gtar"))
@@ -430,6 +436,7 @@ move to its line in dired."
430 (dired-omit-mode) 436 (dired-omit-mode)
431 (dired-goto-file file))))))) 437 (dired-goto-file file)))))))
432 438
439;;;###autoload
433(defun dired-jump-other-window (&optional file-name) 440(defun dired-jump-other-window (&optional file-name)
434 "Like \\[dired-jump] (`dired-jump') but in other window." 441 "Like \\[dired-jump] (`dired-jump') but in other window."
435 (interactive 442 (interactive
@@ -698,15 +705,26 @@ Also useful for `auto-mode-alist' like this:
698 (dired-current-directory) 705 (dired-current-directory)
699 default-directory))) 706 default-directory)))
700 "Alist of major modes and their opinion on `default-directory'. 707 "Alist of major modes and their opinion on `default-directory'.
701This is given as a Lisp expression to evaluate. A resulting value of 708Each element has the form (MAJOR . EXPRESSION).
702nil is ignored in favor of `default-directory'.") 709The function `dired-default-directory' evaluates EXPRESSION to
710determine a default directory.")
711
712(put 'dired-default-directory-alist 'risky-local-variable t) ; gets eval'd
713(make-obsolete-variable 'dired-default-directory-alist
714 "this feature is due to be removed." "24.1")
703 715
704(defun dired-default-directory () 716(defun dired-default-directory ()
705 "Usage like variable `default-directory'. 717 "Return the `dired-default-directory-alist' entry for the current major-mode.
706Knows about the special cases in variable `dired-default-directory-alist'." 718If none, return `default-directory'."
707 (or (eval (cdr (assq major-mode dired-default-directory-alist))) 719 (or (eval (cdr (assq major-mode dired-default-directory-alist)))
708 default-directory)) 720 default-directory))
709 721
722;; It looks like this was intended to be something of a "general" feature,
723;; but it only ever seems to have been used in dired-smart-shell-command,
724;; and does not seem worth keeping around (?).
725(make-obsolete 'dired-default-directory
726 "this feature is due to be removed." "24.1")
727
710(defun dired-smart-shell-command (command &optional output-buffer error-buffer) 728(defun dired-smart-shell-command (command &optional output-buffer error-buffer)
711 "Like function `shell-command', but in the current Virtual Dired directory." 729 "Like function `shell-command', but in the current Virtual Dired directory."
712 (interactive 730 (interactive
@@ -717,32 +735,33 @@ Knows about the special cases in variable `dired-default-directory-alist'."
717 ((eq major-mode 'dired-mode) (dired-get-filename t t)))) 735 ((eq major-mode 'dired-mode) (dired-get-filename t t))))
718 current-prefix-arg 736 current-prefix-arg
719 shell-command-default-error-buffer)) 737 shell-command-default-error-buffer))
720 (let ((default-directory (dired-default-directory))) 738 (let ((default-directory (or (and (eq major-mode 'dired-mode)
739 (dired-current-directory))
740 default-directory)))
721 (shell-command command output-buffer error-buffer))) 741 (shell-command command output-buffer error-buffer)))
722 742
723 743
724;;; LOCAL VARIABLES FOR DIRED BUFFERS. 744;;; LOCAL VARIABLES FOR DIRED BUFFERS.
725 745
726;; Brief Description: 746;; Brief Description (This feature is obsolete as of Emacs 24.1)
727;;; 747;;
728;; * `dired-extra-startup' is part of the `dired-mode-hook'. 748;; * `dired-extra-startup' is part of the `dired-mode-hook'.
729;;; 749;;
730;; * `dired-extra-startup' calls `dired-hack-local-variables' 750;; * `dired-extra-startup' calls `dired-hack-local-variables'
731;;; 751;;
732;; * `dired-hack-local-variables' checks the value of 752;; * `dired-hack-local-variables' checks the value of
733;;; `dired-local-variables-file' 753;; `dired-local-variables-file'
734;;; 754;;
735;; * Check if `dired-local-variables-file' is a non-nil string and is a 755;; * Check if `dired-local-variables-file' is a non-nil string and is a
736;;; filename found in the directory of the Dired Buffer being created. 756;; filename found in the directory of the Dired Buffer being created.
737;;; 757;;
738;; * If `dired-local-variables-file' satisfies the above, then temporarily 758;; * If `dired-local-variables-file' satisfies the above, then temporarily
739;;; include it in the Dired Buffer at the bottom. 759;; include it in the Dired Buffer at the bottom.
740;;; 760;;
741;; * Set `enable-local-variables' temporarily to the user variable 761;; * Set `enable-local-variables' temporarily to the user variable
742;;; `dired-enable-local-variables' and run `hack-local-variables' on the 762;; `dired-enable-local-variables' and run `hack-local-variables' on the
743;;; Dired Buffer. 763;; Dired Buffer.
744 764
745;; FIXME do standard dir-locals obsolete this?
746(defcustom dired-local-variables-file (convert-standard-filename ".dired") 765(defcustom dired-local-variables-file (convert-standard-filename ".dired")
747 "Filename, as string, containing local dired buffer variables to be hacked. 766 "Filename, as string, containing local dired buffer variables to be hacked.
748If this file found in current directory, then it will be inserted into dired 767If this file found in current directory, then it will be inserted into dired
@@ -752,6 +771,8 @@ See also `dired-enable-local-variables'."
752 :type 'file 771 :type 'file
753 :group 'dired) 772 :group 'dired)
754 773
774(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1")
775
755(defun dired-hack-local-variables () 776(defun dired-hack-local-variables ()
756 "Evaluate local variables in `dired-local-variables-file' for dired buffer." 777 "Evaluate local variables in `dired-local-variables-file' for dired buffer."
757 (and (stringp dired-local-variables-file) 778 (and (stringp dired-local-variables-file)
@@ -767,29 +788,42 @@ See also `dired-enable-local-variables'."
767 (insert "\^L\n") 788 (insert "\^L\n")
768 (insert-file-contents dired-local-variables-file)) 789 (insert-file-contents dired-local-variables-file))
769 ;; Hack 'em. 790 ;; Hack 'em.
770 (let ((buffer-file-name dired-local-variables-file)) 791 (unwind-protect
771 (hack-local-variables)) 792 (let ((buffer-file-name dired-local-variables-file))
793 (hack-local-variables))
794 ;; Delete this stuff: `eobp' is used to find last subdir by dired.el.
795 (delete-region opoint (point-max)))
772 ;; Make sure that the modeline shows the proper information. 796 ;; Make sure that the modeline shows the proper information.
773 (dired-sort-set-modeline) 797 (dired-sort-set-modeline))))
774 ;; Delete this stuff: `eobp' is used to find last subdir by dired.el.
775 (delete-region opoint (point-max)))))
776 798
799(make-obsolete 'dired-hack-local-variables
800 'hack-dir-local-variables-non-file-buffer "24.1")
801
802;; Does not seem worth a dedicated command.
803;; See the more general features in files-x.el.
777(defun dired-omit-here-always () 804(defun dired-omit-here-always ()
778 "Create `dired-local-variables-file' for omitting and reverts directory. 805 "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'.
779Sets `dired-omit-mode' to t in a local variables file that is readable by 806If in a Dired buffer, reverts it."
780dired."
781 (interactive) 807 (interactive)
782 (if (file-exists-p dired-local-variables-file) 808 (if (file-exists-p dired-local-variables-file)
783 (message "File `./%s' already exists." dired-local-variables-file) 809 (error "Old-style dired-local-variables-file `./%s' found;
784 ;; Create `dired-local-variables-file'. 810replace it with a dir-locals-file `./%s'"
785 (with-current-buffer (get-buffer-create " *dot-dired*") 811 dired-local-variables-file
786 (erase-buffer) 812 dir-locals-file))
787 (insert "Local Variables:\ndired-omit-mode: t\nEnd:\n") 813 (if (file-exists-p dir-locals-file)
788 (write-file dired-local-variables-file) 814 (message "File `./%s' already exists." dir-locals-file)
789 (kill-buffer)) 815 (with-temp-buffer
816 (insert "\
817\((dired-mode . ((subdirs . nil)
818 (dired-omit-mode . t))))\n")
819 (write-file dir-locals-file))
790 ;; Run extra-hooks and revert directory. 820 ;; Run extra-hooks and revert directory.
791 (dired-extra-startup) 821 (when (derived-mode-p 'dired-mode)
792 (dired-revert))) 822 (hack-dir-local-variables-non-file-buffer)
823 (dired-extra-startup)
824 (dired-revert))))
825
826(make-obsolete 'dired-omit-here-always 'add-dir-local-variable "24.1")
793 827
794 828
795;;; GUESS SHELL COMMAND. 829;;; GUESS SHELL COMMAND.
@@ -826,11 +860,11 @@ dired."
826;; NOTE: Use `gunzip -c' instead of `zcat' on `.gz' files. Some do not 860;; NOTE: Use `gunzip -c' instead of `zcat' on `.gz' files. Some do not
827;; install GNU zip's version of zcat. 861;; install GNU zip's version of zcat.
828 862
829(declare-function Man-support-local-filenames "man" ()) 863(autoload 'Man-support-local-filenames "man")
830 864
831(defvar dired-guess-shell-alist-default 865(defvar dired-guess-shell-alist-default
832 (list 866 (list
833 (list "\\.tar$" 867 (list "\\.tar\\'"
834 '(if dired-guess-shell-gnutar 868 '(if dired-guess-shell-gnutar
835 (concat dired-guess-shell-gnutar " xvf") 869 (concat dired-guess-shell-gnutar " xvf")
836 "tar xvf") 870 "tar xvf")
@@ -848,7 +882,7 @@ dired."
848 882
849 ;; REGEXPS for compressed archives must come before the .Z rule to 883 ;; REGEXPS for compressed archives must come before the .Z rule to
850 ;; be recognized: 884 ;; be recognized:
851 (list "\\.tar\\.Z$" 885 (list "\\.tar\\.Z\\'"
852 ;; Untar it. 886 ;; Untar it.
853 '(if dired-guess-shell-gnutar 887 '(if dired-guess-shell-gnutar
854 (concat dired-guess-shell-gnutar " zxvf") 888 (concat dired-guess-shell-gnutar " zxvf")
@@ -858,7 +892,7 @@ dired."
858 " " dired-guess-shell-znew-switches)) 892 " " dired-guess-shell-znew-switches))
859 893
860 ;; gzip'ed archives 894 ;; gzip'ed archives
861 (list "\\.t\\(ar\\.\\)?gz$" 895 (list "\\.t\\(ar\\.\\)?gz\\'"
862 '(if dired-guess-shell-gnutar 896 '(if dired-guess-shell-gnutar
863 (concat dired-guess-shell-gnutar " zxvf") 897 (concat dired-guess-shell-gnutar " zxvf")
864 (concat "gunzip -qc * | tar xvf -")) 898 (concat "gunzip -qc * | tar xvf -"))
@@ -878,7 +912,7 @@ dired."
878 (concat "gunzip -qc * | tar tvf -"))) 912 (concat "gunzip -qc * | tar tvf -")))
879 913
880 ;; bzip2'ed archives 914 ;; bzip2'ed archives
881 (list "\\.t\\(ar\\.bz2\\|bz\\)$" 915 (list "\\.t\\(ar\\.bz2\\|bz\\)\\'"
882 "bunzip2 -c * | tar xvf -" 916 "bunzip2 -c * | tar xvf -"
883 ;; Extract files into a separate subdirectory 917 ;; Extract files into a separate subdirectory
884 '(concat "mkdir " (file-name-sans-extension file) 918 '(concat "mkdir " (file-name-sans-extension file)
@@ -888,7 +922,7 @@ dired."
888 "bunzip2") 922 "bunzip2")
889 923
890 ;; xz'ed archives 924 ;; xz'ed archives
891 (list "\\.t\\(ar\\.\\)?xz$" 925 (list "\\.t\\(ar\\.\\)?xz\\'"
892 "unxz -c * | tar xvf -" 926 "unxz -c * | tar xvf -"
893 ;; Extract files into a separate subdirectory 927 ;; Extract files into a separate subdirectory
894 '(concat "mkdir " (file-name-sans-extension file) 928 '(concat "mkdir " (file-name-sans-extension file)
@@ -897,94 +931,103 @@ dired."
897 ;; Optional decompression. 931 ;; Optional decompression.
898 "unxz") 932 "unxz")
899 933
900 '("\\.shar\\.Z$" "zcat * | unshar") 934 '("\\.shar\\.Z\\'" "zcat * | unshar")
901 '("\\.shar\\.g?z$" "gunzip -qc * | unshar") 935 '("\\.shar\\.g?z\\'" "gunzip -qc * | unshar")
902 936
903 '("\\.e?ps$" "ghostview" "xloadimage" "lpr") 937 '("\\.e?ps\\'" "ghostview" "xloadimage" "lpr")
904 (list "\\.e?ps\\.g?z$" "gunzip -qc * | ghostview -" 938 (list "\\.e?ps\\.g?z\\'" "gunzip -qc * | ghostview -"
905 ;; Optional decompression. 939 ;; Optional decompression.
906 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) 940 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
907 (list "\\.e?ps\\.Z$" "zcat * | ghostview -" 941 (list "\\.e?ps\\.Z\\'" "zcat * | ghostview -"
908 ;; Optional conversion to gzip format. 942 ;; Optional conversion to gzip format.
909 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") 943 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
910 " " dired-guess-shell-znew-switches)) 944 " " dired-guess-shell-znew-switches))
911 945
912 '("\\.patch$" "cat * | patch") 946 '("\\.patch\\'" "cat * | patch")
913 (list "\\.patch\\.g?z$" "gunzip -qc * | patch" 947 (list "\\.patch\\.g?z\\'" "gunzip -qc * | patch"
914 ;; Optional decompression. 948 ;; Optional decompression.
915 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) 949 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
916 (list "\\.patch\\.Z$" "zcat * | patch" 950 (list "\\.patch\\.Z\\'" "zcat * | patch"
917 ;; Optional conversion to gzip format. 951 ;; Optional conversion to gzip format.
918 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") 952 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
919 " " dired-guess-shell-znew-switches)) 953 " " dired-guess-shell-znew-switches))
920 954
921 ;; The following four extensions are useful with dired-man ("N" key) 955 ;; The following four extensions are useful with dired-man ("N" key)
922 (list "\\.\\(?:[0-9]\\|man\\)$" '(progn (require 'man) 956 ;; FIXME "man ./" does not work with dired-do-shell-command,
923 (if (Man-support-local-filenames) 957 ;; because there seems to be no way for us to modify the filename,
924 "man -l" 958 ;; only the command. Hmph. `dired-man' works though.
925 "cat * | tbl | nroff -man -h"))) 959 (list "\\.\\(?:[0-9]\\|man\\)\\'" '(let ((loc (Man-support-local-filenames)))
926 (list "\\.\\(?:[0-9]\\|man\\)\\.g?z$" '(progn (require 'man) 960 (cond ((eq loc 'man-db) "man -l")
927 (if (Man-support-local-filenames) 961 ((eq loc 'man) "man ./")
928 "man -l" 962 (t
929 "gunzip -qc * | tbl | nroff -man -h")) 963 "cat * | tbl | nroff -man -h"))))
964 (list "\\.\\(?:[0-9]\\|man\\)\\.g?z\\'"
965 '(let ((loc (Man-support-local-filenames)))
966 (cond ((eq loc 'man-db)
967 "man -l")
968 ((eq loc 'man)
969 "man ./")
970 (t "gunzip -qc * | tbl | nroff -man -h")))
930 ;; Optional decompression. 971 ;; Optional decompression.
931 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) 972 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
932 (list "\\.[0-9]\\.Z$" '(progn (require 'man) 973 (list "\\.[0-9]\\.Z\\'" '(let ((loc (Man-support-local-filenames)))
933 (if (Man-support-local-filenames) 974 (cond ((eq loc 'man-db) "man -l")
934 "man -l" 975 ((eq loc 'man) "man ./")
935 "zcat * | tbl | nroff -man -h")) 976 (t "zcat * | tbl | nroff -man -h")))
936 ;; Optional conversion to gzip format. 977 ;; Optional conversion to gzip format.
937 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") 978 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
938 " " dired-guess-shell-znew-switches)) 979 " " dired-guess-shell-znew-switches))
939 '("\\.pod$" "perldoc" "pod2man * | nroff -man") 980 '("\\.pod\\'" "perldoc" "pod2man * | nroff -man")
940 981
941 '("\\.dvi$" "xdvi" "dvips") ; preview and printing 982 '("\\.dvi\\'" "xdvi" "dvips") ; preview and printing
942 '("\\.au$" "play") ; play Sun audiofiles 983 '("\\.au\\'" "play") ; play Sun audiofiles
943 '("\\.mpe?g$\\|\\.avi$" "xine -p") 984 '("\\.mpe?g\\'\\|\\.avi\\'" "xine -p")
944 '("\\.ogg$" "ogg123") 985 '("\\.ogg\\'" "ogg123")
945 '("\\.mp3$" "mpg123") 986 '("\\.mp3\\'" "mpg123")
946 '("\\.wav$" "play") 987 '("\\.wav\\'" "play")
947 '("\\.uu$" "uudecode") ; for uudecoded files 988 '("\\.uu\\'" "uudecode") ; for uudecoded files
948 '("\\.hqx$" "mcvert") 989 '("\\.hqx\\'" "mcvert")
949 '("\\.sh$" "sh") ; execute shell scripts 990 '("\\.sh\\'" "sh") ; execute shell scripts
950 '("\\.xbm$" "bitmap") ; view X11 bitmaps 991 '("\\.xbm\\'" "bitmap") ; view X11 bitmaps
951 '("\\.gp$" "gnuplot") 992 '("\\.gp\\'" "gnuplot")
952 '("\\.p[bgpn]m$" "xloadimage") 993 '("\\.p[bgpn]m\\'" "xloadimage")
953 '("\\.gif$" "xloadimage") ; view gif pictures 994 '("\\.gif\\'" "xloadimage") ; view gif pictures
954 '("\\.tif$" "xloadimage") 995 '("\\.tif\\'" "xloadimage")
955 '("\\.png$" "display") ; xloadimage 4.1 doesn't grok PNG 996 '("\\.png\\'" "display") ; xloadimage 4.1 doesn't grok PNG
956 '("\\.jpe?g$" "xloadimage") 997 '("\\.jpe?g\\'" "xloadimage")
957 '("\\.fig$" "xfig") ; edit fig pictures 998 '("\\.fig\\'" "xfig") ; edit fig pictures
958 '("\\.out$" "xgraph") ; for plotting purposes. 999 '("\\.out\\'" "xgraph") ; for plotting purposes.
959 '("\\.tex$" "latex" "tex") 1000 '("\\.tex\\'" "latex" "tex")
960 '("\\.texi\\(nfo\\)?$" "makeinfo" "texi2dvi") 1001 '("\\.texi\\(nfo\\)?\\'" "makeinfo" "texi2dvi")
961 '("\\.pdf$" "xpdf") 1002 '("\\.pdf\\'" "xpdf")
962 '("\\.doc$" "antiword" "strings") 1003 '("\\.doc\\'" "antiword" "strings")
963 '("\\.rpm$" "rpm -qilp" "rpm -ivh") 1004 '("\\.rpm\\'" "rpm -qilp" "rpm -ivh")
964 '("\\.dia$" "dia") 1005 '("\\.dia\\'" "dia")
965 '("\\.mgp$" "mgp") 1006 '("\\.mgp\\'" "mgp")
966 1007
967 ;; Some other popular archivers. 1008 ;; Some other popular archivers.
968 (list "\\.zip$" "unzip" "unzip -l" 1009 (list "\\.zip\\'" "unzip" "unzip -l"
969 ;; Extract files into a separate subdirectory 1010 ;; Extract files into a separate subdirectory
970 '(concat "unzip" (if dired-guess-shell-gzip-quiet " -q") 1011 '(concat "unzip" (if dired-guess-shell-gzip-quiet " -q")
971 " -d " (file-name-sans-extension file))) 1012 " -d " (file-name-sans-extension file)))
972 '("\\.zoo$" "zoo x//") 1013 '("\\.zoo\\'" "zoo x//")
973 '("\\.lzh$" "lharc x") 1014 '("\\.lzh\\'" "lharc x")
974 '("\\.arc$" "arc x") 1015 '("\\.arc\\'" "arc x")
975 '("\\.shar$" "unshar") 1016 '("\\.shar\\'" "unshar")
1017 '("\\.rar\\'" "unrar x")
1018 '("\\.7z\\'" "7z x")
976 1019
977 ;; Compression. 1020 ;; Compression.
978 (list "\\.g?z$" '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) 1021 (list "\\.g?z\\'" '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
979 (list "\\.dz$" "dictunzip") 1022 (list "\\.dz\\'" "dictunzip")
980 (list "\\.bz2$" "bunzip2") 1023 (list "\\.bz2\\'" "bunzip2")
981 (list "\\.xz$" "unxz") 1024 (list "\\.xz\\'" "unxz")
982 (list "\\.Z$" "uncompress" 1025 (list "\\.Z\\'" "uncompress"
983 ;; Optional conversion to gzip format. 1026 ;; Optional conversion to gzip format.
984 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") 1027 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
985 " " dired-guess-shell-znew-switches)) 1028 " " dired-guess-shell-znew-switches))
986 1029
987 '("\\.sign?$" "gpg --verify")) 1030 '("\\.sign?\\'" "gpg --verify"))
988 1031
989 "Default alist used for shell command guessing. 1032 "Default alist used for shell command guessing.
990See `dired-guess-shell-alist-user'.") 1033See `dired-guess-shell-alist-user'.")
diff --git a/lisp/dired.el b/lisp/dired.el
index af99d4c7413..c8343ba7561 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -249,9 +249,19 @@ Local to each dired buffer. May be a list, in which case the car is the
249directory name and the cdr is the list of files to mention. 249directory name and the cdr is the list of files to mention.
250The directory name must be absolute, but need not be fully expanded.") 250The directory name must be absolute, but need not be fully expanded.")
251 251
252;; Beware of "-l;reboot" etc. See bug#3230.
253(defun dired-safe-switches-p (switches)
254 "Return non-nil if string SWITCHES does not look risky for dired."
255 (or (not switches)
256 (and (stringp switches)
257 (< (length switches) 100) ; arbitrary
258 (string-match "\\` *-[- [:alnum:]]+\\'" switches))))
259
252(defvar dired-actual-switches nil 260(defvar dired-actual-switches nil
253 "The value of `dired-listing-switches' used to make this buffer's text.") 261 "The value of `dired-listing-switches' used to make this buffer's text.")
254 262
263(put 'dired-actual-switches 'safe-local-variable 'dired-safe-switches-p)
264
255(defvar dired-re-inode-size "[0-9 \t]*" 265(defvar dired-re-inode-size "[0-9 \t]*"
256 "Regexp for optional initial inode and file size as made by `ls -i -s'.") 266 "Regexp for optional initial inode and file size as made by `ls -i -s'.")
257 267
@@ -601,9 +611,12 @@ Don't use that together with FILTER."
601 (if current-prefix-arg 611 (if current-prefix-arg
602 (read-string "Dired listing switches: " 612 (read-string "Dired listing switches: "
603 dired-listing-switches)) 613 dired-listing-switches))
604 ;; If a dialog is about to be used, call read-directory-name so 614 ;; If a dialog is used, call `read-directory-name' so the
605 ;; the dialog code knows we want directories. Some dialogs can 615 ;; dialog code knows we want directories. Some dialogs
606 ;; only select directories or files when popped up, not both. 616 ;; can only select directories or files when popped up,
617 ;; not both. If no dialog is used, call `read-file-name'
618 ;; because the user may want completion of file names for
619 ;; use in a wildcard pattern.
607 (if (next-read-file-uses-dialog-p) 620 (if (next-read-file-uses-dialog-p)
608 (read-directory-name (format "Dired %s(directory): " str) 621 (read-directory-name (format "Dired %s(directory): " str)
609 nil default-directory nil) 622 nil default-directory nil)
@@ -1860,6 +1873,7 @@ Keybindings:
1860 (set (make-local-variable 'desktop-save-buffer) 1873 (set (make-local-variable 'desktop-save-buffer)
1861 'dired-desktop-buffer-misc-data) 1874 'dired-desktop-buffer-misc-data)
1862 (setq dired-switches-alist nil) 1875 (setq dired-switches-alist nil)
1876 (hack-dir-local-variables-non-file-buffer) ; before sorting
1863 (dired-sort-other dired-actual-switches t) 1877 (dired-sort-other dired-actual-switches t)
1864 (when (featurep 'dnd) 1878 (when (featurep 'dnd)
1865 (set (make-local-variable 'dnd-protocol-alist) 1879 (set (make-local-variable 'dnd-protocol-alist)
@@ -3615,7 +3629,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3615;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command 3629;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
3616;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown 3630;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
3617;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff 3631;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
3618;;;;;; dired-diff) "dired-aux" "dired-aux.el" "9d6333fab9c0f1b49e0bf2a536b8f245") 3632;;;;;; dired-diff) "dired-aux" "dired-aux.el" "154cdfbf451aedec60c5012b625ff329")
3619;;; Generated autoloads from dired-aux.el 3633;;; Generated autoloads from dired-aux.el
3620 3634
3621(autoload 'dired-diff "dired-aux" "\ 3635(autoload 'dired-diff "dired-aux" "\
@@ -4073,8 +4087,8 @@ true then the type of the file linked to by FILE is printed instead.
4073 4087
4074;;;*** 4088;;;***
4075 4089
4076;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el" 4090;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump)
4077;;;;;; "86d436093caa9ae80f7b73915c6a4b4c") 4091;;;;;; "dired-x" "dired-x.el" "87fd4ae2fdade7e0f11c4a0b1cfdeda2")
4078;;; Generated autoloads from dired-x.el 4092;;; Generated autoloads from dired-x.el
4079 4093
4080(autoload 'dired-jump "dired-x" "\ 4094(autoload 'dired-jump "dired-x" "\
@@ -4089,6 +4103,11 @@ move to its line in dired.
4089 4103
4090\(fn &optional OTHER-WINDOW FILE-NAME)" t nil) 4104\(fn &optional OTHER-WINDOW FILE-NAME)" t nil)
4091 4105
4106(autoload 'dired-jump-other-window "dired-x" "\
4107Like \\[dired-jump] (`dired-jump') but in other window.
4108
4109\(fn &optional FILE-NAME)" t nil)
4110
4092(autoload 'dired-do-relsymlink "dired-x" "\ 4111(autoload 'dired-do-relsymlink "dired-x" "\
4093Relative symlink all marked (or next ARG) files into a directory. 4112Relative symlink all marked (or next ARG) files into a directory.
4094Otherwise make a relative symbolic link to the current file. 4113Otherwise make a relative symbolic link to the current file.
diff --git a/lisp/emacs-lisp/assoc.el b/lisp/emacs-lisp/assoc.el
index aa85916cc3f..31be851f2dd 100644
--- a/lisp/emacs-lisp/assoc.el
+++ b/lisp/emacs-lisp/assoc.el
@@ -1,4 +1,4 @@
1;;; assoc.el --- insert/delete/sort functions on association lists 1;;; assoc.el --- insert/delete functions on association lists
2 2
3;; Copyright (C) 1996, 2001-2011 Free Software Foundation, Inc. 3;; Copyright (C) 1996, 2001-2011 Free Software Foundation, Inc.
4 4
@@ -35,7 +35,7 @@ head is one matching KEY. Returns the sorted list and doesn't affect
35the order of any other key-value pair. Side effect sets alist to new 35the order of any other key-value pair. Side effect sets alist to new
36sorted list." 36sorted list."
37 (set alist-symbol 37 (set alist-symbol
38 (sort (copy-alist (eval alist-symbol)) 38 (sort (copy-alist (symbol-value alist-symbol))
39 (function (lambda (a b) (equal (car a) key)))))) 39 (function (lambda (a b) (equal (car a) key))))))
40 40
41 41
@@ -75,7 +75,7 @@ of the alist (with value nil if VALUE is nil or not supplied)."
75 (lexical-let ((elem (aelement key value)) 75 (lexical-let ((elem (aelement key value))
76 alist) 76 alist)
77 (asort alist-symbol key) 77 (asort alist-symbol key)
78 (setq alist (eval alist-symbol)) 78 (setq alist (symbol-value alist-symbol))
79 (cond ((null alist) (set alist-symbol elem)) 79 (cond ((null alist) (set alist-symbol elem))
80 ((anot-head-p alist key) (set alist-symbol (nconc elem alist))) 80 ((anot-head-p alist key) (set alist-symbol (nconc elem alist)))
81 (value (setcar alist (car elem))) 81 (value (setcar alist (car elem)))
@@ -87,7 +87,7 @@ of the alist (with value nil if VALUE is nil or not supplied)."
87Alist is referenced by ALIST-SYMBOL and the key-value pair to remove 87Alist is referenced by ALIST-SYMBOL and the key-value pair to remove
88is pair matching KEY. Returns the altered alist." 88is pair matching KEY. Returns the altered alist."
89 (asort alist-symbol key) 89 (asort alist-symbol key)
90 (lexical-let ((alist (eval alist-symbol))) 90 (lexical-let ((alist (symbol-value alist-symbol)))
91 (cond ((null alist) nil) 91 (cond ((null alist) nil)
92 ((anot-head-p alist key) alist) 92 ((anot-head-p alist key) alist)
93 (t (set alist-symbol (cdr alist)))))) 93 (t (set alist-symbol (cdr alist))))))
@@ -133,7 +133,7 @@ extra values are ignored. Returns the created alist."
133 (t 133 (t
134 (amake alist-symbol keycdr valcdr) 134 (amake alist-symbol keycdr valcdr)
135 (aput alist-symbol keycar valcar)))) 135 (aput alist-symbol keycar valcar))))
136 (eval alist-symbol)) 136 (symbol-value alist-symbol))
137 137
138(provide 'assoc) 138(provide 'assoc)
139 139
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 7b610d11b0f..d6e7ee9e3cb 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -537,7 +537,8 @@ Return non-nil if and only if FILE adds no autoloads to OUTFILE
537(defun autoload-save-buffers () 537(defun autoload-save-buffers ()
538 (while autoload-modified-buffers 538 (while autoload-modified-buffers
539 (with-current-buffer (pop autoload-modified-buffers) 539 (with-current-buffer (pop autoload-modified-buffers)
540 (save-buffer)))) 540 (let ((version-control 'never))
541 (save-buffer)))))
541 542
542;;;###autoload 543;;;###autoload
543(defun update-file-autoloads (file &optional save-after) 544(defun update-file-autoloads (file &optional save-after)
@@ -569,8 +570,9 @@ removes any prior now out-of-date autoload entries."
569 (with-current-buffer 570 (with-current-buffer
570 ;; We used to use `raw-text' to read this file, but this causes 571 ;; We used to use `raw-text' to read this file, but this causes
571 ;; problems when the file contains non-ASCII characters. 572 ;; problems when the file contains non-ASCII characters.
572 (find-file-noselect 573 (let ((enable-local-variables :safe))
573 (autoload-ensure-default-file (autoload-generated-file))) 574 (find-file-noselect
575 (autoload-ensure-default-file (autoload-generated-file))))
574 ;; This is to make generated-autoload-file have Unix EOLs, so 576 ;; This is to make generated-autoload-file have Unix EOLs, so
575 ;; that it is portable to all platforms. 577 ;; that it is portable to all platforms.
576 (or (eq 0 (coding-system-eol-type buffer-file-coding-system)) 578 (or (eq 0 (coding-system-eol-type buffer-file-coding-system))
@@ -656,8 +658,9 @@ directory or directories specified."
656 (autoload-modified-buffers nil)) 658 (autoload-modified-buffers nil))
657 659
658 (with-current-buffer 660 (with-current-buffer
659 (find-file-noselect 661 (let ((enable-local-variables :safe))
660 (autoload-ensure-default-file (autoload-generated-file))) 662 (find-file-noselect
663 (autoload-ensure-default-file (autoload-generated-file))))
661 (save-excursion 664 (save-excursion
662 665
663 ;; Canonicalize file names and remove the autoload file itself. 666 ;; Canonicalize file names and remove the autoload file itself.
@@ -721,7 +724,8 @@ directory or directories specified."
721 (current-buffer) nil nil no-autoloads this-time) 724 (current-buffer) nil nil no-autoloads this-time)
722 (insert generate-autoload-section-trailer)) 725 (insert generate-autoload-section-trailer))
723 726
724 (save-buffer) 727 (let ((version-control 'never))
728 (save-buffer))
725 ;; In case autoload entries were added to other files because of 729 ;; In case autoload entries were added to other files because of
726 ;; file-local autoload-generated-file settings. 730 ;; file-local autoload-generated-file settings.
727 (autoload-save-buffers)))) 731 (autoload-save-buffers))))
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 297655a235a..7b785c9ace6 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -238,6 +238,7 @@ the functions you loaded will not be able to run.")
238 238
239(defvar byte-compile-disable-print-circle nil 239(defvar byte-compile-disable-print-circle nil
240 "If non-nil, disable `print-circle' on printing a byte-compiled code.") 240 "If non-nil, disable `print-circle' on printing a byte-compiled code.")
241(make-obsolete-variable 'byte-compile-disable-print-circle nil "24.1")
241;;;###autoload(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp) 242;;;###autoload(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
242 243
243(defcustom byte-compile-dynamic-docstrings t 244(defcustom byte-compile-dynamic-docstrings t
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index df9460154e8..17046f1ffb4 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -282,7 +282,7 @@ Not documented
282;;;;;; do-all-symbols do-symbols dotimes dolist do* do loop return-from 282;;;;;; do-all-symbols do-symbols dotimes dolist do* do loop return-from
283;;;;;; return block etypecase typecase ecase case load-time-value 283;;;;;; return block etypecase typecase ecase case load-time-value
284;;;;;; eval-when destructuring-bind function* defmacro* defun* gentemp 284;;;;;; eval-when destructuring-bind function* defmacro* defun* gentemp
285;;;;;; gensym) "cl-macs" "cl-macs.el" "7602128fa01003de9a8df4c752865300") 285;;;;;; gensym) "cl-macs" "cl-macs.el" "5bdba3fbbcbfcf57a2c9ca87a6318150")
286;;; Generated autoloads from cl-macs.el 286;;; Generated autoloads from cl-macs.el
287 287
288(autoload 'gensym "cl-macs" "\ 288(autoload 'gensym "cl-macs" "\
@@ -319,7 +319,7 @@ its argument list allows full Common Lisp conventions.
319\(fn FUNC)" nil (quote macro)) 319\(fn FUNC)" nil (quote macro))
320 320
321(autoload 'destructuring-bind "cl-macs" "\ 321(autoload 'destructuring-bind "cl-macs" "\
322Not documented 322
323 323
324\(fn ARGS EXPR &rest BODY)" nil (quote macro)) 324\(fn ARGS EXPR &rest BODY)" nil (quote macro))
325 325
@@ -445,7 +445,7 @@ from OBARRAY.
445\(fn (VAR [OBARRAY [RESULT]]) BODY...)" nil (quote macro)) 445\(fn (VAR [OBARRAY [RESULT]]) BODY...)" nil (quote macro))
446 446
447(autoload 'do-all-symbols "cl-macs" "\ 447(autoload 'do-all-symbols "cl-macs" "\
448Not documented 448
449 449
450\(fn SPEC &rest BODY)" nil (quote macro)) 450\(fn SPEC &rest BODY)" nil (quote macro))
451 451
@@ -505,7 +505,7 @@ lexical closures as in Common Lisp.
505(autoload 'lexical-let* "cl-macs" "\ 505(autoload 'lexical-let* "cl-macs" "\
506Like `let*', but lexically scoped. 506Like `let*', but lexically scoped.
507The main visible difference is that lambdas inside BODY, and in 507The main visible difference is that lambdas inside BODY, and in
508successive bindings within BINDINGS, will create lexical closures 508successive bindings within VARLIST, will create lexical closures
509as in Common Lisp. This is similar to the behavior of `let*' in 509as in Common Lisp. This is similar to the behavior of `let*' in
510Common Lisp. 510Common Lisp.
511 511
@@ -531,12 +531,12 @@ values. For compatibility, (values A B C) is a synonym for (list A B C).
531\(fn (SYM...) FORM)" nil (quote macro)) 531\(fn (SYM...) FORM)" nil (quote macro))
532 532
533(autoload 'locally "cl-macs" "\ 533(autoload 'locally "cl-macs" "\
534Not documented 534
535 535
536\(fn &rest BODY)" nil (quote macro)) 536\(fn &rest BODY)" nil (quote macro))
537 537
538(autoload 'declare "cl-macs" "\ 538(autoload 'declare "cl-macs" "\
539Not documented 539
540 540
541\(fn &rest SPECS)" nil (quote macro)) 541\(fn &rest SPECS)" nil (quote macro))
542 542
@@ -596,7 +596,7 @@ before assigning any PLACEs to the corresponding values.
596\(fn PLACE VAL PLACE VAL ...)" nil (quote macro)) 596\(fn PLACE VAL PLACE VAL ...)" nil (quote macro))
597 597
598(autoload 'cl-do-pop "cl-macs" "\ 598(autoload 'cl-do-pop "cl-macs" "\
599Not documented 599
600 600
601\(fn PLACE)" nil nil) 601\(fn PLACE)" nil nil)
602 602
@@ -684,7 +684,7 @@ value, that slot cannot be set via `setf'.
684\(fn NAME SLOTS...)" nil (quote macro)) 684\(fn NAME SLOTS...)" nil (quote macro))
685 685
686(autoload 'cl-struct-setf-expander "cl-macs" "\ 686(autoload 'cl-struct-setf-expander "cl-macs" "\
687Not documented 687
688 688
689\(fn X NAME ACCESSOR PRED-FORM POS)" nil nil) 689\(fn X NAME ACCESSOR PRED-FORM POS)" nil nil)
690 690
@@ -730,7 +730,7 @@ and then returning foo.
730\(fn FUNC ARGS &rest BODY)" nil (quote macro)) 730\(fn FUNC ARGS &rest BODY)" nil (quote macro))
731 731
732(autoload 'compiler-macroexpand "cl-macs" "\ 732(autoload 'compiler-macroexpand "cl-macs" "\
733Not documented 733
734 734
735\(fn FORM)" nil nil) 735\(fn FORM)" nil nil)
736 736
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 093e4fbf258..8b1fc9d5f53 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1476,7 +1476,7 @@ lexical closures as in Common Lisp.
1476(defmacro lexical-let* (bindings &rest body) 1476(defmacro lexical-let* (bindings &rest body)
1477 "Like `let*', but lexically scoped. 1477 "Like `let*', but lexically scoped.
1478The main visible difference is that lambdas inside BODY, and in 1478The main visible difference is that lambdas inside BODY, and in
1479successive bindings within BINDINGS, will create lexical closures 1479successive bindings within VARLIST, will create lexical closures
1480as in Common Lisp. This is similar to the behavior of `let*' in 1480as in Common Lisp. This is similar to the behavior of `let*' in
1481Common Lisp. 1481Common Lisp.
1482\n(fn VARLIST BODY)" 1482\n(fn VARLIST BODY)"
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index 910eff3c78f..73af3a5708f 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -630,7 +630,7 @@ displayed."
630 'display (list 'space :align-to column) 630 'display (list 'space :align-to column)
631 'face 'fixed-pitch) 631 'face 'fixed-pitch)
632 title) 632 title)
633 (setq column (+ column 1 633 (setq column (+ column 2
634 (if (= column 0) 634 (if (= column 0)
635 elp-field-len 635 elp-field-len
636 (length title)))))) 636 (length title))))))
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index b3c95fcc78f..5bd8fd01b1e 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -219,7 +219,7 @@ Emacs bug 6581 at URL `http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6581'."
219 ;; This implementation is inefficient. Rather than making it 219 ;; This implementation is inefficient. Rather than making it
220 ;; efficient, let's hope bug 6581 gets fixed so that we can delete 220 ;; efficient, let's hope bug 6581 gets fixed so that we can delete
221 ;; it altogether. 221 ;; it altogether.
222 (not (ert--explain-not-equal-including-properties a b))) 222 (not (ert--explain-equal-including-properties a b)))
223 223
224 224
225;;; Defining and locating tests. 225;;; Defining and locating tests.
@@ -571,16 +571,15 @@ failed."
571 (when (and (not firstp) (eq fast slow)) (return nil)))) 571 (when (and (not firstp) (eq fast slow)) (return nil))))
572 572
573(defun ert--explain-format-atom (x) 573(defun ert--explain-format-atom (x)
574 "Format the atom X for `ert--explain-not-equal'." 574 "Format the atom X for `ert--explain-equal'."
575 (typecase x 575 (typecase x
576 (fixnum (list x (format "#x%x" x) (format "?%c" x))) 576 (fixnum (list x (format "#x%x" x) (format "?%c" x)))
577 (t x))) 577 (t x)))
578 578
579(defun ert--explain-not-equal (a b) 579(defun ert--explain-equal-rec (a b)
580 "Explainer function for `equal'. 580 "Returns a programmer-readable explanation of why A and B are not `equal'.
581 581
582Returns a programmer-readable explanation of why A and B are not 582Returns nil if they are."
583`equal', or nil if they are."
584 (if (not (equal (type-of a) (type-of b))) 583 (if (not (equal (type-of a) (type-of b)))
585 `(different-types ,a ,b) 584 `(different-types ,a ,b)
586 (etypecase a 585 (etypecase a
@@ -598,13 +597,13 @@ Returns a programmer-readable explanation of why A and B are not
598 (loop for i from 0 597 (loop for i from 0
599 for ai in a 598 for ai in a
600 for bi in b 599 for bi in b
601 for xi = (ert--explain-not-equal ai bi) 600 for xi = (ert--explain-equal-rec ai bi)
602 do (when xi (return `(list-elt ,i ,xi))) 601 do (when xi (return `(list-elt ,i ,xi)))
603 finally (assert (equal a b) t))) 602 finally (assert (equal a b) t)))
604 (let ((car-x (ert--explain-not-equal (car a) (car b)))) 603 (let ((car-x (ert--explain-equal-rec (car a) (car b))))
605 (if car-x 604 (if car-x
606 `(car ,car-x) 605 `(car ,car-x)
607 (let ((cdr-x (ert--explain-not-equal (cdr a) (cdr b)))) 606 (let ((cdr-x (ert--explain-equal-rec (cdr a) (cdr b))))
608 (if cdr-x 607 (if cdr-x
609 `(cdr ,cdr-x) 608 `(cdr ,cdr-x)
610 (assert (equal a b) t) 609 (assert (equal a b) t)
@@ -618,7 +617,7 @@ Returns a programmer-readable explanation of why A and B are not
618 (loop for i from 0 617 (loop for i from 0
619 for ai across a 618 for ai across a
620 for bi across b 619 for bi across b
621 for xi = (ert--explain-not-equal ai bi) 620 for xi = (ert--explain-equal-rec ai bi)
622 do (when xi (return `(array-elt ,i ,xi))) 621 do (when xi (return `(array-elt ,i ,xi)))
623 finally (assert (equal a b) t)))) 622 finally (assert (equal a b) t))))
624 (atom (if (not (equal a b)) 623 (atom (if (not (equal a b))
@@ -627,7 +626,15 @@ Returns a programmer-readable explanation of why A and B are not
627 `(different-atoms ,(ert--explain-format-atom a) 626 `(different-atoms ,(ert--explain-format-atom a)
628 ,(ert--explain-format-atom b))) 627 ,(ert--explain-format-atom b)))
629 nil))))) 628 nil)))))
630(put 'equal 'ert-explainer 'ert--explain-not-equal) 629
630(defun ert--explain-equal (a b)
631 "Explainer function for `equal'."
632 ;; Do a quick comparison in C to avoid running our expensive
633 ;; comparison when possible.
634 (if (equal a b)
635 nil
636 (ert--explain-equal-rec a b)))
637(put 'equal 'ert-explainer 'ert--explain-equal)
631 638
632(defun ert--significant-plist-keys (plist) 639(defun ert--significant-plist-keys (plist)
633 "Return the keys of PLIST that have non-null values, in order." 640 "Return the keys of PLIST that have non-null values, in order."
@@ -658,8 +665,8 @@ key/value pairs in each list does not matter."
658 (value-b (plist-get b key))) 665 (value-b (plist-get b key)))
659 (assert (not (equal value-a value-b)) t) 666 (assert (not (equal value-a value-b)) t)
660 `(different-properties-for-key 667 `(different-properties-for-key
661 ,key ,(ert--explain-not-equal-including-properties value-a 668 ,key ,(ert--explain-equal-including-properties value-a
662 value-b))))) 669 value-b)))))
663 (cond (keys-in-a-not-in-b 670 (cond (keys-in-a-not-in-b
664 (explain-with-key (first keys-in-a-not-in-b))) 671 (explain-with-key (first keys-in-a-not-in-b)))
665 (keys-in-b-not-in-a 672 (keys-in-b-not-in-a
@@ -681,13 +688,16 @@ If SUFFIXP is non-nil, returns a suffix of S, otherwise a prefix."
681 (t 688 (t
682 (substring s 0 len))))) 689 (substring s 0 len)))))
683 690
684(defun ert--explain-not-equal-including-properties (a b) 691;; TODO(ohler): Once bug 6581 is fixed, rename this to
692;; `ert--explain-equal-including-properties-rec' and add a fast-path
693;; wrapper like `ert--explain-equal'.
694(defun ert--explain-equal-including-properties (a b)
685 "Explainer function for `ert-equal-including-properties'. 695 "Explainer function for `ert-equal-including-properties'.
686 696
687Returns a programmer-readable explanation of why A and B are not 697Returns a programmer-readable explanation of why A and B are not
688`ert-equal-including-properties', or nil if they are." 698`ert-equal-including-properties', or nil if they are."
689 (if (not (equal a b)) 699 (if (not (equal a b))
690 (ert--explain-not-equal a b) 700 (ert--explain-equal a b)
691 (assert (stringp a) t) 701 (assert (stringp a) t)
692 (assert (stringp b) t) 702 (assert (stringp b) t)
693 (assert (eql (length a) (length b)) t) 703 (assert (eql (length a) (length b)) t)
@@ -713,7 +723,7 @@ Returns a programmer-readable explanation of why A and B are not
713 ))) 723 )))
714(put 'ert-equal-including-properties 724(put 'ert-equal-including-properties
715 'ert-explainer 725 'ert-explainer
716 'ert--explain-not-equal-including-properties) 726 'ert--explain-equal-including-properties)
717 727
718 728
719;;; Implementation of `ert-info'. 729;;; Implementation of `ert-info'.
@@ -1244,12 +1254,14 @@ Also changes the counters in STATS to match."
1244 (ert-test-passed (incf (ert--stats-passed-expected stats) d)) 1254 (ert-test-passed (incf (ert--stats-passed-expected stats) d))
1245 (ert-test-failed (incf (ert--stats-failed-expected stats) d)) 1255 (ert-test-failed (incf (ert--stats-failed-expected stats) d))
1246 (null) 1256 (null)
1247 (ert-test-aborted-with-non-local-exit)) 1257 (ert-test-aborted-with-non-local-exit)
1258 (ert-test-quit))
1248 (etypecase (aref results pos) 1259 (etypecase (aref results pos)
1249 (ert-test-passed (incf (ert--stats-passed-unexpected stats) d)) 1260 (ert-test-passed (incf (ert--stats-passed-unexpected stats) d))
1250 (ert-test-failed (incf (ert--stats-failed-unexpected stats) d)) 1261 (ert-test-failed (incf (ert--stats-failed-unexpected stats) d))
1251 (null) 1262 (null)
1252 (ert-test-aborted-with-non-local-exit))))) 1263 (ert-test-aborted-with-non-local-exit)
1264 (ert-test-quit)))))
1253 ;; Adjust counters to remove the result that is currently in stats. 1265 ;; Adjust counters to remove the result that is currently in stats.
1254 (update -1) 1266 (update -1)
1255 ;; Put new test and result into stats. 1267 ;; Put new test and result into stats.
@@ -1342,7 +1354,8 @@ EXPECTEDP specifies whether the result was expected."
1342 (ert-test-passed ".P") 1354 (ert-test-passed ".P")
1343 (ert-test-failed "fF") 1355 (ert-test-failed "fF")
1344 (null "--") 1356 (null "--")
1345 (ert-test-aborted-with-non-local-exit "aA")))) 1357 (ert-test-aborted-with-non-local-exit "aA")
1358 (ert-test-quit "qQ"))))
1346 (elt s (if expectedp 0 1)))) 1359 (elt s (if expectedp 0 1))))
1347 1360
1348(defun ert-string-for-test-result (result expectedp) 1361(defun ert-string-for-test-result (result expectedp)
@@ -1353,7 +1366,8 @@ EXPECTEDP specifies whether the result was expected."
1353 (ert-test-passed '("passed" "PASSED")) 1366 (ert-test-passed '("passed" "PASSED"))
1354 (ert-test-failed '("failed" "FAILED")) 1367 (ert-test-failed '("failed" "FAILED"))
1355 (null '("unknown" "UNKNOWN")) 1368 (null '("unknown" "UNKNOWN"))
1356 (ert-test-aborted-with-non-local-exit '("aborted" "ABORTED"))))) 1369 (ert-test-aborted-with-non-local-exit '("aborted" "ABORTED"))
1370 (ert-test-quit '("quit" "QUIT")))))
1357 (elt s (if expectedp 0 1)))) 1371 (elt s (if expectedp 0 1))))
1358 1372
1359(defun ert--pp-with-indentation-and-newline (object) 1373(defun ert--pp-with-indentation-and-newline (object)
@@ -1478,7 +1492,9 @@ Returns the stats object."
1478 (message "%s" (buffer-string)))) 1492 (message "%s" (buffer-string))))
1479 (ert-test-aborted-with-non-local-exit 1493 (ert-test-aborted-with-non-local-exit
1480 (message "Test %S aborted with non-local exit" 1494 (message "Test %S aborted with non-local exit"
1481 (ert-test-name test))))) 1495 (ert-test-name test)))
1496 (ert-test-quit
1497 (message "Quit during %S" (ert-test-name test)))))
1482 (let* ((max (prin1-to-string (length (ert--stats-tests stats)))) 1498 (let* ((max (prin1-to-string (length (ert--stats-tests stats))))
1483 (format-string (concat "%9s %" 1499 (format-string (concat "%9s %"
1484 (prin1-to-string (length max)) 1500 (prin1-to-string (length max))
@@ -1853,7 +1869,9 @@ non-nil, returns the face for expected results.."
1853 (ert-test-result-with-condition-condition result)) 1869 (ert-test-result-with-condition-condition result))
1854 (ert--make-xrefs-region begin (point))))) 1870 (ert--make-xrefs-region begin (point)))))
1855 (ert-test-aborted-with-non-local-exit 1871 (ert-test-aborted-with-non-local-exit
1856 (insert " aborted\n"))) 1872 (insert " aborted\n"))
1873 (ert-test-quit
1874 (insert " quit\n")))
1857 (insert "\n"))))) 1875 (insert "\n")))))
1858 nil) 1876 nil)
1859 1877
diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el
index bf9998695ee..a71f3c7244c 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -495,6 +495,8 @@ Return the node (or nil if we just passed the last node)."
495 ;; Never step below the first element. 495 ;; Never step below the first element.
496 ;; (unless (ewoc--filter-hf-nodes ewoc node) 496 ;; (unless (ewoc--filter-hf-nodes ewoc node)
497 ;; (setq node (ewoc--node-nth dll -2))) 497 ;; (setq node (ewoc--node-nth dll -2)))
498 (unless node
499 (error "No next"))
498 (ewoc-goto-node ewoc node))) 500 (ewoc-goto-node ewoc node)))
499 501
500(defun ewoc-goto-node (ewoc node) 502(defun ewoc-goto-node (ewoc node)
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el
index b9994be3d39..61f23abf0a7 100644
--- a/lisp/emacs-lisp/package-x.el
+++ b/lisp/emacs-lisp/package-x.el
@@ -40,6 +40,9 @@
40(defvar package-archive-upload-base nil 40(defvar package-archive-upload-base nil
41 "Base location for uploading to package archive.") 41 "Base location for uploading to package archive.")
42 42
43(defvar package-update-news-on-upload nil
44 "Whether package upload should also update NEWS and RSS feeds.")
45
43(defun package--encode (string) 46(defun package--encode (string)
44 "Encode a string by replacing some characters with XML entities." 47 "Encode a string by replacing some characters with XML entities."
45 ;; We need a special case for translating "&" to "&amp;". 48 ;; We need a special case for translating "&" to "&amp;".
@@ -86,6 +89,36 @@
86 (unless old-buffer 89 (unless old-buffer
87 (kill-buffer (current-buffer))))))) 90 (kill-buffer (current-buffer)))))))
88 91
92(defun package--archive-contents-from-url (archive-url)
93 "Parse archive-contents file at ARCHIVE-URL.
94Return the file contents, as a string, or nil if unsuccessful."
95 (ignore-errors
96 (when archive-url
97 (let* ((buffer (url-retrieve-synchronously
98 (concat archive-url "archive-contents"))))
99 (set-buffer buffer)
100 (package-handle-response)
101 (re-search-forward "^$" nil 'move)
102 (forward-char)
103 (delete-region (point-min) (point))
104 (prog1 (package-read-from-string
105 (buffer-substring-no-properties (point-min) (point-max)))
106 (kill-buffer buffer))))))
107
108(defun package--archive-contents-from-file (file)
109 "Parse the given archive-contents file."
110 (if (not (file-exists-p file))
111 ;; no existing archive-contents, possibly a new ELPA repo.
112 (list package-archive-version)
113 (let ((dont-kill (find-buffer-visiting file)))
114 (with-current-buffer (let ((find-file-visit-truename t))
115 (find-file-noselect file))
116 (prog1
117 (package-read-from-string
118 (buffer-substring-no-properties (point-min) (point-max)))
119 (unless dont-kill
120 (kill-buffer (current-buffer))))))))
121
89(defun package-maint-add-news-item (title description archive-url) 122(defun package-maint-add-news-item (title description archive-url)
90 "Add a news item to the ELPA web pages. 123 "Add a news item to the ELPA web pages.
91TITLE is the title of the news item. 124TITLE is the title of the news item.
@@ -111,11 +144,20 @@ PKG-INFO is the package info, see `package-buffer-info'.
111EXTENSION is the file extension, a string. It can be either 144EXTENSION is the file extension, a string. It can be either
112\"el\" or \"tar\". 145\"el\" or \"tar\".
113 146
147The variable `package-archive-upload-base' specifies the upload
148destination. If this is nil, signal an error.
149
114Optional arg ARCHIVE-URL is the URL of the destination archive. 150Optional arg ARCHIVE-URL is the URL of the destination archive.
115If nil, the \"gnu\" archive is used." 151If it is non-nil, compute the new \"archive-contents\" file
116 (unless archive-url 152starting from the existing \"archive-contents\" at that URL. In
117 (or (setq archive-url (cdr (assoc "gnu" package-archives))) 153addition, if `package-update-news-on-upload' is non-nil, call
118 (error "No destination URL"))) 154`package--update-news' to add a news item at that URL.
155
156If ARCHIVE-URL is nil, compute the new \"archive-contents\" file
157from the \"archive-contents\" at `package-archive-upload-base',
158if it exists."
159 (unless package-archive-upload-base
160 (error "No destination specified in `package-archive-upload-base'"))
119 (save-excursion 161 (save-excursion
120 (save-restriction 162 (save-restriction
121 (let* ((file-type (cond 163 (let* ((file-type (cond
@@ -131,21 +173,14 @@ If nil, the \"gnu\" archive is used."
131 (pkg-version (aref pkg-info 3)) 173 (pkg-version (aref pkg-info 3))
132 (commentary (aref pkg-info 4)) 174 (commentary (aref pkg-info 4))
133 (split-version (version-to-list pkg-version)) 175 (split-version (version-to-list pkg-version))
134 (pkg-buffer (current-buffer)) 176 (pkg-buffer (current-buffer)))
135 177
136 ;; Download latest archive-contents. 178 ;; Get archive-contents from ARCHIVE-URL if it's non-nil, or
137 (buffer (url-retrieve-synchronously 179 ;; from `package-archive-upload-base' otherwise.
138 (concat archive-url "archive-contents")))) 180 (let ((contents (or (package--archive-contents-from-url archive-url)
139 181 (package--archive-contents-from-file
140 ;; Parse archive-contents. 182 (concat package-archive-upload-base
141 (set-buffer buffer) 183 "archive-contents"))))
142 (package-handle-response)
143 (re-search-forward "^$" nil 'move)
144 (forward-char)
145 (delete-region (point-min) (point))
146 (let ((contents (package-read-from-string
147 (buffer-substring-no-properties (point-min)
148 (point-max))))
149 (new-desc (vector split-version requires desc file-type))) 184 (new-desc (vector split-version requires desc file-type)))
150 (if (> (car contents) package-archive-version) 185 (if (> (car contents) package-archive-version)
151 (error "Unrecognized archive version %d" (car contents))) 186 (error "Unrecognized archive version %d" (car contents)))
@@ -176,7 +211,6 @@ If nil, the \"gnu\" archive is used."
176 (symbol-name pkg-name) "-readme.txt"))) 211 (symbol-name pkg-name) "-readme.txt")))
177 212
178 (set-buffer pkg-buffer) 213 (set-buffer pkg-buffer)
179 (kill-buffer buffer)
180 (write-region (point-min) (point-max) 214 (write-region (point-min) (point-max)
181 (concat package-archive-upload-base 215 (concat package-archive-upload-base
182 file-name "-" pkg-version 216 file-name "-" pkg-version
@@ -184,8 +218,10 @@ If nil, the \"gnu\" archive is used."
184 nil nil nil 'excl) 218 nil nil nil 'excl)
185 219
186 ;; Write a news entry. 220 ;; Write a news entry.
187 (package--update-news (concat file-name "." extension) 221 (and package-update-news-on-upload
188 pkg-version desc archive-url) 222 archive-url
223 (package--update-news (concat file-name "." extension)
224 pkg-version desc archive-url))
189 225
190 ;; special-case "package": write a second copy so that the 226 ;; special-case "package": write a second copy so that the
191 ;; installer can easily find the latest version. 227 ;; installer can easily find the latest version.
@@ -196,7 +232,9 @@ If nil, the \"gnu\" archive is used."
196 nil nil nil 'ask))))))) 232 nil nil nil 'ask)))))))
197 233
198(defun package-upload-buffer () 234(defun package-upload-buffer ()
199 "Upload a single .el file to ELPA from the current buffer." 235 "Upload the current buffer as a single-file Emacs Lisp package.
236The variable `package-archive-upload-base' specifies the upload
237destination."
200 (interactive) 238 (interactive)
201 (save-excursion 239 (save-excursion
202 (save-restriction 240 (save-restriction
@@ -205,6 +243,13 @@ If nil, the \"gnu\" archive is used."
205 (package-upload-buffer-internal pkg-info "el"))))) 243 (package-upload-buffer-internal pkg-info "el")))))
206 244
207(defun package-upload-file (file) 245(defun package-upload-file (file)
246 "Upload the Emacs Lisp package FILE to the package archive.
247Interactively, prompt for FILE. The package is considered a
248single-file package if FILE ends in \".el\", and a multi-file
249package if FILE ends in \".tar\".
250
251The variable `package-archive-upload-base' specifies the upload
252destination."
208 (interactive "fPackage file name: ") 253 (interactive "fPackage file name: ")
209 (with-temp-buffer 254 (with-temp-buffer
210 (insert-file-contents-literally file) 255 (insert-file-contents-literally file)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index ab5ba1bea56..2552ad4eb68 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -220,10 +220,15 @@ If VERSION is nil, the package is not loaded (it is \"disabled\")."
220(defcustom package-archives '(("gnu" . "http://elpa.gnu.org/packages/")) 220(defcustom package-archives '(("gnu" . "http://elpa.gnu.org/packages/"))
221 "An alist of archives from which to fetch. 221 "An alist of archives from which to fetch.
222The default value points to the GNU Emacs package repository. 222The default value points to the GNU Emacs package repository.
223Each element has the form (ID . URL), where ID is an identifier 223
224string for an archive and URL is a http: URL (a string)." 224Each element has the form (ID . LOCATION).
225 ID is an archive name, as a string.
226 LOCATION specifies the base location for the archive.
227 If it starts with \"http:\", it is treated as a HTTP URL;
228 otherwise it should be an absolute directory name.
229 (Other types of URL are currently not supported.)"
225 :type '(alist :key-type (string :tag "Archive name") 230 :type '(alist :key-type (string :tag "Archive name")
226 :value-type (string :tag "Archive URL")) 231 :value-type (string :tag "URL or directory name"))
227 :risky t 232 :risky t
228 :group 'package 233 :group 'package
229 :version "24.1") 234 :version "24.1")
@@ -617,8 +622,36 @@ Otherwise it uses an external `tar' program.
617 (let ((load-path (cons pkg-dir load-path))) 622 (let ((load-path (cons pkg-dir load-path)))
618 (byte-recompile-directory pkg-dir 0 t))))) 623 (byte-recompile-directory pkg-dir 0 t)))))
619 624
625(defmacro package--with-work-buffer (location file &rest body)
626 "Run BODY in a buffer containing the contents of FILE at LOCATION.
627LOCATION is the base location of a package archive, and should be
628one of the URLs (or file names) specified in `package-archives'.
629FILE is the name of a file relative to that base location.
630
631This macro retrieves FILE from LOCATION into a temporary buffer,
632and evaluates BODY while that buffer is current. This work
633buffer is killed afterwards. Return the last value in BODY."
634 `(let* ((http (string-match "\\`http:" ,location))
635 (buffer
636 (if http
637 (url-retrieve-synchronously (concat ,location ,file))
638 (generate-new-buffer "*package work buffer*"))))
639 (prog1
640 (with-current-buffer buffer
641 (if http
642 (progn (package-handle-response)
643 (re-search-forward "^$" nil 'move)
644 (forward-char)
645 (delete-region (point-min) (point)))
646 (unless (file-name-absolute-p ,location)
647 (error "Archive location %s is not an absolute file name"
648 ,location))
649 (insert-file-contents (expand-file-name ,file ,location)))
650 ,@body)
651 (kill-buffer buffer))))
652
620(defun package-handle-response () 653(defun package-handle-response ()
621 "Handle the response from the server. 654 "Handle the response from a `url-retrieve-synchronously' call.
622Parse the HTTP response and throw if an error occurred. 655Parse the HTTP response and throw if an error occurred.
623The url package seems to require extra processing for this. 656The url package seems to require extra processing for this.
624This should be called in a `save-excursion', in the download buffer. 657This should be called in a `save-excursion', in the download buffer.
@@ -627,7 +660,6 @@ It will move point to somewhere in the headers."
627 (require 'url-http) 660 (require 'url-http)
628 (let ((response (url-http-parse-response))) 661 (let ((response (url-http-parse-response)))
629 (when (or (< response 200) (>= response 300)) 662 (when (or (< response 200) (>= response 300))
630 (display-buffer (current-buffer))
631 (error "Error during download request:%s" 663 (error "Error during download request:%s"
632 (buffer-substring-no-properties (point) (progn 664 (buffer-substring-no-properties (point) (progn
633 (end-of-line) 665 (end-of-line)
@@ -635,28 +667,17 @@ It will move point to somewhere in the headers."
635 667
636(defun package-download-single (name version desc requires) 668(defun package-download-single (name version desc requires)
637 "Download and install a single-file package." 669 "Download and install a single-file package."
638 (let ((buffer (url-retrieve-synchronously 670 (let ((location (package-archive-base name))
639 (concat (package-archive-url name) 671 (file (concat (symbol-name name) "-" version ".el")))
640 (symbol-name name) "-" version ".el")))) 672 (package--with-work-buffer location file
641 (with-current-buffer buffer 673 (package-unpack-single (symbol-name name) version desc requires))))
642 (package-handle-response)
643 (re-search-forward "^$" nil 'move)
644 (forward-char)
645 (delete-region (point-min) (point))
646 (package-unpack-single (symbol-name name) version desc requires)
647 (kill-buffer buffer))))
648 674
649(defun package-download-tar (name version) 675(defun package-download-tar (name version)
650 "Download and install a tar package." 676 "Download and install a tar package."
651 (let ((tar-buffer (url-retrieve-synchronously 677 (let ((location (package-archive-base name))
652 (concat (package-archive-url name) 678 (file (concat (symbol-name name) "-" version ".tar")))
653 (symbol-name name) "-" version ".tar")))) 679 (package--with-work-buffer location file
654 (with-current-buffer tar-buffer 680 (package-unpack name version))))
655 (package-handle-response)
656 (re-search-forward "^$" nil 'move)
657 (forward-char)
658 (package-unpack name version)
659 (kill-buffer tar-buffer))))
660 681
661(defun package-installed-p (package &optional min-version) 682(defun package-installed-p (package &optional min-version)
662 "Return true if PACKAGE, of VERSION or newer, is installed. 683 "Return true if PACKAGE, of VERSION or newer, is installed.
@@ -987,31 +1008,26 @@ The file can either be a tar file or an Emacs Lisp file."
987 (error "Package `%s-%s' is a system package, not deleting" 1008 (error "Package `%s-%s' is a system package, not deleting"
988 name version)))) 1009 name version))))
989 1010
990(defun package-archive-url (name) 1011(defun package-archive-base (name)
991 "Return the archive containing the package NAME." 1012 "Return the archive containing the package NAME."
992 (let ((desc (cdr (assq (intern-soft name) package-archive-contents)))) 1013 (let ((desc (cdr (assq (intern-soft name) package-archive-contents))))
993 (cdr (assoc (aref desc (- (length desc) 1)) package-archives)))) 1014 (cdr (assoc (aref desc (- (length desc) 1)) package-archives))))
994 1015
995(defun package--download-one-archive (archive file) 1016(defun package--download-one-archive (archive file)
996 "Download an archive file FILE from ARCHIVE, and cache it locally." 1017 "Retrieve an archive file FILE from ARCHIVE, and cache it.
997 (let* ((archive-name (car archive)) 1018ARCHIVE should be a cons cell of the form (NAME . LOCATION),
998 (archive-url (cdr archive)) 1019similar to an entry in `package-alist'. Save the cached copy to
999 (dir (expand-file-name "archives" package-user-dir)) 1020\"archives/NAME/archive-contents\" in `package-user-dir'."
1000 (dir (expand-file-name archive-name dir)) 1021 (let* ((dir (expand-file-name "archives" package-user-dir))
1001 (buffer (url-retrieve-synchronously (concat archive-url file)))) 1022 (dir (expand-file-name (car archive) dir)))
1002 (with-current-buffer buffer 1023 (package--with-work-buffer (cdr archive) file
1003 (package-handle-response)
1004 (re-search-forward "^$" nil 'move)
1005 (forward-char)
1006 (delete-region (point-min) (point))
1007 ;; Read the retrieved buffer to make sure it is valid (e.g. it 1024 ;; Read the retrieved buffer to make sure it is valid (e.g. it
1008 ;; may fetch a URL redirect page). 1025 ;; may fetch a URL redirect page).
1009 (when (listp (read buffer)) 1026 (when (listp (read buffer))
1010 (make-directory dir t) 1027 (make-directory dir t)
1011 (setq buffer-file-name (expand-file-name file dir)) 1028 (setq buffer-file-name (expand-file-name file dir))
1012 (let ((version-control 'never)) 1029 (let ((version-control 'never))
1013 (save-buffer)))) 1030 (save-buffer))))))
1014 (kill-buffer buffer)))
1015 1031
1016(defun package-refresh-contents () 1032(defun package-refresh-contents ()
1017 "Download the ELPA archive description if needed. 1033 "Download the ELPA archive description if needed.
@@ -1176,27 +1192,21 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
1176 (while (re-search-forward "^\\(;+ ?\\)" nil t) 1192 (while (re-search-forward "^\\(;+ ?\\)" nil t)
1177 (replace-match "")))) 1193 (replace-match ""))))
1178 (let ((readme (expand-file-name (concat package-name "-readme.txt") 1194 (let ((readme (expand-file-name (concat package-name "-readme.txt")
1179 package-user-dir))) 1195 package-user-dir))
1196 readme-string)
1180 ;; For elpa packages, try downloading the commentary. If that 1197 ;; For elpa packages, try downloading the commentary. If that
1181 ;; fails, try an existing readme file in `package-user-dir'. 1198 ;; fails, try an existing readme file in `package-user-dir'.
1182 (cond ((let ((buffer (ignore-errors 1199 (cond ((condition-case nil
1183 (url-retrieve-synchronously 1200 (package--with-work-buffer (package-archive-base package)
1184 (concat (package-archive-url package) 1201 (concat package-name "-readme.txt")
1185 package-name "-readme.txt")))) 1202 (setq buffer-file-name
1186 response) 1203 (expand-file-name readme package-user-dir))
1187 (when buffer 1204 (let ((version-control 'never))
1188 (with-current-buffer buffer 1205 (save-buffer))
1189 (setq response (url-http-parse-response)) 1206 (setq readme-string (buffer-string))
1190 (if (or (< response 200) (>= response 300)) 1207 t)
1191 (setq response nil) 1208 (error nil))
1192 (setq buffer-file-name 1209 (insert readme-string))
1193 (expand-file-name readme package-user-dir))
1194 (delete-region (point-min) (1+ url-http-end-of-headers))
1195 (save-buffer)))
1196 (when response
1197 (insert-buffer-substring buffer)
1198 (kill-buffer buffer)
1199 t))))
1200 ((file-readable-p readme) 1210 ((file-readable-p readme)
1201 (insert-file-contents readme) 1211 (insert-file-contents readme)
1202 (goto-char (point-max)))))))) 1212 (goto-char (point-max))))))))
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 2300ebf721a..e95bcac2a70 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 2010-2011 Free Software Foundation, Inc. 3;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
4 4
5;; Author: Stefan Monnier <monnier@iro.umontreal.ca> 5;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
6;; Keywords: 6;; Keywords:
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
@@ -32,6 +32,14 @@
32;; could be defined this way, as a shorthand for (pred (lambda (_) BOOLEXP)). 32;; could be defined this way, as a shorthand for (pred (lambda (_) BOOLEXP)).
33;; But better would be if we could define new ways to match by having the 33;; But better would be if we could define new ways to match by having the
34;; extension provide its own `pcase--split-<foo>' thingy. 34;; extension provide its own `pcase--split-<foo>' thingy.
35;; - provide something like (setq VAR) so a var can be set rather than
36;; let-bound.
37;; - provide a way to fallthrough to other cases.
38;; - try and be more clever to reduce the size of the decision tree, and
39;; to reduce the number of leafs that need to be turned into function:
40;; - first, do the tests shared by all remaining branches (it will have
41;; to be performed anyway, so better so it first so it's shared).
42;; - then choose the test that discriminates more (?).
35;; - ideally we'd want (pcase s ((re RE1) E1) ((re RE2) E2)) to be able to 43;; - ideally we'd want (pcase s ((re RE1) E1) ((re RE2) E2)) to be able to
36;; generate a lex-style DFA to decide whether to run E1 or E2. 44;; generate a lex-style DFA to decide whether to run E1 or E2.
37 45
@@ -65,12 +73,12 @@ If a SYMBOL is used twice in the same pattern (i.e. the pattern is
65QPatterns can take the following forms: 73QPatterns can take the following forms:
66 (QPAT1 . QPAT2) matches if QPAT1 matches the car and QPAT2 the cdr. 74 (QPAT1 . QPAT2) matches if QPAT1 matches the car and QPAT2 the cdr.
67 ,UPAT matches if the UPattern UPAT matches. 75 ,UPAT matches if the UPattern UPAT matches.
68 STRING matches if the object is `equal' to STRING. 76 STRING matches if the object is `equal' to STRING.
69 ATOM matches if the object is `eq' to ATOM. 77 ATOM matches if the object is `eq' to ATOM.
70QPatterns for vectors are not implemented yet. 78QPatterns for vectors are not implemented yet.
71 79
72PRED can take the form 80PRED can take the form
73 FUNCTION in which case it gets called with one argument. 81 FUNCTION in which case it gets called with one argument.
74 (FUN ARG1 .. ARGN) in which case it gets called with N+1 arguments. 82 (FUN ARG1 .. ARGN) in which case it gets called with N+1 arguments.
75A PRED of the form FUNCTION is equivalent to one of the form (FUNCTION). 83A PRED of the form FUNCTION is equivalent to one of the form (FUNCTION).
76PRED patterns can refer to variables bound earlier in the pattern. 84PRED patterns can refer to variables bound earlier in the pattern.
@@ -222,6 +230,7 @@ of the form (UPAT EXP)."
222(defun pcase--if (test then else) 230(defun pcase--if (test then else)
223 (cond 231 (cond
224 ((eq else :pcase--dontcare) then) 232 ((eq else :pcase--dontcare) then)
233 ((eq then :pcase--dontcare) (debug) else) ;Can/should this ever happen?
225 ((eq (car-safe else) 'if) 234 ((eq (car-safe else) 'if)
226 (if (equal test (nth 1 else)) 235 (if (equal test (nth 1 else))
227 ;; Doing a test a second time: get rid of the redundancy. 236 ;; Doing a test a second time: get rid of the redundancy.
@@ -236,6 +245,8 @@ of the form (UPAT EXP)."
236 `(cond (,test ,then) 245 `(cond (,test ,then)
237 ;; Doing a test a second time: get rid of the redundancy, as above. 246 ;; Doing a test a second time: get rid of the redundancy, as above.
238 ,@(remove (assoc test else) (cdr else)))) 247 ,@(remove (assoc test else) (cdr else))))
248 ;; Invert the test if that lets us reduce the depth of the tree.
249 ((memq (car-safe then) '(if cond)) (pcase--if `(not ,test) else then))
239 (t `(if ,test ,then ,else)))) 250 (t `(if ,test ,then ,else))))
240 251
241(defun pcase--upat (qpattern) 252(defun pcase--upat (qpattern)
@@ -280,6 +291,22 @@ MATCH is the pattern that needs to be matched, of the form:
280(defun pcase--and (match matches) 291(defun pcase--and (match matches)
281 (if matches `(and ,match ,@matches) match)) 292 (if matches `(and ,match ,@matches) match))
282 293
294(defconst pcase-mutually-exclusive-predicates
295 '((symbolp . integerp)
296 (symbolp . numberp)
297 (symbolp . consp)
298 (symbolp . arrayp)
299 (symbolp . stringp)
300 (integerp . consp)
301 (integerp . arrayp)
302 (integerp . stringp)
303 (numberp . consp)
304 (numberp . arrayp)
305 (numberp . stringp)
306 (consp . arrayp)
307 (consp . stringp)
308 (arrayp . stringp)))
309
283(defun pcase--split-match (sym splitter match) 310(defun pcase--split-match (sym splitter match)
284 (cond 311 (cond
285 ((eq (car match) 'match) 312 ((eq (car match) 'match)
@@ -340,8 +367,14 @@ MATCH is the pattern that needs to be matched, of the form:
340 (cons `(and (match ,syma . ,(pcase--upat (car qpat))) 367 (cons `(and (match ,syma . ,(pcase--upat (car qpat)))
341 (match ,symd . ,(pcase--upat (cdr qpat)))) 368 (match ,symd . ,(pcase--upat (cdr qpat))))
342 :pcase--fail))) 369 :pcase--fail)))
343 ;; A QPattern but not for a cons, can only go the `else' side. 370 ;; A QPattern but not for a cons, can only go to the `else' side.
344 ((eq (car-safe pat) '\`) (cons :pcase--fail nil)))) 371 ((eq (car-safe pat) '\`) (cons :pcase--fail nil))
372 ((and (eq (car-safe pat) 'pred)
373 (or (member (cons 'consp (cadr pat))
374 pcase-mutually-exclusive-predicates)
375 (member (cons (cadr pat) 'consp)
376 pcase-mutually-exclusive-predicates)))
377 (cons :pcase--fail nil))))
345 378
346(defun pcase--split-equal (elem pat) 379(defun pcase--split-equal (elem pat)
347 (cond 380 (cond
@@ -353,7 +386,12 @@ MATCH is the pattern that needs to be matched, of the form:
353 ;; (or (integerp (cadr pat)) (symbolp (cadr pat)) 386 ;; (or (integerp (cadr pat)) (symbolp (cadr pat))
354 ;; (consp (cadr pat))) 387 ;; (consp (cadr pat)))
355 ) 388 )
356 (cons :pcase--fail nil)))) 389 (cons :pcase--fail nil))
390 ((and (eq (car-safe pat) 'pred)
391 (symbolp (cadr pat))
392 (get (cadr pat) 'side-effect-free)
393 (funcall (cadr pat) elem))
394 (cons :pcase--succeed nil))))
357 395
358(defun pcase--split-member (elems pat) 396(defun pcase--split-member (elems pat)
359 ;; Based on pcase--split-equal. 397 ;; Based on pcase--split-equal.
@@ -370,13 +408,39 @@ MATCH is the pattern that needs to be matched, of the form:
370 ;; (or (integerp (cadr pat)) (symbolp (cadr pat)) 408 ;; (or (integerp (cadr pat)) (symbolp (cadr pat))
371 ;; (consp (cadr pat))) 409 ;; (consp (cadr pat)))
372 ) 410 )
373 (cons :pcase--fail nil)))) 411 (cons :pcase--fail nil))
412 ((and (eq (car-safe pat) 'pred)
413 (symbolp (cadr pat))
414 (get (cadr pat) 'side-effect-free)
415 (let ((p (cadr pat)) (all t))
416 (dolist (elem elems)
417 (unless (funcall p elem) (setq all nil)))
418 all))
419 (cons :pcase--succeed nil))))
374 420
375(defun pcase--split-pred (upat pat) 421(defun pcase--split-pred (upat pat)
376 ;; FIXME: For predicates like (pred (> a)), two such predicates may 422 ;; FIXME: For predicates like (pred (> a)), two such predicates may
377 ;; actually refer to different variables `a'. 423 ;; actually refer to different variables `a'.
378 (if (equal upat pat) 424 (cond
379 (cons :pcase--succeed :pcase--fail))) 425 ((equal upat pat) (cons :pcase--succeed :pcase--fail))
426 ((and (eq 'pred (car upat))
427 (eq 'pred (car-safe pat))
428 (or (member (cons (cadr upat) (cadr pat))
429 pcase-mutually-exclusive-predicates)
430 (member (cons (cadr pat) (cadr upat))
431 pcase-mutually-exclusive-predicates)))
432 (cons :pcase--fail nil))
433 ;; ((and (eq 'pred (car upat))
434 ;; (eq '\` (car-safe pat))
435 ;; (symbolp (cadr upat))
436 ;; (or (symbolp (cadr pat)) (stringp (cadr pat)) (numberp (cadr pat)))
437 ;; (get (cadr upat) 'side-effect-free)
438 ;; (progn (message "Trying predicate %S" (cadr upat))
439 ;; (ignore-errors
440 ;; (funcall (cadr upat) (cadr pat)))))
441 ;; (message "Simplify pred %S against %S" upat pat)
442 ;; (cons nil :pcase--fail))
443 ))
380 444
381(defun pcase--fgrep (vars sexp) 445(defun pcase--fgrep (vars sexp)
382 "Check which of the symbols VARS appear in SEXP." 446 "Check which of the symbols VARS appear in SEXP."
@@ -391,7 +455,7 @@ MATCH is the pattern that needs to be matched, of the form:
391;; bootstrapping problems. 455;; bootstrapping problems.
392(defun pcase--u1 (matches code vars rest) 456(defun pcase--u1 (matches code vars rest)
393 "Return code that runs CODE (with VARS) if MATCHES match. 457 "Return code that runs CODE (with VARS) if MATCHES match.
394and otherwise defers to REST which is a list of branches of the form 458Otherwise, it defers to REST which is a list of branches of the form
395\(ELSE-MATCH ELSE-CODE . ELSE-VARS)." 459\(ELSE-MATCH ELSE-CODE . ELSE-VARS)."
396 ;; Depending on the order in which we choose to check each of the MATCHES, 460 ;; Depending on the order in which we choose to check each of the MATCHES,
397 ;; the resulting tree may be smaller or bigger. So in general, we'd want 461 ;; the resulting tree may be smaller or bigger. So in general, we'd want
@@ -452,8 +516,9 @@ and otherwise defers to REST which is a list of branches of the form
452 ((eq upat 'dontcare) :pcase--dontcare) 516 ((eq upat 'dontcare) :pcase--dontcare)
453 ((functionp upat) (error "Feature removed, use (pred %s)" upat)) 517 ((functionp upat) (error "Feature removed, use (pred %s)" upat))
454 ((memq (car-safe upat) '(guard pred)) 518 ((memq (car-safe upat) '(guard pred))
519 (if (eq (car upat) 'pred) (put sym 'pcase-used t))
455 (let* ((splitrest 520 (let* ((splitrest
456 (pcase--split-rest 521 (pcase--split-rest
457 sym (apply-partially #'pcase--split-pred upat) rest)) 522 sym (apply-partially #'pcase--split-pred upat) rest))
458 (then-rest (car splitrest)) 523 (then-rest (car splitrest))
459 (else-rest (cdr splitrest))) 524 (else-rest (cdr splitrest)))
@@ -480,6 +545,7 @@ and otherwise defers to REST which is a list of branches of the form
480 (pcase--u1 matches code vars then-rest) 545 (pcase--u1 matches code vars then-rest)
481 (pcase--u else-rest)))) 546 (pcase--u else-rest))))
482 ((symbolp upat) 547 ((symbolp upat)
548 (put sym 'pcase-used t)
483 (if (not (assq upat vars)) 549 (if (not (assq upat vars))
484 (pcase--u1 matches code (cons (cons upat sym) vars) rest) 550 (pcase--u1 matches code (cons (cons upat sym) vars) rest)
485 ;; Non-linear pattern. Turn it into an `eq' test. 551 ;; Non-linear pattern. Turn it into an `eq' test.
@@ -487,6 +553,7 @@ and otherwise defers to REST which is a list of branches of the form
487 matches) 553 matches)
488 code vars rest))) 554 code vars rest)))
489 ((eq (car-safe upat) '\`) 555 ((eq (car-safe upat) '\`)
556 (put sym 'pcase-used t)
490 (pcase--q1 sym (cadr upat) matches code vars rest)) 557 (pcase--q1 sym (cadr upat) matches code vars rest))
491 ((eq (car-safe upat) 'or) 558 ((eq (car-safe upat) 'or)
492 (let ((all (> (length (cdr upat)) 1)) 559 (let ((all (> (length (cdr upat)) 1))
@@ -546,7 +613,7 @@ and otherwise defers to REST which is a list of branches of the form
546 613
547(defun pcase--q1 (sym qpat matches code vars rest) 614(defun pcase--q1 (sym qpat matches code vars rest)
548 "Return code that runs CODE if SYM matches QPAT and if MATCHES match. 615 "Return code that runs CODE if SYM matches QPAT and if MATCHES match.
549and if not, defers to REST which is a list of branches of the form 616Otherwise, it defers to REST which is a list of branches of the form
550\(OTHER_MATCH OTHER-CODE . OTHER-VARS)." 617\(OTHER_MATCH OTHER-CODE . OTHER-VARS)."
551 (cond 618 (cond
552 ((eq (car-safe qpat) '\,) (error "Can't use `,UPATTERN")) 619 ((eq (car-safe qpat) '\,) (error "Can't use `,UPATTERN"))
@@ -555,22 +622,28 @@ and if not, defers to REST which is a list of branches of the form
555 ;; FIXME. 622 ;; FIXME.
556 (error "Vector QPatterns not implemented yet")) 623 (error "Vector QPatterns not implemented yet"))
557 ((consp qpat) 624 ((consp qpat)
558 (let ((syma (make-symbol "xcar")) 625 (let* ((syma (make-symbol "xcar"))
559 (symd (make-symbol "xcdr"))) 626 (symd (make-symbol "xcdr"))
560 (let* ((splitrest (pcase--split-rest 627 (splitrest (pcase--split-rest
561 sym 628 sym
562 (apply-partially #'pcase--split-consp syma symd) 629 (apply-partially #'pcase--split-consp syma symd)
563 rest)) 630 rest))
564 (then-rest (car splitrest)) 631 (then-rest (car splitrest))
565 (else-rest (cdr splitrest))) 632 (else-rest (cdr splitrest))
566 (pcase--if `(consp ,sym) 633 (then-body (pcase--u1 `((match ,syma . ,(pcase--upat (car qpat)))
567 `(let ((,syma (car ,sym)) 634 (match ,symd . ,(pcase--upat (cdr qpat)))
568 (,symd (cdr ,sym))) 635 ,@matches)
569 ,(pcase--u1 `((match ,syma . ,(pcase--upat (car qpat))) 636 code vars then-rest)))
570 (match ,symd . ,(pcase--upat (cdr qpat))) 637 (pcase--if
571 ,@matches) 638 `(consp ,sym)
572 code vars then-rest)) 639 ;; We want to be careful to only add bindings that are used.
573 (pcase--u else-rest))))) 640 ;; The byte-compiler could do that for us, but it would have to pay
641 ;; attention to the `consp' test in order to figure out that car/cdr
642 ;; can't signal errors and our byte-compiler is not that clever.
643 `(let (,@(if (get syma 'pcase-used) `((,syma (car ,sym))))
644 ,@(if (get symd 'pcase-used) `((,symd (cdr ,sym)))))
645 ,then-body)
646 (pcase--u else-rest))))
574 ((or (integerp qpat) (symbolp qpat) (stringp qpat)) 647 ((or (integerp qpat) (symbolp qpat) (stringp qpat))
575 (let* ((splitrest (pcase--split-rest 648 (let* ((splitrest (pcase--split-rest
576 sym (apply-partially 'pcase--split-equal qpat) rest)) 649 sym (apply-partially 'pcase--split-equal qpat) rest))
diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el
index 22795a47d98..6033648298d 100644
--- a/lisp/emacs-lock.el
+++ b/lisp/emacs-lock.el
@@ -88,7 +88,8 @@ If the buffer is locked, signal error and display its name."
88 (if emacs-lock-buffer-locked 88 (if emacs-lock-buffer-locked
89 (setq emacs-lock-from-exiting t))) 89 (setq emacs-lock-from-exiting t)))
90 90
91(add-hook 'kill-emacs-hook 'check-emacs-lock) 91(unless noninteractive
92 (add-hook 'kill-emacs-hook 'check-emacs-lock))
92(add-hook 'kill-buffer-hook 'emacs-lock-check-buffer-lock) 93(add-hook 'kill-buffer-hook 'emacs-lock-check-buffer-lock)
93(add-hook 'shell-mode-hook 'emacs-lock-was-buffer-locked) 94(add-hook 'shell-mode-hook 'emacs-lock-was-buffer-locked)
94(add-hook 'shell-mode-hook 'emacs-lock-shell-sentinel) 95(add-hook 'shell-mode-hook 'emacs-lock-shell-sentinel)
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index fae249da9d3..5daef7f9666 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -776,7 +776,7 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
776 (viper-copy-event (viper-seq-last-elt key)))) 776 (viper-copy-event (viper-seq-last-elt key))))
777 777
778 (if (commandp com) 778 (if (commandp com)
779 ;; pretend that current state is the state we excaped to 779 ;; pretend that current state is the state we escaped to
780 (let ((viper-current-state state)) 780 (let ((viper-current-state state))
781 (setq prefix-arg (or prefix-arg arg)) 781 (setq prefix-arg (or prefix-arg arg))
782 (command-execute com))) 782 (command-execute com)))
@@ -2375,7 +2375,7 @@ problems."
2375 (if (eq viper-intermediate-command 'viper-repeat) 2375 (if (eq viper-intermediate-command 'viper-repeat)
2376 (viper-change-subr (mark t) (point)) 2376 (viper-change-subr (mark t) (point))
2377 (viper-change (mark t) (point))) 2377 (viper-change (mark t) (point)))
2378 ;; com is set to ?r when we repeat this comand with dot 2378 ;; com is set to ?r when we repeat this command with dot
2379 (viper-set-destructive-command (list 'viper-substitute val ?r nil nil nil)) 2379 (viper-set-destructive-command (list 'viper-substitute val ?r nil nil nil))
2380 )) 2380 ))
2381 2381
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 2996fee9bcb..e05828dfeea 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,7 @@
12011-03-04 Julien Danjou <julien@danjou.info>
2
3 * erc-track.el (erc-track-visibility): Fix :type. (Bug#6369)
4
12011-02-10 Stefan Monnier <monnier@iro.umontreal.ca> 52011-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * erc-list.el (erc-list-menu-mode-map): Move initialization 7 * erc-list.el (erc-list-menu-mode-map): Move initialization
diff --git a/lisp/erc/ChangeLog.01 b/lisp/erc/ChangeLog.01
index 962acd5bfc6..4016586abc7 100644
--- a/lisp/erc/ChangeLog.01
+++ b/lisp/erc/ChangeLog.01
@@ -584,9 +584,9 @@
584 584
585 * debian/maint/conffiles.in: new file 585 * debian/maint/conffiles.in: new file
586 586
587 * debian/maint/conffiles: superceded by conffiles.in 587 * debian/maint/conffiles: superseded by conffiles.in
588 588
589 * debian/scripts/startup: superceded by startup.erc 589 * debian/scripts/startup: superseded by startup.erc
590 590
5912001-10-25 Mario Lang <mlang@delysid.org> 5912001-10-25 Mario Lang <mlang@delysid.org>
592 592
@@ -609,7 +609,7 @@
609 609
610 * debian/maint/postinst, debian/maint/prerm, debian/scripts/install, 610 * debian/maint/postinst, debian/maint/prerm, debian/scripts/install,
611 debian/scripts/remove: 611 debian/scripts/remove:
612 removed, superceded by it's .in counterpart 612 removed, superseded by its .in counterpart
613 613
6142001-10-25 Mario Lang <mlang@delysid.org> 6142001-10-25 Mario Lang <mlang@delysid.org>
615 615
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index a89244f695d..28c1ced91c6 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -84,8 +84,8 @@ Activity means that there was no user input in the last 10 seconds."
84 :type '(choice (const :tag "All frames" t) 84 :type '(choice (const :tag "All frames" t)
85 (const :tag "All visible frames" visible) 85 (const :tag "All visible frames" visible)
86 (const :tag "Only the selected frame" nil) 86 (const :tag "Only the selected frame" nil)
87 (const :tag "Only the selected frame if it was active" 87 (const :tag "Only the selected frame if it is visible"
88 active))) 88 selected-visible)))
89 89
90(defcustom erc-track-exclude nil 90(defcustom erc-track-exclude nil
91 "A list targets (channel names or query targets) which should not be tracked." 91 "A list targets (channel names or query targets) which should not be tracked."
diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el
index aa138cb4dcb..4e1dbd41045 100644
--- a/lisp/eshell/em-alias.el
+++ b/lisp/eshell/em-alias.el
@@ -117,8 +117,9 @@ gained by using this module."
117 ;; :link '(custom-manual "(eshell)Auto-correction of bad commands") 117 ;; :link '(custom-manual "(eshell)Auto-correction of bad commands")
118 :group 'eshell-alias) 118 :group 'eshell-alias)
119 119
120(defcustom eshell-alias-load-hook '(eshell-alias-initialize) 120(defcustom eshell-alias-load-hook nil
121 "A hook that gets run when `eshell-alias' is loaded." 121 "A hook that gets run when `eshell-alias' is loaded."
122 :version "24.1" ; removed eshell-alias-initialize
122 :type 'hook 123 :type 'hook
123 :group 'eshell-alias) 124 :group 'eshell-alias)
124 125
@@ -156,7 +157,7 @@ command, which will automatically write them to the file named by
156(defun eshell/alias (&optional alias &rest definition) 157(defun eshell/alias (&optional alias &rest definition)
157 "Define an ALIAS in the user's alias list using DEFINITION." 158 "Define an ALIAS in the user's alias list using DEFINITION."
158 (if (not alias) 159 (if (not alias)
159 (eshell-for alias eshell-command-aliases-list 160 (dolist (alias eshell-command-aliases-list)
160 (eshell-print (apply 'format "alias %s %s\n" alias))) 161 (eshell-print (apply 'format "alias %s %s\n" alias)))
161 (if (not definition) 162 (if (not definition)
162 (setq eshell-command-aliases-list 163 (setq eshell-command-aliases-list
@@ -238,7 +239,7 @@ command, which will automatically write them to the file named by
238 "Find all possible completions for NAME. 239 "Find all possible completions for NAME.
239These are all the command aliases which begin with NAME." 240These are all the command aliases which begin with NAME."
240 (let (completions) 241 (let (completions)
241 (eshell-for alias eshell-command-aliases-list 242 (dolist (alias eshell-command-aliases-list)
242 (if (string-match (concat "^" name) (car alias)) 243 (if (string-match (concat "^" name) (car alias))
243 (setq completions (cons (car alias) completions)))) 244 (setq completions (cons (car alias) completions))))
244 completions)) 245 completions))
diff --git a/lisp/eshell/em-banner.el b/lisp/eshell/em-banner.el
index b2ebde98cee..ce987f132e3 100644
--- a/lisp/eshell/em-banner.el
+++ b/lisp/eshell/em-banner.el
@@ -64,8 +64,9 @@ This can be any sexp, and should end with at least two newlines."
64 64
65(put 'eshell-banner-message 'risky-local-variable t) 65(put 'eshell-banner-message 'risky-local-variable t)
66 66
67(defcustom eshell-banner-load-hook '(eshell-banner-initialize) 67(defcustom eshell-banner-load-hook nil
68 "A list of functions to run when `eshell-banner' is loaded." 68 "A list of functions to run when `eshell-banner' is loaded."
69 :version "24.1" ; removed eshell-banner-initialize
69 :type 'hook 70 :type 'hook
70 :group 'eshell-banner) 71 :group 'eshell-banner)
71 72
@@ -81,14 +82,6 @@ This can be any sexp, and should end with at least two newlines."
81 (assert msg) 82 (assert msg)
82 (eshell-interactive-print msg)))) 83 (eshell-interactive-print msg))))
83 84
84(eshell-deftest banner banner-displayed
85 "Startup banner is displayed at point-min"
86 (assert eshell-banner-message)
87 (let ((msg (eval eshell-banner-message)))
88 (assert msg)
89 (goto-char (point-min))
90 (looking-at msg)))
91
92(provide 'em-banner) 85(provide 'em-banner)
93 86
94;; Local Variables: 87;; Local Variables:
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index f3f104c1ede..c551684210c 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -84,8 +84,9 @@ variable names, arguments, etc."
84 84
85;;; User Variables: 85;;; User Variables:
86 86
87(defcustom eshell-cmpl-load-hook '(eshell-cmpl-initialize) 87(defcustom eshell-cmpl-load-hook nil
88 "A list of functions to run when `eshell-cmpl' is loaded." 88 "A list of functions to run when `eshell-cmpl' is loaded."
89 :version "24.1" ; removed eshell-cmpl-initialize
89 :type 'hook 90 :type 'hook
90 :group 'eshell-cmpl) 91 :group 'eshell-cmpl)
91 92
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index 64555ab15ef..1aa2c34c395 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -58,8 +58,9 @@ they lack somewhat in feel from the typical shell equivalents."
58 58
59;;; User Variables: 59;;; User Variables:
60 60
61(defcustom eshell-dirs-load-hook '(eshell-dirs-initialize) 61(defcustom eshell-dirs-load-hook nil
62 "A hook that gets run when `eshell-dirs' is loaded." 62 "A hook that gets run when `eshell-dirs' is loaded."
63 :version "24.1" ; removed eshell-dirs-initialize
63 :type 'hook 64 :type 'hook
64 :group 'eshell-dirs) 65 :group 'eshell-dirs)
65 66
@@ -233,7 +234,7 @@ Thus, this does not include the current directory.")
233 234
234(defun eshell-save-some-last-dir () 235(defun eshell-save-some-last-dir ()
235 "Save the list-dir-ring for any open Eshell buffers." 236 "Save the list-dir-ring for any open Eshell buffers."
236 (eshell-for buf (buffer-list) 237 (dolist (buf (buffer-list))
237 (if (buffer-live-p buf) 238 (if (buffer-live-p buf)
238 (with-current-buffer buf 239 (with-current-buffer buf
239 (if (and eshell-mode 240 (if (and eshell-mode
diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el
index 2a565c5c827..732c6c05bfe 100644
--- a/lisp/eshell/em-glob.el
+++ b/lisp/eshell/em-glob.el
@@ -61,8 +61,9 @@ by zsh for filename generation."
61 61
62;;; User Variables: 62;;; User Variables:
63 63
64(defcustom eshell-glob-load-hook '(eshell-glob-initialize) 64(defcustom eshell-glob-load-hook nil
65 "A list of functions to run when `eshell-glob' is loaded." 65 "A list of functions to run when `eshell-glob' is loaded."
66 :version "24.1" ; removed eshell-glob-initialize
66 :type 'hook 67 :type 'hook
67 :group 'eshell-glob) 68 :group 'eshell-glob)
68 69
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 5ec529f4b8f..993e9d63a94 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -70,8 +70,9 @@
70 70
71;;; User Variables: 71;;; User Variables:
72 72
73(defcustom eshell-hist-load-hook '(eshell-hist-initialize) 73(defcustom eshell-hist-load-hook nil
74 "A list of functions to call when loading `eshell-hist'." 74 "A list of functions to call when loading `eshell-hist'."
75 :version "24.1" ; removed eshell-hist-initialize
75 :type 'hook 76 :type 'hook
76 :group 'eshell-hist) 77 :group 'eshell-hist)
77 78
@@ -292,7 +293,7 @@ element, regardless of any text on the command line. In that case,
292 293
293(defun eshell-save-some-history () 294(defun eshell-save-some-history ()
294 "Save the history for any open Eshell buffers." 295 "Save the history for any open Eshell buffers."
295 (eshell-for buf (buffer-list) 296 (dolist (buf (buffer-list))
296 (if (buffer-live-p buf) 297 (if (buffer-live-p buf)
297 (with-current-buffer buf 298 (with-current-buffer buf
298 (if (and eshell-mode 299 (if (and eshell-mode
@@ -730,7 +731,7 @@ matched."
730 (narrow-to-region here (point)) 731 (narrow-to-region here (point))
731 (goto-char (point-min)) 732 (goto-char (point-min))
732 (let ((modifiers (cdr (eshell-parse-modifiers)))) 733 (let ((modifiers (cdr (eshell-parse-modifiers))))
733 (eshell-for mod modifiers 734 (dolist (mod modifiers)
734 (setq hist (funcall mod hist))) 735 (setq hist (funcall mod hist)))
735 hist)) 736 hist))
736 (delete-region here (point))))) 737 (delete-region here (point)))))
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index 7714629f2fa..4ef259dee4b 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -561,7 +561,7 @@ relative to that directory."
561 (when (or (eq listing-style 'long-listing) show-size) 561 (when (or (eq listing-style 'long-listing) show-size)
562 (let ((total 0.0)) 562 (let ((total 0.0))
563 (setq size-width 0) 563 (setq size-width 0)
564 (eshell-for e entries 564 (dolist (e entries)
565 (if (nth 7 (cdr e)) 565 (if (nth 7 (cdr e))
566 (setq total (+ total (nth 7 (cdr e))) 566 (setq total (+ total (nth 7 (cdr e)))
567 size-width 567 size-width
@@ -651,7 +651,7 @@ Each member of FILES is either a string or a cons cell of the form
651 (not (eq eshell-in-pipeline-p 'last)) 651 (not (eq eshell-in-pipeline-p 'last))
652 (not (eq listing-style 'by-lines))) 652 (not (eq listing-style 'by-lines)))
653 (memq listing-style '(long-listing single-column))) 653 (memq listing-style '(long-listing single-column)))
654 (eshell-for file files 654 (dolist (file files)
655 (if file 655 (if file
656 (eshell-ls-file file size-width copy-fileinfo))) 656 (eshell-ls-file file size-width copy-fileinfo)))
657 (let ((f files) 657 (let ((f files)
@@ -676,7 +676,7 @@ Each member of FILES is either a string or a cons cell of the form
676 (setcdr f (cddr f)))))) 676 (setcdr f (cddr f))))))
677 (if (not show-size) 677 (if (not show-size)
678 (setq display-files (mapcar 'eshell-ls-annotate files)) 678 (setq display-files (mapcar 'eshell-ls-annotate files))
679 (eshell-for file files 679 (dolist (file files)
680 (let* ((str (eshell-ls-printable-size (nth 7 (cdr file)) t)) 680 (let* ((str (eshell-ls-printable-size (nth 7 (cdr file)) t))
681 (len (length str))) 681 (len (length str)))
682 (if (< len size-width) 682 (if (< len size-width)
@@ -696,7 +696,7 @@ Each member of FILES is either a string or a cons cell of the form
696 (columns (length col-widths)) 696 (columns (length col-widths))
697 (col-index 1) 697 (col-index 1)
698 need-return) 698 need-return)
699 (eshell-for file display-files 699 (dolist (file display-files)
700 (let ((name 700 (let ((name
701 (if (car file) 701 (if (car file)
702 (if show-size 702 (if show-size
@@ -731,7 +731,7 @@ ROOT-DIR, if non-nil, specifies the root directory of the listing, to
731which non-absolute directory names will be made relative if ever they 731which non-absolute directory names will be made relative if ever they
732need to be printed." 732need to be printed."
733 (let (dirs files show-names need-return (size-width 0)) 733 (let (dirs files show-names need-return (size-width 0))
734 (eshell-for entry entries 734 (dolist (entry entries)
735 (if (and (not dir-literal) 735 (if (and (not dir-literal)
736 (or (eshell-ls-filetype-p (cdr entry) ?d) 736 (or (eshell-ls-filetype-p (cdr entry) ?d)
737 (and (eshell-ls-filetype-p (cdr entry) ?l) 737 (and (eshell-ls-filetype-p (cdr entry) ?l)
@@ -757,7 +757,7 @@ need to be printed."
757 (setq need-return t)) 757 (setq need-return t))
758 (setq show-names (or show-recursive 758 (setq show-names (or show-recursive
759 (> (+ (length files) (length dirs)) 1))) 759 (> (+ (length files) (length dirs)) 1)))
760 (eshell-for dir (eshell-ls-sort-entries dirs) 760 (dolist (dir (eshell-ls-sort-entries dirs))
761 (if (and need-return (not dir-literal)) 761 (if (and need-return (not dir-literal))
762 (funcall insert-func "\n")) 762 (funcall insert-func "\n"))
763 (eshell-ls-dir dir show-names 763 (eshell-ls-dir dir show-names
diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el
index 33085c067fd..f3027ea9b5e 100644
--- a/lisp/eshell/em-pred.el
+++ b/lisp/eshell/em-pred.el
@@ -59,8 +59,9 @@ ordinary strings."
59 59
60;;; User Variables: 60;;; User Variables:
61 61
62(defcustom eshell-pred-load-hook '(eshell-pred-initialize) 62(defcustom eshell-pred-load-hook nil
63 "A list of functions to run when `eshell-pred' is loaded." 63 "A list of functions to run when `eshell-pred' is loaded."
64 :version "24.1" ; removed eshell-pred-initialize
64 :type 'hook 65 :type 'hook
65 :group 'eshell-pred) 66 :group 'eshell-pred)
66 67
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index 448d2cdf303..3e87acc6d1e 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -37,8 +37,9 @@ as is common with most shells."
37 37
38;;; User Variables: 38;;; User Variables:
39 39
40(defcustom eshell-prompt-load-hook '(eshell-prompt-initialize) 40(defcustom eshell-prompt-load-hook nil
41 "A list of functions to call when loading `eshell-prompt'." 41 "A list of functions to call when loading `eshell-prompt'."
42 :version "24.1" ; removed eshell-prompt-initialize
42 :type 'hook 43 :type 'hook
43 :group 'eshell-prompt) 44 :group 'eshell-prompt)
44 45
diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el
index 6def23e1b71..2c346dfcd3d 100644
--- a/lisp/eshell/em-rebind.el
+++ b/lisp/eshell/em-rebind.el
@@ -41,8 +41,9 @@ the behavior of normal shells while the user editing new input text."
41 41
42;;; User Variables: 42;;; User Variables:
43 43
44(defcustom eshell-rebind-load-hook '(eshell-rebind-initialize) 44(defcustom eshell-rebind-load-hook nil
45 "A list of functions to call when loading `eshell-rebind'." 45 "A list of functions to call when loading `eshell-rebind'."
46 :version "24.1" ; removed eshell-rebind-initialize
46 :type 'hook 47 :type 'hook
47 :group 'eshell-rebind) 48 :group 'eshell-rebind)
48 49
diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el
index ed4ad1c0712..d76e19cdd07 100644
--- a/lisp/eshell/em-script.el
+++ b/lisp/eshell/em-script.el
@@ -34,8 +34,9 @@ commands, as a script file."
34 34
35;;; User Variables: 35;;; User Variables:
36 36
37(defcustom eshell-script-load-hook '(eshell-script-initialize) 37(defcustom eshell-script-load-hook nil
38 "A list of functions to call when loading `eshell-script'." 38 "A list of functions to call when loading `eshell-script'."
39 :version "24.1" ; removed eshell-script-initialize
39 :type 'hook 40 :type 'hook
40 :group 'eshell-script) 41 :group 'eshell-script)
41 42
diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el
index 2c54930e439..f08fec8f8fa 100644
--- a/lisp/eshell/em-smart.el
+++ b/lisp/eshell/em-smart.el
@@ -84,8 +84,9 @@ it to get a real sense of how it works."
84 84
85;;; User Variables: 85;;; User Variables:
86 86
87(defcustom eshell-smart-load-hook '(eshell-smart-initialize) 87(defcustom eshell-smart-load-hook nil
88 "A list of functions to call when loading `eshell-smart'." 88 "A list of functions to call when loading `eshell-smart'."
89 :version "24.1" ; removed eshell-smart-initialize
89 :type 'hook 90 :type 'hook
90 :group 'eshell-smart) 91 :group 'eshell-smart)
91 92
diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el
index be394ba5b22..7d5fbbeabeb 100644
--- a/lisp/eshell/em-term.el
+++ b/lisp/eshell/em-term.el
@@ -46,8 +46,9 @@ which commands are considered visual in nature."
46 46
47;;; User Variables: 47;;; User Variables:
48 48
49(defcustom eshell-term-load-hook '(eshell-term-initialize) 49(defcustom eshell-term-load-hook nil
50 "A list of functions to call when loading `eshell-term'." 50 "A list of functions to call when loading `eshell-term'."
51 :version "24.1" ; removed eshell-term-initialize
51 :type 'hook 52 :type 'hook
52 :group 'eshell-term) 53 :group 'eshell-term)
53 54
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index dc5650d240e..707f2ebc2ce 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -53,8 +53,9 @@ by name)."
53 :tag "UNIX commands in Lisp" 53 :tag "UNIX commands in Lisp"
54 :group 'eshell-module) 54 :group 'eshell-module)
55 55
56(defcustom eshell-unix-load-hook '(eshell-unix-initialize) 56(defcustom eshell-unix-load-hook nil
57 "A list of functions to run when `eshell-unix' is loaded." 57 "A list of functions to run when `eshell-unix' is loaded."
58 :version "24.1" ; removed eshell-unix-initialize
58 :type 'hook 59 :type 'hook
59 :group 'eshell-unix) 60 :group 'eshell-unix)
60 61
@@ -587,7 +588,7 @@ symlink, then revert to the system's definition of cat."
587 (setq args (eshell-stringify-list (eshell-flatten-list args))) 588 (setq args (eshell-stringify-list (eshell-flatten-list args)))
588 (if (or eshell-in-pipeline-p 589 (if (or eshell-in-pipeline-p
589 (catch 'special 590 (catch 'special
590 (eshell-for arg args 591 (dolist (arg args)
591 (unless (or (and (stringp arg) 592 (unless (or (and (stringp arg)
592 (> (length arg) 0) 593 (> (length arg) 0)
593 (eq (aref arg 0) ?-)) 594 (eq (aref arg 0) ?-))
@@ -610,12 +611,12 @@ symlink, then revert to the system's definition of cat."
610 :show-usage 611 :show-usage
611 :usage "[OPTION] FILE... 612 :usage "[OPTION] FILE...
612Concatenate FILE(s), or standard input, to standard output.") 613Concatenate FILE(s), or standard input, to standard output.")
613 (eshell-for file args 614 (dolist (file args)
614 (if (string= file "-") 615 (if (string= file "-")
615 (throw 'eshell-external 616 (throw 'eshell-external
616 (eshell-external-command "cat" args)))) 617 (eshell-external-command "cat" args))))
617 (let ((curbuf (current-buffer))) 618 (let ((curbuf (current-buffer)))
618 (eshell-for file args 619 (dolist (file args)
619 (with-temp-buffer 620 (with-temp-buffer
620 (insert-file-contents file) 621 (insert-file-contents file)
621 (goto-char (point-min)) 622 (goto-char (point-min))
@@ -851,7 +852,7 @@ external command."
851 (let ((ext-du (eshell-search-path "du"))) 852 (let ((ext-du (eshell-search-path "du")))
852 (if (and ext-du 853 (if (and ext-du
853 (not (catch 'have-ange-path 854 (not (catch 'have-ange-path
854 (eshell-for arg args 855 (dolist (arg args)
855 (if (string-equal 856 (if (string-equal
856 (file-remote-p (expand-file-name arg) 'method) "ftp") 857 (file-remote-p (expand-file-name arg) 'method) "ftp")
857 (throw 'have-ange-path t)))))) 858 (throw 'have-ange-path t))))))
@@ -1055,7 +1056,7 @@ Become another USER during a login session.")
1055 "localhost")) 1056 "localhost"))
1056 (dir (or (file-remote-p default-directory 'localname) 1057 (dir (or (file-remote-p default-directory 'localname)
1057 (expand-file-name default-directory)))) 1058 (expand-file-name default-directory))))
1058 (eshell-for arg args 1059 (dolist (arg args)
1059 (if (string-equal arg "-") (setq login t) (setq user arg))) 1060 (if (string-equal arg "-") (setq login t) (setq user arg)))
1060 ;; `eshell-eval-using-options' does not handle "-". 1061 ;; `eshell-eval-using-options' does not handle "-".
1061 (if (member "-" orig-args) (setq login t)) 1062 (if (member "-" orig-args) (setq login t))
diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el
index f42440ae4ec..1fb8b7f4c32 100644
--- a/lisp/eshell/esh-arg.el
+++ b/lisp/eshell/esh-arg.el
@@ -117,8 +117,9 @@ treated as a literal character."
117 117
118;;; User Variables: 118;;; User Variables:
119 119
120(defcustom eshell-arg-load-hook '(eshell-arg-initialize) 120(defcustom eshell-arg-load-hook nil
121 "A hook that gets run when `eshell-arg' is loaded." 121 "A hook that gets run when `eshell-arg' is loaded."
122 :version "24.1" ; removed eshell-arg-initialize
122 :type 'hook 123 :type 'hook
123 :group 'eshell-arg) 124 :group 'eshell-arg)
124 125
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 0567beb9a53..bdcdc453272 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -229,8 +229,9 @@ return non-nil if the command is complex."
229 229
230;;; User Variables: 230;;; User Variables:
231 231
232(defcustom eshell-cmd-load-hook '(eshell-cmd-initialize) 232(defcustom eshell-cmd-load-hook nil
233 "A hook that gets run when `eshell-cmd' is loaded." 233 "A hook that gets run when `eshell-cmd' is loaded."
234 :version "24.1" ; removed eshell-cmd-initialize
234 :type 'hook 235 :type 'hook
235 :group 'eshell-cmd) 236 :group 'eshell-cmd)
236 237
@@ -319,18 +320,6 @@ otherwise t.")
319 (add-hook 'pcomplete-try-first-hook 320 (add-hook 'pcomplete-try-first-hook
320 'eshell-complete-lisp-symbols nil t))) 321 'eshell-complete-lisp-symbols nil t)))
321 322
322(eshell-deftest var last-result-var
323 "\"last result\" variable"
324 (eshell-command-result-p "+ 1 2; + $$ 2" "3\n5\n"))
325
326(eshell-deftest var last-result-var2
327 "\"last result\" variable"
328 (eshell-command-result-p "+ 1 2; + $$ $$" "3\n6\n"))
329
330(eshell-deftest var last-arg-var
331 "\"last arg\" variable"
332 (eshell-command-result-p "+ 1 2; + $_ 4" "3\n6\n"))
333
334(defun eshell-complete-lisp-symbols () 323(defun eshell-complete-lisp-symbols ()
335 "If there is a user reference, complete it." 324 "If there is a user reference, complete it."
336 (let ((arg (pcomplete-actual-arg))) 325 (let ((arg (pcomplete-actual-arg)))
@@ -440,32 +429,12 @@ hooks should be run before and after the command."
440 (eq (caar terms) 'eshell-command-to-value)) 429 (eq (caar terms) 'eshell-command-to-value))
441 (car (cdar terms)))) 430 (car (cdar terms))))
442 431
443(eshell-deftest cmd lisp-command
444 "Evaluate Lisp command"
445 (eshell-command-result-p "(+ 1 2)" "3"))
446
447(eshell-deftest cmd lisp-command-args
448 "Evaluate Lisp command (ignore args)"
449 (eshell-command-result-p "(+ 1 2) 3" "3"))
450
451(defun eshell-rewrite-initial-subcommand (terms) 432(defun eshell-rewrite-initial-subcommand (terms)
452 "Rewrite a subcommand in initial position, such as '{+ 1 2}'." 433 "Rewrite a subcommand in initial position, such as '{+ 1 2}'."
453 (if (and (listp (car terms)) 434 (if (and (listp (car terms))
454 (eq (caar terms) 'eshell-as-subcommand)) 435 (eq (caar terms) 'eshell-as-subcommand))
455 (car terms))) 436 (car terms)))
456 437
457(eshell-deftest cmd subcommand
458 "Run subcommand"
459 (eshell-command-result-p "{+ 1 2}" "3\n"))
460
461(eshell-deftest cmd subcommand-args
462 "Run subcommand (ignore args)"
463 (eshell-command-result-p "{+ 1 2} 3" "3\n"))
464
465(eshell-deftest cmd subcommand-lisp
466 "Run subcommand + Lisp form"
467 (eshell-command-result-p "{(+ 1 2)}" "3\n"))
468
469(defun eshell-rewrite-named-command (terms) 438(defun eshell-rewrite-named-command (terms)
470 "If no other rewriting rule transforms TERMS, assume a named command." 439 "If no other rewriting rule transforms TERMS, assume a named command."
471 (let ((sym (if eshell-in-pipeline-p 440 (let ((sym (if eshell-in-pipeline-p
@@ -477,10 +446,6 @@ hooks should be run before and after the command."
477 (list sym cmd (append (list 'list) (cdr terms))) 446 (list sym cmd (append (list 'list) (cdr terms)))
478 (list sym cmd)))) 447 (list sym cmd))))
479 448
480(eshell-deftest cmd named-command
481 "Execute named command"
482 (eshell-command-result-p "+ 1 2" "3\n"))
483
484(defvar eshell-command-body) 449(defvar eshell-command-body)
485(defvar eshell-test-body) 450(defvar eshell-test-body)
486 451
@@ -987,7 +952,7 @@ at the moment are:
987 (not (member name eshell-complex-commands)) 952 (not (member name eshell-complex-commands))
988 (catch 'simple 953 (catch 'simple
989 (progn 954 (progn
990 (eshell-for pred eshell-complex-commands 955 (dolist (pred eshell-complex-commands)
991 (if (and (functionp pred) 956 (if (and (functionp pred)
992 (funcall pred name)) 957 (funcall pred name))
993 (throw 'simple nil))) 958 (throw 'simple nil)))
@@ -1165,7 +1130,7 @@ be finished later after the completion of an asynchronous subprocess."
1165 (if (and (eq (car form) 'let) 1130 (if (and (eq (car form) 'let)
1166 (not (eq (car (cadr args)) 'eshell-do-eval))) 1131 (not (eq (car (cadr args)) 'eshell-do-eval)))
1167 (eshell-manipulate "evaluating let args" 1132 (eshell-manipulate "evaluating let args"
1168 (eshell-for letarg (car args) 1133 (dolist (letarg (car args))
1169 (if (and (listp letarg) 1134 (if (and (listp letarg)
1170 (not (eq (cadr letarg) 'quote))) 1135 (not (eq (cadr letarg) 'quote)))
1171 (setcdr letarg 1136 (setcdr letarg
@@ -1241,7 +1206,7 @@ be finished later after the completion of an asynchronous subprocess."
1241 1206
1242(defun eshell/which (command &rest names) 1207(defun eshell/which (command &rest names)
1243 "Identify the COMMAND, and where it is located." 1208 "Identify the COMMAND, and where it is located."
1244 (eshell-for name (cons command names) 1209 (dolist (name (cons command names))
1245 (let (program alias direct) 1210 (let (program alias direct)
1246 (if (eq (aref name 0) eshell-explicit-command-char) 1211 (if (eq (aref name 0) eshell-explicit-command-char)
1247 (setq name (substring name 1) 1212 (setq name (substring name 1)
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index f0b9a5eb083..3acbeac0b89 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -46,8 +46,9 @@ loaded into memory, thus beginning a new process."
46 46
47;;; User Variables: 47;;; User Variables:
48 48
49(defcustom eshell-ext-load-hook '(eshell-ext-initialize) 49(defcustom eshell-ext-load-hook nil
50 "A hook that gets run when `eshell-ext' is loaded." 50 "A hook that gets run when `eshell-ext' is loaded."
51 :version "24.1" ; removed eshell-ext-initialize
51 :type 'hook 52 :type 'hook
52 :group 'eshell-ext) 53 :group 'eshell-ext)
53 54
@@ -202,7 +203,7 @@ causing the user to wonder if anything's really going on..."
202(defun eshell-external-command (command args) 203(defun eshell-external-command (command args)
203 "Insert output from an external COMMAND, using ARGS." 204 "Insert output from an external COMMAND, using ARGS."
204 (setq args (eshell-stringify-list (eshell-flatten-list args))) 205 (setq args (eshell-stringify-list (eshell-flatten-list args)))
205 (if (string-equal (file-remote-p default-directory 'method) "ftp") 206 (if (file-remote-p default-directory)
206 (eshell-remote-command command args)) 207 (eshell-remote-command command args))
207 (let ((interp (eshell-find-interpreter command))) 208 (let ((interp (eshell-find-interpreter command)))
208 (assert interp) 209 (assert interp)
@@ -263,7 +264,7 @@ line of the form #!<interp>."
263 (let ((finterp 264 (let ((finterp
264 (catch 'found 265 (catch 'found
265 (ignore 266 (ignore
266 (eshell-for possible eshell-interpreter-alist 267 (dolist (possible eshell-interpreter-alist)
267 (cond 268 (cond
268 ((functionp (car possible)) 269 ((functionp (car possible))
269 (and (funcall (car possible) file) 270 (and (funcall (car possible) file)
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index ef8966f1d7d..71fae34b360 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -71,8 +71,9 @@ though they were files."
71 71
72;;; User Variables: 72;;; User Variables:
73 73
74(defcustom eshell-io-load-hook '(eshell-io-initialize) 74(defcustom eshell-io-load-hook nil
75 "A hook that gets run when `eshell-io' is loaded." 75 "A hook that gets run when `eshell-io' is loaded."
76 :version "24.1" ; removed eshell-io-initialize
76 :type 'hook 77 :type 'hook
77 :group 'eshell-io) 78 :group 'eshell-io)
78 79
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 3735ee35fd5..10623dba8e3 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -89,9 +89,10 @@ That is to say, the first time during an Emacs session."
89 :type 'hook 89 :type 'hook
90 :group 'eshell-mode) 90 :group 'eshell-mode)
91 91
92(defcustom eshell-exit-hook '(eshell-query-kill-processes) 92(defcustom eshell-exit-hook nil
93 "A hook that is run whenever `eshell' is exited. 93 "A hook that is run whenever `eshell' is exited.
94This hook is only run if exiting actually kills the buffer." 94This hook is only run if exiting actually kills the buffer."
95 :version "24.1" ; removed eshell-query-kill-processes
95 :type 'hook 96 :type 'hook
96 :group 'eshell-mode) 97 :group 'eshell-mode)
97 98
@@ -287,6 +288,17 @@ This is used by `eshell-watch-for-password-prompt'."
287 288
288;;; User Functions: 289;;; User Functions:
289 290
291(defun eshell-kill-buffer-function ()
292 "Function added to `kill-buffer-hook' in Eshell buffers.
293This runs the function `eshell-kill-processes-on-exit',
294and the hook `eshell-exit-hook'."
295 ;; It's fine to run this unconditionally since it can be customized
296 ;; via the `eshell-kill-processes-on-exit' variable.
297 (and (fboundp 'eshell-query-kill-processes)
298 (not (memq 'eshell-query-kill-processes eshell-exit-hook))
299 (eshell-query-kill-processes))
300 (run-hooks 'eshell-exit-hook))
301
290;;;###autoload 302;;;###autoload
291(defun eshell-mode () 303(defun eshell-mode ()
292 "Emacs shell interactive mode. 304 "Emacs shell interactive mode.
@@ -389,7 +401,7 @@ This is used by `eshell-watch-for-password-prompt'."
389 ;; load extension modules into memory. This will cause any global 401 ;; load extension modules into memory. This will cause any global
390 ;; variables they define to be visible, since some of the core 402 ;; variables they define to be visible, since some of the core
391 ;; modules sometimes take advantage of their functionality if used. 403 ;; modules sometimes take advantage of their functionality if used.
392 (eshell-for module eshell-modules-list 404 (dolist (module eshell-modules-list)
393 (let ((module-fullname (symbol-name module)) 405 (let ((module-fullname (symbol-name module))
394 module-shortname) 406 module-shortname)
395 (if (string-match "^eshell-\\(.*\\)" module-fullname) 407 (if (string-match "^eshell-\\(.*\\)" module-fullname)
@@ -403,17 +415,15 @@ This is used by `eshell-watch-for-password-prompt'."
403 (unless (file-exists-p eshell-directory-name) 415 (unless (file-exists-p eshell-directory-name)
404 (eshell-make-private-directory eshell-directory-name t)) 416 (eshell-make-private-directory eshell-directory-name t))
405 417
406 ;; load core Eshell modules for this session 418 ;; Load core Eshell modules, then extension modules, for this session.
407 (eshell-for module (eshell-subgroups 'eshell) 419 (dolist (module (append (eshell-subgroups 'eshell) eshell-modules-list))
408 (run-hooks (intern-soft (concat (symbol-name module) 420 (let ((load-hook (intern-soft (format "%s-load-hook" module)))
409 "-load-hook")))) 421 (initfunc (intern-soft (format "%s-initialize" module))))
410 422 (when (and load-hook (boundp load-hook))
411 ;; load extension modules for this session 423 (if (memq initfunc (symbol-value load-hook)) (setq initfunc nil))
412 (eshell-for module eshell-modules-list 424 (run-hooks load-hook))
413 (let ((load-hook (intern-soft (concat (symbol-name module) 425 ;; So we don't need the -initialize functions on the hooks (b#5375).
414 "-load-hook")))) 426 (and initfunc (fboundp initfunc) (funcall initfunc))))
415 (if (and load-hook (boundp load-hook))
416 (run-hooks load-hook))))
417 427
418 (if eshell-send-direct-to-subprocesses 428 (if eshell-send-direct-to-subprocesses
419 (add-hook 'pre-command-hook 'eshell-intercept-commands t t)) 429 (add-hook 'pre-command-hook 'eshell-intercept-commands t t))
@@ -428,10 +438,7 @@ This is used by `eshell-watch-for-password-prompt'."
428 (add-hook 'eshell-pre-command-hook 'eshell-command-started nil t) 438 (add-hook 'eshell-pre-command-hook 'eshell-command-started nil t)
429 (add-hook 'eshell-post-command-hook 'eshell-command-finished nil t)) 439 (add-hook 'eshell-post-command-hook 'eshell-command-finished nil t))
430 440
431 (add-hook 'kill-buffer-hook 441 (add-hook 'kill-buffer-hook 'eshell-kill-buffer-function t t)
432 (function
433 (lambda ()
434 (run-hooks 'eshell-exit-hook))) t t)
435 442
436 (if eshell-first-time-p 443 (if eshell-first-time-p
437 (run-hooks 'eshell-first-time-mode-hook)) 444 (run-hooks 'eshell-first-time-mode-hook))
@@ -440,19 +447,6 @@ This is used by `eshell-watch-for-password-prompt'."
440 447
441(put 'eshell-mode 'mode-class 'special) 448(put 'eshell-mode 'mode-class 'special)
442 449
443(eshell-deftest mode major-mode
444 "Major mode is correct"
445 (eq major-mode 'eshell-mode))
446
447(eshell-deftest mode eshell-mode-variable
448 "`eshell-mode' is true"
449 (eq eshell-mode t))
450
451(eshell-deftest var window-height
452 "LINES equals window height"
453 (let ((eshell-stringify-t t))
454 (eshell-command-result-p "= $LINES (window-height)" "t\n")))
455
456(defun eshell-command-started () 450(defun eshell-command-started ()
457 "Indicate in the modeline that a command has started." 451 "Indicate in the modeline that a command has started."
458 (setq eshell-command-running-string "**") 452 (setq eshell-command-running-string "**")
@@ -463,13 +457,6 @@ This is used by `eshell-watch-for-password-prompt'."
463 (setq eshell-command-running-string "--") 457 (setq eshell-command-running-string "--")
464 (force-mode-line-update)) 458 (force-mode-line-update))
465 459
466(eshell-deftest mode command-running-p
467 "Modeline shows no command running"
468 (or (featurep 'xemacs)
469 (not eshell-status-in-modeline)
470 (and (memq 'eshell-command-running-string mode-line-format)
471 (equal eshell-command-running-string "--"))))
472
473;;; Internal Functions: 460;;; Internal Functions:
474 461
475(defun eshell-toggle-direct-send () 462(defun eshell-toggle-direct-send ()
@@ -539,20 +526,6 @@ This is used by `eshell-watch-for-password-prompt'."
539 (= (1+ pos) limit)) 526 (= (1+ pos) limit))
540 (forward-char 1)))) 527 (forward-char 1))))
541 528
542(eshell-deftest arg forward-arg
543 "Move across command arguments"
544 (eshell-insert-command "echo $(+ 1 (- 4 3)) \"alpha beta\" file" 'ignore)
545 (let ((here (point)) begin valid)
546 (eshell-bol)
547 (setq begin (point))
548 (eshell-forward-argument 4)
549 (setq valid (= here (point)))
550 (eshell-backward-argument 4)
551 (prog1
552 (and valid (= begin (point)))
553 (eshell-bol)
554 (delete-region (point) (point-max)))))
555
556(defun eshell-forward-argument (&optional arg) 529(defun eshell-forward-argument (&optional arg)
557 "Move forward ARG arguments." 530 "Move forward ARG arguments."
558 (interactive "p") 531 (interactive "p")
@@ -652,17 +625,6 @@ waiting for input."
652 (interactive "P") 625 (interactive "P")
653 (eshell-send-input use-region t)) 626 (eshell-send-input use-region t))
654 627
655(eshell-deftest mode queue-input
656 "Queue command input"
657 (eshell-insert-command "sleep 2")
658 (eshell-insert-command "echo alpha" 'eshell-queue-input)
659 (let ((count 10))
660 (while (and eshell-current-command
661 (> count 0))
662 (sit-for 1 0)
663 (setq count (1- count))))
664 (eshell-match-result "alpha\n"))
665
666(defun eshell-send-input (&optional use-region queue-p no-newline) 628(defun eshell-send-input (&optional use-region queue-p no-newline)
667 "Send the input received to Eshell for parsing and processing. 629 "Send the input received to Eshell for parsing and processing.
668After `eshell-last-output-end', sends all text from that marker to 630After `eshell-last-output-end', sends all text from that marker to
@@ -741,20 +703,6 @@ newline."
741 (run-hooks 'eshell-post-command-hook) 703 (run-hooks 'eshell-post-command-hook)
742 (insert-and-inherit input))))))))) 704 (insert-and-inherit input)))))))))
743 705
744; (eshell-deftest proc send-to-subprocess
745; "Send input to a subprocess"
746; ;; jww (1999-12-06): what about when bc is unavailable?
747; (if (not (eshell-search-path "bc"))
748; t
749; (eshell-insert-command "bc")
750; (eshell-insert-command "1 + 2")
751; (sit-for 1 0)
752; (forward-line -1)
753; (prog1
754; (looking-at "3\n")
755; (eshell-insert-command "quit")
756; (sit-for 1 0))))
757
758(defsubst eshell-kill-new () 706(defsubst eshell-kill-new ()
759 "Add the last input text to the kill ring." 707 "Add the last input text to the kill ring."
760 (kill-ring-save eshell-last-input-start eshell-last-input-end)) 708 (kill-ring-save eshell-last-input-start eshell-last-input-end))
@@ -900,14 +848,6 @@ Does not delete the prompt."
900 (insert "*** output flushed ***\n") 848 (insert "*** output flushed ***\n")
901 (delete-region (point) (eshell-end-of-output)))) 849 (delete-region (point) (eshell-end-of-output))))
902 850
903(eshell-deftest io flush-output
904 "Flush previous output"
905 (eshell-insert-command "echo alpha")
906 (eshell-kill-output)
907 (and (eshell-match-result (regexp-quote "*** output flushed ***\n"))
908 (forward-line)
909 (= (point) eshell-last-output-start)))
910
911(defun eshell-show-output (&optional arg) 851(defun eshell-show-output (&optional arg)
912 "Display start of this batch of interpreter output at top of window. 852 "Display start of this batch of interpreter output at top of window.
913Sets mark to the value of point when this command is run. 853Sets mark to the value of point when this command is run.
@@ -968,12 +908,6 @@ When run interactively, widen the buffer first."
968 (goto-char eshell-last-output-end) 908 (goto-char eshell-last-output-end)
969 (insert-and-inherit input))) 909 (insert-and-inherit input)))
970 910
971(eshell-deftest mode run-old-command
972 "Re-run an old command"
973 (eshell-insert-command "echo alpha")
974 (goto-char eshell-last-input-start)
975 (string= (eshell-get-old-input) "echo alpha"))
976
977(defun eshell/exit () 911(defun eshell/exit ()
978 "Leave or kill the Eshell buffer, depending on `eshell-kill-on-exit'." 912 "Leave or kill the Eshell buffer, depending on `eshell-kill-on-exit'."
979 (throw 'eshell-terminal t)) 913 (throw 'eshell-terminal t))
diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el
index 5a62c71355c..1581d05889e 100644
--- a/lisp/eshell/esh-module.el
+++ b/lisp/eshell/esh-module.el
@@ -43,7 +43,7 @@ customizing the variable `eshell-modules-list'."
43 43
44(defcustom eshell-module-unload-hook 44(defcustom eshell-module-unload-hook
45 '(eshell-unload-extension-modules) 45 '(eshell-unload-extension-modules)
46 "*A hook run when `eshell-module' is unloaded." 46 "A hook run when `eshell-module' is unloaded."
47 :type 'hook 47 :type 'hook
48 :group 'eshell-module) 48 :group 'eshell-module)
49 49
@@ -61,7 +61,7 @@ customizing the variable `eshell-modules-list'."
61 eshell-script 61 eshell-script
62 eshell-term 62 eshell-term
63 eshell-unix) 63 eshell-unix)
64 "*A list of optional add-on modules to be loaded by Eshell. 64 "A list of optional add-on modules to be loaded by Eshell.
65Changes will only take effect in future Eshell buffers." 65Changes will only take effect in future Eshell buffers."
66 :type (append 66 :type (append
67 (list 'set ':tag "Supported modules") 67 (list 'set ':tag "Supported modules")
@@ -92,7 +92,7 @@ customization group. Example: `eshell-cmpl' for that module."
92 92
93(defun eshell-unload-extension-modules () 93(defun eshell-unload-extension-modules ()
94 "Unload any memory resident extension modules." 94 "Unload any memory resident extension modules."
95 (eshell-for module (eshell-subgroups 'eshell-module) 95 (dolist (module (eshell-subgroups 'eshell-module))
96 (if (featurep module) 96 (if (featurep module)
97 (ignore-errors 97 (ignore-errors
98 (message "Unloading %s..." (symbol-name module)) 98 (message "Unloading %s..." (symbol-name module))
diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index f697a400556..eeaccc4b890 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -38,8 +38,9 @@ finish."
38 38
39;;; User Variables: 39;;; User Variables:
40 40
41(defcustom eshell-proc-load-hook '(eshell-proc-initialize) 41(defcustom eshell-proc-load-hook nil
42 "A hook that gets run when `eshell-proc' is loaded." 42 "A hook that gets run when `eshell-proc' is loaded."
43 :version "24.1" ; removed eshell-proc-initialize
43 :type 'hook 44 :type 'hook
44 :group 'eshell-proc) 45 :group 'eshell-proc)
45 46
@@ -94,13 +95,14 @@ is created."
94 :type 'hook 95 :type 'hook
95 :group 'eshell-proc) 96 :group 'eshell-proc)
96 97
97(defcustom eshell-kill-hook '(eshell-reset-after-proc) 98(defcustom eshell-kill-hook nil
98 "Called when a process run by `eshell-gather-process-output' has ended. 99 "Called when a process run by `eshell-gather-process-output' has ended.
99It is passed two arguments: the process that was just ended, and the 100It is passed two arguments: the process that was just ended, and the
100termination status (as a string). Note that the first argument may be 101termination status (as a string). Note that the first argument may be
101nil, in which case the user attempted to send a signal, but there was 102nil, in which case the user attempted to send a signal, but there was
102no relevant process. This can be used for displaying help 103no relevant process. This can be used for displaying help
103information, for example." 104information, for example."
105 :version "24.1" ; removed eshell-reset-after-proc
104 :type 'hook 106 :type 'hook
105 :group 'eshell-proc) 107 :group 'eshell-proc)
106 108
@@ -113,6 +115,14 @@ information, for example."
113 115
114;;; Functions: 116;;; Functions:
115 117
118(defun eshell-kill-process-function (proc status)
119 "Function run when killing a process.
120Runs `eshell-reset-after-proc' and `eshell-kill-hook', passing arguments
121PROC and STATUS to both."
122 (or (memq 'eshell-reset-after-proc eshell-kill-hook)
123 (eshell-reset-after-proc proc status))
124 (run-hook-with-args 'eshell-kill-hook proc status))
125
116(defun eshell-proc-initialize () 126(defun eshell-proc-initialize ()
117 "Initialize the process handling code." 127 "Initialize the process handling code."
118 (make-local-variable 'eshell-process-list) 128 (make-local-variable 'eshell-process-list)
@@ -346,7 +356,7 @@ See `eshell-needs-pipe'."
346 (eshell-update-markers eshell-last-output-end) 356 (eshell-update-markers eshell-last-output-end)
347 ;; Simulate the effect of eshell-sentinel. 357 ;; Simulate the effect of eshell-sentinel.
348 (eshell-close-handles (if (numberp exit-status) exit-status -1)) 358 (eshell-close-handles (if (numberp exit-status) exit-status -1))
349 (run-hook-with-args 'eshell-kill-hook command exit-status) 359 (eshell-kill-process-function command exit-status)
350 (or eshell-in-pipeline-p 360 (or eshell-in-pipeline-p
351 (setq eshell-last-sync-output-start nil)) 361 (setq eshell-last-sync-output-start nil))
352 (if (not (numberp exit-status)) 362 (if (not (numberp exit-status))
@@ -391,14 +401,14 @@ PROC is the process that's exiting. STRING is the exit message."
391 (eshell-close-handles (process-exit-status proc) 'nil 401 (eshell-close-handles (process-exit-status proc) 'nil
392 (cadr entry)))) 402 (cadr entry))))
393 (eshell-remove-process-entry entry)))) 403 (eshell-remove-process-entry entry))))
394 (run-hook-with-args 'eshell-kill-hook proc string))))) 404 (eshell-kill-process-function proc string)))))
395 405
396(defun eshell-process-interact (func &optional all query) 406(defun eshell-process-interact (func &optional all query)
397 "Interact with a process, using PROMPT if more than one, via FUNC. 407 "Interact with a process, using PROMPT if more than one, via FUNC.
398If ALL is non-nil, background processes will be interacted with as well. 408If ALL is non-nil, background processes will be interacted with as well.
399If QUERY is non-nil, query the user with QUERY before calling FUNC." 409If QUERY is non-nil, query the user with QUERY before calling FUNC."
400 (let (defunct result) 410 (let (defunct result)
401 (eshell-for entry eshell-process-list 411 (dolist (entry eshell-process-list)
402 (if (and (memq (process-status (car entry)) 412 (if (and (memq (process-status (car entry))
403 '(run stop open closed)) 413 '(run stop open closed))
404 (or all 414 (or all
@@ -412,7 +422,7 @@ If QUERY is non-nil, query the user with QUERY before calling FUNC."
412 ;; clean up the process list; this can get dirty if an error 422 ;; clean up the process list; this can get dirty if an error
413 ;; occurred that brought the user into the debugger, and then they 423 ;; occurred that brought the user into the debugger, and then they
414 ;; quit, so that the sentinel was never called. 424 ;; quit, so that the sentinel was never called.
415 (eshell-for d defunct 425 (dolist (d defunct)
416 (eshell-remove-process-entry d)) 426 (eshell-remove-process-entry d))
417 result)) 427 result))
418 428
@@ -485,31 +495,29 @@ See the variable `eshell-kill-processes-on-exit'."
485 (kill-buffer buf))) 495 (kill-buffer buf)))
486 (message nil)))) 496 (message nil))))
487 497
488(custom-add-option 'eshell-exit-hook 'eshell-query-kill-processes)
489
490(defun eshell-interrupt-process () 498(defun eshell-interrupt-process ()
491 "Interrupt a process." 499 "Interrupt a process."
492 (interactive) 500 (interactive)
493 (unless (eshell-process-interact 'interrupt-process) 501 (unless (eshell-process-interact 'interrupt-process)
494 (run-hook-with-args 'eshell-kill-hook nil "interrupt"))) 502 (eshell-kill-process-function nil "interrupt")))
495 503
496(defun eshell-kill-process () 504(defun eshell-kill-process ()
497 "Kill a process." 505 "Kill a process."
498 (interactive) 506 (interactive)
499 (unless (eshell-process-interact 'kill-process) 507 (unless (eshell-process-interact 'kill-process)
500 (run-hook-with-args 'eshell-kill-hook nil "killed"))) 508 (eshell-kill-process-function nil "killed")))
501 509
502(defun eshell-quit-process () 510(defun eshell-quit-process ()
503 "Send quit signal to process." 511 "Send quit signal to process."
504 (interactive) 512 (interactive)
505 (unless (eshell-process-interact 'quit-process) 513 (unless (eshell-process-interact 'quit-process)
506 (run-hook-with-args 'eshell-kill-hook nil "quit"))) 514 (eshell-kill-process-function nil "quit")))
507 515
508;(defun eshell-stop-process () 516;(defun eshell-stop-process ()
509; "Send STOP signal to process." 517; "Send STOP signal to process."
510; (interactive) 518; (interactive)
511; (unless (eshell-process-interact 'stop-process) 519; (unless (eshell-process-interact 'stop-process)
512; (run-hook-with-args 'eshell-kill-hook nil "stopped"))) 520; (eshell-kill-process-function nil "stopped")))
513 521
514;(defun eshell-continue-process () 522;(defun eshell-continue-process ()
515; "Send CONTINUE signal to process." 523; "Send CONTINUE signal to process."
@@ -518,7 +526,7 @@ See the variable `eshell-kill-processes-on-exit'."
518; ;; jww (1999-09-17): this signal is not dealt with yet. For 526; ;; jww (1999-09-17): this signal is not dealt with yet. For
519; ;; example, `eshell-reset' will be called, and so will 527; ;; example, `eshell-reset' will be called, and so will
520; ;; `eshell-resume-eval'. 528; ;; `eshell-resume-eval'.
521; (run-hook-with-args 'eshell-kill-hook nil "continue"))) 529; (eshell-kill-process-function nil "continue")))
522 530
523(defun eshell-send-eof-to-process () 531(defun eshell-send-eof-to-process ()
524 "Send EOF to process." 532 "Send EOF to process."
diff --git a/lisp/eshell/esh-test.el b/lisp/eshell/esh-test.el
deleted file mode 100644
index f5c55dd8ae7..00000000000
--- a/lisp/eshell/esh-test.el
+++ /dev/null
@@ -1,233 +0,0 @@
1;;; esh-test.el --- Eshell test suite
2
3;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
4
5;; Author: John Wiegley <johnw@gnu.org>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Commentary:
23
24;; The purpose of this module is to verify that Eshell works as
25;; expected. To run it on your system, use the command
26;; \\[eshell-test].
27
28;;; Code:
29
30(eval-when-compile
31 (require 'eshell)
32 (require 'esh-util))
33(require 'esh-mode)
34
35(defgroup eshell-test nil
36 "This module is meant to ensure that Eshell is working correctly."
37 :tag "Eshell test suite"
38 :group 'eshell)
39
40;;; User Variables:
41
42(defface eshell-test-ok
43 '((((class color) (background light)) (:foreground "Green" :bold t))
44 (((class color) (background dark)) (:foreground "Green" :bold t)))
45 "The face used to highlight OK result strings."
46 :group 'eshell-test)
47(define-obsolete-face-alias 'eshell-test-ok-face 'eshell-test-ok "22.1")
48
49(defface eshell-test-failed
50 '((((class color) (background light)) (:foreground "OrangeRed" :bold t))
51 (((class color) (background dark)) (:foreground "OrangeRed" :bold t))
52 (t (:bold t)))
53 "The face used to highlight FAILED result strings."
54 :group 'eshell-test)
55(define-obsolete-face-alias 'eshell-test-failed-face 'eshell-test-failed "22.1")
56
57(defcustom eshell-show-usage-metrics nil
58 "If non-nil, display different usage metrics for each Eshell command."
59 :set (lambda (symbol value)
60 (if value
61 (add-hook 'eshell-mode-hook 'eshell-show-usage-metrics)
62 (remove-hook 'eshell-mode-hook 'eshell-show-usage-metrics))
63 (set symbol value))
64 :type '(choice (const :tag "No metrics" nil)
65 (const :tag "Cons cells consumed" t)
66 (const :tag "Time elapsed" 0))
67 :group 'eshell-test)
68
69;;; Code:
70
71(defvar test-buffer)
72
73(defun eshell-insert-command (text &optional func)
74 "Insert a command at the end of the buffer."
75 (goto-char eshell-last-output-end)
76 (insert-and-inherit text)
77 (funcall (or func 'eshell-send-input)))
78
79(defun eshell-match-result (regexp)
80 "Insert a command at the end of the buffer."
81 (goto-char eshell-last-input-end)
82 (looking-at regexp))
83
84(defun eshell-command-result-p (text regexp &optional func)
85 "Insert a command at the end of the buffer."
86 (eshell-insert-command text func)
87 (eshell-match-result regexp))
88
89(defvar eshell-test-failures nil)
90
91(defun eshell-run-test (module funcsym label command)
92 "Test whether FORM evaluates to a non-nil value."
93 (when (let ((sym (intern-soft (concat "eshell-" (symbol-name module)))))
94 (or (memq sym (eshell-subgroups 'eshell))
95 (eshell-using-module sym)))
96 (with-current-buffer test-buffer
97 (insert-before-markers
98 (format "%-70s " (substring label 0 (min 70 (length label)))))
99 (insert-before-markers " ....")
100 (eshell-redisplay))
101 (let ((truth (eval command)))
102 (with-current-buffer test-buffer
103 (delete-char -6)
104 (insert-before-markers
105 "[" (let (str)
106 (if truth
107 (progn
108 (setq str " OK ")
109 (put-text-property 0 6 'face 'eshell-test-ok str))
110 (setq str "FAILED")
111 (setq eshell-test-failures (1+ eshell-test-failures))
112 (put-text-property 0 6 'face 'eshell-test-failed str))
113 str) "]")
114 (add-text-properties (line-beginning-position) (point)
115 (list 'test-func funcsym))
116 (eshell-redisplay)))))
117
118(defun eshell-test-goto-func ()
119 "Jump to the function that defines a particular test."
120 (interactive)
121 (let ((fsym (get-text-property (point) 'test-func)))
122 (when fsym
123 (let* ((def (symbol-function fsym))
124 (library (locate-library (symbol-file fsym 'defun)))
125 (name (substring (symbol-name fsym)
126 (length "eshell-test--")))
127 (inhibit-redisplay t))
128 (find-file library)
129 (goto-char (point-min))
130 (re-search-forward (concat "^(eshell-deftest\\s-+\\w+\\s-+"
131 name))
132 (beginning-of-line)))))
133
134(defun eshell-run-one-test (&optional arg)
135 "Jump to the function that defines a particular test."
136 (interactive "P")
137 (let ((fsym (get-text-property (point) 'test-func)))
138 (when fsym
139 (beginning-of-line)
140 (delete-region (point) (line-end-position))
141 (let ((test-buffer (current-buffer)))
142 (set-buffer (let ((inhibit-redisplay t))
143 (save-window-excursion (eshell t))))
144 (funcall fsym)
145 (unless arg
146 (kill-buffer (current-buffer)))))))
147
148;;;###autoload
149(defun eshell-test (&optional arg)
150 "Test Eshell to verify that it works as expected."
151 (interactive "P")
152 (let* ((begin (float-time))
153 (test-buffer (get-buffer-create "*eshell test*")))
154 (set-buffer (let ((inhibit-redisplay t))
155 (save-window-excursion (eshell t))))
156 (with-current-buffer test-buffer
157 (erase-buffer)
158 (setq major-mode 'eshell-test-mode)
159 (setq mode-name "EShell Test")
160 (set (make-local-variable 'eshell-test-failures) 0)
161 (local-set-key [(control ?c) (control ?c)] 'eshell-test-goto-func)
162 (local-set-key [(control ?c) (control ?r)] 'eshell-run-one-test)
163 (local-set-key [(control ?m)] 'eshell-test-goto-func)
164 (local-set-key [return] 'eshell-test-goto-func)
165
166 (insert "Testing Eshell under " (emacs-version))
167 (switch-to-buffer test-buffer)
168 (delete-other-windows))
169 (eshell-for funcname (sort (all-completions "eshell-test--"
170 obarray 'functionp)
171 'string-lessp)
172 (with-current-buffer test-buffer
173 (insert "\n"))
174 (funcall (intern-soft funcname)))
175 (with-current-buffer test-buffer
176 (insert (format "\n\n--- %s --- (completed in %d seconds)\n"
177 (current-time-string)
178 (- (float-time) begin)))
179 (message "Eshell test suite completed: %s failure%s"
180 (if (> eshell-test-failures 0)
181 (number-to-string eshell-test-failures)
182 "No")
183 (if (= eshell-test-failures 1) "" "s"))))
184 (goto-char eshell-last-output-end)
185 (unless arg
186 (kill-buffer (current-buffer))))
187
188
189(defvar eshell-metric-before-command 0)
190(defvar eshell-metric-after-command 0)
191
192(defun eshell-show-usage-metrics ()
193 "If run at Eshell mode startup, metrics are shown after each command."
194 (set (make-local-variable 'eshell-metric-before-command)
195 (if (eq eshell-show-usage-metrics t)
196 0
197 (current-time)))
198 (set (make-local-variable 'eshell-metric-after-command)
199 (if (eq eshell-show-usage-metrics t)
200 0
201 (current-time)))
202
203 (add-hook 'eshell-pre-command-hook
204 (function
205 (lambda ()
206 (setq eshell-metric-before-command
207 (if (eq eshell-show-usage-metrics t)
208 (car (memory-use-counts))
209 (current-time))))) nil t)
210
211 (add-hook 'eshell-post-command-hook
212 (function
213 (lambda ()
214 (setq eshell-metric-after-command
215 (if (eq eshell-show-usage-metrics t)
216 (car (memory-use-counts))
217 (current-time)))
218 (eshell-interactive-print
219 (concat
220 (int-to-string
221 (if (eq eshell-show-usage-metrics t)
222 (- eshell-metric-after-command
223 eshell-metric-before-command 7)
224 (- (float-time
225 eshell-metric-after-command)
226 (float-time
227 eshell-metric-before-command))))
228 "\n"))))
229 nil t))
230
231(provide 'esh-test)
232
233;;; esh-test.el ends here
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 2de147acb00..dbe4f824deb 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -147,18 +147,6 @@ function `string-to-number'."
147 147
148(put 'eshell-condition-case 'lisp-indent-function 2) 148(put 'eshell-condition-case 'lisp-indent-function 2)
149 149
150(defmacro eshell-deftest (module name label &rest forms)
151 (if (and (fboundp 'cl-compiling-file) (cl-compiling-file))
152 nil
153 (let ((fsym (intern (concat "eshell-test--" (symbol-name name)))))
154 `(eval-when-compile
155 (ignore
156 (defun ,fsym () ,label
157 (eshell-run-test (quote ,module) (quote ,fsym) ,label
158 (quote (progn ,@forms)))))))))
159
160(put 'eshell-deftest 'lisp-indent-function 2)
161
162(defun eshell-find-delimiter 150(defun eshell-find-delimiter
163 (open close &optional bound reverse-p backslash-p) 151 (open close &optional bound reverse-p backslash-p)
164 "From point, find the CLOSE delimiter corresponding to OPEN. 152 "From point, find the CLOSE delimiter corresponding to OPEN.
@@ -285,7 +273,6 @@ Prepend remote identification of `default-directory', if any."
285 (setq text (replace-match " " t t text))) 273 (setq text (replace-match " " t t text)))
286 text)) 274 text))
287 275
288;; FIXME this is just dolist.
289(defmacro eshell-for (for-var for-list &rest forms) 276(defmacro eshell-for (for-var for-list &rest forms)
290 "Iterate through a list" 277 "Iterate through a list"
291 `(let ((list-iter ,for-list)) 278 `(let ((list-iter ,for-list))
@@ -296,10 +283,12 @@ Prepend remote identification of `default-directory', if any."
296 283
297(put 'eshell-for 'lisp-indent-function 2) 284(put 'eshell-for 'lisp-indent-function 2)
298 285
286(make-obsolete 'eshell-for 'dolist "24.1")
287
299(defun eshell-flatten-list (args) 288(defun eshell-flatten-list (args)
300 "Flatten any lists within ARGS, so that there are no sublists." 289 "Flatten any lists within ARGS, so that there are no sublists."
301 (let ((new-list (list t))) 290 (let ((new-list (list t)))
302 (eshell-for a args 291 (dolist (a args)
303 (if (and (listp a) 292 (if (and (listp a)
304 (listp (cdr a))) 293 (listp (cdr a)))
305 (nconc new-list (eshell-flatten-list a)) 294 (nconc new-list (eshell-flatten-list a))
@@ -405,7 +394,7 @@ list."
405 (unless (listp entries) 394 (unless (listp entries)
406 (setq entries (list entries) 395 (setq entries (list entries)
407 listified t)) 396 listified t))
408 (eshell-for entry entries 397 (dolist (entry entries)
409 (unless (and exclude (string-match exclude entry)) 398 (unless (and exclude (string-match exclude entry))
410 (setq p predicates valid (null p)) 399 (setq p predicates valid (null p))
411 (while p 400 (while p
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 4c42b305ec2..69004a841f1 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -109,7 +109,6 @@
109 109
110(eval-when-compile 110(eval-when-compile
111 (require 'pcomplete) 111 (require 'pcomplete)
112 (require 'esh-test)
113 (require 'esh-util) 112 (require 'esh-util)
114 (require 'esh-opt) 113 (require 'esh-opt)
115 (require 'esh-mode)) 114 (require 'esh-mode))
@@ -126,8 +125,9 @@ variable value, a subcommand, or even the result of a Lisp form."
126 125
127;;; User Variables: 126;;; User Variables:
128 127
129(defcustom eshell-var-load-hook '(eshell-var-initialize) 128(defcustom eshell-var-load-hook nil
130 "A list of functions to call when loading `eshell-var'." 129 "A list of functions to call when loading `eshell-var'."
130 :version "24.1" ; removed eshell-var-initialize
131 :type 'hook 131 :type 'hook
132 :group 'eshell-var) 132 :group 'eshell-var)
133 133
@@ -351,8 +351,7 @@ This function is explicit for adding to `eshell-parse-argument-hook'."
351 '((?h "help" nil nil "show this usage screen") 351 '((?h "help" nil nil "show this usage screen")
352 :external "env" 352 :external "env"
353 :usage "<no arguments>") 353 :usage "<no arguments>")
354 (eshell-for setting (sort (eshell-environment-variables) 354 (dolist (setting (sort (eshell-environment-variables) 'string-lessp))
355 'string-lessp)
356 (eshell-buffered-print setting "\n")) 355 (eshell-buffered-print setting "\n"))
357 (eshell-flush))) 356 (eshell-flush)))
358 357
@@ -374,7 +373,7 @@ This function is explicit for adding to `eshell-parse-argument-hook'."
374This involves setting any variable aliases which affect the 373This involves setting any variable aliases which affect the
375environment, as specified in `eshell-variable-aliases-list'." 374environment, as specified in `eshell-variable-aliases-list'."
376 (let ((process-environment (eshell-copy-environment))) 375 (let ((process-environment (eshell-copy-environment)))
377 (eshell-for var-alias eshell-variable-aliases-list 376 (dolist (var-alias eshell-variable-aliases-list)
378 (if (nth 2 var-alias) 377 (if (nth 2 var-alias)
379 (setenv (car var-alias) 378 (setenv (car var-alias)
380 (eshell-stringify 379 (eshell-stringify
@@ -477,30 +476,6 @@ Possible options are:
477 (t 476 (t
478 (error "Invalid variable reference"))))) 477 (error "Invalid variable reference")))))
479 478
480(eshell-deftest var interp-cmd
481 "Interpolate command result"
482 (eshell-command-result-p "+ ${+ 1 2} 3" "6\n"))
483
484(eshell-deftest var interp-lisp
485 "Interpolate Lisp form evalution"
486 (eshell-command-result-p "+ $(+ 1 2) 3" "6\n"))
487
488(eshell-deftest var interp-concat
489 "Interpolate and concat command"
490 (eshell-command-result-p "+ ${+ 1 2}3 3" "36\n"))
491
492(eshell-deftest var interp-concat-lisp
493 "Interpolate and concat Lisp form"
494 (eshell-command-result-p "+ $(+ 1 2)3 3" "36\n"))
495
496(eshell-deftest var interp-concat2
497 "Interpolate and concat two commands"
498 (eshell-command-result-p "+ ${+ 1 2}${+ 1 2} 3" "36\n"))
499
500(eshell-deftest var interp-concat-lisp2
501 "Interpolate and concat two Lisp forms"
502 (eshell-command-result-p "+ $(+ 1 2)$(+ 1 2) 3" "36\n"))
503
504(defun eshell-parse-indices () 479(defun eshell-parse-indices ()
505 "Parse and return a list of list of indices." 480 "Parse and return a list of list of indices."
506 (let (indices) 481 (let (indices)
@@ -623,7 +598,7 @@ For example, to retrieve the second element of a user's record in
623 "Generate list of applicable variables." 598 "Generate list of applicable variables."
624 (let ((argname pcomplete-stub) 599 (let ((argname pcomplete-stub)
625 completions) 600 completions)
626 (eshell-for alias eshell-variable-aliases-list 601 (dolist (alias eshell-variable-aliases-list)
627 (if (string-match (concat "^" argname) (car alias)) 602 (if (string-match (concat "^" argname) (car alias))
628 (setq completions (cons (car alias) completions)))) 603 (setq completions (cons (car alias) completions))))
629 (sort 604 (sort
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index 7690a102a9b..1a9d7c97b83 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -280,26 +280,12 @@ shells such as bash, zsh, rc, 4dos."
280 :type 'string 280 :type 'string
281 :group 'eshell) 281 :group 'eshell)
282 282
283(eshell-deftest mode same-window-buffer-names
284 "`eshell-buffer-name' is a member of `same-window-buffer-names'"
285 (member eshell-buffer-name same-window-buffer-names))
286
287(defcustom eshell-directory-name 283(defcustom eshell-directory-name
288 (locate-user-emacs-file "eshell/" ".eshell/") 284 (locate-user-emacs-file "eshell/" ".eshell/")
289 "The directory where Eshell control files should be kept." 285 "The directory where Eshell control files should be kept."
290 :type 'directory 286 :type 'directory
291 :group 'eshell) 287 :group 'eshell)
292 288
293(eshell-deftest mode eshell-directory-exists
294 "`eshell-directory-name' exists and is writable"
295 (file-writable-p eshell-directory-name))
296
297(eshell-deftest mode eshell-directory-modes
298 "`eshell-directory-name' has correct access protections"
299 (or (eshell-under-windows-p)
300 (= (file-modes eshell-directory-name)
301 eshell-private-directory-modes)))
302
303;;;_* Running Eshell 289;;;_* Running Eshell
304;; 290;;
305;; There are only three commands used to invoke Eshell. The first two 291;; There are only three commands used to invoke Eshell. The first two
@@ -450,10 +436,6 @@ corresponding to a successful execution."
450 (set status-var eshell-last-command-status)) 436 (set status-var eshell-last-command-status))
451 (cadr result)))))) 437 (cadr result))))))
452 438
453(eshell-deftest mode simple-command-result
454 "`eshell-command-result' works with a simple command."
455 (= (eshell-command-result "+ 1 2") 3))
456
457;;;_* Reporting bugs 439;;;_* Reporting bugs
458;; 440;;
459;; If you do encounter a bug, on any system, please report 441;; If you do encounter a bug, on any system, please report
@@ -474,7 +456,7 @@ Emacs."
474 ;; if the user set `eshell-prefer-to-shell' to t, but never loaded 456 ;; if the user set `eshell-prefer-to-shell' to t, but never loaded
475 ;; Eshell, then `eshell-subgroups' will be unbound 457 ;; Eshell, then `eshell-subgroups' will be unbound
476 (when (fboundp 'eshell-subgroups) 458 (when (fboundp 'eshell-subgroups)
477 (eshell-for module (eshell-subgroups 'eshell) 459 (dolist (module (eshell-subgroups 'eshell))
478 ;; this really only unloads as many modules as possible, 460 ;; this really only unloads as many modules as possible,
479 ;; since other `require' references (such as by customizing 461 ;; since other `require' references (such as by customizing
480 ;; `eshell-prefer-to-shell' to a non-nil value) might make it 462 ;; `eshell-prefer-to-shell' to a non-nil value) might make it
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 360383aa32b..97862afb678 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -562,17 +562,23 @@ You can change the color sort order by customizing `list-colors-sort'."
562 (let ((lc (nthcdr (1- (display-color-cells)) list))) 562 (let ((lc (nthcdr (1- (display-color-cells)) list)))
563 (if lc 563 (if lc
564 (setcdr lc nil))))) 564 (setcdr lc nil)))))
565 (let ((buf (get-buffer-create "*Colors*"))) 565 (unless buffer-name
566 (with-current-buffer buf 566 (setq buffer-name "*Colors*"))
567 (with-help-window buffer-name
568 (with-current-buffer standard-output
567 (erase-buffer) 569 (erase-buffer)
568 (setq truncate-lines t) 570 (setq truncate-lines t)))
569 ;; Display buffer before generating content to allow 571 (let ((buf (get-buffer buffer-name))
570 ;; `list-colors-print' to get the right window-width. 572 (inhibit-read-only t))
573 ;; Display buffer before generating content, to allow
574 ;; `list-colors-print' to get the right window-width.
575 (with-selected-window (or (get-buffer-window buf t) (selected-window))
576 (with-current-buffer buf
577 (list-colors-print list callback)
578 (set-buffer-modified-p nil)))
579 (when callback
571 (pop-to-buffer buf) 580 (pop-to-buffer buf)
572 (list-colors-print list callback) 581 (message "Click on a color to select it."))))
573 (set-buffer-modified-p nil)))
574 (if callback
575 (message "Click on a color to select it.")))
576 582
577(defun list-colors-print (list &optional callback) 583(defun list-colors-print (list &optional callback)
578 (let ((callback-fn 584 (let ((callback-fn
diff --git a/lisp/files-x.el b/lisp/files-x.el
index a3cb5331e67..a9c32477155 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -360,18 +360,28 @@ from the MODE alist ignoring the input argument VALUE."
360 (catch 'exit 360 (catch 'exit
361 (unless enable-local-variables 361 (unless enable-local-variables
362 (throw 'exit (message "Directory-local variables are disabled"))) 362 (throw 'exit (message "Directory-local variables are disabled")))
363
364 (let ((variables-file (or (and (buffer-file-name) 363 (let ((variables-file (or (and (buffer-file-name)
365 (not (file-remote-p (buffer-file-name))) 364 (not (file-remote-p (buffer-file-name)))
366 (dir-locals-find-file (buffer-file-name))) 365 (dir-locals-find-file (buffer-file-name)))
367 dir-locals-file)) 366 dir-locals-file))
368 variables) 367 variables)
369 368 (if (consp variables-file) ; result from cache
369 ;; If cache element has an mtime, assume it came from a file.
370 ;; Otherwise, assume it was set directly.
371 (setq variables-file (if (nth 2 variables-file)
372 (expand-file-name dir-locals-file
373 (car variables-file))
374 (cadr variables-file))))
375 ;; I can't be bothered to handle this case right now.
376 ;; Dir locals were set directly from a class. You need to
377 ;; directly modify the class in dir-locals-class-alist.
378 (and variables-file (not (stringp variables-file))
379 (throw 'exit (message "Directory locals were not set from a file")))
370 ;; Don't create ".dir-locals.el" for the deletion operation. 380 ;; Don't create ".dir-locals.el" for the deletion operation.
371 (when (and (eq op 'delete) 381 (and (eq op 'delete)
372 (not (file-exists-p variables-file))) 382 (or (not variables-file)
373 (throw 'exit (message "File .dir-locals.el not found"))) 383 (not (file-exists-p variables-file)))
374 384 (throw 'exit (message "No .dir-locals.el file was found")))
375 (let ((auto-insert nil)) 385 (let ((auto-insert nil))
376 (find-file variables-file)) 386 (find-file variables-file))
377 (widen) 387 (widen)
diff --git a/lisp/files.el b/lisp/files.el
index 42f09f8b6da..caf0a9752c5 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -983,7 +983,8 @@ accessible."
983 nil))) 983 nil)))
984 984
985(defun file-truename (filename &optional counter prev-dirs) 985(defun file-truename (filename &optional counter prev-dirs)
986 "Return the truename of FILENAME, which should be absolute. 986 "Return the truename of FILENAME.
987If FILENAME is not absolute, first expands it against `default-directory'.
987The truename of a file name is found by chasing symbolic links 988The truename of a file name is found by chasing symbolic links
988both at the level of the file and at the level of the directories 989both at the level of the file and at the level of the directories
989containing it, until no links are left at any level. 990containing it, until no links are left at any level.
@@ -1893,8 +1894,8 @@ the various files."
1893 (not nonexistent) 1894 (not nonexistent)
1894 ;; It is confusing to ask whether to visit 1895 ;; It is confusing to ask whether to visit
1895 ;; non-literally if they have the file in 1896 ;; non-literally if they have the file in
1896 ;; hexl-mode. 1897 ;; hexl-mode or image-mode.
1897 (not (eq major-mode 'hexl-mode))) 1898 (not (memq major-mode '(hexl-mode image-mode))))
1898 (if (buffer-modified-p) 1899 (if (buffer-modified-p)
1899 (if (y-or-n-p 1900 (if (y-or-n-p
1900 (format 1901 (format
@@ -2806,7 +2807,9 @@ symbol and VAL is a value that is considered safe."
2806 :type 'alist) 2807 :type 'alist)
2807 2808
2808(defcustom safe-local-eval-forms 2809(defcustom safe-local-eval-forms
2809 '((add-hook 'write-file-functions 'time-stamp) 2810 ;; This should be here at least as long as Emacs supports write-file-hooks.
2811 '((add-hook 'write-file-hooks 'time-stamp)
2812 (add-hook 'write-file-functions 'time-stamp)
2810 (add-hook 'before-save-hook 'time-stamp)) 2813 (add-hook 'before-save-hook 'time-stamp))
2811 "Expressions that are considered safe in an `eval:' local variable. 2814 "Expressions that are considered safe in an `eval:' local variable.
2812Add expressions to this list if you want Emacs to evaluate them, when 2815Add expressions to this list if you want Emacs to evaluate them, when
@@ -2814,7 +2817,7 @@ they appear in an `eval' local variable specification, without first
2814asking you for confirmation." 2817asking you for confirmation."
2815 :risky t 2818 :risky t
2816 :group 'find-file 2819 :group 'find-file
2817 :version "22.2" 2820 :version "24.1" ; added write-file-hooks
2818 :type '(repeat sexp)) 2821 :type '(repeat sexp))
2819 2822
2820;; Risky local variables: 2823;; Risky local variables:
@@ -2918,8 +2921,8 @@ variable to set.")
2918ALL-VARS is the list of all variables to be set up. 2921ALL-VARS is the list of all variables to be set up.
2919UNSAFE-VARS is the list of those that aren't marked as safe or risky. 2922UNSAFE-VARS is the list of those that aren't marked as safe or risky.
2920RISKY-VARS is the list of those that are marked as risky. 2923RISKY-VARS is the list of those that are marked as risky.
2921DIR-NAME is a directory name if these settings come from 2924If these settings come from directory-local variables, then
2922directory-local variables, or nil otherwise." 2925DIR-NAME is the name of the associated directory. Otherwise it is nil."
2923 (if noninteractive 2926 (if noninteractive
2924 nil 2927 nil
2925 (save-window-excursion 2928 (save-window-excursion
@@ -3061,8 +3064,8 @@ VARIABLES is the alist of variable-value settings. This alist is
3061 `enable-local-eval', `enable-local-variables', and (if necessary) 3064 `enable-local-eval', `enable-local-variables', and (if necessary)
3062 user interaction. The results are added to 3065 user interaction. The results are added to
3063 `file-local-variables-alist', without applying them. 3066 `file-local-variables-alist', without applying them.
3064DIR-NAME is a directory name if these settings come from 3067If these settings come from directory-local variables, then
3065 directory-local variables, or nil otherwise." 3068DIR-NAME is the name of the associated directory. Otherwise it is nil."
3066 ;; Find those variables that we may want to save to 3069 ;; Find those variables that we may want to save to
3067 ;; `safe-local-variable-values'. 3070 ;; `safe-local-variable-values'.
3068 (let (all-vars risky-vars unsafe-vars) 3071 (let (all-vars risky-vars unsafe-vars)
@@ -3346,11 +3349,11 @@ Each element in this list has the form (DIR CLASS MTIME).
3346DIR is the name of the directory. 3349DIR is the name of the directory.
3347CLASS is the name of a variable class (a symbol). 3350CLASS is the name of a variable class (a symbol).
3348MTIME is the recorded modification time of the directory-local 3351MTIME is the recorded modification time of the directory-local
3349 variables file associated with this entry. This time is a list 3352variables file associated with this entry. This time is a list
3350 of two integers (the same format as `file-attributes'), and is 3353of two integers (the same format as `file-attributes'), and is
3351 used to test whether the cache entry is still valid. 3354used to test whether the cache entry is still valid.
3352 Alternatively, MTIME can be nil, which means the entry is always 3355Alternatively, MTIME can be nil, which means the entry is always
3353 considered valid.") 3356considered valid.")
3354 3357
3355(defsubst dir-locals-get-class-variables (class) 3358(defsubst dir-locals-get-class-variables (class)
3356 "Return the variable list for CLASS." 3359 "Return the variable list for CLASS."
@@ -3393,8 +3396,19 @@ Return the new variables list."
3393 (cdr entry) root variables)))) 3396 (cdr entry) root variables))))
3394 ((or (not key) 3397 ((or (not key)
3395 (derived-mode-p key)) 3398 (derived-mode-p key))
3396 (setq variables (dir-locals-collect-mode-variables 3399 (let* ((alist (cdr entry))
3397 (cdr entry) variables)))))) 3400 (subdirs (assq 'subdirs alist)))
3401 (if (or (not subdirs)
3402 (progn
3403 (setq alist (delq subdirs alist))
3404 (cdr-safe subdirs))
3405 ;; TODO someone might want to extend this to allow
3406 ;; integer values for subdir, where N means
3407 ;; variables apply to this directory and N levels
3408 ;; below it (0 == nil).
3409 (equal root default-directory))
3410 (setq variables (dir-locals-collect-mode-variables
3411 alist variables))))))))
3398 (error 3412 (error
3399 ;; The file's content might be invalid (e.g. have a merge conflict), but 3413 ;; The file's content might be invalid (e.g. have a merge conflict), but
3400 ;; that shouldn't prevent the user from opening the file. 3414 ;; that shouldn't prevent the user from opening the file.
@@ -3459,13 +3473,20 @@ across different environments and users.")
3459(defun dir-locals-find-file (file) 3473(defun dir-locals-find-file (file)
3460 "Find the directory-local variables for FILE. 3474 "Find the directory-local variables for FILE.
3461This searches upward in the directory tree from FILE. 3475This searches upward in the directory tree from FILE.
3462If the directory root of FILE has been registered in 3476It stops at the first directory that has been registered in
3463 `dir-locals-directory-cache' and the directory-local variables 3477`dir-locals-directory-cache' or contains a `dir-locals-file'.
3464 file has not been modified, return the matching entry in 3478If it finds an entry in the cache, it checks that it is valid.
3465 `dir-locals-directory-cache'. 3479A cache entry with no modification time element (normally, one that
3466Otherwise, if a directory-local variables file is found, return 3480has been assigned directly using `dir-locals-set-directory-class', not
3467 the file name. 3481set from a file) is always valid.
3468Otherwise, return nil." 3482A cache entry based on a `dir-locals-file' is valid if the modification
3483time stored in the cache matches the current file modification time.
3484If not, the cache entry is cleared so that the file will be re-read.
3485
3486This function returns either nil (no directory local variables found),
3487or the matching entry from `dir-locals-directory-cache' (a list),
3488or the full path to the `dir-locals-file' (a string) in the case
3489of no valid cache entry."
3469 (setq file (expand-file-name file)) 3490 (setq file (expand-file-name file))
3470 (let* ((dir-locals-file-name 3491 (let* ((dir-locals-file-name
3471 (if (eq system-type 'ms-dos) 3492 (if (eq system-type 'ms-dos)
@@ -3474,8 +3495,8 @@ Otherwise, return nil."
3474 (locals-file (locate-dominating-file file dir-locals-file-name)) 3495 (locals-file (locate-dominating-file file dir-locals-file-name))
3475 (dir-elt nil)) 3496 (dir-elt nil))
3476 ;; `locate-dominating-file' may have abbreviated the name. 3497 ;; `locate-dominating-file' may have abbreviated the name.
3477 (when locals-file 3498 (if locals-file
3478 (setq locals-file (expand-file-name dir-locals-file-name locals-file))) 3499 (setq locals-file (expand-file-name dir-locals-file-name locals-file)))
3479 ;; Find the best cached value in `dir-locals-directory-cache'. 3500 ;; Find the best cached value in `dir-locals-directory-cache'.
3480 (dolist (elt dir-locals-directory-cache) 3501 (dolist (elt dir-locals-directory-cache)
3481 (when (and (eq t (compare-strings file nil (length (car elt)) 3502 (when (and (eq t (compare-strings file nil (length (car elt))
@@ -3484,23 +3505,32 @@ Otherwise, return nil."
3484 '(windows-nt cygwin ms-dos)))) 3505 '(windows-nt cygwin ms-dos))))
3485 (> (length (car elt)) (length (car dir-elt)))) 3506 (> (length (car elt)) (length (car dir-elt))))
3486 (setq dir-elt elt))) 3507 (setq dir-elt elt)))
3487 (let ((use-cache (and dir-elt 3508 (if (and dir-elt
3488 (or (null locals-file) 3509 (or (null locals-file)
3489 (<= (length (file-name-directory locals-file)) 3510 (<= (length (file-name-directory locals-file))
3490 (length (car dir-elt))))))) 3511 (length (car dir-elt)))))
3491 (if use-cache 3512 ;; Found a potential cache entry. Check validity.
3492 ;; Check the validity of the cache. 3513 ;; A cache entry with no MTIME is assumed to always be valid
3493 (if (and (file-readable-p (car dir-elt)) 3514 ;; (ie, set directly, not from a dir-locals file).
3494 (or (null (nth 2 dir-elt)) 3515 ;; Note, we don't bother to check that there is a matching class
3516 ;; element in dir-locals-class-alist, since that's done by
3517 ;; dir-locals-set-directory-class.
3518 (if (or (null (nth 2 dir-elt))
3519 (let ((cached-file (expand-file-name dir-locals-file-name
3520 (car dir-elt))))
3521 (and (file-readable-p cached-file)
3495 (equal (nth 2 dir-elt) 3522 (equal (nth 2 dir-elt)
3496 (nth 5 (file-attributes (car dir-elt)))))) 3523 (nth 5 (file-attributes cached-file))))))
3497 ;; This cache entry is OK. 3524 ;; This cache entry is OK.
3498 dir-elt 3525 dir-elt
3499 ;; This cache entry is invalid; clear it. 3526 ;; This cache entry is invalid; clear it.
3500 (setq dir-locals-directory-cache 3527 (setq dir-locals-directory-cache
3501 (delq dir-elt dir-locals-directory-cache)) 3528 (delq dir-elt dir-locals-directory-cache))
3502 locals-file) 3529 ;; Return the first existing dir-locals file. Might be the same
3503 locals-file)))) 3530 ;; as dir-elt's, might not (eg latter might have been deleted).
3531 locals-file)
3532 ;; No cache entry.
3533 locals-file)))
3504 3534
3505(defun dir-locals-read-from-file (file) 3535(defun dir-locals-read-from-file (file)
3506 "Load a variables FILE and register a new class and instance. 3536 "Load a variables FILE and register a new class and instance.
@@ -3530,10 +3560,8 @@ and `file-local-variables-alist', without applying them."
3530 (dir-name nil)) 3560 (dir-name nil))
3531 (cond 3561 (cond
3532 ((stringp variables-file) 3562 ((stringp variables-file)
3533 (setq dir-name (if (buffer-file-name) 3563 (setq dir-name (file-name-directory variables-file)
3534 (file-name-directory (buffer-file-name)) 3564 class (dir-locals-read-from-file variables-file)))
3535 default-directory))
3536 (setq class (dir-locals-read-from-file variables-file)))
3537 ((consp variables-file) 3565 ((consp variables-file)
3538 (setq dir-name (nth 0 variables-file)) 3566 (setq dir-name (nth 0 variables-file))
3539 (setq class (nth 1 variables-file)))) 3567 (setq class (nth 1 variables-file))))
@@ -3842,7 +3870,9 @@ BACKUPNAME is the backup file name, which is the old file renamed."
3842 (set-file-selinux-context to-name context))) 3870 (set-file-selinux-context to-name context)))
3843 3871
3844(defvar file-name-version-regexp 3872(defvar file-name-version-regexp
3845 "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+~\\)" 3873 "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(?:~[[:digit:]]+\\)?~\\)"
3874 ;; The last ~[[:digit]]+ matches relative versions in git,
3875 ;; e.g. `foo.js.~HEAD~1~'.
3846 "Regular expression matching the backup/version part of a file name. 3876 "Regular expression matching the backup/version part of a file name.
3847Used by `file-name-sans-versions'.") 3877Used by `file-name-sans-versions'.")
3848 3878
@@ -4582,14 +4612,14 @@ See `save-some-buffers-action-alist' if you want to
4582change the additional actions you can take on files." 4612change the additional actions you can take on files."
4583 (interactive "P") 4613 (interactive "P")
4584 (save-window-excursion 4614 (save-window-excursion
4585 (let* (queried some-automatic 4615 (let* (queried autosaved-buffers
4586 files-done abbrevs-done) 4616 files-done abbrevs-done)
4587 (dolist (buffer (buffer-list)) 4617 (dolist (buffer (buffer-list))
4588 ;; First save any buffers that we're supposed to save unconditionally. 4618 ;; First save any buffers that we're supposed to save unconditionally.
4589 ;; That way the following code won't ask about them. 4619 ;; That way the following code won't ask about them.
4590 (with-current-buffer buffer 4620 (with-current-buffer buffer
4591 (when (and buffer-save-without-query (buffer-modified-p)) 4621 (when (and buffer-save-without-query (buffer-modified-p))
4592 (setq some-automatic t) 4622 (push (buffer-name) autosaved-buffers)
4593 (save-buffer)))) 4623 (save-buffer))))
4594 ;; Ask about those buffers that merit it, 4624 ;; Ask about those buffers that merit it,
4595 ;; and record the number thus saved. 4625 ;; and record the number thus saved.
@@ -4635,9 +4665,15 @@ change the additional actions you can take on files."
4635 (setq abbrevs-changed nil) 4665 (setq abbrevs-changed nil)
4636 (setq abbrevs-done t))) 4666 (setq abbrevs-done t)))
4637 (or queried (> files-done 0) abbrevs-done 4667 (or queried (> files-done 0) abbrevs-done
4638 (message (if some-automatic 4668 (cond
4639 "(Some special files were saved without asking)" 4669 ((null autosaved-buffers)
4640 "(No files need saving)")))))) 4670 (message "(No files need saving)"))
4671 ((= (length autosaved-buffers) 1)
4672 (message "(Saved %s)" (car autosaved-buffers)))
4673 (t
4674 (message "(Saved %d files: %s)"
4675 (length autosaved-buffers)
4676 (mapconcat 'identity autosaved-buffers ", "))))))))
4641 4677
4642(defun not-modified (&optional arg) 4678(defun not-modified (&optional arg)
4643 "Mark current buffer as unmodified, not needing to be saved. 4679 "Mark current buffer as unmodified, not needing to be saved.
@@ -4796,7 +4832,7 @@ given. With a prefix argument, TRASH is nil."
4796 (let* ((trashing (and delete-by-moving-to-trash 4832 (let* ((trashing (and delete-by-moving-to-trash
4797 (null current-prefix-arg))) 4833 (null current-prefix-arg)))
4798 (dir (expand-file-name 4834 (dir (expand-file-name
4799 (read-file-name 4835 (read-directory-name
4800 (if trashing 4836 (if trashing
4801 "Move directory to trash: " 4837 "Move directory to trash: "
4802 "Delete directory: ") 4838 "Delete directory: ")
@@ -4864,7 +4900,7 @@ directly into NEWNAME instead."
4864 (let ((dir (read-directory-name 4900 (let ((dir (read-directory-name
4865 "Copy directory: " default-directory default-directory t nil))) 4901 "Copy directory: " default-directory default-directory t nil)))
4866 (list dir 4902 (list dir
4867 (read-file-name 4903 (read-directory-name
4868 (format "Copy directory %s to: " dir) 4904 (format "Copy directory %s to: " dir)
4869 default-directory default-directory nil nil) 4905 default-directory default-directory nil nil)
4870 current-prefix-arg t nil))) 4906 current-prefix-arg t nil)))
@@ -5563,7 +5599,7 @@ Prefix arg (second arg if noninteractive) means supply -l switch to `ls'.
5563Actions controlled by variables `list-directory-brief-switches' 5599Actions controlled by variables `list-directory-brief-switches'
5564and `list-directory-verbose-switches'." 5600and `list-directory-verbose-switches'."
5565 (interactive (let ((pfx current-prefix-arg)) 5601 (interactive (let ((pfx current-prefix-arg))
5566 (list (read-file-name (if pfx "List directory (verbose): " 5602 (list (read-directory-name (if pfx "List directory (verbose): "
5567 "List directory (brief): ") 5603 "List directory (brief): ")
5568 nil default-directory nil) 5604 nil default-directory nil)
5569 pfx))) 5605 pfx)))
@@ -5822,6 +5858,9 @@ normally equivalent short `-D' option is just passed on to
5822 (file-name-directory file) 5858 (file-name-directory file)
5823 (file-name-directory (expand-file-name file)))) 5859 (file-name-directory (expand-file-name file))))
5824 (pattern (file-name-nondirectory file))) 5860 (pattern (file-name-nondirectory file)))
5861 ;; NB since switches is passed to the shell, be
5862 ;; careful of malicious values, eg "-l;reboot".
5863 ;; See eg dired-safe-switches-p.
5825 (call-process 5864 (call-process
5826 shell-file-name nil t nil 5865 shell-file-name nil t nil
5827 "-c" 5866 "-c"
diff --git a/lisp/find-file.el b/lisp/find-file.el
index 7ace6ce01dc..e4285523184 100644
--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -183,7 +183,7 @@ To override this, give an argument to `ff-find-other-file'."
183;;;###autoload 183;;;###autoload
184(defvar ff-special-constructs 184(defvar ff-special-constructs
185 `( 185 `(
186 ;; C/C++ include, for NeXTSTEP too 186 ;; C/C++ include, for NeXTstep too
187 (,(purecopy "^\#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") . 187 (,(purecopy "^\#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") .
188 (lambda () 188 (lambda ()
189 (buffer-substring (match-beginning 2) (match-end 2)))) 189 (buffer-substring (match-beginning 2) (match-end 2))))
@@ -494,7 +494,7 @@ If optional IN-OTHER-WINDOW is non-nil, find the file in another window."
494 494
495 (setq name 495 (setq name
496 (expand-file-name 496 (expand-file-name
497 (read-file-name 497 (read-directory-name
498 (format "Find or create %s in: " default-name) 498 (format "Find or create %s in: " default-name)
499 default-directory default-name nil))) 499 default-directory default-name nil)))
500 500
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index e23af4dff78..bce03331a29 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -229,7 +229,8 @@ This hook will be installed if the variable
229 prototype-generic-mode 229 prototype-generic-mode
230 resolve-conf-generic-mode 230 resolve-conf-generic-mode
231 samba-generic-mode 231 samba-generic-mode
232 x-resource-generic-mode) 232 x-resource-generic-mode
233 xmodmap-generic-mode)
233 "List of generic modes that are defined by default on Unix.") 234 "List of generic modes that are defined by default on Unix.")
234 235
235(defconst generic-other-modes 236(defconst generic-other-modes
@@ -370,6 +371,15 @@ your changes into effect."
370 nil 371 nil
371 "Generic mode for X Resource configuration files.")) 372 "Generic mode for X Resource configuration files."))
372 373
374(if (memq 'xmodmap-generic-mode generic-extras-enable-list)
375(define-generic-mode xmodmap-generic-mode
376 '(?!)
377 '("add" "clear" "keycode" "keysym" "remove" "pointer")
378 nil
379 '("[xX]modmap\\(rc\\)?\\'")
380 nil
381 "Simple mode for xmodmap files."))
382
373;;; Hosts 383;;; Hosts
374(when (memq 'hosts-generic-mode generic-extras-enable-list) 384(when (memq 'hosts-generic-mode generic-extras-enable-list)
375 385
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index ff48920e69c..c14c79a92cb 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,220 @@
12011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
2
3 * gnus.el (gnus-interactive): Use read-directory-name.
4
5 * gnus-uu.el (gnus-uu-decode-uu-and-save)
6 (gnus-uu-decode-unshar-and-save, gnus-uu-decode-save)
7 (gnus-uu-decode-binhex, gnus-uu-decode-yenc)
8 (gnus-uu-decode-save-view, gnus-uu-decode-postscript-and-save):
9 Likewise.
10
11 * gnus-group.el (gnus-group-make-directory-group): Likewise.
12
132011-03-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
14
15 * gnus-sum.el (gnus-update-read-articles): Fix typo.
16
17 * gnus.el (gnus-valid-select-methods): Mark nnimap as a backend that
18 really have server-side marks.
19
20 * gnus-sum.el (gnus-propagate-marks): Change default back to nil again,
21 since most backends do not usefully have server-side marks.
22 (gnus-update-read-articles): Propagate marks to all backends that
23 really have server-side marks.
24
252011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
26
27 * message.el (message-cite-reply-position, message-cite-style): New
28 variables.
29 (message-yank-original): Use the new citation styles.
30
312011-03-04 Daiki Ueno <ueno@unixuser.org>
32
33 * message.el (message-options): Revert the change that's a workaround
34 for XEmacs buffer-local issue; don't mark it buffer-local when running
35 under XEmacs.
36
372011-03-03 Tassilo Horn <tassilo@member.fsf.org>
38
39 * nnimap.el (nnimap-parse-flags): Add a workaround for FETCH lines with
40 numbers too big to be `read'.
41
422011-03-02 Teodor Zlatanov <tzz@lifelogs.com>
43
44 * message.el (message-options): Make buffer-local two ways to attempt
45 to fix a XEmacs bug.
46
472011-03-02 Julien Danjou <julien@danjou.info>
48
49 * gnus-art.el (gnus-with-article-buffer): Fix buffer live check.
50
512011-03-01 Julien Danjou <julien@danjou.info>
52
53 * gnus-art.el (list-identifier): Add list-identifier as a parameter
54 group.
55 (article-hide-list-identifiers): Use list-identifier group parameter.
56
572011-02-28 Julien Danjou <julien@danjou.info>
58
59 * sieve.el (sieve-buffer-script-name): New local variable to store
60 sieve script name.
61 (sieve-edit-script): Store sieve script name.
62 (sieve-upload): Use sieve script name when uploading.
63 (sieve-upload): Use substitute-command-keys.
64 (sieve-edit-script): Use substitute-command-keys.
65 (sieve-refresh-scriptlist): Use substitute-command-keys.
66 (sieve-manage-mode-map): Define keymap properly.
67 (sieve-manage-mode): Do not set mode name manually, change mode-name to
68 (sieve-refresh-scriptlist): Use substitute-command-keys."Sieve-manage".
69 Remove commented code about cvs.
70 (sieve-manage-quit): New function.
71 (sieve-manage-mode-map): Bind 'q' to sieve-manage-quit.
72
732011-02-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
74
75 * gnus-group.el (gnus-import-other-newsrc-file): New function.
76
772011-02-25 Teodor Zlatanov <tzz@lifelogs.com>
78
79 * auth-source.el (auth-source-search): Cache empty result sets.
80
81 * auth-source.el (auth-source-save-behavior): New variable to replace
82 `auth-source-never-create'.
83 (auth-source-netrc-create): Use it.
84 (auth-source-never-save): Remove.
85
862011-02-25 Lars Ingebrigtsen <larsi@gnus.org>
87
88 * nnimap.el (nnimap-stream): Doc fix.
89 (nnimap-open-connection-1): Reverse the order of the ports to that the
90 prompted-for port is first.
91
92 * gnus-start.el (gnus-get-unread-articles): Don't clobber the async
93 retrieval by the no-group selection.
94
95 * gnus-demon.el (gnus-demon-init): run-with-timer should be called with
96 numerical parameters.
97
982011-02-25 Julien Danjou <julien@danjou.info>
99
100 * gnus-gravatar.el: Use gnus-with-article-buffer.
101
102 * gnus-art.el (gnus-with-article-buffer): Check that the
103 gnus-article-buffer is alive.
104
1052011-02-24 Teodor Zlatanov <tzz@lifelogs.com>
106
107 * auth-source.el (auth-source-creation-prompts): New variable to manage
108 creation-time prompts.
109 (auth-source-search): Document it.
110 (auth-source-format-prompt): Add utility function.
111 (auth-source-netrc-create): Don't default the user name to
112 user-login-name. Use `auth-source-creation-prompts' and some default
113 prompts for user, host, port, and password (the default generic prompt
114 remains ugly).
115 (auth-source-never-save): Add customizable option to never save info.
116 (auth-source-netrc-create): Use it and improve save prompts. Fix help
117 mode excursion.
118
1192011-02-24 Katsumi Yamaoka <yamaoka@jpl.org>
120
121 * auth-source.el (auth-source-netrc-create): Use `read-char' with no
122 argument that XEmacs doesn't support.
123
1242011-02-23 Julien Danjou <julien@danjou.info>
125
126 * gnus-art.el (article-make-date-line): Ignore errors if time is
127 invalid and not convertible.
128 (article-make-date-line): Only add lapsed time if time is not nil.
129
1302011-02-23 Teodor Zlatanov <tzz@lifelogs.com>
131
132 * auth-source.el (auth-source-netrc-create): Use `read-char' instead of
133 `read-char-choice' for backwards compatibility.
134 (auth-source-netrc-element-or-first): New function to DTRT for
135 parameter extraction.
136 (auth-source-netrc-create): Use it and fix multiple parameter print
137 bug. Use the default passed from above (given-default) or the
138 built-in (user-login-name for :user).
139
1402011-02-23 Lars Ingebrigtsen <larsi@gnus.org>
141
142 * gnus-start.el (gnus-dribble-read-file): Set
143 buffer-save-without-query, since we always want to save the dribble
144 file, probably.
145
146 * nnmail.el (nnmail-article-group): Allow a final "" split to work on
147 nnimap.
148
149 * gnus-sum.el (gnus-user-date-format-alist): Renamed back again from
150 -summary- since it's a user-visible variable.
151
152 * nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the
153 first time you use the new Gnus.
154
1552011-02-22 Teodor Zlatanov <tzz@lifelogs.com>
156
157 * auth-source.el: Don't load netrc.el.
158 (auth-sources): Search ~/.netrc as well by default.
159 (auth-source-debug): Add 'trivia option for extra output.
160 (auth-source-do-trivia): Use it.
161 (auth-source-search): Simplify logic to use
162 `auth-source-search-backends'. Use `auth-source-do-trivia' where
163 appropriate. Don't keep a running count at this level. Layer :create
164 and :delete options appropriately on the first and second passes.
165 Don't track the backend with the search results.
166 (auth-source-search-backends): New function to search a list of
167 backends for a processed spec.
168 (auth-source-netrc-parse): Cache all netrc files, making
169 auth-source-netrc-cache an alist keyed by the file name and using the
170 file mtime as the caching criterion. Keep the obfuscated data secret
171 with a lexical bind.
172 (auth-source-netrc-search): Don't calculate the length of the results
173 unnecessarily.
174 (auth-source-search-backends): Fix bug.
175 (auth-source-netrc-create): Rework prompts.
176
1772011-02-22 Andrew Cohen <cohen@andy.bu.edu>
178
179 * nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key):
180 Lower case names of search constraints.
181 (nnir-run-query): Cache and reuse search constraints for all imap
182 servers.
183
1842011-02-22 Sam Steingold <sds@gnu.org>
185
186 * gnus-msg.el (gnus-setup-message): Also bind `winconf-name'.
187
1882011-02-22 Lars Ingebrigtsen <larsi@gnus.org>
189
190 * gnus-msg.el (gnus-inews-add-send-actions): Restore the winconf name
191 after exit.
192 (gnus-setup-message): Define missing variable from last checkin.
193
194 * gnus-sum.el (gnus-summary-show-article): When called with t as the
195 value, show the raw article.
196
1972011-02-21 Lars Ingebrigtsen <larsi@gnus.org>
198
199 * nnimap.el (nnimap-open-connection-1): Revert last change, since
200 auth-source now accepts numbers.
201
202 * auth-source.el (auth-source-netrc-parse): Accept a number as the port
203 spec, too.
204 (auth-source-ensure-strings): New function.
205
206 * gnus-art.el (gnus-article-update-date-headers): Doc fix.
207 (gnus-article-setup-buffer): Always restart the date timer so that user
208 changes to the frequency is respected.
209
210 * nnimap.el (nnimap-open-connection-1): auth-source expects strings as
211 port numbers, so make sure it gets that if nnimap-server-port is
212 explicit.
213
2142011-02-21 Simon Josefsson <simon@josefsson.org>
215
216 * nnimap.el (nnimap-inbox): Doc fix.
217
12011-02-20 Chong Yidong <cyd@stupidchicken.com> 2182011-02-20 Chong Yidong <cyd@stupidchicken.com>
2 219
3 * shr-color.el (shr-color->hexadecimal): Use renamed function names 220 * shr-color.el (shr-color->hexadecimal): Use renamed function names
@@ -620,7 +837,7 @@
620 837
621 * shr.el: Revert change that made headings use different-sized faces. 838 * shr.el: Revert change that made headings use different-sized faces.
622 The Emacs display engine isn't advanced enough that, for instance, 839 The Emacs display engine isn't advanced enough that, for instance,
623 tables can comfortably use differntly-sized faces. 840 tables can comfortably use differently-sized faces.
624 841
6252011-01-25 Lars Ingebrigtsen <larsi@gnus.org> 8422011-01-25 Lars Ingebrigtsen <larsi@gnus.org>
626 843
@@ -1672,7 +1889,7 @@
1672 1889
16732010-11-24 Lars Magne Ingebrigtsen <larsi@gnus.org> 18902010-11-24 Lars Magne Ingebrigtsen <larsi@gnus.org>
1674 1891
1675 * shr.el (shr-color-check): Protect against non-existant colour names. 1892 * shr.el (shr-color-check): Protect against non-existent colour names.
1676 1893
16772010-11-24 Julien Danjou <julien@danjou.info> 18942010-11-24 Julien Danjou <julien@danjou.info>
1678 1895
@@ -2986,7 +3203,7 @@
2986 This makes nnimap work properly on Courier again. 3203 This makes nnimap work properly on Courier again.
2987 3204
2988 * gnus.el (gnus-carpal): The carpal mode has been removed, but define 3205 * gnus.el (gnus-carpal): The carpal mode has been removed, but define
2989 the variable for backwards compatability. 3206 the variable for backwards compatibility.
2990 3207
2991 * mm-decode.el (mm-save-part): If given a non-directory result, expand 3208 * mm-decode.el (mm-save-part): If given a non-directory result, expand
2992 the file name before using to avoid setting mm-default-directory to 3209 the file name before using to avoid setting mm-default-directory to
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index e033b01ae97..500de10b71c 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -42,7 +42,6 @@
42(require 'password-cache) 42(require 'password-cache)
43(require 'mm-util) 43(require 'mm-util)
44(require 'gnus-util) 44(require 'gnus-util)
45(require 'netrc)
46(require 'assoc) 45(require 'assoc)
47(eval-when-compile (require 'cl)) 46(eval-when-compile (require 'cl))
48(require 'eieio) 47(require 'eieio)
@@ -138,8 +137,21 @@ let-binding."
138(defvar auth-source-creation-defaults nil 137(defvar auth-source-creation-defaults nil
139 "Defaults for creating token values. Usually let-bound.") 138 "Defaults for creating token values. Usually let-bound.")
140 139
140(defvar auth-source-creation-prompts nil
141 "Default prompts for token values. Usually let-bound.")
142
141(make-obsolete 'auth-source-hide-passwords nil "Emacs 24.1") 143(make-obsolete 'auth-source-hide-passwords nil "Emacs 24.1")
142 144
145(defcustom auth-source-save-behavior 'ask
146 "If set, auth-source will respect it for save behavior."
147 :group 'auth-source
148 :version "23.2" ;; No Gnus
149 :type `(choice
150 :tag "auth-source new token save behavior"
151 (const :tag "Always save" t)
152 (const :tag "Never save" nil)
153 (const :tag "Ask" ask)))
154
143(defvar auth-source-magic "auth-source-magic ") 155(defvar auth-source-magic "auth-source-magic ")
144 156
145(defcustom auth-source-do-cache t 157(defcustom auth-source-do-cache t
@@ -164,16 +176,19 @@ If the value is a function, debug messages are logged by calling
164 :type `(choice 176 :type `(choice
165 :tag "auth-source debugging mode" 177 :tag "auth-source debugging mode"
166 (const :tag "Log using `message' to the *Messages* buffer" t) 178 (const :tag "Log using `message' to the *Messages* buffer" t)
179 (const :tag "Log all trivia with `message' to the *Messages* buffer"
180 trivia)
167 (function :tag "Function that takes arguments like `message'") 181 (function :tag "Function that takes arguments like `message'")
168 (const :tag "Don't log anything" nil))) 182 (const :tag "Don't log anything" nil)))
169 183
170(defcustom auth-sources '("~/.authinfo.gpg" "~/.authinfo") 184(defcustom auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc")
171 "List of authentication sources. 185 "List of authentication sources.
172 186
173The default will get login and password information from 187The default will get login and password information from
174\"~/.authinfo.gpg\", which you should set up with the EPA/EPG 188\"~/.authinfo.gpg\", which you should set up with the EPA/EPG
175packages to be encrypted. If that file doesn't exist, it will 189packages to be encrypted. If that file doesn't exist, it will
176try the unencrypted version \"~/.authinfo\". 190try the unencrypted version \"~/.authinfo\" and the famous
191\"~/.netrc\" file.
177 192
178See the auth.info manual for details. 193See the auth.info manual for details.
179 194
@@ -256,6 +271,11 @@ If the value is not a list, symmetric encryption will be used."
256 (when auth-source-debug 271 (when auth-source-debug
257 (apply 'auth-source-do-warn msg))) 272 (apply 'auth-source-do-warn msg)))
258 273
274(defun auth-source-do-trivia (&rest msg)
275 (when (or (eq auth-source-debug 'trivia)
276 (functionp auth-source-debug))
277 (apply 'auth-source-do-warn msg)))
278
259(defun auth-source-do-warn (&rest msg) 279(defun auth-source-do-warn (&rest msg)
260 (apply 280 (apply
261 ;; set logger to either the function in auth-source-debug or 'message 281 ;; set logger to either the function in auth-source-debug or 'message
@@ -428,12 +448,18 @@ parameter, that parameter will be required in the resulting
428token. The value for that parameter will be obtained from the 448token. The value for that parameter will be obtained from the
429search parameters or from user input. If any queries are needed, 449search parameters or from user input. If any queries are needed,
430the alist `auth-source-creation-defaults' will be checked for the 450the alist `auth-source-creation-defaults' will be checked for the
431default prompt. 451default value. If the user, host, or port are missing, the alist
452`auth-source-creation-prompts' will be used to look up the
453prompts IN THAT ORDER (so the 'user prompt will be queried first,
454then 'host, then 'port, and finally 'secret). Each prompt string
455can use %u, %h, and %p to show the user, host, and port.
432 456
433Here's an example: 457Here's an example:
434 458
435\(let ((auth-source-creation-defaults '((user . \"defaultUser\") 459\(let ((auth-source-creation-defaults '((user . \"defaultUser\")
436 (A . \"default A\")))) 460 (A . \"default A\")))
461 (auth-source-creation-prompts
462 '((password . \"Enter IMAP password for %h:%p: \"))))
437 (auth-source-search :host '(\"nonesuch\" \"twosuch\") :type 'netrc :max 1 463 (auth-source-search :host '(\"nonesuch\" \"twosuch\") :type 'netrc :max 1
438 :P \"pppp\" :Q \"qqqq\" 464 :P \"pppp\" :Q \"qqqq\"
439 :create '(A B Q))) 465 :create '(A B Q)))
@@ -445,12 +471,11 @@ which says:
445 471
446 Create a new entry if you found none. The netrc backend will 472 Create a new entry if you found none. The netrc backend will
447 automatically require host, user, and port. The host will be 473 automatically require host, user, and port. The host will be
448 'nonesuch' and Q will be 'qqqq'. We prompt for A with default 474 'nonesuch' and Q will be 'qqqq'. We prompt for the password
449 'default A', for B and port with default nil, and for the 475 with the shown prompt. We will not prompt for Q. The resulting
450 user with default 'defaultUser'. We will not prompt for Q. The 476 token will have keys user, host, port, A, B, and Q. It will not
451 resulting token will have keys user, host, port, A, B, and Q. 477 have P with any value, even though P is used in the search to
452 It will not have P with any value, even though P is used in the 478 find only entries that have P set to 'pppp'.\"
453 search to find only entries that have P set to 'pppp'.\"
454 479
455When multiple values are specified in the search parameter, the 480When multiple values are specified in the search parameter, the
456user is prompted for which one. So :host (X Y Z) would ask the 481user is prompted for which one. So :host (X Y Z) would ask the
@@ -499,17 +524,20 @@ must call it to obtain the actual value."
499 (keys (loop for i below (length spec) by 2 524 (keys (loop for i below (length spec) by 2
500 unless (memq (nth i spec) ignored-keys) 525 unless (memq (nth i spec) ignored-keys)
501 collect (nth i spec))) 526 collect (nth i spec)))
527 (cached (auth-source-remembered-p spec))
528 ;; note that we may have cached results but found is still nil
529 ;; (there were no results from the search)
502 (found (auth-source-recall spec)) 530 (found (auth-source-recall spec))
503 filtered-backends accessor-key found-here goal matches backend) 531 filtered-backends accessor-key backend)
504 532
505 (if (and found auth-source-do-cache) 533 (if (and cached auth-source-do-cache)
506 (auth-source-do-debug 534 (auth-source-do-debug
507 "auth-source-search: found %d CACHED results matching %S" 535 "auth-source-search: found %d CACHED results matching %S"
508 (length found) spec) 536 (length found) spec)
509 537
510 (assert 538 (assert
511 (or (eq t create) (listp create)) t 539 (or (eq t create) (listp create)) t
512 "Invalid auth-source :create parameter (must be nil, t, or a list): %s %s") 540 "Invalid auth-source :create parameter (must be t or a list): %s %s")
513 541
514 (setq filtered-backends (copy-sequence backends)) 542 (setq filtered-backends (copy-sequence backends))
515 (dolist (backend backends) 543 (dolist (backend backends)
@@ -523,66 +551,65 @@ must call it to obtain the actual value."
523 (return)) 551 (return))
524 (invalid-slot-name)))) 552 (invalid-slot-name))))
525 553
526 (auth-source-do-debug 554 (auth-source-do-trivia
527 "auth-source-search: found %d backends matching %S" 555 "auth-source-search: found %d backends matching %S"
528 (length filtered-backends) spec) 556 (length filtered-backends) spec)
529 557
530 ;; (debug spec "filtered" filtered-backends) 558 ;; (debug spec "filtered" filtered-backends)
531 (setq goal max)
532 ;; First go through all the backends without :create, so we can 559 ;; First go through all the backends without :create, so we can
533 ;; query them all. 560 ;; query them all.
534 (let ((uspec (copy-sequence spec))) 561 (setq found (auth-source-search-backends filtered-backends
535 (plist-put uspec :create nil) 562 spec
536 (dolist (backend filtered-backends) 563 ;; to exit early
537 (let ((match (apply 564 max
538 (slot-value backend 'search-function) 565 ;; create and delete
539 :backend backend 566 nil delete))
540 uspec))) 567
541 (when match 568 (auth-source-do-debug
542 (push (list backend match) matches))))) 569 "auth-source-search: found %d results (max %d) matching %S"
570 (length found) max spec)
571
543 ;; If we didn't find anything, then we allow the backend(s) to 572 ;; If we didn't find anything, then we allow the backend(s) to
544 ;; create the entries. 573 ;; create the entries.
545 (when (and create 574 (when (and create
546 (not matches)) 575 (not found))
547 (dolist (backend filtered-backends) 576 (setq found (auth-source-search-backends filtered-backends
548 (unless matches 577 spec
549 (let ((match (apply 578 ;; to exit early
550 (slot-value backend 'search-function) 579 max
551 :backend backend 580 ;; create and delete
552 :create create 581 create delete))
553 :delete delete 582 (auth-source-do-warn
554 spec))) 583 "auth-source-search: CREATED %d results (max %d) matching %S"
555 (when match 584 (length found) max spec))
556 (push (list backend match) matches)))))) 585
557 586 ;; note we remember the lack of result too, if it's applicable
558 (setq backend (caar matches) 587 (when auth-source-do-cache
559 found-here (cadar matches)) 588 (auth-source-remember spec found)))
560 589
561 (block nil 590 found))
562 ;; if max is 0, as soon as we find something, return it 591
563 (when (and (zerop max) (> 0 (length found-here))) 592(defun auth-source-search-backends (backends spec max create delete)
564 (return t)) 593 (let (matches)
565 594 (dolist (backend backends)
566 ;; decrement the goal by the number of new results 595 (when (> max (length matches)) ; when we need more matches...
567 (decf goal (length found-here)) 596 (let ((bmatches (apply
568 ;; and append the new results to the full list 597 (slot-value backend 'search-function)
569 (setq found (append found found-here)) 598 :backend backend
570 599 ;; note we're overriding whatever the spec
571 (auth-source-do-debug 600 ;; has for :create and :delete
572 "auth-source-search: found %d results (max %d/%d) in %S matching %S" 601 :create create
573 (length found-here) max goal backend spec) 602 :delete delete
574 603 spec)))
575 ;; return full list if the goal is 0 or negative 604 (when bmatches
576 (when (zerop (max 0 goal)) 605 (auth-source-do-trivia
577 (return found)) 606 "auth-source-search-backend: got %d (max %d) in %s:%s matching %S"
578 607 (length bmatches) max
579 ;; change the :max parameter in the spec to the goal 608 (slot-value backend :type)
580 (setq spec (plist-put spec :max goal)) 609 (slot-value backend :source)
581 610 spec)
582 (when (and found auth-source-do-cache) 611 (setq matches (append matches bmatches))))))
583 (auth-source-remember spec found)))) 612 matches))
584
585 found))
586 613
587;;; (auth-source-search :max 1) 614;;; (auth-source-search :max 1)
588;;; (funcall (plist-get (nth 0 (auth-source-search :max 1)) :secret)) 615;;; (funcall (plist-get (nth 0 (auth-source-search :max 1)) :secret))
@@ -631,6 +658,11 @@ Returns the deleted entries."
631 (password-read-from-cache 658 (password-read-from-cache
632 (concat auth-source-magic (format "%S" spec)))) 659 (concat auth-source-magic (format "%S" spec))))
633 660
661(defun auth-source-remembered-p (spec)
662 "Check if SPEC is remembered."
663 (password-in-cache-p
664 (concat auth-source-magic (format "%S" spec))))
665
634(defun auth-source-forget (spec) 666(defun auth-source-forget (spec)
635 "Forget any cached data matching SPEC exactly. 667 "Forget any cached data matching SPEC exactly.
636 668
@@ -641,7 +673,10 @@ Returns t or nil for forgotten or not found."
641;;; (loop for sym being the symbols of password-data when (string-match (concat "^" auth-source-magic) (symbol-name sym)) collect (symbol-name sym)) 673;;; (loop for sym being the symbols of password-data when (string-match (concat "^" auth-source-magic) (symbol-name sym)) collect (symbol-name sym))
642 674
643;;; (auth-source-remember '(:host "wedd") '(4 5 6)) 675;;; (auth-source-remember '(:host "wedd") '(4 5 6))
676;;; (auth-source-remembered-p '(:host "wedd"))
644;;; (auth-source-remember '(:host "xedd") '(1 2 3)) 677;;; (auth-source-remember '(:host "xedd") '(1 2 3))
678;;; (auth-source-remembered-p '(:host "xedd"))
679;;; (auth-source-remembered-p '(:host "zedd"))
645;;; (auth-source-recall '(:host "xedd")) 680;;; (auth-source-recall '(:host "xedd"))
646;;; (auth-source-recall '(:host t)) 681;;; (auth-source-recall '(:host t))
647;;; (auth-source-forget+ :host t) 682;;; (auth-source-forget+ :host t)
@@ -680,6 +715,15 @@ while \(:host t) would find all host entries."
680 715
681;;; Backend specific parsing: netrc/authinfo backend 716;;; Backend specific parsing: netrc/authinfo backend
682 717
718(defun auth-source-ensure-strings (values)
719 (unless (listp values)
720 (setq values (list values)))
721 (mapcar (lambda (value)
722 (if (numberp value)
723 (format "%s" value)
724 value))
725 values))
726
683(defvar auth-source-netrc-cache nil) 727(defvar auth-source-netrc-cache nil)
684 728
685;;; (auth-source-netrc-parse "~/.authinfo.gpg") 729;;; (auth-source-netrc-parse "~/.authinfo.gpg")
@@ -693,26 +737,37 @@ Note that the MAX parameter is used so we can exit the parse early."
693 ;; We got already parsed contents; just return it. 737 ;; We got already parsed contents; just return it.
694 file 738 file
695 (when (file-exists-p file) 739 (when (file-exists-p file)
740 (setq port (auth-source-ensure-strings port))
696 (with-temp-buffer 741 (with-temp-buffer
697 (let ((tokens '("machine" "host" "default" "login" "user" 742 (let* ((tokens '("machine" "host" "default" "login" "user"
698 "password" "account" "macdef" "force" 743 "password" "account" "macdef" "force"
699 "port" "protocol")) 744 "port" "protocol"))
700 (max (or max 5000)) ; sanity check: default to stop at 5K 745 (max (or max 5000)) ; sanity check: default to stop at 5K
701 (modified 0) 746 (modified 0)
702 alist elem result pair) 747 (cached (cdr-safe (assoc file auth-source-netrc-cache)))
703 (if (and auth-source-netrc-cache 748 (cached-mtime (plist-get cached :mtime))
704 (equal (car auth-source-netrc-cache) 749 (cached-secrets (plist-get cached :secret))
705 (nth 5 (file-attributes file)))) 750 alist elem result pair)
706 (insert (base64-decode-string 751
707 (rot13-string (cdr auth-source-netrc-cache)))) 752 (if (and (functionp cached-secrets)
708 (insert-file-contents file) 753 (equal cached-mtime
709 (when (string-match "\\.gpg\\'" file) 754 (nth 5 (file-attributes file))))
710 ;; Store the contents of the file heavily encrypted in memory. 755 (progn
711 (setq auth-source-netrc-cache 756 (auth-source-do-trivia
712 (cons (nth 5 (file-attributes file)) 757 "auth-source-netrc-parse: using CACHED file data for %s"
713 (rot13-string 758 file)
714 (base64-encode-string 759 (insert (funcall cached-secrets)))
715 (buffer-string))))))) 760 (insert-file-contents file)
761 ;; cache all netrc files (used to be just .gpg files)
762 ;; Store the contents of the file heavily encrypted in memory.
763 ;; (note for the irony-impaired: they are just obfuscated)
764 (aput 'auth-source-netrc-cache file
765 (list :mtime (nth 5 (file-attributes file))
766 :secret (lexical-let ((v (rot13-string
767 (base64-encode-string
768 (buffer-string)))))
769 (lambda () (base64-decode-string
770 (rot13-string v)))))))
716 (goto-char (point-min)) 771 (goto-char (point-min))
717 ;; Go through the file, line by line. 772 ;; Go through the file, line by line.
718 (while (and (not (eobp)) 773 (while (and (not (eobp))
@@ -858,7 +913,7 @@ See `auth-source-search' for details on SPEC."
858 913
859 ;; if we need to create an entry AND none were found to match 914 ;; if we need to create an entry AND none were found to match
860 (when (and create 915 (when (and create
861 (= 0 (length results))) 916 (not results))
862 917
863 ;; create based on the spec and record the value 918 ;; create based on the spec and record the value
864 (setq results (or 919 (setq results (or
@@ -873,6 +928,22 @@ See `auth-source-search' for details on SPEC."
873 (plist-put spec :create nil))))) 928 (plist-put spec :create nil)))))
874 results)) 929 results))
875 930
931(defun auth-source-netrc-element-or-first (v)
932 (if (listp v)
933 (nth 0 v)
934 v))
935
936;; (auth-source-format-prompt "test %u %h %p" '((?u "user") (?h "host")))
937
938(defun auth-source-format-prompt (prompt alist)
939 "Format PROMPT using %x (for any character x) specifiers in ALIST."
940 (dolist (cell alist)
941 (let ((c (nth 0 cell))
942 (v (nth 1 cell)))
943 (when (and c v)
944 (setq prompt (replace-regexp-in-string (format "%%%c" c) v prompt)))))
945 prompt)
946
876;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t) 947;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t)
877;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B))) 948;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B)))
878 949
@@ -887,7 +958,6 @@ See `auth-source-search' for details on SPEC."
887 (required (append base-required create-extra)) 958 (required (append base-required create-extra))
888 (file (oref backend source)) 959 (file (oref backend source))
889 (add "") 960 (add "")
890 (show "")
891 ;; `valist' is an alist 961 ;; `valist' is an alist
892 valist 962 valist
893 ;; `artificial' will be returned if no creation is needed 963 ;; `artificial' will be returned if no creation is needed
@@ -918,63 +988,58 @@ See `auth-source-search' for details on SPEC."
918 ;; for each required element 988 ;; for each required element
919 (dolist (r required) 989 (dolist (r required)
920 (let* ((data (aget valist r)) 990 (let* ((data (aget valist r))
991 ;; take the first element if the data is a list
992 (data (auth-source-netrc-element-or-first data))
993 ;; this is the default to be offered
921 (given-default (aget auth-source-creation-defaults r)) 994 (given-default (aget auth-source-creation-defaults r))
922 ;; the defaults are simple 995 ;; the default supplementals are simple: for the user,
996 ;; try (user-login-name), otherwise take given-default
923 (default (cond 997 (default (cond
924 ((and (not given-default) (eq r 'user)) 998 ;; don't default the user name
925 (user-login-name)) 999 ;; ((and (not given-default) (eq r 'user))
926 ;; note we need this empty string 1000 ;; (user-login-name))
927 ((and (not given-default) (eq r 'port))
928 "")
929 (t given-default))) 1001 (t given-default)))
930 ;; the prompt's default string depends on the data so far 1002 (printable-defaults (list
931 (default-string (if (and default (< 0 (length default))) 1003 (cons 'user
932 (format " (default %s)" default) 1004 (or
933 " (no default)")) 1005 (auth-source-netrc-element-or-first
934 ;; the prompt should also show what's entered so far 1006 (aget valist 'user))
935 (user-value (aget valist 'user)) 1007 (plist-get artificial :user)
936 (host-value (aget valist 'host)) 1008 "[any user]"))
937 (port-value (aget valist 'port)) 1009 (cons 'host
938 ;; note this handles lists by just printing them 1010 (or
939 ;; later we allow the user to use completing-read to pick 1011 (auth-source-netrc-element-or-first
940 (info-so-far (concat (if user-value 1012 (aget valist 'host))
941 (format "%s@" user-value) 1013 (plist-get artificial :host)
942 "[USER?]") 1014 "[any host]"))
943 (if host-value 1015 (cons 'port
944 (format "%s" host-value) 1016 (or
945 "[HOST?]") 1017 (auth-source-netrc-element-or-first
946 (if port-value 1018 (aget valist 'port))
947 ;; this distinguishes protocol between 1019 (plist-get artificial :port)
948 (if (zerop (length port-value)) 1020 "[any port]"))))
949 "" ; 'entered as "no default"' vs. 1021 (prompt (or (aget auth-source-creation-prompts r)
950 (format ":%s" port-value)) ; given 1022 (case r
951 ;; and this is when the protocol is unknown 1023 ('secret "%p password for user %u, host %h: ")
952 "[PORT?]")))) 1024 ('user "%p user name: ")
953 1025 ('host "%p host name for user %u: ")
954 ;; now prompt if the search SPEC did not include a required key; 1026 ('port "%p port for user %u and host %h: "))
955 ;; take the result and put it in `data' AND store it in `valist' 1027 (format "Enter %s (%%u@%%h:%%p): " r)))
956 (aput 'valist r 1028 (prompt (auth-source-format-prompt
957 (setq data 1029 prompt
958 (cond 1030 `((?u ,(aget printable-defaults 'user))
959 ((and (null data) (eq r 'secret)) 1031 (?h ,(aget printable-defaults 'host))
960 ;; special case prompt for passwords 1032 (?p ,(aget printable-defaults 'port))))))
961 (read-passwd (format "Password for %s: " info-so-far))) 1033
962 ((null data) 1034 ;; store the data, prompting for the password if needed
963 (read-string 1035 (setq data
964 (format "Enter %s for %s%s: " 1036 (cond
965 r info-so-far default-string) 1037 ((and (null data) (eq r 'secret))
966 nil nil default)) 1038 ;; special case prompt for passwords
967 ((listp data) 1039 (read-passwd prompt))
968 (completing-read 1040 ((null data)
969 (format "Enter %s for %s (TAB to see the choices): " 1041 (read-string prompt default))
970 r info-so-far) 1042 (t (or data default))))
971 data
972 nil ; no predicate
973 t ; require a match
974 ;; note the default is nil, but if the user
975 ;; hits RET we'll get "", which is handled OK later
976 nil))
977 (t data))))
978 1043
979 (when data 1044 (when data
980 (setq artificial (plist-put artificial 1045 (setq artificial (plist-put artificial
@@ -987,7 +1052,9 @@ See `auth-source-search' for details on SPEC."
987 ;; when r is not an empty string... 1052 ;; when r is not an empty string...
988 (when (and (stringp data) 1053 (when (and (stringp data)
989 (< 0 (length data))) 1054 (< 0 (length data)))
990 (let ((printer (lambda (hide) 1055 ;; this function is not strictly necessary but I think it
1056 ;; makes the code clearer -tzz
1057 (let ((printer (lambda ()
991 ;; append the key (the symbol name of r) 1058 ;; append the key (the symbol name of r)
992 ;; and the value in r 1059 ;; and the value in r
993 (format "%s%s %S" 1060 (format "%s%s %S"
@@ -995,17 +1062,14 @@ See `auth-source-search' for details on SPEC."
995 (if (zerop (length add)) "" " ") 1062 (if (zerop (length add)) "" " ")
996 ;; remap auth-source tokens to netrc 1063 ;; remap auth-source tokens to netrc
997 (case r 1064 (case r
998 ('user "login") 1065 ('user "login")
999 ('host "machine") 1066 ('host "machine")
1000 ('secret "password") 1067 ('secret "password")
1001 ('port "port") ; redundant but clearer 1068 ('port "port") ; redundant but clearer
1002 (t (symbol-name r))) 1069 (t (symbol-name r)))
1003 ;; the value will be printed in %S format 1070 ;; the value will be printed in %S format
1004 (if (and hide (eq r 'secret)) 1071 data))))
1005 "HIDDEN_SECRET" 1072 (setq add (concat add (funcall printer)))))))
1006 data)))))
1007 (setq add (concat add (funcall printer nil)))
1008 (setq show (concat show (funcall printer t)))))))
1009 1073
1010 (with-temp-buffer 1074 (with-temp-buffer
1011 (when (file-exists-p file) 1075 (when (file-exists-p file)
@@ -1022,17 +1086,55 @@ See `auth-source-search' for details on SPEC."
1022 (goto-char (point-max)) 1086 (goto-char (point-max))
1023 1087
1024 ;; ask AFTER we've successfully opened the file 1088 ;; ask AFTER we've successfully opened the file
1025 (if (y-or-n-p (format "Add to file %s: line [%s]" file show)) 1089 (let ((prompt (format "Save auth info to file %s? %s: "
1090 file
1091 "y/n/N/e/?"))
1092 (done (not (eq auth-source-save-behavior 'ask)))
1093 (bufname "*auth-source Help*")
1094 k)
1095 (while (not done)
1096 (message "%s" prompt)
1097 (setq k (read-char))
1098 (case k
1099 (?y (setq done t))
1100 (?? (save-excursion
1101 (with-output-to-temp-buffer bufname
1102 (princ
1103 (concat "(y)es, save\n"
1104 "(n)o but use the info\n"
1105 "(N)o and don't ask to save again\n"
1106 "(e)dit the line\n"
1107 "(?) for help as you can see.\n"))
1108 (set-buffer standard-output)
1109 (help-mode))))
1110 (?n (setq add ""
1111 done t))
1112 (?N (setq add ""
1113 done t
1114 auth-source-save-behavior nil))
1115 (?e (setq add (read-string "Line to add: " add)))
1116 (t nil)))
1117
1118 (when (get-buffer-window bufname)
1119 (delete-window (get-buffer-window bufname)))
1120
1121 ;; make sure the info is not saved
1122 (when (null auth-source-save-behavior)
1123 (setq add ""))
1124
1125 (when (< 0 (length add))
1026 (progn 1126 (progn
1027 (unless (bolp) 1127 (unless (bolp)
1028 (insert "\n")) 1128 (insert "\n"))
1029 (insert add "\n") 1129 (insert add "\n")
1030 (write-region (point-min) (point-max) file nil 'silent) 1130 (write-region (point-min) (point-max) file nil 'silent)
1031 (auth-source-do-debug 1131 (auth-source-do-warn
1032 "auth-source-netrc-create: wrote 1 new line to %s" 1132 "auth-source-netrc-create: wrote 1 new line to %s"
1033 file) 1133 file)
1034 nil) 1134 nil))
1035 (list artificial))))) 1135
1136 (when (eq done t)
1137 (list artificial))))))
1036 1138
1037;;; Backend specific parsing: Secrets API backend 1139;;; Backend specific parsing: Secrets API backend
1038 1140
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 204d63d37e4..989488c0995 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -441,7 +441,7 @@ manipulated as follows:
441 (setf (gnus-agent-cat-groups old-category) 441 (setf (gnus-agent-cat-groups old-category)
442 (delete group (gnus-agent-cat-groups 442 (delete group (gnus-agent-cat-groups
443 old-category)))))) 443 old-category))))))
444 ;; Purge cache as preceeding loop invalidated it. 444 ;; Purge cache as preceding loop invalidated it.
445 (setq gnus-category-group-cache nil)) 445 (setq gnus-category-group-cache nil))
446 446
447 (setcdr (or (assq 'agent-groups category) 447 (setcdr (or (assq 'agent-groups category)
@@ -1195,7 +1195,7 @@ downloadable."
1195 (mapc #'gnus-summary-remove-process-mark 1195 (mapc #'gnus-summary-remove-process-mark
1196 (gnus-sorted-ndifference gnus-newsgroup-processable gnus-newsgroup-undownloaded)) 1196 (gnus-sorted-ndifference gnus-newsgroup-processable gnus-newsgroup-undownloaded))
1197 1197
1198 ;; The preceeding call to (gnus-agent-summary-fetch-group) 1198 ;; The preceding call to (gnus-agent-summary-fetch-group)
1199 ;; updated the temporary gnus-newsgroup-downloadable to 1199 ;; updated the temporary gnus-newsgroup-downloadable to
1200 ;; remove each article successfully fetched. Now, I 1200 ;; remove each article successfully fetched. Now, I
1201 ;; update the real gnus-newsgroup-downloadable to only 1201 ;; update the real gnus-newsgroup-downloadable to only
@@ -1520,14 +1520,14 @@ downloaded into the agent."
1520 header-number) 1520 header-number)
1521 ;; Check each article 1521 ;; Check each article
1522 (while (setq article (pop articles)) 1522 (while (setq article (pop articles))
1523 ;; Skip alist entries preceeding this article 1523 ;; Skip alist entries preceding this article
1524 (while (> article (or (caar alist) (1+ article))) 1524 (while (> article (or (caar alist) (1+ article)))
1525 (setq alist (cdr alist))) 1525 (setq alist (cdr alist)))
1526 1526
1527 ;; Prune off articles that we have already fetched. 1527 ;; Prune off articles that we have already fetched.
1528 (unless (and (eq article (caar alist)) 1528 (unless (and (eq article (caar alist))
1529 (cdar alist)) 1529 (cdar alist))
1530 ;; Skip headers preceeding this article 1530 ;; Skip headers preceding this article
1531 (while (> article 1531 (while (> article
1532 (setq header-number 1532 (setq header-number
1533 (let* ((header (car headers))) 1533 (let* ((header (car headers)))
@@ -3437,7 +3437,7 @@ missing NOV entry. Run gnus-agent-regenerate-group to restore it.")))
3437 3437
3438 ;; If considering all articles is set, I can only 3438 ;; If considering all articles is set, I can only
3439 ;; expire article IDs that are no longer in the 3439 ;; expire article IDs that are no longer in the
3440 ;; active range (That is, articles that preceed the 3440 ;; active range (That is, articles that precede the
3441 ;; first article in the new alist). 3441 ;; first article in the new alist).
3442 (if (and gnus-agent-consider-all-articles 3442 (if (and gnus-agent-consider-all-articles
3443 (>= article-number (car active))) 3443 (>= article-number (car active)))
@@ -3715,7 +3715,7 @@ has been fetched."
3715 (gnus-agent-append-to-list tail-uncached v1)) 3715 (gnus-agent-append-to-list tail-uncached v1))
3716 (setq arts (cdr arts)) 3716 (setq arts (cdr arts))
3717 (setq ref (cdr ref))) 3717 (setq ref (cdr ref)))
3718 (t ; reference article (v2) preceeds the list being filtered 3718 (t ; reference article (v2) precedes the list being filtered
3719 (setq ref (cdr ref)))))) 3719 (setq ref (cdr ref))))))
3720 (while arts 3720 (while arts
3721 (gnus-agent-append-to-list tail-uncached (pop arts))) 3721 (gnus-agent-append-to-list tail-uncached (pop arts)))
@@ -4020,7 +4020,7 @@ If REREAD is not nil, downloaded articles are marked as unread."
4020 ;; article (with the exception of the last ID in the list - it's 4020 ;; article (with the exception of the last ID in the list - it's
4021 ;; special) that no longer appears in the overview. In this 4021 ;; special) that no longer appears in the overview. In this
4022 ;; situtation, the last article ID in the list implies that it, 4022 ;; situtation, the last article ID in the list implies that it,
4023 ;; and every article ID preceeding it, have been fetched from the 4023 ;; and every article ID preceding it, have been fetched from the
4024 ;; server. 4024 ;; server.
4025 4025
4026 (if gnus-agent-consider-all-articles 4026 (if gnus-agent-consider-all-articles
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 19eee78ab17..c64138b43d7 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1040,7 +1040,7 @@ Some of these headers are updated automatically. See
1040 (item :tag "User-defined" :value 'user-defined))) 1040 (item :tag "User-defined" :value 'user-defined)))
1041 1041
1042(defcustom gnus-article-update-date-headers 1 1042(defcustom gnus-article-update-date-headers 1
1043 "How often to update the date header. 1043 "A number that says how often to update the date header (in seconds).
1044If nil, don't update it at all." 1044If nil, don't update it at all."
1045 :version "24.1" 1045 :version "24.1"
1046 :group 'gnus-article-headers 1046 :group 'gnus-article-headers
@@ -1253,6 +1253,24 @@ predicate. See Info node `(gnus)Customizing Articles'."
1253 :link '(custom-manual "(gnus)Customizing Articles") 1253 :link '(custom-manual "(gnus)Customizing Articles")
1254 :type gnus-article-treat-custom) 1254 :type gnus-article-treat-custom)
1255 1255
1256(gnus-define-group-parameter
1257 list-identifier
1258 :variable-document
1259 "Alist of regexps and correspondent identifiers."
1260 :variable-group gnus-article-washing
1261 :parameter-type
1262 '(choice :tag "Identifier"
1263 :value nil
1264 (symbol :tag "Item in `gnus-list-identifiers'" none)
1265 regexp
1266 (const :tag "None" nil))
1267 :parameter-document
1268 "If non-nil, specify how to remove `identifiers' from articles' subject.
1269
1270Any symbol is used to look up a regular expression to match the
1271banner in `gnus-list-identifiers'. A string is used as a regular
1272expression to match the identifier directly.")
1273
1256(make-obsolete-variable 'gnus-treat-strip-pgp nil 1274(make-obsolete-variable 'gnus-treat-strip-pgp nil
1257 "Gnus 5.10 (Emacs 22.1)") 1275 "Gnus 5.10 (Emacs 22.1)")
1258 1276
@@ -1725,9 +1743,10 @@ Initialized from `text-mode-syntax-table.")
1725(put 'gnus-with-article-headers 'edebug-form-spec '(body)) 1743(put 'gnus-with-article-headers 'edebug-form-spec '(body))
1726 1744
1727(defmacro gnus-with-article-buffer (&rest forms) 1745(defmacro gnus-with-article-buffer (&rest forms)
1728 `(with-current-buffer gnus-article-buffer 1746 `(when (buffer-live-p (get-buffer gnus-article-buffer))
1729 (let ((inhibit-read-only t)) 1747 (with-current-buffer gnus-article-buffer
1730 ,@forms))) 1748 (let ((inhibit-read-only t))
1749 ,@forms))))
1731 1750
1732(put 'gnus-with-article-buffer 'lisp-indent-function 0) 1751(put 'gnus-with-article-buffer 'lisp-indent-function 0)
1733(put 'gnus-with-article-buffer 'edebug-form-spec '(body)) 1752(put 'gnus-with-article-buffer 'edebug-form-spec '(body))
@@ -3055,10 +3074,11 @@ images if any to the browser, and deletes them when exiting the group
3055The `gnus-list-identifiers' variable specifies what to do." 3074The `gnus-list-identifiers' variable specifies what to do."
3056 (interactive) 3075 (interactive)
3057 (let ((inhibit-point-motion-hooks t) 3076 (let ((inhibit-point-motion-hooks t)
3058 (regexp (if (consp gnus-list-identifiers) 3077 (regexp (or (gnus-parameter-list-identifier gnus-newsgroup-name)
3059 (mapconcat 'identity gnus-list-identifiers " *\\|") 3078 (if (consp gnus-list-identifiers)
3060 gnus-list-identifiers)) 3079 (mapconcat 'identity gnus-list-identifiers " *\\|")
3061 (inhibit-read-only t)) 3080 gnus-list-identifiers)))
3081 (inhibit-read-only t))
3062 (when regexp 3082 (when regexp
3063 (save-excursion 3083 (save-excursion
3064 (save-restriction 3084 (save-restriction
@@ -3463,7 +3483,7 @@ possible values."
3463 combined-lapsed)) 3483 combined-lapsed))
3464 (error "Unknown conversion type: %s" type)) 3484 (error "Unknown conversion type: %s" type))
3465 (condition-case () 3485 (condition-case ()
3466 (let ((time (date-to-time date))) 3486 (let ((time (ignore-errors (date-to-time date))))
3467 (cond 3487 (cond
3468 ;; Convert to the local timezone. 3488 ;; Convert to the local timezone.
3469 ((eq type 'local) 3489 ((eq type 'local)
@@ -3515,6 +3535,7 @@ possible values."
3515 (segments 3) 3535 (segments 3)
3516 lapsed-string) 3536 lapsed-string)
3517 (while (and 3537 (while (and
3538 time
3518 (setq lapsed-string 3539 (setq lapsed-string
3519 (concat " (" (article-lapsed-string time segments) ")")) 3540 (concat " (" (article-lapsed-string time segments) ")"))
3520 (> (+ (length date-string) 3541 (> (+ (length date-string)
@@ -4505,13 +4526,10 @@ commands:
4505 (setq gnus-summary-buffer 4526 (setq gnus-summary-buffer
4506 (gnus-summary-buffer-name gnus-newsgroup-name)) 4527 (gnus-summary-buffer-name gnus-newsgroup-name))
4507 (gnus-summary-set-local-parameters gnus-newsgroup-name) 4528 (gnus-summary-set-local-parameters gnus-newsgroup-name)
4508 (cond 4529 (when article-lapsed-timer
4509 ((and gnus-article-update-date-headers 4530 (gnus-stop-date-timer))
4510 (not article-lapsed-timer)) 4531 (when gnus-article-update-date-headers
4511 (gnus-start-date-timer gnus-article-update-date-headers)) 4532 (gnus-start-date-timer gnus-article-update-date-headers))
4512 ((and (not gnus-article-update-date-headers)
4513 article-lapsed-timer)
4514 (gnus-stop-date-timer)))
4515 (current-buffer))))) 4533 (current-buffer)))))
4516 4534
4517;; Set article window start at LINE, where LINE is the number of lines 4535;; Set article window start at LINE, where LINE is the number of lines
diff --git a/lisp/gnus/gnus-demon.el b/lisp/gnus/gnus-demon.el
index 2a45b9363f4..419346b7191 100644
--- a/lisp/gnus/gnus-demon.el
+++ b/lisp/gnus/gnus-demon.el
@@ -140,7 +140,7 @@ Emacs has been idle for IDLE `gnus-demon-timestep's."
140 ;; (func number nil) 140 ;; (func number nil)
141 ;; Call every `time' 141 ;; Call every `time'
142 ((and (numberp time) (null idle)) 142 ((and (numberp time) (null idle))
143 (run-with-timer t time 'gnus-demon-run-callback func))))) 143 (run-with-timer time time 'gnus-demon-run-callback func)))))
144 (when timer 144 (when timer
145 (add-to-list 'gnus-demon-timers timer))))) 145 (add-to-list 'gnus-demon-timers timer)))))
146 146
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index 7208889a163..98b1f3bd18c 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -80,9 +80,8 @@ If nil, default to `gravatar-size'."
80 "Insert GRAVATAR for ADDRESS in HEADER in current article buffer. 80 "Insert GRAVATAR for ADDRESS in HEADER in current article buffer.
81Set image category to CATEGORY." 81Set image category to CATEGORY."
82 (unless (eq gravatar 'error) 82 (unless (eq gravatar 'error)
83 (with-current-buffer gnus-article-buffer 83 (gnus-with-article-buffer
84 (let ((mark (point-marker)) 84 (let ((mark (point-marker))
85 (inhibit-read-only t)
86 (inhibit-point-motion-hooks t) 85 (inhibit-point-motion-hooks t)
87 (case-fold-search t)) 86 (case-fold-search t))
88 (save-restriction 87 (save-restriction
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 30cd1275e7b..9ed3cf02a49 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -3102,7 +3102,7 @@ The user will be prompted for a directory. The contents of this
3102directory will be used as a newsgroup. The directory should contain 3102directory will be used as a newsgroup. The directory should contain
3103mail messages or news articles in files that have numeric names." 3103mail messages or news articles in files that have numeric names."
3104 (interactive 3104 (interactive
3105 (list (read-file-name "Create group from directory: "))) 3105 (list (read-directory-name "Create group from directory: ")))
3106 (unless (file-exists-p dir) 3106 (unless (file-exists-p dir)
3107 (error "No such directory")) 3107 (error "No such directory"))
3108 (unless (file-directory-p dir) 3108 (unless (file-directory-p dir)
@@ -4400,6 +4400,21 @@ and the second element is the address."
4400(defun gnus-group-set-params-info (group params) 4400(defun gnus-group-set-params-info (group params)
4401 (gnus-group-set-info params group 'params)) 4401 (gnus-group-set-info params group 'params))
4402 4402
4403;; Ad-hoc function for inserting data from a different newsrc.eld
4404;; file. Use with caution, if at all.
4405(defun gnus-import-other-newsrc-file (file)
4406 (with-temp-buffer
4407 (insert-file file)
4408 (let (form)
4409 (while (ignore-errors
4410 (setq form (read (current-buffer))))
4411 (when (and (consp form)
4412 (eq (cadr form) 'gnus-newsrc-alist))
4413 (let ((infos (cadr (nth 2 form))))
4414 (dolist (info infos)
4415 (when (gnus-get-info (car info))
4416 (gnus-set-info (car info) info)))))))))
4417
4403(defun gnus-add-marked-articles (group type articles &optional info force) 4418(defun gnus-add-marked-articles (group type articles &optional info force)
4404 ;; Add ARTICLES of TYPE to the info of GROUP. 4419 ;; Add ARTICLES of TYPE to the info of GROUP.
4405 ;; If INFO is non-nil, use that info. If FORCE is non-nil, don't 4420 ;; If INFO is non-nil, use that info. If FORCE is non-nil, don't
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index b199dcc572c..093eec33fcd 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -383,11 +383,13 @@ Thank you for your help in stamping out bugs.
383(defvar gnus-article-reply nil) 383(defvar gnus-article-reply nil)
384(defmacro gnus-setup-message (config &rest forms) 384(defmacro gnus-setup-message (config &rest forms)
385 (let ((winconf (make-symbol "gnus-setup-message-winconf")) 385 (let ((winconf (make-symbol "gnus-setup-message-winconf"))
386 (winconf-name (make-symbol "gnus-setup-message-winconf-name"))
386 (buffer (make-symbol "gnus-setup-message-buffer")) 387 (buffer (make-symbol "gnus-setup-message-buffer"))
387 (article (make-symbol "gnus-setup-message-article")) 388 (article (make-symbol "gnus-setup-message-article"))
388 (yanked (make-symbol "gnus-setup-yanked-articles")) 389 (yanked (make-symbol "gnus-setup-yanked-articles"))
389 (group (make-symbol "gnus-setup-message-group"))) 390 (group (make-symbol "gnus-setup-message-group")))
390 `(let ((,winconf (current-window-configuration)) 391 `(let ((,winconf (current-window-configuration))
392 (,winconf-name gnus-current-window-configuration)
391 (,buffer (buffer-name (current-buffer))) 393 (,buffer (buffer-name (current-buffer)))
392 (,article gnus-article-reply) 394 (,article gnus-article-reply)
393 (,yanked gnus-article-yanked-articles) 395 (,yanked gnus-article-yanked-articles)
@@ -432,7 +434,7 @@ Thank you for your help in stamping out bugs.
432 (progn 434 (progn
433 ,@forms) 435 ,@forms)
434 (gnus-inews-add-send-actions ,winconf ,buffer ,article ,config 436 (gnus-inews-add-send-actions ,winconf ,buffer ,article ,config
435 ,yanked) 437 ,yanked ',winconf-name)
436 (setq gnus-message-buffer (current-buffer)) 438 (setq gnus-message-buffer (current-buffer))
437 (set (make-local-variable 'gnus-message-group-art) 439 (set (make-local-variable 'gnus-message-group-art)
438 (cons ,group ,article)) 440 (cons ,group ,article))
@@ -527,7 +529,8 @@ Gcc: header for archiving purposes."
527 (throw 'found (cons (cadr elem) (caddr elem))))))))) 529 (throw 'found (cons (cadr elem) (caddr elem)))))))))
528 530
529(defun gnus-inews-add-send-actions (winconf buffer article 531(defun gnus-inews-add-send-actions (winconf buffer article
530 &optional config yanked) 532 &optional config yanked
533 winconf-name)
531 (gnus-make-local-hook 'message-sent-hook) 534 (gnus-make-local-hook 'message-sent-hook)
532 (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc 535 (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc
533 'gnus-inews-do-gcc) nil t) 536 'gnus-inews-do-gcc) nil t)
@@ -538,8 +541,10 @@ Gcc: header for archiving purposes."
538 `(lambda (&optional arg) 541 `(lambda (&optional arg)
539 (gnus-post-method arg ,gnus-newsgroup-name))) 542 (gnus-post-method arg ,gnus-newsgroup-name)))
540 (message-add-action 543 (message-add-action
541 `(when (gnus-buffer-exists-p ,buffer) 544 `(progn
542 (set-window-configuration ,winconf)) 545 (setq gnus-current-window-configuration ',winconf-name)
546 (when (gnus-buffer-exists-p ,buffer)
547 (set-window-configuration ,winconf)))
543 'exit 'postpone 'kill) 548 'exit 'postpone 'kill)
544 (let ((to-be-marked (cond 549 (let ((to-be-marked (cond
545 (yanked 550 (yanked
diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el
index 794d1642cdd..ce5a837eaef 100644
--- a/lisp/gnus/gnus-range.el
+++ b/lisp/gnus/gnus-range.el
@@ -116,10 +116,10 @@ Both ranges must be in ascending order."
116 ;; All done with range2 116 ;; All done with range2
117 (setq r nil)) 117 (setq r nil))
118 ((< max1 min2) 118 ((< max1 min2)
119 ;; No overlap: range1 preceeds range2 119 ;; No overlap: range1 precedes range2
120 (pop r)) 120 (pop r))
121 ((< max2 min1) 121 ((< max2 min1)
122 ;; No overlap: range2 preceeds range1 122 ;; No overlap: range2 precedes range1
123 (pop range2)) 123 (pop range2))
124 ((and (<= min2 min1) (<= max1 max2)) 124 ((and (<= min2 min1) (<= max1 max2))
125 ;; Complete overlap: range1 removed 125 ;; Complete overlap: range1 removed
@@ -232,10 +232,10 @@ RANGE1 and RANGE2 have to be sorted over <."
232 (setq range1 (cdr range1) 232 (setq range1 (cdr range1)
233 range2 (cdr range2)) 233 range2 (cdr range2))
234 (while (and min1 min2) 234 (while (and min1 min2)
235 (cond ((< max1 min2) ; range1 preceeds range2 235 (cond ((< max1 min2) ; range1 precedes range2
236 (setq range1 (cdr range1) 236 (setq range1 (cdr range1)
237 min1 nil)) 237 min1 nil))
238 ((< max2 min1) ; range2 preceeds range1 238 ((< max2 min1) ; range2 precedes range1
239 (setq range2 (cdr range2) 239 (setq range2 (cdr range2)
240 min2 nil)) 240 min2 nil))
241 (t ; some sort of overlap is occurring 241 (t ; some sort of overlap is occurring
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index e5e2468058c..ebfa53f841e 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -864,6 +864,7 @@ prompt the user for the name of an NNTP server to use."
864 (gnus-get-buffer-create 864 (gnus-get-buffer-create
865 (file-name-nondirectory dribble-file))) 865 (file-name-nondirectory dribble-file)))
866 (set (make-local-variable 'file-precious-flag) t) 866 (set (make-local-variable 'file-precious-flag) t)
867 (setq buffer-save-without-query t)
867 (erase-buffer) 868 (erase-buffer)
868 (setq buffer-file-name dribble-file) 869 (setq buffer-file-name dribble-file)
869 (auto-save-mode t) 870 (auto-save-mode t)
@@ -1512,7 +1513,7 @@ If SCAN, request a scan of that group as well."
1512 (num 0)) 1513 (num 0))
1513 1514
1514 ;; These checks are present in gnus-activate-group but skipped 1515 ;; These checks are present in gnus-activate-group but skipped
1515 ;; due to setting dont-check in the preceeding call. 1516 ;; due to setting dont-check in the preceding call.
1516 1517
1517 ;; If a cache is present, we may have to alter the active info. 1518 ;; If a cache is present, we may have to alter the active info.
1518 (when (and gnus-use-cache info) 1519 (when (and gnus-use-cache info)
@@ -1689,6 +1690,16 @@ If SCAN, request a scan of that group as well."
1689 method)) 1690 method))
1690 (setcar elem method)) 1691 (setcar elem method))
1691 (push (list method 'ok) methods))))) 1692 (push (list method 'ok) methods)))))
1693
1694 ;; If we have primary/secondary select methods, but no groups from
1695 ;; them, we still want to issue a retrieval request from them.
1696 (dolist (method (cons gnus-select-method
1697 gnus-secondary-select-methods))
1698 (when (and (not (assoc method type-cache))
1699 (gnus-check-backend-function 'request-list (car method)))
1700 (with-current-buffer nntp-server-buffer
1701 (gnus-read-active-file-1 method nil))))
1702
1692 ;; Start early async retrieval of data. 1703 ;; Start early async retrieval of data.
1693 (dolist (elem type-cache) 1704 (dolist (elem type-cache)
1694 (destructuring-bind (method method-type infos dummy) elem 1705 (destructuring-bind (method method-type infos dummy) elem
@@ -1711,15 +1722,6 @@ If SCAN, request a scan of that group as well."
1711 (setcar (nthcdr 3 elem) 1722 (setcar (nthcdr 3 elem)
1712 (gnus-retrieve-group-data-early method infos))))))) 1723 (gnus-retrieve-group-data-early method infos)))))))
1713 1724
1714 ;; If we have primary/secondary select methods, but no groups from
1715 ;; them, we still want to issue a retrieval request from them.
1716 (dolist (method (cons gnus-select-method
1717 gnus-secondary-select-methods))
1718 (when (and (not (assoc method type-cache))
1719 (gnus-check-backend-function 'request-list (car method)))
1720 (with-current-buffer nntp-server-buffer
1721 (gnus-read-active-file-1 method nil))))
1722
1723 ;; Do the rest of the retrieval. 1725 ;; Do the rest of the retrieval.
1724 (dolist (elem type-cache) 1726 (dolist (elem type-cache)
1725 (destructuring-bind (method method-type infos early-data) elem 1727 (destructuring-bind (method method-type infos early-data) elem
@@ -1885,7 +1887,7 @@ If SCAN, request a scan of that group as well."
1885 ;; OK - I'm done 1887 ;; OK - I'm done
1886 (setq articles nil)) 1888 (setq articles nil))
1887 ((< range article) 1889 ((< range article)
1888 ;; this range preceeds the article. Leave the range unmodified. 1890 ;; this range precedes the article. Leave the range unmodified.
1889 (pop ranges) 1891 (pop ranges)
1890 ranges) 1892 ranges)
1891 ((= range article) 1893 ((= range article)
@@ -1908,11 +1910,11 @@ If SCAN, request a scan of that group as well."
1908 (setcar ranges min) 1910 (setcar ranges min)
1909 ranges) 1911 ranges)
1910 ((< max article) 1912 ((< max article)
1911 ;; this range preceeds the article. Leave the range unmodified. 1913 ;; this range precedes the article. Leave the range unmodified.
1912 (pop ranges) 1914 (pop ranges)
1913 ranges) 1915 ranges)
1914 ((< article min) 1916 ((< article min)
1915 ;; this article preceeds the range. Return null to move to the 1917 ;; this article precedes the range. Return null to move to the
1916 ;; next article 1918 ;; next article
1917 nil) 1919 nil)
1918 (t 1920 (t
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 789308c4ab9..a8786e39c7b 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1234,7 +1234,7 @@ For example: ((1 . cn-gb-2312) (2 . big5))."
1234 :type 'boolean 1234 :type 'boolean
1235 :group 'gnus-summary-marks) 1235 :group 'gnus-summary-marks)
1236 1236
1237(defcustom gnus-propagate-marks t 1237(defcustom gnus-propagate-marks nil
1238 "If non-nil, Gnus will store and retrieve marks from the backends. 1238 "If non-nil, Gnus will store and retrieve marks from the backends.
1239This means that marks will be stored both in .newsrc.eld and in 1239This means that marks will be stored both in .newsrc.eld and in
1240the backend, and will slow operation down somewhat." 1240the backend, and will slow operation down somewhat."
@@ -3853,7 +3853,7 @@ This function is intended to be used in
3853 ((< c (* 1000 10000)) (format "%1.1fM" (/ c (* 1024.0 1024)))) 3853 ((< c (* 1000 10000)) (format "%1.1fM" (/ c (* 1024.0 1024))))
3854 (t (format "%dM" (/ c (* 1024.0 1024))))))) 3854 (t (format "%dM" (/ c (* 1024.0 1024)))))))
3855 3855
3856(defcustom gnus-summary-user-date-format-alist 3856(defcustom gnus-user-date-format-alist
3857 '(((gnus-seconds-today) . "Today, %H:%M") 3857 '(((gnus-seconds-today) . "Today, %H:%M")
3858 ((+ 86400 (gnus-seconds-today)) . "Yesterday, %H:%M") 3858 ((+ 86400 (gnus-seconds-today)) . "Yesterday, %H:%M")
3859 (604800 . "%A %H:%M") ; That's one week 3859 (604800 . "%A %H:%M") ; That's one week
@@ -3880,11 +3880,9 @@ respectively."
3880 :version "24.1" 3880 :version "24.1"
3881 :group 'gnus-summary-format 3881 :group 'gnus-summary-format
3882 :type '(alist :key-type sexp :value-type string)) 3882 :type '(alist :key-type sexp :value-type string))
3883(make-obsolete-variable 'gnus-user-date-format-alist
3884 'gnus-summary-user-date-format-alist "24.1")
3885 3883
3886(defun gnus-user-date (messy-date) 3884(defun gnus-user-date (messy-date)
3887 "Format the messy-date according to `gnus-summary-user-date-format-alist'. 3885 "Format the messy-date according to `gnus-user-date-format-alist'.
3888Returns \" ? \" if there's bad input or if another error occurs. 3886Returns \" ? \" if there's bad input or if another error occurs.
3889Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"." 3887Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
3890 (condition-case () 3888 (condition-case ()
@@ -3893,7 +3891,7 @@ Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
3893 ;;If we don't find something suitable we'll use this one 3891 ;;If we don't find something suitable we'll use this one
3894 (my-format "%b %d '%y")) 3892 (my-format "%b %d '%y"))
3895 (let* ((difference (- now messy-date)) 3893 (let* ((difference (- now messy-date))
3896 (templist gnus-summary-user-date-format-alist) 3894 (templist gnus-user-date-format-alist)
3897 (top (eval (caar templist)))) 3895 (top (eval (caar templist))))
3898 (while (if (numberp top) (< top difference) (not top)) 3896 (while (if (numberp top) (< top difference) (not top))
3899 (progn 3897 (progn
@@ -9525,8 +9523,7 @@ C-u g', show the raw article."
9525 ((not arg) 9523 ((not arg)
9526 ;; Select the article the normal way. 9524 ;; Select the article the normal way.
9527 (gnus-summary-select-article nil 'force)) 9525 (gnus-summary-select-article nil 'force))
9528 ((or (equal arg '(16)) 9526 ((equal arg '(16))
9529 (eq arg t))
9530 ;; C-u C-u g 9527 ;; C-u C-u g
9531 (let ((gnus-inhibit-article-treatments t)) 9528 (let ((gnus-inhibit-article-treatments t))
9532 (gnus-summary-select-article nil 'force))) 9529 (gnus-summary-select-article nil 'force)))
@@ -12438,7 +12435,10 @@ UNREAD is a sorted list."
12438 (save-excursion 12435 (save-excursion
12439 (let (setmarkundo) 12436 (let (setmarkundo)
12440 ;; Propagate the read marks to the backend. 12437 ;; Propagate the read marks to the backend.
12441 (when (and gnus-propagate-marks 12438 (when (and (or gnus-propagate-marks
12439 (gnus-method-option-p
12440 (gnus-find-method-for-group group)
12441 'server-marks))
12442 (gnus-check-backend-function 'request-set-mark group)) 12442 (gnus-check-backend-function 'request-set-mark group))
12443 (let ((del (gnus-remove-from-range (gnus-info-read info) read)) 12443 (let ((del (gnus-remove-from-range (gnus-info-read info) read))
12444 (add (gnus-remove-from-range read (gnus-info-read info)))) 12444 (add (gnus-remove-from-range read (gnus-info-read info))))
diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el
index d6aad539029..05ba3595479 100644
--- a/lisp/gnus/gnus-uu.el
+++ b/lisp/gnus/gnus-uu.el
@@ -366,7 +366,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
366 (interactive 366 (interactive
367 (list current-prefix-arg 367 (list current-prefix-arg
368 (file-name-as-directory 368 (file-name-as-directory
369 (read-file-name "Uudecode and save in dir: " 369 (read-directory-name "Uudecode and save in dir: "
370 gnus-uu-default-dir 370 gnus-uu-default-dir
371 gnus-uu-default-dir t)))) 371 gnus-uu-default-dir t))))
372 (gnus-uu-decode-with-method 'gnus-uu-uustrip-article n dir nil nil t)) 372 (gnus-uu-decode-with-method 'gnus-uu-uustrip-article n dir nil nil t))
@@ -381,7 +381,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
381 (interactive 381 (interactive
382 (list current-prefix-arg 382 (list current-prefix-arg
383 (file-name-as-directory 383 (file-name-as-directory
384 (read-file-name "Unshar and save in dir: " 384 (read-directory-name "Unshar and save in dir: "
385 gnus-uu-default-dir 385 gnus-uu-default-dir
386 gnus-uu-default-dir t)))) 386 gnus-uu-default-dir t))))
387 (gnus-uu-decode-with-method 'gnus-uu-unshar-article n dir nil 'scan t)) 387 (gnus-uu-decode-with-method 'gnus-uu-unshar-article n dir nil 'scan t))
@@ -390,12 +390,11 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
390 "Saves the current article." 390 "Saves the current article."
391 (interactive 391 (interactive
392 (list current-prefix-arg 392 (list current-prefix-arg
393 (read-file-name 393 (if gnus-uu-save-separate-articles
394 (if gnus-uu-save-separate-articles 394 (read-directory-name
395 "Save articles in dir: " 395 "Save articles in dir: " gnus-uu-default-dir gnus-uu-default-dir)
396 "Save articles in file: ") 396 (read-file-name
397 gnus-uu-default-dir 397 "Save article in file: " gnus-uu-default-dir gnus-uu-default-dir))))
398 gnus-uu-default-dir)))
399 (setq gnus-uu-saved-article-name file) 398 (setq gnus-uu-saved-article-name file)
400 (gnus-uu-decode-with-method 'gnus-uu-save-article n nil t)) 399 (gnus-uu-decode-with-method 'gnus-uu-save-article n nil t))
401 400
@@ -404,7 +403,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
404 (interactive 403 (interactive
405 (list current-prefix-arg 404 (list current-prefix-arg
406 (file-name-as-directory 405 (file-name-as-directory
407 (read-file-name "Unbinhex and save in dir: " 406 (read-directory-name "Unbinhex and save in dir: "
408 gnus-uu-default-dir 407 gnus-uu-default-dir
409 gnus-uu-default-dir)))) 408 gnus-uu-default-dir))))
410 (setq gnus-uu-binhex-article-name 409 (setq gnus-uu-binhex-article-name
@@ -416,7 +415,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
416 (interactive 415 (interactive
417 (list current-prefix-arg 416 (list current-prefix-arg
418 (file-name-as-directory 417 (file-name-as-directory
419 (read-file-name "yEnc decode and save in dir: " 418 (read-directory-name "yEnc decode and save in dir: "
420 gnus-uu-default-dir 419 gnus-uu-default-dir
421 gnus-uu-default-dir)))) 420 gnus-uu-default-dir))))
422 (setq gnus-uu-yenc-article-name nil) 421 (setq gnus-uu-yenc-article-name nil)
@@ -458,10 +457,11 @@ didn't work, and overwrite existing files. Otherwise, ask each time."
458 "Saves and views the current article." 457 "Saves and views the current article."
459 (interactive 458 (interactive
460 (list current-prefix-arg 459 (list current-prefix-arg
461 (read-file-name (if gnus-uu-save-separate-articles 460 (if gnus-uu-save-separate-articles
462 "Save articles is dir: " 461 (read-directory-name "Save articles in dir: "
463 "Save articles in file: ") 462 gnus-uu-default-dir gnus-uu-default-dir)
464 gnus-uu-default-dir gnus-uu-default-dir))) 463 (read-file-name "Save articles in file: "
464 gnus-uu-default-dir gnus-uu-default-dir))))
465 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) 465 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic)))
466 (gnus-uu-decode-save n file))) 466 (gnus-uu-decode-save n file)))
467 467
@@ -742,7 +742,7 @@ When called interactively, prompt for REGEXP."
742 (interactive 742 (interactive
743 (list current-prefix-arg 743 (list current-prefix-arg
744 (file-name-as-directory 744 (file-name-as-directory
745 (read-file-name "Save in dir: " 745 (read-directory-name "Save in dir: "
746 gnus-uu-default-dir 746 gnus-uu-default-dir
747 gnus-uu-default-dir t)))) 747 gnus-uu-default-dir t))))
748 (gnus-uu-decode-with-method 'gnus-uu-decode-postscript-article 748 (gnus-uu-decode-with-method 'gnus-uu-decode-postscript-article
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 42acb65ff9f..57d085a0380 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1607,7 +1607,8 @@ slower."
1607 ("nnweb" none) 1607 ("nnweb" none)
1608 ("nnrss" none) 1608 ("nnrss" none)
1609 ("nnagent" post-mail) 1609 ("nnagent" post-mail)
1610 ("nnimap" post-mail address prompt-address physical-address respool) 1610 ("nnimap" post-mail address prompt-address physical-address respool
1611 server-marks)
1611 ("nnmaildir" mail respool address) 1612 ("nnmaildir" mail respool address)
1612 ("nnnil" none)) 1613 ("nnnil" none))
1613 "*An alist of valid select methods. 1614 "*An alist of valid select methods.
@@ -2545,7 +2546,7 @@ a string, be sure to use a valid format, see RFC 2616."
2545(defvar gnus-extended-servers nil) 2546(defvar gnus-extended-servers nil)
2546 2547
2547;; The carpal mode has been removed, but define the variable for 2548;; The carpal mode has been removed, but define the variable for
2548;; backwards compatability. 2549;; backwards compatibility.
2549(defvar gnus-carpal nil) 2550(defvar gnus-carpal nil)
2550(make-obsolete-variable 'gnus-carpal nil "Emacs 24.1") 2551(make-obsolete-variable 'gnus-carpal nil "Emacs 24.1")
2551 2552
@@ -3114,6 +3115,10 @@ Return nil if not defined."
3114(defmacro gnus-get-info (group) 3115(defmacro gnus-get-info (group)
3115 `(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb))) 3116 `(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb)))
3116 3117
3118(defun gnus-set-info (group info)
3119 (setcar (nthcdr 2 (gnus-gethash group gnus-newsrc-hashtb))
3120 info))
3121
3117;;; Load the compatibility functions. 3122;;; Load the compatibility functions.
3118 3123
3119(require 'gnus-ems) 3124(require 'gnus-ems)
@@ -3263,7 +3268,7 @@ g -- Group name."
3263 ((= c ?d) 3268 ((= c ?d)
3264 (point)) 3269 (point))
3265 ((= c ?D) 3270 ((= c ?D)
3266 (read-file-name prompt nil default-directory 'lambda)) 3271 (read-directory-name prompt nil default-directory 'lambda))
3267 ((= c ?f) 3272 ((= c ?f)
3268 (read-file-name prompt nil nil 'lambda)) 3273 (read-file-name prompt nil nil 'lambda))
3269 ((= c ?F) 3274 ((= c ?F)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 58daf1baf94..08c59b00bfc 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -129,17 +129,6 @@
129 :group 'message-buffers 129 :group 'message-buffers
130 :type '(choice function (const nil))) 130 :type '(choice function (const nil)))
131 131
132(defcustom message-cite-style nil
133 "The overall style to be used when yanking cited text.
134Values are either `traditional' (cited text first),
135`top-post' (cited text at the bottom), or nil (don't override the
136individual message variables)."
137 :version "24.1"
138 :group 'message-various
139 :type '(choice (const :tag "None" :value nil)
140 (const :tag "Traditional" :value traditional)
141 (const :tag "Top-post" :value top-post)))
142
143(defcustom message-fcc-handler-function 'message-output 132(defcustom message-fcc-handler-function 'message-output
144 "*A function called to save outgoing articles. 133 "*A function called to save outgoing articles.
145This function will be called with the name of the file to store the 134This function will be called with the name of the file to store the
@@ -1088,6 +1077,71 @@ needed."
1088 :link '(custom-manual "(message)Insertion Variables") 1077 :link '(custom-manual "(message)Insertion Variables")
1089 :group 'message-insertion) 1078 :group 'message-insertion)
1090 1079
1080(defcustom message-cite-reply-position 'traditional
1081 "*Where the reply should be positioned.
1082If `traditional', reply inline.
1083If `above', reply above quoted text.
1084If `below', reply below quoted text.
1085
1086Note: Many newsgroups frown upon nontraditional reply styles. You
1087probably want to set this variable only for specific groups,
1088e.g. using `gnus-posting-styles':
1089
1090 (eval (set (make-local-variable 'message-cite-reply-above) 'above))"
1091 :type '(choice (const :tag "Reply inline" 'traditional)
1092 (const :tag "Reply above" 'above)
1093 (const :tag "Reply below" 'below))
1094 :group 'message-insertion)
1095
1096(defcustom message-cite-style nil
1097 "*The overall style to be used when yanking cited text.
1098Value is either `nil' (no variable overrides) or a let-style list
1099of pairs (VARIABLE VALUE) that will be bound in
1100`message-yank-original' to do the quoting.
1101
1102Presets to impersonate popular mail agents are found in the
1103message-cite-style-* variables. This variable is intended for
1104use in `gnus-posting-styles', such as:
1105
1106 ((posting-from-work-p) (eval (set (make-local-variable 'message-cite-style) message-cite-style-outlook)))"
1107 :version "24.1"
1108 :group 'message-insertion
1109 :type '(choice (const :tag "Do not override variables" :value nil)
1110 (const :tag "MS Outlook" :value message-cite-style-outlook)
1111 (const :tag "Mozilla Thunderbird" :value message-cite-style-thunderbird)
1112 (const :tag "Gmail" :value message-cite-style-gmail)
1113 (variable :tag "User-specified")))
1114
1115(defconst message-cite-style-outlook
1116 '((message-cite-function 'message-cite-original)
1117 (message-citation-line-function 'message-insert-formatted-citation-line)
1118 (message-cite-reply-position 'above)
1119 (message-yank-prefix "")
1120 (message-yank-cited-prefix "")
1121 (message-yank-empty-prefix "")
1122 (message-citation-line-format "\n\n-----------------------\nOn %a, %b %d %Y, %N wrote:\n"))
1123 "Message citation style used by MS Outlook. Use with message-cite-style.")
1124
1125(defconst message-cite-style-thunderbird
1126 '((message-cite-function 'message-cite-original)
1127 (message-citation-line-function 'message-insert-formatted-citation-line)
1128 (message-cite-reply-position 'above)
1129 (message-yank-prefix "> ")
1130 (message-yank-cited-prefix ">")
1131 (message-yank-empty-prefix ">")
1132 (message-citation-line-format "On %D %R %p, %N wrote:"))
1133 "Message citation style used by Mozilla Thunderbird. Use with message-cite-style.")
1134
1135(defconst message-cite-style-gmail
1136 '((message-cite-function 'message-cite-original)
1137 (message-citation-line-function 'message-insert-formatted-citation-line)
1138 (message-cite-reply-position 'above)
1139 (message-yank-prefix " ")
1140 (message-yank-cited-prefix " ")
1141 (message-yank-empty-prefix " ")
1142 (message-citation-line-format "On %e %B %Y %R, %f wrote:\n"))
1143 "Message citation style used by Gmail. Use with message-cite-style.")
1144
1091(defcustom message-distribution-function nil 1145(defcustom message-distribution-function nil
1092 "*Function called to return a Distribution header." 1146 "*Function called to return a Distribution header."
1093 :group 'message-news 1147 :group 'message-news
@@ -1814,7 +1868,12 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'."
1814 1868
1815(defvar message-options nil 1869(defvar message-options nil
1816 "Some saved answers when sending message.") 1870 "Some saved answers when sending message.")
1817(make-variable-buffer-local 'message-options) 1871;; FIXME: On XEmacs this causes problems since let-binding like:
1872;; (let ((message-options message-options)) ...)
1873;; as in `message-send' and `mml-preview' loses to buffer-local
1874;; variable initialization.
1875(unless (featurep 'xemacs)
1876 (make-variable-buffer-local 'message-options))
1818 1877
1819(defvar message-send-mail-real-function nil 1878(defvar message-send-mail-real-function nil
1820 "Internal send mail function.") 1879 "Internal send mail function.")
@@ -3645,17 +3704,6 @@ To use this automatically, you may add this function to
3645 (while (re-search-forward citexp nil t) 3704 (while (re-search-forward citexp nil t)
3646 (replace-match (if remove "" "\n")))))) 3705 (replace-match (if remove "" "\n"))))))
3647 3706
3648(defvar message-cite-reply-above nil
3649 "If non-nil, start own text above the quote.
3650
3651Note: Top posting is bad netiquette. Don't use it unless you
3652really must. You probably want to set variable only for specific
3653groups, e.g. using `gnus-posting-styles':
3654
3655 (eval (set (make-local-variable 'message-cite-reply-above) t))
3656
3657This variable has no effect in news postings.")
3658
3659(defun message-yank-original (&optional arg) 3707(defun message-yank-original (&optional arg)
3660 "Insert the message being replied to, if any. 3708 "Insert the message being replied to, if any.
3661Puts point before the text and mark after. 3709Puts point before the text and mark after.
@@ -3669,49 +3717,49 @@ prefix, and don't delete any headers."
3669 (interactive "P") 3717 (interactive "P")
3670 (let ((modified (buffer-modified-p)) 3718 (let ((modified (buffer-modified-p))
3671 body-text) 3719 body-text)
3672 (when (and message-reply-buffer 3720 ;; eval the let forms contained in message-cite-style
3673 message-cite-function) 3721 (eval
3674 (when message-cite-reply-above 3722 `(let ,message-cite-style
3675 (if (and (not (message-news-p)) 3723 (when (and message-reply-buffer
3676 (or (eq message-cite-reply-above 'is-evil) 3724 message-cite-function)
3677 (y-or-n-p "\ 3725 (when (equal message-cite-reply-position 'above)
3678Top posting is bad netiquette. Please don't top post unless you really must.
3679Really top post? ")))
3680 (save-excursion 3726 (save-excursion
3681 (setq body-text 3727 (setq body-text
3682 (buffer-substring (message-goto-body) 3728 (buffer-substring (message-goto-body)
3683 (point-max))) 3729 (point-max)))
3684 (delete-region (message-goto-body) (point-max))) 3730 (delete-region (message-goto-body) (point-max))))
3685 (set (make-local-variable 'message-cite-reply-above) nil))) 3731 (if (bufferp message-reply-buffer)
3686 (if (bufferp message-reply-buffer) 3732 (delete-windows-on message-reply-buffer t))
3687 (delete-windows-on message-reply-buffer t)) 3733 (push-mark (save-excursion
3688 (push-mark (save-excursion 3734 (cond
3689 (cond 3735 ((bufferp message-reply-buffer)
3690 ((bufferp message-reply-buffer) 3736 (insert-buffer-substring message-reply-buffer))
3691 (insert-buffer-substring message-reply-buffer)) 3737 ((and (consp message-reply-buffer)
3692 ((and (consp message-reply-buffer) 3738 (functionp (car message-reply-buffer)))
3693 (functionp (car message-reply-buffer))) 3739 (apply (car message-reply-buffer)
3694 (apply (car message-reply-buffer) 3740 (cdr message-reply-buffer))))
3695 (cdr message-reply-buffer)))) 3741 (unless (bolp)
3696 (unless (bolp) 3742 (insert ?\n))
3697 (insert ?\n)) 3743 (point)))
3698 (point))) 3744 (unless arg
3699 (unless arg 3745 (funcall message-cite-function)
3700 (funcall message-cite-function) 3746 (unless (eq (char-before (mark t)) ?\n)
3701 (unless (eq (char-before (mark t)) ?\n) 3747 (let ((pt (point)))
3702 (let ((pt (point))) 3748 (goto-char (mark t))
3703 (goto-char (mark t)) 3749 (insert-before-markers ?\n)
3704 (insert-before-markers ?\n) 3750 (goto-char pt))))
3705 (goto-char pt)))) 3751 (case message-cite-reply-position
3706 (when message-cite-reply-above 3752 ('above
3707 (message-goto-body) 3753 (message-goto-body)
3708 (insert body-text) 3754 (insert body-text)
3709 (insert (if (bolp) "\n" "\n\n")) 3755 (insert (if (bolp) "\n" "\n\n"))
3710 (message-goto-body)) 3756 (message-goto-body))
3711 ;; Add a `message-setup-very-last-hook' here? 3757 ('below
3712 ;; Add `gnus-article-highlight-citation' here? 3758 (message-goto-signature)))
3713 (unless modified 3759 ;; Add a `message-setup-very-last-hook' here?
3714 (setq message-checksum (message-checksum)))))) 3760 ;; Add `gnus-article-highlight-citation' here?
3761 (unless modified
3762 (setq message-checksum (message-checksum))))))))
3715 3763
3716(defun message-yank-buffer (buffer) 3764(defun message-yank-buffer (buffer)
3717 "Insert BUFFER into the current buffer and quote it." 3765 "Insert BUFFER into the current buffer and quote it."
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 83b8c416283..aa4ecbc3b0f 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -62,8 +62,9 @@ it will default to `imap'.")
62 62
63(defvoo nnimap-stream 'undecided 63(defvoo nnimap-stream 'undecided
64 "How nnimap will talk to the IMAP server. 64 "How nnimap will talk to the IMAP server.
65Values are `ssl', `network', `starttls' or `shell'. 65Values are `ssl', `network', `network-only, `starttls' or
66The default is to try `ssl' first, and then `network'.") 66`shell'. The default is to try `ssl' first, and then
67`network'.")
67 68
68(defvoo nnimap-shell-program (if (boundp 'imap-shell-program) 69(defvoo nnimap-shell-program (if (boundp 'imap-shell-program)
69 (if (listp imap-shell-program) 70 (if (listp imap-shell-program)
@@ -72,14 +73,15 @@ The default is to try `ssl' first, and then `network'.")
72 "ssh %s imapd")) 73 "ssh %s imapd"))
73 74
74(defvoo nnimap-inbox nil 75(defvoo nnimap-inbox nil
75 "The mail box where incoming mail arrives and should be split out of.") 76 "The mail box where incoming mail arrives and should be split out of.
77For example, \"INBOX\".")
76 78
77(defvoo nnimap-split-methods nil 79(defvoo nnimap-split-methods nil
78 "How mail is split. 80 "How mail is split.
79Uses the same syntax as nnmail-split-methods") 81Uses the same syntax as `nnmail-split-methods'.")
80 82
81(defvoo nnimap-split-fancy nil 83(defvoo nnimap-split-fancy nil
82 "Uses the same syntax as nnmail-split-fancy.") 84 "Uses the same syntax as `nnmail-split-fancy'.")
83 85
84(defvoo nnimap-unsplittable-articles '(%Deleted %Seen) 86(defvoo nnimap-unsplittable-articles '(%Deleted %Seen)
85 "Articles with the flags in the list will not be considered when splitting.") 87 "Articles with the flags in the list will not be considered when splitting.")
@@ -336,7 +338,7 @@ textual parts.")
336 (eq nnimap-stream 'starttls)) 338 (eq nnimap-stream 'starttls))
337 (nnheader-message 7 "Opening connection to %s..." 339 (nnheader-message 7 "Opening connection to %s..."
338 nnimap-address) 340 nnimap-address)
339 '("143" "imap")) 341 '("imap" "143"))
340 ((eq nnimap-stream 'shell) 342 ((eq nnimap-stream 'shell)
341 (nnheader-message 7 "Opening connection to %s via shell..." 343 (nnheader-message 7 "Opening connection to %s via shell..."
342 nnimap-address) 344 nnimap-address)
@@ -344,16 +346,16 @@ textual parts.")
344 ((memq nnimap-stream '(ssl tls)) 346 ((memq nnimap-stream '(ssl tls))
345 (nnheader-message 7 "Opening connection to %s via tls..." 347 (nnheader-message 7 "Opening connection to %s via tls..."
346 nnimap-address) 348 nnimap-address)
347 '("143" "993" "imap" "imaps")) 349 '("imaps" "imap" "993" "143"))
348 (t 350 (t
349 (error "Unknown stream type: %s" nnimap-stream)))) 351 (error "Unknown stream type: %s" nnimap-stream))))
350 (proto-stream-always-use-starttls t) 352 (proto-stream-always-use-starttls t)
351 login-result credentials) 353 login-result credentials)
352 (when nnimap-server-port 354 (when nnimap-server-port
353 (setq ports (append ports (list nnimap-server-port)))) 355 (push nnimap-server-port ports))
354 (destructuring-bind (stream greeting capabilities stream-type) 356 (destructuring-bind (stream greeting capabilities stream-type)
355 (open-protocol-stream 357 (open-protocol-stream
356 "*nnimap*" (current-buffer) nnimap-address (car (last ports)) 358 "*nnimap*" (current-buffer) nnimap-address (car ports)
357 :type nnimap-stream 359 :type nnimap-stream
358 :shell-command nnimap-shell-program 360 :shell-command nnimap-shell-program
359 :capability-command "1 CAPABILITY\r\n" 361 :capability-command "1 CAPABILITY\r\n"
@@ -1150,6 +1152,7 @@ textual parts.")
1150 (setf (nnimap-examined nnimap-object) group) 1152 (setf (nnimap-examined nnimap-object) group)
1151 (if (and qresyncp 1153 (if (and qresyncp
1152 uidvalidity 1154 uidvalidity
1155 active
1153 modseq) 1156 modseq)
1154 (push 1157 (push
1155 (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" 1158 (list (nnimap-send-command "EXAMINE %S (%s (%s %s))"
@@ -1493,10 +1496,22 @@ textual parts.")
1493 (setq start (point)) 1496 (setq start (point))
1494 (goto-char end)) 1497 (goto-char end))
1495 (while (re-search-forward "^\\* [0-9]+ FETCH " start t) 1498 (while (re-search-forward "^\\* [0-9]+ FETCH " start t)
1496 (setq elems (read (current-buffer))) 1499 (let ((p (point)))
1497 (push (cons (cadr (memq 'UID elems)) 1500 ;; FIXME: For FETCH lines like "* 2971 FETCH (FLAGS (%Recent) UID
1498 (cadr (memq 'FLAGS elems))) 1501 ;; 12509 MODSEQ (13419098521433281274))" we get an
1499 articles)) 1502 ;; overflow-error. The handler simply deletes that large number
1503 ;; and reads again. But maybe there's a better fix...
1504 (setq elems (condition-case nil (read (current-buffer))
1505 (overflow-error
1506 ;; After an overflow-error, point is just after
1507 ;; the too large number. So delete it and try
1508 ;; again.
1509 (delete-region (point) (progn (backward-word) (point)))
1510 (goto-char p)
1511 (read (current-buffer)))))
1512 (push (cons (cadr (memq 'UID elems))
1513 (cadr (memq 'FLAGS elems)))
1514 articles)))
1500 (push (nconc (list group uidnext totalp permanent-flags uidvalidity 1515 (push (nconc (list group uidnext totalp permanent-flags uidvalidity
1501 vanished highestmodseq) 1516 vanished highestmodseq)
1502 articles) 1517 articles)
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index 8e91c68b391..eaaac3f88ce 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -203,11 +203,12 @@
203;; Imap variables 203;; Imap variables
204 204
205(defvar nnir-imap-search-arguments 205(defvar nnir-imap-search-arguments
206 '(("Whole message" . "TEXT") 206 '(("whole message" . "TEXT")
207 ("Subject" . "SUBJECT") 207 ("subject" . "SUBJECT")
208 ("To" . "TO") 208 ("to" . "TO")
209 ("From" . "FROM") 209 ("from" . "FROM")
210 ("Imap" . "")) 210 ("body" . "BODY")
211 ("imap" . ""))
211 "Mapping from user readable keys to IMAP search items for use in nnir") 212 "Mapping from user readable keys to IMAP search items for use in nnir")
212 213
213(defvar nnir-imap-search-other "HEADER %S" 214(defvar nnir-imap-search-other "HEADER %S"
@@ -335,7 +336,7 @@ result, `gnus-retrieve-headers' will be called instead."
335 :type '(function) 336 :type '(function)
336 :group 'nnir) 337 :group 'nnir)
337 338
338(defcustom nnir-imap-default-search-key "Whole message" 339(defcustom nnir-imap-default-search-key "whole message"
339 "*The default IMAP search key for an nnir search. Must be one of 340 "*The default IMAP search key for an nnir search. Must be one of
340 the keys in `nnir-imap-search-arguments'. To use raw imap queries 341 the keys in `nnir-imap-search-arguments'. To use raw imap queries
341 by default set this to \"Imap\"." 342 by default set this to \"Imap\"."
@@ -1500,11 +1501,14 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
1500 (setq search-func (cadr (assoc nnir-search-engine 1501 (setq search-func (cadr (assoc nnir-search-engine
1501 nnir-engines))) 1502 nnir-engines)))
1502 (if search-func 1503 (if search-func
1503 (funcall search-func 1504 (funcall
1504 (if nnir-extra-parms 1505 search-func
1505 (nnir-read-parms q nnir-search-engine) 1506 (if nnir-extra-parms
1506 q) 1507 (or (and (eq nnir-search-engine 'imap)
1507 server (cadr x)) 1508 (assq 'criteria q) q)
1509 (setq q (nnir-read-parms q nnir-search-engine)))
1510 q)
1511 server (cadr x))
1508 nil))) 1512 nil)))
1509 groups)))) 1513 groups))))
1510 1514
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index b2336e13b64..8906a036779 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1215,7 +1215,8 @@ FUNC will be called with the group name to determine the article number."
1215 ;; This is the final group, which is used as a 1215 ;; This is the final group, which is used as a
1216 ;; catch-all. 1216 ;; catch-all.
1217 (when (and (not group-art) 1217 (when (and (not group-art)
1218 (not nnmail-inhibit-default-split-group)) 1218 (or (equal "" (nth 1 method))
1219 (not nnmail-inhibit-default-split-group)))
1219 (setq group-art 1220 (setq group-art
1220 (list (cons (car method) 1221 (list (cons (car method)
1221 (funcall func (car method)))))))) 1222 (funcall func (car method))))))))
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 09ecfb8f6b7..66a6365cb3b 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -1672,7 +1672,7 @@ password contained in '~/.nntp-authinfo'."
1672 1672
1673 ;; Some nntp servers seem to have an extension to the XOVER 1673 ;; Some nntp servers seem to have an extension to the XOVER
1674 ;; extension. On these servers, requesting an article range 1674 ;; extension. On these servers, requesting an article range
1675 ;; preceeding the active range does not return an error as 1675 ;; preceding the active range does not return an error as
1676 ;; specified in the RFC. What we instead get is the NOV entry 1676 ;; specified in the RFC. What we instead get is the NOV entry
1677 ;; for the first available article. Obviously, a client can 1677 ;; for the first available article. Obviously, a client can
1678 ;; use that entry to avoid making unnecessary requests. The 1678 ;; use that entry to avoid making unnecessary requests. The
diff --git a/lisp/gnus/sieve.el b/lisp/gnus/sieve.el
index 31b2665a644..2111d34eac5 100644
--- a/lisp/gnus/sieve.el
+++ b/lisp/gnus/sieve.el
@@ -98,39 +98,40 @@ require \"fileinto\";
98 98
99(defvar sieve-manage-buffer nil) 99(defvar sieve-manage-buffer nil)
100(defvar sieve-buffer-header-end nil) 100(defvar sieve-buffer-header-end nil)
101(defvar sieve-buffer-script-name nil
102 "The real script name of the buffer.")
103(make-local-variable 'sieve-buffer-script-name)
101 104
102;; Sieve-manage mode: 105;; Sieve-manage mode:
103 106
104(defvar sieve-manage-mode-map nil 107(defvar sieve-manage-mode-map
108 (let ((map (make-sparse-keymap)))
109 ;; various
110 (define-key map "?" 'sieve-help)
111 (define-key map "h" 'sieve-help)
112 (define-key map "q" 'sieve-bury-buffer)
113 ;; activating
114 (define-key map "m" 'sieve-activate)
115 (define-key map "u" 'sieve-deactivate)
116 (define-key map "\M-\C-?" 'sieve-deactivate-all)
117 ;; navigation keys
118 (define-key map "\C-p" 'sieve-prev-line)
119 (define-key map [up] 'sieve-prev-line)
120 (define-key map "\C-n" 'sieve-next-line)
121 (define-key map [down] 'sieve-next-line)
122 (define-key map " " 'sieve-next-line)
123 (define-key map "n" 'sieve-next-line)
124 (define-key map "p" 'sieve-prev-line)
125 (define-key map "\C-m" 'sieve-edit-script)
126 (define-key map "f" 'sieve-edit-script)
127 (define-key map "o" 'sieve-edit-script-other-window)
128 (define-key map "r" 'sieve-remove)
129 (define-key map "q" 'sieve-manage-quit)
130 (define-key map [(down-mouse-2)] 'sieve-edit-script)
131 (define-key map [(down-mouse-3)] 'sieve-manage-mode-menu)
132 map)
105 "Keymap for `sieve-manage-mode'.") 133 "Keymap for `sieve-manage-mode'.")
106 134
107(if sieve-manage-mode-map
108 ()
109 (setq sieve-manage-mode-map (make-sparse-keymap))
110 (suppress-keymap sieve-manage-mode-map)
111 ;; various
112 (define-key sieve-manage-mode-map "?" 'sieve-help)
113 (define-key sieve-manage-mode-map "h" 'sieve-help)
114 (define-key sieve-manage-mode-map "q" 'sieve-bury-buffer)
115 ;; activating
116 (define-key sieve-manage-mode-map "m" 'sieve-activate)
117 (define-key sieve-manage-mode-map "u" 'sieve-deactivate)
118 (define-key sieve-manage-mode-map "\M-\C-?" 'sieve-deactivate-all)
119 ;; navigation keys
120 (define-key sieve-manage-mode-map "\C-p" 'sieve-prev-line)
121 (define-key sieve-manage-mode-map [up] 'sieve-prev-line)
122 (define-key sieve-manage-mode-map "\C-n" 'sieve-next-line)
123 (define-key sieve-manage-mode-map [down] 'sieve-next-line)
124 (define-key sieve-manage-mode-map " " 'sieve-next-line)
125 (define-key sieve-manage-mode-map "n" 'sieve-next-line)
126 (define-key sieve-manage-mode-map "p" 'sieve-prev-line)
127 (define-key sieve-manage-mode-map "\C-m" 'sieve-edit-script)
128 (define-key sieve-manage-mode-map "f" 'sieve-edit-script)
129 (define-key sieve-manage-mode-map "o" 'sieve-edit-script-other-window)
130 (define-key sieve-manage-mode-map "r" 'sieve-remove)
131 (define-key sieve-manage-mode-map [(down-mouse-2)] 'sieve-edit-script)
132 (define-key sieve-manage-mode-map [(down-mouse-3)] 'sieve-manage-mode-menu))
133
134(easy-menu-define sieve-manage-mode-menu sieve-manage-mode-map 135(easy-menu-define sieve-manage-mode-menu sieve-manage-mode-map
135 "Sieve Menu." 136 "Sieve Menu."
136 '("Manage Sieve" 137 '("Manage Sieve"
@@ -138,21 +139,21 @@ require \"fileinto\";
138 ["Activate script" sieve-activate t] 139 ["Activate script" sieve-activate t]
139 ["Deactivate script" sieve-deactivate t])) 140 ["Deactivate script" sieve-deactivate t]))
140 141
141(define-derived-mode sieve-manage-mode fundamental-mode "SIEVE" 142(define-derived-mode sieve-manage-mode fundamental-mode "Sieve-manage"
142 "Mode used for sieve script management." 143 "Mode used for sieve script management."
143 (setq mode-name "SIEVE")
144 (buffer-disable-undo (current-buffer)) 144 (buffer-disable-undo (current-buffer))
145 (setq truncate-lines t) 145 (setq truncate-lines t)
146 (easy-menu-add sieve-manage-mode-menu sieve-manage-mode-map)) 146 (easy-menu-add sieve-manage-mode-menu sieve-manage-mode-map))
147 147
148(put 'sieve-manage-mode 'mode-class 'special) 148(put 'sieve-manage-mode 'mode-class 'special)
149 149
150;; This is necessary to allow correct handling of \\[cvs-mode-diff-map]
151;; in substitute-command-keys.
152;(fset 'sieve-manage-mode-map sieve-manage-mode-map)
153
154;; Commands used in sieve-manage mode: 150;; Commands used in sieve-manage mode:
155 151
152(defun sieve-manage-quit ()
153 "Quit."
154 (interactive)
155 (kill-buffer (current-buffer)))
156
156(defun sieve-activate (&optional pos) 157(defun sieve-activate (&optional pos)
157 (interactive "d") 158 (interactive "d")
158 (let ((name (sieve-script-at-point)) err) 159 (let ((name (sieve-script-at-point)) err)
@@ -204,7 +205,10 @@ require \"fileinto\";
204 (switch-to-buffer (get-buffer-create "template.siv")) 205 (switch-to-buffer (get-buffer-create "template.siv"))
205 (insert sieve-template)) 206 (insert sieve-template))
206 (sieve-mode) 207 (sieve-mode)
207 (message "Press C-c C-l to upload script to server."))) 208 (setq sieve-buffer-script-name name)
209 (message
210 (substitute-command-keys
211 "Press \\[sieve-upload] to upload script to server."))))
208 212
209(defmacro sieve-change-region (&rest body) 213(defmacro sieve-change-region (&rest body)
210 "Turns off sieve-region before executing BODY, then re-enables it after. 214 "Turns off sieve-region before executing BODY, then re-enables it after.
@@ -337,13 +341,18 @@ Server : " server ":" (or port "2000") "
337 ;; get list of script names and print them 341 ;; get list of script names and print them
338 (let ((scripts (sieve-manage-listscripts sieve-manage-buffer))) 342 (let ((scripts (sieve-manage-listscripts sieve-manage-buffer)))
339 (if (null scripts) 343 (if (null scripts)
340 (insert (format (concat "No scripts on server, press RET on %s to " 344 (insert
341 "create a new script.\n") sieve-new-script)) 345 (substitute-command-keys
342 (insert (format (concat "%d script%s on server, press RET on a script " 346 (format
343 "name edits it, or\npress RET on %s to create " 347 "No scripts on server, press \\[sieve-edit-script] on %s to create a new script.\n"
344 "a new script.\n") (length scripts) 348 sieve-new-script)))
345 (if (eq (length scripts) 1) "" "s") 349 (insert
346 sieve-new-script))) 350 (substitute-command-keys
351 (format (concat "%d script%s on server, press \\[sieve-edit-script] on a script "
352 "name edits it, or\npress \\[sieve-edit-script] on %s to create "
353 "a new script.\n") (length scripts)
354 (if (eq (length scripts) 1) "" "s")
355 sieve-new-script))))
347 (save-excursion 356 (save-excursion
348 (sieve-insert-scripts (list sieve-new-script)) 357 (sieve-insert-scripts (list sieve-new-script))
349 (sieve-insert-scripts scripts))) 358 (sieve-insert-scripts scripts)))
@@ -363,15 +372,15 @@ Server : " server ":" (or port "2000") "
363;;;###autoload 372;;;###autoload
364(defun sieve-upload (&optional name) 373(defun sieve-upload (&optional name)
365 (interactive) 374 (interactive)
366 (unless name
367 (setq name (buffer-name)))
368 (when (or (get-buffer sieve-buffer) (call-interactively 'sieve-manage)) 375 (when (or (get-buffer sieve-buffer) (call-interactively 'sieve-manage))
369 (let ((script (buffer-string)) err) 376 (let ((script (buffer-string)) err)
370 (with-current-buffer (get-buffer sieve-buffer) 377 (with-current-buffer (get-buffer sieve-buffer)
371 (setq err (sieve-manage-putscript name script sieve-manage-buffer)) 378 (setq err (sieve-manage-putscript
379 (or name sieve-buffer-script-name (buffer-name))
380 script sieve-manage-buffer))
372 (if (sieve-manage-ok-p err) 381 (if (sieve-manage-ok-p err)
373 (message (concat 382 (message (substitute-command-keys
374 "Sieve upload done. Use `C-c RET' to manage scripts.")) 383 "Sieve upload done. Use \\[sieve-manage] to manage scripts."))
375 (message "Sieve upload failed: %s" (nth 2 err))))))) 384 (message "Sieve upload failed: %s" (nth 2 err)))))))
376 385
377;;;###autoload 386;;;###autoload
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 58df45bc33c..35f8c5e8e37 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -502,7 +502,8 @@ suitable file is found, return nil."
502 (let* ((advertised (gethash def advertised-signature-table t)) 502 (let* ((advertised (gethash def advertised-signature-table t))
503 (arglist (if (listp advertised) 503 (arglist (if (listp advertised)
504 advertised (help-function-arglist def))) 504 advertised (help-function-arglist def)))
505 (doc (documentation function)) 505 (doc (condition-case err (documentation function)
506 (error (format "No Doc! %S" err))))
506 (usage (help-split-fundoc doc function))) 507 (usage (help-split-fundoc doc function)))
507 (with-current-buffer standard-output 508 (with-current-buffer standard-output
508 ;; If definition is a keymap, skip arglist note. 509 ;; If definition is a keymap, skip arglist note.
@@ -773,15 +774,21 @@ it is displayed along with the global value."
773 (setq extra-line t) 774 (setq extra-line t)
774 (if (member (cons variable val) dir-local-variables-alist) 775 (if (member (cons variable val) dir-local-variables-alist)
775 (let ((file (and (buffer-file-name) 776 (let ((file (and (buffer-file-name)
776 (not (file-remote-p (buffer-file-name))) 777 (not (file-remote-p (buffer-file-name)))
777 (dir-locals-find-file (buffer-file-name))))) 778 (dir-locals-find-file
779 (buffer-file-name))))
780 (type "file"))
778 (princ " This variable is a directory local variable") 781 (princ " This variable is a directory local variable")
779 (when file 782 (when file
780 (princ (concat "\n from the file \"" 783 (if (consp file) ; result from cache
781 (if (consp file) 784 ;; If the cache element has an mtime, we
782 (car file) 785 ;; assume it came from a file.
783 file) 786 (if (nth 2 file)
784 "\""))) 787 (setq file (expand-file-name
788 dir-locals-file (car file)))
789 ;; Otherwise, assume it was set directly.
790 (setq type "directory")))
791 (princ (format "\n from the %s \"%s\"" type file)))
785 (princ ".\n")) 792 (princ ".\n"))
786 (princ " This variable is a file local variable.\n"))) 793 (princ " This variable is a file local variable.\n")))
787 794
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 724b0186679..51d18235e1b 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -409,13 +409,16 @@ restore it properly when going back."
409(defun help-buffer () 409(defun help-buffer ()
410 "Return the name of a buffer for inserting help. 410 "Return the name of a buffer for inserting help.
411If `help-xref-following' is non-nil, this is the name of the 411If `help-xref-following' is non-nil, this is the name of the
412current buffer. 412current buffer. Signal an error if this buffer is not derived
413Otherwise, it is *Help*; if no buffer with that name currently 413from `help-mode'.
414exists, it is created." 414Otherwise, return \"*Help*\", creating a buffer with that name if
415it does not already exist."
415 (buffer-name ;for with-output-to-temp-buffer 416 (buffer-name ;for with-output-to-temp-buffer
416 (if help-xref-following 417 (if (not help-xref-following)
417 (current-buffer) 418 (get-buffer-create "*Help*")
418 (get-buffer-create "*Help*")))) 419 (unless (derived-mode-p 'help-mode)
420 (error "Current buffer is not in Help mode"))
421 (current-buffer))))
419 422
420(defvar help-xref-override-view-map 423(defvar help-xref-override-view-map
421 (let ((map (make-sparse-keymap))) 424 (let ((map (make-sparse-keymap)))
diff --git a/lisp/ido.el b/lisp/ido.el
index d1f2cea83f8..2e67e367a8f 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1472,8 +1472,8 @@ Removes badly formatted data and ignored directories."
1472 (add-hook 'choose-completion-string-functions 'ido-choose-completion-string)) 1472 (add-hook 'choose-completion-string-functions 'ido-choose-completion-string))
1473 1473
1474(define-minor-mode ido-everywhere 1474(define-minor-mode ido-everywhere
1475 "Toggle using ido speed-ups everywhere file and directory names are read. 1475 "Toggle using ido-mode everywhere file and directory names are read.
1476With ARG, turn ido speed-up on if arg is positive, off otherwise." 1476With ARG, turn ido-mode on if arg is positive, off otherwise."
1477 :global t 1477 :global t
1478 :group 'ido 1478 :group 'ido
1479 (when (get 'ido-everywhere 'file) 1479 (when (get 'ido-everywhere 'file)
@@ -1494,8 +1494,8 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise."
1494 1494
1495;;;###autoload 1495;;;###autoload
1496(defun ido-mode (&optional arg) 1496(defun ido-mode (&optional arg)
1497 "Toggle ido speed-ups on or off. 1497 "Toggle ido mode on or off.
1498With ARG, turn ido speed-up on if arg is positive, off otherwise. 1498With ARG, turn ido-mode on if arg is positive, off otherwise.
1499Turning on ido-mode will remap (via a minor-mode keymap) the default 1499Turning on ido-mode will remap (via a minor-mode keymap) the default
1500keybindings for the `find-file' and `switch-to-buffer' families of 1500keybindings for the `find-file' and `switch-to-buffer' families of
1501commands to the ido versions of these functions. 1501commands to the ido versions of these functions.
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 8fa6963b3d7..efe8262645d 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -384,7 +384,7 @@ Used together with `image-dired-cmd-read-exif-data-program-options'."
384 "%p -s -s -s -%t \"%f\"" 384 "%p -s -s -s -%t \"%f\""
385 "Format of command used to read EXIF data. 385 "Format of command used to read EXIF data.
386Available options are %p which is replaced by 386Available options are %p which is replaced by
387`image-dired-cmd-write-exif-data-options', %f which is replaced 387`image-dired-cmd-write-exif-data-program', %f which is replaced
388by the image file name and %t which is replaced by the tag name." 388by the image file name and %t which is replaced by the tag name."
389 :type 'string 389 :type 'string
390 :group 'image-dired) 390 :group 'image-dired)
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index 7e317ea09c0..c0fcf19d841 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -337,7 +337,7 @@ The name of generated file is specified by the variable `ja-dic-filename'."
337 (erase-buffer) 337 (erase-buffer)
338 (buffer-disable-undo) 338 (buffer-disable-undo)
339 (insert ";;; ja-dic.el --- dictionary for Japanese input method" 339 (insert ";;; ja-dic.el --- dictionary for Japanese input method"
340 " -*-coding: euc-japan; byte-compile-disable-print-circle:t; -*-\n" 340 " -*-coding: euc-japan; -*-\n"
341 ";;\tGenerated by the command `skkdic-convert'\n" 341 ";;\tGenerated by the command `skkdic-convert'\n"
342 ";;\tDate: " (current-time-string) "\n" 342 ";;\tDate: " (current-time-string) "\n"
343 ";;\tOriginal SKK dictionary file: " 343 ";;\tOriginal SKK dictionary file: "
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 8672fca3a85..5f4d3ea849e 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -366,7 +366,9 @@ This also sets the following values:
366 (coding-system-get coding-system 'ascii-compatible-p))) 366 (coding-system-get coding-system 'ascii-compatible-p)))
367 (setq default-file-name-coding-system coding-system))) 367 (setq default-file-name-coding-system coding-system)))
368 (setq default-terminal-coding-system coding-system) 368 (setq default-terminal-coding-system coding-system)
369 (setq default-keyboard-coding-system coding-system) 369 ;; Prevent default-terminal-coding-system from converting ^M to ^J.
370 (setq default-keyboard-coding-system
371 (coding-system-change-eol-conversion coding-system 'unix))
370 ;; Preserve eol-type from existing default-process-coding-systems. 372 ;; Preserve eol-type from existing default-process-coding-systems.
371 ;; On non-unix-like systems in particular, these may have been set 373 ;; On non-unix-like systems in particular, these may have been set
372 ;; carefully by the user, or by the startup code, to deal with the 374 ;; carefully by the user, or by the startup code, to deal with the
diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index 935d66c613b..e68dc8bdc17 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -272,8 +272,7 @@ SPC, 6, 3, 4, or 7 specifing a tone (SPC:$(0?v(N(B, 6:$(0Dm(N(B, 3:$(0&9Vy
272 272
273 (princ ";; Quail package `") 273 (princ ";; Quail package `")
274 (princ package) 274 (princ package)
275 (princ (format "' -*- coding:%s; " coding-system-for-write)) 275 (princ (format "' -*- coding:%s -*-\n" coding-system-for-write))
276 (princ "byte-compile-disable-print-circle:t; -*-\n")
277 (princ ";; Generated by the command `titdic-convert'\n;;\tDate: ") 276 (princ ";; Generated by the command `titdic-convert'\n;;\tDate: ")
278 (princ (current-time-string)) 277 (princ (current-time-string))
279 (princ "\n;;\tOriginal TIT dictionary file: ") 278 (princ "\n;;\tOriginal TIT dictionary file: ")
@@ -1154,8 +1153,8 @@ the generated Quail package is saved."
1154 (setq coding-system-for-write 1153 (setq coding-system-for-write
1155 (coding-system-change-eol-conversion coding 'unix)) 1154 (coding-system-change-eol-conversion coding 'unix))
1156 (with-temp-file (expand-file-name quailfile dirname) 1155 (with-temp-file (expand-file-name quailfile dirname)
1157 (insert (format ";; Quail package `%s' -*- coding:%s; " name coding)) 1156 (insert (format ";; Quail package `%s' -*- coding:%s -*-\n"
1158 (insert "byte-compile-disable-print-circle:t; -*-\n") 1157 name coding))
1159 (insert ";; Generated by the command `miscdic-convert'\n") 1158 (insert ";; Generated by the command `miscdic-convert'\n")
1160 (insert ";; Date: " (current-time-string) "\n") 1159 (insert ";; Date: " (current-time-string) "\n")
1161 (insert ";; Source dictionary file: " dicfile "\n") 1160 (insert ";; Source dictionary file: " dicfile "\n")
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 5aadac4a3b1..e13d9673514 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -464,7 +464,8 @@ This is like `describe-bindings', but displays only Isearch keys."
464 (define-key map "\C-w" 'isearch-yank-word-or-char) 464 (define-key map "\C-w" 'isearch-yank-word-or-char)
465 (define-key map "\M-\C-w" 'isearch-del-char) 465 (define-key map "\M-\C-w" 'isearch-del-char)
466 (define-key map "\M-\C-y" 'isearch-yank-char) 466 (define-key map "\M-\C-y" 'isearch-yank-char)
467 (define-key map "\C-y" 'isearch-yank-line) 467 (define-key map "\C-y" 'isearch-yank-kill)
468 (define-key map "\M-s\C-e" 'isearch-yank-line)
468 469
469 (define-key map (char-to-string help-char) isearch-help-map) 470 (define-key map (char-to-string help-char) isearch-help-map)
470 (define-key map [help] isearch-help-map) 471 (define-key map [help] isearch-help-map)
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el
index ab9f3662745..b957d9f36c6 100644
--- a/lisp/mail/mailclient.el
+++ b/lisp/mail/mailclient.el
@@ -1,4 +1,4 @@
1;;; mailclient.el --- mail sending via system's mail client. -*- byte-compile-dynamic: t -*- 1;;; mailclient.el --- mail sending via system's mail client.
2 2
3;; Copyright (C) 2005-2011 Free Software Foundation 3;; Copyright (C) 2005-2011 Free Software Foundation
4 4
diff --git a/lisp/mail/mailheader.el b/lisp/mail/mailheader.el
index 896400068cc..1277d1d4109 100644
--- a/lisp/mail/mailheader.el
+++ b/lisp/mail/mailheader.el
@@ -101,7 +101,7 @@ value."
101 (cons (cdr header) (funcall (cdr rule) (cdr header)))))))) 101 (cons (cdr header) (funcall (cdr rule) (cdr header))))))))
102 headers) 102 headers)
103 103
104;; Advertized part of the interface; see mail-header, mail-header-set. 104;; Advertised part of the interface; see mail-header, mail-header-set.
105(defvar headers) 105(defvar headers)
106 106
107(defsubst mail-header (header &optional header-alist) 107(defsubst mail-header (header &optional header-alist)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 06867f6d92a..9a892f493d7 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -503,7 +503,7 @@ FIELD is the plain text name of a field in the message, such as
503\"subject\" or \"from\". A FIELD of \"to\" will automatically include 503\"subject\" or \"from\". A FIELD of \"to\" will automatically include
504all text from the \"cc\" field as well. 504all text from the \"cc\" field as well.
505 505
506REGEXP is an expression to match in the preceeding specified FIELD. 506REGEXP is an expression to match in the preceding specified FIELD.
507FIELD/REGEXP pairs continue in the list. 507FIELD/REGEXP pairs continue in the list.
508 508
509examples: 509examples:
@@ -3443,6 +3443,16 @@ does not pop any summary buffer."
3443 (setq yank-action (list 'insert-buffer replybuffer))) 3443 (setq yank-action (list 'insert-buffer replybuffer)))
3444 (push (cons "cc" cc) other-headers) 3444 (push (cons "cc" cc) other-headers)
3445 (push (cons "in-reply-to" in-reply-to) other-headers) 3445 (push (cons "in-reply-to" in-reply-to) other-headers)
3446 (setq other-headers
3447 (mapcar #'(lambda (elt)
3448 (cons (car elt) (if (stringp (cdr elt))
3449 (rfc2047-decode-string (cdr elt)))))
3450 other-headers))
3451 (if (stringp to) (setq to (rfc2047-decode-string to)))
3452 (if (stringp in-reply-to)
3453 (setq in-reply-to (rfc2047-decode-string in-reply-to)))
3454 (if (stringp cc) (setq cc (rfc2047-decode-string cc)))
3455 (if (stringp subject) (setq subject (rfc2047-decode-string subject)))
3446 (prog1 3456 (prog1
3447 (compose-mail to subject other-headers noerase 3457 (compose-mail to subject other-headers noerase
3448 switch-function yank-action sendactions 3458 switch-function yank-action sendactions
@@ -3450,7 +3460,7 @@ does not pop any summary buffer."
3450 (if (eq switch-function 'switch-to-buffer-other-frame) 3460 (if (eq switch-function 'switch-to-buffer-other-frame)
3451 ;; This is not a standard frame parameter; nothing except 3461 ;; This is not a standard frame parameter; nothing except
3452 ;; sendmail.el looks at it. 3462 ;; sendmail.el looks at it.
3453 (modify-frame-parameters (selected-frame) 3463 (modify-frame-parameters (selected-frame)
3454 '((mail-dedicated-frame . t))))))) 3464 '((mail-dedicated-frame . t)))))))
3455 3465
3456(defun rmail-mail-return () 3466(defun rmail-mail-return ()
@@ -4306,7 +4316,7 @@ With prefix argument N moves forward N messages with these labels.
4306 4316
4307;;;*** 4317;;;***
4308 4318
4309;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "04902da045706fb7f2b0915529ed161b") 4319;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "c530622b53038152ca84f2ec9313bd7a")
4310;;; Generated autoloads from rmailmm.el 4320;;; Generated autoloads from rmailmm.el
4311 4321
4312(autoload 'rmail-mime "rmailmm" "\ 4322(autoload 'rmail-mime "rmailmm" "\
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 0bfeb121ca4..96132739b20 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -853,28 +853,33 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
853 ((looking-at "[ \t]*\n") 853 ((looking-at "[ \t]*\n")
854 (setq next (copy-marker (match-end 0) t))) 854 (setq next (copy-marker (match-end 0) t)))
855 (t 855 (t
856 (rmail-mm-get-boundary-error-message 856 ;; The original code signalled an error as below, but
857 "Malformed boundary" content-type content-disposition 857 ;; this line may be a boundary of nested multipart. So,
858 content-transfer-encoding))) 858 ;; we just set `next' to nil to skip this line
859 859 ;; (rmail-mm-get-boundary-error-message
860 (setq index (1+ index)) 860 ;; "Malformed boundary" content-type content-disposition
861 ;; Handle the part. 861 ;; content-transfer-encoding)
862 (if parse-tag 862 (setq next nil)))
863
864 (when next
865 (setq index (1+ index))
866 ;; Handle the part.
867 (if parse-tag
868 (save-restriction
869 (narrow-to-region beg end)
870 (let ((child (rmail-mime-process
871 nil (format "%s/%d" parse-tag index)
872 content-type content-disposition)))
873 ;; Display a tagline.
874 (aset (aref (rmail-mime-entity-display child) 1) 1
875 (aset (rmail-mime-entity-tagline child) 2 t))
876 (push child entities)))
877
878 (delete-region end next)
863 (save-restriction 879 (save-restriction
864 (narrow-to-region beg end) 880 (narrow-to-region beg end)
865 (let ((child (rmail-mime-process 881 (rmail-mime-show)))
866 nil (format "%s/%d" parse-tag index) 882 (goto-char (setq beg next))))
867 content-type content-disposition)))
868 ;; Display a tagline.
869 (aset (aref (rmail-mime-entity-display child) 1) 1
870 (aset (rmail-mime-entity-tagline child) 2 t))
871 (push child entities)))
872
873 (delete-region end next)
874 (save-restriction
875 (narrow-to-region beg end)
876 (rmail-mime-show)))
877 (goto-char (setq beg next)))
878 883
879 (when parse-tag 884 (when parse-tag
880 (setq entities (nreverse entities)) 885 (setq entities (nreverse entities))
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 77ae87b5449..0548f24b1dd 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -309,7 +309,6 @@ The default value matches citations like `foo-bar>' plus whitespace."
309 (define-key map [remap split-line] 'mail-split-line) 309 (define-key map [remap split-line] 'mail-split-line)
310 (define-key map "\C-c\C-q" 'mail-fill-yanked-message) 310 (define-key map "\C-c\C-q" 'mail-fill-yanked-message)
311 (define-key map "\C-c\C-w" 'mail-signature) 311 (define-key map "\C-c\C-w" 'mail-signature)
312 (define-key map "\C-c\C-v" 'mail-sent-via)
313 (define-key map "\C-c\C-c" 'mail-send-and-exit) 312 (define-key map "\C-c\C-c" 'mail-send-and-exit)
314 (define-key map "\C-c\C-s" 'mail-send) 313 (define-key map "\C-c\C-s" 'mail-send)
315 (define-key map "\C-c\C-i" 'mail-attach-file) 314 (define-key map "\C-c\C-i" 'mail-attach-file)
@@ -349,9 +348,6 @@ The default value matches citations like `foo-bar>' plus whitespace."
349 (define-key map [menu-bar headers expand-aliases] 348 (define-key map [menu-bar headers expand-aliases]
350 '("Expand Aliases" . expand-mail-aliases)) 349 '("Expand Aliases" . expand-mail-aliases))
351 350
352 (define-key map [menu-bar headers sent-via]
353 '("Sent-Via" . mail-sent-via))
354
355 (define-key map [menu-bar headers mail-reply-to] 351 (define-key map [menu-bar headers mail-reply-to]
356 '("Mail-Reply-To" . mail-mail-reply-to)) 352 '("Mail-Reply-To" . mail-mail-reply-to))
357 353
@@ -665,7 +661,6 @@ Here are commands that move to a header field (and create it if there isn't):
665\\[mail-signature] mail-signature (insert `mail-signature-file' file). 661\\[mail-signature] mail-signature (insert `mail-signature-file' file).
666\\[mail-yank-original] mail-yank-original (insert current message, in Rmail). 662\\[mail-yank-original] mail-yank-original (insert current message, in Rmail).
667\\[mail-fill-yanked-message] mail-fill-yanked-message (fill what was yanked). 663\\[mail-fill-yanked-message] mail-fill-yanked-message (fill what was yanked).
668\\[mail-sent-via] mail-sent-via (add a sent-via field for each To or CC).
669Turning on Mail mode runs the normal hooks `text-mode-hook' and 664Turning on Mail mode runs the normal hooks `text-mode-hook' and
670`mail-mode-hook' (in that order)." 665`mail-mode-hook' (in that order)."
671 (make-local-variable 'mail-reply-action) 666 (make-local-variable 'mail-reply-action)
@@ -1346,6 +1341,9 @@ just append to the file, in Babyl format if necessary."
1346 (point))))) 1341 (point)))))
1347 ;; Insert a copy, with altered header field name. 1342 ;; Insert a copy, with altered header field name.
1348 (insert-before-markers "Sent-via:" to-line)))))) 1343 (insert-before-markers "Sent-via:" to-line))))))
1344
1345(make-obsolete 'mail-sent-via "nobody can remember what it is for." "24.1")
1346
1349 1347
1350(defun mail-to () 1348(defun mail-to ()
1351 "Move point to end of To field, creating it if necessary." 1349 "Move point to end of To field, creating it if necessary."
diff --git a/lisp/man.el b/lisp/man.el
index 0b3ac537c5b..c8c2f8653e2 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -623,36 +623,32 @@ and the `Man-section-translations-alist' variables)."
623 (concat Man-specified-section-option section " " name)))) 623 (concat Man-specified-section-option section " " name))))
624 624
625(defun Man-support-local-filenames () 625(defun Man-support-local-filenames ()
626 "Check the availability of `-l' option of the man command. 626 "Return non-nil if the man command supports local filenames.
627This option allows `man' to interpret command line arguments 627Different man programs support this feature in different ways.
628as local filenames. 628The default Debian man program (\"man-db\") has a `--local-file'
629Return the value of the variable `Man-support-local-filenames' 629\(or `-l') option for this purpose. The default Red Hat man
630if it was set to nil or t before the call of this function. 630program has no such option, but interprets any name containing
631If t, the man command supports `-l' option. If nil, it doesn't. 631a \"/\" as a local filename. The function returns either `man-db'
632Otherwise, if the value of `Man-support-local-filenames' 632`man', or nil."
633is neither t nor nil, then determine a new value, set it 633 (if (eq Man-support-local-filenames 'auto-detect)
634to the variable `Man-support-local-filenames' and return 634 (setq Man-support-local-filenames
635a new value." 635 (with-temp-buffer
636 (if (or (not Man-support-local-filenames) 636 (let ((default-directory
637 (eq Man-support-local-filenames t)) 637 ;; Ensure that `default-directory' exists and is readable.
638 Man-support-local-filenames 638 (if (and (file-directory-p default-directory)
639 (setq Man-support-local-filenames 639 (file-readable-p default-directory))
640 (with-temp-buffer 640 default-directory
641 (and (equal (condition-case nil 641 (expand-file-name "~/"))))
642 (let ((default-directory 642 (ignore-errors
643 ;; Assure that `default-directory' exists 643 (call-process manual-program nil t nil "--help")))
644 ;; and is readable. 644 (cond ((search-backward "--local-file" nil 'move)
645 (if (and (file-directory-p default-directory) 645 'man-db)
646 (file-readable-p default-directory)) 646 ;; This feature seems to be present in at least ver 1.4f,
647 default-directory 647 ;; which is about 20 years old.
648 (expand-file-name "~/")))) 648 ;; I don't know if this version has an official name?
649 (call-process manual-program nil t nil "--help")) 649 ((looking-at "^man, versione? [1-9]")
650 (error nil)) 650 'man))))
651 0) 651 Man-support-local-filenames))
652 (progn
653 (goto-char (point-min))
654 (search-forward "--local-file" nil t))
655 t)))))
656 652
657 653
658;; ====================================================================== 654;; ======================================================================
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index f3d1682127e..4b904ed2b7a 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,8 @@
12011-03-05 Antoine Levitt <antoine.levitt@gmail.com>
2
3 * mh-funcs.el (mh-store-msg, mh-store-buffer):
4 * mh-mime.el (mh-mime-save-parts): Use read-directory-name.
5
12011-01-13 Chong Yidong <cyd@stupidchicken.com> 62011-01-13 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * mh-comp.el (mh-user-agent-compose): New arg RETURN-ACTION. 8 * mh-comp.el (mh-user-agent-compose): New arg RETURN-ACTION.
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index ad508416501..c3f301e649d 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -286,7 +286,7 @@ to \"Directory\", and then enter the name of the directory for
286storing the content of these messages." 286storing the content of these messages."
287 (interactive (list (let ((udir (or mh-store-default-directory 287 (interactive (list (let ((udir (or mh-store-default-directory
288 default-directory))) 288 default-directory)))
289 (read-file-name "Store message in directory: " 289 (read-directory-name "Store message in directory: "
290 udir udir nil)))) 290 udir udir nil))))
291 (let ((msg-file-to-store (mh-msg-filename (mh-get-msg-num t)))) 291 (let ((msg-file-to-store (mh-msg-filename (mh-get-msg-num t))))
292 (with-current-buffer (get-buffer-create mh-temp-buffer) 292 (with-current-buffer (get-buffer-create mh-temp-buffer)
@@ -300,7 +300,7 @@ storing the content of these messages."
300See `mh-store-msg' for a description of DIRECTORY." 300See `mh-store-msg' for a description of DIRECTORY."
301 (interactive (list (let ((udir (or mh-store-default-directory 301 (interactive (list (let ((udir (or mh-store-default-directory
302 default-directory))) 302 default-directory)))
303 (read-file-name "Store buffer in directory: " 303 (read-directory-name "Store buffer in directory: "
304 udir udir nil)))) 304 udir udir nil))))
305 (let ((store-directory (expand-file-name directory)) 305 (let ((store-directory (expand-file-name directory))
306 (sh-start (save-excursion 306 (sh-start (save-excursion
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index de0f49e41db..ba994e73a91 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -390,11 +390,11 @@ do the work."
390 (equal nil mh-mime-save-parts-default-directory) 390 (equal nil mh-mime-save-parts-default-directory)
391 (equal t mh-mime-save-parts-default-directory)) 391 (equal t mh-mime-save-parts-default-directory))
392 (not mh-mime-save-parts-directory)) 392 (not mh-mime-save-parts-directory))
393 (read-file-name "Store in directory: " nil nil t nil)) 393 (read-directory-name "Store in directory: " nil nil t))
394 ((and (or prompt 394 ((and (or prompt
395 (equal t mh-mime-save-parts-default-directory)) 395 (equal t mh-mime-save-parts-default-directory))
396 mh-mime-save-parts-directory) 396 mh-mime-save-parts-directory)
397 (read-file-name (format 397 (read-directory-name (format
398 "Store in directory (default %s): " 398 "Store in directory (default %s): "
399 mh-mime-save-parts-directory) 399 mh-mime-save-parts-directory)
400 "" mh-mime-save-parts-directory t "")) 400 "" mh-mime-save-parts-directory t ""))
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index f0d36451b5c..8c9ead479e8 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -4071,7 +4071,7 @@ directory, so that Emacs will know its current contents."
4071 (ange-ftp-get-files dir t)))) 4071 (ange-ftp-get-files dir t))))
4072 4072
4073(defun ange-ftp-make-directory (dir &optional parents) 4073(defun ange-ftp-make-directory (dir &optional parents)
4074 (interactive (list (expand-file-name (read-file-name "Make directory: ")))) 4074 (interactive (list (expand-file-name (read-directory-name "Make directory: "))))
4075 (if parents 4075 (if parents
4076 (let ((parent (file-name-directory (directory-file-name dir)))) 4076 (let ((parent (file-name-directory (directory-file-name dir))))
4077 (or (file-exists-p parent) 4077 (or (file-exists-p parent)
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 660eb3b968e..24dbfc0c30a 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -798,7 +798,12 @@ first, if that exists."
798 (let ((process-environment (copy-sequence process-environment)) 798 (let ((process-environment (copy-sequence process-environment))
799 (function (or (and (string-match "\\`mailto:" url) 799 (function (or (and (string-match "\\`mailto:" url)
800 browse-url-mailto-function) 800 browse-url-mailto-function)
801 browse-url-browser-function))) 801 browse-url-browser-function))
802 ;; Ensure that `default-directory' exists and is readable (b#6077).
803 (default-directory (if (and (file-directory-p default-directory)
804 (file-readable-p default-directory))
805 default-directory
806 (expand-file-name "~/"))))
802 ;; When connected to various displays, be careful to use the display of 807 ;; When connected to various displays, be careful to use the display of
803 ;; the currently selected frame, rather than the original start display, 808 ;; the currently selected frame, rather than the original start display,
804 ;; which may not even exist any more. 809 ;; which may not even exist any more.
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 1d419dbfa18..1e3ee91092d 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -204,12 +204,14 @@ The ARGUMENTS for each METHOD symbol are:
204 `nickserv': NICK PASSWORD [NICKSERV-NICK] 204 `nickserv': NICK PASSWORD [NICKSERV-NICK]
205 `chanserv': NICK CHANNEL PASSWORD 205 `chanserv': NICK CHANNEL PASSWORD
206 `bitlbee': NICK PASSWORD 206 `bitlbee': NICK PASSWORD
207 `quakenet': ACCOUNT PASSWORD
207 208
208Examples: 209Examples:
209 ((\"freenode\" nickserv \"bob\" \"p455w0rd\") 210 ((\"freenode\" nickserv \"bob\" \"p455w0rd\")
210 (\"freenode\" chanserv \"bob\" \"#bobland\" \"passwd99\") 211 (\"freenode\" chanserv \"bob\" \"#bobland\" \"passwd99\")
211 (\"bitlbee\" bitlbee \"robert\" \"sekrit\") 212 (\"bitlbee\" bitlbee \"robert\" \"sekrit\")
212 (\"dal.net\" nickserv \"bob\" \"sekrit\" \"NickServ@services.dal.net\"))" 213 (\"dal.net\" nickserv \"bob\" \"sekrit\" \"NickServ@services.dal.net\")
214 (\"quakenet.org\" quakenet \"bobby\" \"sekrit\"))"
213 :type '(alist :key-type (string :tag "Server") 215 :type '(alist :key-type (string :tag "Server")
214 :value-type (choice (list :tag "NickServ" 216 :value-type (choice (list :tag "NickServ"
215 (const nickserv) 217 (const nickserv)
@@ -223,7 +225,11 @@ Examples:
223 (list :tag "BitlBee" 225 (list :tag "BitlBee"
224 (const bitlbee) 226 (const bitlbee)
225 (string :tag "Nick") 227 (string :tag "Nick")
226 (string :tag "Password")))) 228 (string :tag "Password"))
229 (list :tag "QuakeNet"
230 (const quakenet)
231 (string :tag "Account")
232 (string :tag "Password"))))
227 :group 'rcirc) 233 :group 'rcirc)
228 234
229(defcustom rcirc-auto-authenticate-flag t 235(defcustom rcirc-auto-authenticate-flag t
@@ -232,6 +238,13 @@ See also `rcirc-authinfo'."
232 :type 'boolean 238 :type 'boolean
233 :group 'rcirc) 239 :group 'rcirc)
234 240
241(defcustom rcirc-authenticate-before-join t
242 "*Non-nil means authenticate to services before joining channels.
243Currently only works with NickServ on some networks."
244 :version "24.1"
245 :type 'boolean
246 :group 'rcirc)
247
235(defcustom rcirc-prompt "> " 248(defcustom rcirc-prompt "> "
236 "Prompt string to use in IRC buffers. 249 "Prompt string to use in IRC buffers.
237 250
@@ -282,6 +295,9 @@ Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
282 :type 'hook 295 :type 'hook
283 :group 'rcirc) 296 :group 'rcirc)
284 297
298(defvar rcirc-authenticated-hook nil
299 "Hook run after successfully authenticated.")
300
285(defcustom rcirc-always-use-server-buffer-flag nil 301(defcustom rcirc-always-use-server-buffer-flag nil
286 "Non-nil means messages without a channel target will go to the server buffer." 302 "Non-nil means messages without a channel target will go to the server buffer."
287 :type 'boolean 303 :type 'boolean
@@ -524,6 +540,8 @@ If ARG is non-nil, instead prompt for connection parameters."
524 (setq rcirc-timeout-timer nil) 540 (setq rcirc-timeout-timer nil)
525 (make-local-variable 'rcirc-user-disconnect) 541 (make-local-variable 'rcirc-user-disconnect)
526 (setq rcirc-user-disconnect nil) 542 (setq rcirc-user-disconnect nil)
543 (make-local-variable 'rcirc-user-authenticated)
544 (setq rcirc-user-authenticated nil)
527 (make-local-variable 'rcirc-connecting) 545 (make-local-variable 'rcirc-connecting)
528 (setq rcirc-connecting t) 546 (setq rcirc-connecting t)
529 547
@@ -2104,7 +2122,8 @@ CHANNELS is a comma- or space-separated string of channel names."
2104 (let* ((split-channels (split-string channels "[ ,]" t)) 2122 (let* ((split-channels (split-string channels "[ ,]" t))
2105 (buffers (mapcar (lambda (ch) 2123 (buffers (mapcar (lambda (ch)
2106 (rcirc-get-buffer-create process ch)) 2124 (rcirc-get-buffer-create process ch))
2107 split-channels))) 2125 split-channels))
2126 (channels (mapconcat 'identity split-channels ",")))
2108 (rcirc-send-string process (concat "JOIN " channels)) 2127 (rcirc-send-string process (concat "JOIN " channels))
2109 (when (not (eq (selected-window) (minibuffer-window))) 2128 (when (not (eq (selected-window) (minibuffer-window)))
2110 (dolist (b buffers) ;; order the new channel buffers in the buffer list 2129 (dolist (b buffers) ;; order the new channel buffers in the buffer list
@@ -2427,10 +2446,23 @@ keywords when no KEYWORD is given."
2427 (setq rcirc-server-name sender) 2446 (setq rcirc-server-name sender)
2428 (setq rcirc-nick (car args)) 2447 (setq rcirc-nick (car args))
2429 (rcirc-update-prompt) 2448 (rcirc-update-prompt)
2430 (when rcirc-auto-authenticate-flag (rcirc-authenticate)) 2449 (if rcirc-auto-authenticate-flag
2450 (if rcirc-authenticate-before-join
2451 (progn
2452 (with-rcirc-process-buffer process
2453 (add-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t t))
2454 (rcirc-authenticate))
2455 (rcirc-authenticate)
2456 (rcirc-join-channels process rcirc-startup-channels))
2457 (rcirc-join-channels process rcirc-startup-channels))))
2458
2459(defun rcirc-join-channels-post-auth (process)
2460 "Join `rcirc-startup-channels' after authenticating."
2461 (with-rcirc-process-buffer process
2431 (rcirc-join-channels process rcirc-startup-channels))) 2462 (rcirc-join-channels process rcirc-startup-channels)))
2432 2463
2433(defun rcirc-handler-PRIVMSG (process sender args text) 2464(defun rcirc-handler-PRIVMSG (process sender args text)
2465 (rcirc-check-auth-status process sender args text)
2434 (let ((target (if (rcirc-channel-p (car args)) 2466 (let ((target (if (rcirc-channel-p (car args))
2435 (car args) 2467 (car args)
2436 sender)) 2468 sender))
@@ -2443,6 +2475,7 @@ keywords when no KEYWORD is given."
2443 (rcirc-put-nick-channel process sender target rcirc-current-line)))) 2475 (rcirc-put-nick-channel process sender target rcirc-current-line))))
2444 2476
2445(defun rcirc-handler-NOTICE (process sender args text) 2477(defun rcirc-handler-NOTICE (process sender args text)
2478 (rcirc-check-auth-status process sender args text)
2446 (let ((target (car args)) 2479 (let ((target (car args))
2447 (message (cadr args))) 2480 (message (cadr args)))
2448 (if (string-match "^\C-a\\(.*\\)\C-a$" message) 2481 (if (string-match "^\C-a\\(.*\\)\C-a$" message)
@@ -2460,6 +2493,33 @@ keywords when no KEYWORD is given."
2460 sender))) 2493 sender)))
2461 message t)))) 2494 message t))))
2462 2495
2496(defun rcirc-check-auth-status (process sender args text)
2497 "Check if the user just authenticated.
2498If authenticated, runs `rcirc-authenticated-hook' with PROCESS as
2499the only argument."
2500 (with-rcirc-process-buffer process
2501 (when (and (not rcirc-user-authenticated)
2502 rcirc-authenticate-before-join
2503 rcirc-auto-authenticate-flag)
2504 (let ((target (car args))
2505 (message (cadr args)))
2506 (when (or
2507 (and ;; nickserv
2508 (string= sender "NickServ")
2509 (string= target rcirc-nick)
2510 (member message
2511 (list
2512 (format "You are now identified for \C-b%s\C-b." rcirc-nick)
2513 "Password accepted - you are now recognized."
2514 )))
2515 (and ;; quakenet
2516 (string= sender "Q")
2517 (string= target rcirc-nick)
2518 (string-match message "\\`You are now logged in as .+\\.\\'")))
2519 (setq rcirc-user-authenticated t)
2520 (run-hook-with-args 'rcirc-authenticated-hook process)
2521 (remove-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t))))))
2522
2463(defun rcirc-handler-WALLOPS (process sender args text) 2523(defun rcirc-handler-WALLOPS (process sender args text)
2464 (rcirc-print process sender "WALLOPS" sender (car args) t)) 2524 (rcirc-print process sender "WALLOPS" sender (car args) t))
2465 2525
@@ -2704,26 +2764,33 @@ Passwords are stored in `rcirc-authinfo' (which see)."
2704 (nick (caddr i)) 2764 (nick (caddr i))
2705 (method (cadr i)) 2765 (method (cadr i))
2706 (args (cdddr i))) 2766 (args (cdddr i)))
2707 (when (and (string-match server rcirc-server) 2767 (when (and (string-match server rcirc-server))
2708 (string-match nick rcirc-nick)) 2768 (if (and (memq method '(nickserv chanserv bitlbee))
2709 (cond ((equal method 'nickserv) 2769 (string-match nick rcirc-nick))
2710 (rcirc-send-privmsg 2770 ;; the following methods rely on the user's nickname.
2711 process 2771 (case method
2772 (nickserv
2773 (rcirc-send-privmsg
2774 process
2712 (or (cadr args) "NickServ") 2775 (or (cadr args) "NickServ")
2713 (concat "identify " (car args)))) 2776 (concat "IDENTIFY " (car args))))
2714 ((equal method 'chanserv) 2777 (chanserv
2715 (rcirc-send-privmsg 2778 (rcirc-send-privmsg
2716 process 2779 process
2717 "ChanServ" 2780 "ChanServ"
2718 (format "identify %s %s" (car args) (cadr args)))) 2781 (format "IDENTIFY %s %s" (car args) (cadr args))))
2719 ((equal method 'bitlbee) 2782 (bitlbee
2720 (rcirc-send-privmsg 2783 (rcirc-send-privmsg
2721 process 2784 process
2722 "&bitlbee" 2785 "&bitlbee"
2723 (concat "identify " (car args)))) 2786 (concat "IDENTIFY " (car args)))))
2724 (t 2787 ;; quakenet authentication doesn't rely on the user's nickname.
2725 (message "No %S authentication method defined" 2788 ;; the variable `nick' here represents the Q account name.
2726 method)))))))) 2789 (when (eq method 'quakenet)
2790 (rcirc-send-privmsg
2791 process
2792 "Q@CServe.quakenet.org"
2793 (format "AUTH %s %s" nick (car args))))))))))
2727 2794
2728(defun rcirc-handler-INVITE (process sender args text) 2795(defun rcirc-handler-INVITE (process sender args text)
2729 (rcirc-print process sender "INVITE" nil (mapconcat 'identity args " ") t)) 2796 (rcirc-print process sender "INVITE" nil (mapconcat 'identity args " ") t))
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el
index b4307223ba8..b5453733d1d 100644
--- a/lisp/net/soap-client.el
+++ b/lisp/net/soap-client.el
@@ -2,9 +2,10 @@
2 2
3;; Copyright (C) 2009-2011 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
4 4
5;; Author: Alexandru Harsanyi (AlexHarsanyi@gmail.com) 5;; Author: Alexandru Harsanyi <AlexHarsanyi@gmail.com>
6;; Created: December, 2009 6;; Created: December, 2009
7;; Keywords: soap, web-services, comm, hypermedia 7;; Keywords: soap, web-services, comm, hypermedia
8;; Package: soap-client
8;; Homepage: http://code.google.com/p/emacs-soap-client 9;; Homepage: http://code.google.com/p/emacs-soap-client
9 10
10;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -323,13 +324,18 @@ added to the namespace."
323 ;; if name is nil, use TARGET as a name... 324 ;; if name is nil, use TARGET as a name...
324 (cond ((soap-element-p target) 325 (cond ((soap-element-p target)
325 (setq name (soap-element-name target))) 326 (setq name (soap-element-name target)))
327 ((consp target) ; a fq name: (namespace . name)
328 (setq name (cdr target)))
326 ((stringp target) 329 ((stringp target)
327 (cond ((string-match "^\\(.*\\):\\(.*\\)$" target) 330 (cond ((string-match "^\\(.*\\):\\(.*\\)$" target)
328 (setq name (match-string 2 target))) 331 (setq name (match-string 2 target)))
329 (t 332 (t
330 (setq name target)))))) 333 (setq name target))))))
331 334
332 (assert name) ; by now, name should be valid 335 ;; by now, name should be valid
336 (assert (and name (not (equal name "")))
337 nil
338 "Cannot determine name for namespace link")
333 (push (make-soap-namespace-link :name name :target target) 339 (push (make-soap-namespace-link :name name :target target)
334 (gethash name (soap-namespace-elements ns)))) 340 (gethash name (soap-namespace-elements ns))))
335 341
@@ -890,7 +896,11 @@ Return a SOAP-NAMESPACE containing the elements."
890 (when (consp c) ; skip string nodes, which are whitespace 896 (when (consp c) ; skip string nodes, which are whitespace
891 (let ((node-name (soap-l2wk (xml-node-name c)))) 897 (let ((node-name (soap-l2wk (xml-node-name c))))
892 (cond 898 (cond
893 ((eq node-name 'xsd:sequence) 899 ;; The difference between xsd:all and xsd:sequence is that fields
900 ;; in xsd:all are not ordered and they can occur only once. We
901 ;; don't care about that difference in soap-client.el
902 ((or (eq node-name 'xsd:sequence)
903 (eq node-name 'xsd:all))
894 (setq type (soap-parse-complex-type-sequence c))) 904 (setq type (soap-parse-complex-type-sequence c)))
895 ((eq node-name 'xsd:complexContent) 905 ((eq node-name 'xsd:complexContent)
896 (setq type (soap-parse-complex-type-complex-content c))) 906 (setq type (soap-parse-complex-type-complex-content c)))
@@ -909,9 +919,10 @@ NODE is assumed to be an xsd:sequence node. In that case, each
909of its children is assumed to be a sequence element. Each 919of its children is assumed to be a sequence element. Each
910sequence element is parsed constructing the corresponding type. 920sequence element is parsed constructing the corresponding type.
911A list of these types is returned." 921A list of these types is returned."
912 (assert (eq (soap-l2wk (xml-node-name node)) 'xsd:sequence) 922 (assert (let ((n (soap-l2wk (xml-node-name node))))
923 (memq n '(xsd:sequence xsd:all)))
913 nil 924 nil
914 "soap-parse-sequence: expecting xsd:sequence node, got %s" 925 "soap-parse-sequence: expecting xsd:sequence or xsd:all node, got %s"
915 (soap-l2wk (xml-node-name node))) 926 (soap-l2wk (xml-node-name node)))
916 (let (elements) 927 (let (elements)
917 (dolist (e (soap-xml-get-children1 node 'xsd:element)) 928 (dolist (e (soap-xml-get-children1 node 'xsd:element))
diff --git a/lisp/net/soap-inspect.el b/lisp/net/soap-inspect.el
index 7cce9844d76..8f67d02dc6f 100644
--- a/lisp/net/soap-inspect.el
+++ b/lisp/net/soap-inspect.el
@@ -2,9 +2,10 @@
2 2
3;; Copyright (C) 2010-2011 Free Software Foundation, Inc. 3;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
4 4
5;; Author: Alexandru Harsanyi (AlexHarsanyi@gmail.com) 5;; Author: Alexandru Harsanyi <AlexHarsanyi@gmail.com>
6;; Created: October 2010 6;; Created: October 2010
7;; Keywords: soap, web-services, comm, hypermedia 7;; Keywords: soap, web-services, comm, hypermedia
8;; Package: soap-client
8;; Homepage: http://code.google.com/p/emacs-soap-client 9;; Homepage: http://code.google.com/p/emacs-soap-client
9 10
10;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index a98e523a68b..f8bc594e959 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -353,7 +353,8 @@ KEY identifies the connection, it is either a process or a vector."
353 (write-region 353 (write-region
354 (point-min) (point-max) tramp-persistency-file-name)))))) 354 (point-min) (point-max) tramp-persistency-file-name))))))
355 355
356(add-hook 'kill-emacs-hook 'tramp-dump-connection-properties) 356(unless noninteractive
357 (add-hook 'kill-emacs-hook 'tramp-dump-connection-properties))
357(add-hook 'tramp-cache-unload-hook 358(add-hook 'tramp-cache-unload-hook
358 '(lambda () 359 '(lambda ()
359 (remove-hook 'kill-emacs-hook 360 (remove-hook 'kill-emacs-hook
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 7d266ad17d7..58f1e2c6a9e 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -281,6 +281,12 @@ buffer in your bug report.
281 (insert ")\n")) 281 (insert ")\n"))
282 (insert-buffer-substring elbuf))) 282 (insert-buffer-substring elbuf)))
283 283
284 ;; Dump load-path shadows.
285 (insert "\nload-path shadows:\n==================\n")
286 (ignore-errors
287 (mapc (lambda (x) (when (string-match "tramp" x) (insert x "\n")))
288 (split-string (list-load-path-shadows t) "\n")))
289
284 ;; Append buffers only when we are in message mode. 290 ;; Append buffers only when we are in message mode.
285 (when (and 291 (when (and
286 (eq major-mode 'message-mode) 292 (eq major-mode 'message-mode)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 57cc54935dc..b3278dc312d 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -142,7 +142,7 @@
142 (add-to-list 'tramp-methods (cons elt nil))))) 142 (add-to-list 'tramp-methods (cons elt nil)))))
143 143
144(defconst tramp-gvfs-path-tramp (concat dbus-path-emacs "/Tramp") 144(defconst tramp-gvfs-path-tramp (concat dbus-path-emacs "/Tramp")
145 "The preceeding object path for own objects.") 145 "The preceding object path for own objects.")
146 146
147(defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon" 147(defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon"
148 "The well known name of the GVFS daemon.") 148 "The well known name of the GVFS daemon.")
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el
index 68d06ef34bc..a59e7871458 100644
--- a/lisp/obsolete/fast-lock.el
+++ b/lisp/obsolete/fast-lock.el
@@ -840,7 +840,8 @@ See `fast-lock-get-face-properties'."
840 840
841(add-hook 'after-save-hook 'fast-lock-save-cache-after-save-file) 841(add-hook 'after-save-hook 'fast-lock-save-cache-after-save-file)
842(add-hook 'kill-buffer-hook 'fast-lock-save-cache-before-kill-buffer) 842(add-hook 'kill-buffer-hook 'fast-lock-save-cache-before-kill-buffer)
843(add-hook 'kill-emacs-hook 'fast-lock-save-caches-before-kill-emacs) 843(unless noninteractive
844 (add-hook 'kill-emacs-hook 'fast-lock-save-caches-before-kill-emacs))
844 845
845;;;###autoload 846;;;###autoload
846(when (fboundp 'add-minor-mode) 847(when (fboundp 'add-minor-mode)
diff --git a/lisp/obsolete/sym-comp.el b/lisp/obsolete/sym-comp.el
index 6365a1075e0..7e9a460ea14 100644
--- a/lisp/obsolete/sym-comp.el
+++ b/lisp/obsolete/sym-comp.el
@@ -51,7 +51,7 @@ Uses `current-word' with the buffer narrowed to the part before
51point." 51point."
52 (save-restriction 52 (save-restriction
53 ;; Narrow in case point is in the middle of a symbol -- we want 53 ;; Narrow in case point is in the middle of a symbol -- we want
54 ;; just the preceeding part. 54 ;; just the preceding part.
55 (narrow-to-region (point-min) (point)) 55 (narrow-to-region (point-min) (point))
56 (current-word))) 56 (current-word)))
57 57
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index 5f0908e11c6..e75821b6860 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,16 @@
12011-03-06 Juanma Barranquero <lekktu@gmail.com>
2
3 * org.el (org-blank-before-new-entry, org-context-in-file-links)
4 (org-refile-targets, org-log-repeat, org-insert-link)
5 (org-speed-command-default-hook, org-speed-command-hook)
6 (org-in-regexps-block-p, org-yank-generic, org-goto-first-child):
7 Fix typos in docstrings.
8 (org-toggle-pretty-entities): Fix typo in message.
9
102011-03-06 Juanma Barranquero <lekktu@gmail.com>
11
12 * org-id.el: Don't set `kill-emacs-hook' on noninteractive sessions.
13
12011-02-10 Stefan Monnier <monnier@iro.umontreal.ca> 142011-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
2 15
3 * org-remember.el (org-remember-mode-map): 16 * org-remember.el (org-remember-mode-map):
@@ -48,7 +61,7 @@
482010-12-11 Nicolas Goaziou <n.goaziou@gmail.com> 612010-12-11 Nicolas Goaziou <n.goaziou@gmail.com>
49 62
50 * org-inlinetask.el (org-inlinetask-export-templates): Add 63 * org-inlinetask.el (org-inlinetask-export-templates): Add
51 Sébastien Vauban's suggestion for LaTeX export in docstring. This is 64 Sébastien Vauban's suggestion for LaTeX export in docstring. This is
52 not default as it requires an additional LaTeX package: "todonotes". 65 not default as it requires an additional LaTeX package: "todonotes".
53 66
542010-12-11 Nicolas Goaziou <n.goaziou@gmail.com> 672010-12-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -102,7 +115,7 @@
102 115
103 * org.el (org-make-heading-search-string): Optionally limit number 116 * org.el (org-make-heading-search-string): Optionally limit number
104 of lines stored in file link search strings. 117 of lines stored in file link search strings.
105 (org-context-in-file-links) Add option to set to integer specifying 118 (org-context-in-file-links): Add option to set to integer specifying
106 number of lines. 119 number of lines.
107 120
1082010-12-11 Carsten Dominik <carsten.dominik@gmail.com> 1212010-12-11 Carsten Dominik <carsten.dominik@gmail.com>
@@ -279,7 +292,7 @@
2792010-12-11 Julien Danjou <julien@danjou.info> 2922010-12-11 Julien Danjou <julien@danjou.info>
280 293
281 * org-agenda.el (org-format-agenda-item): Convert category to a string 294 * org-agenda.el (org-format-agenda-item): Convert category to a string
282 if it is a symbol. This fixes the following call to 295 if it is a symbol. This fixes the following call to
283 org-agenda-get-category-icon which fails if category is not a string. 296 org-agenda-get-category-icon which fails if category is not a string.
284 297
2852010-12-11 Eric Schulte <schulte.eric@gmail.com> 2982010-12-11 Eric Schulte <schulte.eric@gmail.com>
@@ -305,7 +318,7 @@
305 318
306 * ob-python.el (org-babel-execute:python): Use a :return header 319 * ob-python.el (org-babel-execute:python): Use a :return header
307 argument for external evaluation in which the code block body need 320 argument for external evaluation in which the code block body need
308 be wrapped in a function 321 to be wrapped in a function.
309 322
3102010-12-11 Eric Schulte <schulte.eric@gmail.com> 3232010-12-11 Eric Schulte <schulte.eric@gmail.com>
311 324
@@ -314,7 +327,7 @@
314 327
3152010-12-11 Carsten Dominik <carsten.dominik@gmail.com> 3282010-12-11 Carsten Dominik <carsten.dominik@gmail.com>
316 329
317 * org.el (org-edit-special): Edit formulas when in TBLMF line 330 * org.el (org-edit-special): Edit formulas when in TBLMF line.
318 331
3192010-12-11 Allen S. Rout <asr@ufl.edu> (tiny change) 3322010-12-11 Allen S. Rout <asr@ufl.edu> (tiny change)
320 333
@@ -394,7 +407,7 @@
394 407
395 * org-macs.el (org-called-interactively-p): Wrap function call in 408 * org-macs.el (org-called-interactively-p): Wrap function call in
396 with-no-warnings. 409 with-no-warnings.
397 (with-silent-modifications) Declare macro for Emacs < 23.2. 410 (with-silent-modifications): Declare macro for Emacs < 23.2.
398 411
3992010-12-11 Eric Schulte <schulte.eric@gmail.com> 4122010-12-11 Eric Schulte <schulte.eric@gmail.com>
400 413
@@ -430,7 +443,7 @@
4302010-12-11 Achim Gratz <Stromeko@Stromeko.DE> (tiny change) 4432010-12-11 Achim Gratz <Stromeko@Stromeko.DE> (tiny change)
431 444
432 * org-clock.el (org-get-clocktable): Previous patch incorrectly 445 * org-clock.el (org-get-clocktable): Previous patch incorrectly
433 required whitespace in front of #+BEGIN: and #+END: 446 required whitespace in front of #+BEGIN: and #+END:.
434 447
4352010-12-11 Dan Davison <dandavison7@gmail.com> 4482010-12-11 Dan Davison <dandavison7@gmail.com>
436 449
@@ -467,7 +480,7 @@
4672010-12-11 Nicolas Goaziou <n.goaziou@gmail.com> 4802010-12-11 Nicolas Goaziou <n.goaziou@gmail.com>
468 481
469 * org.el (org-indent-line-function): Drawers and blocks have no 482 * org.el (org-indent-line-function): Drawers and blocks have no
470 influence on indentation of text below. Also fix indentation 483 influence on indentation of text below. Also fix indentation
471 problem with a block at column 0 and add a special case for 484 problem with a block at column 0 and add a special case for
472 literal examples. 485 literal examples.
473 486
@@ -480,7 +493,7 @@
480 493
481 * ob-ref.el (org-babel-ref-resolve): Recognize `list' as a unique 494 * ob-ref.el (org-babel-ref-resolve): Recognize `list' as a unique
482 type of data 495 type of data
483 (org-babel-ref-at-ref-p): Recognize `list' as a unique type of data 496 (org-babel-ref-at-ref-p): Recognize `list' as a unique type of data.
484 497
4852010-12-11 Eric Schulte <schulte.eric@gmail.com> 4982010-12-11 Eric Schulte <schulte.eric@gmail.com>
486 499
@@ -510,7 +523,7 @@
510 * org-clock.el (org-get-clocktable): 523 * org-clock.el (org-get-clocktable):
511 (org-in-clocktable-p): 524 (org-in-clocktable-p):
512 (org-clocktable-shift): 525 (org-clocktable-shift):
513 (org-clocktable-steps): Fix regexp to allow for indented clock tables 526 (org-clocktable-steps): Fix regexp to allow for indented clock tables.
514 527
5152010-12-11 Puneeth Chaganti <punchagan@gmail.com> 5282010-12-11 Puneeth Chaganti <punchagan@gmail.com>
516 529
@@ -525,7 +538,7 @@
525 (org-export-latex-href-format): Rename the existing variable 538 (org-export-latex-href-format): Rename the existing variable
526 `org-export-latex-hyperref-format' as `org-export-latex-href-format' 539 `org-export-latex-hyperref-format' as `org-export-latex-href-format'
527 (org-export-latex-links): Use `org-export-latex-hyperref-format' and 540 (org-export-latex-links): Use `org-export-latex-hyperref-format' and
528 `org-export-latex-href-format' 541 `org-export-latex-href-format'.
529 542
5302010-12-11 Eric Schulte <schulte.eric@gmail.com> 5432010-12-11 Eric Schulte <schulte.eric@gmail.com>
531 544
@@ -535,7 +548,7 @@
5352010-12-11 Nicolas Goaziou <n.goaziou@gmail.com> 5482010-12-11 Nicolas Goaziou <n.goaziou@gmail.com>
536 549
537 * org-exp.el (org-export-preprocess-string): delaying code block 550 * org-exp.el (org-export-preprocess-string): delaying code block
538 processing a bit to allow correct list parsing in the export string 551 processing a bit to allow correct list parsing in the export string.
539 552
5402010-12-11 Christopher Allan Webber <cwebber@dustycloud.org> 5532010-12-11 Christopher Allan Webber <cwebber@dustycloud.org>
541 554
@@ -575,7 +588,7 @@
575 588
576 * org-exp.el (org-export-format-source-code-or-example): 589 * org-exp.el (org-export-format-source-code-or-example):
577 Remove hard-wired configuration of minted export 590 Remove hard-wired configuration of minted export
578 (org-export-latex-minted-with-line-numbers): Remove variable 591 (org-export-latex-minted-with-line-numbers): Remove variable.
579 592
5802010-12-11 Bastien Guerry <bzg@altern.org> 5932010-12-11 Bastien Guerry <bzg@altern.org>
581 594
@@ -592,7 +605,7 @@
5922010-12-11 Eric Schulte <schulte.eric@gmail.com> 6052010-12-11 Eric Schulte <schulte.eric@gmail.com>
593 606
594 * ob-lob.el (org-babel-lob-get-info): including pass-through 607 * ob-lob.el (org-babel-lob-get-info): including pass-through
595 header arguments in results variable header argument string 608 header arguments in results variable header argument string.
596 609
5972010-12-11 David Maus <dmaus@ictsoc.de> 6102010-12-11 David Maus <dmaus@ictsoc.de>
598 611
@@ -640,11 +653,11 @@
6402010-12-11 Eric Schulte <schulte.eric@gmail.com> 6532010-12-11 Eric Schulte <schulte.eric@gmail.com>
641 654
642 * ob-calc.el (org-babel-execute:calc): support for variables -- 655 * ob-calc.el (org-babel-execute:calc): support for variables --
643 converts :var variables in calc variables 656 converts :var variables in calc variables.
644 657
6452010-12-11 Carsten Dominik <carsten.dominik@gmail.com> 6582010-12-11 Carsten Dominik <carsten.dominik@gmail.com>
646 659
647 * org.el (org-sparse-tree): Mention [r] in dispatch menu 660 * org.el (org-sparse-tree): Mention [r] in dispatch menu.
648 661
6492010-12-11 Carsten Dominik <carsten.dominik@gmail.com> 6622010-12-11 Carsten Dominik <carsten.dominik@gmail.com>
650 663
@@ -743,10 +756,10 @@
743 756
744 * org-exp.el (org-export-format-source-code-or-example): 757 * org-exp.el (org-export-format-source-code-or-example):
745 Use minted for latex source code export if `org-export-latex-listings' 758 Use minted for latex source code export if `org-export-latex-listings'
746 has the value 'minted 759 has the value 'minted.
747 760
748 * org-latex.el (org-export-latex-listings): Document special value 761 * org-latex.el (org-export-latex-listings): Document special value
749 'minted 762 'minted.
750 763
751 * org-latex.el (org-export-latex-minted): Delete variable. 764 * org-latex.el (org-export-latex-minted): Delete variable.
752 765
@@ -786,10 +799,10 @@
7862010-11-11 Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> 7992010-11-11 Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl>
787 800
788 * org-agenda.el (org-agenda-get-sexps): Handle lists as return 801 * org-agenda.el (org-agenda-get-sexps): Handle lists as return
789 values from diary entries 802 values from diary entries.
790 803
791 * org-bbdb.el (org-bbdb-anniversaries): Handle lists of 804 * org-bbdb.el (org-bbdb-anniversaries): Handle lists of
792 anniversaries 805 anniversaries.
793 806
794 * org.el (org-diary-sexp-entry): Handle lists as return values 807 * org.el (org-diary-sexp-entry): Handle lists as return values
795 from diary entries. 808 from diary entries.
@@ -1034,90 +1047,90 @@
1034 1047
1035 * ob-C.el (org-babel-C-execute): Remove call to 1048 * ob-C.el (org-babel-C-execute): Remove call to
1036 org-babel-process-params which should no longer be called from 1049 org-babel-process-params which should no longer be called from
1037 within a language file 1050 within a language file.
1038 1051
1039 * ob-R.el (org-babel-execute:R): Remove call to 1052 * ob-R.el (org-babel-execute:R): Remove call to
1040 org-babel-process-params which should no longer be called from 1053 org-babel-process-params which should no longer be called from
1041 within a language file 1054 within a language file
1042 (org-babel-R-variable-assignments): Remove call to 1055 (org-babel-R-variable-assignments): Remove call to
1043 org-babel-process-params which should no longer be called from 1056 org-babel-process-params which should no longer be called from
1044 within a language file 1057 within a language file.
1045 1058
1046 * ob-asymptote.el (org-babel-execute:asymptote): Remove call to 1059 * ob-asymptote.el (org-babel-execute:asymptote): Remove call to
1047 org-babel-process-params which should no longer be called from 1060 org-babel-process-params which should no longer be called from
1048 within a language file 1061 within a language file.
1049 1062
1050 * ob-clojure.el (org-babel-execute:clojure): Remove call to 1063 * ob-clojure.el (org-babel-execute:clojure): Remove call to
1051 org-babel-process-params which should no longer be called from 1064 org-babel-process-params which should no longer be called from
1052 within a language file 1065 within a language file.
1053 1066
1054 * ob-dot.el (org-babel-execute:dot): Remove call to 1067 * ob-dot.el (org-babel-execute:dot): Remove call to
1055 org-babel-process-params which should no longer be called from 1068 org-babel-process-params which should no longer be called from
1056 within a language file 1069 within a language file.
1057 1070
1058 * ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp): Remove 1071 * ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp): Remove
1059 call to org-babel-process-params which should no longer be called 1072 call to org-babel-process-params which should no longer be called
1060 from within a language file 1073 from within a language file
1061 (org-babel-execute:emacs-lisp): Remove call to 1074 (org-babel-execute:emacs-lisp): Remove call to
1062 org-babel-process-params which should no longer be called from 1075 org-babel-process-params which should no longer be called from
1063 within a language file 1076 within a language file.
1064 1077
1065 * ob-haskell.el (org-babel-execute:haskell): Remove call to 1078 * ob-haskell.el (org-babel-execute:haskell): Remove call to
1066 org-babel-process-params which should no longer be called from 1079 org-babel-process-params which should no longer be called from
1067 within a language file 1080 within a language file.
1068 1081
1069 * ob-js.el (org-babel-execute:js): Remove call to 1082 * ob-js.el (org-babel-execute:js): Remove call to
1070 org-babel-process-params which should no longer be called from 1083 org-babel-process-params which should no longer be called from
1071 within a language file 1084 within a language file.
1072 1085
1073 * ob-lisp.el (org-babel-execute:lisp): Remove call to 1086 * ob-lisp.el (org-babel-execute:lisp): Remove call to
1074 org-babel-process-params which should no longer be called from 1087 org-babel-process-params which should no longer be called from
1075 within a language file 1088 within a language file.
1076 1089
1077 * ob-ocaml.el (org-babel-execute:ocaml): Remove call to 1090 * ob-ocaml.el (org-babel-execute:ocaml): Remove call to
1078 org-babel-process-params which should no longer be called from 1091 org-babel-process-params which should no longer be called from
1079 within a language file 1092 within a language file.
1080 1093
1081 * ob-octave.el (org-babel-execute:octave): Remove call to 1094 * ob-octave.el (org-babel-execute:octave): Remove call to
1082 org-babel-process-params which should no longer be called from 1095 org-babel-process-params which should no longer be called from
1083 within a language file 1096 within a language file.
1084 1097
1085 * ob-perl.el (org-babel-execute:perl): Remove call to 1098 * ob-perl.el (org-babel-execute:perl): Remove call to
1086 org-babel-process-params which should no longer be called from 1099 org-babel-process-params which should no longer be called from
1087 within a language file 1100 within a language file.
1088 1101
1089 * ob-python.el (org-babel-execute:python): Remove call to 1102 * ob-python.el (org-babel-execute:python): Remove call to
1090 org-babel-process-params which should no longer be called from 1103 org-babel-process-params which should no longer be called from
1091 within a language file 1104 within a language file.
1092 1105
1093 * ob-ruby.el (org-babel-execute:ruby): Remove call to 1106 * ob-ruby.el (org-babel-execute:ruby): Remove call to
1094 org-babel-process-params which should no longer be called from 1107 org-babel-process-params which should no longer be called from
1095 within a language file 1108 within a language file.
1096 1109
1097 * ob-scheme.el (org-babel-execute:scheme): Remove call to 1110 * ob-scheme.el (org-babel-execute:scheme): Remove call to
1098 org-babel-process-params which should no longer be called from 1111 org-babel-process-params which should no longer be called from
1099 within a language file 1112 within a language file.
1100 1113
1101 * ob-screen.el (org-babel-execute:screen): Remove call to 1114 * ob-screen.el (org-babel-execute:screen): Remove call to
1102 org-babel-process-params which should no longer be called from 1115 org-babel-process-params which should no longer be called from
1103 within a language file 1116 within a language file
1104 (org-babel-prep-session:screen): Remove call to 1117 (org-babel-prep-session:screen): Remove call to
1105 org-babel-process-params which should no longer be called from 1118 org-babel-process-params which should no longer be called from
1106 within a language file 1119 within a language file.
1107 1120
1108 * ob-sh.el (org-babel-execute:sh): Remove call to 1121 * ob-sh.el (org-babel-execute:sh): Remove call to
1109 org-babel-process-params which should no longer be called from 1122 org-babel-process-params which should no longer be called from
1110 within a language file 1123 within a language file.
1111 1124
1112 * ob-sql.el (org-babel-execute:sql): Remove call to 1125 * ob-sql.el (org-babel-execute:sql): Remove call to
1113 org-babel-process-params which should no longer be called from 1126 org-babel-process-params which should no longer be called from
1114 within a language file 1127 within a language file.
1115 1128
1116 * ob-haskell.el (org-babel-execute:haskell): Remove reference to 1129 * ob-haskell.el (org-babel-execute:haskell): Remove reference to
1117 processed params 1130 processed params.
1118 1131
1119 * ob-clojure.el (org-babel-execute:clojure): Remove reference to 1132 * ob-clojure.el (org-babel-execute:clojure): Remove reference to
1120 processed params 1133 processed params.
1121 1134
1122 * ob-R.el (org-babel-execute:R): Remove reference to processed 1135 * ob-R.el (org-babel-execute:R): Remove reference to processed
1123 params. 1136 params.
@@ -1308,162 +1321,45 @@
1308 1321
13092010-11-11 Eric Schulte <schulte.eric@gmail.com> 13222010-11-11 Eric Schulte <schulte.eric@gmail.com>
1310 1323
1311 * ob-C.el (org-babel-expand-body:c++): Remove obsoleted optional 1324 * ob-C.el (org-babel-expand-body:c++, org-babel-C-expand):
1312 third argument 1325 * ob-R.el (org-babel-expand-body:R, org-babel-execute:R)
1313 (org-babel-expand-body:c++): Remove obsoleted optional third 1326 (org-babel-R-variable-assignments):
1314 argument 1327 * ob-asymptote.el (org-babel-expand-body:asymptote)
1315 (org-babel-C-expand): Remove obsoleted optional third argument 1328 (org-babel-execute:asymptote):
1316 1329 * ob-clojure.el (org-babel-expand-body:clojure)
1317 * ob-R.el: 1330 (org-babel-execute:clojure):
1318 (org-babel-expand-body:R): Remove obsoleted optional third 1331 * ob-css.el (org-babel-expand-body:css):
1319 argument 1332 * ob-ditaa.el (org-babel-expand-body:ditaa):
1320 (org-babel-execute:R): Remove obsoleted optional third argument 1333 * ob-dot.el (org-babel-expand-body:dot, org-babel-execute:dot):
1321 (org-babel-R-variable-assignments): Remove obsoleted optional 1334 * ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp)
1322 third argument 1335 (org-babel-execute:emacs-lisp):
1323 1336 * ob-gnuplot.el (org-babel-expand-body:gnuplot)
1324 * ob-asymptote.el: 1337 * ob-haskell.el (org-babel-expand-body:haskell)
1325 (org-babel-expand-body:asymptote): Remove obsoleted optional 1338 (org-babel-execute:haskell, org-babel-load-session:haskell)
1326 third argument 1339 (org-babel-prep-session:haskell):
1327 (org-babel-execute:asymptote): Remove obsoleted optional third 1340 * ob-js.el (org-babel-expand-body:js, org-babel-execute:js):
1328 argument 1341 * ob-latex.el (org-babel-expand-body:latex):
1329 1342 * ob-lisp.el (org-babel-expand-body:lisp, org-babel-execute:lisp):
1330 * ob-clojure.el: 1343 * ob-mscgen.el (org-babel-expand-body:mscgen):
1331 (org-babel-expand-body:clojure): Remove obsoleted optional third 1344 * ob-ocaml.el (org-babel-expand-body:ocaml, org-babel-execute:ocaml):
1332 argument 1345 * ob-octave.el (org-babel-expand-body:matlab)
1333 (org-babel-execute:clojure): Remove obsoleted optional third 1346 (org-babel-expand-body:octave, org-babel-execute:octave)
1334 argument 1347 (org-babel-octave-variable-assignments):
1335 1348 * ob-org.el (org-babel-expand-body:org):
1336 * ob-css.el: 1349 * ob-perl.el (org-babel-expand-body:perl, org-babel-execute:perl):
1337 (org-babel-expand-body:css): Remove obsoleted optional third 1350 * ob-plantuml.el (org-babel-expand-body:plantuml):
1338 argument 1351 * ob-python.el (org-babel-expand-body:python, org-babel-execute:python)
1339 1352 (org-babel-python-variable-assignments):
1340 * ob-ditaa.el: 1353 * ob-ruby.el (org-babel-expand-body:ruby, org-babel-execute:ruby):
1341 (org-babel-expand-body:ditaa): Remove obsoleted optional third 1354 * ob-sass.el (org-babel-expand-body:sass):
1342 argument 1355 * ob-scheme.el (org-babel-expand-body:scheme, org-babel-execute:scheme):
1343 1356 * ob-screen.el (org-babel-expand-body:screen):
1344 * ob-dot.el: 1357 * ob-sh.el (org-babel-expand-body:sh, org-babel-execute:sh)
1345 (org-babel-expand-body:dot): Remove obsoleted optional third 1358 (org-babel-sh-variable-assignments):
1346 argument 1359 * ob-sql.el (org-babel-expand-body:sql):
1347 (org-babel-execute:dot): Remove obsoleted optional third 1360 * ob-sqlite.el (org-babel-expand-body:sqlite, org-babel-execute:sqlite):
1348 argument 1361 * ob.el (org-babel-expand-body:generic):
1349 1362 Remove obsoleted optional third argument.
1350 * ob-emacs-lisp.el:
1351 (org-babel-expand-body:emacs-lisp): Remove obsoleted optional
1352 third argument
1353 (org-babel-execute:emacs-lisp): Remove obsoleted optional third
1354 argument
1355
1356 * ob-gnuplot.el:
1357 (org-babel-expand-body:gnuplot): Remove obsoleted optional third
1358 argument
1359
1360 * ob-haskell.el:
1361 (org-babel-expand-body:haskell): Remove obsoleted optional third
1362 argument
1363 (org-babel-execute:haskell): Remove obsoleted optional third
1364 argument
1365 (org-babel-load-session:haskell): Remove obsoleted optional
1366 third
1367 (org-babel-prep-session:haskell): Remove obsoleted optional
1368 third
1369
1370 * ob-js.el:
1371 (org-babel-expand-body:js): Remove obsoleted optional third
1372 argument
1373 (org-babel-execute:js): Remove obsoleted optional third argument
1374
1375 * ob-latex.el:
1376 (org-babel-expand-body:latex): Remove obsoleted optional third
1377 argument
1378
1379 * ob-lisp.el:
1380 (org-babel-expand-body:lisp): Remove obsoleted optional third
1381 argument
1382 (org-babel-execute:lisp): Remove obsoleted optional third
1383 argument
1384
1385 * ob-mscgen.el:
1386 (org-babel-expand-body:mscgen): Remove obsoleted optional third
1387 argument
1388
1389 * ob-ocaml.el:
1390 (org-babel-expand-body:ocaml): Remove obsoleted optional third
1391 argument
1392 (org-babel-execute:ocaml): Remove obsoleted optional third
1393 argument
1394
1395 * ob-octave.el:
1396 (org-babel-expand-body:matlab): Remove obsoleted optional third
1397 argument
1398 (org-babel-expand-body:octave): Remove obsoleted optional third
1399 argument
1400 (org-babel-execute:octave): Remove obsoleted optional third
1401 argument
1402 (org-babel-octave-variable-assignments): Remove obsoleted
1403 optional third
1404
1405 * ob-org.el:
1406 (org-babel-expand-body:org): Remove obsoleted optional third
1407 argument
1408
1409 * ob-perl.el:
1410 (org-babel-expand-body:perl): Remove obsoleted optional third
1411 argument
1412 (org-babel-execute:perl): Remove obsoleted optional third
1413 argument
1414
1415 * ob-plantuml.el:
1416 (org-babel-expand-body:plantuml): Remove obsoleted optional
1417 third argument
1418
1419 * ob-python.el:
1420 (org-babel-expand-body:python): Remove obsoleted optional third
1421 argument
1422 (org-babel-execute:python): Remove obsoleted optional third
1423 argument
1424 (org-babel-python-variable-assignments): Remove obsoleted
1425 optional third
1426
1427 * ob-ruby.el:
1428 (org-babel-expand-body:ruby): Remove obsoleted optional third
1429 argument
1430 (org-babel-execute:ruby): Remove obsoleted optional third
1431 argument
1432
1433 * ob-sass.el:
1434 (org-babel-expand-body:sass): Remove obsoleted optional third
1435 argument
1436
1437 * ob-scheme.el:
1438 (org-babel-expand-body:scheme): Remove obsoleted optional third
1439 argument
1440 (org-babel-execute:scheme): Remove obsoleted optional third
1441 argument
1442
1443 * ob-screen.el:
1444 (org-babel-expand-body:screen): Remove obsoleted optional third
1445 argument
1446
1447 * ob-sh.el:
1448 (org-babel-expand-body:sh): Remove obsoleted optional third
1449 argument
1450 (org-babel-execute:sh): Remove obsoleted optional third argument
1451 (org-babel-sh-variable-assignments): Remove obsoleted optional
1452 third
1453
1454 * ob-sql.el:
1455 (org-babel-expand-body:sql): Remove obsoleted optional third
1456 argument
1457
1458 * ob-sqlite.el:
1459 (org-babel-expand-body:sqlite): Remove obsoleted optional third
1460 argument
1461 (org-babel-execute:sqlite): Remove obsoleted optional third
1462 argument
1463
1464 * ob.el:
1465 (org-babel-expand-body:generic): Remove obsoleted optional third
1466 argument.
1467 1363
14682010-11-11 Eric Schulte <schulte.eric@gmail.com> 13642010-11-11 Eric Schulte <schulte.eric@gmail.com>
1469 1365
@@ -1493,7 +1389,7 @@
14932010-11-11 Dan Davison <davison@stats.ox.ac.uk> 13892010-11-11 Dan Davison <davison@stats.ox.ac.uk>
1494 1390
1495 * ob-sh.el (org-babel-sh-variable-assignments): Provide missing 1391 * ob-sh.el (org-babel-sh-variable-assignments): Provide missing
1496 docstring 1392 docstring.
1497 1393
1498 * ob-python.el (org-babel-python-variable-assignments): 1394 * ob-python.el (org-babel-python-variable-assignments):
1499 Provide missing docstring. 1395 Provide missing docstring.
@@ -1589,7 +1485,7 @@
1589 1485
15902010-11-11 Noorul Islam <noorul@noorul.com> 14862010-11-11 Noorul Islam <noorul@noorul.com>
1591 1487
1592 * org-latex.el (org-export-latex-links) : Replaced hard coded 1488 * org-latex.el (org-export-latex-links): Replaced hard coded
1593 hyperref format with custom variable 1489 hyperref format with custom variable
1594 `org-export-latex-hyperref-format'. 1490 `org-export-latex-hyperref-format'.
1595 1491
@@ -1643,7 +1539,7 @@
1643 1539
16442010-11-11 Eric Schulte <schulte.eric@gmail.com> 15402010-11-11 Eric Schulte <schulte.eric@gmail.com>
1645 1541
1646 * ob.el (org-babel-params-from-properties): Max line with at <=80 1542 * ob.el (org-babel-params-from-properties): Max line with at <=80.
1647 1543
16482010-11-11 Eric Schulte <schulte.eric@gmail.com> 15442010-11-11 Eric Schulte <schulte.eric@gmail.com>
1649 1545
@@ -2023,11 +1919,11 @@
2023 1919
20242010-11-11 Jambunathan K <kjambunathan@gmail.com> (tiny change) 19202010-11-11 Jambunathan K <kjambunathan@gmail.com> (tiny change)
2025 1921
2026 * org.el (org-speed-command-hook): New. Hook for installing 1922 * org.el (org-speed-command-hook): New. Hook for installing
2027 additional speed commands. Use this for enabling speed commands on 1923 additional speed commands. Use this for enabling speed commands on
2028 src blocks. 1924 src blocks.
2029 (org-speed-command-default-hook): The default hook for 1925 (org-speed-command-default-hook): The default hook for
2030 org-speed-command-hook. Factored out from org-self-insert-command 1926 org-speed-command-hook. Factored out from org-self-insert-command
2031 and mimics existing behaviour. 1927 and mimics existing behaviour.
2032 (org-self-insert-command): Modified to use org-speed-command-hook. 1928 (org-self-insert-command): Modified to use org-speed-command-hook.
2033 1929
@@ -2091,7 +1987,7 @@
20912010-11-11 Bastien Guerry <bzg@altern.org> 19872010-11-11 Bastien Guerry <bzg@altern.org>
2092 1988
2093 * org-capture.el (org-capture-templates): Update docstring to 1989 * org-capture.el (org-capture-templates): Update docstring to
2094 advertize %:org-date. 1990 advertise %:org-date.
2095 1991
20962010-11-11 Eric Schulte <schulte.eric@gmail.com> 19922010-11-11 Eric Schulte <schulte.eric@gmail.com>
2097 1993
@@ -2168,7 +2064,7 @@
21682010-11-11 Eric Schulte <schulte.eric@gmail.com> 20642010-11-11 Eric Schulte <schulte.eric@gmail.com>
2169 2065
2170 * ob.el (org-babel-demarcate-block): Interactive demarcation of 2066 * ob.el (org-babel-demarcate-block): Interactive demarcation of
2171 code blocks 2067 code blocks.
2172 2068
2173 * ob-keys.el (org-babel-key-bindings): Key bindings for block 2069 * ob-keys.el (org-babel-key-bindings): Key bindings for block
2174 demarcation. 2070 demarcation.
@@ -2223,7 +2119,7 @@
2223 [[elisp:(org-agenda-list)]], org-prepare-agenda erases the buffer 2119 [[elisp:(org-agenda-list)]], org-prepare-agenda erases the buffer
2224 of the file containing the link, since that buffer is current 2120 of the file containing the link, since that buffer is current
2225 during org-prepare agenda (due to a with-current-buffer in 2121 during org-prepare agenda (due to a with-current-buffer in
2226 org-agenda-open-link). An additional test now ensures that the 2122 org-agenda-open-link). An additional test now ensures that the
2227 agenda buffer is in fact current when the buffer is erased and 2123 agenda buffer is in fact current when the buffer is erased and
2228 local variables for the agenda are set. 2124 local variables for the agenda are set.
2229 2125
@@ -2281,7 +2177,7 @@
2281 2177
22822010-11-11 Eric Schulte <schulte.eric@gmail.com> 21782010-11-11 Eric Schulte <schulte.eric@gmail.com>
2283 2179
2284 * ob-C.el (org): No longer requires org 2180 * ob-C.el (org): No longer requires org.
2285 2181
2286 * ob-ledger.el (org): No longer requires org. 2182 * ob-ledger.el (org): No longer requires org.
2287 2183
@@ -2345,7 +2241,7 @@
23452010-11-11 Eric Schulte <schulte.eric@gmail.com> 22412010-11-11 Eric Schulte <schulte.eric@gmail.com>
2346 2242
2347 * ob-keys.el (org-babel-key-bindings): Adding key-binding for 2243 * ob-keys.el (org-babel-key-bindings): Adding key-binding for
2348 `org-babel-goto-src-block-head' 2244 `org-babel-goto-src-block-head'.
2349 2245
2350 * ob.el (org-babel-goto-src-block-head): Jump to the head of the 2246 * ob.el (org-babel-goto-src-block-head): Jump to the head of the
2351 current code block. 2247 current code block.
@@ -2353,7 +2249,7 @@
23532010-11-11 Eric Schulte <schulte.eric@gmail.com> 22492010-11-11 Eric Schulte <schulte.eric@gmail.com>
2354 2250
2355 * ob.el (org-babel-next-src-block): Now raising more informative 2251 * ob.el (org-babel-next-src-block): Now raising more informative
2356 error when no further code blocks can be found 2252 error when no further code blocks can be found.
2357 (org-babel-previous-src-block): Now raising more informative error 2253 (org-babel-previous-src-block): Now raising more informative error
2358 when no previous code blocks can be found. 2254 when no previous code blocks can be found.
2359 2255
@@ -2365,7 +2261,7 @@
2365 2261
23662010-11-11 Eric Schulte <schulte.eric@gmail.com> 22622010-11-11 Eric Schulte <schulte.eric@gmail.com>
2367 2263
2368 * ob-plantuml.el (org-babel-execute:plantuml): 2264 * ob-plantuml.el (org-babel-execute:plantuml): ????
2369 2265
23702010-11-11 Dan Davison <davison@stats.ox.ac.uk> 22662010-11-11 Dan Davison <davison@stats.ox.ac.uk>
2371 2267
@@ -2464,7 +2360,7 @@
24642010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 23602010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2465 2361
2466 * org-list.el (org-toggle-checkbox): Ignore items in drawers when 2362 * org-list.el (org-toggle-checkbox): Ignore items in drawers when
2467 used from an heading. Send an error when no item is in region. 2363 used from an heading. Send an error when no item is in region.
2468 2364
24692010-11-11 Dan Davison <davison@stats.ox.ac.uk> 23652010-11-11 Dan Davison <davison@stats.ox.ac.uk>
2470 2366
@@ -2517,7 +2413,7 @@
25172010-11-11 Dan Davison <davison@stats.ox.ac.uk> 24132010-11-11 Dan Davison <davison@stats.ox.ac.uk>
2518 2414
2519 * org.el (org-fontify-meta-lines-and-blocks): Alter main regexp to 2415 * org.el (org-fontify-meta-lines-and-blocks): Alter main regexp to
2520 match code blocks with switches and header args. Call 2416 match code blocks with switches and header args. Call
2521 `org-src-font-lock-fontify-block' for automatic fontification of 2417 `org-src-font-lock-fontify-block' for automatic fontification of
2522 code in code blocks, controlled by variable 2418 code in code blocks, controlled by variable
2523 `org-src-fontify-natively'. 2419 `org-src-fontify-natively'.
@@ -2530,14 +2426,14 @@
2530 2426
25312010-11-11 Noorul Islam <noorul@noorul.com> (tiny change) 24272010-11-11 Noorul Islam <noorul@noorul.com> (tiny change)
2532 2428
2533 * org-html.el (org-html-make-link): (Expand-file-name ) removes 2429 * org-html.el (org-html-make-link): (expand-file-name) removes
2534 one "/" from "///path-to-file", so add one. Anything other than 2430 one "/" from "///path-to-file", so add one. Anything other than
2535 'file' type should be exported along with the type. 2431 'file' type should be exported along with the type.
2536 2432
25372010-11-11 Noorul Islam <noorul@noorul.com> (tiny change) 24332010-11-11 Noorul Islam <noorul@noorul.com> (tiny change)
2538 2434
2539 * org.el (org-insert-subheading) : Fix compiler warning 2435 * org.el (org-insert-subheading): Fix compiler warning
2540 (org-insert-todo-subheading) : Fix compiler warning. 2436 (org-insert-todo-subheading): Fix compiler warning.
2541 2437
25422010-11-11 Carsten Dominik <carsten.dominik@gmail.com> 24382010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
2543 2439
@@ -2578,7 +2474,7 @@
2578 2474
2579 * org.el (org-indent-line-function): Indentation of source block 2475 * org.el (org-indent-line-function): Indentation of source block
2580 is left to `org-edit-src-exit' and shouldn't be modified by 2476 is left to `org-edit-src-exit' and shouldn't be modified by
2581 `org-indent-line-function'. Indentation of others blocks should be 2477 `org-indent-line-function'. Indentation of others blocks should be
2582 the same as the #+begin line. 2478 the same as the #+begin line.
2583 2479
25842010-11-11 Dan Davison <davison@stats.ox.ac.uk> 24802010-11-11 Dan Davison <davison@stats.ox.ac.uk>
@@ -2610,7 +2506,7 @@
26102010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 25062010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2611 2507
2612 * org-list.el (org-list-ending-method): New customizable variable 2508 * org-list.el (org-list-ending-method): New customizable variable
2613 to tell Org Mode how lists end. See docstring. 2509 to tell Org Mode how lists end. See docstring.
2614 2510
26152010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 25112010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2616 2512
@@ -2649,14 +2545,14 @@
2649 2545
2650 * org-list.el (org-list-insert-item-generic): A single item 2546 * org-list.el (org-list-insert-item-generic): A single item
2651 already counting blank lines in his body should be separated with 2547 already counting blank lines in his body should be separated with
2652 the next one by a blank line. Moreover, if user already provided 2548 the next one by a blank line. Moreover, if user already provided
2653 blank lines, follow his wishes. 2549 blank lines, follow his wishes.
2654 2550
26552010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 25512010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2656 2552
2657 * org-list.el (org-indent-item-tree): When moving top item of a 2553 * org-list.el (org-indent-item-tree): When moving top item of a
2658 *-list to column 0, only the first item had its bullet changed to 2554 *-list to column 0, only the first item had its bullet changed to
2659 -. It now changes all items of the top-level list, as expected. 2555 -. It now changes all items of the top-level list, as expected.
2660 2556
26612010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 25572010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2662 2558
@@ -2687,12 +2583,12 @@
2687 change. 2583 change.
2688 2584
2689 * org-list.el (org-indent-item-tree): Prevent whole list from 2585 * org-list.el (org-indent-item-tree): Prevent whole list from
2690 being moved when user is not moving subtree. Thus) 2586 being moved when user is not moving subtree. Thus
2691 (`org-cycle-item-indentation' will not allow to move the list. 2587 `org-cycle-item-indentation' will not allow to move the list.
2692 2588
26932010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 25892010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2694 2590
2695 * org-list.el (org-indent-item-tree): Remove region code. It was 2591 * org-list.el (org-indent-item-tree): Remove region code. It was
2696 prone to errors and undocumented. 2592 prone to errors and undocumented.
2697 2593
2698 * org-list.el (org-item-indent-positions): Better heuristics to 2594 * org-list.el (org-item-indent-positions): Better heuristics to
@@ -2708,7 +2604,7 @@
2708 * org-list.el (org-list-bullet-string): Do not modify match-data. 2604 * org-list.el (org-list-bullet-string): Do not modify match-data.
2709 2605
2710 * org.el (org-toggle-item): Now working again when changing list 2606 * org.el (org-toggle-item): Now working again when changing list
2711 items into plain text. Moreover take into consideration 2607 items into plain text. Moreover take into consideration
2712 `org-list-two-spaces-after-bullet-regexp'. 2608 `org-list-two-spaces-after-bullet-regexp'.
2713 2609
27142010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 26102010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2723,11 +2619,10 @@
27232010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 26192010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2724 2620
2725 * org-docbook.el (org-export-as-docbook): Use override="num" in 2621 * org-docbook.el (org-export-as-docbook): Use override="num" in
2726 any listitem matching [@start:num] 2622 any listitem matching [@start:num].
2727 2623
2728 * org-html.el (org-export-as-html): Use value="num" in any li 2624 * org-html.el (org-export-as-html): Use value="num" in any li
2729 matching 2625 matching [@start:num].
2730 [@start:num]
2731 2626
27322010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 26272010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2733 2628
@@ -2803,14 +2698,14 @@
28032010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 26982010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2804 2699
2805 * org-list.el (org-indent-item-tree): Try to keep relative 2700 * org-list.el (org-indent-item-tree): Try to keep relative
2806 position on line. It can't if point is in white spaces before 2701 position on line. It can't if point is in white spaces before
2807 bullet because mixed tabs and spaces make some columns 2702 bullet because mixed tabs and spaces make some columns
2808 unattainable. 2703 unattainable.
2809 2704
28102010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 27052010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2811 2706
2812 * org-list.el (org-cycle-item-indentation): Cycle when the whole 2707 * org-list.el (org-cycle-item-indentation): Cycle when the whole
2813 item only contains bullet and maybe a checkbox. Previously, TAB 2708 item only contains bullet and maybe a checkbox. Previously, TAB
2814 would cycle when the first line of the item was blank. 2709 would cycle when the first line of the item was blank.
2815 2710
28162010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 27112010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2843,7 +2738,7 @@
2843 2738
2844 * org-list.el (org-indent-item-tree): If indent rule is activated, 2739 * org-list.el (org-indent-item-tree): If indent rule is activated,
2845 it should be impossible to outdent an item having children without 2740 it should be impossible to outdent an item having children without
2846 moving its subtree. Improved reordering of lists modified by 2741 moving its subtree. Improved reordering of lists modified by
2847 cycling indentation. 2742 cycling indentation.
2848 2743
28492010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 27442010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2864,7 +2759,7 @@
28642010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 27592010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2865 2760
2866 * org-list.el (org-list-insert-item-generic): When local search 2761 * org-list.el (org-list-insert-item-generic): When local search
2867 doesn't help, search the list globally for blank lines. Moreover, 2762 doesn't help, search the list globally for blank lines. Moreover,
2868 don't bother with new lists, and add 1 blank line. 2763 don't bother with new lists, and add 1 blank line.
2869 2764
28702010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 27652010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2888,7 +2783,7 @@
2888 heading. 2783 heading.
2889 2784
2890 * org-list.el (org-list-make-subtree): Add protection when used 2785 * org-list.el (org-list-make-subtree): Add protection when used
2891 outside of list 2786 outside of list.
2892 2787
2893 * org-list.el (org-insert-item): Remove useless hack now 2788 * org-list.el (org-insert-item): Remove useless hack now
2894 `org-in-item-p' is fixed. 2789 `org-in-item-p' is fixed.
@@ -2899,7 +2794,7 @@
28992010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 27942010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2900 2795
2901 * org-list.el (org-cycle-list-bullet): Prevent description items 2796 * org-list.el (org-cycle-list-bullet): Prevent description items
2902 from being numbered. String argument is also recognized now, as 2797 from being numbered. String argument is also recognized now, as
2903 long as it is a valid bullet. 2798 long as it is a valid bullet.
2904 2799
29052010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 28002010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -2968,8 +2863,8 @@
2968 2863
29692010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 28642010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
2970 2865
2971 * org-timer.el (org-timer-item): Refactoring. Compute timer string 2866 * org-timer.el (org-timer-item): Refactoring. Compute timer string
2972 before inserting it in the buffer 2867 before inserting it in the buffer.
2973 2868
2974 * org-timer.el (org-timer): Add an optional argument to return 2869 * org-timer.el (org-timer): Add an optional argument to return
2975 timer string instead of inserting it. 2870 timer string instead of inserting it.
@@ -3001,8 +2896,8 @@
3001 a list prior to add a new item. 2896 a list prior to add a new item.
3002 2897
3003 * org-timer.el (org-timer-item): When in a timer list, insert a 2898 * org-timer.el (org-timer-item): When in a timer list, insert a
3004 new timer item like `org-insert-item'. If in another list, send an 2899 new timer item like `org-insert-item'. If in another list, send an
3005 error. Otherwise, start a new timer list. 2900 error. Otherwise, start a new timer list.
3006 2901
30072010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 29022010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
3008 2903
@@ -3047,7 +2942,7 @@
3047 2942
3048 * org-list.el (org-list-send-list): We cannot count on 2943 * org-list.el (org-list-send-list): We cannot count on
3049 `org-list-top-point' and `org-list-bottom-point' before buffer is 2944 `org-list-top-point' and `org-list-bottom-point' before buffer is
3050 narrowed. Find bounds of list otherwise. 2945 narrowed. Find bounds of list otherwise.
3051 2946
30522010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 29472010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
3053 2948
@@ -3083,7 +2978,7 @@
30832010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 29782010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
3084 2979
3085 * org-docbook.el (org-export-as-docbook): Properly close any open 2980 * org-docbook.el (org-export-as-docbook): Properly close any open
3086 list when seeing ORG-LIST-END. Removed any reference to now 2981 list when seeing ORG-LIST-END. Removed any reference to now
3087 unneeded DIDCLOSE variable. 2982 unneeded DIDCLOSE variable.
3088 2983
30892010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 29842010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
@@ -3121,7 +3016,7 @@
3121 recognize lists. 3016 recognize lists.
3122 3017
3123 * org-latex.el (org-export-latex-lists): Better search for 3018 * org-latex.el (org-export-latex-lists): Better search for
3124 lists. It now only finds items not enclosed and not protected. 3019 lists. It now only finds items not enclosed and not protected.
3125 3020
31262010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 30212010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
3127 3022
@@ -3156,10 +3051,10 @@
31562010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 30512010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
3157 3052
3158 * org-list.el (org-search-forward-unenclosed): Fix behavior when 3053 * org-list.el (org-search-forward-unenclosed): Fix behavior when
3159 last occurence was enclosed. 3054 last occurrence was enclosed.
3160 3055
3161 * org-list.el (org-search-backward-unenclosed): Fix behavior when 3056 * org-list.el (org-search-backward-unenclosed): Fix behavior when
3162 last occurence was enclosed. 3057 last occurrence was enclosed.
3163 3058
31642010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 30592010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
3165 3060
@@ -3195,8 +3090,8 @@
3195 3090
31962010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 30912010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
3197 3092
3198 * org-html.el: preprocess buffer string and add ORG-LIST-END where 3093 * org-html.el: Preprocess buffer string and add ORG-LIST-END where
3199 needed. Lists should not end before seeing this. 3094 needed. Lists should not end before seeing this.
3200 3095
32012010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 30962010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
3202 3097
@@ -3269,7 +3164,7 @@
3269 to evaluate code invisibly and block until output file exists. 3164 to evaluate code invisibly and block until output file exists.
3270 3165
3271 * ob-R.el (org-babel-R-evaluate-session): Use `ess-eval-buffer' to 3166 * ob-R.el (org-babel-R-evaluate-session): Use `ess-eval-buffer' to
3272 evaluate R code in session for :results value. Write result to 3167 evaluate R code in session for :results value. Write result to
3273 file invisibly using new function 3168 file invisibly using new function
3274 `org-babel-comint-eval-invisibly-and-wait-for-file'. 3169 `org-babel-comint-eval-invisibly-and-wait-for-file'.
3275 3170
@@ -3298,7 +3193,7 @@
32982010-11-11 Eric Schulte <schulte.eric@gmail.com> 31932010-11-11 Eric Schulte <schulte.eric@gmail.com>
3299 3194
3300 * ob-scheme.el: very preliminary support for evaluating scheme 3195 * ob-scheme.el: very preliminary support for evaluating scheme
3301 code blocks 3196 code blocks.
3302 3197
3303 * org.el (org-babel-load-languages): Adding scheme. 3198 * org.el (org-babel-load-languages): Adding scheme.
3304 3199
@@ -3308,16 +3203,15 @@
3308 3203
33092010-11-11 Eric Schulte <schulte.eric@gmail.com> 32042010-11-11 Eric Schulte <schulte.eric@gmail.com>
3310 3205
3311 * ob-R.el (ess-make-buffer-current): 3206 * ob-R.el (ess-make-buffer-current): Declared.
3312 Declared (ess-ask-for-ess-directory): 3207 (ess-ask-for-ess-directory): Declared.
3313 Declared (ess-local-process-name): 3208 (ess-local-process-name): Declared.
3314 Declared * ob-latex.el (org-babel-latex-tex-to-pdf): Capturing free 3209 * ob-latex.el (org-babel-latex-tex-to-pdf): Capturing free variable.
3315 variable
3316 3210
3317 * ob.el (org-edit-src-code): Fixing arguments 3211 * ob.el (org-edit-src-code): Fixing arguments.
3318 (org-edit-src-exit): 3212 (org-edit-src-exit): Declared.
3319 Declared (org-outline-overlay-data): 3213 (org-outline-overlay-data): Declared.
3320 Declared (org-set-outline-overlay-data): Declared. 3214 (org-set-outline-overlay-data): Declared.
3321 3215
33222010-11-11 Glenn Morris <rgm@gnu.org> 32162010-11-11 Glenn Morris <rgm@gnu.org>
3323 3217
@@ -3365,7 +3259,7 @@
33652010-11-11 Eric Schulte <schulte.eric@gmail.com> 32592010-11-11 Eric Schulte <schulte.eric@gmail.com>
3366 3260
3367 * ob-exp.el (org-babel-exp-do-export): Remove hacky ":noeval", 3261 * ob-exp.el (org-babel-exp-do-export): Remove hacky ":noeval",
3368 which is now an alias to ":eval no" 3262 which is now an alias to ":eval no".
3369 3263
33702010-11-11 Eric Schulte <schulte.eric@gmail.com> 32642010-11-11 Eric Schulte <schulte.eric@gmail.com>
3371 3265
@@ -3548,7 +3442,7 @@
3548 * ob.el (org-babel-do-in-edit-buffer): New macro to evaluate lisp 3442 * ob.el (org-babel-do-in-edit-buffer): New macro to evaluate lisp
3549 in the language major mode edit buffer. 3443 in the language major mode edit buffer.
3550 (org-babel-do-key-sequence-in-edit-buffer): New function to call 3444 (org-babel-do-key-sequence-in-edit-buffer): New function to call
3551 an arbitrary key sequence in the language major mode edit buffer 3445 an arbitrary key sequence in the language major mode edit buffer.
3552 3446
3553 * org-src.el (org-src-switch-to-buffer): Add new allowed value 3447 * org-src.el (org-src-switch-to-buffer): Add new allowed value
3554 'switch-invisibly for `org-src-window-setup'. 3448 'switch-invisibly for `org-src-window-setup'.
@@ -3574,7 +3468,7 @@
3574 * org-src.el (org-edit-src-code): If at src block, store babel 3468 * org-src.el (org-edit-src-code): If at src block, store babel
3575 info as buffer local variable. 3469 info as buffer local variable.
3576 (org-src-associate-babel-session): New function to associate code 3470 (org-src-associate-babel-session): New function to associate code
3577 edit buffer with comint session. Does nothing unless a 3471 edit buffer with comint session. Does nothing unless a
3578 language-specific function named 3472 language-specific function named
3579 `org-babel-LANG-associate-session' exists. 3473 `org-babel-LANG-associate-session' exists.
3580 (org-src-babel-configure-edit-buffer): New function to be called 3474 (org-src-babel-configure-edit-buffer): New function to be called
@@ -3712,7 +3606,7 @@
3712 3606
37132010-11-11 Noorul Islam <noorul@noorul.com> 36072010-11-11 Noorul Islam <noorul@noorul.com>
3714 3608
3715 * org.el: org-set-visibility-according-to-property () Use backward 3609 * org.el (org-set-visibility-according-to-property): Use backward
3716 search instead of forward, so that top hierarchy gets priority. 3610 search instead of forward, so that top hierarchy gets priority.
3717 3611
37182010-11-11 Carsten Dominik <carsten.dominik@gmail.com> 36122010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
@@ -3798,7 +3692,7 @@
37982010-11-11 Dan Davison <davison@stats.ox.ac.uk> 36922010-11-11 Dan Davison <davison@stats.ox.ac.uk>
3799 3693
3800 * ob-octave.el: Only (require 'matlab) when necessary. 3694 * ob-octave.el: Only (require 'matlab) when necessary.
3801 (org-babel-octave-initiate-session) (require) octave-inf or matlab 3695 (org-babel-octave-initiate-session): (require) octave-inf or matlab
3802 as appropriate. 3696 as appropriate.
3803 (org-babel-execute:matlab): Remove (require). 3697 (org-babel-execute:matlab): Remove (require).
3804 (org-babel-prep-session:matlab): Remove (require). 3698 (org-babel-prep-session:matlab): Remove (require).
@@ -3816,7 +3710,7 @@
3816 3710
38172010-11-11 Nicolas Goaziou <n.goaziou@gmail.com> 37112010-11-11 Nicolas Goaziou <n.goaziou@gmail.com>
3818 3712
3819 * org-latex.el (org-export-latex-tables): Add label if any 3713 * org-latex.el (org-export-latex-tables): Add label if any.
3820 3714
3821 * org-latex.el (org-export-latex-convert-table.el-table): 3715 * org-latex.el (org-export-latex-convert-table.el-table):
3822 Fix little mistake when inserting label. 3716 Fix little mistake when inserting label.
@@ -7317,7 +7211,7 @@
7317 New customization variable for allowing the user to create an "auto 7211 New customization variable for allowing the user to create an "auto
7318 exclusion" filter for doing context-aware auto tag filtering. 7212 exclusion" filter for doing context-aware auto tag filtering.
7319 (org-agenda-filter-by-tag): Changes to support the use of 7213 (org-agenda-filter-by-tag): Changes to support the use of
7320 `org-agenda-auto-exclude-function'. See the new manual addition,. 7214 `org-agenda-auto-exclude-function'. See the new manual addition.
7321 7215
73222009-11-13 John Wiegley <johnw@newartisans.com> 72162009-11-13 John Wiegley <johnw@newartisans.com>
7323 7217
@@ -9387,7 +9281,7 @@
9387 (org-export-latex-first-lines): New argument END, to force the end 9281 (org-export-latex-first-lines): New argument END, to force the end
9388 of the region. 9282 of the region.
9389 (org-export-region-as-latex): Use the property list. 9283 (org-export-region-as-latex): Use the property list.
9390 (org-export-as-latex): 9284 (org-export-as-latex): ????
9391 9285
9392 * org-colview-xemacs.el (org-columns-remove-overlays) 9286 * org-colview-xemacs.el (org-columns-remove-overlays)
9393 (org-columns): Fix call to `local-variable-p'. 9287 (org-columns): Fix call to `local-variable-p'.
@@ -11761,7 +11655,7 @@
11761 11655
117622008-10-26 Carsten Dominik <dominik@science.uva.nl> 116562008-10-26 Carsten Dominik <dominik@science.uva.nl>
11763 11657
11764 * org-agenda.el (org-agenda-filter-tags,org-agenda-filter-form): 11658 * org-agenda.el (org-agenda-filter-tags, org-agenda-filter-form):
11765 New variables. 11659 New variables.
11766 (org-prepare-agenda): Reset the filter tags. 11660 (org-prepare-agenda): Reset the filter tags.
11767 (org-agenda-filter-by-tag, org-agenda-filter-by-tag-show-all): 11661 (org-agenda-filter-by-tag, org-agenda-filter-by-tag-show-all):
@@ -12868,7 +12762,7 @@
12868 12762
12869 * org.el (org-base-buffer): New function. 12763 * org.el (org-base-buffer): New function.
12870 12764
12871 * org-exp.el (org-icalendar-cleanup-string): Make sure '," 12765 * org-exp.el (org-icalendar-cleanup-string): Make sure ","
12872 and ";" are escaped. 12766 and ";" are escaped.
12873 (org-print-icalendar-entries): Also apply 12767 (org-print-icalendar-entries): Also apply
12874 `org-icalendar-cleanup-string' to the headline, not only to the 12768 `org-icalendar-cleanup-string' to the headline, not only to the
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index 2f64b8b0bb6..b979097dee3 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -519,7 +519,8 @@ When CHECK is given, prepare detailed information about duplicate IDs."
519 (puthash id (abbreviate-file-name file) org-id-locations) 519 (puthash id (abbreviate-file-name file) org-id-locations)
520 (add-to-list 'org-id-files (abbreviate-file-name file)))) 520 (add-to-list 'org-id-files (abbreviate-file-name file))))
521 521
522(add-hook 'kill-emacs-hook 'org-id-locations-save) 522(unless noninteractive
523 (add-hook 'kill-emacs-hook 'org-id-locations-save))
523 524
524(defun org-id-hash-to-alist (hash) 525(defun org-id-hash-to-alist (hash)
525 "Turn an org-id hash into an alist, so that it can be written to a file." 526 "Turn an org-id hash into an alist, so that it can be written to a file."
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 8f1ef9e5d60..076df5f0d07 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -1078,7 +1078,7 @@ for the duration of the command."
1078 (plain-list-item . auto)) 1078 (plain-list-item . auto))
1079 "Should `org-insert-heading' leave a blank line before new heading/item? 1079 "Should `org-insert-heading' leave a blank line before new heading/item?
1080The value is an alist, with `heading' and `plain-list-item' as car, 1080The value is an alist, with `heading' and `plain-list-item' as car,
1081and a boolean flag as cdr. The cdr may lso be the symbol `auto', and then 1081and a boolean flag as cdr. The cdr may lso be the symbol `auto', and then
1082Org will look at the surrounding headings/items and try to make an 1082Org will look at the surrounding headings/items and try to make an
1083intelligent decision wether to insert a blank line or not. 1083intelligent decision wether to insert a blank line or not.
1084 1084
@@ -1384,9 +1384,9 @@ nil Never use an ID to make a link, instead link using a text search for
1384(defcustom org-context-in-file-links t 1384(defcustom org-context-in-file-links t
1385 "Non-nil means file links from `org-store-link' contain context. 1385 "Non-nil means file links from `org-store-link' contain context.
1386A search string will be added to the file name with :: as separator and 1386A search string will be added to the file name with :: as separator and
1387used to find the context when the link is activated by the command 1387used to find the context when the link is activated by the command
1388`org-open-at-point'. When this option is t, the entire active region 1388`org-open-at-point'. When this option is t, the entire active region
1389will be placed in the search string of the file link. If set to a 1389will be placed in the search string of the file link. If set to a
1390positive integer, only the first n lines of context will be stored. 1390positive integer, only the first n lines of context will be stored.
1391 1391
1392Using a prefix arg to the command \\[org-store-link] (`org-store-link') 1392Using a prefix arg to the command \\[org-store-link] (`org-store-link')
@@ -1843,7 +1843,7 @@ This is list of cons cells. Each cell contains:
1843 - a cons cell (:level . N). Any headline of level N is considered a target. 1843 - a cons cell (:level . N). Any headline of level N is considered a target.
1844 Note that, when `org-odd-levels-only' is set, level corresponds to 1844 Note that, when `org-odd-levels-only' is set, level corresponds to
1845 order in hierarchy, not to the number of stars. 1845 order in hierarchy, not to the number of stars.
1846 - a cons cell (:maxlevel . N). Any headline with level <= N is a target. 1846 - a cons cell (:maxlevel . N). Any headline with level <= N is a target.
1847 Note that, when `org-odd-levels-only' is set, level corresponds to 1847 Note that, when `org-odd-levels-only' is set, level corresponds to
1848 order in hierarchy, not to the number of stars. 1848 order in hierarchy, not to the number of stars.
1849 1849
@@ -2418,7 +2418,7 @@ An auto-repeating task is immediately switched back to TODO when
2418marked DONE. If you are not logging state changes (by adding \"@\" 2418marked DONE. If you are not logging state changes (by adding \"@\"
2419or \"!\" to the TODO keyword definition), or set `org-log-done' to 2419or \"!\" to the TODO keyword definition), or set `org-log-done' to
2420record a closing note, there will be no record of the task moving 2420record a closing note, there will be no record of the task moving
2421through DONE. This variable forces taking a note anyway. 2421through DONE. This variable forces taking a note anyway.
2422 2422
2423nil Don't force a record 2423nil Don't force a record
2424time Record a time stamp 2424time Record a time stamp
@@ -2624,8 +2624,8 @@ See also `org-agenda-jump-prefer-future'."
2624The default is to do the same as configured in `org-read-date-prefer-future'. 2624The default is to do the same as configured in `org-read-date-prefer-future'.
2625But you can alse set a deviating value here. 2625But you can alse set a deviating value here.
2626This may t or nil, or the symbol `org-read-date-prefer-future'." 2626This may t or nil, or the symbol `org-read-date-prefer-future'."
2627 :group 'org-agenda 2627 :group 'org-agenda
2628 :group 'org-time 2628 :group 'org-time
2629 :type '(choice 2629 :type '(choice
2630 (const :tag "Use org-read-date-prefer-future" 2630 (const :tag "Use org-read-date-prefer-future"
2631 org-read-date-prefer-future) 2631 org-read-date-prefer-future)
@@ -5575,7 +5575,7 @@ needs to be inserted at a specific position in the font-lock sequence.")
5575 (org-set-local 'org-pretty-entities (not org-pretty-entities)) 5575 (org-set-local 'org-pretty-entities (not org-pretty-entities))
5576 (org-restart-font-lock) 5576 (org-restart-font-lock)
5577 (if org-pretty-entities 5577 (if org-pretty-entities
5578 (message "Entities are displayed as UTF8 characers") 5578 (message "Entities are displayed as UTF8 characters")
5579 (save-restriction 5579 (save-restriction
5580 (widen) 5580 (widen)
5581 (org-decompose-region (point-min) (point-max)) 5581 (org-decompose-region (point-min) (point-max))
@@ -8525,9 +8525,9 @@ according to FMT (default from `org-email-link-description-format')."
8525 (when (and string (integerp lines) (> lines 0)) 8525 (when (and string (integerp lines) (> lines 0))
8526 (let ((slines (org-split-string s "\n"))) 8526 (let ((slines (org-split-string s "\n")))
8527 (when (< lines (length slines)) 8527 (when (< lines (length slines))
8528 (setq s (mapconcat 8528 (setq s (mapconcat
8529 'identity 8529 'identity
8530 (reverse (nthcdr (- (length slines) lines) 8530 (reverse (nthcdr (- (length slines) lines)
8531 (reverse slines))) "\n"))))) 8531 (reverse slines))) "\n")))))
8532 (mapconcat 'identity (org-split-string s "[ \t]+") " "))) 8532 (mapconcat 'identity (org-split-string s "[ \t]+") " ")))
8533 8533
@@ -8672,8 +8672,8 @@ be displayed in the buffer instead of the link.
8672If there is already a link at point, this command will allow you to edit link 8672If there is already a link at point, this command will allow you to edit link
8673and description parts. 8673and description parts.
8674 8674
8675With a \\[universal-argument] prefix, prompts for a file to link to. The file name can 8675With a \\[universal-argument] prefix, prompts for a file to link to. The file name can
8676be selected using completion. The path to the file will be relative to the 8676be selected using completion. The path to the file will be relative to the
8677current directory if the file is in the current directory or a subdirectory. 8677current directory if the file is in the current directory or a subdirectory.
8678Otherwise, the link will be the absolute path as completed in the minibuffer 8678Otherwise, the link will be the absolute path as completed in the minibuffer
8679\(i.e. normally ~/path/to/file). You can configure this behavior using the 8679\(i.e. normally ~/path/to/file). You can configure this behavior using the
@@ -16498,8 +16498,8 @@ If not, return to the original position and throw an error."
16498 16498
16499(defun org-speed-command-default-hook (keys) 16499(defun org-speed-command-default-hook (keys)
16500 "Hook for activating single-letter speed commands. 16500 "Hook for activating single-letter speed commands.
16501`org-speed-commands-default' specifies a minimal command set. Use 16501`org-speed-commands-default' specifies a minimal command set.
16502`org-speed-commands-user' for further customization." 16502Use `org-speed-commands-user' for further customization."
16503 (when (or (and (bolp) (looking-at outline-regexp)) 16503 (when (or (and (bolp) (looking-at outline-regexp))
16504 (and (functionp org-use-speed-commands) 16504 (and (functionp org-use-speed-commands)
16505 (funcall org-use-speed-commands))) 16505 (funcall org-use-speed-commands)))
@@ -16521,11 +16521,11 @@ Each hook takes a single argument, a user-pressed command key
16521which is also a `self-insert-command' from the global map. 16521which is also a `self-insert-command' from the global map.
16522 16522
16523Within the hook, examine the cursor position and the command key 16523Within the hook, examine the cursor position and the command key
16524and return nil or a valid handler as appropriate. Handler could 16524and return nil or a valid handler as appropriate. Handler could
16525be one of an interactive command, a function, or a form. 16525be one of an interactive command, a function, or a form.
16526 16526
16527Set `org-use-speed-commands' to non-nil value to enable this 16527Set `org-use-speed-commands' to non-nil value to enable this
16528hook. The default setting is `org-speed-command-default-hook'." 16528hook. The default setting is `org-speed-command-default-hook'."
16529 :group 'org-structure 16529 :group 'org-structure
16530 :type 'hook) 16530 :type 'hook)
16531 16531
@@ -18300,11 +18300,11 @@ really on, so that the block visually is on the match."
18300(defun org-in-regexps-block-p (start-re end-re &optional bound) 18300(defun org-in-regexps-block-p (start-re end-re &optional bound)
18301 "Return t if the current point is between matches of START-RE and END-RE. 18301 "Return t if the current point is between matches of START-RE and END-RE.
18302This will also return t if point is on one of the two matches or 18302This will also return t if point is on one of the two matches or
18303in an unfinished block. END-RE can be a string or a form 18303in an unfinished block. END-RE can be a string or a form
18304returning a string. 18304returning a string.
18305 18305
18306An optional third argument bounds the search for START-RE. It 18306An optional third argument bounds the search for START-RE.
18307defaults to previous heading or `point-min'." 18307It defaults to previous heading or `point-min'."
18308 (let ((pos (point)) 18308 (let ((pos (point))
18309 (limit (or bound (save-excursion (outline-previous-heading))))) 18309 (limit (or bound (save-excursion (outline-previous-heading)))))
18310 (save-excursion 18310 (save-excursion
@@ -19040,7 +19040,7 @@ plainly yank the text as it is.
19040 "Perform some yank-like command. 19040 "Perform some yank-like command.
19041 19041
19042This function implements the behavior described in the `org-yank' 19042This function implements the behavior described in the `org-yank'
19043documentation. However, it has been generalized to work for any 19043documentation. However, it has been generalized to work for any
19044interactive command with similar behavior." 19044interactive command with similar behavior."
19045 19045
19046 ;; pretend to be command COMMAND 19046 ;; pretend to be command COMMAND
@@ -19247,7 +19247,7 @@ move point."
19247 19247
19248(defun org-goto-first-child () 19248(defun org-goto-first-child ()
19249 "Goto the first child, even if it is invisible. 19249 "Goto the first child, even if it is invisible.
19250Return t when a child was found. Otherwise don't move point and 19250Return t when a child was found. Otherwise don't move point and
19251return nil." 19251return nil."
19252 (let (level (pos (point)) (re (concat "^" outline-regexp))) 19252 (let (level (pos (point)) (re (concat "^" outline-regexp)))
19253 (when (condition-case nil (org-back-to-heading t) (error nil)) 19253 (when (condition-case nil (org-back-to-heading t) (error nil))
diff --git a/lisp/outline.el b/lisp/outline.el
index d43afd94a3c..cedc55b3336 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -50,9 +50,9 @@ Note that Outline mode only checks this regexp at the start of a line,
50so the regexp need not (and usually does not) start with `^'. 50so the regexp need not (and usually does not) start with `^'.
51The recommended way to set this is with a Local Variables: list 51The recommended way to set this is with a Local Variables: list
52in the file it applies to. See also `outline-heading-end-regexp'." 52in the file it applies to. See also `outline-heading-end-regexp'."
53 :type '(choice regexp (const nil)) 53 :type 'regexp
54 :group 'outlines) 54 :group 'outlines)
55;;;###autoload(put 'outline-regexp 'safe-local-variable 'string-or-null-p) 55;;;###autoload(put 'outline-regexp 'safe-local-variable 'stringp)
56 56
57(defcustom outline-heading-end-regexp "\n" 57(defcustom outline-heading-end-regexp "\n"
58 "Regular expression to match the end of a heading line. 58 "Regular expression to match the end of a heading line.
@@ -62,6 +62,7 @@ The recommended way to set this is with a `Local Variables:' list
62in the file it applies to." 62in the file it applies to."
63 :type 'regexp 63 :type 'regexp
64 :group 'outlines) 64 :group 'outlines)
65;;;###autoload(put 'outline-heading-end-regexp 'safe-local-variable 'stringp)
65 66
66(defvar outline-mode-prefix-map 67(defvar outline-mode-prefix-map
67 (let ((map (make-sparse-keymap))) 68 (let ((map (make-sparse-keymap)))
diff --git a/lisp/password-cache.el b/lisp/password-cache.el
index 8738aa65a9f..941428d5291 100644
--- a/lisp/password-cache.el
+++ b/lisp/password-cache.el
@@ -76,6 +76,13 @@ regulate cache behavior."
76 key 76 key
77 (symbol-value (intern-soft key password-data)))) 77 (symbol-value (intern-soft key password-data))))
78 78
79;;;###autoload
80(defun password-in-cache-p (key)
81 "Check if KEY is in the cache."
82 (and password-cache
83 key
84 (intern-soft key password-data)))
85
79(defun password-read (prompt &optional key) 86(defun password-read (prompt &optional key)
80 "Read password, for use with KEY, from user, or from cache if wanted. 87 "Read password, for use with KEY, from user, or from cache if wanted.
81KEY indicate the purpose of the password, so the cache can 88KEY indicate the purpose of the password, so the cache can
diff --git a/lisp/printing.el b/lisp/printing.el
index 99ed8c04262..e66cca25933 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -5707,8 +5707,8 @@ If menu binding was not done, calls `pr-menu-bind'."
5707 (let* ((dir-name (file-name-directory (or (buffer-file-name) 5707 (let* ((dir-name (file-name-directory (or (buffer-file-name)
5708 default-directory))) 5708 default-directory)))
5709 (fmt-prompt (concat "%s[" mess "] Directory to print: ")) 5709 (fmt-prompt (concat "%s[" mess "] Directory to print: "))
5710 (dir (read-file-name (format fmt-prompt "") 5710 (dir (read-directory-name (format fmt-prompt "")
5711 "" dir-name nil dir-name)) 5711 "" dir-name nil dir-name))
5712 prompt) 5712 prompt)
5713 (while (cond ((not (file-directory-p dir)) 5713 (while (cond ((not (file-directory-p dir))
5714 (ding) 5714 (ding)
@@ -5718,8 +5718,8 @@ If menu binding was not done, calls `pr-menu-bind'."
5718 (setq prompt "Directory is unreadable! ")) 5718 (setq prompt "Directory is unreadable! "))
5719 (t nil)) 5719 (t nil))
5720 (setq dir-name (file-name-directory dir) 5720 (setq dir-name (file-name-directory dir)
5721 dir (read-file-name (format fmt-prompt prompt) 5721 dir (read-directory-name (format fmt-prompt prompt)
5722 "" dir-name nil dir-name))) 5722 "" dir-name nil dir-name)))
5723 (file-name-as-directory dir))) 5723 (file-name-as-directory dir)))
5724 5724
5725 5725
diff --git a/lisp/progmodes/ada-prj.el b/lisp/progmodes/ada-prj.el
index d7397144498..dd05ab8f310 100644
--- a/lisp/progmodes/ada-prj.el
+++ b/lisp/progmodes/ada-prj.el
@@ -227,7 +227,7 @@ If FILE-NAME is nil, ask the user for the name."
227 ;; the user to select a directory 227 ;; the user to select a directory
228 (let ((use-dialog-box nil)) 228 (let ((use-dialog-box nil))
229 (unless file-name 229 (unless file-name
230 (set 'file-name (read-file-name "Root directory: " nil nil t)))) 230 (set 'file-name (read-directory-name "Root directory: " nil nil t))))
231 231
232 (set 'ada-prj-current-values 232 (set 'ada-prj-current-values
233 (plist-put ada-prj-current-values 233 (plist-put ada-prj-current-values
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index de1debd6456..5ef12300195 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -2023,9 +2023,9 @@ comment at the start of cc-engine.el for more info."
2023 2023
2024(defvar c-state-nonlit-pos-cache nil) 2024(defvar c-state-nonlit-pos-cache nil)
2025(make-variable-buffer-local 'c-state-nonlit-pos-cache) 2025(make-variable-buffer-local 'c-state-nonlit-pos-cache)
2026;; A list of buffer positions which are known not to be in a literal. This is 2026;; A list of buffer positions which are known not to be in a literal or a cpp
2027;; ordered with higher positions at the front of the list. Only those which 2027;; construct. This is ordered with higher positions at the front of the list.
2028;; are less than `c-state-nonlit-pos-cache-limit' are valid. 2028;; Only those which are less than `c-state-nonlit-pos-cache-limit' are valid.
2029 2029
2030(defvar c-state-nonlit-pos-cache-limit 1) 2030(defvar c-state-nonlit-pos-cache-limit 1)
2031(make-variable-buffer-local 'c-state-nonlit-pos-cache-limit) 2031(make-variable-buffer-local 'c-state-nonlit-pos-cache-limit)
@@ -2056,6 +2056,12 @@ comment at the start of cc-engine.el for more info."
2056 ;; This function is almost the same as `c-literal-limits'. It differs in 2056 ;; This function is almost the same as `c-literal-limits'. It differs in
2057 ;; that it is a lower level function, and that it rigourously follows the 2057 ;; that it is a lower level function, and that it rigourously follows the
2058 ;; syntax from BOB, whereas `c-literal-limits' uses a "local" safe position. 2058 ;; syntax from BOB, whereas `c-literal-limits' uses a "local" safe position.
2059 ;;
2060 ;; NOTE: This function manipulates `c-state-nonlit-pos-cache'. This cache
2061 ;; MAY NOT contain any positions within macros, since macros are frequently
2062 ;; turned into comments by use of the `c-cpp-delimiter' category properties.
2063 ;; We cannot rely on this mechanism whilst determining a cache pos since
2064 ;; this function is also called from outwith `c-parse-state'.
2059 (save-restriction 2065 (save-restriction
2060 (widen) 2066 (widen)
2061 (save-excursion 2067 (save-excursion
@@ -2074,6 +2080,11 @@ comment at the start of cc-engine.el for more info."
2074 here) 2080 here)
2075 (setq lit (c-state-pp-to-literal pos npos)) 2081 (setq lit (c-state-pp-to-literal pos npos))
2076 (setq pos (or (cdr lit) npos)) ; end of literal containing npos. 2082 (setq pos (or (cdr lit) npos)) ; end of literal containing npos.
2083 (goto-char pos)
2084 (when (and (c-beginning-of-macro) (/= (point) pos))
2085 (c-syntactic-end-of-macro)
2086 (or (eobp) (forward-char))
2087 (setq pos (point)))
2077 (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache))) 2088 (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache)))
2078 2089
2079 (if (> pos c-state-nonlit-pos-cache-limit) 2090 (if (> pos c-state-nonlit-pos-cache-limit)
@@ -2158,7 +2169,7 @@ comment at the start of cc-engine.el for more info."
2158;; of fruitless backward scans. 2169;; of fruitless backward scans.
2159(defvar c-state-brace-pair-desert nil) 2170(defvar c-state-brace-pair-desert nil)
2160(make-variable-buffer-local 'c-state-brace-pair-desert) 2171(make-variable-buffer-local 'c-state-brace-pair-desert)
2161;; Used only in `c-append-lower-brace-pair-to-state-cache'. It is set when an 2172;; Used only in `c-append-lower-brace-pair-to-state-cache'. It is set when
2162;; that defun has searched backwards for a brace pair and not found one. Its 2173;; that defun has searched backwards for a brace pair and not found one. Its
2163;; value is either nil or a cons (PA . FROM), where PA is the position of the 2174;; value is either nil or a cons (PA . FROM), where PA is the position of the
2164;; enclosing opening paren/brace/bracket which bounds the backwards search (or 2175;; enclosing opening paren/brace/bracket which bounds the backwards search (or
@@ -2843,6 +2854,29 @@ comment at the start of cc-engine.el for more info."
2843 c-state-old-cpp-end nil) 2854 c-state-old-cpp-end nil)
2844 (c-state-mark-point-min-literal)) 2855 (c-state-mark-point-min-literal))
2845 2856
2857;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2858;; Debugging routines to dump `c-state-cache' in a "replayable" form.
2859;; (defmacro c-sc-de (elt) ; "c-state-cache-dump-element"
2860;; `(format ,(concat "(setq " (symbol-name elt) " %s) ") ,elt))
2861;; (defmacro c-sc-qde (elt) ; "c-state-cache-quote-dump-element"
2862;; `(format ,(concat "(setq " (symbol-name elt) " '%s) ") ,elt))
2863;; (defun c-state-dump ()
2864;; ;; For debugging.
2865;; ;(message
2866;; (concat
2867;; (c-sc-qde c-state-cache)
2868;; (c-sc-de c-state-cache-good-pos)
2869;; (c-sc-qde c-state-nonlit-pos-cache)
2870;; (c-sc-de c-state-nonlit-pos-cache-limit)
2871;; (c-sc-qde c-state-brace-pair-desert)
2872;; (c-sc-de c-state-point-min)
2873;; (c-sc-de c-state-point-min-lit-type)
2874;; (c-sc-de c-state-point-min-lit-start)
2875;; (c-sc-de c-state-min-scan-pos)
2876;; (c-sc-de c-state-old-cpp-beg)
2877;; (c-sc-de c-state-old-cpp-end)))
2878;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2879
2846(defun c-invalidate-state-cache-1 (here) 2880(defun c-invalidate-state-cache-1 (here)
2847 ;; Invalidate all info on `c-state-cache' that applies to the buffer at HERE 2881 ;; Invalidate all info on `c-state-cache' that applies to the buffer at HERE
2848 ;; or higher and set `c-state-cache-good-pos' accordingly. The cache is 2882 ;; or higher and set `c-state-cache-good-pos' accordingly. The cache is
@@ -8691,841 +8725,841 @@ comment at the start of cc-engine.el for more info."
8691(defun c-guess-basic-syntax () 8725(defun c-guess-basic-syntax ()
8692 "Return the syntactic context of the current line." 8726 "Return the syntactic context of the current line."
8693 (save-excursion 8727 (save-excursion
8694 (beginning-of-line) 8728 (beginning-of-line)
8695 (c-save-buffer-state 8729 (c-save-buffer-state
8696 ((indent-point (point)) 8730 ((indent-point (point))
8697 (case-fold-search nil) 8731 (case-fold-search nil)
8698 ;; A whole ugly bunch of various temporary variables. Have 8732 ;; A whole ugly bunch of various temporary variables. Have
8699 ;; to declare them here since it's not possible to declare 8733 ;; to declare them here since it's not possible to declare
8700 ;; a variable with only the scope of a cond test and the 8734 ;; a variable with only the scope of a cond test and the
8701 ;; following result clauses, and most of this function is a 8735 ;; following result clauses, and most of this function is a
8702 ;; single gigantic cond. :P 8736 ;; single gigantic cond. :P
8703 literal char-before-ip before-ws-ip char-after-ip macro-start 8737 literal char-before-ip before-ws-ip char-after-ip macro-start
8704 in-macro-expr c-syntactic-context placeholder c-in-literal-cache 8738 in-macro-expr c-syntactic-context placeholder c-in-literal-cache
8705 step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos 8739 step-type tmpsymbol keyword injava-inher special-brace-list tmp-pos
8706 containing-< 8740 containing-<
8707 ;; The following record some positions for the containing 8741 ;; The following record some positions for the containing
8708 ;; declaration block if we're directly within one: 8742 ;; declaration block if we're directly within one:
8709 ;; `containing-decl-open' is the position of the open 8743 ;; `containing-decl-open' is the position of the open
8710 ;; brace. `containing-decl-start' is the start of the 8744 ;; brace. `containing-decl-start' is the start of the
8711 ;; declaration. `containing-decl-kwd' is the keyword 8745 ;; declaration. `containing-decl-kwd' is the keyword
8712 ;; symbol of the keyword that tells what kind of block it 8746 ;; symbol of the keyword that tells what kind of block it
8713 ;; is. 8747 ;; is.
8714 containing-decl-open 8748 containing-decl-open
8715 containing-decl-start 8749 containing-decl-start
8716 containing-decl-kwd 8750 containing-decl-kwd
8717 ;; The open paren of the closest surrounding sexp or nil if 8751 ;; The open paren of the closest surrounding sexp or nil if
8718 ;; there is none. 8752 ;; there is none.
8719 containing-sexp 8753 containing-sexp
8720 ;; The position after the closest preceding brace sexp 8754 ;; The position after the closest preceding brace sexp
8721 ;; (nested sexps are ignored), or the position after 8755 ;; (nested sexps are ignored), or the position after
8722 ;; `containing-sexp' if there is none, or (point-min) if 8756 ;; `containing-sexp' if there is none, or (point-min) if
8723 ;; `containing-sexp' is nil. 8757 ;; `containing-sexp' is nil.
8724 lim 8758 lim
8725 ;; The paren state outside `containing-sexp', or at 8759 ;; The paren state outside `containing-sexp', or at
8726 ;; `indent-point' if `containing-sexp' is nil. 8760 ;; `indent-point' if `containing-sexp' is nil.
8727 (paren-state (c-parse-state)) 8761 (paren-state (c-parse-state))
8728 ;; There's always at most one syntactic element which got 8762 ;; There's always at most one syntactic element which got
8729 ;; an anchor pos. It's stored in syntactic-relpos. 8763 ;; an anchor pos. It's stored in syntactic-relpos.
8730 syntactic-relpos 8764 syntactic-relpos
8731 (c-stmt-delim-chars c-stmt-delim-chars)) 8765 (c-stmt-delim-chars c-stmt-delim-chars))
8732 8766
8733 ;; Check if we're directly inside an enclosing declaration 8767 ;; Check if we're directly inside an enclosing declaration
8734 ;; level block. 8768 ;; level block.
8735 (when (and (setq containing-sexp 8769 (when (and (setq containing-sexp
8736 (c-most-enclosing-brace paren-state)) 8770 (c-most-enclosing-brace paren-state))
8737 (progn 8771 (progn
8738 (goto-char containing-sexp) 8772 (goto-char containing-sexp)
8739 (eq (char-after) ?{)) 8773 (eq (char-after) ?{))
8740 (setq placeholder 8774 (setq placeholder
8741 (c-looking-at-decl-block 8775 (c-looking-at-decl-block
8742 (c-most-enclosing-brace paren-state 8776 (c-most-enclosing-brace paren-state
8743 containing-sexp) 8777 containing-sexp)
8744 t))) 8778 t)))
8745 (setq containing-decl-open containing-sexp 8779 (setq containing-decl-open containing-sexp
8746 containing-decl-start (point) 8780 containing-decl-start (point)
8747 containing-sexp nil) 8781 containing-sexp nil)
8748 (goto-char placeholder) 8782 (goto-char placeholder)
8749 (setq containing-decl-kwd (and (looking-at c-keywords-regexp) 8783 (setq containing-decl-kwd (and (looking-at c-keywords-regexp)
8750 (c-keyword-sym (match-string 1))))) 8784 (c-keyword-sym (match-string 1)))))
8751 8785
8752 ;; Init some position variables. 8786 ;; Init some position variables.
8753 (if c-state-cache 8787 (if c-state-cache
8754 (progn 8788 (progn
8755 (setq containing-sexp (car paren-state) 8789 (setq containing-sexp (car paren-state)
8756 paren-state (cdr paren-state)) 8790 paren-state (cdr paren-state))
8757 (if (consp containing-sexp) 8791 (if (consp containing-sexp)
8758 (progn 8792 (progn
8759 (setq lim (cdr containing-sexp)) 8793 (setq lim (cdr containing-sexp))
8760 (if (cdr c-state-cache) 8794 (if (cdr c-state-cache)
8761 ;; Ignore balanced paren. The next entry 8795 ;; Ignore balanced paren. The next entry
8762 ;; can't be another one. 8796 ;; can't be another one.
8763 (setq containing-sexp (car (cdr c-state-cache)) 8797 (setq containing-sexp (car (cdr c-state-cache))
8764 paren-state (cdr paren-state)) 8798 paren-state (cdr paren-state))
8765 ;; If there is no surrounding open paren then 8799 ;; If there is no surrounding open paren then
8766 ;; put the last balanced pair back on paren-state. 8800 ;; put the last balanced pair back on paren-state.
8767 (setq paren-state (cons containing-sexp paren-state) 8801 (setq paren-state (cons containing-sexp paren-state)
8768 containing-sexp nil))) 8802 containing-sexp nil)))
8769 (setq lim (1+ containing-sexp)))) 8803 (setq lim (1+ containing-sexp))))
8770 (setq lim (point-min))) 8804 (setq lim (point-min)))
8771 8805
8772 ;; If we're in a parenthesis list then ',' delimits the 8806 ;; If we're in a parenthesis list then ',' delimits the
8773 ;; "statements" rather than being an operator (with the 8807 ;; "statements" rather than being an operator (with the
8774 ;; exception of the "for" clause). This difference is 8808 ;; exception of the "for" clause). This difference is
8775 ;; typically only noticeable when statements are used in macro 8809 ;; typically only noticeable when statements are used in macro
8776 ;; arglists. 8810 ;; arglists.
8777 (when (and containing-sexp 8811 (when (and containing-sexp
8778 (eq (char-after containing-sexp) ?\()) 8812 (eq (char-after containing-sexp) ?\())
8779 (setq c-stmt-delim-chars c-stmt-delim-chars-with-comma)) 8813 (setq c-stmt-delim-chars c-stmt-delim-chars-with-comma))
8780 ;; cache char before and after indent point, and move point to 8814 ;; cache char before and after indent point, and move point to
8781 ;; the most likely position to perform the majority of tests 8815 ;; the most likely position to perform the majority of tests
8782 (goto-char indent-point) 8816 (goto-char indent-point)
8783 (c-backward-syntactic-ws lim) 8817 (c-backward-syntactic-ws lim)
8784 (setq before-ws-ip (point) 8818 (setq before-ws-ip (point)
8785 char-before-ip (char-before)) 8819 char-before-ip (char-before))
8786 (goto-char indent-point) 8820 (goto-char indent-point)
8787 (skip-chars-forward " \t") 8821 (skip-chars-forward " \t")
8788 (setq char-after-ip (char-after)) 8822 (setq char-after-ip (char-after))
8789 8823
8790 ;; are we in a literal? 8824 ;; are we in a literal?
8791 (setq literal (c-in-literal lim)) 8825 (setq literal (c-in-literal lim))
8792 8826
8793 ;; now figure out syntactic qualities of the current line 8827 ;; now figure out syntactic qualities of the current line
8794 (cond 8828 (cond
8795 8829
8796 ;; CASE 1: in a string. 8830 ;; CASE 1: in a string.
8797 ((eq literal 'string) 8831 ((eq literal 'string)
8798 (c-add-syntax 'string (c-point 'bopl))) 8832 (c-add-syntax 'string (c-point 'bopl)))
8799 8833
8800 ;; CASE 2: in a C or C++ style comment. 8834 ;; CASE 2: in a C or C++ style comment.
8801 ((and (memq literal '(c c++)) 8835 ((and (memq literal '(c c++))
8802 ;; This is a kludge for XEmacs where we use 8836 ;; This is a kludge for XEmacs where we use
8803 ;; `buffer-syntactic-context', which doesn't correctly 8837 ;; `buffer-syntactic-context', which doesn't correctly
8804 ;; recognize "\*/" to end a block comment. 8838 ;; recognize "\*/" to end a block comment.
8805 ;; `parse-partial-sexp' which is used by 8839 ;; `parse-partial-sexp' which is used by
8806 ;; `c-literal-limits' will however do that in most 8840 ;; `c-literal-limits' will however do that in most
8807 ;; versions, which results in that we get nil from 8841 ;; versions, which results in that we get nil from
8808 ;; `c-literal-limits' even when `c-in-literal' claims 8842 ;; `c-literal-limits' even when `c-in-literal' claims
8809 ;; we're inside a comment. 8843 ;; we're inside a comment.
8810 (setq placeholder (c-literal-limits lim))) 8844 (setq placeholder (c-literal-limits lim)))
8811 (c-add-syntax literal (car placeholder))) 8845 (c-add-syntax literal (car placeholder)))
8812 8846
8813 ;; CASE 3: in a cpp preprocessor macro continuation. 8847 ;; CASE 3: in a cpp preprocessor macro continuation.
8814 ((and (save-excursion 8848 ((and (save-excursion
8815 (when (c-beginning-of-macro) 8849 (when (c-beginning-of-macro)
8816 (setq macro-start (point)))) 8850 (setq macro-start (point))))
8817 (/= macro-start (c-point 'boi)) 8851 (/= macro-start (c-point 'boi))
8818 (progn 8852 (progn
8819 (setq tmpsymbol 'cpp-macro-cont) 8853 (setq tmpsymbol 'cpp-macro-cont)
8820 (or (not c-syntactic-indentation-in-macros) 8854 (or (not c-syntactic-indentation-in-macros)
8821 (save-excursion 8855 (save-excursion
8822 (goto-char macro-start) 8856 (goto-char macro-start)
8823 ;; If at the beginning of the body of a #define 8857 ;; If at the beginning of the body of a #define
8824 ;; directive then analyze as cpp-define-intro 8858 ;; directive then analyze as cpp-define-intro
8825 ;; only. Go on with the syntactic analysis 8859 ;; only. Go on with the syntactic analysis
8826 ;; otherwise. in-macro-expr is set if we're in a 8860 ;; otherwise. in-macro-expr is set if we're in a
8827 ;; cpp expression, i.e. before the #define body 8861 ;; cpp expression, i.e. before the #define body
8828 ;; or anywhere in a non-#define directive. 8862 ;; or anywhere in a non-#define directive.
8829 (if (c-forward-to-cpp-define-body) 8863 (if (c-forward-to-cpp-define-body)
8830 (let ((indent-boi (c-point 'boi indent-point))) 8864 (let ((indent-boi (c-point 'boi indent-point)))
8831 (setq in-macro-expr (> (point) indent-boi) 8865 (setq in-macro-expr (> (point) indent-boi)
8832 tmpsymbol 'cpp-define-intro) 8866 tmpsymbol 'cpp-define-intro)
8833 (= (point) indent-boi)) 8867 (= (point) indent-boi))
8834 (setq in-macro-expr t) 8868 (setq in-macro-expr t)
8835 nil))))) 8869 nil)))))
8836 (c-add-syntax tmpsymbol macro-start) 8870 (c-add-syntax tmpsymbol macro-start)
8837 (setq macro-start nil)) 8871 (setq macro-start nil))
8838 8872
8839 ;; CASE 11: an else clause? 8873 ;; CASE 11: an else clause?
8840 ((looking-at "else\\>[^_]") 8874 ((looking-at "else\\>[^_]")
8841 (c-beginning-of-statement-1 containing-sexp) 8875 (c-beginning-of-statement-1 containing-sexp)
8842 (c-add-stmt-syntax 'else-clause nil t 8876 (c-add-stmt-syntax 'else-clause nil t
8843 containing-sexp paren-state)) 8877 containing-sexp paren-state))
8844 8878
8845 ;; CASE 12: while closure of a do/while construct? 8879 ;; CASE 12: while closure of a do/while construct?
8846 ((and (looking-at "while\\>[^_]") 8880 ((and (looking-at "while\\>[^_]")
8847 (save-excursion 8881 (save-excursion
8848 (prog1 (eq (c-beginning-of-statement-1 containing-sexp) 8882 (prog1 (eq (c-beginning-of-statement-1 containing-sexp)
8849 'beginning) 8883 'beginning)
8850 (setq placeholder (point))))) 8884 (setq placeholder (point)))))
8851 (goto-char placeholder) 8885 (goto-char placeholder)
8852 (c-add-stmt-syntax 'do-while-closure nil t 8886 (c-add-stmt-syntax 'do-while-closure nil t
8853 containing-sexp paren-state)) 8887 containing-sexp paren-state))
8854 8888
8855 ;; CASE 13: A catch or finally clause? This case is simpler 8889 ;; CASE 13: A catch or finally clause? This case is simpler
8856 ;; than if-else and do-while, because a block is required 8890 ;; than if-else and do-while, because a block is required
8857 ;; after every try, catch and finally. 8891 ;; after every try, catch and finally.
8858 ((save-excursion 8892 ((save-excursion
8859 (and (cond ((c-major-mode-is 'c++-mode) 8893 (and (cond ((c-major-mode-is 'c++-mode)
8860 (looking-at "catch\\>[^_]")) 8894 (looking-at "catch\\>[^_]"))
8861 ((c-major-mode-is 'java-mode) 8895 ((c-major-mode-is 'java-mode)
8862 (looking-at "\\(catch\\|finally\\)\\>[^_]"))) 8896 (looking-at "\\(catch\\|finally\\)\\>[^_]")))
8863 (and (c-safe (c-backward-syntactic-ws) 8897 (and (c-safe (c-backward-syntactic-ws)
8864 (c-backward-sexp) 8898 (c-backward-sexp)
8865 t) 8899 t)
8866 (eq (char-after) ?{) 8900 (eq (char-after) ?{)
8867 (c-safe (c-backward-syntactic-ws) 8901 (c-safe (c-backward-syntactic-ws)
8868 (c-backward-sexp) 8902 (c-backward-sexp)
8869 t) 8903 t)
8870 (if (eq (char-after) ?\() 8904 (if (eq (char-after) ?\()
8871 (c-safe (c-backward-sexp) t) 8905 (c-safe (c-backward-sexp) t)
8872 t)) 8906 t))
8873 (looking-at "\\(try\\|catch\\)\\>[^_]") 8907 (looking-at "\\(try\\|catch\\)\\>[^_]")
8874 (setq placeholder (point)))) 8908 (setq placeholder (point))))
8875 (goto-char placeholder) 8909 (goto-char placeholder)
8876 (c-add-stmt-syntax 'catch-clause nil t 8910 (c-add-stmt-syntax 'catch-clause nil t
8877 containing-sexp paren-state)) 8911 containing-sexp paren-state))
8878 8912
8879 ;; CASE 18: A substatement we can recognize by keyword. 8913 ;; CASE 18: A substatement we can recognize by keyword.
8880 ((save-excursion 8914 ((save-excursion
8881 (and c-opt-block-stmt-key 8915 (and c-opt-block-stmt-key
8882 (not (eq char-before-ip ?\;)) 8916 (not (eq char-before-ip ?\;))
8883 (not (c-at-vsemi-p before-ws-ip)) 8917 (not (c-at-vsemi-p before-ws-ip))
8884 (not (memq char-after-ip '(?\) ?\] ?,))) 8918 (not (memq char-after-ip '(?\) ?\] ?,)))
8885 (or (not (eq char-before-ip ?})) 8919 (or (not (eq char-before-ip ?}))
8886 (c-looking-at-inexpr-block-backward c-state-cache)) 8920 (c-looking-at-inexpr-block-backward c-state-cache))
8887 (> (point) 8921 (> (point)
8888 (progn 8922 (progn
8889 ;; Ought to cache the result from the 8923 ;; Ought to cache the result from the
8890 ;; c-beginning-of-statement-1 calls here. 8924 ;; c-beginning-of-statement-1 calls here.
8925 (setq placeholder (point))
8926 (while (eq (setq step-type
8927 (c-beginning-of-statement-1 lim))
8928 'label))
8929 (if (eq step-type 'previous)
8930 (goto-char placeholder)
8891 (setq placeholder (point)) 8931 (setq placeholder (point))
8892 (while (eq (setq step-type 8932 (if (and (eq step-type 'same)
8893 (c-beginning-of-statement-1 lim)) 8933 (not (looking-at c-opt-block-stmt-key)))
8894 'label)) 8934 ;; Step up to the containing statement if we
8895 (if (eq step-type 'previous) 8935 ;; stayed in the same one.
8896 (goto-char placeholder) 8936 (let (step)
8897 (setq placeholder (point)) 8937 (while (eq
8898 (if (and (eq step-type 'same) 8938 (setq step
8899 (not (looking-at c-opt-block-stmt-key))) 8939 (c-beginning-of-statement-1 lim))
8900 ;; Step up to the containing statement if we 8940 'label))
8901 ;; stayed in the same one. 8941 (if (eq step 'up)
8902 (let (step) 8942 (setq placeholder (point))
8903 (while (eq 8943 ;; There was no containing statement afterall.
8904 (setq step 8944 (goto-char placeholder)))))
8905 (c-beginning-of-statement-1 lim)) 8945 placeholder))
8906 'label)) 8946 (if (looking-at c-block-stmt-2-key)
8907 (if (eq step 'up) 8947 ;; Require a parenthesis after these keywords.
8908 (setq placeholder (point)) 8948 ;; Necessary to catch e.g. synchronized in Java,
8909 ;; There was no containing statement afterall. 8949 ;; which can be used both as statement and
8910 (goto-char placeholder))))) 8950 ;; modifier.
8911 placeholder)) 8951 (and (zerop (c-forward-token-2 1 nil))
8912 (if (looking-at c-block-stmt-2-key) 8952 (eq (char-after) ?\())
8913 ;; Require a parenthesis after these keywords. 8953 (looking-at c-opt-block-stmt-key))))
8914 ;; Necessary to catch e.g. synchronized in Java, 8954
8915 ;; which can be used both as statement and 8955 (if (eq step-type 'up)
8916 ;; modifier. 8956 ;; CASE 18A: Simple substatement.
8917 (and (zerop (c-forward-token-2 1 nil)) 8957 (progn
8918 (eq (char-after) ?\()) 8958 (goto-char placeholder)
8919 (looking-at c-opt-block-stmt-key)))) 8959 (cond
8920 8960 ((eq char-after-ip ?{)
8921 (if (eq step-type 'up) 8961 (c-add-stmt-syntax 'substatement-open nil nil
8922 ;; CASE 18A: Simple substatement. 8962 containing-sexp paren-state))
8923 (progn 8963 ((save-excursion
8924 (goto-char placeholder) 8964 (goto-char indent-point)
8925 (cond 8965 (back-to-indentation)
8926 ((eq char-after-ip ?{) 8966 (c-forward-label))
8927 (c-add-stmt-syntax 'substatement-open nil nil 8967 (c-add-stmt-syntax 'substatement-label nil nil
8928 containing-sexp paren-state)) 8968 containing-sexp paren-state))
8929 ((save-excursion 8969 (t
8930 (goto-char indent-point) 8970 (c-add-stmt-syntax 'substatement nil nil
8931 (back-to-indentation) 8971 containing-sexp paren-state))))
8932 (c-forward-label)) 8972
8933 (c-add-stmt-syntax 'substatement-label nil nil 8973 ;; CASE 18B: Some other substatement. This is shared
8934 containing-sexp paren-state)) 8974 ;; with case 10.
8935 (t 8975 (c-guess-continued-construct indent-point
8936 (c-add-stmt-syntax 'substatement nil nil 8976 char-after-ip
8937 containing-sexp paren-state)))) 8977 placeholder
8938 8978 lim
8939 ;; CASE 18B: Some other substatement. This is shared 8979 paren-state)))
8940 ;; with case 10.
8941 (c-guess-continued-construct indent-point
8942 char-after-ip
8943 placeholder
8944 lim
8945 paren-state)))
8946
8947 ;; CASE 14: A case or default label
8948 ((looking-at c-label-kwds-regexp)
8949 (if containing-sexp
8950 (progn
8951 (goto-char containing-sexp)
8952 (setq lim (c-most-enclosing-brace c-state-cache
8953 containing-sexp))
8954 (c-backward-to-block-anchor lim)
8955 (c-add-stmt-syntax 'case-label nil t lim paren-state))
8956 ;; Got a bogus label at the top level. In lack of better
8957 ;; alternatives, anchor it on (point-min).
8958 (c-add-syntax 'case-label (point-min))))
8959
8960 ;; CASE 15: any other label
8961 ((save-excursion
8962 (back-to-indentation)
8963 (and (not (looking-at c-syntactic-ws-start))
8964 (c-forward-label)))
8965 (cond (containing-decl-open
8966 (setq placeholder (c-add-class-syntax 'inclass
8967 containing-decl-open
8968 containing-decl-start
8969 containing-decl-kwd
8970 paren-state))
8971 ;; Append access-label with the same anchor point as
8972 ;; inclass gets.
8973 (c-append-syntax 'access-label placeholder))
8974
8975 (containing-sexp
8976 (goto-char containing-sexp)
8977 (setq lim (c-most-enclosing-brace c-state-cache
8978 containing-sexp))
8979 (save-excursion
8980 (setq tmpsymbol
8981 (if (and (eq (c-beginning-of-statement-1 lim) 'up)
8982 (looking-at "switch\\>[^_]"))
8983 ;; If the surrounding statement is a switch then
8984 ;; let's analyze all labels as switch labels, so
8985 ;; that they get lined up consistently.
8986 'case-label
8987 'label)))
8988 (c-backward-to-block-anchor lim)
8989 (c-add-stmt-syntax tmpsymbol nil t lim paren-state))
8990 8980
8991 (t 8981 ;; CASE 14: A case or default label
8992 ;; A label on the top level. Treat it as a class 8982 ((looking-at c-label-kwds-regexp)
8993 ;; context. (point-min) is the closest we get to the 8983 (if containing-sexp
8994 ;; class open brace. 8984 (progn
8995 (c-add-syntax 'access-label (point-min))))) 8985 (goto-char containing-sexp)
8986 (setq lim (c-most-enclosing-brace c-state-cache
8987 containing-sexp))
8988 (c-backward-to-block-anchor lim)
8989 (c-add-stmt-syntax 'case-label nil t lim paren-state))
8990 ;; Got a bogus label at the top level. In lack of better
8991 ;; alternatives, anchor it on (point-min).
8992 (c-add-syntax 'case-label (point-min))))
8996 8993
8997 ;; CASE 4: In-expression statement. C.f. cases 7B, 16A and 8994 ;; CASE 15: any other label
8998 ;; 17E. 8995 ((save-excursion
8999 ((setq placeholder (c-looking-at-inexpr-block
9000 (c-safe-position containing-sexp paren-state)
9001 containing-sexp
9002 ;; Have to turn on the heuristics after
9003 ;; the point even though it doesn't work
9004 ;; very well. C.f. test case class-16.pike.
9005 t))
9006 (setq tmpsymbol (assq (car placeholder)
9007 '((inexpr-class . class-open)
9008 (inexpr-statement . block-open))))
9009 (if tmpsymbol
9010 ;; It's a statement block or an anonymous class.
9011 (setq tmpsymbol (cdr tmpsymbol))
9012 ;; It's a Pike lambda. Check whether we are between the
9013 ;; lambda keyword and the argument list or at the defun
9014 ;; opener.
9015 (setq tmpsymbol (if (eq char-after-ip ?{)
9016 'inline-open
9017 'lambda-intro-cont)))
9018 (goto-char (cdr placeholder))
9019 (back-to-indentation) 8996 (back-to-indentation)
9020 (c-add-stmt-syntax tmpsymbol nil t 8997 (and (not (looking-at c-syntactic-ws-start))
9021 (c-most-enclosing-brace c-state-cache (point)) 8998 (c-forward-label)))
9022 paren-state) 8999 (cond (containing-decl-open
9023 (unless (eq (point) (cdr placeholder)) 9000 (setq placeholder (c-add-class-syntax 'inclass
9024 (c-add-syntax (car placeholder)))) 9001 containing-decl-open
9025 9002 containing-decl-start
9026 ;; CASE 5: Line is inside a declaration level block or at top level. 9003 containing-decl-kwd
9027 ((or containing-decl-open (null containing-sexp)) 9004 paren-state))
9028 (cond 9005 ;; Append access-label with the same anchor point as
9029 9006 ;; inclass gets.
9030 ;; CASE 5A: we are looking at a defun, brace list, class, 9007 (c-append-syntax 'access-label placeholder))
9031 ;; or inline-inclass method opening brace 9008
9032 ((setq special-brace-list 9009 (containing-sexp
9033 (or (and c-special-brace-lists 9010 (goto-char containing-sexp)
9034 (c-looking-at-special-brace-list)) 9011 (setq lim (c-most-enclosing-brace c-state-cache
9035 (eq char-after-ip ?{))) 9012 containing-sexp))
9036 (cond 9013 (save-excursion
9014 (setq tmpsymbol
9015 (if (and (eq (c-beginning-of-statement-1 lim) 'up)
9016 (looking-at "switch\\>[^_]"))
9017 ;; If the surrounding statement is a switch then
9018 ;; let's analyze all labels as switch labels, so
9019 ;; that they get lined up consistently.
9020 'case-label
9021 'label)))
9022 (c-backward-to-block-anchor lim)
9023 (c-add-stmt-syntax tmpsymbol nil t lim paren-state))
9037 9024
9038 ;; CASE 5A.1: Non-class declaration block open. 9025 (t
9039 ((save-excursion 9026 ;; A label on the top level. Treat it as a class
9040 (let (tmp) 9027 ;; context. (point-min) is the closest we get to the
9041 (and (eq char-after-ip ?{) 9028 ;; class open brace.
9042 (setq tmp (c-looking-at-decl-block containing-sexp t)) 9029 (c-add-syntax 'access-label (point-min)))))
9043 (progn 9030
9044 (setq placeholder (point)) 9031 ;; CASE 4: In-expression statement. C.f. cases 7B, 16A and
9045 (goto-char tmp) 9032 ;; 17E.
9046 (looking-at c-symbol-key)) 9033 ((setq placeholder (c-looking-at-inexpr-block
9047 (c-keyword-member 9034 (c-safe-position containing-sexp paren-state)
9048 (c-keyword-sym (setq keyword (match-string 0))) 9035 containing-sexp
9049 'c-other-block-decl-kwds)))) 9036 ;; Have to turn on the heuristics after
9050 (goto-char placeholder) 9037 ;; the point even though it doesn't work
9051 (c-add-stmt-syntax 9038 ;; very well. C.f. test case class-16.pike.
9052 (if (string-equal keyword "extern") 9039 t))
9053 ;; Special case for extern-lang-open. 9040 (setq tmpsymbol (assq (car placeholder)
9054 'extern-lang-open 9041 '((inexpr-class . class-open)
9055 (intern (concat keyword "-open"))) 9042 (inexpr-statement . block-open))))
9056 nil t containing-sexp paren-state)) 9043 (if tmpsymbol
9057 9044 ;; It's a statement block or an anonymous class.
9058 ;; CASE 5A.2: we are looking at a class opening brace 9045 (setq tmpsymbol (cdr tmpsymbol))
9059 ((save-excursion 9046 ;; It's a Pike lambda. Check whether we are between the
9060 (goto-char indent-point) 9047 ;; lambda keyword and the argument list or at the defun
9061 (skip-chars-forward " \t") 9048 ;; opener.
9062 (and (eq (char-after) ?{) 9049 (setq tmpsymbol (if (eq char-after-ip ?{)
9063 (c-looking-at-decl-block containing-sexp t) 9050 'inline-open
9064 (setq placeholder (point)))) 9051 'lambda-intro-cont)))
9065 (c-add-syntax 'class-open placeholder)) 9052 (goto-char (cdr placeholder))
9066 9053 (back-to-indentation)
9067 ;; CASE 5A.3: brace list open 9054 (c-add-stmt-syntax tmpsymbol nil t
9068 ((save-excursion 9055 (c-most-enclosing-brace c-state-cache (point))
9069 (c-beginning-of-decl-1 lim) 9056 paren-state)
9070 (while (looking-at c-specifier-key) 9057 (unless (eq (point) (cdr placeholder))
9071 (goto-char (match-end 1)) 9058 (c-add-syntax (car placeholder))))
9072 (c-forward-syntactic-ws indent-point))
9073 (setq placeholder (c-point 'boi))
9074 (or (consp special-brace-list)
9075 (and (or (save-excursion
9076 (goto-char indent-point)
9077 (setq tmpsymbol nil)
9078 (while (and (> (point) placeholder)
9079 (zerop (c-backward-token-2 1 t))
9080 (/= (char-after) ?=))
9081 (and c-opt-inexpr-brace-list-key
9082 (not tmpsymbol)
9083 (looking-at c-opt-inexpr-brace-list-key)
9084 (setq tmpsymbol 'topmost-intro-cont)))
9085 (eq (char-after) ?=))
9086 (looking-at c-brace-list-key))
9087 (save-excursion
9088 (while (and (< (point) indent-point)
9089 (zerop (c-forward-token-2 1 t))
9090 (not (memq (char-after) '(?\; ?\()))))
9091 (not (memq (char-after) '(?\; ?\()))
9092 ))))
9093 (if (and (not c-auto-newline-analysis)
9094 (c-major-mode-is 'java-mode)
9095 (eq tmpsymbol 'topmost-intro-cont))
9096 ;; We're in Java and have found that the open brace
9097 ;; belongs to a "new Foo[]" initialization list,
9098 ;; which means the brace list is part of an
9099 ;; expression and not a top level definition. We
9100 ;; therefore treat it as any topmost continuation
9101 ;; even though the semantically correct symbol still
9102 ;; is brace-list-open, on the same grounds as in
9103 ;; case B.2.
9104 (progn
9105 (c-beginning-of-statement-1 lim)
9106 (c-add-syntax 'topmost-intro-cont (c-point 'boi)))
9107 (c-add-syntax 'brace-list-open placeholder)))
9108
9109 ;; CASE 5A.4: inline defun open
9110 ((and containing-decl-open
9111 (not (c-keyword-member containing-decl-kwd
9112 'c-other-block-decl-kwds)))
9113 (c-add-syntax 'inline-open)
9114 (c-add-class-syntax 'inclass
9115 containing-decl-open
9116 containing-decl-start
9117 containing-decl-kwd
9118 paren-state))
9119
9120 ;; CASE 5A.5: ordinary defun open
9121 (t
9122 (save-excursion
9123 (c-beginning-of-decl-1 lim)
9124 (while (looking-at c-specifier-key)
9125 (goto-char (match-end 1))
9126 (c-forward-syntactic-ws indent-point))
9127 (c-add-syntax 'defun-open (c-point 'boi))
9128 ;; Bogus to use bol here, but it's the legacy. (Resolved,
9129 ;; 2007-11-09)
9130 ))))
9131
9132 ;; CASE 5B: After a function header but before the body (or
9133 ;; the ending semicolon if there's no body).
9134 ((save-excursion
9135 (when (setq placeholder (c-just-after-func-arglist-p lim))
9136 (setq tmp-pos (point))))
9137 (cond
9138 9059
9139 ;; CASE 5B.1: Member init list. 9060 ;; CASE 5: Line is inside a declaration level block or at top level.
9140 ((eq (char-after tmp-pos) ?:) 9061 ((or containing-decl-open (null containing-sexp))
9141 (if (or (> tmp-pos indent-point) 9062 (cond
9142 (= (c-point 'bosws) (1+ tmp-pos)))
9143 (progn
9144 ;; There is no preceding member init clause.
9145 ;; Indent relative to the beginning of indentation
9146 ;; for the topmost-intro line that contains the
9147 ;; prototype's open paren.
9148 (goto-char placeholder)
9149 (c-add-syntax 'member-init-intro (c-point 'boi)))
9150 ;; Indent relative to the first member init clause.
9151 (goto-char (1+ tmp-pos))
9152 (c-forward-syntactic-ws)
9153 (c-add-syntax 'member-init-cont (point))))
9154 9063
9155 ;; CASE 5B.2: K&R arg decl intro 9064 ;; CASE 5A: we are looking at a defun, brace list, class,
9156 ((and c-recognize-knr-p 9065 ;; or inline-inclass method opening brace
9157 (c-in-knr-argdecl lim)) 9066 ((setq special-brace-list
9158 (c-beginning-of-statement-1 lim) 9067 (or (and c-special-brace-lists
9159 (c-add-syntax 'knr-argdecl-intro (c-point 'boi)) 9068 (c-looking-at-special-brace-list))
9160 (if containing-decl-open 9069 (eq char-after-ip ?{)))
9161 (c-add-class-syntax 'inclass 9070 (cond
9162 containing-decl-open
9163 containing-decl-start
9164 containing-decl-kwd
9165 paren-state)))
9166
9167 ;; CASE 5B.4: Nether region after a C++ or Java func
9168 ;; decl, which could include a `throws' declaration.
9169 (t
9170 (c-beginning-of-statement-1 lim)
9171 (c-add-syntax 'func-decl-cont (c-point 'boi))
9172 )))
9173 9071
9174 ;; CASE 5C: inheritance line. could be first inheritance 9072 ;; CASE 5A.1: Non-class declaration block open.
9175 ;; line, or continuation of a multiple inheritance 9073 ((save-excursion
9176 ((or (and (c-major-mode-is 'c++-mode) 9074 (let (tmp)
9075 (and (eq char-after-ip ?{)
9076 (setq tmp (c-looking-at-decl-block containing-sexp t))
9177 (progn 9077 (progn
9178 (when (eq char-after-ip ?,) 9078 (setq placeholder (point))
9179 (skip-chars-forward " \t") 9079 (goto-char tmp)
9180 (forward-char)) 9080 (looking-at c-symbol-key))
9181 (looking-at c-opt-postfix-decl-spec-key))) 9081 (c-keyword-member
9182 (and (or (eq char-before-ip ?:) 9082 (c-keyword-sym (setq keyword (match-string 0)))
9183 ;; watch out for scope operator 9083 'c-other-block-decl-kwds))))
9184 (save-excursion 9084 (goto-char placeholder)
9185 (and (eq char-after-ip ?:) 9085 (c-add-stmt-syntax
9186 (c-safe (forward-char 1) t) 9086 (if (string-equal keyword "extern")
9187 (not (eq (char-after) ?:)) 9087 ;; Special case for extern-lang-open.
9188 ))) 9088 'extern-lang-open
9189 (save-excursion 9089 (intern (concat keyword "-open")))
9190 (c-backward-syntactic-ws lim) 9090 nil t containing-sexp paren-state))
9191 (if (eq char-before-ip ?:)
9192 (progn
9193 (forward-char -1)
9194 (c-backward-syntactic-ws lim)))
9195 (back-to-indentation)
9196 (looking-at c-class-key)))
9197 ;; for Java
9198 (and (c-major-mode-is 'java-mode)
9199 (let ((fence (save-excursion
9200 (c-beginning-of-statement-1 lim)
9201 (point)))
9202 cont done)
9203 (save-excursion
9204 (while (not done)
9205 (cond ((looking-at c-opt-postfix-decl-spec-key)
9206 (setq injava-inher (cons cont (point))
9207 done t))
9208 ((or (not (c-safe (c-forward-sexp -1) t))
9209 (<= (point) fence))
9210 (setq done t))
9211 )
9212 (setq cont t)))
9213 injava-inher)
9214 (not (c-crosses-statement-barrier-p (cdr injava-inher)
9215 (point)))
9216 ))
9217 (cond
9218
9219 ;; CASE 5C.1: non-hanging colon on an inher intro
9220 ((eq char-after-ip ?:)
9221 (c-beginning-of-statement-1 lim)
9222 (c-add-syntax 'inher-intro (c-point 'boi))
9223 ;; don't add inclass symbol since relative point already
9224 ;; contains any class offset
9225 )
9226 9091
9227 ;; CASE 5C.2: hanging colon on an inher intro 9092 ;; CASE 5A.2: we are looking at a class opening brace
9228 ((eq char-before-ip ?:)
9229 (c-beginning-of-statement-1 lim)
9230 (c-add-syntax 'inher-intro (c-point 'boi))
9231 (if containing-decl-open
9232 (c-add-class-syntax 'inclass
9233 containing-decl-open
9234 containing-decl-start
9235 containing-decl-kwd
9236 paren-state)))
9237
9238 ;; CASE 5C.3: in a Java implements/extends
9239 (injava-inher
9240 (let ((where (cdr injava-inher))
9241 (cont (car injava-inher)))
9242 (goto-char where)
9243 (cond ((looking-at "throws\\>[^_]")
9244 (c-add-syntax 'func-decl-cont
9245 (progn (c-beginning-of-statement-1 lim)
9246 (c-point 'boi))))
9247 (cont (c-add-syntax 'inher-cont where))
9248 (t (c-add-syntax 'inher-intro
9249 (progn (goto-char (cdr injava-inher))
9250 (c-beginning-of-statement-1 lim)
9251 (point))))
9252 )))
9253
9254 ;; CASE 5C.4: a continued inheritance line
9255 (t
9256 (c-beginning-of-inheritance-list lim)
9257 (c-add-syntax 'inher-cont (point))
9258 ;; don't add inclass symbol since relative point already
9259 ;; contains any class offset
9260 )))
9261
9262 ;; CASE 5D: this could be a top-level initialization, a
9263 ;; member init list continuation, or a template argument
9264 ;; list continuation.
9265 ((save-excursion 9093 ((save-excursion
9266 ;; Note: We use the fact that lim is always after any 9094 (goto-char indent-point)
9267 ;; preceding brace sexp. 9095 (skip-chars-forward " \t")
9268 (if c-recognize-<>-arglists 9096 (and (eq (char-after) ?{)
9269 (while (and 9097 (c-looking-at-decl-block containing-sexp t)
9270 (progn 9098 (setq placeholder (point))))
9271 (c-syntactic-skip-backward "^;,=<>" lim t) 9099 (c-add-syntax 'class-open placeholder))
9272 (> (point) lim)) 9100
9273 (or 9101 ;; CASE 5A.3: brace list open
9274 (when c-overloadable-operators-regexp 9102 ((save-excursion
9275 (when (setq placeholder (c-after-special-operator-id lim)) 9103 (c-beginning-of-decl-1 lim)
9276 (goto-char placeholder) 9104 (while (looking-at c-specifier-key)
9277 t)) 9105 (goto-char (match-end 1))
9278 (cond 9106 (c-forward-syntactic-ws indent-point))
9279 ((eq (char-before) ?>) 9107 (setq placeholder (c-point 'boi))
9280 (or (c-backward-<>-arglist nil lim) 9108 (or (consp special-brace-list)
9281 (backward-char)) 9109 (and (or (save-excursion
9282 t) 9110 (goto-char indent-point)
9283 ((eq (char-before) ?<) 9111 (setq tmpsymbol nil)
9284 (backward-char) 9112 (while (and (> (point) placeholder)
9285 (if (save-excursion 9113 (zerop (c-backward-token-2 1 t))
9286 (c-forward-<>-arglist nil)) 9114 (/= (char-after) ?=))
9287 (progn (forward-char) 9115 (and c-opt-inexpr-brace-list-key
9288 nil) 9116 (not tmpsymbol)
9289 t)) 9117 (looking-at c-opt-inexpr-brace-list-key)
9290 (t nil))))) 9118 (setq tmpsymbol 'topmost-intro-cont)))
9291 ;; NB: No c-after-special-operator-id stuff in this 9119 (eq (char-after) ?=))
9292 ;; clause - we assume only C++ needs it. 9120 (looking-at c-brace-list-key))
9293 (c-syntactic-skip-backward "^;,=" lim t)) 9121 (save-excursion
9294 (memq (char-before) '(?, ?= ?<))) 9122 (while (and (< (point) indent-point)
9295 (cond 9123 (zerop (c-forward-token-2 1 t))
9296 9124 (not (memq (char-after) '(?\; ?\()))))
9297 ;; CASE 5D.3: perhaps a template list continuation? 9125 (not (memq (char-after) '(?\; ?\()))
9298 ((and (c-major-mode-is 'c++-mode) 9126 ))))
9299 (save-excursion 9127 (if (and (not c-auto-newline-analysis)
9300 (save-restriction 9128 (c-major-mode-is 'java-mode)
9301 (c-with-syntax-table c++-template-syntax-table 9129 (eq tmpsymbol 'topmost-intro-cont))
9302 (goto-char indent-point) 9130 ;; We're in Java and have found that the open brace
9303 (setq placeholder (c-up-list-backward)) 9131 ;; belongs to a "new Foo[]" initialization list,
9304 (and placeholder 9132 ;; which means the brace list is part of an
9305 (eq (char-after placeholder) ?<)))))) 9133 ;; expression and not a top level definition. We
9306 (c-with-syntax-table c++-template-syntax-table 9134 ;; therefore treat it as any topmost continuation
9307 (goto-char placeholder) 9135 ;; even though the semantically correct symbol still
9308 (c-beginning-of-statement-1 lim t) 9136 ;; is brace-list-open, on the same grounds as in
9309 (if (save-excursion 9137 ;; case B.2.
9310 (c-backward-syntactic-ws lim) 9138 (progn
9311 (eq (char-before) ?<)) 9139 (c-beginning-of-statement-1 lim)
9312 ;; In a nested template arglist. 9140 (c-add-syntax 'topmost-intro-cont (c-point 'boi)))
9313 (progn 9141 (c-add-syntax 'brace-list-open placeholder)))
9314 (goto-char placeholder) 9142
9315 (c-syntactic-skip-backward "^,;" lim t) 9143 ;; CASE 5A.4: inline defun open
9316 (c-forward-syntactic-ws)) 9144 ((and containing-decl-open
9317 (back-to-indentation))) 9145 (not (c-keyword-member containing-decl-kwd
9318 ;; FIXME: Should use c-add-stmt-syntax, but it's not yet 9146 'c-other-block-decl-kwds)))
9319 ;; template aware. 9147 (c-add-syntax 'inline-open)
9320 (c-add-syntax 'template-args-cont (point) placeholder)) 9148 (c-add-class-syntax 'inclass
9321
9322 ;; CASE 5D.4: perhaps a multiple inheritance line?
9323 ((and (c-major-mode-is 'c++-mode)
9324 (save-excursion
9325 (c-beginning-of-statement-1 lim)
9326 (setq placeholder (point))
9327 (if (looking-at "static\\>[^_]")
9328 (c-forward-token-2 1 nil indent-point))
9329 (and (looking-at c-class-key)
9330 (zerop (c-forward-token-2 2 nil indent-point))
9331 (if (eq (char-after) ?<)
9332 (c-with-syntax-table c++-template-syntax-table
9333 (zerop (c-forward-token-2 1 t indent-point)))
9334 t)
9335 (eq (char-after) ?:))))
9336 (goto-char placeholder)
9337 (c-add-syntax 'inher-cont (c-point 'boi)))
9338
9339 ;; CASE 5D.5: Continuation of the "expression part" of a
9340 ;; top level construct. Or, perhaps, an unrecognised construct.
9341 (t
9342 (while (and (setq placeholder (point))
9343 (eq (car (c-beginning-of-decl-1 containing-sexp))
9344 'same)
9345 (save-excursion
9346 (c-backward-syntactic-ws)
9347 (eq (char-before) ?}))
9348 (< (point) placeholder)))
9349 (c-add-stmt-syntax
9350 (cond
9351 ((eq (point) placeholder) 'statement) ; unrecognised construct
9352 ;; A preceding comma at the top level means that a
9353 ;; new variable declaration starts here. Use
9354 ;; topmost-intro-cont for it, for consistency with
9355 ;; the first variable declaration. C.f. case 5N.
9356 ((eq char-before-ip ?,) 'topmost-intro-cont)
9357 (t 'statement-cont))
9358 nil nil containing-sexp paren-state))
9359 ))
9360
9361 ;; CASE 5F: Close of a non-class declaration level block.
9362 ((and (eq char-after-ip ?})
9363 (c-keyword-member containing-decl-kwd
9364 'c-other-block-decl-kwds))
9365 ;; This is inconsistent: Should use `containing-decl-open'
9366 ;; here if it's at boi, like in case 5J.
9367 (goto-char containing-decl-start)
9368 (c-add-stmt-syntax
9369 (if (string-equal (symbol-name containing-decl-kwd) "extern")
9370 ;; Special case for compatibility with the
9371 ;; extern-lang syntactic symbols.
9372 'extern-lang-close
9373 (intern (concat (symbol-name containing-decl-kwd)
9374 "-close")))
9375 nil t
9376 (c-most-enclosing-brace paren-state (point))
9377 paren-state))
9378
9379 ;; CASE 5G: we are looking at the brace which closes the
9380 ;; enclosing nested class decl
9381 ((and containing-sexp
9382 (eq char-after-ip ?})
9383 (eq containing-decl-open containing-sexp))
9384 (c-add-class-syntax 'class-close
9385 containing-decl-open 9149 containing-decl-open
9386 containing-decl-start 9150 containing-decl-start
9387 containing-decl-kwd 9151 containing-decl-kwd
9388 paren-state)) 9152 paren-state))
9389 9153
9390 ;; CASE 5H: we could be looking at subsequent knr-argdecls 9154 ;; CASE 5A.5: ordinary defun open
9155 (t
9156 (save-excursion
9157 (c-beginning-of-decl-1 lim)
9158 (while (looking-at c-specifier-key)
9159 (goto-char (match-end 1))
9160 (c-forward-syntactic-ws indent-point))
9161 (c-add-syntax 'defun-open (c-point 'boi))
9162 ;; Bogus to use bol here, but it's the legacy. (Resolved,
9163 ;; 2007-11-09)
9164 ))))
9165
9166 ;; CASE 5B: After a function header but before the body (or
9167 ;; the ending semicolon if there's no body).
9168 ((save-excursion
9169 (when (setq placeholder (c-just-after-func-arglist-p lim))
9170 (setq tmp-pos (point))))
9171 (cond
9172
9173 ;; CASE 5B.1: Member init list.
9174 ((eq (char-after tmp-pos) ?:)
9175 (if (or (> tmp-pos indent-point)
9176 (= (c-point 'bosws) (1+ tmp-pos)))
9177 (progn
9178 ;; There is no preceding member init clause.
9179 ;; Indent relative to the beginning of indentation
9180 ;; for the topmost-intro line that contains the
9181 ;; prototype's open paren.
9182 (goto-char placeholder)
9183 (c-add-syntax 'member-init-intro (c-point 'boi)))
9184 ;; Indent relative to the first member init clause.
9185 (goto-char (1+ tmp-pos))
9186 (c-forward-syntactic-ws)
9187 (c-add-syntax 'member-init-cont (point))))
9188
9189 ;; CASE 5B.2: K&R arg decl intro
9391 ((and c-recognize-knr-p 9190 ((and c-recognize-knr-p
9392 (not containing-sexp) ; can't be knr inside braces. 9191 (c-in-knr-argdecl lim))
9393 (not (eq char-before-ip ?})) 9192 (c-beginning-of-statement-1 lim)
9394 (save-excursion 9193 (c-add-syntax 'knr-argdecl-intro (c-point 'boi))
9395 (setq placeholder (cdr (c-beginning-of-decl-1 lim))) 9194 (if containing-decl-open
9396 (and placeholder 9195 (c-add-class-syntax 'inclass
9397 ;; Do an extra check to avoid tripping up on 9196 containing-decl-open
9398 ;; statements that occur in invalid contexts 9197 containing-decl-start
9399 ;; (e.g. in macro bodies where we don't really 9198 containing-decl-kwd
9400 ;; know the context of what we're looking at). 9199 paren-state)))
9401 (not (and c-opt-block-stmt-key 9200
9402 (looking-at c-opt-block-stmt-key))))) 9201 ;; CASE 5B.4: Nether region after a C++ or Java func
9403 (< placeholder indent-point)) 9202 ;; decl, which could include a `throws' declaration.
9404 (goto-char placeholder) 9203 (t
9405 (c-add-syntax 'knr-argdecl (point))) 9204 (c-beginning-of-statement-1 lim)
9406 9205 (c-add-syntax 'func-decl-cont (c-point 'boi))
9407 ;; CASE 5I: ObjC method definition. 9206 )))
9408 ((and c-opt-method-key 9207
9409 (looking-at c-opt-method-key)) 9208 ;; CASE 5C: inheritance line. could be first inheritance
9410 (c-beginning-of-statement-1 nil t) 9209 ;; line, or continuation of a multiple inheritance
9411 (if (= (point) indent-point) 9210 ((or (and (c-major-mode-is 'c++-mode)
9412 ;; Handle the case when it's the first (non-comment) 9211 (progn
9413 ;; thing in the buffer. Can't look for a 'same return 9212 (when (eq char-after-ip ?,)
9414 ;; value from cbos1 since ObjC directives currently 9213 (skip-chars-forward " \t")
9415 ;; aren't recognized fully, so that we get 'same 9214 (forward-char))
9416 ;; instead of 'previous if it moved over a preceding 9215 (looking-at c-opt-postfix-decl-spec-key)))
9417 ;; directive. 9216 (and (or (eq char-before-ip ?:)
9418 (goto-char (point-min))) 9217 ;; watch out for scope operator
9419 (c-add-syntax 'objc-method-intro (c-point 'boi))) 9218 (save-excursion
9420 9219 (and (eq char-after-ip ?:)
9421 ;; CASE 5P: AWK pattern or function or continuation 9220 (c-safe (forward-char 1) t)
9422 ;; thereof. 9221 (not (eq (char-after) ?:))
9423 ((c-major-mode-is 'awk-mode) 9222 )))
9424 (setq placeholder (point))
9425 (c-add-stmt-syntax
9426 (if (and (eq (c-beginning-of-statement-1) 'same)
9427 (/= (point) placeholder))
9428 'topmost-intro-cont
9429 'topmost-intro)
9430 nil nil
9431 containing-sexp paren-state))
9432
9433 ;; CASE 5N: At a variable declaration that follows a class
9434 ;; definition or some other block declaration that doesn't
9435 ;; end at the closing '}'. C.f. case 5D.5.
9436 ((progn
9437 (c-backward-syntactic-ws lim)
9438 (and (eq (char-before) ?})
9439 (save-excursion 9223 (save-excursion
9440 (let ((start (point))) 9224 (c-backward-syntactic-ws lim)
9441 (if (and c-state-cache 9225 (if (eq char-before-ip ?:)
9442 (consp (car c-state-cache)) 9226 (progn
9443 (eq (cdar c-state-cache) (point))) 9227 (forward-char -1)
9444 ;; Speed up the backward search a bit. 9228 (c-backward-syntactic-ws lim)))
9445 (goto-char (caar c-state-cache))) 9229 (back-to-indentation)
9446 (c-beginning-of-decl-1 containing-sexp) 9230 (looking-at c-class-key)))
9447 (setq placeholder (point)) 9231 ;; for Java
9448 (if (= start (point)) 9232 (and (c-major-mode-is 'java-mode)
9449 ;; The '}' is unbalanced. 9233 (let ((fence (save-excursion
9450 nil 9234 (c-beginning-of-statement-1 lim)
9451 (c-end-of-decl-1) 9235 (point)))
9452 (>= (point) indent-point)))))) 9236 cont done)
9453 (goto-char placeholder) 9237 (save-excursion
9454 (c-add-stmt-syntax 'topmost-intro-cont nil nil 9238 (while (not done)
9455 containing-sexp paren-state)) 9239 (cond ((looking-at c-opt-postfix-decl-spec-key)
9240 (setq injava-inher (cons cont (point))
9241 done t))
9242 ((or (not (c-safe (c-forward-sexp -1) t))
9243 (<= (point) fence))
9244 (setq done t))
9245 )
9246 (setq cont t)))
9247 injava-inher)
9248 (not (c-crosses-statement-barrier-p (cdr injava-inher)
9249 (point)))
9250 ))
9251 (cond
9456 9252
9457 ;; NOTE: The point is at the end of the previous token here. 9253 ;; CASE 5C.1: non-hanging colon on an inher intro
9254 ((eq char-after-ip ?:)
9255 (c-beginning-of-statement-1 lim)
9256 (c-add-syntax 'inher-intro (c-point 'boi))
9257 ;; don't add inclass symbol since relative point already
9258 ;; contains any class offset
9259 )
9458 9260
9459 ;; CASE 5J: we are at the topmost level, make 9261 ;; CASE 5C.2: hanging colon on an inher intro
9460 ;; sure we skip back past any access specifiers 9262 ((eq char-before-ip ?:)
9461 ((and 9263 (c-beginning-of-statement-1 lim)
9462 ;; A macro continuation line is never at top level. 9264 (c-add-syntax 'inher-intro (c-point 'boi))
9463 (not (and macro-start
9464 (> indent-point macro-start)))
9465 (save-excursion
9466 (setq placeholder (point))
9467 (or (memq char-before-ip '(?\; ?{ ?} nil))
9468 (c-at-vsemi-p before-ws-ip)
9469 (when (and (eq char-before-ip ?:)
9470 (eq (c-beginning-of-statement-1 lim)
9471 'label))
9472 (c-backward-syntactic-ws lim)
9473 (setq placeholder (point)))
9474 (and (c-major-mode-is 'objc-mode)
9475 (catch 'not-in-directive
9476 (c-beginning-of-statement-1 lim)
9477 (setq placeholder (point))
9478 (while (and (c-forward-objc-directive)
9479 (< (point) indent-point))
9480 (c-forward-syntactic-ws)
9481 (if (>= (point) indent-point)
9482 (throw 'not-in-directive t))
9483 (setq placeholder (point)))
9484 nil)))))
9485 ;; For historic reasons we anchor at bol of the last
9486 ;; line of the previous declaration. That's clearly
9487 ;; highly bogus and useless, and it makes our lives hard
9488 ;; to remain compatible. :P
9489 (goto-char placeholder)
9490 (c-add-syntax 'topmost-intro (c-point 'bol))
9491 (if containing-decl-open 9265 (if containing-decl-open
9492 (if (c-keyword-member containing-decl-kwd 9266 (c-add-class-syntax 'inclass
9493 'c-other-block-decl-kwds) 9267 containing-decl-open
9494 (progn 9268 containing-decl-start
9495 (goto-char (c-brace-anchor-point containing-decl-open)) 9269 containing-decl-kwd
9496 (c-add-stmt-syntax 9270 paren-state)))
9497 (if (string-equal (symbol-name containing-decl-kwd) 9271
9498 "extern") 9272 ;; CASE 5C.3: in a Java implements/extends
9499 ;; Special case for compatibility with the 9273 (injava-inher
9500 ;; extern-lang syntactic symbols. 9274 (let ((where (cdr injava-inher))
9501 'inextern-lang 9275 (cont (car injava-inher)))
9502 (intern (concat "in" 9276 (goto-char where)
9503 (symbol-name containing-decl-kwd)))) 9277 (cond ((looking-at "throws\\>[^_]")
9504 nil t 9278 (c-add-syntax 'func-decl-cont
9505 (c-most-enclosing-brace paren-state (point)) 9279 (progn (c-beginning-of-statement-1 lim)
9506 paren-state)) 9280 (c-point 'boi))))
9507 (c-add-class-syntax 'inclass 9281 (cont (c-add-syntax 'inher-cont where))
9508 containing-decl-open 9282 (t (c-add-syntax 'inher-intro
9509 containing-decl-start 9283 (progn (goto-char (cdr injava-inher))
9510 containing-decl-kwd 9284 (c-beginning-of-statement-1 lim)
9511 paren-state))) 9285 (point))))
9512 (when (and c-syntactic-indentation-in-macros 9286 )))
9513 macro-start 9287
9514 (/= macro-start (c-point 'boi indent-point))) 9288 ;; CASE 5C.4: a continued inheritance line
9515 (c-add-syntax 'cpp-define-intro) 9289 (t
9516 (setq macro-start nil))) 9290 (c-beginning-of-inheritance-list lim)
9517 9291 (c-add-syntax 'inher-cont (point))
9518 ;; CASE 5K: we are at an ObjC method definition 9292 ;; don't add inclass symbol since relative point already
9519 ;; continuation line. 9293 ;; contains any class offset
9520 ((and c-opt-method-key 9294 )))
9295
9296 ;; CASE 5D: this could be a top-level initialization, a
9297 ;; member init list continuation, or a template argument
9298 ;; list continuation.
9299 ((save-excursion
9300 ;; Note: We use the fact that lim is always after any
9301 ;; preceding brace sexp.
9302 (if c-recognize-<>-arglists
9303 (while (and
9304 (progn
9305 (c-syntactic-skip-backward "^;,=<>" lim t)
9306 (> (point) lim))
9307 (or
9308 (when c-overloadable-operators-regexp
9309 (when (setq placeholder (c-after-special-operator-id lim))
9310 (goto-char placeholder)
9311 t))
9312 (cond
9313 ((eq (char-before) ?>)
9314 (or (c-backward-<>-arglist nil lim)
9315 (backward-char))
9316 t)
9317 ((eq (char-before) ?<)
9318 (backward-char)
9319 (if (save-excursion
9320 (c-forward-<>-arglist nil))
9321 (progn (forward-char)
9322 nil)
9323 t))
9324 (t nil)))))
9325 ;; NB: No c-after-special-operator-id stuff in this
9326 ;; clause - we assume only C++ needs it.
9327 (c-syntactic-skip-backward "^;,=" lim t))
9328 (memq (char-before) '(?, ?= ?<)))
9329 (cond
9330
9331 ;; CASE 5D.3: perhaps a template list continuation?
9332 ((and (c-major-mode-is 'c++-mode)
9333 (save-excursion
9334 (save-restriction
9335 (c-with-syntax-table c++-template-syntax-table
9336 (goto-char indent-point)
9337 (setq placeholder (c-up-list-backward))
9338 (and placeholder
9339 (eq (char-after placeholder) ?<))))))
9340 (c-with-syntax-table c++-template-syntax-table
9341 (goto-char placeholder)
9342 (c-beginning-of-statement-1 lim t)
9343 (if (save-excursion
9344 (c-backward-syntactic-ws lim)
9345 (eq (char-before) ?<))
9346 ;; In a nested template arglist.
9347 (progn
9348 (goto-char placeholder)
9349 (c-syntactic-skip-backward "^,;" lim t)
9350 (c-forward-syntactic-ws))
9351 (back-to-indentation)))
9352 ;; FIXME: Should use c-add-stmt-syntax, but it's not yet
9353 ;; template aware.
9354 (c-add-syntax 'template-args-cont (point) placeholder))
9355
9356 ;; CASE 5D.4: perhaps a multiple inheritance line?
9357 ((and (c-major-mode-is 'c++-mode)
9521 (save-excursion 9358 (save-excursion
9522 (c-beginning-of-statement-1 lim) 9359 (c-beginning-of-statement-1 lim)
9523 (beginning-of-line) 9360 (setq placeholder (point))
9524 (when (looking-at c-opt-method-key) 9361 (if (looking-at "static\\>[^_]")
9525 (setq placeholder (point))))) 9362 (c-forward-token-2 1 nil indent-point))
9526 (c-add-syntax 'objc-method-args-cont placeholder)) 9363 (and (looking-at c-class-key)
9364 (zerop (c-forward-token-2 2 nil indent-point))
9365 (if (eq (char-after) ?<)
9366 (c-with-syntax-table c++-template-syntax-table
9367 (zerop (c-forward-token-2 1 t indent-point)))
9368 t)
9369 (eq (char-after) ?:))))
9370 (goto-char placeholder)
9371 (c-add-syntax 'inher-cont (c-point 'boi)))
9372
9373 ;; CASE 5D.5: Continuation of the "expression part" of a
9374 ;; top level construct. Or, perhaps, an unrecognised construct.
9375 (t
9376 (while (and (setq placeholder (point))
9377 (eq (car (c-beginning-of-decl-1 containing-sexp))
9378 'same)
9379 (save-excursion
9380 (c-backward-syntactic-ws)
9381 (eq (char-before) ?}))
9382 (< (point) placeholder)))
9383 (c-add-stmt-syntax
9384 (cond
9385 ((eq (point) placeholder) 'statement) ; unrecognised construct
9386 ;; A preceding comma at the top level means that a
9387 ;; new variable declaration starts here. Use
9388 ;; topmost-intro-cont for it, for consistency with
9389 ;; the first variable declaration. C.f. case 5N.
9390 ((eq char-before-ip ?,) 'topmost-intro-cont)
9391 (t 'statement-cont))
9392 nil nil containing-sexp paren-state))
9393 ))
9394
9395 ;; CASE 5F: Close of a non-class declaration level block.
9396 ((and (eq char-after-ip ?})
9397 (c-keyword-member containing-decl-kwd
9398 'c-other-block-decl-kwds))
9399 ;; This is inconsistent: Should use `containing-decl-open'
9400 ;; here if it's at boi, like in case 5J.
9401 (goto-char containing-decl-start)
9402 (c-add-stmt-syntax
9403 (if (string-equal (symbol-name containing-decl-kwd) "extern")
9404 ;; Special case for compatibility with the
9405 ;; extern-lang syntactic symbols.
9406 'extern-lang-close
9407 (intern (concat (symbol-name containing-decl-kwd)
9408 "-close")))
9409 nil t
9410 (c-most-enclosing-brace paren-state (point))
9411 paren-state))
9412
9413 ;; CASE 5G: we are looking at the brace which closes the
9414 ;; enclosing nested class decl
9415 ((and containing-sexp
9416 (eq char-after-ip ?})
9417 (eq containing-decl-open containing-sexp))
9418 (c-add-class-syntax 'class-close
9419 containing-decl-open
9420 containing-decl-start
9421 containing-decl-kwd
9422 paren-state))
9423
9424 ;; CASE 5H: we could be looking at subsequent knr-argdecls
9425 ((and c-recognize-knr-p
9426 (not containing-sexp) ; can't be knr inside braces.
9427 (not (eq char-before-ip ?}))
9428 (save-excursion
9429 (setq placeholder (cdr (c-beginning-of-decl-1 lim)))
9430 (and placeholder
9431 ;; Do an extra check to avoid tripping up on
9432 ;; statements that occur in invalid contexts
9433 ;; (e.g. in macro bodies where we don't really
9434 ;; know the context of what we're looking at).
9435 (not (and c-opt-block-stmt-key
9436 (looking-at c-opt-block-stmt-key)))))
9437 (< placeholder indent-point))
9438 (goto-char placeholder)
9439 (c-add-syntax 'knr-argdecl (point)))
9440
9441 ;; CASE 5I: ObjC method definition.
9442 ((and c-opt-method-key
9443 (looking-at c-opt-method-key))
9444 (c-beginning-of-statement-1 nil t)
9445 (if (= (point) indent-point)
9446 ;; Handle the case when it's the first (non-comment)
9447 ;; thing in the buffer. Can't look for a 'same return
9448 ;; value from cbos1 since ObjC directives currently
9449 ;; aren't recognized fully, so that we get 'same
9450 ;; instead of 'previous if it moved over a preceding
9451 ;; directive.
9452 (goto-char (point-min)))
9453 (c-add-syntax 'objc-method-intro (c-point 'boi)))
9454
9455 ;; CASE 5P: AWK pattern or function or continuation
9456 ;; thereof.
9457 ((c-major-mode-is 'awk-mode)
9458 (setq placeholder (point))
9459 (c-add-stmt-syntax
9460 (if (and (eq (c-beginning-of-statement-1) 'same)
9461 (/= (point) placeholder))
9462 'topmost-intro-cont
9463 'topmost-intro)
9464 nil nil
9465 containing-sexp paren-state))
9466
9467 ;; CASE 5N: At a variable declaration that follows a class
9468 ;; definition or some other block declaration that doesn't
9469 ;; end at the closing '}'. C.f. case 5D.5.
9470 ((progn
9471 (c-backward-syntactic-ws lim)
9472 (and (eq (char-before) ?})
9473 (save-excursion
9474 (let ((start (point)))
9475 (if (and c-state-cache
9476 (consp (car c-state-cache))
9477 (eq (cdar c-state-cache) (point)))
9478 ;; Speed up the backward search a bit.
9479 (goto-char (caar c-state-cache)))
9480 (c-beginning-of-decl-1 containing-sexp)
9481 (setq placeholder (point))
9482 (if (= start (point))
9483 ;; The '}' is unbalanced.
9484 nil
9485 (c-end-of-decl-1)
9486 (>= (point) indent-point))))))
9487 (goto-char placeholder)
9488 (c-add-stmt-syntax 'topmost-intro-cont nil nil
9489 containing-sexp paren-state))
9490
9491 ;; NOTE: The point is at the end of the previous token here.
9492
9493 ;; CASE 5J: we are at the topmost level, make
9494 ;; sure we skip back past any access specifiers
9495 ((and
9496 ;; A macro continuation line is never at top level.
9497 (not (and macro-start
9498 (> indent-point macro-start)))
9499 (save-excursion
9500 (setq placeholder (point))
9501 (or (memq char-before-ip '(?\; ?{ ?} nil))
9502 (c-at-vsemi-p before-ws-ip)
9503 (when (and (eq char-before-ip ?:)
9504 (eq (c-beginning-of-statement-1 lim)
9505 'label))
9506 (c-backward-syntactic-ws lim)
9507 (setq placeholder (point)))
9508 (and (c-major-mode-is 'objc-mode)
9509 (catch 'not-in-directive
9510 (c-beginning-of-statement-1 lim)
9511 (setq placeholder (point))
9512 (while (and (c-forward-objc-directive)
9513 (< (point) indent-point))
9514 (c-forward-syntactic-ws)
9515 (if (>= (point) indent-point)
9516 (throw 'not-in-directive t))
9517 (setq placeholder (point)))
9518 nil)))))
9519 ;; For historic reasons we anchor at bol of the last
9520 ;; line of the previous declaration. That's clearly
9521 ;; highly bogus and useless, and it makes our lives hard
9522 ;; to remain compatible. :P
9523 (goto-char placeholder)
9524 (c-add-syntax 'topmost-intro (c-point 'bol))
9525 (if containing-decl-open
9526 (if (c-keyword-member containing-decl-kwd
9527 'c-other-block-decl-kwds)
9528 (progn
9529 (goto-char (c-brace-anchor-point containing-decl-open))
9530 (c-add-stmt-syntax
9531 (if (string-equal (symbol-name containing-decl-kwd)
9532 "extern")
9533 ;; Special case for compatibility with the
9534 ;; extern-lang syntactic symbols.
9535 'inextern-lang
9536 (intern (concat "in"
9537 (symbol-name containing-decl-kwd))))
9538 nil t
9539 (c-most-enclosing-brace paren-state (point))
9540 paren-state))
9541 (c-add-class-syntax 'inclass
9542 containing-decl-open
9543 containing-decl-start
9544 containing-decl-kwd
9545 paren-state)))
9546 (when (and c-syntactic-indentation-in-macros
9547 macro-start
9548 (/= macro-start (c-point 'boi indent-point)))
9549 (c-add-syntax 'cpp-define-intro)
9550 (setq macro-start nil)))
9551
9552 ;; CASE 5K: we are at an ObjC method definition
9553 ;; continuation line.
9554 ((and c-opt-method-key
9555 (save-excursion
9556 (c-beginning-of-statement-1 lim)
9557 (beginning-of-line)
9558 (when (looking-at c-opt-method-key)
9559 (setq placeholder (point)))))
9560 (c-add-syntax 'objc-method-args-cont placeholder))
9527 9561
9528 ;; CASE 5L: we are at the first argument of a template 9562 ;; CASE 5L: we are at the first argument of a template
9529 ;; arglist that begins on the previous line. 9563 ;; arglist that begins on the previous line.
9530 ((and c-recognize-<>-arglists 9564 ((and c-recognize-<>-arglists
9531 (eq (char-before) ?<) 9565 (eq (char-before) ?<)
@@ -9539,32 +9573,32 @@ comment at the start of cc-engine.el for more info."
9539 (c-beginning-of-statement-1 containing-sexp) 9573 (c-beginning-of-statement-1 containing-sexp)
9540 (c-add-stmt-syntax 'statement nil t containing-sexp paren-state)) 9574 (c-add-stmt-syntax 'statement nil t containing-sexp paren-state))
9541 9575
9542 ;;CASE 5N: We are at a tompmost continuation line and the only 9576 ;;CASE 5N: We are at a tompmost continuation line and the only
9543 ;;preceding items are annotations. 9577 ;;preceding items are annotations.
9544 ((and (c-major-mode-is 'java-mode) 9578 ((and (c-major-mode-is 'java-mode)
9545 (setq placeholder (point)) 9579 (setq placeholder (point))
9546 (c-beginning-of-statement-1) 9580 (c-beginning-of-statement-1)
9547 (progn 9581 (progn
9548 (while (and (c-forward-annotation)) 9582 (while (and (c-forward-annotation))
9549 (c-forward-syntactic-ws)) 9583 (c-forward-syntactic-ws))
9550 t) 9584 t)
9551 (prog1 9585 (prog1
9552 (>= (point) placeholder) 9586 (>= (point) placeholder)
9553 (goto-char placeholder))) 9587 (goto-char placeholder)))
9554 (c-add-syntax 'annotation-top-cont (c-point 'boi))) 9588 (c-add-syntax 'annotation-top-cont (c-point 'boi)))
9555 9589
9556 ;; CASE 5M: we are at a topmost continuation line 9590 ;; CASE 5M: we are at a topmost continuation line
9557 (t 9591 (t
9558 (c-beginning-of-statement-1 (c-safe-position (point) paren-state)) 9592 (c-beginning-of-statement-1 (c-safe-position (point) paren-state))
9559 (when (c-major-mode-is 'objc-mode) 9593 (when (c-major-mode-is 'objc-mode)
9560 (setq placeholder (point)) 9594 (setq placeholder (point))
9561 (while (and (c-forward-objc-directive) 9595 (while (and (c-forward-objc-directive)
9562 (< (point) indent-point)) 9596 (< (point) indent-point))
9563 (c-forward-syntactic-ws) 9597 (c-forward-syntactic-ws)
9564 (setq placeholder (point))) 9598 (setq placeholder (point)))
9565 (goto-char placeholder)) 9599 (goto-char placeholder))
9566 (c-add-syntax 'topmost-intro-cont (c-point 'boi))) 9600 (c-add-syntax 'topmost-intro-cont (c-point 'boi)))
9567 )) 9601 ))
9568 9602
9569 9603
9570 ;; (CASE 6 has been removed.) 9604 ;; (CASE 6 has been removed.)
@@ -9580,576 +9614,576 @@ comment at the start of cc-engine.el for more info."
9580 (cond 9614 (cond
9581 9615
9582 ;; CASE 7A: we are looking at the arglist closing paren. 9616 ;; CASE 7A: we are looking at the arglist closing paren.
9583 ;; C.f. case 7F. 9617 ;; C.f. case 7F.
9584 ((memq char-after-ip '(?\) ?\])) 9618 ((memq char-after-ip '(?\) ?\]))
9585 (goto-char containing-sexp) 9619 (goto-char containing-sexp)
9586 (setq placeholder (c-point 'boi)) 9620 (setq placeholder (c-point 'boi))
9587 (if (and (c-safe (backward-up-list 1) t) 9621 (if (and (c-safe (backward-up-list 1) t)
9588 (>= (point) placeholder)) 9622 (>= (point) placeholder))
9589 (progn 9623 (progn
9590 (forward-char) 9624 (forward-char)
9591 (skip-chars-forward " \t")) 9625 (skip-chars-forward " \t"))
9592 (goto-char placeholder)) 9626 (goto-char placeholder))
9593 (c-add-stmt-syntax 'arglist-close (list containing-sexp) t 9627 (c-add-stmt-syntax 'arglist-close (list containing-sexp) t
9594 (c-most-enclosing-brace paren-state (point)) 9628 (c-most-enclosing-brace paren-state (point))
9595 paren-state)) 9629 paren-state))
9596 9630
9597 ;; CASE 19: line is an expression, not a statement, and is directly
9598 ;; contained by a template delimiter. Most likely, we are in a
9599 ;; template arglist within a statement. This case is based on CASE
9600 ;; 7. At some point in the future, we may wish to create more
9601 ;; syntactic symbols such as `template-intro',
9602 ;; `template-cont-nonempty', etc., and distinguish between them as we
9603 ;; do for `arglist-intro' etc. (2009-12-07).
9604 ((and c-recognize-<>-arglists
9605 (setq containing-< (c-up-list-backward indent-point containing-sexp))
9606 (eq (char-after containing-<) ?\<))
9607 (setq placeholder (c-point 'boi containing-<))
9608 (goto-char containing-sexp) ; Most nested Lbrace/Lparen (but not
9609 ; '<') before indent-point.
9610 (if (>= (point) placeholder)
9611 (progn
9612 (forward-char)
9613 (skip-chars-forward " \t"))
9614 (goto-char placeholder))
9615 (c-add-stmt-syntax 'template-args-cont (list containing-<) t
9616 (c-most-enclosing-brace c-state-cache (point))
9617 paren-state))
9618
9619 ;; CASE 7B: Looking at the opening brace of an 9631 ;; CASE 7B: Looking at the opening brace of an
9620 ;; in-expression block or brace list. C.f. cases 4, 16A 9632 ;; in-expression block or brace list. C.f. cases 4, 16A
9621 ;; and 17E. 9633 ;; and 17E.
9622 ((and (eq char-after-ip ?{) 9634 ((and (eq char-after-ip ?{)
9623 (progn 9635 (progn
9624 (setq placeholder (c-inside-bracelist-p (point) 9636 (setq placeholder (c-inside-bracelist-p (point)
9625 paren-state)) 9637 paren-state))
9626 (if placeholder 9638 (if placeholder
9627 (setq tmpsymbol '(brace-list-open . inexpr-class)) 9639 (setq tmpsymbol '(brace-list-open . inexpr-class))
9628 (setq tmpsymbol '(block-open . inexpr-statement) 9640 (setq tmpsymbol '(block-open . inexpr-statement)
9629 placeholder 9641 placeholder
9630 (cdr-safe (c-looking-at-inexpr-block 9642 (cdr-safe (c-looking-at-inexpr-block
9631 (c-safe-position containing-sexp 9643 (c-safe-position containing-sexp
9632 paren-state) 9644 paren-state)
9633 containing-sexp))) 9645 containing-sexp)))
9634 ;; placeholder is nil if it's a block directly in 9646 ;; placeholder is nil if it's a block directly in
9635 ;; a function arglist. That makes us skip out of 9647 ;; a function arglist. That makes us skip out of
9636 ;; this case. 9648 ;; this case.
9637 ))) 9649 )))
9638 (goto-char placeholder) 9650 (goto-char placeholder)
9639 (back-to-indentation) 9651 (back-to-indentation)
9640 (c-add-stmt-syntax (car tmpsymbol) nil t 9652 (c-add-stmt-syntax (car tmpsymbol) nil t
9641 (c-most-enclosing-brace paren-state (point)) 9653 (c-most-enclosing-brace paren-state (point))
9642 paren-state) 9654 paren-state)
9643 (if (/= (point) placeholder) 9655 (if (/= (point) placeholder)
9644 (c-add-syntax (cdr tmpsymbol)))) 9656 (c-add-syntax (cdr tmpsymbol))))
9645 9657
9646 ;; CASE 7C: we are looking at the first argument in an empty 9658 ;; CASE 7C: we are looking at the first argument in an empty
9647 ;; argument list. Use arglist-close if we're actually 9659 ;; argument list. Use arglist-close if we're actually
9648 ;; looking at a close paren or bracket. 9660 ;; looking at a close paren or bracket.
9649 ((memq char-before-ip '(?\( ?\[)) 9661 ((memq char-before-ip '(?\( ?\[))
9662 (goto-char containing-sexp)
9663 (setq placeholder (c-point 'boi))
9664 (if (and (c-safe (backward-up-list 1) t)
9665 (>= (point) placeholder))
9666 (progn
9667 (forward-char)
9668 (skip-chars-forward " \t"))
9669 (goto-char placeholder))
9670 (c-add-stmt-syntax 'arglist-intro (list containing-sexp) t
9671 (c-most-enclosing-brace paren-state (point))
9672 paren-state))
9673
9674 ;; CASE 7D: we are inside a conditional test clause. treat
9675 ;; these things as statements
9676 ((progn
9650 (goto-char containing-sexp) 9677 (goto-char containing-sexp)
9651 (setq placeholder (c-point 'boi)) 9678 (and (c-safe (c-forward-sexp -1) t)
9652 (if (and (c-safe (backward-up-list 1) t) 9679 (looking-at "\\<for\\>[^_]")))
9653 (>= (point) placeholder)) 9680 (goto-char (1+ containing-sexp))
9654 (progn 9681 (c-forward-syntactic-ws indent-point)
9655 (forward-char) 9682 (if (eq char-before-ip ?\;)
9656 (skip-chars-forward " \t")) 9683 (c-add-syntax 'statement (point))
9657 (goto-char placeholder)) 9684 (c-add-syntax 'statement-cont (point))
9658 (c-add-stmt-syntax 'arglist-intro (list containing-sexp) t 9685 ))
9659 (c-most-enclosing-brace paren-state (point)) 9686
9660 paren-state)) 9687 ;; CASE 7E: maybe a continued ObjC method call. This is the
9688 ;; case when we are inside a [] bracketed exp, and what
9689 ;; precede the opening bracket is not an identifier.
9690 ((and c-opt-method-key
9691 (eq (char-after containing-sexp) ?\[)
9692 (progn
9693 (goto-char (1- containing-sexp))
9694 (c-backward-syntactic-ws (c-point 'bod))
9695 (if (not (looking-at c-symbol-key))
9696 (c-add-syntax 'objc-method-call-cont containing-sexp))
9697 )))
9661 9698
9662 ;; CASE 7D: we are inside a conditional test clause. treat 9699 ;; CASE 7F: we are looking at an arglist continuation line,
9663 ;; these things as statements 9700 ;; but the preceding argument is on the same line as the
9664 ((progn 9701 ;; opening paren. This case includes multi-line
9665 (goto-char containing-sexp) 9702 ;; mathematical paren groupings, but we could be on a
9666 (and (c-safe (c-forward-sexp -1) t) 9703 ;; for-list continuation line. C.f. case 7A.
9667 (looking-at "\\<for\\>[^_]"))) 9704 ((progn
9668 (goto-char (1+ containing-sexp)) 9705 (goto-char (1+ containing-sexp))
9669 (c-forward-syntactic-ws indent-point) 9706 (< (save-excursion
9670 (if (eq char-before-ip ?\;) 9707 (c-forward-syntactic-ws)
9671 (c-add-syntax 'statement (point)) 9708 (point))
9672 (c-add-syntax 'statement-cont (point)) 9709 (c-point 'bonl)))
9673 )) 9710 (goto-char containing-sexp) ; paren opening the arglist
9674 9711 (setq placeholder (c-point 'boi))
9675 ;; CASE 7E: maybe a continued ObjC method call. This is the 9712 (if (and (c-safe (backward-up-list 1) t)
9676 ;; case when we are inside a [] bracketed exp, and what 9713 (>= (point) placeholder))
9677 ;; precede the opening bracket is not an identifier. 9714 (progn
9678 ((and c-opt-method-key 9715 (forward-char)
9679 (eq (char-after containing-sexp) ?\[) 9716 (skip-chars-forward " \t"))
9680 (progn 9717 (goto-char placeholder))
9681 (goto-char (1- containing-sexp)) 9718 (c-add-stmt-syntax 'arglist-cont-nonempty (list containing-sexp) t
9682 (c-backward-syntactic-ws (c-point 'bod)) 9719 (c-most-enclosing-brace c-state-cache (point))
9683 (if (not (looking-at c-symbol-key)) 9720 paren-state))
9684 (c-add-syntax 'objc-method-call-cont containing-sexp))
9685 )))
9686 9721
9687 ;; CASE 7F: we are looking at an arglist continuation line, 9722 ;; CASE 7G: we are looking at just a normal arglist
9688 ;; but the preceding argument is on the same line as the 9723 ;; continuation line
9689 ;; opening paren. This case includes multi-line 9724 (t (c-forward-syntactic-ws indent-point)
9690 ;; mathematical paren groupings, but we could be on a 9725 (c-add-syntax 'arglist-cont (c-point 'boi)))
9691 ;; for-list continuation line. C.f. case 7A. 9726 ))
9692 ((progn
9693 (goto-char (1+ containing-sexp))
9694 (< (save-excursion
9695 (c-forward-syntactic-ws)
9696 (point))
9697 (c-point 'bonl)))
9698 (goto-char containing-sexp) ; paren opening the arglist
9699 (setq placeholder (c-point 'boi))
9700 (if (and (c-safe (backward-up-list 1) t)
9701 (>= (point) placeholder))
9702 (progn
9703 (forward-char)
9704 (skip-chars-forward " \t"))
9705 (goto-char placeholder))
9706 (c-add-stmt-syntax 'arglist-cont-nonempty (list containing-sexp) t
9707 (c-most-enclosing-brace c-state-cache (point))
9708 paren-state))
9709 9727
9710 ;; CASE 7G: we are looking at just a normal arglist 9728 ;; CASE 8: func-local multi-inheritance line
9711 ;; continuation line 9729 ((and (c-major-mode-is 'c++-mode)
9712 (t (c-forward-syntactic-ws indent-point) 9730 (save-excursion
9713 (c-add-syntax 'arglist-cont (c-point 'boi))) 9731 (goto-char indent-point)
9714 )) 9732 (skip-chars-forward " \t")
9733 (looking-at c-opt-postfix-decl-spec-key)))
9734 (goto-char indent-point)
9735 (skip-chars-forward " \t")
9736 (cond
9715 9737
9716 ;; CASE 8: func-local multi-inheritance line 9738 ;; CASE 8A: non-hanging colon on an inher intro
9717 ((and (c-major-mode-is 'c++-mode) 9739 ((eq char-after-ip ?:)
9718 (save-excursion 9740 (c-backward-syntactic-ws lim)
9719 (goto-char indent-point) 9741 (c-add-syntax 'inher-intro (c-point 'boi)))
9720 (skip-chars-forward " \t")
9721 (looking-at c-opt-postfix-decl-spec-key)))
9722 (goto-char indent-point)
9723 (skip-chars-forward " \t")
9724 (cond
9725 9742
9726 ;; CASE 8A: non-hanging colon on an inher intro 9743 ;; CASE 8B: hanging colon on an inher intro
9727 ((eq char-after-ip ?:) 9744 ((eq char-before-ip ?:)
9728 (c-backward-syntactic-ws lim) 9745 (c-add-syntax 'inher-intro (c-point 'boi)))
9729 (c-add-syntax 'inher-intro (c-point 'boi)))
9730 9746
9731 ;; CASE 8B: hanging colon on an inher intro 9747 ;; CASE 8C: a continued inheritance line
9732 ((eq char-before-ip ?:) 9748 (t
9733 (c-add-syntax 'inher-intro (c-point 'boi))) 9749 (c-beginning-of-inheritance-list lim)
9750 (c-add-syntax 'inher-cont (point))
9751 )))
9752
9753 ;; CASE 9: we are inside a brace-list
9754 ((and (not (c-major-mode-is 'awk-mode)) ; Maybe this isn't needed (ACM, 2002/3/29)
9755 (setq special-brace-list
9756 (or (and c-special-brace-lists ;;;; ALWAYS NIL FOR AWK!!
9757 (save-excursion
9758 (goto-char containing-sexp)
9759 (c-looking-at-special-brace-list)))
9760 (c-inside-bracelist-p containing-sexp paren-state))))
9761 (cond
9734 9762
9735 ;; CASE 8C: a continued inheritance line 9763 ;; CASE 9A: In the middle of a special brace list opener.
9736 (t 9764 ((and (consp special-brace-list)
9737 (c-beginning-of-inheritance-list lim) 9765 (save-excursion
9738 (c-add-syntax 'inher-cont (point)) 9766 (goto-char containing-sexp)
9739 ))) 9767 (eq (char-after) ?\())
9768 (eq char-after-ip (car (cdr special-brace-list))))
9769 (goto-char (car (car special-brace-list)))
9770 (skip-chars-backward " \t")
9771 (if (and (bolp)
9772 (assoc 'statement-cont
9773 (setq placeholder (c-guess-basic-syntax))))
9774 (setq c-syntactic-context placeholder)
9775 (c-beginning-of-statement-1
9776 (c-safe-position (1- containing-sexp) paren-state))
9777 (c-forward-token-2 0)
9778 (while (looking-at c-specifier-key)
9779 (goto-char (match-end 1))
9780 (c-forward-syntactic-ws))
9781 (c-add-syntax 'brace-list-open (c-point 'boi))))
9782
9783 ;; CASE 9B: brace-list-close brace
9784 ((if (consp special-brace-list)
9785 ;; Check special brace list closer.
9786 (progn
9787 (goto-char (car (car special-brace-list)))
9788 (save-excursion
9789 (goto-char indent-point)
9790 (back-to-indentation)
9791 (or
9792 ;; We were between the special close char and the `)'.
9793 (and (eq (char-after) ?\))
9794 (eq (1+ (point)) (cdr (car special-brace-list))))
9795 ;; We were before the special close char.
9796 (and (eq (char-after) (cdr (cdr special-brace-list)))
9797 (zerop (c-forward-token-2))
9798 (eq (1+ (point)) (cdr (car special-brace-list)))))))
9799 ;; Normal brace list check.
9800 (and (eq char-after-ip ?})
9801 (c-safe (goto-char (c-up-list-backward (point))) t)
9802 (= (point) containing-sexp)))
9803 (if (eq (point) (c-point 'boi))
9804 (c-add-syntax 'brace-list-close (point))
9805 (setq lim (c-most-enclosing-brace c-state-cache (point)))
9806 (c-beginning-of-statement-1 lim)
9807 (c-add-stmt-syntax 'brace-list-close nil t lim paren-state)))
9740 9808
9741 ;; CASE 9: we are inside a brace-list 9809 (t
9742 ((and (not (c-major-mode-is 'awk-mode)) ; Maybe this isn't needed (ACM, 2002/3/29) 9810 ;; Prepare for the rest of the cases below by going to the
9743 (setq special-brace-list 9811 ;; token following the opening brace
9744 (or (and c-special-brace-lists ;;;; ALWAYS NIL FOR AWK!! 9812 (if (consp special-brace-list)
9745 (save-excursion 9813 (progn
9746 (goto-char containing-sexp) 9814 (goto-char (car (car special-brace-list)))
9747 (c-looking-at-special-brace-list))) 9815 (c-forward-token-2 1 nil indent-point))
9748 (c-inside-bracelist-p containing-sexp paren-state)))) 9816 (goto-char containing-sexp))
9817 (forward-char)
9818 (let ((start (point)))
9819 (c-forward-syntactic-ws indent-point)
9820 (goto-char (max start (c-point 'bol))))
9821 (c-skip-ws-forward indent-point)
9749 (cond 9822 (cond
9750 9823
9751 ;; CASE 9A: In the middle of a special brace list opener. 9824 ;; CASE 9C: we're looking at the first line in a brace-list
9752 ((and (consp special-brace-list) 9825 ((= (point) indent-point)
9753 (save-excursion 9826 (if (consp special-brace-list)
9754 (goto-char containing-sexp) 9827 (goto-char (car (car special-brace-list)))
9755 (eq (char-after) ?\()) 9828 (goto-char containing-sexp))
9756 (eq char-after-ip (car (cdr special-brace-list))))
9757 (goto-char (car (car special-brace-list)))
9758 (skip-chars-backward " \t")
9759 (if (and (bolp)
9760 (assoc 'statement-cont
9761 (setq placeholder (c-guess-basic-syntax))))
9762 (setq c-syntactic-context placeholder)
9763 (c-beginning-of-statement-1
9764 (c-safe-position (1- containing-sexp) paren-state))
9765 (c-forward-token-2 0)
9766 (while (looking-at c-specifier-key)
9767 (goto-char (match-end 1))
9768 (c-forward-syntactic-ws))
9769 (c-add-syntax 'brace-list-open (c-point 'boi))))
9770
9771 ;; CASE 9B: brace-list-close brace
9772 ((if (consp special-brace-list)
9773 ;; Check special brace list closer.
9774 (progn
9775 (goto-char (car (car special-brace-list)))
9776 (save-excursion
9777 (goto-char indent-point)
9778 (back-to-indentation)
9779 (or
9780 ;; We were between the special close char and the `)'.
9781 (and (eq (char-after) ?\))
9782 (eq (1+ (point)) (cdr (car special-brace-list))))
9783 ;; We were before the special close char.
9784 (and (eq (char-after) (cdr (cdr special-brace-list)))
9785 (zerop (c-forward-token-2))
9786 (eq (1+ (point)) (cdr (car special-brace-list)))))))
9787 ;; Normal brace list check.
9788 (and (eq char-after-ip ?})
9789 (c-safe (goto-char (c-up-list-backward (point))) t)
9790 (= (point) containing-sexp)))
9791 (if (eq (point) (c-point 'boi)) 9829 (if (eq (point) (c-point 'boi))
9792 (c-add-syntax 'brace-list-close (point)) 9830 (c-add-syntax 'brace-list-intro (point))
9793 (setq lim (c-most-enclosing-brace c-state-cache (point))) 9831 (setq lim (c-most-enclosing-brace c-state-cache (point)))
9794 (c-beginning-of-statement-1 lim) 9832 (c-beginning-of-statement-1 lim)
9795 (c-add-stmt-syntax 'brace-list-close nil t lim paren-state))) 9833 (c-add-stmt-syntax 'brace-list-intro nil t lim paren-state)))
9796 9834
9797 (t 9835 ;; CASE 9D: this is just a later brace-list-entry or
9798 ;; Prepare for the rest of the cases below by going to the 9836 ;; brace-entry-open
9799 ;; token following the opening brace 9837 (t (if (or (eq char-after-ip ?{)
9800 (if (consp special-brace-list) 9838 (and c-special-brace-lists
9801 (progn 9839 (save-excursion
9802 (goto-char (car (car special-brace-list))) 9840 (goto-char indent-point)
9803 (c-forward-token-2 1 nil indent-point)) 9841 (c-forward-syntactic-ws (c-point 'eol))
9804 (goto-char containing-sexp)) 9842 (c-looking-at-special-brace-list (point)))))
9805 (forward-char) 9843 (c-add-syntax 'brace-entry-open (point))
9806 (let ((start (point))) 9844 (c-add-syntax 'brace-list-entry (point))
9807 (c-forward-syntactic-ws indent-point) 9845 ))
9808 (goto-char (max start (c-point 'bol)))) 9846 ))))
9809 (c-skip-ws-forward indent-point) 9847
9810 (cond 9848 ;; CASE 10: A continued statement or top level construct.
9849 ((and (not (memq char-before-ip '(?\; ?:)))
9850 (not (c-at-vsemi-p before-ws-ip))
9851 (or (not (eq char-before-ip ?}))
9852 (c-looking-at-inexpr-block-backward c-state-cache))
9853 (> (point)
9854 (save-excursion
9855 (c-beginning-of-statement-1 containing-sexp)
9856 (setq placeholder (point))))
9857 (/= placeholder containing-sexp))
9858 ;; This is shared with case 18.
9859 (c-guess-continued-construct indent-point
9860 char-after-ip
9861 placeholder
9862 containing-sexp
9863 paren-state))
9864
9865 ;; CASE 16: block close brace, possibly closing the defun or
9866 ;; the class
9867 ((eq char-after-ip ?})
9868 ;; From here on we have the next containing sexp in lim.
9869 (setq lim (c-most-enclosing-brace paren-state))
9870 (goto-char containing-sexp)
9871 (cond
9811 9872
9812 ;; CASE 9C: we're looking at the first line in a brace-list 9873 ;; CASE 16E: Closing a statement block? This catches
9813 ((= (point) indent-point) 9874 ;; cases where it's preceded by a statement keyword,
9814 (if (consp special-brace-list) 9875 ;; which works even when used in an "invalid" context,
9815 (goto-char (car (car special-brace-list))) 9876 ;; e.g. a macro argument.
9816 (goto-char containing-sexp)) 9877 ((c-after-conditional)
9817 (if (eq (point) (c-point 'boi)) 9878 (c-backward-to-block-anchor lim)
9818 (c-add-syntax 'brace-list-intro (point)) 9879 (c-add-stmt-syntax 'block-close nil t lim paren-state))
9819 (setq lim (c-most-enclosing-brace c-state-cache (point))) 9880
9820 (c-beginning-of-statement-1 lim) 9881 ;; CASE 16A: closing a lambda defun or an in-expression
9821 (c-add-stmt-syntax 'brace-list-intro nil t lim paren-state))) 9882 ;; block? C.f. cases 4, 7B and 17E.
9822 9883 ((setq placeholder (c-looking-at-inexpr-block
9823 ;; CASE 9D: this is just a later brace-list-entry or 9884 (c-safe-position containing-sexp paren-state)
9824 ;; brace-entry-open 9885 nil))
9825 (t (if (or (eq char-after-ip ?{) 9886 (setq tmpsymbol (if (eq (car placeholder) 'inlambda)
9826 (and c-special-brace-lists 9887 'inline-close
9827 (save-excursion 9888 'block-close))
9828 (goto-char indent-point)
9829 (c-forward-syntactic-ws (c-point 'eol))
9830 (c-looking-at-special-brace-list (point)))))
9831 (c-add-syntax 'brace-entry-open (point))
9832 (c-add-syntax 'brace-list-entry (point))
9833 ))
9834 ))))
9835
9836 ;; CASE 10: A continued statement or top level construct.
9837 ((and (not (memq char-before-ip '(?\; ?:)))
9838 (not (c-at-vsemi-p before-ws-ip))
9839 (or (not (eq char-before-ip ?}))
9840 (c-looking-at-inexpr-block-backward c-state-cache))
9841 (> (point)
9842 (save-excursion
9843 (c-beginning-of-statement-1 containing-sexp)
9844 (setq placeholder (point))))
9845 (/= placeholder containing-sexp))
9846 ;; This is shared with case 18.
9847 (c-guess-continued-construct indent-point
9848 char-after-ip
9849 placeholder
9850 containing-sexp
9851 paren-state))
9852
9853 ;; CASE 16: block close brace, possibly closing the defun or
9854 ;; the class
9855 ((eq char-after-ip ?})
9856 ;; From here on we have the next containing sexp in lim.
9857 (setq lim (c-most-enclosing-brace paren-state))
9858 (goto-char containing-sexp) 9889 (goto-char containing-sexp)
9859 (cond 9890 (back-to-indentation)
9891 (if (= containing-sexp (point))
9892 (c-add-syntax tmpsymbol (point))
9893 (goto-char (cdr placeholder))
9894 (back-to-indentation)
9895 (c-add-stmt-syntax tmpsymbol nil t
9896 (c-most-enclosing-brace paren-state (point))
9897 paren-state)
9898 (if (/= (point) (cdr placeholder))
9899 (c-add-syntax (car placeholder)))))
9860 9900
9861 ;; CASE 16E: Closing a statement block? This catches 9901 ;; CASE 16B: does this close an inline or a function in
9862 ;; cases where it's preceded by a statement keyword, 9902 ;; a non-class declaration level block?
9863 ;; which works even when used in an "invalid" context, 9903 ((save-excursion
9864 ;; e.g. a macro argument. 9904 (and lim
9865 ((c-after-conditional) 9905 (progn
9866 (c-backward-to-block-anchor lim) 9906 (goto-char lim)
9867 (c-add-stmt-syntax 'block-close nil t lim paren-state)) 9907 (c-looking-at-decl-block
9868 9908 (c-most-enclosing-brace paren-state lim)
9869 ;; CASE 16A: closing a lambda defun or an in-expression 9909 nil))
9870 ;; block? C.f. cases 4, 7B and 17E. 9910 (setq placeholder (point))))
9871 ((setq placeholder (c-looking-at-inexpr-block 9911 (c-backward-to-decl-anchor lim)
9872 (c-safe-position containing-sexp paren-state) 9912 (back-to-indentation)
9873 nil)) 9913 (if (save-excursion
9874 (setq tmpsymbol (if (eq (car placeholder) 'inlambda) 9914 (goto-char placeholder)
9875 'inline-close 9915 (looking-at c-other-decl-block-key))
9876 'block-close)) 9916 (c-add-syntax 'defun-close (point))
9877 (goto-char containing-sexp) 9917 (c-add-syntax 'inline-close (point))))
9878 (back-to-indentation) 9918
9879 (if (= containing-sexp (point)) 9919 ;; CASE 16F: Can be a defun-close of a function declared
9880 (c-add-syntax tmpsymbol (point)) 9920 ;; in a statement block, e.g. in Pike or when using gcc
9881 (goto-char (cdr placeholder)) 9921 ;; extensions, but watch out for macros followed by
9882 (back-to-indentation) 9922 ;; blocks. Let it through to be handled below.
9883 (c-add-stmt-syntax tmpsymbol nil t 9923 ;; C.f. cases B.3 and 17G.
9884 (c-most-enclosing-brace paren-state (point)) 9924 ((save-excursion
9885 paren-state) 9925 (and (not (c-at-statement-start-p))
9886 (if (/= (point) (cdr placeholder)) 9926 (eq (c-beginning-of-statement-1 lim nil nil t) 'same)
9887 (c-add-syntax (car placeholder))))) 9927 (setq placeholder (point))
9888 9928 (let ((c-recognize-typeless-decls nil))
9889 ;; CASE 16B: does this close an inline or a function in 9929 ;; Turn off recognition of constructs that
9890 ;; a non-class declaration level block? 9930 ;; lacks a type in this case, since that's more
9891 ((save-excursion 9931 ;; likely to be a macro followed by a block.
9892 (and lim 9932 (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
9893 (progn 9933 (back-to-indentation)
9894 (goto-char lim) 9934 (if (/= (point) containing-sexp)
9895 (c-looking-at-decl-block 9935 (goto-char placeholder))
9896 (c-most-enclosing-brace paren-state lim) 9936 (c-add-stmt-syntax 'defun-close nil t lim paren-state))
9897 nil)) 9937
9898 (setq placeholder (point)))) 9938 ;; CASE 16C: If there is an enclosing brace then this is
9899 (c-backward-to-decl-anchor lim) 9939 ;; a block close since defun closes inside declaration
9900 (back-to-indentation) 9940 ;; level blocks have been handled above.
9901 (if (save-excursion 9941 (lim
9902 (goto-char placeholder) 9942 ;; If the block is preceded by a case/switch label on
9903 (looking-at c-other-decl-block-key)) 9943 ;; the same line, we anchor at the first preceding label
9904 (c-add-syntax 'defun-close (point)) 9944 ;; at boi. The default handling in c-add-stmt-syntax
9905 (c-add-syntax 'inline-close (point)))) 9945 ;; really fixes it better, but we do like this to keep
9906 9946 ;; the indentation compatible with version 5.28 and
9907 ;; CASE 16F: Can be a defun-close of a function declared 9947 ;; earlier. C.f. case 17H.
9908 ;; in a statement block, e.g. in Pike or when using gcc 9948 (while (and (/= (setq placeholder (point)) (c-point 'boi))
9909 ;; extensions, but watch out for macros followed by 9949 (eq (c-beginning-of-statement-1 lim) 'label)))
9910 ;; blocks. Let it through to be handled below. 9950 (goto-char placeholder)
9911 ;; C.f. cases B.3 and 17G. 9951 (if (looking-at c-label-kwds-regexp)
9912 ((save-excursion 9952 (c-add-syntax 'block-close (point))
9913 (and (not (c-at-statement-start-p)) 9953 (goto-char containing-sexp)
9914 (eq (c-beginning-of-statement-1 lim nil nil t) 'same) 9954 ;; c-backward-to-block-anchor not necessary here; those
9915 (setq placeholder (point)) 9955 ;; situations are handled in case 16E above.
9916 (let ((c-recognize-typeless-decls nil)) 9956 (c-add-stmt-syntax 'block-close nil t lim paren-state)))
9917 ;; Turn off recognition of constructs that
9918 ;; lacks a type in this case, since that's more
9919 ;; likely to be a macro followed by a block.
9920 (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
9921 (back-to-indentation)
9922 (if (/= (point) containing-sexp)
9923 (goto-char placeholder))
9924 (c-add-stmt-syntax 'defun-close nil t lim paren-state))
9925
9926 ;; CASE 16C: If there is an enclosing brace then this is
9927 ;; a block close since defun closes inside declaration
9928 ;; level blocks have been handled above.
9929 (lim
9930 ;; If the block is preceded by a case/switch label on
9931 ;; the same line, we anchor at the first preceding label
9932 ;; at boi. The default handling in c-add-stmt-syntax
9933 ;; really fixes it better, but we do like this to keep
9934 ;; the indentation compatible with version 5.28 and
9935 ;; earlier. C.f. case 17H.
9936 (while (and (/= (setq placeholder (point)) (c-point 'boi))
9937 (eq (c-beginning-of-statement-1 lim) 'label)))
9938 (goto-char placeholder)
9939 (if (looking-at c-label-kwds-regexp)
9940 (c-add-syntax 'block-close (point))
9941 (goto-char containing-sexp)
9942 ;; c-backward-to-block-anchor not necessary here; those
9943 ;; situations are handled in case 16E above.
9944 (c-add-stmt-syntax 'block-close nil t lim paren-state)))
9945
9946 ;; CASE 16D: Only top level defun close left.
9947 (t
9948 (goto-char containing-sexp)
9949 (c-backward-to-decl-anchor lim)
9950 (c-add-stmt-syntax 'defun-close nil nil
9951 (c-most-enclosing-brace paren-state)
9952 paren-state))
9953 ))
9954 9957
9955 ;; CASE 17: Statement or defun catchall. 9958 ;; CASE 16D: Only top level defun close left.
9956 (t 9959 (t
9957 (goto-char indent-point) 9960 (goto-char containing-sexp)
9958 ;; Back up statements until we find one that starts at boi. 9961 (c-backward-to-decl-anchor lim)
9959 (while (let* ((prev-point (point)) 9962 (c-add-stmt-syntax 'defun-close nil nil
9960 (last-step-type (c-beginning-of-statement-1 9963 (c-most-enclosing-brace paren-state)
9961 containing-sexp))) 9964 paren-state))
9962 (if (= (point) prev-point) 9965 ))
9963 (progn 9966
9964 (setq step-type (or step-type last-step-type)) 9967 ;; CASE 19: line is an expression, not a statement, and is directly
9965 nil) 9968 ;; contained by a template delimiter. Most likely, we are in a
9966 (setq step-type last-step-type) 9969 ;; template arglist within a statement. This case is based on CASE
9967 (/= (point) (c-point 'boi))))) 9970 ;; 7. At some point in the future, we may wish to create more
9968 (cond 9971 ;; syntactic symbols such as `template-intro',
9972 ;; `template-cont-nonempty', etc., and distinguish between them as we
9973 ;; do for `arglist-intro' etc. (2009-12-07).
9974 ((and c-recognize-<>-arglists
9975 (setq containing-< (c-up-list-backward indent-point containing-sexp))
9976 (eq (char-after containing-<) ?\<))
9977 (setq placeholder (c-point 'boi containing-<))
9978 (goto-char containing-sexp) ; Most nested Lbrace/Lparen (but not
9979 ; '<') before indent-point.
9980 (if (>= (point) placeholder)
9981 (progn
9982 (forward-char)
9983 (skip-chars-forward " \t"))
9984 (goto-char placeholder))
9985 (c-add-stmt-syntax 'template-args-cont (list containing-<) t
9986 (c-most-enclosing-brace c-state-cache (point))
9987 paren-state))
9969 9988
9970 ;; CASE 17B: continued statement 9989 ;; CASE 17: Statement or defun catchall.
9971 ((and (eq step-type 'same) 9990 (t
9972 (/= (point) indent-point)) 9991 (goto-char indent-point)
9973 (c-add-stmt-syntax 'statement-cont nil nil 9992 ;; Back up statements until we find one that starts at boi.
9974 containing-sexp paren-state)) 9993 (while (let* ((prev-point (point))
9975 9994 (last-step-type (c-beginning-of-statement-1
9976 ;; CASE 17A: After a case/default label? 9995 containing-sexp)))
9977 ((progn 9996 (if (= (point) prev-point)
9978 (while (and (eq step-type 'label) 9997 (progn
9979 (not (looking-at c-label-kwds-regexp))) 9998 (setq step-type (or step-type last-step-type))
9980 (setq step-type 9999 nil)
9981 (c-beginning-of-statement-1 containing-sexp))) 10000 (setq step-type last-step-type)
9982 (eq step-type 'label)) 10001 (/= (point) (c-point 'boi)))))
9983 (c-add-stmt-syntax (if (eq char-after-ip ?{) 10002 (cond
9984 'statement-case-open
9985 'statement-case-intro)
9986 nil t containing-sexp paren-state))
9987
9988 ;; CASE 17D: any old statement
9989 ((progn
9990 (while (eq step-type 'label)
9991 (setq step-type
9992 (c-beginning-of-statement-1 containing-sexp)))
9993 (eq step-type 'previous))
9994 (c-add-stmt-syntax 'statement nil t
9995 containing-sexp paren-state)
9996 (if (eq char-after-ip ?{)
9997 (c-add-syntax 'block-open)))
9998
9999 ;; CASE 17I: Inside a substatement block.
10000 ((progn
10001 ;; The following tests are all based on containing-sexp.
10002 (goto-char containing-sexp)
10003 ;; From here on we have the next containing sexp in lim.
10004 (setq lim (c-most-enclosing-brace paren-state containing-sexp))
10005 (c-after-conditional))
10006 (c-backward-to-block-anchor lim)
10007 (c-add-stmt-syntax 'statement-block-intro nil t
10008 lim paren-state)
10009 (if (eq char-after-ip ?{)
10010 (c-add-syntax 'block-open)))
10011
10012 ;; CASE 17E: first statement in an in-expression block.
10013 ;; C.f. cases 4, 7B and 16A.
10014 ((setq placeholder (c-looking-at-inexpr-block
10015 (c-safe-position containing-sexp paren-state)
10016 nil))
10017 (setq tmpsymbol (if (eq (car placeholder) 'inlambda)
10018 'defun-block-intro
10019 'statement-block-intro))
10020 (back-to-indentation)
10021 (if (= containing-sexp (point))
10022 (c-add-syntax tmpsymbol (point))
10023 (goto-char (cdr placeholder))
10024 (back-to-indentation)
10025 (c-add-stmt-syntax tmpsymbol nil t
10026 (c-most-enclosing-brace c-state-cache (point))
10027 paren-state)
10028 (if (/= (point) (cdr placeholder))
10029 (c-add-syntax (car placeholder))))
10030 (if (eq char-after-ip ?{)
10031 (c-add-syntax 'block-open)))
10032
10033 ;; CASE 17F: first statement in an inline, or first
10034 ;; statement in a top-level defun. we can tell this is it
10035 ;; if there are no enclosing braces that haven't been
10036 ;; narrowed out by a class (i.e. don't use bod here).
10037 ((save-excursion
10038 (or (not (setq placeholder (c-most-enclosing-brace
10039 paren-state)))
10040 (and (progn
10041 (goto-char placeholder)
10042 (eq (char-after) ?{))
10043 (c-looking-at-decl-block (c-most-enclosing-brace
10044 paren-state (point))
10045 nil))))
10046 (c-backward-to-decl-anchor lim)
10047 (back-to-indentation)
10048 (c-add-syntax 'defun-block-intro (point)))
10049 10003
10050 ;; CASE 17G: First statement in a function declared inside 10004 ;; CASE 17B: continued statement
10051 ;; a normal block. This can occur in Pike and with 10005 ((and (eq step-type 'same)
10052 ;; e.g. the gcc extensions, but watch out for macros 10006 (/= (point) indent-point))
10053 ;; followed by blocks. C.f. cases B.3 and 16F. 10007 (c-add-stmt-syntax 'statement-cont nil nil
10054 ((save-excursion 10008 containing-sexp paren-state))
10055 (and (not (c-at-statement-start-p)) 10009
10056 (eq (c-beginning-of-statement-1 lim nil nil t) 'same) 10010 ;; CASE 17A: After a case/default label?
10057 (setq placeholder (point)) 10011 ((progn
10058 (let ((c-recognize-typeless-decls nil)) 10012 (while (and (eq step-type 'label)
10059 ;; Turn off recognition of constructs that lacks 10013 (not (looking-at c-label-kwds-regexp)))
10060 ;; a type in this case, since that's more likely 10014 (setq step-type
10061 ;; to be a macro followed by a block. 10015 (c-beginning-of-statement-1 containing-sexp)))
10062 (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil)))) 10016 (eq step-type 'label))
10017 (c-add-stmt-syntax (if (eq char-after-ip ?{)
10018 'statement-case-open
10019 'statement-case-intro)
10020 nil t containing-sexp paren-state))
10021
10022 ;; CASE 17D: any old statement
10023 ((progn
10024 (while (eq step-type 'label)
10025 (setq step-type
10026 (c-beginning-of-statement-1 containing-sexp)))
10027 (eq step-type 'previous))
10028 (c-add-stmt-syntax 'statement nil t
10029 containing-sexp paren-state)
10030 (if (eq char-after-ip ?{)
10031 (c-add-syntax 'block-open)))
10032
10033 ;; CASE 17I: Inside a substatement block.
10034 ((progn
10035 ;; The following tests are all based on containing-sexp.
10036 (goto-char containing-sexp)
10037 ;; From here on we have the next containing sexp in lim.
10038 (setq lim (c-most-enclosing-brace paren-state containing-sexp))
10039 (c-after-conditional))
10040 (c-backward-to-block-anchor lim)
10041 (c-add-stmt-syntax 'statement-block-intro nil t
10042 lim paren-state)
10043 (if (eq char-after-ip ?{)
10044 (c-add-syntax 'block-open)))
10045
10046 ;; CASE 17E: first statement in an in-expression block.
10047 ;; C.f. cases 4, 7B and 16A.
10048 ((setq placeholder (c-looking-at-inexpr-block
10049 (c-safe-position containing-sexp paren-state)
10050 nil))
10051 (setq tmpsymbol (if (eq (car placeholder) 'inlambda)
10052 'defun-block-intro
10053 'statement-block-intro))
10054 (back-to-indentation)
10055 (if (= containing-sexp (point))
10056 (c-add-syntax tmpsymbol (point))
10057 (goto-char (cdr placeholder))
10063 (back-to-indentation) 10058 (back-to-indentation)
10064 (if (/= (point) containing-sexp) 10059 (c-add-stmt-syntax tmpsymbol nil t
10065 (goto-char placeholder)) 10060 (c-most-enclosing-brace c-state-cache (point))
10066 (c-add-stmt-syntax 'defun-block-intro nil t 10061 paren-state)
10067 lim paren-state)) 10062 (if (/= (point) (cdr placeholder))
10063 (c-add-syntax (car placeholder))))
10064 (if (eq char-after-ip ?{)
10065 (c-add-syntax 'block-open)))
10066
10067 ;; CASE 17F: first statement in an inline, or first
10068 ;; statement in a top-level defun. we can tell this is it
10069 ;; if there are no enclosing braces that haven't been
10070 ;; narrowed out by a class (i.e. don't use bod here).
10071 ((save-excursion
10072 (or (not (setq placeholder (c-most-enclosing-brace
10073 paren-state)))
10074 (and (progn
10075 (goto-char placeholder)
10076 (eq (char-after) ?{))
10077 (c-looking-at-decl-block (c-most-enclosing-brace
10078 paren-state (point))
10079 nil))))
10080 (c-backward-to-decl-anchor lim)
10081 (back-to-indentation)
10082 (c-add-syntax 'defun-block-intro (point)))
10068 10083
10069 ;; CASE 17H: First statement in a block. 10084 ;; CASE 17G: First statement in a function declared inside
10070 (t 10085 ;; a normal block. This can occur in Pike and with
10071 ;; If the block is preceded by a case/switch label on the 10086 ;; e.g. the gcc extensions, but watch out for macros
10072 ;; same line, we anchor at the first preceding label at 10087 ;; followed by blocks. C.f. cases B.3 and 16F.
10073 ;; boi. The default handling in c-add-stmt-syntax is 10088 ((save-excursion
10074 ;; really fixes it better, but we do like this to keep the 10089 (and (not (c-at-statement-start-p))
10075 ;; indentation compatible with version 5.28 and earlier. 10090 (eq (c-beginning-of-statement-1 lim nil nil t) 'same)
10076 ;; C.f. case 16C. 10091 (setq placeholder (point))
10077 (while (and (/= (setq placeholder (point)) (c-point 'boi)) 10092 (let ((c-recognize-typeless-decls nil))
10078 (eq (c-beginning-of-statement-1 lim) 'label))) 10093 ;; Turn off recognition of constructs that lacks
10079 (goto-char placeholder) 10094 ;; a type in this case, since that's more likely
10080 (if (looking-at c-label-kwds-regexp) 10095 ;; to be a macro followed by a block.
10081 (c-add-syntax 'statement-block-intro (point)) 10096 (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))))
10082 (goto-char containing-sexp) 10097 (back-to-indentation)
10083 ;; c-backward-to-block-anchor not necessary here; those 10098 (if (/= (point) containing-sexp)
10084 ;; situations are handled in case 17I above. 10099 (goto-char placeholder))
10085 (c-add-stmt-syntax 'statement-block-intro nil t 10100 (c-add-stmt-syntax 'defun-block-intro nil t
10086 lim paren-state)) 10101 lim paren-state))
10087 (if (eq char-after-ip ?{)
10088 (c-add-syntax 'block-open)))
10089 ))
10090 )
10091 10102
10092 ;; now we need to look at any modifiers 10103 ;; CASE 17H: First statement in a block.
10093 (goto-char indent-point) 10104 (t
10094 (skip-chars-forward " \t") 10105 ;; If the block is preceded by a case/switch label on the
10106 ;; same line, we anchor at the first preceding label at
10107 ;; boi. The default handling in c-add-stmt-syntax is
10108 ;; really fixes it better, but we do like this to keep the
10109 ;; indentation compatible with version 5.28 and earlier.
10110 ;; C.f. case 16C.
10111 (while (and (/= (setq placeholder (point)) (c-point 'boi))
10112 (eq (c-beginning-of-statement-1 lim) 'label)))
10113 (goto-char placeholder)
10114 (if (looking-at c-label-kwds-regexp)
10115 (c-add-syntax 'statement-block-intro (point))
10116 (goto-char containing-sexp)
10117 ;; c-backward-to-block-anchor not necessary here; those
10118 ;; situations are handled in case 17I above.
10119 (c-add-stmt-syntax 'statement-block-intro nil t
10120 lim paren-state))
10121 (if (eq char-after-ip ?{)
10122 (c-add-syntax 'block-open)))
10123 ))
10124 )
10125
10126 ;; now we need to look at any modifiers
10127 (goto-char indent-point)
10128 (skip-chars-forward " \t")
10129
10130 ;; are we looking at a comment only line?
10131 (when (and (looking-at c-comment-start-regexp)
10132 (/= (c-forward-token-2 0 nil (c-point 'eol)) 0))
10133 (c-append-syntax 'comment-intro))
10134
10135 ;; we might want to give additional offset to friends (in C++).
10136 (when (and c-opt-friend-key
10137 (looking-at c-opt-friend-key))
10138 (c-append-syntax 'friend))
10139
10140 ;; Set syntactic-relpos.
10141 (let ((p c-syntactic-context))
10142 (while (and p
10143 (if (integerp (c-langelem-pos (car p)))
10144 (progn
10145 (setq syntactic-relpos (c-langelem-pos (car p)))
10146 nil)
10147 t))
10148 (setq p (cdr p))))
10095 10149
10096 ;; are we looking at a comment only line? 10150 ;; Start of or a continuation of a preprocessor directive?
10097 (when (and (looking-at c-comment-start-regexp) 10151 (if (and macro-start
10098 (/= (c-forward-token-2 0 nil (c-point 'eol)) 0)) 10152 (eq macro-start (c-point 'boi))
10099 (c-append-syntax 'comment-intro)) 10153 (not (and (c-major-mode-is 'pike-mode)
10100 10154 (eq (char-after (1+ macro-start)) ?\"))))
10101 ;; we might want to give additional offset to friends (in C++). 10155 (c-append-syntax 'cpp-macro)
10102 (when (and c-opt-friend-key 10156 (when (and c-syntactic-indentation-in-macros macro-start)
10103 (looking-at c-opt-friend-key)) 10157 (if in-macro-expr
10104 (c-append-syntax 'friend)) 10158 (when (or
10105 10159 (< syntactic-relpos macro-start)
10106 ;; Set syntactic-relpos. 10160 (not (or
10107 (let ((p c-syntactic-context)) 10161 (assq 'arglist-intro c-syntactic-context)
10108 (while (and p 10162 (assq 'arglist-cont c-syntactic-context)
10109 (if (integerp (c-langelem-pos (car p))) 10163 (assq 'arglist-cont-nonempty c-syntactic-context)
10110 (progn 10164 (assq 'arglist-close c-syntactic-context))))
10111 (setq syntactic-relpos (c-langelem-pos (car p))) 10165 ;; If inside a cpp expression, i.e. anywhere in a
10112 nil) 10166 ;; cpp directive except a #define body, we only let
10113 t)) 10167 ;; through the syntactic analysis that is internal
10114 (setq p (cdr p)))) 10168 ;; in the expression. That means the arglist
10115 10169 ;; elements, if they are anchored inside the cpp
10116 ;; Start of or a continuation of a preprocessor directive? 10170 ;; expression.
10117 (if (and macro-start 10171 (setq c-syntactic-context nil)
10118 (eq macro-start (c-point 'boi)) 10172 (c-add-syntax 'cpp-macro-cont macro-start))
10119 (not (and (c-major-mode-is 'pike-mode) 10173 (when (and (eq macro-start syntactic-relpos)
10120 (eq (char-after (1+ macro-start)) ?\")))) 10174 (not (assq 'cpp-define-intro c-syntactic-context))
10121 (c-append-syntax 'cpp-macro) 10175 (save-excursion
10122 (when (and c-syntactic-indentation-in-macros macro-start) 10176 (goto-char macro-start)
10123 (if in-macro-expr 10177 (or (not (c-forward-to-cpp-define-body))
10124 (when (or 10178 (<= (point) (c-point 'boi indent-point)))))
10125 (< syntactic-relpos macro-start) 10179 ;; Inside a #define body and the syntactic analysis is
10126 (not (or 10180 ;; anchored on the start of the #define. In this case
10127 (assq 'arglist-intro c-syntactic-context) 10181 ;; we add cpp-define-intro to get the extra
10128 (assq 'arglist-cont c-syntactic-context) 10182 ;; indentation of the #define body.
10129 (assq 'arglist-cont-nonempty c-syntactic-context) 10183 (c-add-syntax 'cpp-define-intro)))))
10130 (assq 'arglist-close c-syntactic-context)))) 10184
10131 ;; If inside a cpp expression, i.e. anywhere in a 10185 ;; return the syntax
10132 ;; cpp directive except a #define body, we only let 10186 c-syntactic-context)))
10133 ;; through the syntactic analysis that is internal
10134 ;; in the expression. That means the arglist
10135 ;; elements, if they are anchored inside the cpp
10136 ;; expression.
10137 (setq c-syntactic-context nil)
10138 (c-add-syntax 'cpp-macro-cont macro-start))
10139 (when (and (eq macro-start syntactic-relpos)
10140 (not (assq 'cpp-define-intro c-syntactic-context))
10141 (save-excursion
10142 (goto-char macro-start)
10143 (or (not (c-forward-to-cpp-define-body))
10144 (<= (point) (c-point 'boi indent-point)))))
10145 ;; Inside a #define body and the syntactic analysis is
10146 ;; anchored on the start of the #define. In this case
10147 ;; we add cpp-define-intro to get the extra
10148 ;; indentation of the #define body.
10149 (c-add-syntax 'cpp-define-intro)))))
10150
10151 ;; return the syntax
10152 c-syntactic-context)))
10153 10187
10154 10188
10155;; Indentation calculation. 10189;; Indentation calculation.
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 7c634d14e6a..f6d497569ba 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -2769,7 +2769,7 @@ Will not look before LIM."
2769 (goto-char (cperl-beginning-of-property p look-prop)) 2769 (goto-char (cperl-beginning-of-property p look-prop))
2770 (beginning-of-line) 2770 (beginning-of-line)
2771 (setq pre-indent-point (point))))) 2771 (setq pre-indent-point (point)))))
2772 (goto-char pre-indent-point) ; Orig line skipping preceeding pod/etc 2772 (goto-char pre-indent-point) ; Orig line skipping preceding pod/etc
2773 (let* ((case-fold-search nil) 2773 (let* ((case-fold-search nil)
2774 (s-s (cperl-get-state (car parse-data) (nth 1 parse-data))) 2774 (s-s (cperl-get-state (car parse-data) (nth 1 parse-data)))
2775 (start (or (nth 2 parse-data) ; last complete sexp terminated 2775 (start (or (nth 2 parse-data) ; last complete sexp terminated
@@ -2796,8 +2796,8 @@ Will not look before LIM."
2796 (cperl-1+ char-after-pos) 'indentable) 2796 (cperl-1+ char-after-pos) 'indentable)
2797 p (1+ (cperl-beginning-of-property 2797 p (1+ (cperl-beginning-of-property
2798 (point) 'indentable)) 2798 (point) 'indentable))
2799 is-block ; misused for: preceeding line in REx 2799 is-block ; misused for: preceding line in REx
2800 (save-excursion ; Find preceeding line 2800 (save-excursion ; Find preceding line
2801 (cperl-backward-to-noncomment p) 2801 (cperl-backward-to-noncomment p)
2802 (beginning-of-line) 2802 (beginning-of-line)
2803 (if (<= (point) p) 2803 (if (<= (point) p)
@@ -2813,10 +2813,10 @@ Will not look before LIM."
2813 prop (parse-partial-sexp p char-after-pos)) 2813 prop (parse-partial-sexp p char-after-pos))
2814 (cond ((not delim) ; End the REx, ignore is-block 2814 (cond ((not delim) ; End the REx, ignore is-block
2815 (vector 'indentable 'terminator p is-block)) 2815 (vector 'indentable 'terminator p is-block))
2816 (is-block ; Indent w.r.t. preceeding line 2816 (is-block ; Indent w.r.t. preceding line
2817 (vector 'indentable 'cont-line char-after-pos 2817 (vector 'indentable 'cont-line char-after-pos
2818 is-block char-after p)) 2818 is-block char-after p))
2819 (t ; No preceeding line... 2819 (t ; No preceding line...
2820 (vector 'indentable 'first-line p)))) 2820 (vector 'indentable 'first-line p))))
2821 ((get-text-property char-after-pos 'REx-part2) 2821 ((get-text-property char-after-pos 'REx-part2)
2822 (vector 'REx-part2 (point))) 2822 (vector 'REx-part2 (point)))
@@ -2897,7 +2897,7 @@ Will not look before LIM."
2897 (cperl-backward-to-start-of-continued-exp containing-sexp)) 2897 (cperl-backward-to-start-of-continued-exp containing-sexp))
2898 (beginning-of-line) 2898 (beginning-of-line)
2899 (cperl-backward-to-noncomment containing-sexp)) 2899 (cperl-backward-to-noncomment containing-sexp))
2900 ;; Now we get non-label preceeding the indent point 2900 ;; Now we get non-label preceding the indent point
2901 (if (not (or (eq (1- (point)) containing-sexp) 2901 (if (not (or (eq (1- (point)) containing-sexp)
2902 (memq (preceding-char) 2902 (memq (preceding-char)
2903 (append (if is-block " ;{" " ,;{") '(nil))) 2903 (append (if is-block " ;{" " ,;{") '(nil)))
@@ -4835,7 +4835,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
4835;;; Moreover, one takes positive approach (looks for else,grep etc) 4835;;; Moreover, one takes positive approach (looks for else,grep etc)
4836;;; another negative (looks for bless,tr etc) 4836;;; another negative (looks for bless,tr etc)
4837(defun cperl-after-block-p (lim &optional pre-block) 4837(defun cperl-after-block-p (lim &optional pre-block)
4838 "Return true if the preceeding } (if PRE-BLOCK, following {) delimits a block. 4838 "Return true if the preceding } (if PRE-BLOCK, following {) delimits a block.
4839Would not look before LIM. Assumes that LIM is a good place to begin a 4839Would not look before LIM. Assumes that LIM is a good place to begin a
4840statement. The kind of block we treat here is one after which a new 4840statement. The kind of block we treat here is one after which a new
4841statement would start; thus the block in ${func()} does not count." 4841statement would start; thus the block in ${func()} does not count."
@@ -4864,7 +4864,7 @@ statement would start; thus the block in ${func()} does not count."
4864 (progn 4864 (progn
4865 (forward-sexp -1) 4865 (forward-sexp -1)
4866 (looking-at "sub[ \t\n\f#]")))))) 4866 (looking-at "sub[ \t\n\f#]"))))))
4867 ;; What preceeds is not word... XXXX Last statement in sub??? 4867 ;; What precedes is not word... XXXX Last statement in sub???
4868 (cperl-after-expr-p lim)))) 4868 (cperl-after-expr-p lim))))
4869 (error nil)))) 4869 (error nil))))
4870 4870
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 9f8dd79e0fc..f7965d2cd01 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -2229,8 +2229,8 @@ processed.
2229 2229
2230See also `ebnf-print-buffer'." 2230See also `ebnf-print-buffer'."
2231 (interactive 2231 (interactive
2232 (list (read-file-name "Directory containing EBNF files (print): " 2232 (list (read-directory-name "Directory containing EBNF files (print): "
2233 nil default-directory))) 2233 nil default-directory)))
2234 (ebnf-log-header "(ebnf-print-directory %S)" directory) 2234 (ebnf-log-header "(ebnf-print-directory %S)" directory)
2235 (ebnf-directory 'ebnf-print-buffer directory)) 2235 (ebnf-directory 'ebnf-print-buffer directory))
2236 2236
@@ -2287,8 +2287,8 @@ processed.
2287 2287
2288See also `ebnf-spool-buffer'." 2288See also `ebnf-spool-buffer'."
2289 (interactive 2289 (interactive
2290 (list (read-file-name "Directory containing EBNF files (spool): " 2290 (list (read-directory-name "Directory containing EBNF files (spool): "
2291 nil default-directory))) 2291 nil default-directory)))
2292 (ebnf-log-header "(ebnf-spool-directory %S)" directory) 2292 (ebnf-log-header "(ebnf-spool-directory %S)" directory)
2293 (ebnf-directory 'ebnf-spool-buffer directory)) 2293 (ebnf-directory 'ebnf-spool-buffer directory))
2294 2294
@@ -2340,8 +2340,8 @@ processed.
2340 2340
2341See also `ebnf-eps-buffer'." 2341See also `ebnf-eps-buffer'."
2342 (interactive 2342 (interactive
2343 (list (read-file-name "Directory containing EBNF files (EPS): " 2343 (list (read-directory-name "Directory containing EBNF files (EPS): "
2344 nil default-directory))) 2344 nil default-directory)))
2345 (ebnf-log-header "(ebnf-eps-directory %S)" directory) 2345 (ebnf-log-header "(ebnf-eps-directory %S)" directory)
2346 (ebnf-directory 'ebnf-eps-buffer directory)) 2346 (ebnf-directory 'ebnf-eps-buffer directory))
2347 2347
@@ -2425,8 +2425,8 @@ are processed.
2425 2425
2426See also `ebnf-syntax-buffer'." 2426See also `ebnf-syntax-buffer'."
2427 (interactive 2427 (interactive
2428 (list (read-file-name "Directory containing EBNF files (syntax): " 2428 (list (read-directory-name "Directory containing EBNF files (syntax): "
2429 nil default-directory))) 2429 nil default-directory)))
2430 (ebnf-log-header "(ebnf-syntax-directory %S)" directory) 2430 (ebnf-log-header "(ebnf-syntax-directory %S)" directory)
2431 (ebnf-directory 'ebnf-syntax-buffer directory)) 2431 (ebnf-directory 'ebnf-syntax-buffer directory))
2432 2432
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 32ab52228f9..a4c9b7fccba 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -72,7 +72,9 @@ SYMBOL should be one of `grep-command', `grep-template',
72 72
73Some grep programs are able to surround matches with special 73Some grep programs are able to surround matches with special
74markers in grep output. Such markers can be used to highlight 74markers in grep output. Such markers can be used to highlight
75matches in grep mode. 75matches in grep mode. This requires `font-lock-mode' to be active
76in grep buffers, so if you have globally disabled font-lock-mode,
77you will not get highlighting.
76 78
77This option sets the environment variable GREP_COLORS to specify 79This option sets the environment variable GREP_COLORS to specify
78markers for highlighting and GREP_OPTIONS to add the --color 80markers for highlighting and GREP_OPTIONS to add the --color
@@ -462,6 +464,8 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
462 (when (eq grep-highlight-matches 'auto-detect) 464 (when (eq grep-highlight-matches 'auto-detect)
463 (grep-compute-defaults)) 465 (grep-compute-defaults))
464 (unless (or (eq grep-highlight-matches 'auto-detect) 466 (unless (or (eq grep-highlight-matches 'auto-detect)
467 ;; Uses font-lock to parse color escapes. (Bug#8084)
468 (null font-lock-mode)
465 (null grep-highlight-matches)) 469 (null grep-highlight-matches))
466 ;; `setenv' modifies `process-environment' let-bound in `compilation-start' 470 ;; `setenv' modifies `process-environment' let-bound in `compilation-start'
467 ;; Any TERM except "dumb" allows GNU grep to use `--color=auto' 471 ;; Any TERM except "dumb" allows GNU grep to use `--color=auto'
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 6e175da1414..53918b903ee 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -3218,7 +3218,7 @@ Treats actions as defuns."
3218 t) 3218 t)
3219 3219
3220;;;###autoload 3220;;;###autoload
3221(define-derived-mode gdb-script-mode nil "GDB-Script" 3221(define-derived-mode gdb-script-mode prog-mode "GDB-Script"
3222 "Major mode for editing GDB scripts." 3222 "Major mode for editing GDB scripts."
3223 (set (make-local-variable 'comment-start) "#") 3223 (set (make-local-variable 'comment-start) "#")
3224 (set (make-local-variable 'comment-start-skip) "#+\\s-*") 3224 (set (make-local-variable 'comment-start-skip) "#+\\s-*")
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 30d9fc21867..5b7e07a5aad 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -428,7 +428,7 @@ path \(the value of !PATH). However, under Windows and MacOS
428variable can be set to specify the paths where IDLWAVE can find PRO 428variable can be set to specify the paths where IDLWAVE can find PRO
429files. The shell will only be asked for a list of paths when this 429files. The shell will only be asked for a list of paths when this
430variable is nil. The value is a list of directories. A directory 430variable is nil. The value is a list of directories. A directory
431preceeded by a `+' will be searched recursively. If you set this 431preceded by a `+' will be searched recursively. If you set this
432variable on a UNIX system, the shell will not be queried. See also 432variable on a UNIX system, the shell will not be queried. See also
433`idlwave-system-directory'." 433`idlwave-system-directory'."
434 :group 'idlwave-routine-info 434 :group 'idlwave-routine-info
@@ -1197,7 +1197,7 @@ As a user, you should not set this to t.")
1197 (2 font-lock-function-name-face))) 1197 (2 font-lock-function-name-face)))
1198 1198
1199 ;; Keyword parameters, like /xlog or ,xrange=[] 1199 ;; Keyword parameters, like /xlog or ,xrange=[]
1200 ;; This is anchored to the comma preceeding the keyword. 1200 ;; This is anchored to the comma preceding the keyword.
1201 ;; Treats continuation lines, works only during whole buffer 1201 ;; Treats continuation lines, works only during whole buffer
1202 ;; fontification. Slow, use it only in fancy fontification. 1202 ;; fontification. Slow, use it only in fancy fontification.
1203 (keyword-parameters 1203 (keyword-parameters
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 45d967e92d9..62472edfbe4 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -1715,7 +1715,7 @@ If COMPILEP is non-nil, compile, otherwise consult."
1715;; Font-lock stuff 1715;; Font-lock stuff
1716;;------------------------------------------------------------------- 1716;;-------------------------------------------------------------------
1717 1717
1718;; Auxilliary functions 1718;; Auxiliary functions
1719(defun prolog-make-keywords-regexp (keywords &optional protect) 1719(defun prolog-make-keywords-regexp (keywords &optional protect)
1720 "Create regexp from the list of strings KEYWORDS. 1720 "Create regexp from the list of strings KEYWORDS.
1721If PROTECT is non-nil, surround the result regexp by word breaks." 1721If PROTECT is non-nil, surround the result regexp by word breaks."
@@ -3777,7 +3777,7 @@ If the point is not on a variable then insert underscore."
3777 3777
3778 3778
3779(defun prolog-find-term (functor arity &optional prefix) 3779(defun prolog-find-term (functor arity &optional prefix)
3780 "Go to the position at the start of the next occurance of a term. 3780 "Go to the position at the start of the next occurrence of a term.
3781The term is specified with FUNCTOR and ARITY. The optional argument 3781The term is specified with FUNCTOR and ARITY. The optional argument
3782PREFIX is the prefix of the search regexp." 3782PREFIX is the prefix of the search regexp."
3783 (let* (;; If prefix is not set then use the default "\\<" 3783 (let* (;; If prefix is not set then use the default "\\<"
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 9e49f0e775b..1c1ffc41624 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -2801,7 +2801,7 @@ server/database name."
2801(defun sql-rename-buffer (&optional new-name) 2801(defun sql-rename-buffer (&optional new-name)
2802 "Rename a SQL interactive buffer. 2802 "Rename a SQL interactive buffer.
2803 2803
2804Prompts for the new name if command is preceeded by 2804Prompts for the new name if command is preceded by
2805\\[universal-argument]. If no buffer name is provided, then the 2805\\[universal-argument]. If no buffer name is provided, then the
2806`sql-alternate-buffer-name' is used. 2806`sql-alternate-buffer-name' is used.
2807 2807
@@ -3262,7 +3262,7 @@ you must tell Emacs. Here's how to do that in your `~/.emacs' file:
3262 :abbrev-table sql-mode-abbrev-table 3262 :abbrev-table sql-mode-abbrev-table
3263 (if sql-mode-menu 3263 (if sql-mode-menu
3264 (easy-menu-add sql-mode-menu)); XEmacs 3264 (easy-menu-add sql-mode-menu)); XEmacs
3265 3265
3266 (set (make-local-variable 'comment-start) "--") 3266 (set (make-local-variable 'comment-start) "--")
3267 ;; Make each buffer in sql-mode remember the "current" SQLi buffer. 3267 ;; Make each buffer in sql-mode remember the "current" SQLi buffer.
3268 (make-local-variable 'sql-buffer) 3268 (make-local-variable 'sql-buffer)
@@ -4257,4 +4257,3 @@ buffer.
4257(provide 'sql) 4257(provide 'sql)
4258 4258
4259;;; sql.el ends here 4259;;; sql.el ends here
4260
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index cb1d3c24a94..75b706b74ec 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -1775,7 +1775,7 @@ NOTE: Activate the new setting by restarting Emacs.
1775 1775
1776(defcustom vhdl-intelligent-tab t 1776(defcustom vhdl-intelligent-tab t
1777 "*Non-nil means `TAB' does indentation, word completion and tab insertion. 1777 "*Non-nil means `TAB' does indentation, word completion and tab insertion.
1778That is, if preceeding character is part of a word then complete word, 1778That is, if preceding character is part of a word then complete word,
1779else if not at beginning of line then insert tab, 1779else if not at beginning of line then insert tab,
1780else if last command was a `TAB' or `RET' then dedent one step, 1780else if last command was a `TAB' or `RET' then dedent one step,
1781else indent current line (i.e. `TAB' is bound to `vhdl-electric-tab'). 1781else indent current line (i.e. `TAB' is bound to `vhdl-electric-tab').
@@ -6946,7 +6946,7 @@ only-lines."
6946;; Indentation commands 6946;; Indentation commands
6947 6947
6948(defun vhdl-electric-tab (&optional prefix-arg) 6948(defun vhdl-electric-tab (&optional prefix-arg)
6949 "If preceeding character is part of a word or a paren then hippie-expand, 6949 "If preceding character is part of a word or a paren then hippie-expand,
6950else if right of non whitespace on line then insert tab, 6950else if right of non whitespace on line then insert tab,
6951else if last command was a tab or return then dedent one step or if a comment 6951else if last command was a tab or return then dedent one step or if a comment
6952toggle between normal indent and inline comment indent, 6952toggle between normal indent and inline comment indent,
@@ -10396,7 +10396,7 @@ with double-quotes is to be inserted. DEFAULT specifies a default string."
10396 (if vhdl-upper-case-keywords (upcase-word num) (downcase-word num))) 10396 (if vhdl-upper-case-keywords (upcase-word num) (downcase-word num)))
10397 10397
10398(defun vhdl-minibuffer-tab (&optional prefix-arg) 10398(defun vhdl-minibuffer-tab (&optional prefix-arg)
10399 "If preceeding character is part of a word or a paren then hippie-expand, 10399 "If preceding character is part of a word or a paren then hippie-expand,
10400else insert tab (used for word completion in VHDL minibuffer)." 10400else insert tab (used for word completion in VHDL minibuffer)."
10401 (interactive "P") 10401 (interactive "P")
10402 (cond 10402 (cond
@@ -13056,7 +13056,7 @@ hierarchy otherwise.")
13056;; Scan functions 13056;; Scan functions
13057 13057
13058(defun vhdl-scan-context-clause () 13058(defun vhdl-scan-context-clause ()
13059 "Scan the context clause that preceeds a design unit." 13059 "Scan the context clause that precedes a design unit."
13060 (let (lib-alist) 13060 (let (lib-alist)
13061 (save-excursion 13061 (save-excursion
13062 (when (re-search-backward "^[ \t]*\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil t) 13062 (when (re-search-backward "^[ \t]*\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil t)
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 19431c30d68..b51eb944696 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -6645,7 +6645,8 @@ If FACE is not a valid face name, use default face."
6645 (error "Unprinted PostScript")))) 6645 (error "Unprinted PostScript"))))
6646 6646
6647(cond ((fboundp 'add-hook) 6647(cond ((fboundp 'add-hook)
6648 (funcall 'add-hook 'kill-emacs-hook 'ps-kill-emacs-check)) 6648 (unless noninteractive
6649 (funcall 'add-hook 'kill-emacs-hook 'ps-kill-emacs-check)))
6649 (kill-emacs-hook 6650 (kill-emacs-hook
6650 (message "Won't override existing `kill-emacs-hook'")) 6651 (message "Won't override existing `kill-emacs-hook'"))
6651 (t 6652 (t
diff --git a/lisp/recentf.el b/lisp/recentf.el
index d0be69b51fc..9f9baad8dbd 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -411,13 +411,14 @@ That is, if it doesn't match any of the `recentf-exclude' checks."
411 (checks recentf-exclude) 411 (checks recentf-exclude)
412 (keepit t)) 412 (keepit t))
413 (while (and checks keepit) 413 (while (and checks keepit)
414 (setq keepit (condition-case nil 414 ;; If there was an error in a predicate, err on the side of
415 (not (if (stringp (car checks)) 415 ;; keeping the file. (Bug#5843)
416 ;; A regexp 416 (setq keepit (not (ignore-errors
417 (string-match (car checks) filename) 417 (if (stringp (car checks))
418 ;; A predicate 418 ;; A regexp
419 (funcall (car checks) filename))) 419 (string-match (car checks) filename)
420 (error nil)) 420 ;; A predicate
421 (funcall (car checks) filename))))
421 checks (cdr checks))) 422 checks (cdr checks)))
422 keepit)) 423 keepit))
423 424
diff --git a/lisp/replace.el b/lisp/replace.el
index 0f8adea2aca..928c3170c65 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1531,7 +1531,7 @@ N (match-string N) (where N is a string of digits)
1531#& (string-to-number (match-string 0)) 1531#& (string-to-number (match-string 0))
1532# replace-count 1532# replace-count
1533 1533
1534Note that these symbols must be preceeded by a backslash in order to 1534Note that these symbols must be preceded by a backslash in order to
1535type them using Lisp syntax." 1535type them using Lisp syntax."
1536 (while (consp n) 1536 (while (consp n)
1537 (cond 1537 (cond
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index b7d43bd230a..c10b5cbb7ec 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -300,7 +300,8 @@ may have changed\) back to `save-place-alist'."
300 300
301(add-hook 'find-file-hook 'save-place-find-file-hook t) 301(add-hook 'find-file-hook 'save-place-find-file-hook t)
302 302
303(add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook) 303(unless noninteractive
304 (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook))
304 305
305(add-hook 'kill-buffer-hook 'save-place-to-alist) 306(add-hook 'kill-buffer-hook 'save-place-to-alist)
306 307
diff --git a/lisp/shell.el b/lisp/shell.el
index ea89ce765c3..2f11cc6314c 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -569,9 +569,9 @@ Otherwise, one argument `-i' is passed to the shell.
569 ;; of the current-buffer rather than of the *shell* buffer. 569 ;; of the current-buffer rather than of the *shell* buffer.
570 (setq default-directory 570 (setq default-directory
571 (expand-file-name 571 (expand-file-name
572 (read-file-name 572 (read-directory-name
573 "Default directory: " default-directory default-directory 573 "Default directory: " default-directory default-directory
574 t nil 'file-directory-p)))))))) 574 t nil))))))))
575 (require 'ansi-color) 575 (require 'ansi-color)
576 (setq buffer (if (or buffer (not (derived-mode-p 'shell-mode)) 576 (setq buffer (if (or buffer (not (derived-mode-p 'shell-mode))
577 (comint-check-proc (current-buffer))) 577 (comint-check-proc (current-buffer)))
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index dad2a4c82ac..d160a836359 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -1622,7 +1622,7 @@ Files can be renamed to new names or moved to new directories."
1622 (let ((f (speedbar-line-file))) 1622 (let ((f (speedbar-line-file)))
1623 (if f 1623 (if f
1624 (let* ((basedir (file-name-directory f)) 1624 (let* ((basedir (file-name-directory f))
1625 (nd (read-file-name "Create directory: " 1625 (nd (read-directory-name "Create directory: "
1626 basedir))) 1626 basedir)))
1627 ;; Make the directory 1627 ;; Make the directory
1628 (make-directory nd t) 1628 (make-directory nd t)
diff --git a/lisp/term/screen.el b/lisp/term/screen.el
new file mode 100644
index 00000000000..4931a422e09
--- /dev/null
+++ b/lisp/term/screen.el
@@ -0,0 +1,11 @@
1;; -*- no-byte-compile: t -*-
2;; Treat a screen terminal similar to an xterm.
3(load "term/xterm")
4
5(defun terminal-init-screen ()
6 "Terminal initialization function for screen."
7 ;; Use the xterm color initialization code.
8 (xterm-register-default-colors)
9 (tty-set-up-initial-frame-faces))
10
11;; screen.el ends here
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index f1e73dcf480..5fbc8a643d8 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -422,7 +422,7 @@ be in `artist-spray-chars', or spraying will behave strangely.")
422(defvar artist-mode-name " Artist" 422(defvar artist-mode-name " Artist"
423 "Name of Artist mode beginning with a space (appears in the mode-line).") 423 "Name of Artist mode beginning with a space (appears in the mode-line).")
424 424
425(defvar artist-curr-go 'pen-char 425(defvar artist-curr-go 'pen-line
426 "Current selected graphics operation.") 426 "Current selected graphics operation.")
427(make-variable-buffer-local 'artist-curr-go) 427(make-variable-buffer-local 'artist-curr-go)
428 428
@@ -502,6 +502,49 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.")
502(defvar artist-arrow-point-1 nil) 502(defvar artist-arrow-point-1 nil)
503(defvar artist-arrow-point-2 nil) 503(defvar artist-arrow-point-2 nil)
504 504
505(defvar artist-menu-map
506 (let ((map (make-sparse-keymap)))
507 (define-key map [spray-chars]
508 '(menu-item "Characters for Spray" artist-select-spray-chars
509 :help "Choose characters for sprayed by the spray-can"))
510 (define-key map [borders]
511 '(menu-item "Draw Shape Borders" artist-toggle-borderless-shapes
512 :help "Toggle whether shapes are drawn with borders"
513 :button (:toggle . (not artist-borderless-shapes))))
514 (define-key map [trimming]
515 '(menu-item "Trim Line Endings" artist-toggle-trim-line-endings
516 :help "Toggle trimming of line-endings"
517 :button (:toggle . artist-trim-line-endings)))
518 (define-key map [rubber-band]
519 '(menu-item "Rubber-banding" artist-toggle-rubber-banding
520 :help "Toggle rubber-banding"
521 :button (:toggle . artist-rubber-banding)))
522 (define-key map [set-erase]
523 '(menu-item "Character to Erase..." artist-select-erase-char
524 :help "Choose a specific character to erase"))
525 (define-key map [set-line]
526 '(menu-item "Character for Line..." artist-select-line-char
527 :help "Choose the character to insert when drawing lines"))
528 (define-key map [set-fill]
529 '(menu-item "Character for Fill..." artist-select-fill-char
530 :help "Choose the character to insert when filling in shapes"))
531 (define-key map [artist-separator] '(menu-item "--"))
532 (dolist (op '(("Vaporize" artist-select-op-vaporize-lines vaporize-lines)
533 ("Erase" artist-select-op-erase-rectangle erase-rect)
534 ("Spray-can" artist-select-op-spray-set-size spray-get-size)
535 ("Text" artist-select-op-text-overwrite text-ovwrt)
536 ("Ellipse" artist-select-op-circle circle)
537 ("Poly-line" artist-select-op-straight-poly-line spolyline)
538 ("Rectangle" artist-select-op-square square)
539 ("Line" artist-select-op-straight-line s-line)
540 ("Pen" artist-select-op-pen-line pen-line)))
541 (define-key map (vector (nth 2 op))
542 `(menu-item ,(nth 0 op)
543 ,(nth 1 op)
544 :help ,(format "Draw using the %s style" (nth 0 op))
545 :button (:radio . (eq artist-curr-go ',(nth 2 op))))))
546 map))
547
505(defvar artist-mode-map 548(defvar artist-mode-map
506 (let ((map (make-sparse-keymap))) 549 (let ((map (make-sparse-keymap)))
507 (setq artist-mode-map (make-sparse-keymap)) 550 (setq artist-mode-map (make-sparse-keymap))
@@ -554,6 +597,7 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.")
554 (define-key map "\C-c\C-a\C-y" 'artist-select-op-paste) 597 (define-key map "\C-c\C-a\C-y" 'artist-select-op-paste)
555 (define-key map "\C-c\C-af" 'artist-select-op-flood-fill) 598 (define-key map "\C-c\C-af" 'artist-select-op-flood-fill)
556 (define-key map "\C-c\C-a\C-b" 'artist-submit-bug-report) 599 (define-key map "\C-c\C-a\C-b" 'artist-submit-bug-report)
600 (define-key map [menu-bar artist] (cons "Artist" artist-menu-map))
557 map) 601 map)
558 "Keymap for `artist-minor-mode'.") 602 "Keymap for `artist-minor-mode'.")
559 603
@@ -4601,6 +4645,10 @@ If optional argument STATE is positive, turn borders on."
4601 4645
4602 (artist-arrow-point-set-state artist-arrow-point-2 new-state))))) 4646 (artist-arrow-point-set-state artist-arrow-point-2 new-state)))))
4603 4647
4648(defun artist-select-op-pen-line ()
4649 "Select drawing pen lines."
4650 (interactive)
4651 (artist-select-operation "Pen Line"))
4604 4652
4605(defun artist-select-op-line () 4653(defun artist-select-op-line ()
4606 "Select drawing lines." 4654 "Select drawing lines."
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 70f11cf66dc..a0892b5ebba 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -43,7 +43,7 @@ only considered as a candidate to match `paragraph-start' or
43 43
44Prefix argument says to turn mode on if positive, off if negative. 44Prefix argument says to turn mode on if positive, off if negative.
45When the mode is turned on, if there are newlines in the buffer but no hard 45When the mode is turned on, if there are newlines in the buffer but no hard
46newlines, ask the user whether to mark as hard any newlines preceeding a 46newlines, ask the user whether to mark as hard any newlines preceding a
47`paragraph-start' line. From a program, second arg INSERT specifies whether 47`paragraph-start' line. From a program, second arg INSERT specifies whether
48to do this; it can be `never' to change nothing, t or `always' to force 48to do this; it can be `never' to change nothing, t or `always' to force
49marking, `guess' to try to do the right thing with no questions, nil 49marking, `guess' to try to do the right thing with no questions, nil
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 6719a647c36..7e150bff997 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -567,7 +567,7 @@ on the menu bar.
567 "Save RefTeX's parse file for this buffer if the information has changed." 567 "Save RefTeX's parse file for this buffer if the information has changed."
568 ;; Save the parsing information if it was modified. 568 ;; Save the parsing information if it was modified.
569 ;; This function should be installed in `kill-buffer-hook'. 569 ;; This function should be installed in `kill-buffer-hook'.
570 ;; We are careful to make sure nothing goes wring in this function. 570 ;; We are careful to make sure nothing goes wrong in this function.
571 (when (and (boundp 'reftex-mode) reftex-mode 571 (when (and (boundp 'reftex-mode) reftex-mode
572 (boundp 'reftex-save-parse-info) reftex-save-parse-info 572 (boundp 'reftex-save-parse-info) reftex-save-parse-info
573 (boundp 'reftex-docstruct-symbol) reftex-docstruct-symbol 573 (boundp 'reftex-docstruct-symbol) reftex-docstruct-symbol
@@ -2397,7 +2397,7 @@ IGNORE-WORDS List of words which should be removed from the string."
2397 (define-key reftex-mode-map 2397 (define-key reftex-mode-map
2398 reftex-extra-bindings-prefix 2398 reftex-extra-bindings-prefix
2399 reftex-extra-bindings-map)) 2399 reftex-extra-bindings-map))
2400 2400
2401 2401
2402;;; ========================================================================= 2402;;; =========================================================================
2403;;; 2403;;;
@@ -2568,7 +2568,8 @@ With optional NODE, go directly to that node."
2568;;; Install the kill-buffer and kill-emacs hooks ------------------------------ 2568;;; Install the kill-buffer and kill-emacs hooks ------------------------------
2569 2569
2570(add-hook 'kill-buffer-hook 'reftex-kill-buffer-hook) 2570(add-hook 'kill-buffer-hook 'reftex-kill-buffer-hook)
2571(add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook) 2571(unless noninteractive
2572 (add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook))
2572 2573
2573;;; Run Hook ------------------------------------------------------------------ 2574;;; Run Hook ------------------------------------------------------------------
2574 2575
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 2229dc6c9e8..314fbf9671b 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -427,7 +427,12 @@ a DOCTYPE or an XML declaration."
427 (format-mode-line mode-name)))))) 427 (format-mode-line mode-name))))))
428 428
429(defun sgml-fill-nobreak () 429(defun sgml-fill-nobreak ()
430 ;; Don't break between a tag name and its first argument. 430 "Don't break between a tag name and its first argument.
431This function is designed for use in `fill-nobreak-predicate'.
432
433 <a href=\"some://where\" type=\"text/plain\">
434 ^ ^
435 | no break here | but still allowed here"
431 (save-excursion 436 (save-excursion
432 (skip-chars-backward " \t") 437 (skip-chars-backward " \t")
433 (and (not (zerop (skip-syntax-backward "w_"))) 438 (and (not (zerop (skip-syntax-backward "w_")))
diff --git a/lisp/time.el b/lisp/time.el
index 1bc1cca1112..2e9dd252bd6 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -157,7 +157,7 @@ LABEL is a string to display as the label of that TIMEZONE's time."
157 ;; Determine if zoneinfo style timezones are supported by testing that 157 ;; Determine if zoneinfo style timezones are supported by testing that
158 ;; America/New York and Europe/London return different timezones. 158 ;; America/New York and Europe/London return different timezones.
159 (let (gmt nyt) 159 (let (gmt nyt)
160 (set-time-zone-rule "America/New York") 160 (set-time-zone-rule "America/New_York")
161 (setq nyt (format-time-string "%z")) 161 (setq nyt (format-time-string "%z"))
162 (set-time-zone-rule "Europe/London") 162 (set-time-zone-rule "Europe/London")
163 (setq gmt (format-time-string "%z")) 163 (setq gmt (format-time-string "%z"))
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 59e442a89c3..8e5fe27f965 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1266,7 +1266,7 @@ a diff with \\[diff-reverse-direction].
1266 1266
1267 ;; Set up `whitespace-mode' so that turning it on will show trailing 1267 ;; Set up `whitespace-mode' so that turning it on will show trailing
1268 ;; whitespace problems on the modified lines of the diff. 1268 ;; whitespace problems on the modified lines of the diff.
1269 (set (make-local-variable 'whitespace-style) '(trailing)) 1269 (set (make-local-variable 'whitespace-style) '(face trailing))
1270 (set (make-local-variable 'whitespace-trailing-regexp) 1270 (set (make-local-variable 'whitespace-trailing-regexp)
1271 "^[-\+!<>].*?\\([\t ]+\\)$") 1271 "^[-\+!<>].*?\\([\t ]+\\)$")
1272 1272
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index ff1f7f6b017..0d904ec85c4 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -560,7 +560,6 @@ See the documentation string of `ediff-focus-on-regexp-matches' for details.")
560 :group 'ediff) 560 :group 'ediff)
561 561
562 562
563(ediff-defvar-local ediff-use-faces t "")
564(defcustom ediff-use-faces t 563(defcustom ediff-use-faces t
565 "If t, differences are highlighted using faces, if device supports faces. 564 "If t, differences are highlighted using faces, if device supports faces.
566If nil, differences are highlighted using ASCII flags, ediff-before-flag 565If nil, differences are highlighted using ASCII flags, ediff-before-flag
@@ -568,6 +567,7 @@ and ediff-after-flag. On a non-window system, differences are always
568highlighted using ASCII flags." 567highlighted using ASCII flags."
569 :type 'boolean 568 :type 'boolean
570 :group 'ediff-highlighting) 569 :group 'ediff-highlighting)
570(ediff-defvar-local ediff-use-faces t "")
571 571
572;; this indicates that diff regions are word-size, so fine diffs are 572;; this indicates that diff regions are word-size, so fine diffs are
573;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise 573;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise
@@ -604,13 +604,13 @@ meaning of this variable."
604 :type 'boolean 604 :type 'boolean
605 :group 'ediff) 605 :group 'ediff)
606 606
607(ediff-defvar-local ediff-highlight-all-diffs t "")
608(defcustom ediff-highlight-all-diffs t 607(defcustom ediff-highlight-all-diffs t
609 "If nil, only the selected differences are highlighted. 608 "If nil, only the selected differences are highlighted.
610Otherwise, all difference regions are highlighted, but the selected region is 609Otherwise, all difference regions are highlighted, but the selected region is
611shown in brighter colors." 610shown in brighter colors."
612 :type 'boolean 611 :type 'boolean
613 :group 'ediff-highlighting) 612 :group 'ediff-highlighting)
613(ediff-defvar-local ediff-highlight-all-diffs t "")
614 614
615 615
616;; The suffix of the control buffer name. 616;; The suffix of the control buffer name.
diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el
index ee34944e448..601b6b1e597 100644
--- a/lisp/vc/emerge.el
+++ b/lisp/vc/emerge.el
@@ -1271,10 +1271,10 @@ Otherwise, the A or B file present is copied to the output file."
1271(defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir) 1271(defun emerge-merge-directories (a-dir b-dir ancestor-dir output-dir)
1272 (interactive 1272 (interactive
1273 (list 1273 (list
1274 (read-file-name "A directory: " nil nil 'confirm) 1274 (read-directory-name "A directory: " nil nil 'confirm)
1275 (read-file-name "B directory: " nil nil 'confirm) 1275 (read-directory-name "B directory: " nil nil 'confirm)
1276 (read-file-name "Ancestor directory (null for none): " nil nil 'confirm) 1276 (read-directory-name "Ancestor directory (null for none): " nil nil 'confirm)
1277 (read-file-name "Output directory (null for none): " nil nil 'confirm))) 1277 (read-directory-name "Output directory (null for none): " nil nil 'confirm)))
1278 ;; Check that we're not on a line 1278 ;; Check that we're not on a line
1279 (if (not (and (bolp) (eolp))) 1279 (if (not (and (bolp) (eolp)))
1280 (error "There is text on this line")) 1280 (error "There is text on this line"))
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 5e6e054924c..a0a16601ed7 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -182,10 +182,19 @@ in the repository root directory of FILE."
182 ;; format 3' in the first line. 182 ;; format 3' in the first line.
183 ;; If the `checkout/dirstate' file cannot be parsed, fall back to 183 ;; If the `checkout/dirstate' file cannot be parsed, fall back to
184 ;; running `vc-bzr-state'." 184 ;; running `vc-bzr-state'."
185 ;;
186 ;; The format of the dirstate file is explained in bzrlib/dirstate.py
187 ;; in the bzr distribution. Basically:
188 ;; header-line giving the version of the file format in use.
189 ;; a few lines of stuff
190 ;; entries, one per line, with null-separated fields. Each line:
191 ;; entry_key = dirname (may be empty), basename, file-id
192 ;; current = common ( = kind, fingerprint, size, executable )
193 ;; + working ( = packed_stat )
194 ;; parent = common ( as above ) + history ( = rev_id )
195 ;; kinds = (r)elocated, (a)bsent, (d)irectory, (f)ile, (l)ink
185 (lexical-let ((root (vc-bzr-root file))) 196 (lexical-let ((root (vc-bzr-root file)))
186 (when root ; Short cut. 197 (when root ; Short cut.
187 ;; This looks at internal files. May break if they change
188 ;; their format.
189 (lexical-let ((dirstate (expand-file-name vc-bzr-admin-dirstate root))) 198 (lexical-let ((dirstate (expand-file-name vc-bzr-admin-dirstate root)))
190 (condition-case nil 199 (condition-case nil
191 (with-temp-buffer 200 (with-temp-buffer
@@ -210,13 +219,14 @@ in the repository root directory of FILE."
210 ;; was executable the last time bzr checked? 219 ;; was executable the last time bzr checked?
211 "[^\0]*\0" 220 "[^\0]*\0"
212 "[^\0]*\0" ;? 221 "[^\0]*\0" ;?
213 "\\([^\0]*\\)\0" ;"a/f/d" a=added? 222 ;; Parent information. Absent in a new repo.
223 "\\(?:\\([^\0]*\\)\0" ;"a/f/d" a=added?
214 "\\([^\0]*\\)\0" ;sha1 again? 224 "\\([^\0]*\\)\0" ;sha1 again?
215 "\\([^\0]*\\)\0" ;size again? 225 "\\([^\0]*\\)\0" ;size again?
216 ;; y/n. Whether or not the repo thinks 226 ;; y/n. Whether or not the repo thinks
217 ;; the file should be executable? 227 ;; the file should be executable?
218 "\\([^\0]*\\)\0" 228 "\\([^\0]*\\)\0"
219 "[^\0]*\0" ;last revid? 229 "[^\0]*\0\\)?" ;last revid?
220 ;; There are more fields when merges are pending. 230 ;; There are more fields when merges are pending.
221 ) 231 )
222 nil t) 232 nil t)
@@ -226,7 +236,10 @@ in the repository root directory of FILE."
226 ;; conflict markers). 236 ;; conflict markers).
227 (cond 237 (cond
228 ((eq (char-after (match-beginning 1)) ?a) 'removed) 238 ((eq (char-after (match-beginning 1)) ?a) 'removed)
229 ((eq (char-after (match-beginning 4)) ?a) 'added) 239 ;; If there is no parent, this must be a new repo.
240 ;; If file is in dirstate, can only be added (b#8025).
241 ((or (not (match-beginning 4))
242 (eq (char-after (match-beginning 4)) ?a)) 'added)
230 ((or (and (eq (string-to-number (match-string 3)) 243 ((or (and (eq (string-to-number (match-string 3))
231 (nth 7 (file-attributes file))) 244 (nth 7 (file-attributes file)))
232 (equal (match-string 5) 245 (equal (match-string 5)
@@ -866,38 +879,40 @@ stream. Standard error output is discarded."
866 (result nil)) 879 (result nil))
867 (goto-char (point-min)) 880 (goto-char (point-min))
868 (while (not (eobp)) 881 (while (not (eobp))
869 (setq status-str 882 ;; Bzr 2.3.0 added this if there are shelves. (Bug#8170)
870 (buffer-substring-no-properties (point) (+ (point) 3))) 883 (unless (looking-at "[1-9]+ shel\\(f\\|ves\\) exists?\\.")
871 (setq translated (cdr (assoc status-str translation))) 884 (setq status-str
872 (cond 885 (buffer-substring-no-properties (point) (+ (point) 3)))
873 ((eq translated 'conflict) 886 (setq translated (cdr (assoc status-str translation)))
874 ;; For conflicts the file appears twice in the listing: once 887 (cond
875 ;; with the M flag and once with the C flag, so take care 888 ((eq translated 'conflict)
876 ;; not to add it twice to `result'. Ugly. 889 ;; For conflicts the file appears twice in the listing: once
877 (let* ((file 890 ;; with the M flag and once with the C flag, so take care
878 (buffer-substring-no-properties 891 ;; not to add it twice to `result'. Ugly.
879 ;;For files with conflicts the format is: 892 (let* ((file
880 ;;C Text conflict in FILENAME 893 (buffer-substring-no-properties
881 ;; Bah. 894 ;;For files with conflicts the format is:
882 (+ (point) 21) (line-end-position))) 895 ;;C Text conflict in FILENAME
883 (entry (assoc file result))) 896 ;; Bah.
884 (when entry 897 (+ (point) 21) (line-end-position)))
885 (setf (nth 1 entry) 'conflict)))) 898 (entry (assoc file result)))
886 ((eq translated 'renamed) 899 (when entry
887 (re-search-forward "R[ M] \\(.*\\) => \\(.*\\)$" (line-end-position) t) 900 (setf (nth 1 entry) 'conflict))))
888 (let ((new-name (file-relative-name (match-string 2) relative-dir)) 901 ((eq translated 'renamed)
889 (old-name (file-relative-name (match-string 1) relative-dir))) 902 (re-search-forward "R[ M] \\(.*\\) => \\(.*\\)$" (line-end-position) t)
890 (push (list new-name 'edited 903 (let ((new-name (file-relative-name (match-string 2) relative-dir))
891 (vc-bzr-create-extra-fileinfo old-name)) result))) 904 (old-name (file-relative-name (match-string 1) relative-dir)))
892 ;; do nothing for non existent files 905 (push (list new-name 'edited
893 ((eq translated 'not-found)) 906 (vc-bzr-create-extra-fileinfo old-name)) result)))
894 (t 907 ;; do nothing for non existent files
895 (push (list (file-relative-name 908 ((eq translated 'not-found))
896 (buffer-substring-no-properties 909 (t
897 (+ (point) 4) 910 (push (list (file-relative-name
898 (line-end-position)) relative-dir) 911 (buffer-substring-no-properties
899 translated) result))) 912 (+ (point) 4)
900 (forward-line)) 913 (line-end-position)) relative-dir)
914 translated) result))))
915 (forward-line))
901 (funcall update-function result))) 916 (funcall update-function result)))
902 917
903(defun vc-bzr-dir-status (dir update-function) 918(defun vc-bzr-dir-status (dir update-function)
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 38fbaaedd32..d4970207b94 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -265,6 +265,7 @@ See `run-hooks'."
265 (define-key map [C-up] 'vc-dir-previous-directory) 265 (define-key map [C-up] 'vc-dir-previous-directory)
266 ;; The remainder. 266 ;; The remainder.
267 (define-key map "f" 'vc-dir-find-file) 267 (define-key map "f" 'vc-dir-find-file)
268 (define-key map "e" 'vc-dir-find-file) ; dired-mode compatibility
268 (define-key map "\C-m" 'vc-dir-find-file) 269 (define-key map "\C-m" 'vc-dir-find-file)
269 (define-key map "o" 'vc-dir-find-file-other-window) 270 (define-key map "o" 'vc-dir-find-file-other-window)
270 (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process) 271 (define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process)
@@ -1184,9 +1185,9 @@ These are the commands available for use in the file status buffer:
1184 ;; therefore it makes sense to always do that. 1185 ;; therefore it makes sense to always do that.
1185 ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d 1186 ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d
1186 ;; you may get a new *vc-dir* buffer, different from the original 1187 ;; you may get a new *vc-dir* buffer, different from the original
1187 (file-truename (read-file-name "VC status for directory: " 1188 (file-truename (read-directory-name "VC status for directory: "
1188 default-directory default-directory t 1189 default-directory default-directory t
1189 nil #'file-directory-p)) 1190 nil))
1190 (if current-prefix-arg 1191 (if current-prefix-arg
1191 (intern 1192 (intern
1192 (completing-read 1193 (completing-read
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index d3a64f15f9e..488efaa3522 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -25,14 +25,10 @@
25 25
26;; See vc.el 26;; See vc.el
27 27
28;; Some features will not work with old RCS versions. Where 28;; Some features will not work with ancient RCS versions. Where
29;; appropriate, VC finds out which version you have, and allows or 29;; appropriate, VC finds out which version you have, and allows or
30;; disallows those features (stealing locks, for example, works only 30;; disallows those features.
31;; from 5.6.2 onwards). 31
32;; Even initial checkins will fail if your RCS version is so old that ci
33;; doesn't understand -t-; this has been known to happen to people running
34;; NExTSTEP 3.0.
35;;
36;; You can support the RCS -x option by customizing vc-rcs-master-templates. 32;; You can support the RCS -x option by customizing vc-rcs-master-templates.
37 33
38;;; Code: 34;;; Code:
@@ -391,7 +387,7 @@ whether to remove it."
391 (vc-rcs-set-default-branch file 387 (vc-rcs-set-default-branch file
392 (if (vc-rcs-trunk-p new-version) nil 388 (if (vc-rcs-trunk-p new-version) nil
393 (vc-branch-part new-version))) 389 (vc-branch-part new-version)))
394 ;; If this is an old RCS release, we might have 390 ;; If this is an old (pre-1992!) RCS release, we might have
395 ;; to remove a remaining lock. 391 ;; to remove a remaining lock.
396 (if (not (vc-rcs-release-p "5.6.2")) 392 (if (not (vc-rcs-release-p "5.6.2"))
397 ;; exit status of 1 is also accepted. 393 ;; exit status of 1 is also accepted.
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 20c7689f401..7362258a42d 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -174,7 +174,9 @@ If you want to force an empty list of arguments, use t."
174 (while (re-search-forward re nil t) 174 (while (re-search-forward re nil t)
175 (let ((state (cdr (assq (aref (match-string 1) 0) state-map))) 175 (let ((state (cdr (assq (aref (match-string 1) 0) state-map)))
176 (propstat (cdr (assq (aref (match-string 2) 0) state-map))) 176 (propstat (cdr (assq (aref (match-string 2) 0) state-map)))
177 (filename (match-string 4))) 177 (filename (if (memq system-type '(windows-nt ms-dos))
178 (replace-regexp-in-string "\\\\" "/" (match-string 4))
179 (match-string 4))))
178 (and (memq propstat '(conflict edited)) 180 (and (memq propstat '(conflict edited))
179 (not (eq state 'conflict)) ; conflict always wins 181 (not (eq state 'conflict)) ; conflict always wins
180 (setq state propstat)) 182 (setq state propstat))
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 02743847800..200291bd925 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1954,7 +1954,7 @@ checked out in that new branch."
1954 ;; For VC's that do not work at file level, it's pointless 1954 ;; For VC's that do not work at file level, it's pointless
1955 ;; to ask for a directory, branches are created at repository level. 1955 ;; to ask for a directory, branches are created at repository level.
1956 default-directory 1956 default-directory
1957 (read-file-name "Directory: " default-directory default-directory t)) 1957 (read-directory-name "Directory: " default-directory default-directory t))
1958 (read-string (if current-prefix-arg "New branch name: " "New tag name: ")) 1958 (read-string (if current-prefix-arg "New branch name: " "New tag name: "))
1959 current-prefix-arg))) 1959 current-prefix-arg)))
1960 (message "Making %s... " (if branchp "branch" "tag")) 1960 (message "Making %s... " (if branchp "branch" "tag"))
@@ -1980,7 +1980,7 @@ allowed and simply skipped)."
1980 ;; For VC's that do not work at file level, it's pointless 1980 ;; For VC's that do not work at file level, it's pointless
1981 ;; to ask for a directory, branches are created at repository level. 1981 ;; to ask for a directory, branches are created at repository level.
1982 default-directory 1982 default-directory
1983 (read-file-name "Directory: " default-directory default-directory t)) 1983 (read-directory-name "Directory: " default-directory default-directory t))
1984 (read-string "Tag name to retrieve (default latest revisions): ")))) 1984 (read-string "Tag name to retrieve (default latest revisions): "))))
1985 (let ((update (yes-or-no-p "Update any affected buffers? ")) 1985 (let ((update (yes-or-no-p "Update any affected buffers? "))
1986 (msg (if (or (not name) (string= name "")) 1986 (msg (if (or (not name) (string= name ""))
diff --git a/lisp/window.el b/lisp/window.el
index af5d9a5b16b..c3f8de6f9dd 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -106,11 +106,12 @@ even if it is active. Otherwise, the minibuffer is counted
106when it is active. 106when it is active.
107 107
108The optional arg ALL-FRAMES t means count windows on all frames. 108The optional arg ALL-FRAMES t means count windows on all frames.
109If it is `visible', count windows on all visible frames. 109If it is `visible', count windows on all visible frames on the
110ALL-FRAMES nil or omitted means count only the selected frame, 110current terminal. ALL-FRAMES nil or omitted means count only the
111plus the minibuffer it uses (which may be on another frame). 111selected frame, plus the minibuffer it uses (which may be on
112ALL-FRAMES 0 means count all windows in all visible or iconified frames. 112another frame). ALL-FRAMES 0 means count all windows in all
113If ALL-FRAMES is anything else, count only the selected frame." 113visible or iconified frames on the current terminal. If
114ALL-FRAMES is anything else, count only the selected frame."
114 (let ((base-window (selected-window))) 115 (let ((base-window (selected-window)))
115 (if (and nomini (eq base-window (minibuffer-window))) 116 (if (and nomini (eq base-window (minibuffer-window)))
116 (setq base-window (next-window base-window))) 117 (setq base-window (next-window base-window)))
@@ -169,9 +170,9 @@ ALL-FRAMES nil or omitted means cycle through all windows on the
169ALL-FRAMES t means cycle through all windows on all existing 170ALL-FRAMES t means cycle through all windows on all existing
170 frames. 171 frames.
171ALL-FRAMES `visible' means cycle through all windows on all 172ALL-FRAMES `visible' means cycle through all windows on all
172 visible frames. 173 visible frames on the current terminal.
173ALL-FRAMES 0 means cycle through all windows on all visible and 174ALL-FRAMES 0 means cycle through all windows on all visible and
174 iconified frames. 175 iconified frames on the current terminal.
175ALL-FRAMES a frame means cycle through all windows on that frame 176ALL-FRAMES a frame means cycle through all windows on that frame
176 only. 177 only.
177Anything else means cycle through all windows on the selected 178Anything else means cycle through all windows on the selected
@@ -1067,9 +1068,11 @@ when the specified buffer is already displayed. If the buffer is
1067already displayed in some window on one of these frames simply 1068already displayed in some window on one of these frames simply
1068return that window. Possible values of FRAME are: 1069return that window. Possible values of FRAME are:
1069 1070
1070`visible' - consider windows on all visible frames. 1071`visible' - consider windows on all visible frames on the current
1072terminal.
1071 1073
10720 - consider windows on all visible or iconified frames. 10740 - consider windows on all visible or iconified frames on the
1075current terminal.
1073 1076
1074t - consider windows on all frames. 1077t - consider windows on all frames.
1075 1078
@@ -1079,7 +1082,7 @@ nil - consider windows on the selected frame \(actually the
1079last non-minibuffer frame\) only. If, however, either 1082last non-minibuffer frame\) only. If, however, either
1080`display-buffer-reuse-frames' or `pop-up-frames' is non-nil 1083`display-buffer-reuse-frames' or `pop-up-frames' is non-nil
1081\(non-nil and not graphic-only on a text-only terminal), 1084\(non-nil and not graphic-only on a text-only terminal),
1082consider all visible or iconified frames." 1085consider all visible or iconified frames on the current terminal."
1083 (interactive "BDisplay buffer:\nP") 1086 (interactive "BDisplay buffer:\nP")
1084 (let* ((can-use-selected-window 1087 (let* ((can-use-selected-window
1085 ;; The selected window is usable unless either NOT-THIS-WINDOW 1088 ;; The selected window is usable unless either NOT-THIS-WINDOW