aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJoakim Verona2011-07-15 04:39:29 +0200
committerJoakim Verona2011-07-15 04:39:29 +0200
commit4f616a2e7ed1db28da98df90266e9751a8ae9ee1 (patch)
tree74a9dcbe13e945e712ae04a4a94c2202ca720591 /lisp
parentff2be00005c3aeda6e11d7ed264ce86f02b60958 (diff)
parentec2bc542a4d0127425625e8cb458684bd825675a (diff)
downloademacs-4f616a2e7ed1db28da98df90266e9751a8ae9ee1.tar.gz
emacs-4f616a2e7ed1db28da98df90266e9751a8ae9ee1.zip
merge from upstream
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog1225
-rw-r--r--lisp/ChangeLog.142
-rw-r--r--lisp/ChangeLog.152
-rw-r--r--lisp/ChangeLog.62
-rw-r--r--lisp/abbrev.el37
-rw-r--r--lisp/allout-widgets.el14
-rw-r--r--lisp/allout.el226
-rw-r--r--lisp/arc-mode.el91
-rw-r--r--lisp/autoinsert.el2
-rw-r--r--lisp/bindings.el13
-rw-r--r--lisp/bookmark.el6
-rw-r--r--lisp/bs.el4
-rw-r--r--lisp/buff-menu.el26
-rw-r--r--lisp/button.el5
-rw-r--r--lisp/calendar/timeclock.el6
-rw-r--r--lisp/cedet/ChangeLog10
-rw-r--r--lisp/cedet/semantic.el4
-rw-r--r--lisp/cedet/semantic/db.el2
-rw-r--r--lisp/comint.el2
-rw-r--r--lisp/cus-edit.el69
-rw-r--r--lisp/cus-theme.el4
-rw-r--r--lisp/custom.el100
-rw-r--r--lisp/dabbrev.el3
-rw-r--r--lisp/dired-aux.el35
-rw-r--r--lisp/dired-x.el19
-rw-r--r--lisp/dired.el133
-rw-r--r--lisp/disp-table.el20
-rw-r--r--lisp/dynamic-setting.el2
-rw-r--r--lisp/emacs-lisp/benchmark.el5
-rw-r--r--lisp/emacs-lisp/debug.el2
-rw-r--r--lisp/emacs-lisp/derived.el10
-rw-r--r--lisp/emacs-lisp/elp.el6
-rw-r--r--lisp/emacs-lisp/find-func.el21
-rw-r--r--lisp/emacs-lisp/lisp-mode.el39
-rw-r--r--lisp/emacs-lisp/testcover.el2
-rw-r--r--lisp/emacs-lisp/timer.el41
-rw-r--r--lisp/emacs-lock.el277
-rw-r--r--lisp/emulation/viper-cmd.el5
-rw-r--r--lisp/erc/ChangeLog5
-rw-r--r--lisp/erc/erc.el44
-rw-r--r--lisp/eshell/em-smart.el1
-rw-r--r--lisp/faces.el108
-rw-r--r--lisp/files.el36
-rw-r--r--lisp/find-dired.el3
-rw-r--r--lisp/follow.el46
-rw-r--r--lisp/font-lock.el13
-rw-r--r--lisp/frame.el110
-rw-r--r--lisp/fringe.el2
-rw-r--r--lisp/gnus/ChangeLog311
-rw-r--r--lisp/gnus/ChangeLog.22
-rw-r--r--lisp/gnus/auth-source.el497
-rw-r--r--lisp/gnus/gnus-art.el14
-rw-r--r--lisp/gnus/gnus-draft.el3
-rw-r--r--lisp/gnus/gnus-fun.el5
-rw-r--r--lisp/gnus/gnus-group.el44
-rw-r--r--lisp/gnus/gnus-int.el7
-rw-r--r--lisp/gnus/gnus-msg.el79
-rw-r--r--lisp/gnus/gnus-start.el17
-rw-r--r--lisp/gnus/gnus-sum.el9
-rw-r--r--lisp/gnus/gnus-util.el11
-rw-r--r--lisp/gnus/gnus.el21
-rw-r--r--lisp/gnus/message.el18
-rw-r--r--lisp/gnus/mm-decode.el14
-rw-r--r--lisp/gnus/mm-util.el59
-rw-r--r--lisp/gnus/mml2015.el12
-rw-r--r--lisp/gnus/nndraft.el30
-rw-r--r--lisp/gnus/nnimap.el42
-rw-r--r--lisp/gnus/nnir.el204
-rw-r--r--lisp/gnus/nnmh.el4
-rw-r--r--lisp/gnus/nntp.el6
-rw-r--r--lisp/gnus/plstore.el438
-rw-r--r--lisp/gnus/pop3.el3
-rw-r--r--lisp/image-mode.el2
-rw-r--r--lisp/image.el1
-rw-r--r--lisp/info-look.el4
-rw-r--r--lisp/info.el30
-rw-r--r--lisp/international/characters.el18
-rw-r--r--lisp/international/charprop.el13
-rw-r--r--lisp/international/mule-cmds.el53
-rw-r--r--lisp/international/uni-bidi.elbin9287 -> 8719 bytes
-rw-r--r--lisp/international/uni-category.elbin12450 -> 11396 bytes
-rw-r--r--lisp/international/uni-combining.elbin8881 -> 8369 bytes
-rw-r--r--lisp/international/uni-comment.elbin2276 -> 2386 bytes
-rw-r--r--lisp/international/uni-decimal.elbin2483 -> 1869 bytes
-rw-r--r--lisp/international/uni-decomposition.elbin27823 -> 28459 bytes
-rw-r--r--lisp/international/uni-digit.elbin2790 -> 2187 bytes
-rw-r--r--lisp/international/uni-lowercase.elbin5387 -> 5347 bytes
-rw-r--r--lisp/international/uni-mirrored.elbin7904 -> 10452 bytes
-rw-r--r--lisp/international/uni-name.elbin157287 -> 158765 bytes
-rw-r--r--lisp/international/uni-numeric.elbin4258 -> 3688 bytes
-rw-r--r--lisp/international/uni-old-name.elbin19338 -> 19692 bytes
-rw-r--r--lisp/international/uni-titlecase.elbin5477 -> 5434 bytes
-rw-r--r--lisp/international/uni-uppercase.elbin5473 -> 5430 bytes
-rw-r--r--lisp/isearch.el11
-rw-r--r--lisp/jka-cmpr-hook.el2
-rw-r--r--lisp/jka-compr.el11
-rw-r--r--lisp/ldefs-boot.el552
-rw-r--r--lisp/loadhist.el32
-rw-r--r--lisp/loadup.el4
-rw-r--r--lisp/longlines.el6
-rw-r--r--lisp/mail/feedmail.el33
-rw-r--r--lisp/mail/rmail.el44
-rw-r--r--lisp/mail/rmailmm.el64
-rw-r--r--lisp/mail/sendmail.el64
-rw-r--r--lisp/mail/smtpmail.el17
-rw-r--r--lisp/man.el31
-rw-r--r--lisp/menu-bar.el129
-rw-r--r--lisp/mh-e/ChangeLog83
-rw-r--r--lisp/mh-e/mh-acros.el7
-rw-r--r--lisp/mh-e/mh-alias.el3
-rw-r--r--lisp/mh-e/mh-comp.el5
-rw-r--r--lisp/mh-e/mh-compat.el28
-rw-r--r--lisp/mh-e/mh-e.el14
-rw-r--r--lisp/mh-e/mh-folder.el13
-rw-r--r--lisp/mh-e/mh-funcs.el2
-rw-r--r--lisp/mh-e/mh-letter.el22
-rw-r--r--lisp/mh-e/mh-mime.el13
-rw-r--r--lisp/mh-e/mh-search.el15
-rw-r--r--lisp/mh-e/mh-seq.el3
-rw-r--r--lisp/mh-e/mh-show.el4
-rw-r--r--lisp/mh-e/mh-speed.el8
-rw-r--r--lisp/mh-e/mh-utils.el6
-rw-r--r--lisp/mh-e/mh-xface.el21
-rw-r--r--lisp/minibuffer.el72
-rw-r--r--lisp/mouse-sel.el31
-rw-r--r--lisp/mouse.el20
-rw-r--r--lisp/net/browse-url.el17
-rw-r--r--lisp/net/network-stream.el43
-rw-r--r--lisp/net/soap-client.el8
-rw-r--r--lisp/net/tramp-cmds.el9
-rw-r--r--lisp/net/tramp-compat.el20
-rw-r--r--lisp/net/tramp-sh.el81
-rw-r--r--lisp/net/tramp.el10
-rw-r--r--lisp/nxml/rng-maint.el8
-rw-r--r--lisp/obsolete/old-emacs-lock.el102
-rw-r--r--lisp/pcmpl-linux.el13
-rw-r--r--lisp/play/animate.el41
-rw-r--r--lisp/play/hanoi.el13
-rw-r--r--lisp/printing.el19
-rw-r--r--lisp/progmodes/cc-engine.el29
-rw-r--r--lisp/progmodes/cc-guess.el574
-rw-r--r--lisp/progmodes/cc-langs.el13
-rw-r--r--lisp/progmodes/cc-mode.el10
-rw-r--r--lisp/progmodes/cc-styles.el9
-rw-r--r--lisp/progmodes/cc-vars.el3
-rw-r--r--lisp/progmodes/cfengine.el268
-rw-r--r--lisp/progmodes/compile.el11
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/progmodes/etags.el6
-rw-r--r--lisp/progmodes/flymake.el11
-rw-r--r--lisp/progmodes/gdb-mi.el1058
-rw-r--r--lisp/progmodes/grep.el3
-rw-r--r--lisp/progmodes/gud.el3
-rw-r--r--lisp/progmodes/js.el4
-rw-r--r--lisp/progmodes/sql.el1155
-rw-r--r--lisp/progmodes/which-func.el3
-rw-r--r--lisp/rect.el11
-rw-r--r--lisp/register.el4
-rw-r--r--lisp/replace.el3
-rw-r--r--lisp/scroll-bar.el3
-rw-r--r--lisp/server.el13
-rw-r--r--lisp/ses.el26
-rw-r--r--lisp/simple.el21
-rw-r--r--lisp/startup.el188
-rw-r--r--lisp/subr.el100
-rw-r--r--lisp/tabify.el28
-rw-r--r--lisp/term/ns-win.el3
-rw-r--r--lisp/textmodes/bibtex.el1259
-rw-r--r--lisp/textmodes/fill.el2
-rw-r--r--lisp/textmodes/flyspell.el9
-rw-r--r--lisp/textmodes/reftex-parse.el55
-rw-r--r--lisp/textmodes/rst.el2
-rw-r--r--lisp/textmodes/texnfo-upd.el2
-rw-r--r--lisp/thingatpt.el64
-rw-r--r--lisp/time.el49
-rw-r--r--lisp/tool-bar.el3
-rw-r--r--lisp/type-break.el50
-rw-r--r--lisp/url/ChangeLog21
-rw-r--r--lisp/url/url-cache.el1
-rw-r--r--lisp/url/url-http.el27
-rw-r--r--lisp/vc/diff.el8
-rw-r--r--lisp/vc/ediff-util.el12
-rw-r--r--lisp/vc/ediff.el2
-rw-r--r--lisp/vc/vc-arch.el2
-rw-r--r--lisp/vc/vc-bzr.el18
-rw-r--r--lisp/vc/vc.el15
-rw-r--r--lisp/w32-fns.el2
-rw-r--r--lisp/window.el1014
-rw-r--r--lisp/winner.el2
-rw-r--r--lisp/woman.el12
190 files changed, 9029 insertions, 3729 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 29ea8dca53c..1b3e25da8e1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,1222 @@
12011-07-15 Glenn Morris <rgm@gnu.org>
2
3 * emacs-lisp/debug.el (debug): Doc fix. (Bug#8273)
4
52011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6
7 * man.el (Man-fontify-manpage): Fix message when formatting the
8 man page (bug#7929).
9
102011-07-14 Eli Zaretskii <eliz@gnu.org>
11
12 * buff-menu.el (Buffer-menu-buffer+size): Accept an additional
13 argument LRM; if non-nil, append an invisible LRM character to the
14 buffer name.
15 (list-buffers-noselect): Call Buffer-menu-buffer+size with the
16 last argument non-nil, when formatting buffer names.
17 (Buffer-menu-mode, list-buffers-noselect): Force left-to-right
18 paragraph direction.
19
202011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
21
22 * man.el (Man-bgproc-sentinel): Skip any arguments and only output
23 the man page name (bug#7929).
24
25 * image.el (put-image): Mention the `put-image' overlay property
26 (bug#7834).
27
28 * scroll-bar.el (set-scroll-bar-mode): Mention that
29 `scroll-bar-mode' lists the values (bug#7772).
30
31 * image-mode.el (image-mode-fit-frame): Mention that it's a toggle
32 command (bug#7729).
33
34 * rect.el (apply-on-rectangle): Return the point after the last
35 operation.
36 (string-rectangle): Go to the point after the last operation
37 (bug#7522).
38
39 * simple.el (current-kill): Clarify what
40 `interprogram-paste-function' does (bug#7500).
41
42 * printing.el (pr-toggle-region): Clarify the documentation
43 slightly (bug#7493).
44
45 * time.el (display-time-update): Allow
46 `display-time-mail-function' to return nil (bug#7158). Fix
47 suggested by Detlev Zundel.
48
49 * vc/diff.el (diff): Clarify the order the file names are read
50 (bug#7111).
51
52 * mouse.el (mouse-set-region): Link to `mouse-drag-copy-region' in
53 the doc string (bug#7015).
54
55 * font-lock.el (font-lock-maximum-decoration): Mention what
56 numeric levels mean (bug#6935).
57
58 * startup.el (initial-buffer-choice): Don't mention the `none'
59 selection, which is against policy.
60
612011-07-14 Martin Rudalics <rudalics@gmx.at>
62
63 * window.el (display-buffer-normalize-special): Replace
64 `dedicated' by `dedicate' to dedicate window (Bug#9072).
65
662011-07-14 Eli Zaretskii <eliz@gnu.org>
67
68 * subr.el (version<, version<=, version=): Mention "-CVS" and
69 "-12345" alpha version numbers.
70
712011-07-14 Chong Yidong <cyd@stupidchicken.com>
72
73 * bindings.el: Add advertised binding for set-mark-command
74 (Bug#5772).
75
762011-07-14 Chong Yidong <cyd@stupidchicken.com>
77
78 * bindings.el (mode-line-other-buffer):
79 * bookmark.el (bookmark-bmenu-2-window):
80 * bs.el (bs-cycle-next, bs-cycle-previous):
81 * net/tramp-cmds.el (tramp-append-tramp-buffers): Revert to using
82 switch-to-buffer.
83
84 * net/tramp-compat.el (tramp-compat-pop-to-buffer-same-window):
85 Deleted.
86
872011-07-14 Juanma Barranquero <lekktu@gmail.com>
88
89 * follow.el (follow-debug-message, follow-redisplay):
90 * jka-cmpr-hook.el (with-auto-compression-mode):
91 Fix typos in docstrings.
92
932011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
94
95 * subr.el (with-silent-modifications): Clarify somewhat what the
96 macro inhibits (bug#6525).
97
98 * simple.el (eval-expression): Note what it does if called
99 interactively (bug#6495).
100
1012011-07-13 Chong Yidong <cyd@stupidchicken.com>
102
103 * window.el (switch-to-buffer): New arg FORCE-SAME-WINDOW. Use
104 pop-to-buffer buffer-or-name if it is nil.
105
106 * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
107 Remove switch-to-buffer.
108
1092011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
110
111 * files.el (make-directory): Clarify that an error will be raised
112 if there's an error (bug#6397).
113
114 * startup.el (initial-buffer-choice): Add `none' as a choice
115 (bug#6234).
116
117 * subr.el (add-hook): Clarify section about buffer-local hooks
118 (bug#6218).
119
120 * dired.el (dired-flagged): Clarify doc string (bug#6117).
121
1222011-07-13 Juanma Barranquero <lekktu@gmail.com>
123
124 * tabify.el (untabify): Preserve the current column so that point
125 doesn't move (bug#6032).
126
1272011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
128
129 * progmodes/cperl-mode.el (cperl-syntaxify-by-font-lock): Rewrite
130 to avoid awkward possessive "s" (bug#5986).
131
1322011-07-13 Glenn Morris <rgm@gnu.org>
133
134 * dired.el (dired-use-ls-dired): Doc fix. (Bug#9039).
135 (dired-insert-directory): Give a message the first time
136 if ls is found not to support --dired.
137
1382011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
139
140 * simple.el (toggle-truncate-lines): Clarify what is toggled
141 (bug#5580). Text by Drew Adams.
142
1432011-07-13 Chong Yidong <cyd@stupidchicken.com>
144
145 * simple.el (blink-matching-open): Make the error message from the
146 last change less verbose.
147
1482011-07-13 Dan Nicolaescu <dann@ics.uci.edu>
149
150 * font-lock.el (font-lock-comment-face): Use the high contrast
151 "yellow" color for font-lock-comment-face on low color terminals
152 using a dark background color (bug#4221).
153
1542011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
155
156 * dired.el (dired-insert-set-properties): Make the doc string
157 reflect what it does now (bug#5325).
158
159 * simple.el (blink-matching-open): Say that we were unable to find
160 the match within the limit, if we're limited (bug#5122).
161
162 * international/mule-cmds.el (prefer-coding-system): Add an
163 example (bug#4869).
164
165 * progmodes/etags.el (tags-search): Document `file-list-form'
166 (bug#4731).
167
1682011-07-13 Lawrence Mitchell <wence@gmx.li>
169
170 * net/browse-url.el (browse-url-default-browser)
171 (browse-url-browser-function): Make the default browser choice a
172 bit more logical (bug#4300). Also clean up the doc string.
173
1742011-07-13 Juanma Barranquero <lekktu@gmail.com>
175
176 * bindings.el (completion-ignored-extensions): Add OpenMCL/Clozure
177 binary endings (bug#4440).
178
1792011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
180
181 * info.el (info-insert-file-contents): Inhibit jka-compr messages,
182 which can be pretty annoying (bug#8971).
183
184 * jka-compr.el (jka-compr-verbose): New variable, and use
185 throughout (bug#8971).
186
187 * info.el (Info-find-file): Fall back on the installation
188 directory if we can't find the info node anywhere else.
189
1902011-07-13 Sergei Organov <osv@javad.com> (tiny change)
191
192 * vc/vc.el (vc-revert-file):
193 Don't set file time-stamp in the past. (Bug#5181)
194
1952011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
196
197 * files.el (after-find-file): Give a better error message when
198 trying to find a symlink that points to a file that doesn't exist
199 (bug#4398).
200
201 * progmodes/cc-vars.el: Remove (probably) misleading comment
202 (bug#4396).
203
2042011-07-12 Johan Bockgård <bojohan@gnu.org>
205
206 * mouse-sel.el (mouse-sel-primary-overlay): Use the `region' face.
207
2082011-07-12 Chong Yidong <cyd@stupidchicken.com>
209
210 * mouse-sel.el: Hack restoring functionality, while keeping
211 compatibility with 2010-07-03 changes to mouse selection.
212 (mouse-sel-primary-overlay): New var.
213 (mouse-sel-selection-alist): Use it.
214 (mouse-sel-mode): Doc fix; remove points that are default features
215 of mouse.el.
216
2172011-07-12 Johan Bockgård <bojohan@gnu.org>
218
219 * progmodes/compile.el (compilation-error-regexp-alist-alist):
220 Fix previous fix (bug#2490).
221
2222011-07-12 Roland Winkler <winkler@gnu.org>
223
224 * textmodes/bibtex.el (bibtex-initialize): Use
225 pop-to-buffer-same-window.
226 (bibtex-search-entries): Fix interactive call.
227
2282011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
229
230 * progmodes/compile.el (compilation-error-regexp-alist-alist):
231 Fontise bytecomp Error lines more correctly (bug#2490). Fix
232 suggested by Johan Bockgård.
233
234 * subr.el (remove-duplicates): Remove; `delete-dups' is sufficient.
235
236 * dired-x.el (dired-guess-default): Use `delete-dups'.
237
2382011-07-12 Chong Yidong <cyd@stupidchicken.com>
239
240 * dired.el (dired-mark-prompt):
241 * dired-aux.el (dired-read-shell-command): Doc fix.
242
2432011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
244
245 * mail/sendmail.el (sendmail-query-once): Use
246 `customize-save-variable' unconditionally, now that it works under
247 emacs -Q.
248
249 * mail/smtpmail.el (smtpmail-query-smtp-server): Ditto.
250
251 * cus-edit.el (custom-file): Take an optional no-error variable.
252 (customize-save-variable): Set the variable, and give a warning if
253 running under "emacs -q".
254
2552011-07-11 Juanma Barranquero <lekktu@gmail.com>
256
257 * loadhist.el (unload-feature-special-hooks):
258 Add `auto-coding-functions', `fill-nobreak-predicate' and
259 `find-directory-functions' (bug#5327).
260
2612011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
262
263 * vc/ediff.el (ediff-patch-file): Clarify doc string (bug#3138).
264
265 * cus-edit.el (custom-guess-name-alist): -alist variables should
266 use the `alist' type (bug#3120). Suggested by Drew Adams.
267
268 * printing.el: Add documentation to all the `pr-toggle-' commands.
269
2702011-07-11 Leo <sdl.web@gmail.com> (tiny change)
271
272 * files.el (toggle-read-only): Only do the `C-x C-q' warning on VC
273 backends where it makes sense (bug#2623).
274
2752011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
276
277 * dired-x.el (dired-guess-default): Remove duplicate shell command
278 entries (bug#2028).
279 (dired-guess-default): Fix grammar in doc string (bug#2028).
280 (dired-guess-shell-alist-user): Clarify the example a bit (bug#2030).
281
282 * subr.el (remove-duplicates): New conveniency function.
283
2842011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
285
286 * tool-bar.el (tool-bar-mode): Clarify positive/negative arguments
287 (bug#1526).
288
2892011-07-10 Martin Rudalics <rudalics@gmx.at>
290
291 * window.el (display-buffer-normalize-default): Don't invert
292 meaning of even-window-heights. Reported by Eli Zaretskii
293 <eliz@gnu.org>.
294
2952011-07-10 Bob Rogers <rogers@rgrjr.dyndns.org>
296
297 * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256).
298
2992011-07-10 Chong Yidong <cyd@stupidchicken.com>
300
301 * window.el (display-buffer): Fix arguments to
302 display-buffer-reuse-window in last change.
303
304 * faces.el (link): Use a less saturated blue on light backgrounds.
305
306 * startup.el (fancy-startup-text, fancy-about-text)
307 (fancy-startup-tail): Use font-lock faces, for background safety.
308
3092011-07-09 Bob Nnamtrop <bobnnamtrop@gmail.com> (tiny change)
310
311 * emulation/viper-cmd.el (viper-change-state-to-vi): Limit
312 triggering of abbrev expansion (Bug#9038).
313
3142011-07-09 Martin Rudalics <rudalics@gmx.at>
315
316 * window.el (display-buffer-default-specifiers): Remove.
317 (display-buffer-macro-specifiers): Remove default specifiers.
318 (display-buffer-alist): Default to nil.
319 (display-buffer-reuse-window): New optional argument
320 other-window.
321 (display-buffer-pop-up-window): Allow splitting internal
322 windows. Check whether a live window was created.
323 (display-buffer-other-window-means-other-frame)
324 (display-buffer-normalize-arguments): Rename to
325 display-buffer-normalize-argument and rewrite. Set the
326 other-window specifier.
327 (display-buffer-normalize-special): New function.
328 (display-buffer-normalize-options): Rename to
329 display-buffer-normalize-default and rewrite.
330 (display-buffer-normalize-options-inhibit): Remove.
331 (display-buffer-normalize-specifiers): Rewrite.
332 (display-buffer): Process other-window specifier and call
333 display-buffer-reuse-window with it. Emulate Emacs 23 behavior
334 more faithfully.
335 (pop-up-windows, even-window-heights): Restore Emacs 23 default
336 values.
337 (display-buffer-alist-set): Don't handle 'unset default values.
338 (display-buffer-in-window, display-buffer-alist-set): Replace
339 symbol "dedicated" by "dedicate". Reported by Tassilo Horn
340 <tassilo@member.fsf.org>.
341
3422011-07-09 Leo Liu <sdl.web@gmail.com>
343
344 * register.el (insert-register): Restore accidental change on
345 2011-06-26. (Bug#9028)
346
3472011-07-09 Glenn Morris <rgm@gnu.org>
348
349 * subr.el (remq): Handle the empty list. (Bug#9024)
350
3512011-07-08 Andreas Schwab <schwab@linux-m68k.org>
352
353 * mail/sendmail.el (send-mail-function): No longer delay custom
354 initialization.
355 * custom.el (custom-initialize-delay): Doc fix.
356
3572011-07-08 Stefan Monnier <monnier@iro.umontreal.ca>
358
359 * abbrev.el (expand-abbrev): Try to preserve point (bug#5805).
360
3612011-07-08 Michael Albinus <michael.albinus@gmx.de>
362
363 * net/tramp-sh.el (tramp-sh-handle-start-file-process): Use a
364 human-friendly prompt.
365
3662011-07-08 Stefan Monnier <monnier@iro.umontreal.ca>
367
368 * vc/vc-bzr.el (vc-bzr-revision-keywords): Remove svn, it's only
369 provided by a particular plugin.
370
3712011-07-08 Lars Magne Ingebrigtsen <larsi@gnus.org>
372
373 * mail/sendmail.el (sendmail-query-once): If we aren't allowed to
374 save customizations (with "emacs -Q"), just set the variable
375 instead of erroring out.
376
377 * mail/smtpmail.el (smtpmail-query-smtp-server): Ditto.
378
3792011-07-08 Juri Linkov <juri@jurta.org>
380
381 * arc-mode.el (archive-zip-expunge, archive-zip-update)
382 (archive-zip-update-case): Use 7z if found by `executable-find'.
383 The order of searching the available programs is the same as in
384 `archive-zip-extract' (bug#8968).
385
3862011-07-07 Chong Yidong <cyd@stupidchicken.com>
387
388 * menu-bar.el (menu-bar-line-wrapping-menu): Revert last change.
389 (menu-bar-options-menu): Tweak descriptions.
390
3912011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
392
393 * menu-bar.el (menu-bar-line-wrapping-menu): Make all the Options
394 menu items into verb phrases (bug#1421). Also refill to fit under
395 80 columns.
396
3972011-07-07 Chong Yidong <cyd@stupidchicken.com>
398
399 * info.el (info, Info-read-node-name-2, Info-read-node-name-1)
400 (Info-read-node-name): Doc fix (Bug#1084).
401
402 * thingatpt.el (forward-thing, bounds-of-thing-at-point)
403 (thing-at-point, beginning-of-thing, end-of-thing, in-string-p)
404 (end-of-sexp, beginning-of-sexp)
405 (thing-at-point-bounds-of-list-at-point, forward-whitespace)
406 (forward-symbol, forward-same-syntax, word-at-point)
407 (sentence-at-point): Doc fix (Bug#1144).
408
4092011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
410
411 * info.el (Info-mode-map): Remove S-TAB binding, since [backtab]
412 should cover it (bug#1281).
413
414 * cus-edit.el (custom-show): Mark as obsolete.
415
416 * net/network-stream.el (network-stream-open-starttls): If gnutls
417 negotiation fails, then possibly try again with a non-encrypted
418 connection (bug#9017).
419
420 * mail/smtpmail.el (smtpmail-stream-type): Note that `plain' can
421 be used.
422
4232011-07-07 Richard Stallman <rms@gnu.org>
424
425 * mail/rmail.el (rmail-next-error-move): Use `compilation-message'
426 property, and handle its changed format.
427 Look for the correct line number.
428 Use file's line contents (but not past first =) to find
429 correct line in message.
430
4312011-07-07 Kenichi Handa <handa@m17n.org>
432
433 * international/characters.el (build-unicode-category-table):
434 Delete it.
435 (unicode-category-table): Set it by unicode-property-table-internal.
436
437 * international/mule-cmds.el (char-code-property-alist): Move to
438 to src/chartab.c.
439 (get-char-code-property): Call unicode-property-table-internal to
440 load a file. Call get-unicode-property-internal where necessary.
441 (put-char-code-property): Call unicode-property-table-internal to
442 load a file. Call put-unicode-property-internal where necessary.
443 put-unicode-property-internal where necessary.
444 (char-code-property-description):
445 Call unicode-property-table-internal to load a file.
446
447 * international/charprop.el:
448 * international/uni-bidi.el:
449 * international/uni-category.el:
450 * international/uni-combining.el:
451 * international/uni-comment.el:
452 * international/uni-decimal.el:
453 * international/uni-decomposition.el:
454 * international/uni-digit.el:
455 * international/uni-lowercase.el:
456 * international/uni-mirrored.el:
457 * international/uni-name.el:
458 * international/uni-numeric.el:
459 * international/uni-old-name.el:
460 * international/uni-titlecase.el:
461 * international/uni-uppercase.el: Regenerate.
462
463 * loadup.el: Load international/charprop.el before
464 international/characters.
465
4662011-07-07 Chong Yidong <cyd@stupidchicken.com>
467
468 * window.el (next-buffer, previous-buffer): Signal an error if
469 called from a minibuffer window.
470
471 * bindings.el: Revert 2011-07-04 change.
472
4732011-07-06 Richard Stallman <rms@gnu.org>
474
475 * mail/rmailmm.el (rmail-mime-process): Use markers for buf positions.
476 (rmail-mime-insert-bulk, rmail-mime-insert-text):
477 Treat markers like ints.
478 (rmail-mime-entity): Doc fix.
479
4802011-07-06 Lars Magne Ingebrigtsen <larsi@gnus.org>
481
482 * mail/smtpmail.el (smtpmail-default-smtp-server): Made into a
483 defcustom again for backwards compatibility.
484
485 * simple.el (shell-command-on-region): Fill.
486
487 * dired-aux.el (dired-kill-line): Add a doc string.
488
489 * dabbrev.el (dabbrev-abbrev-char-regexp): Note that nil defaults
490 to "\\sw\\|\\s_" (bug#358).
491
492 * dired.el (dired-mode): Clarify "unmark or unflag" (bug#8770).
493 (dired-unmark-backward): Ditto.
494 (dired-flag-backup-files): Ditto.
495
496 * dired-x.el (dired-mark-sexp): Ditto.
497
4982011-07-06 Richard Stallman <rms@gnu.org>
499
500 * mail/rmailmm.el: Give entity a new slot, TRUNCATED.
501 (rmail-mime-entity): New arg TRUNCATED.
502 (rmail-mime-entity-truncated, rmail-mime-entity-set-truncated):
503 New functions.
504 (rmail-mime-save): Warn if entity is truncated.
505 (rmail-mime-toggle-hidden): Likewise, for showing.
506 (rmail-mime-process-multipart): Record when an entity is truncated.
507
508 * mail/rmailmm.el (rmail-search-mime-message): Don't get confused
509 if ENTITY is a string.
510
5112011-07-06 Lars Magne Ingebrigtsen <larsi@gnus.org>
512
513 * emacs-lisp/lisp-mode.el (eval-defun-1): Update the documentation
514 of faces when `M-C-x'-ing their definitions (bug#8378).
515 Also clean up the code slightly.
516
517 * progmodes/grep.el (rgrep): Don't bind `process-connection-type',
518 because that makes the colours go away.
519
520 * mail/sendmail.el (send-mail-function): Change the default to
521 `sendmail-query-once'.
522 (sendmail-query-once): Add an autoload cookie.
523
524 * net/network-stream.el (network-stream-open-starttls): Try using
525 a plain connection even if the server offered STARTTLS, and we
526 kinda wanted to use it, if Emacs doesn't have any STARTTLS
527 capability. This should make smtpmail.el work in slightly more
528 configurations.
529
5302011-07-06 Michael Albinus <michael.albinus@gmx.de>
531
532 * net/tramp-compat.el (tramp-compat-pop-to-buffer-same-window):
533 New defun.
534 * net/tramp-cmds.el (tramp-append-tramp-buffers): Use it.
535
5362011-07-06 Michael R. Mauger <mmaug@yahoo.com>
537
538 * progmodes/sql.el: Version 3.0
539 (sql-product-alist): Add product :completion-object,
540 :completion-column, and :statement attributes.
541 (sql-mode-menu, sql-interactive-mode-map): Fix List entries.
542 (sql-mode-syntax-table): Mark all punctuation.
543 (sql-font-lock-keywords-builder): Temporarily remove fallback on
544 ansi keywords.
545 (sql-regexp-abbrev, sql-regexp-abbrev-list): New functions.
546 (sql-mode-oracle-font-lock-keywords): Improve.
547 (sql-oracle-show-reserved-words): New function for development.
548 (sql-product-font-lock): Simplify for source code buffers.
549 (sql-product-syntax-table, sql-product-font-lock-syntax-alist):
550 New functions.
551 (sql-highlight-product): Set product specific syntax table.
552 (sql-mode-map): Add statement movement functions.
553 (sql-ansi-statement-starters, sql-oracle-statement-starters):
554 New variable.
555 (sql-statement-regexp, sql-beginning-of-statement)
556 (sql-end-of-statement, sql-signum): New functions.
557 (sql-buffer-live-p, sql=find-sqli-buffer): Add CONNECTION parameter.
558 (sql-show-sqli-buffer): Bug fix.
559 (sql-interactive-mode): Store connection data as buffer local.
560 (sql-connect): Add NEW-NAME parameter. Redesign interaction
561 with sql-interactive-mode.
562 (sql-save-connection): Save buffer local settings.
563 (sql-connection-menu-filter): Change menu entry name.
564 (sql-product-interactive): Bug fix.
565 (sql-preoutput-hold): New variable.
566 (sql-interactive-remove-continuation-prompt): Bug fixes.
567 (sql-debug-redirect): New variable.
568 (sql-str-literal): New function.
569 (sql-redirect, sql-redirect-one, sql-redirect-value, sql-execute):
570 Redesign.
571 (sql-oracle-save-settings, sql-oracle-restore-settings)
572 (sql-oracle-list-all, sql-oracle-list-table): New functions.
573 (sql-completion-object, sql-completion-column)
574 (sql-completion-sqlbuf): New variables.
575 (sql-build-completions-1, sql-build-completions)
576 (sql-try-completion): New functions.
577 (sql-read-table-name): Use them.
578 (sql-contains-names): New buffer local variable.
579 (sql-list-all, sql-list-table): Use it.
580 (sql-oracle-completion-types): New variable.
581 (sql-oracle-completion-object, sql-sqlite-completion-object)
582 (sql-postgres-completion-object): New functions.
583
5842011-07-06 Glenn Morris <rgm@gnu.org>
585
586 * window.el (pop-to-buffer): Doc fix.
587
5882011-07-06 Markus Heiser <markus.heiser@darmarit.de> (tiny change)
589
590 * progmodes/gud.el (gud-pdb-marker-regexp): Accept \r char (Bug#5653).
591
5922011-07-06 Chong Yidong <cyd@stupidchicken.com>
593
594 * window.el (special-display-popup-frame): Doc fix (Bug#8853).
595
596 * info.el (Info-directory-toc-nodes): Minor doc fix (Bug#8833).
597
5982011-07-05 Chong Yidong <cyd@stupidchicken.com>
599
600 * button.el (button): Inherit from link face. Suggested by Dan
601 Nicolaescu.
602
6032011-07-05 Stefan Monnier <monnier@iro.umontreal.ca>
604
605 * progmodes/gdb-mi.el: Fit in 80 columns.
606 (gdb-setup-windows, gdb-restore-windows): Avoid other-window and
607 switch-to-buffer.
608
609 * progmodes/which-func.el (which-func-ff-hook): Don't output a message
610 if imenu is simply not configured (bug#8941).
611
6122011-07-05 Ken Manheimer <ken.manheimer@gmail.com>
613
614 * allout.el (allout-post-undo-hook): New allout outline-change
615 event hook to signal undo activity.
616 (allout-post-command-business): Run allout-post-undo-hook if an
617 undo just occurred.
618 (allout-after-copy-or-kill-hook, allout-mode): Minor docstring changes.
619 * allout-widgets.el (allout-widgets-after-undo-function):
620 Ensure the integrity of the current item's decoration after it has been
621 in the vicinity of an undo.
622 (allout-widgets-mode): Include allout-widgets-after-undo-function
623 on the new allout-post-undo-hook.
624
6252011-07-05 Stefan Monnier <monnier@iro.umontreal.ca>
626
627 * emacs-lisp/lisp-mode.el (lisp-interaction-mode-abbrev-table):
628 Let define-derived-mode define it.
629 * emacs-lisp/derived.el (define-derived-mode): Try to avoid creating
630 cycles of abbrev-table inheritance (bug#8998).
631
6322011-07-05 Roland Winkler <winkler@gnu.org>
633
634 * textmodes/bibtex.el: Add support for biblatex.
635 (bibtex-BibTeX-entry-alist, bibtex-biblatex-entry-alist)
636 (bibtex-BibTeX-field-alist, bibtex-biblatex-field-alist)
637 (bibtex-dialect-list, bibtex-dialect, bibtex-no-opt-remove-re)
638 (bibtex-entry-alist, bibtex-field-alist): New variables.
639 (bibtex-entry-field-alist): Obsolete alias for
640 bibtex-BibTeX-entry-alist.
641 (bibtex-entry-alist, bibtex-field-alist): New widgets.
642 (bibtex-set-dialect): New command.
643 (bibtex-entry-type, bibtex-entry-head)
644 (bibtex-entry-maybe-empty-head, bibtex-any-valid-entry-type):
645 Bind via bibtex-set-dialect.
646 (bibtex-Article, bibtex-Book, bibtex-Booklet, bibtex-InBook)
647 (bibtex-InCollection, bibtex-InProceedings, bibtex-Manual)
648 (bibtex-MastersThesis, bibtex-Misc, bibtex-PhdThesis)
649 (bibtex-Proceedings, bibtex-TechReport, bibtex-Unpublished):
650 Define via bibtex-set-dialect.
651 (bibtex-name-in-field, bibtex-remove-OPT-or-ALT):
652 Obey bibtex-no-opt-remove-re.
653 (bibtex-vec-push, bibtex-vec-incr): New functions.
654 (bibtex-format-entry, bibtex-field-list)
655 (bibtex-print-help-message, bibtex-validate)
656 (bibtex-search-entries): Use new format of bibtex-entry-alist.
657
6582011-07-05 Stefan Monnier <monnier@iro.umontreal.ca>
659
660 * progmodes/compile.el (compilation-goto-locus):
661 * net/tramp-cmds.el (tramp-append-tramp-buffers):
662 * bs.el (bs-cycle-next, bs-cycle-previous):
663 * bookmark.el (bookmark-bmenu-list, bookmark-bmenu-2-window):
664 * bindings.el (mode-line-other-buffer):
665 * autoinsert.el (auto-insert):
666 * arc-mode.el (archive-extract):
667 * abbrev.el (edit-abbrevs): Fix some uses of switch-to-buffer.
668
6692011-07-05 Juanma Barranquero <lekktu@gmail.com>
670
671 * emacs-lock.el (emacs-lock-mode): Fix typo in variable name.
672 Fix check of `emacs-lock-unlockable-modes'.
673 Coerce true values of `emacs-lock--try-unlocking' to t.
674
6752011-07-05 Juanma Barranquero <lekktu@gmail.com>
676
677 * obsolete/old-emacs-lock.el: Rename from emacs-lock.el.
678 * emacs-lock.el: New file.
679
6802011-07-05 Julien Danjou <julien@danjou.info>
681
682 * textmodes/rst.el (rst-define-level-faces): Use `facep' rather
683 than `boundp' to check if face is set.
684
6852011-07-05 Juanma Barranquero <lekktu@gmail.com>
686
687 * register.el (registerv-make):
688 * window.el (window-min-height): Fix typos in docstrings.
689
6902011-07-05 Jan Djärv <jan.h.d@swipnet.se>
691
692 * dynamic-setting.el (dynamic-setting-handle-config-changed-event):
693 Update doc string.
694
6952011-07-04 Juanma Barranquero <lekktu@gmail.com>
696
697 * server.el (server-execute): Catch quit and call
698 `server-return-error' to pass the error back to emacsclient and
699 close the connection (bug#8942).
700
7012011-07-04 Ken Manheimer <ken.manheimer@gmail.com>
702
703 * allout.el (allout-encrypt-unencrypted-on-saves): Do not provide
704 insecure exception for current topic. Also note that auto-saves
705 are handled differently.
706
707 (allout-auto-save-temporarily-disabled), (allout-just-did-undo):
708 State variables for tracking auto-save inhibition situation.
709
710 (allout-write-contents-hook-handler): Rename from
711 'allout-write-file-hook-handler', and describe how it depends on
712 write-contents-functions sensitivity to non-nil value to prevent
713 file write.
714
715 (allout-auto-save-hook-handler): Remove. auto-save does not check
716 this in individual buffers, only in the starting buffer, so this
717 is not the right way for us to inhibit auto-save in a buffer
718 according to its condition.
719
720 (allout-mode): Use new allout-write-contents-hook-handler, and
721 only with write-contents-functions. Remove auto-save provisions -
722 they're implemented elsewhere.
723
724 (allout-before-change-handler): If undo is in progress, note that
725 for attention of allout-post-command-business.
726
727 (allout-post-command-business): If the command we're following was
728 an undo, check for change in the status of encrypted items and
729 adjust auto-save inhibitions accordingly.
730
731 (allout-toggle-subtree-encryption): Adjust auto-save inhibition
732 according to whether there are or aren't any plain-text topics
733 pending encryption.
734
735 (allout-inhibit-auto-save-info-for-decryption):
736 Adjust buffer-saved-size and some allout state to inhibit auto-saves if
737 there are plain-text topics pending encryption.
738
739 (allout-maybe-resume-auto-save-info-after-encryption): Adjust
740 buffer-saved-size and some allout state to not inhibit auto-saves
741 if there are no longer any plain-text topics pending encryption.
742
743 (allout-next-topic-pending-encryption, allout-encrypt-decrypted):
744 No longer provide for exemption of the current topic.
745
7462011-07-04 Juri Linkov <juri@jurta.org>
747
748 Add 7z operations to delete and save changed members (bug#8968).
749 * arc-mode.el (archive-7z-expunge, archive-7z-update):
750 New defcustoms.
751 (archive-7z-write-file-member): New function.
752 (archive-7z-summarize): Fix the number of dashes in the
753 listing output.
754
7552011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
756
757 * pcmpl-linux.el (pcomplete-pare-list): Re-add, from pcomplete.el
758 (bug#8958).
759
7602011-07-04 Chong Yidong <cyd@stupidchicken.com>
761
762 * bindings.el: Ignore next-buffer and previous-buffer in
763 minibuffer-local-map.
764
765 * font-lock.el (font-lock-builtin-face): Change light background
766 color to dark slate blue (Bug#6693).
767
7682011-07-04 Wang Diancheng <dcwang@kingbase.com.cn> (tiny change)
769
770 * progmodes/gdb-mi.el (gdb): Use completion-at-point.
771
7722011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
773
774 * files.el (find-file): Use pop-to-buffer-same-window (bug#8911).
775 * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):
776 Add switch-to-buffer.
777
7782011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
779
780 * isearch.el (isearch-search-fun-function): Clarify further the
781 meaning of the function returned.
782
7832011-07-04 Michael Albinus <michael.albinus@gmx.de>
784
785 * net/tramp-cmds.el (tramp-cleanup-this-connection): New command.
786
787 * net/tramp-sh.el (tramp-color-escape-sequence-regexp): New defconst.
788 (tramp-sh-handle-insert-directory, tramp-convert-file-attributes):
789 Use it.
790 (tramp-remote-path): Add "/bin" and "/usr/bin". On busyboxes,
791 `tramp-default-remote-path' does not exist.
792 (tramp-send-command-and-read): New optional argument NOERROR.
793 (tramp-open-connection-setup-interactive-shell)
794 (tramp-get-remote-path, tramp-get-remote-stat): Use it.
795 (tramp-get-remote-readlink): Do not mask with `ignore-errors'.
796 (tramp-process-sentinel): Flush also process' connection property.
797 (tramp-sh-handle-start-file-process): Do not set process
798 sentinel. It is done now ...
799 (tramp-maybe-open-connection): ... here. (Bug#8929)
800
8012011-07-04 MON KEY <monkey@sandpframing.com>
802
803 * play/animate.el (animate-string): Doc fixes and allow changing
804 the buffer name (bug#5417).
805
8062011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
807
808 * play/animate.el (animation-buffer-name): Rename from *animate*.
809
8102011-07-04 Paul Eggert <eggert@cs.ucla.edu>
811
812 * emacs-lisp/timer.el: Use time-date fns rather than rolling our own.
813 This is simpler and helps future-proof the code.
814 (timer-until): Use time-subtract and float-time.
815 (timer--time-less-p): Use time-less-p.
816
8172011-07-04 Juanma Barranquero <lekktu@gmail.com>
818
819 * type-break.el (timep): Use the value of `float-time' to avoid a
820 byte-compiler warning.
821
822 * server.el (server-eval-and-print): Return any result, even nil.
823
8242011-07-03 Paul Eggert <eggert@cs.ucla.edu>
825
826 * type-break.el: Accept time formats that the builtins accept.
827 (timep, type-break-time-difference): Accept any format that
828 float-time accepts, rather than insisting on (HIGH LOW USECS) format.
829 This is simpler and helps future-proof the code.
830 (type-break-time-difference): Round rather than ignoring
831 subseconds components.
832
8332011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
834
835 * info.el (Info-apropos-matches): Make non-interactive, since it
836 doesn't seem to do anything useful as a command (bug#8829).
837
8382011-07-03 Chong Yidong <cyd@stupidchicken.com>
839
840 * frame.el (frame-background-mode, frame-set-background-mode):
841 Move from faces.el.
842 (frame-default-terminal-background): New function.
843
844 * custom.el (custom-push-theme): Don't record faces in `changed'
845 theme; this doesn't work correctly for per-frame face settings.
846 (disable-theme): Use face-set-after-frame-default to reset faces.
847 (custom--frame-color-default): New function.
848
8492011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
850
851 * dired.el (dired-flagging-regexp): Remove unused variable
852 (bug#8769).
853
8542011-03-29 Kevin Ryde <user42@zip.com.au>
855
856 * progmodes/compile.el (compilation-error-regexp-alist-alist):
857 `perl-Test2' extend to match possible "fail #N" rep count
858 (bug#8377).
859
8602011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
861
862 * mail/feedmail.el (feedmail-buffer-to-smtpmail):
863 `smtpmail-via-smtp' now returns the error instead of nil.
864
865 * isearch.el (isearch-search-fun-function): Clarify the doc string
866 (bug#8101).
867
8682011-07-03 Richard Kim <emacs18@gmail.com> (tiny change)
869
870 * textmodes/texnfo-upd.el (texinfo-insert-menu): Don't insert
871 unnecessary spaces (bug#8987).
872
8732011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
874
875 * net/network-stream.el (open-network-stream): Use the
876 :end-of-capability command thoughout.
877
8782011-07-03 Wolfgang Jenkner <wjenkner@inode.at> (tiny change)
879
880 * net/network-stream.el (open-network-stream): Add the
881 :end-of-capability command parameter, used by pop3.el.
882
8832011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
884
885 * dired.el (dired-map-over-marks): Refill the doc string (bug#6814).
886
887 * fringe.el (fringe-query-style): Remove redundant text " (type ?
888 for list)" (bug#6475).
889
890 * files.el (file-expand-wildcards): Ignore non-readable
891 sub-directories while trying to find matches instead of signalling
892 an error (bug#6297).
893
894 * man.el (Man-reference-regexp): Allow matching possible
895 word-wrapped references (bug#6289).
896
897 * vc/vc.el (vc-modify-change-comment): Change *VC-log* to *vc-log*
898 for consistency with the other vc buffers (bug#6197).
899 (vc-checkin): Ditto.
900
901 * vc/vc-arch.el: Fix comments to match the *VC-log* name change.
902
903 * longlines.el (longlines-mode): Document what ARG does (bug#6150).
904
9052011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
906
907 * custom.el (defcustom): Clarify that :set is only used in the
908 Customize user interface (bug#6089).
909
910 * progmodes/flymake.el (flymake-mode): If the buffer isn't
911 associated with a file, refuse to run instead of erroring out
912 (bug#6084).
913
914 * textmodes/fill.el (fill-region): Remove the "Ordinarily" from
915 the doc string, since it appears that using `fill-column' always
916 controls the width (bug#7845).
917
918 * simple.el (shell-command-on-region): Say where the error output
919 went if `shell-command-default-error-buffer' is set (bug#6857).
920
9212011-07-02 Ken Manheimer <ken.manheimer@gmail.com>
922
923 * allout.el (allout-yank-processing): Adjust cursor position for
924 backwards-deleted space.
925
926 (allout-rebullet-heading): Register changes with
927 allout-exposure-changed-hook, so the modified topic is properly
928 decorated.
929
9302011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
931
932 * minibuffer.el (completion-in-region): Document PREDICATE
933 (bug#7136).
934
935 * info-look.el (info-lookup-add-help): Clarify that ARGS is a list
936 of keyword/argument pairs (bug#6904).
937
938 * replace.el (multi-occur):
939 Mention `multi-occur-in-matching-buffers' in the doc string (bug#7566).
940
9412011-07-02 Drew Adams <drew.adams@oracle.com>
942
943 * dired.el (dired-mark-if): Make the message about whether it's
944 marking or unmarking clearer (bug#8523).
945
9462011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
947
948 * disp-table.el (display-table-print-array): New function.
949 (describe-display-table): Use it to print the vectors more pretty
950 (Bug#8859).
951
9522011-07-02 Martin Rudalics <rudalics@gmx.at>
953
954 * window.el (window-state-get-1): Don't assign clone numbers.
955 Add clone-of item to list of window parameters.
956 (window-state-put-2): Don't process clone numbers.
957 (display-buffer-alist): Fix doc-string.
958
9592011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
960
961 * subr.el (remq): Don't allocate if it's not needed.
962 (keymap--menu-item-binding, keymap--menu-item-with-binding)
963 (keymap--merge-bindings): New functions.
964 (keymap-canonicalize): Use them to refine the canonicalization.
965 * minibuffer.el (minibuffer-local-completion-map)
966 (minibuffer-local-must-match-map): Move initialization from C.
967 (minibuffer-local-filename-completion-map): Move initialization from C;
968 don't inherit from anything here.
969 (minibuffer-local-filename-must-match-map): Make obsolete.
970 (completing-read-default): Use make-composed-keymap to combine
971 minibuffer-local-filename-completion-map with either
972 minibuffer-local-must-match-map or
973 minibuffer-local-filename-completion-map.
974
9752011-07-01 Glenn Morris <rgm@gnu.org>
976
977 * type-break.el (type-break-time-sum): Use dolist.
978
979 * textmodes/flyspell.el (flyspell-word-search-backward):
980 Replace CL function.
981
9822011-07-01 Stefan Monnier <monnier@iro.umontreal.ca>
983
984 * mouse.el (mouse--strip-first-event): New function.
985 (function-key-map): Use it to map fringe clicks to normal clicks
986 by default.
987
988 * vc/vc-bzr.el (vc-bzr-revision-keywords): Update.
989 (vc-bzr-revision-completion-table): Add support for annotate and date.
990
991 * emacs-lisp/derived.el (define-derived-mode): Make abbrev-table
992 inherit from parent.
993
9942011-07-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
995
996 * dired-aux.el (dired-diff): Doc fixup (bug#8816).
997 (dired-show-file-type): Doc fixup (bug#8818).
998
999 * dired.el (dired-mode): Fix up the doc string as suggested by
1000 Drew Adams (bug#8817).
1001
1002 * progmodes/flymake.el (flymake-find-file-hook): Add an `autoload'
1003 cookie, since the manual says that it should be possible to add
1004 this function to `find-file-hook' (bug#8709).
1005
10062011-07-01 Teodor Zlatanov <tzz@lifelogs.com>
1007
1008 * progmodes/cfengine.el: Moved all cfengine3.el functionality
1009 here. Noted Ted Zlatanov as the maintainer.
1010 (cfengine-common-settings, cfengine-common-syntax): New functions
1011 to set up common things between `cfengine-mode' and
1012 `cfengine3-mode'.
1013 (cfengine3-mode): New mode.
1014 (cfengine3-defuns cfengine3-defuns-regex
1015 (cfengine3-class-selector-regex cfengine3-category-regex)
1016 (cfengine3-vartypes cfengine3-font-lock-keywords)
1017 (cfengine3-beginning-of-defun, cfengine3-end-of-defun)
1018 (cfengine3-indent-line): Add from cfengine3.el.
1019
10202011-07-01 Michael Albinus <michael.albinus@gmx.de>
1021
1022 * net/tramp.el (tramp-encoding-command-interactive): New defcustom.
1023
1024 * net/tramp-sh.el (tramp-maybe-open-connection): Use it.
1025
10262011-07-01 Martin Rudalics <rudalics@gmx.at>
1027
1028 * window.el (same-window-buffer-names, same-window-regexps)
1029 (same-window-p, special-display-frame-alist)
1030 (special-display-popup-frame, special-display-function)
1031 (special-display-buffer-names, special-display-regexps)
1032 (special-display-p, pop-up-frame-alist, pop-up-frame-function)
1033 (pop-up-frames, display-buffer-reuse-frames, pop-up-windows)
1034 (split-window-preferred-function, split-height-threshold)
1035 (split-width-threshold, even-window-heights)
1036 (display-buffer-mark-dedicated, window-splittable-p)
1037 (split-window-sensibly, window-safely-shrinkable-p):
1038 Un-obsolete.
1039 (display-buffer): Don't spread args with function specifier
1040 because special-display-popup-frame won't like it.
1041
10422011-07-01 Paul Eggert <eggert@cs.ucla.edu>
1043
1044 Time-stamp simplifications and fixes.
1045 These improve accuracy slightly, and future-proof the code
1046 against some potential changes to current-time format.
1047
1048 * woman.el (woman-decode-buffer, WoMan-log-end): Log fractional secs
1049 by using time-since and float-time.
1050
1051 * vc/ediff-util.el (ediff-calc-command-time): Use time-since
1052 and float-time. Say "NNN.NNN seconds" rather than "NNN seconds
1053 + NNN microseconds".
1054
1055 * type-break.el (type-break-time-sum): Rewrite using time-add.
1056
1057 * play/hanoi.el (hanoi-current-time-float): Remove.
1058 All uses replaced by float-time.
1059
1060 * nxml/rng-maint.el (rng-time-function): Rewrite using time-subtract.
1061 This yields a more-accurate answer.
1062 (rng-time-to-float): Remove; no longer needed.
1063
1064 * emacs-lisp/timer.el (timer-relative-time): Use time-add.
1065
1066 * calendar/timeclock.el (timeclock-seconds-to-time):
1067 Defalias to seconds-to-time, since they're the same thing.
1068
1069 * emacs-lisp/elp.el (elp-elapsed-time):
1070 * emacs-lisp/benchmark.el (benchmark-elapse):
1071 * allout-widgets.el (allout-elapsed-time-seconds): Use float-time.
1072
10732011-07-01 Stefan Monnier <monnier@iro.umontreal.ca>
1074
1075 * window.el (bury-buffer): Don't iconify the only frame.
1076 (switch-to-buffer): Revert to Emacs<23 behavior, i.e. do not fallback
1077 to pop-to-buffer. Use pop-to-buffer-same-frame if you don't like that.
1078
10792011-07-01 Chong Yidong <cyd@stupidchicken.com>
1080
1081 * eshell/em-smart.el (eshell-smart-display-navigate-list):
1082 Add mouse-yank-primary.
1083
10842011-07-01 Teodor Zlatanov <tzz@lifelogs.com>
1085
1086 * progmodes/cfengine3.el: New file to support CFEngine 3.x.
1087
10882011-07-01 Stefan Monnier <monnier@iro.umontreal.ca>
1089
1090 * emacs-lisp/find-func.el (find-library--load-name): New fun.
1091 (find-library-name): Use it to find relative load names when provided
1092 absolute file name (bug#8803).
1093
10942011-06-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
1095
1096 * textmodes/flyspell.el (flyspell-word): Consider words that
1097 differ only in case as potential doublons (bug#5687).
1098
1099 * net/soap-client.el (soap-invoke, soap-wsdl-resolve-references):
1100 Remove two rather uninteresting debugging-like messages to make
1101 debbugs.el more silent.
1102
1103 * comint.el (comint-password-prompt-regexp): Accept "Response" as
1104 a password-like phrase.
1105
11062011-06-30 Mastake YAMATO <yamato@redhat.com>
1107
1108 * progmodes/cc-guess.el: New file.
1109
1110 * progmodes/cc-langs.el (c-mode-menu): Add "Style..." submenu.
1111
1112 * progmodes/cc-styles.el (cc-choose-style-for-mode): New function
1113 derived from `c-basic-common-init'.
1114
1115 * progmodes/cc-mode.el (top-level): Require cc-guess.
1116 (c-basic-common-init): Use `cc-choose-style-for-mode'.
1117
11182011-06-30 Lawrence Mitchell <wence@gmx.li>
1119
1120 * progmodes/js.el (js-mode): Don't stomp on global settings (bug#8933).
1121
11222011-06-30 Alan Mackenzie <acm@muc.de>
1123
1124 * progmodes/cc-engine.el (c-guess-continued-construct):
1125 Correct the handling of template-args-cont, particularly for when font
1126 lock is disabled. Name this case as "CASE G".
1127
11282011-06-30 Ken Manheimer <ken.manheimer@gmail.com>
1129
1130 * allout.el (allout-yank-processing): Fix injection of extra space
1131 between bullet and non-whitespace character in first topic when
1132 pasting, ensuring that the actual spacing in the pasted topic
1133 following the bullet char is preserved. This extra space was
1134 causing pasted encrypted topics to get a decrypted status even
1135 when the content was actually still encrypted. Now the decryption
1136 status from before the paste is preserved.
1137
1138 (allout-flag-region): Set all allout overlays so they evaporate
1139 when reduced to zero length (evanescent), to prevent overlay
1140 leakage.
1141
11422011-06-30 Glenn Morris <rgm@gnu.org>
1143
1144 * w32-fns.el (w32-charset-info-alist): Declare.
1145
1146 * find-dired.el (find-grep-options): Simplify.
1147
1148 * term/ns-win.el (ns-set-resource): Declare.
1149
1150 * ses.el (row, col): Declare dynamic variables honestly.
1151
1152 * textmodes/reftex-parse.el (index-tags): Declare.
1153
11542011-06-30 Chong Yidong <cyd@stupidchicken.com>
1155
1156 * cus-edit.el (customize-push-and-save): New function.
1157
1158 * files.el (hack-local-variables-confirm): Use it.
1159
1160 * custom.el (load-theme): New arg NO-CONFIRM.
1161 Use customize-push-and-save (Bug#8720).
1162 (custom-enabled-themes): Doc fix.
1163
1164 * cus-theme.el (customize-create-theme)
1165 (custom-theme-merge-theme): Callers to load-theme changed.
1166
11672011-06-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
1168
1169 * thingatpt.el (thing-at-point-short-url-regexp): Require that
1170 short URLs have at least one dot in them (bug #7614).
1171
1172 * progmodes/grep.el (rgrep): Bind `process-connection-type' to
1173 nil, because using a pty is apparently too slow (bug #895).
1174
11752011-06-29 Lars Magne Ingebrigtsen <larsi@gnus.org>
1176
1177 * mail/sendmail.el (sendmail-query-once): New function.
1178 (sendmail-query-once-function): New variable.
1179
11802011-06-29 Glenn Morris <rgm@gnu.org>
1181
1182 * files.el (auto-mode-alist): Add .f03, .f08 for f90-mode.
1183
1184 * ses.el (top-level): Require cl when compiling.
1185 (ses-set-localvars): Fix error statement.
1186 Call it at compile time to silence a storm of warnings.
1187
11882011-06-29 Martin Rudalics <rudalics@gmx.at>
1189
1190 * window.el (normalize-live-buffer): Rename to
1191 window-normalize-buffer.
1192 (normalize-live-frame): Rename to window-normalize-frame.
1193 (normalize-any-window): Rename to window-normalize-any-window.
1194 (normalize-live-window): Rename to window-normalize-live-window.
1195 (make-window-atom): Rename to window-make-atom.
1196 (window-resize-reset): Rename to window--resize-reset.
1197 (window-resize-reset-1): Rename to window--resize-reset-1.
1198 (resize-mini-window): Rename to window--resize-mini-window.
1199 (resize-subwindows-skip-p): Rename to
1200 window--resize-subwindows-skip-p.
1201 (resize-subwindows-normal): Rename to
1202 window--resize-subwindows-normal.
1203 (resize-subwindows): Rename to window--resize-subwindows.
1204 (resize-other-windows): Rename to window--resize-siblings.
1205 (resize-this-window): Rename to window--resize-this-window.
1206 (resize-root-window): Rename to window--resize-root-window.
1207 (resize-root-window-vertically): Rename to
1208 window--resize-root-window-vertically.
1209 (normalize-buffer-to-display): Rename to
1210 window-normalize-buffer-to-display.
1211 (normalize-buffer-to-switch-to): Rename to
1212 window-normalize-buffer-to-switch-to.
1213 Correspondingly update all callers of the functions listed
1214 above.
1215 (display-buffer-alist, display-buffer-normalize-arguments)
1216 (display-buffer-normalize-options, display-buffer)
1217 (display-buffer-alist-set): Use "function" instead of
1218 "fun-with-args".
1219
12011-06-28 Chong Yidong <cyd@stupidchicken.com> 12202011-06-28 Chong Yidong <cyd@stupidchicken.com>
2 1221
3 * mail/emacsbug.el (report-emacs-bug): Handle non-gnu bug 1222 * mail/emacsbug.el (report-emacs-bug): Handle non-gnu bug
@@ -23,8 +1242,8 @@
23 1242
242011-06-28 Deniz Dogan <deniz@dogan.se> 12432011-06-28 Deniz Dogan <deniz@dogan.se>
25 1244
26 * emacs-lisp/lisp-mode.el (emacs-lisp-mode-syntax-table): Unnest 1245 * emacs-lisp/lisp-mode.el (emacs-lisp-mode-syntax-table):
27 `let'. 1246 Unnest `let'.
28 1247
29 * textmodes/css-mode.el (css-font-lock-keywords): Fix grouped 1248 * textmodes/css-mode.el (css-font-lock-keywords): Fix grouped
30 selectors (Bug#5732). 1249 selectors (Bug#5732).
@@ -112,7 +1331,7 @@
112 (ses-cell-symbol): Set macro as safe, so that it can be used in 1331 (ses-cell-symbol): Set macro as safe, so that it can be used in
113 formulas. 1332 formulas.
114 1333
115 * ses.el: Update cycle detection algorithm. 1334 * ses.el: Update cycle detection algorithm.
116 (ses-localvars): Add ses--Dijkstra-attempt-nb and 1335 (ses-localvars): Add ses--Dijkstra-attempt-nb and
117 ses--Dijkstra-weight-bound, and initial values thereof when applicable. 1336 ses--Dijkstra-weight-bound, and initial values thereof when applicable.
118 (ses-set-localvars): New function. 1337 (ses-set-localvars): New function.
diff --git a/lisp/ChangeLog.14 b/lisp/ChangeLog.14
index c1313cfd16f..eeed5d7797c 100644
--- a/lisp/ChangeLog.14
+++ b/lisp/ChangeLog.14
@@ -4421,7 +4421,7 @@
44212008-12-06 Chong Yidong <cyd@stupidchicken.com> 44212008-12-06 Chong Yidong <cyd@stupidchicken.com>
4422 4422
4423 * term/xterm.el (terminal-init-xterm): Discard pending input 4423 * term/xterm.el (terminal-init-xterm): Discard pending input
4424 before reading a reply to the terminal attributes query. 4424 before reading a reply to the terminal attributes query. (Bug#1495)
4425 4425
44262008-12-05 Andreas Schwab <schwab@suse.de> 44262008-12-05 Andreas Schwab <schwab@suse.de>
4427 4427
diff --git a/lisp/ChangeLog.15 b/lisp/ChangeLog.15
index 3cb6c00b6ee..190be56dd09 100644
--- a/lisp/ChangeLog.15
+++ b/lisp/ChangeLog.15
@@ -8424,7 +8424,7 @@
8424 8424
8425 * dabbrev.el (dabbrev-completion): Fix typo in docstring. 8425 * dabbrev.el (dabbrev-completion): Fix typo in docstring.
8426 8426
84272010-08-08 MON KEY <monkey@sandpframing.com> (tiny change) 84272010-08-08 MON KEY <monkey@sandpframing.com>
8428 8428
8429 * emacs-lisp/syntax.el (syntax-ppss-toplevel-pos): 8429 * emacs-lisp/syntax.el (syntax-ppss-toplevel-pos):
8430 Fix typo in docstring (bug#6747). 8430 Fix typo in docstring (bug#6747).
diff --git a/lisp/ChangeLog.6 b/lisp/ChangeLog.6
index 2f73c290231..7ba9261ccf0 100644
--- a/lisp/ChangeLog.6
+++ b/lisp/ChangeLog.6
@@ -6892,7 +6892,7 @@
6892 (find-file-noselect): Use it if new optional argument `rawfile' is 6892 (find-file-noselect): Use it if new optional argument `rawfile' is
6893 non-nil. 6893 non-nil.
6894 6894
6895 * startup.el (command-line-1): Add option --eval to evalute an 6895 * startup.el (command-line-1): Add option --eval to evaluate an
6896 expression on the command line and print the result. 6896 expression on the command line and print the result.
6897 6897
68981995-08-14 Richard Stallman <rms@mole.gnu.ai.mit.edu> 68981995-08-14 Richard Stallman <rms@mole.gnu.ai.mit.edu>
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 9445cf9675c..3795dd46010 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -159,7 +159,7 @@ where NAME and EXPANSION are strings with quotes,
159USECOUNT is an integer, and HOOK is any valid function 159USECOUNT is an integer, and HOOK is any valid function
160or may be omitted (it is usually omitted)." 160or may be omitted (it is usually omitted)."
161 (interactive) 161 (interactive)
162 (switch-to-buffer (prepare-abbrev-list-buffer))) 162 (pop-to-buffer-same-window (prepare-abbrev-list-buffer)))
163 163
164(defun edit-abbrevs-redefine () 164(defun edit-abbrevs-redefine ()
165 "Redefine abbrevs according to current buffer contents." 165 "Redefine abbrevs according to current buffer contents."
@@ -814,19 +814,28 @@ Returns the abbrev symbol, if expansion took place."
814 (destructuring-bind (&optional sym name wordstart wordend) 814 (destructuring-bind (&optional sym name wordstart wordend)
815 (abbrev--before-point) 815 (abbrev--before-point)
816 (when sym 816 (when sym
817 (unless (or ;; executing-kbd-macro 817 (let ((startpos (copy-marker (point) t))
818 noninteractive 818 (endmark (copy-marker wordend t)))
819 (window-minibuffer-p (selected-window))) 819 (unless (or ;; executing-kbd-macro
820 ;; Add an undo boundary, in case we are doing this for 820 noninteractive
821 ;; a self-inserting command which has avoided making one so far. 821 (window-minibuffer-p (selected-window)))
822 (undo-boundary)) 822 ;; Add an undo boundary, in case we are doing this for
823 ;; Now sym is the abbrev symbol. 823 ;; a self-inserting command which has avoided making one so far.
824 (setq last-abbrev-text name) 824 (undo-boundary))
825 (setq last-abbrev sym) 825 ;; Now sym is the abbrev symbol.
826 (setq last-abbrev-location wordstart) 826 (setq last-abbrev-text name)
827 ;; If this abbrev has an expansion, delete the abbrev 827 (setq last-abbrev sym)
828 ;; and insert the expansion. 828 (setq last-abbrev-location wordstart)
829 (abbrev-insert sym name wordstart wordend))))) 829 ;; If this abbrev has an expansion, delete the abbrev
830 ;; and insert the expansion.
831 (prog1
832 (abbrev-insert sym name wordstart wordend)
833 ;; Yuck!! If expand-abbrev is called with point slightly
834 ;; further than the end of the abbrev, move point back to
835 ;; where it started.
836 (if (and (> startpos endmark)
837 (= (point) endmark)) ;Obey skeletons that move point.
838 (goto-char startpos))))))))
830 839
831(defun unexpand-abbrev () 840(defun unexpand-abbrev ()
832 "Undo the expansion of the last abbrev that expanded. 841 "Undo the expansion of the last abbrev that expanded.
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index 0f1fe850123..ef75e7157e6 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -561,6 +561,8 @@ outline hot-spot navigation \(see `allout-mode')."
561 'allout-widgets-shifts-recorder nil 'local) 561 'allout-widgets-shifts-recorder nil 'local)
562 (add-hook 'allout-after-copy-or-kill-hook 562 (add-hook 'allout-after-copy-or-kill-hook
563 'allout-widgets-after-copy-or-kill-function nil 'local) 563 'allout-widgets-after-copy-or-kill-function nil 'local)
564 (add-hook 'allout-post-undo-hook
565 'allout-widgets-after-undo-function nil 'local)
564 566
565 (add-hook 'before-change-functions 'allout-widgets-before-change-handler 567 (add-hook 'before-change-functions 'allout-widgets-before-change-handler
566 nil 'local) 568 nil 'local)
@@ -1130,6 +1132,14 @@ Dispatched by `allout-widgets-post-command-business' in response to
1130Intended for use on allout-after-copy-or-kill-hook." 1132Intended for use on allout-after-copy-or-kill-hook."
1131 (if (car kill-ring) 1133 (if (car kill-ring)
1132 (setcar kill-ring (allout-widgets-undecorate-text (car kill-ring))))) 1134 (setcar kill-ring (allout-widgets-undecorate-text (car kill-ring)))))
1135;;;_ > allout-widgets-after-undo-function ()
1136(defun allout-widgets-after-undo-function ()
1137 "Do allout-widgets processing of text after an undo.
1138
1139Intended for use on allout-post-undo-hook."
1140 (save-excursion
1141 (if (allout-goto-prefix)
1142 (allout-redecorate-item (allout-get-or-create-item-widget)))))
1133 1143
1134;;;_ > allout-widgets-exposure-undo-recorder (widget from-state) 1144;;;_ > allout-widgets-exposure-undo-recorder (widget from-state)
1135(defun allout-widgets-exposure-undo-recorder (widget) 1145(defun allout-widgets-exposure-undo-recorder (widget)
@@ -2324,9 +2334,7 @@ We use a caching strategy, so the caller doesn't need to do so."
2324(defun allout-elapsed-time-seconds (end start) 2334(defun allout-elapsed-time-seconds (end start)
2325 "Return seconds between `current-time' style time START/END triples." 2335 "Return seconds between `current-time' style time START/END triples."
2326 (let ((elapsed (time-subtract end start))) 2336 (let ((elapsed (time-subtract end start)))
2327 (+ (* (car elapsed) (expt 2.0 16)) 2337 (float-time elapsed)))
2328 (cadr elapsed)
2329 (/ (caddr elapsed) (expt 10.0 6)))))
2330;;;_ > allout-frame-property (frame property) 2338;;;_ > allout-frame-property (frame property)
2331(defalias 'allout-frame-property 2339(defalias 'allout-frame-property
2332 (cond ((fboundp 'frame-parameter) 2340 (cond ((fboundp 'frame-parameter)
diff --git a/lisp/allout.el b/lisp/allout.el
index 1d4d4a20e11..592a64c647a 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -823,37 +823,32 @@ formatted copy."
823 :group 'allout-encryption) 823 :group 'allout-encryption)
824;;;_ = allout-encrypt-unencrypted-on-saves 824;;;_ = allout-encrypt-unencrypted-on-saves
825(defcustom allout-encrypt-unencrypted-on-saves t 825(defcustom allout-encrypt-unencrypted-on-saves t
826 "When saving, should topics pending encryption be encrypted? 826 "If non-nil, topics pending encryption are encrypted during buffer saves.
827 827
828The idea is to prevent file-system exposure of any un-encrypted stuff, and 828This provents file-system exposure of un-encrypted contents of
829mostly covers both deliberate file writes and auto-saves. 829items marked for encryption.
830 830
831 - Yes: encrypt all topics pending encryption, even if it's the one 831When non-nil, if the topic currently being edited is decrypted,
832 currently being edited. (In that case, the currently edited topic 832it will be encrypted for saving but automatically decrypted
833 will be automatically decrypted before any user interaction, so they 833before any subsequent user interaction, so it is once again clear
834 can continue editing but the copy on the file system will be 834text for editing though the file system copy is encrypted.
835 encrypted.) 835
836 Auto-saves will use the \"All except current topic\" mode if this 836\(Auto-saves are handled differently. Buffers with plain-text
837 one is selected, to avoid practical difficulties -- see below. 837exposed encrypted topics are exempted from auto saves until all
838 - All except current topic: skip the topic currently being edited, even if 838such topics are encrypted.)"
839 it's pending encryption. This may expose the current topic on the 839
840 file sytem, but avoids the nuisance of prompts for the encryption 840 :type 'boolean
841 passphrase in the middle of editing for, eg, autosaves. 841 :version "23.1"
842 This mode is used for auto-saves for both this option and \"Yes\".
843 - No: leave it to the user to encrypt any unencrypted topics.
844
845For practical reasons, auto-saves always use the 'except-current policy
846when auto-encryption is enabled. (Otherwise, spurious passphrase prompts
847and unavoidable timing collisions are too disruptive.) If security for a
848file requires that even the current topic is never auto-saved in the clear,
849disable auto-saves for that file."
850
851 :type '(choice (const :tag "Yes" t)
852 (const :tag "All except current topic" except-current)
853 (const :tag "No" nil))
854 :version "22.1"
855 :group 'allout-encryption) 842 :group 'allout-encryption)
856(make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves) 843(make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves)
844(defvar allout-auto-save-temporarily-disabled nil
845 "True while topic encryption is pending and auto-saving was active.
846
847The value of buffer-saved-size at the time of decryption is used,
848for restoring when all encryptions are established.")
849(defvar allout-just-did-undo nil
850 "True just after undo commands, until allout-post-command-business.")
851(make-variable-buffer-local 'allout-just-did-undo)
857 852
858;;;_ + Developer 853;;;_ + Developer
859;;;_ = allout-developer group 854;;;_ = allout-developer group
@@ -1466,7 +1461,15 @@ This hook might be invoked multiple times by a single command.")
1466(defvar allout-after-copy-or-kill-hook nil 1461(defvar allout-after-copy-or-kill-hook nil
1467 "*Hook that's run after copying outline text. 1462 "*Hook that's run after copying outline text.
1468 1463
1469Functions on the hook should not take any arguments.") 1464Functions on the hook should not require any arguments.")
1465;;;_ = allout-post-undo-hook
1466(defvar allout-post-undo-hook nil
1467 "*Hook that's run after undo activity.
1468
1469The item that's current when the hook is run *may* be the one
1470that was affected by the undo.
1471
1472Functions on the hook should not require any arguments.")
1470;;;_ = allout-outside-normal-auto-fill-function 1473;;;_ = allout-outside-normal-auto-fill-function
1471(defvar allout-outside-normal-auto-fill-function nil 1474(defvar allout-outside-normal-auto-fill-function nil
1472 "Value of normal-auto-fill-function outside of allout mode. 1475 "Value of normal-auto-fill-function outside of allout mode.
@@ -1564,39 +1567,43 @@ See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.")
1564(defmacro allout-mode-p () 1567(defmacro allout-mode-p ()
1565 "Return t if `allout-mode' is active in current buffer." 1568 "Return t if `allout-mode' is active in current buffer."
1566 'allout-mode) 1569 'allout-mode)
1567;;;_ > allout-write-file-hook-handler () 1570;;;_ > allout-write-contents-hook-handler ()
1568(defun allout-write-file-hook-handler () 1571(defun allout-write-contents-hook-handler ()
1569 "Implement `allout-encrypt-unencrypted-on-saves' policy for file writes." 1572 "Implement `allout-encrypt-unencrypted-on-saves' for file writes
1573
1574Return nil if all goes smoothly, or else return an informative
1575message if an error is encountered. The message will serve as a
1576non-nil return on `write-contents-functions' to prevent saving of
1577the buffer while it has decrypted content.
1578
1579This behavior depends on emacs versions that implement the
1580`write-contents-functions' hook."
1570 1581
1571 (if (or (not (allout-mode-p)) 1582 (if (or (not (allout-mode-p))
1572 (not (boundp 'allout-encrypt-unencrypted-on-saves)) 1583 (not (boundp 'allout-encrypt-unencrypted-on-saves))
1573 (not allout-encrypt-unencrypted-on-saves)) 1584 (not allout-encrypt-unencrypted-on-saves))
1574 nil 1585 nil
1575 (let ((except-mark (and (equal allout-encrypt-unencrypted-on-saves 1586 (if (save-excursion (goto-char (point-min))
1576 'except-current) 1587 (allout-next-topic-pending-encryption))
1577 (point-marker)))) 1588 (progn
1578 (if (save-excursion (goto-char (point-min)) 1589 (message "auto-encrypting pending topics")
1579 (allout-next-topic-pending-encryption except-mark)) 1590 (sit-for 0)
1580 (progn 1591 (condition-case failure
1581 (message "auto-encrypting pending topics") 1592 (progn
1582 (sit-for 0)
1583 (condition-case failure
1584 (setq allout-after-save-decrypt 1593 (setq allout-after-save-decrypt
1585 (allout-encrypt-decrypted except-mark)) 1594 (allout-encrypt-decrypted))
1586 (error (message 1595 ;; aok - return nil:
1587 "allout-write-file-hook-handler suppressing error %s" 1596 nil)
1588 failure) 1597 (error
1589 (sit-for 2))))) 1598 ;; whoops - probably some still-decrypted items, return non-nil:
1590 )) 1599 (let ((text (format (concat "%s contents write inhibited due to"
1591 nil) 1600 " encrypted topic encryption error:"
1592;;;_ > allout-auto-save-hook-handler () 1601 " %s")
1593(defun allout-auto-save-hook-handler () 1602 (buffer-name (current-buffer))
1594 "Implement `allout-encrypt-unencrypted-on-saves' policy for auto save." 1603 failure)))
1595 1604 (message text)(sit-for 2)
1596 (if (and (allout-mode-p) allout-encrypt-unencrypted-on-saves) 1605 text)))))
1597 ;; Always implement 'except-current policy when enabled. 1606 ))
1598 (let ((allout-encrypt-unencrypted-on-saves 'except-current))
1599 (allout-write-file-hook-handler))))
1600;;;_ > allout-after-saves-handler () 1607;;;_ > allout-after-saves-handler ()
1601(defun allout-after-saves-handler () 1608(defun allout-after-saves-handler ()
1602 "Decrypt topic encrypted for save, if it's currently being edited. 1609 "Decrypt topic encrypted for save, if it's currently being edited.
@@ -1875,6 +1882,7 @@ without changes to the allout core. Here are key ones:
1875`allout-structure-deleted-hook' 1882`allout-structure-deleted-hook'
1876`allout-structure-shifted-hook' 1883`allout-structure-shifted-hook'
1877`allout-after-copy-or-kill-hook' 1884`allout-after-copy-or-kill-hook'
1885`allout-post-undo-hook'
1878 1886
1879 Terminology 1887 Terminology
1880 1888
@@ -1960,12 +1968,7 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be."
1960 :lighter " Allout" 1968 :lighter " Allout"
1961 :keymap 'allout-mode-map 1969 :keymap 'allout-mode-map
1962 1970
1963 (let ((write-file-hook-var-name (cond ((boundp 'write-file-functions) 1971 (let ((use-layout (if (listp allout-layout)
1964 'write-file-functions)
1965 ((boundp 'write-file-hooks)
1966 'write-file-hooks)
1967 (t 'local-write-file-hooks)))
1968 (use-layout (if (listp allout-layout)
1969 allout-layout 1972 allout-layout
1970 allout-default-layout))) 1973 allout-default-layout)))
1971 1974
@@ -1984,9 +1987,8 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be."
1984 (remove-hook 'post-command-hook 'allout-post-command-business t) 1987 (remove-hook 'post-command-hook 'allout-post-command-business t)
1985 (remove-hook 'before-change-functions 'allout-before-change-handler t) 1988 (remove-hook 'before-change-functions 'allout-before-change-handler t)
1986 (remove-hook 'isearch-mode-end-hook 'allout-isearch-end-handler t) 1989 (remove-hook 'isearch-mode-end-hook 'allout-isearch-end-handler t)
1987 (remove-hook write-file-hook-var-name 1990 (remove-hook 'write-contents-functions
1988 'allout-write-file-hook-handler t) 1991 'allout-write-contents-hook-handler t)
1989 (remove-hook 'auto-save-hook 'allout-auto-save-hook-handler t)
1990 1992
1991 (remove-overlays (point-min) (point-max) 1993 (remove-overlays (point-min) (point-max)
1992 'category 'allout-exposure-category)) 1994 'category 'allout-exposure-category))
@@ -2019,9 +2021,8 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be."
2019 (add-hook 'post-command-hook 'allout-post-command-business nil t) 2021 (add-hook 'post-command-hook 'allout-post-command-business nil t)
2020 (add-hook 'before-change-functions 'allout-before-change-handler nil t) 2022 (add-hook 'before-change-functions 'allout-before-change-handler nil t)
2021 (add-hook 'isearch-mode-end-hook 'allout-isearch-end-handler nil t) 2023 (add-hook 'isearch-mode-end-hook 'allout-isearch-end-handler nil t)
2022 (add-hook write-file-hook-var-name 'allout-write-file-hook-handler 2024 (add-hook 'write-contents-functions 'allout-write-contents-hook-handler
2023 nil t) 2025 nil t)
2024 (add-hook 'auto-save-hook 'allout-auto-save-hook-handler nil t)
2025 2026
2026 ;; Stash auto-fill settings and adjust so custom allout auto-fill 2027 ;; Stash auto-fill settings and adjust so custom allout auto-fill
2027 ;; func will be used if auto-fill is active or activated. (The 2028 ;; func will be used if auto-fill is active or activated. (The
@@ -2154,8 +2155,10 @@ internal functions use this feature cohesively bunch changes."
2154 2155
2155See `allout-overlay-interior-modification-handler' for details." 2156See `allout-overlay-interior-modification-handler' for details."
2156 2157
2157 (when (and (allout-mode-p) undo-in-progress (allout-hidden-p)) 2158 (when (and (allout-mode-p) undo-in-progress)
2158 (allout-show-children)) 2159 (setq allout-just-did-undo t)
2160 (if (allout-hidden-p)
2161 (allout-show-children)))
2159 2162
2160 ;; allout-overlay-interior-modification-handler on an overlay handles 2163 ;; allout-overlay-interior-modification-handler on an overlay handles
2161 ;; this in other emacs, via `allout-exposure-category's 'modification-hooks. 2164 ;; this in other emacs, via `allout-exposure-category's 'modification-hooks.
@@ -3308,12 +3311,30 @@ coordinating with allout activity.")
3308- Implement (and clear) `allout-post-goto-bullet', for hot-spot 3311- Implement (and clear) `allout-post-goto-bullet', for hot-spot
3309 outline commands. 3312 outline commands.
3310 3313
3314- If the command we're following was an undo, check for change in
3315 the status of encrypted items and adjust auto-save inhibitions
3316 accordingly.
3317
3311- Decrypt topic currently being edited if it was encrypted for a save." 3318- Decrypt topic currently being edited if it was encrypted for a save."
3312 3319
3313 ; Apply any external change func:
3314 (if (not (allout-mode-p)) ; In allout-mode. 3320 (if (not (allout-mode-p)) ; In allout-mode.
3315 nil 3321 nil
3316 3322
3323 (when allout-just-did-undo
3324 (setq allout-just-did-undo nil)
3325 (run-hooks 'allout-post-undo-hook)
3326 (cond ((and (= buffer-saved-size -1)
3327 allout-auto-save-temporarily-disabled)
3328 ;; user possibly undid a decryption, deinhibit auto-save:
3329 (allout-maybe-resume-auto-save-info-after-encryption))
3330 ((save-excursion
3331 (save-restriction
3332 (widen)
3333 (goto-char (point-min))
3334 (not (allout-next-topic-pending-encryption))))
3335 ;; plain-text encrypted items are present, inhibit auto-save:
3336 (allout-inhibit-auto-save-info-for-decryption (buffer-size)))))
3337
3317 (if (and (boundp 'allout-after-save-decrypt) 3338 (if (and (boundp 'allout-after-save-decrypt)
3318 allout-after-save-decrypt) 3339 allout-after-save-decrypt)
3319 (allout-after-saves-handler)) 3340 (allout-after-saves-handler))
@@ -4036,6 +4057,8 @@ this function."
4036 (not (allout-encrypted-topic-p))) 4057 (not (allout-encrypted-topic-p)))
4037 (allout-reindent-body current-depth new-depth)) 4058 (allout-reindent-body current-depth new-depth))
4038 4059
4060 (run-hook-with-args 'allout-exposure-change-hook mb me nil)
4061
4039 ;; Recursively rectify successive siblings of orig topic if 4062 ;; Recursively rectify successive siblings of orig topic if
4040 ;; caller elected for it: 4063 ;; caller elected for it:
4041 (if do-successors 4064 (if do-successors
@@ -4605,8 +4628,9 @@ however, are left exactly like normal, non-allout-specific yanks."
4605 ; and delete residual subj 4628 ; and delete residual subj
4606 ; prefix digits and space: 4629 ; prefix digits and space:
4607 (while (looking-at "[0-9]") (delete-char 1)) 4630 (while (looking-at "[0-9]") (delete-char 1))
4608 (if (looking-at " ") 4631 (delete-char -1)
4609 (delete-char 1)))) 4632 (if (not (eolp))
4633 (forward-char))))
4610 ;; Assert new topic's bullet - minimal effort if unchanged: 4634 ;; Assert new topic's bullet - minimal effort if unchanged:
4611 (allout-rebullet-heading (string-to-char prefix-bullet))) 4635 (allout-rebullet-heading (string-to-char prefix-bullet)))
4612 (exchange-point-and-mark)))) 4636 (exchange-point-and-mark))))
@@ -4736,6 +4760,7 @@ arguments as this function, after the exposure changes are made."
4736 (when flag 4760 (when flag
4737 (let ((o (make-overlay from to nil 'front-advance))) 4761 (let ((o (make-overlay from to nil 'front-advance)))
4738 (overlay-put o 'category 'allout-exposure-category) 4762 (overlay-put o 'category 'allout-exposure-category)
4763 (overlay-put o 'evaporate t)
4739 (when (featurep 'xemacs) 4764 (when (featurep 'xemacs)
4740 (let ((props (symbol-plist 'allout-exposure-category))) 4765 (let ((props (symbol-plist 'allout-exposure-category)))
4741 (while props 4766 (while props
@@ -5895,6 +5920,8 @@ See `allout-toggle-current-subtree-encryption' for more details."
5895 " shift it in to make it encryptable"))) 5920 " shift it in to make it encryptable")))
5896 5921
5897 (let* ((allout-buffer (current-buffer)) 5922 (let* ((allout-buffer (current-buffer))
5923 ;; for use with allout-auto-save-temporarily-disabled, if necessary:
5924 (was-buffer-saved-size buffer-saved-size)
5898 ;; Assess location: 5925 ;; Assess location:
5899 (bullet-pos allout-recent-prefix-beginning) 5926 (bullet-pos allout-recent-prefix-beginning)
5900 (after-bullet-pos (point)) 5927 (after-bullet-pos (point))
@@ -5974,6 +6001,12 @@ See `allout-toggle-current-subtree-encryption' for more details."
5974 ;; Add the is-encrypted bullet qualifier: 6001 ;; Add the is-encrypted bullet qualifier:
5975 (goto-char after-bullet-pos) 6002 (goto-char after-bullet-pos)
5976 (insert "*")))) 6003 (insert "*"))))
6004
6005 ;; adjust buffer's auto-save eligibility:
6006 (if was-encrypted
6007 (allout-inhibit-auto-save-info-for-decryption was-buffer-saved-size)
6008 (allout-maybe-resume-auto-save-info-after-encryption))
6009
5977 (run-hook-with-args 'allout-structure-added-hook 6010 (run-hook-with-args 'allout-structure-added-hook
5978 bullet-pos subtree-end)))) 6011 bullet-pos subtree-end))))
5979;;;_ > allout-encrypt-string (text decrypt allout-buffer keymode-cue 6012;;;_ > allout-encrypt-string (text decrypt allout-buffer keymode-cue
@@ -6025,6 +6058,7 @@ signal."
6025 (epg-context-set-passphrase-callback 6058 (epg-context-set-passphrase-callback
6026 context #'epa-passphrase-callback-function) 6059 context #'epa-passphrase-callback-function)
6027 context)) 6060 context))
6061
6028 (encoding (with-current-buffer allout-buffer 6062 (encoding (with-current-buffer allout-buffer
6029 buffer-file-coding-system)) 6063 buffer-file-coding-system))
6030 (multibyte (with-current-buffer allout-buffer 6064 (multibyte (with-current-buffer allout-buffer
@@ -6146,8 +6180,29 @@ signal."
6146 result-text)) 6180 result-text))
6147 (error (concat "Encryption produced non-armored text, which" 6181 (error (concat "Encryption produced non-armored text, which"
6148 "conflicts with allout mode -- reconfigure!"))) 6182 "conflicts with allout mode -- reconfigure!")))
6149
6150 (t result-text)))) 6183 (t result-text))))
6184;;;_ > allout-inhibit-auto-save-info-for-decryption
6185(defun allout-inhibit-auto-save-info-for-decryption (was-buffer-saved-size)
6186 "Temporarily prevent auto-saves in this buffer when an item is decrypted.
6187
6188WAS-BUFFER-SAVED-SIZE is the value of buffer-saved-size *before*
6189the decryption."
6190 (when (not (or (= buffer-saved-size -1) (= was-buffer-saved-size -1)))
6191 (setq allout-auto-save-temporarily-disabled was-buffer-saved-size
6192 buffer-saved-size -1)))
6193;;;_ > allout-maybe-resume-auto-save-info-after-encryption ()
6194(defun allout-maybe-resume-auto-save-info-after-encryption ()
6195 "Restore auto-save info, *if* there are no topics pending encryption."
6196 (when (and allout-auto-save-temporarily-disabled
6197 (= buffer-saved-size -1)
6198 (save-excursion
6199 (save-restriction
6200 (widen)
6201 (goto-char (point-min))
6202 (not (allout-next-topic-pending-encryption)))))
6203 (setq buffer-saved-size allout-auto-save-temporarily-disabled
6204 allout-auto-save-temporarily-disabled nil)))
6205
6151;;;_ > allout-encrypted-topic-p () 6206;;;_ > allout-encrypted-topic-p ()
6152(defun allout-encrypted-topic-p () 6207(defun allout-encrypted-topic-p ()
6153 "True if the current topic is encryptable and encrypted." 6208 "True if the current topic is encryptable and encrypted."
@@ -6158,14 +6213,10 @@ signal."
6158 (save-match-data (looking-at "\\*"))) 6213 (save-match-data (looking-at "\\*")))
6159 ) 6214 )
6160 ) 6215 )
6161;;;_ > allout-next-topic-pending-encryption (&optional except-mark) 6216;;;_ > allout-next-topic-pending-encryption ()
6162(defun allout-next-topic-pending-encryption (&optional except-mark) 6217(defun allout-next-topic-pending-encryption ()
6163 "Return the point of the next topic pending encryption, or nil if none. 6218 "Return the point of the next topic pending encryption, or nil if none.
6164 6219
6165EXCEPT-MARK identifies a point whose containing topics should be excluded
6166from encryption. This supports 'except-current mode of
6167`allout-encrypt-unencrypted-on-saves'.
6168
6169Such a topic has the `allout-topic-encryption-bullet' without an 6220Such a topic has the `allout-topic-encryption-bullet' without an
6170immediately following '*' that would mark the topic as being encrypted. It 6221immediately following '*' that would mark the topic as being encrypted. It
6171must also have content." 6222must also have content."
@@ -6200,10 +6251,7 @@ must also have content."
6200 (setq content-beg (point)) 6251 (setq content-beg (point))
6201 (backward-char 1) 6252 (backward-char 1)
6202 (allout-end-of-subtree) 6253 (allout-end-of-subtree)
6203 (if (or (<= (point) content-beg) 6254 (if (<= (point) content-beg)
6204 (and except-mark
6205 (<= content-beg except-mark)
6206 (>= (point) except-mark)))
6207 ;; Continue looking 6255 ;; Continue looking
6208 (setq got nil) 6256 (setq got nil)
6209 ;; Got it! 6257 ;; Got it!
@@ -6215,14 +6263,10 @@ must also have content."
6215 ) 6263 )
6216 ) 6264 )
6217 ) 6265 )
6218;;;_ > allout-encrypt-decrypted (&optional except-mark) 6266;;;_ > allout-encrypt-decrypted ()
6219(defun allout-encrypt-decrypted (&optional except-mark) 6267(defun allout-encrypt-decrypted ()
6220 "Encrypt topics pending encryption except those containing exemption point. 6268 "Encrypt topics pending encryption except those containing exemption point.
6221 6269
6222EXCEPT-MARK identifies a point whose containing topics should be excluded
6223from encryption. This supports the `except-current' mode of
6224`allout-encrypt-unencrypted-on-saves'.
6225
6226If a topic that is currently being edited was encrypted, we return a list 6270If a topic that is currently being edited was encrypted, we return a list
6227containing the location of the topic and the location of the cursor just 6271containing the location of the topic and the location of the cursor just
6228before the topic was encrypted. This can be used, eg, to decrypt the topic 6272before the topic was encrypted. This can be used, eg, to decrypt the topic
@@ -6238,7 +6282,7 @@ save. See `allout-encrypt-unencrypted-on-saves' for more info."
6238 bo-subtree 6282 bo-subtree
6239 editing-topic editing-point) 6283 editing-topic editing-point)
6240 (goto-char (point-min)) 6284 (goto-char (point-min))
6241 (while (allout-next-topic-pending-encryption except-mark) 6285 (while (allout-next-topic-pending-encryption)
6242 (setq was-modified (buffer-modified-p)) 6286 (setq was-modified (buffer-modified-p))
6243 (when (save-excursion 6287 (when (save-excursion
6244 (and (boundp 'allout-encrypt-unencrypted-on-saves) 6288 (and (boundp 'allout-encrypt-unencrypted-on-saves)
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 0d129856f1d..ea875b9989d 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -55,9 +55,9 @@
55;; -------------------------------------------- 55;; --------------------------------------------
56;; View listing Intern Intern Intern Intern Y Y 56;; View listing Intern Intern Intern Intern Y Y
57;; Extract member Y Y Y Y Y Y 57;; Extract member Y Y Y Y Y Y
58;; Save changed member Y Y Y Y N N 58;; Save changed member Y Y Y Y N Y
59;; Add new member N N N N N N 59;; Add new member N N N N N N
60;; Delete member Y Y Y Y N N 60;; Delete member Y Y Y Y N Y
61;; Rename member Y Y N N N N 61;; Rename member Y Y N N N N
62;; Chmod - Y Y - N N 62;; Chmod - Y Y - N N
63;; Chown - Y - - N N 63;; Chown - Y - - N N
@@ -216,10 +216,10 @@ Archive and member name will be added."
216;; Zip archive configuration 216;; Zip archive configuration
217 217
218(defcustom archive-zip-extract 218(defcustom archive-zip-extract
219 (cond ((executable-find "unzip") '("unzip" "-qq" "-c")) 219 (cond ((executable-find "unzip") '("unzip" "-qq" "-c"))
220 ((executable-find "7z") '("7z" "x" "-so")) 220 ((executable-find "7z") '("7z" "x" "-so"))
221 ((executable-find "pkunzip") '("pkunzip" "-e" "-o-")) 221 ((executable-find "pkunzip") '("pkunzip" "-e" "-o-"))
222 (t '("unzip" "-qq" "-c"))) 222 (t '("unzip" "-qq" "-c")))
223 "Program and its options to run in order to extract a zip file member. 223 "Program and its options to run in order to extract a zip file member.
224Extraction should happen to standard output. Archive and member name will 224Extraction should happen to standard output. Archive and member name will
225be added." 225be added."
@@ -235,44 +235,44 @@ be added."
235;; names. 235;; names.
236 236
237(defcustom archive-zip-expunge 237(defcustom archive-zip-expunge
238 (if (and (not (executable-find "zip")) 238 (cond ((executable-find "zip") '("zip" "-d" "-q"))
239 (executable-find "pkzip")) 239 ((executable-find "7z") '("7z" "d"))
240 '("pkzip" "-d") 240 ((executable-find "pkzip") '("pkzip" "-d"))
241 '("zip" "-d" "-q")) 241 (t '("zip" "-d" "-q")))
242 "Program and its options to run in order to delete zip file members. 242 "Program and its options to run in order to delete zip file members.
243Archive and member names will be added." 243Archive and member names will be added."
244 :type '(list (string :tag "Program") 244 :type '(list (string :tag "Program")
245 (repeat :tag "Options" 245 (repeat :tag "Options"
246 :inline t 246 :inline t
247 (string :format "%v"))) 247 (string :format "%v")))
248 :group 'archive-zip) 248 :group 'archive-zip)
249 249
250(defcustom archive-zip-update 250(defcustom archive-zip-update
251 (if (and (not (executable-find "zip")) 251 (cond ((executable-find "zip") '("zip" "-q"))
252 (executable-find "pkzip")) 252 ((executable-find "7z") '("7z" "u"))
253 '("pkzip" "-u" "-P") 253 ((executable-find "pkzip") '("pkzip" "-u" "-P"))
254 '("zip" "-q")) 254 (t '("zip" "-q")))
255 "Program and its options to run in order to update a zip file member. 255 "Program and its options to run in order to update a zip file member.
256Options should ensure that specified directory will be put into the zip 256Options should ensure that specified directory will be put into the zip
257file. Archive and member name will be added." 257file. Archive and member name will be added."
258 :type '(list (string :tag "Program") 258 :type '(list (string :tag "Program")
259 (repeat :tag "Options" 259 (repeat :tag "Options"
260 :inline t 260 :inline t
261 (string :format "%v"))) 261 (string :format "%v")))
262 :group 'archive-zip) 262 :group 'archive-zip)
263 263
264(defcustom archive-zip-update-case 264(defcustom archive-zip-update-case
265 (if (and (not (executable-find "zip")) 265 (cond ((executable-find "zip") '("zip" "-q" "-k"))
266 (executable-find "pkzip")) 266 ((executable-find "7z") '("7z" "u"))
267 '("pkzip" "-u" "-P") 267 ((executable-find "pkzip") '("pkzip" "-u" "-P"))
268 '("zip" "-q" "-k")) 268 (t '("zip" "-q" "-k")))
269 "Program and its options to run in order to update a case fiddled zip member. 269 "Program and its options to run in order to update a case fiddled zip member.
270Options should ensure that specified directory will be put into the zip file. 270Options should ensure that specified directory will be put into the zip file.
271Archive and member name will be added." 271Archive and member name will be added."
272 :type '(list (string :tag "Program") 272 :type '(list (string :tag "Program")
273 (repeat :tag "Options" 273 (repeat :tag "Options"
274 :inline t 274 :inline t
275 (string :format "%v"))) 275 (string :format "%v")))
276 :group 'archive-zip) 276 :group 'archive-zip)
277 277
278(defcustom archive-zip-case-fiddle t 278(defcustom archive-zip-case-fiddle t
@@ -323,9 +323,30 @@ Archive and member name will be added."
323Extraction should happen to standard output. Archive and member name will 323Extraction should happen to standard output. Archive and member name will
324be added." 324be added."
325 :type '(list (string :tag "Program") 325 :type '(list (string :tag "Program")
326 (repeat :tag "Options" 326 (repeat :tag "Options"
327 :inline t 327 :inline t
328 (string :format "%v"))) 328 (string :format "%v")))
329 :group 'archive-7z)
330
331(defcustom archive-7z-expunge
332 '("7z" "d")
333 "Program and its options to run in order to delete 7z file members.
334Archive and member names will be added."
335 :type '(list (string :tag "Program")
336 (repeat :tag "Options"
337 :inline t
338 (string :format "%v")))
339 :group 'archive-7z)
340
341(defcustom archive-7z-update
342 '("7z" "u")
343 "Program and its options to run in order to update a 7z file member.
344Options should ensure that specified directory will be put into the 7z
345file. Archive and member name will be added."
346 :type '(list (string :tag "Program")
347 (repeat :tag "Options"
348 :inline t
349 (string :format "%v")))
329 :group 'archive-7z) 350 :group 'archive-7z)
330 351
331;; ------------------------------------------------------------------------- 352;; -------------------------------------------------------------------------
@@ -1062,7 +1083,7 @@ using `make-temp-file', and the generated name is returned."
1062 (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))) 1083 (view-buffer buffer (and just-created 'kill-buffer-if-not-modified)))
1063 ((eq other-window-p 'display) (display-buffer buffer)) 1084 ((eq other-window-p 'display) (display-buffer buffer))
1064 (other-window-p (switch-to-buffer-other-window buffer)) 1085 (other-window-p (switch-to-buffer-other-window buffer))
1065 (t (switch-to-buffer buffer)))))) 1086 (t (pop-to-buffer-same-window buffer))))))
1066 1087
1067(defun archive-*-extract (archive name command) 1088(defun archive-*-extract (archive name command)
1068 (let* ((default-directory (file-name-as-directory archive-tmpdir)) 1089 (let* ((default-directory (file-name-as-directory archive-tmpdir))
@@ -2037,7 +2058,9 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
2037 (with-temp-buffer 2058 (with-temp-buffer
2038 (call-process "7z" nil t nil "l" "-slt" file) 2059 (call-process "7z" nil t nil "l" "-slt" file)
2039 (goto-char (point-min)) 2060 (goto-char (point-min))
2040 (re-search-forward "^-+\n") 2061 ;; Four dashes start the meta info section that should be skipped.
2062 ;; Archive members start with more than four dashes.
2063 (re-search-forward "^-----+\n")
2041 (while (re-search-forward "^Path = \\(.*\\)\n" nil t) 2064 (while (re-search-forward "^Path = \\(.*\\)\n" nil t)
2042 (goto-char (match-end 0)) 2065 (goto-char (match-end 0))
2043 (let ((name (match-string 1)) 2066 (let ((name (match-string 1))
@@ -2084,6 +2107,12 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
2084 (message "%s" (buffer-string))) 2107 (message "%s" (buffer-string)))
2085 (delete-file tmpfile))))) 2108 (delete-file tmpfile)))))
2086 2109
2110(defun archive-7z-write-file-member (archive descr)
2111 (archive-*-write-file-member
2112 archive
2113 descr
2114 archive-7z-update))
2115
2087;; ------------------------------------------------------------------------- 2116;; -------------------------------------------------------------------------
2088;;; Section `ar' archives. 2117;;; Section `ar' archives.
2089 2118
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index 5793c3180be..3b849cece22 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -360,7 +360,7 @@ Matches the visited file name against the elements of `auto-insert-alist'."
360 (save-window-excursion 360 (save-window-excursion
361 ;; make buffer visible before skeleton or function 361 ;; make buffer visible before skeleton or function
362 ;; which might ask the user for something 362 ;; which might ask the user for something
363 (switch-to-buffer (current-buffer)) 363 (pop-to-buffer-same-window (current-buffer))
364 (if (and (consp action) 364 (if (and (consp action)
365 (not (eq (car action) 'lambda))) 365 (not (eq (car action) 'lambda)))
366 (skeleton-insert action) 366 (skeleton-insert action)
diff --git a/lisp/bindings.el b/lisp/bindings.el
index a7b729a1ba3..c4f9369219a 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -471,7 +471,7 @@ Like `bury-buffer', but temporarily select EVENT's window."
471(defun mode-line-other-buffer () "\ 471(defun mode-line-other-buffer () "\
472Switch to the most recently selected buffer other than the current one." 472Switch to the most recently selected buffer other than the current one."
473 (interactive) 473 (interactive)
474 (switch-to-buffer (other-buffer))) 474 (switch-to-buffer (other-buffer) nil t))
475 475
476(defun mode-line-next-buffer (event) 476(defun mode-line-next-buffer (event)
477 "Like `next-buffer', but temporarily select EVENT's window." 477 "Like `next-buffer', but temporarily select EVENT's window."
@@ -593,9 +593,12 @@ is okay. See `mode-line-format'.")
593 ".fas" ".lib" ".mem" 593 ".fas" ".lib" ".mem"
594 ;; CMUCL 594 ;; CMUCL
595 ".x86f" ".sparcf" 595 ".x86f" ".sparcf"
596 ;; Other CL implementations (Allegro, LispWorks, OpenMCL) 596 ;; OpenMCL / Clozure CL
597 ".fasl" ".ufsl" ".fsl" ".dxl" ".pfsl" ".dfsl" 597 ".dfsl" ".pfsl" ".d64fsl" ".p64fsl" ".lx64fsl" ".lx32fsl"
598 ".p64fsl" ".d64fsl" ".dx64fsl" 598 ".dx64fsl" ".dx32fsl" ".fx64fsl" ".fx32fsl" ".sx64fsl"
599 ".sx32fsl" ".wx64fsl" ".wx32fsl"
600 ;; Other CL implementations (Allegro, LispWorks)
601 ".fasl" ".ufsl" ".fsl" ".dxl"
599 ;; Libtool 602 ;; Libtool
600 ".lo" ".la" 603 ".lo" ".la"
601 ;; Gettext 604 ;; Gettext
@@ -846,6 +849,8 @@ if `inhibit-field-text-motion' is non-nil."
846(define-key global-map "\C-@" 'set-mark-command) 849(define-key global-map "\C-@" 'set-mark-command)
847;; Many people are used to typing C-SPC and getting C-@. 850;; Many people are used to typing C-SPC and getting C-@.
848(define-key global-map [?\C- ] 'set-mark-command) 851(define-key global-map [?\C- ] 'set-mark-command)
852(put 'set-mark-command :advertised-binding [?\C- ])
853
849(define-key ctl-x-map "\C-x" 'exchange-point-and-mark) 854(define-key ctl-x-map "\C-x" 'exchange-point-and-mark)
850(define-key ctl-x-map "\C-@" 'pop-global-mark) 855(define-key ctl-x-map "\C-@" 'pop-global-mark)
851(define-key ctl-x-map [?\C- ] 'pop-global-mark) 856(define-key ctl-x-map [?\C- ] 'pop-global-mark)
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 184cecb9e9c..bb7ad153e8b 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1539,9 +1539,7 @@ deletion, or > if it is flagged for displaying."
1539 (bookmark-maybe-load-default-file) 1539 (bookmark-maybe-load-default-file)
1540 (let ((buf (get-buffer-create "*Bookmark List*"))) 1540 (let ((buf (get-buffer-create "*Bookmark List*")))
1541 (if (called-interactively-p 'interactive) 1541 (if (called-interactively-p 'interactive)
1542 (if (or (window-dedicated-p) (window-minibuffer-p)) 1542 (pop-to-buffer-same-window buf)
1543 (pop-to-buffer buf)
1544 (switch-to-buffer buf))
1545 (set-buffer buf))) 1543 (set-buffer buf)))
1546 (let ((inhibit-read-only t)) 1544 (let ((inhibit-read-only t))
1547 (erase-buffer) 1545 (erase-buffer)
@@ -1843,7 +1841,7 @@ With a prefix arg, prompts for a file to save them in."
1843 (menu (current-buffer)) 1841 (menu (current-buffer))
1844 (pop-up-windows t)) 1842 (pop-up-windows t))
1845 (delete-other-windows) 1843 (delete-other-windows)
1846 (switch-to-buffer (other-buffer)) 1844 (switch-to-buffer (other-buffer) nil t)
1847 (bookmark--jump-via bmrk 'pop-to-buffer) 1845 (bookmark--jump-via bmrk 'pop-to-buffer)
1848 (bury-buffer menu))) 1846 (bury-buffer menu)))
1849 1847
diff --git a/lisp/bs.el b/lisp/bs.el
index 94fbd0e04f9..49ffb3f822c 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -1215,7 +1215,7 @@ by buffer configuration `bs-cycle-configuration-name'."
1215 ;; We don't want the frame iconified if the only window in the frame 1215 ;; We don't want the frame iconified if the only window in the frame
1216 ;; happens to be dedicated. 1216 ;; happens to be dedicated.
1217 (bury-buffer (current-buffer)) 1217 (bury-buffer (current-buffer))
1218 (switch-to-buffer next) 1218 (switch-to-buffer next nil t)
1219 (setq bs--cycle-list (append (cdr cycle-list) 1219 (setq bs--cycle-list (append (cdr cycle-list)
1220 (list (car cycle-list)))) 1220 (list (car cycle-list))))
1221 (bs-message-without-log "Next buffers: %s" 1221 (bs-message-without-log "Next buffers: %s"
@@ -1244,7 +1244,7 @@ by buffer configuration `bs-cycle-configuration-name'."
1244 bs--cycle-list))) 1244 bs--cycle-list)))
1245 (prev-buffer (car tupel)) 1245 (prev-buffer (car tupel))
1246 (cycle-list (cdr tupel))) 1246 (cycle-list (cdr tupel)))
1247 (switch-to-buffer prev-buffer) 1247 (switch-to-buffer prev-buffer nil t)
1248 (setq bs--cycle-list (append (last cycle-list) 1248 (setq bs--cycle-list (append (last cycle-list)
1249 (reverse (cdr (reverse cycle-list))))) 1249 (reverse (cdr (reverse cycle-list)))))
1250 (bs-message-without-log "Previous buffers: %s" 1250 (bs-message-without-log "Previous buffers: %s"
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 95f309e33b9..f0a44747378 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -266,7 +266,10 @@ Letters do not insert themselves; instead, they are commands.
266 (set (make-local-variable 'buffer-stale-function) 266 (set (make-local-variable 'buffer-stale-function)
267 (lambda (&optional _noconfirm) 'fast)) 267 (lambda (&optional _noconfirm) 'fast))
268 (setq truncate-lines t) 268 (setq truncate-lines t)
269 (setq buffer-read-only t)) 269 (setq buffer-read-only t)
270 ;; Force L2R direction, to avoid messing the display if the first
271 ;; buffer in the list happens to begin with a strong R2L character.
272 (setq bidi-paragraph-direction 'left-to-right))
270 273
271(define-obsolete-variable-alias 'buffer-menu-mode-hook 274(define-obsolete-variable-alias 'buffer-menu-mode-hook
272 'Buffer-menu-mode-hook "23.1") 275 'Buffer-menu-mode-hook "23.1")
@@ -663,7 +666,7 @@ For more information, see the function `buffer-menu'."
663 ":" ;; (if (char-displayable-p ?…) "…" ":") 666 ":" ;; (if (char-displayable-p ?…) "…" ":")
664 ) 667 )
665 668
666(defun Buffer-menu-buffer+size (name size &optional name-props size-props) 669(defun Buffer-menu-buffer+size (name size &optional name-props size-props lrm)
667 (if (> (+ (string-width name) (string-width size) 2) 670 (if (> (+ (string-width name) (string-width size) 2)
668 Buffer-menu-buffer+size-width) 671 Buffer-menu-buffer+size-width)
669 (setq name 672 (setq name
@@ -678,9 +681,17 @@ For more information, see the function `buffer-menu'."
678 (string-width tail) 681 (string-width tail)
679 2)) 682 2))
680 Buffer-menu-short-ellipsis 683 Buffer-menu-short-ellipsis
681 tail))) 684 tail
685 ;; Append an invisible LRM character to the
686 ;; buffer's name to avoid ugly display with the
687 ;; buffer size to the left of the name, when the
688 ;; name begins with R2L character.
689 (if lrm (propertize (string ?\x200e) 'invisible t) ""))))
682 ;; Don't put properties on (buffer-name). 690 ;; Don't put properties on (buffer-name).
683 (setq name (copy-sequence name))) 691 (setq name (concat (copy-sequence name)
692 (if lrm
693 (propertize (string ?\x200e) 'invisible t)
694 ""))))
684 (add-text-properties 0 (length name) name-props name) 695 (add-text-properties 0 (length name) name-props name)
685 (add-text-properties 0 (length size) size-props size) 696 (add-text-properties 0 (length size) size-props size)
686 (let ((name+space-width (- Buffer-menu-buffer+size-width 697 (let ((name+space-width (- Buffer-menu-buffer+size-width
@@ -813,6 +824,10 @@ For more information, see the function `buffer-menu'."
813 (setq buffer-read-only nil) 824 (setq buffer-read-only nil)
814 (erase-buffer) 825 (erase-buffer)
815 (setq standard-output (current-buffer)) 826 (setq standard-output (current-buffer))
827 ;; Force L2R direction, to avoid messing the display if the
828 ;; first buffer in the list happens to begin with a strong R2L
829 ;; character.
830 (setq bidi-paragraph-direction 'left-to-right)
816 (unless Buffer-menu-use-header-line 831 (unless Buffer-menu-use-header-line
817 ;; Use U+2014 (EM DASH) to underline if possible, else use ASCII 832 ;; Use U+2014 (EM DASH) to underline if possible, else use ASCII
818 ;; (i.e. U+002D, HYPHEN-MINUS). 833 ;; (i.e. U+002D, HYPHEN-MINUS).
@@ -914,7 +929,8 @@ For more information, see the function `buffer-menu'."
914 (max (length size) 3) 929 (max (length size) 3)
915 2)) 930 2))
916 name 931 name
917 "mouse-2: select this buffer")))) 932 "mouse-2: select this buffer"))
933 nil t))
918 " " 934 " "
919 (if (> (string-width (nth 4 buffer)) Buffer-menu-mode-width) 935 (if (> (string-width (nth 4 buffer)) Buffer-menu-mode-width)
920 (truncate-string-to-width (nth 4 buffer) 936 (truncate-string-to-width (nth 4 buffer)
diff --git a/lisp/button.el b/lisp/button.el
index 2e485547745..6ef79532ae7 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -54,10 +54,7 @@
54;; Use color for the MS-DOS port because it doesn't support underline. 54;; Use color for the MS-DOS port because it doesn't support underline.
55;; FIXME if MS-DOS correctly answers the (supports) question, it need 55;; FIXME if MS-DOS correctly answers the (supports) question, it need
56;; no longer be a special case. 56;; no longer be a special case.
57(defface button '((((type pc) (class color)) 57(defface button '((t :inherit link))
58 (:foreground "lightblue"))
59 (((supports :underline t)) :underline t)
60 (t (:foreground "lightblue")))
61 "Default face used for buttons." 58 "Default face used for buttons."
62 :group 'basic-faces) 59 :group 'basic-faces)
63 60
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index 8fc3f762f29..1ec474e828e 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -545,11 +545,7 @@ non-nil, the amount returned will be relative to past time worked."
545(defalias 'timeclock-time-to-seconds (if (fboundp 'float-time) 'float-time 545(defalias 'timeclock-time-to-seconds (if (fboundp 'float-time) 'float-time
546 'time-to-seconds)) 546 'time-to-seconds))
547 547
548(defsubst timeclock-seconds-to-time (seconds) 548(defalias 'timeclock-seconds-to-time 'seconds-to-time)
549 "Convert SECONDS (a floating point number) to an Emacs time structure."
550 (list (floor seconds 65536)
551 (floor (mod seconds 65536))
552 (floor (* (- seconds (ffloor seconds)) 1000000))))
553 549
554;; Should today-only be removed in favour of timeclock-relative? - gm 550;; Should today-only be removed in favour of timeclock-relative? - gm
555(defsubst timeclock-when-to-leave (&optional today-only) 551(defsubst timeclock-when-to-leave (&optional today-only)
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 8c12806df1e..60d7690a3c8 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,13 @@
12011-07-04 Darren Hoo <darren.hoo@gmail.com> (tiny change)
2
3 * semantic/db.el (semanticdb-file-table-object): Don't bug out on
4 unconfigured projects if `global-ede-mode' is on (bug#8092).
5
62011-07-01 Paul Eggert <eggert@cs.ucla.edu>
7
8 * semantic.el (semantic-elapsed-time): Rewrite using
9 time-subtract and float-time.
10
12011-05-11 Glenn Morris <rgm@gnu.org> 112011-05-11 Glenn Morris <rgm@gnu.org>
2 12
3 * semantic/wisent/javascript.el (semantic-get-local-variables): 13 * semantic/wisent/javascript.el (semantic-get-local-variables):
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index c899988dc36..ce9af0e12b5 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -379,9 +379,7 @@ Do not set this yourself. Call `semantic-debug'.")
379(defun semantic-elapsed-time (start end) 379(defun semantic-elapsed-time (start end)
380 "Copied from elp.el. Was `elp-elapsed-time'. 380 "Copied from elp.el. Was `elp-elapsed-time'.
381Argument START and END bound the time being calculated." 381Argument START and END bound the time being calculated."
382 (+ (* (- (car end) (car start)) 65536.0) 382 (float-time (time-subtract end start)))
383 (- (car (cdr end)) (car (cdr start)))
384 (/ (- (car (cdr (cdr end))) (car (cdr (cdr start)))) 1000000.0)))
385 383
386(defun bovinate (&optional clear) 384(defun bovinate (&optional clear)
387 "Parse the current buffer. Show output in a temp buffer. 385 "Parse the current buffer. Show output in a temp buffer.
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index fa8de392b62..dca1b3bafea 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -880,7 +880,7 @@ If file does not have tags available, and DONTLOAD is nil,
880then load the tags for FILE, and create a new table object for it. 880then load the tags for FILE, and create a new table object for it.
881DONTLOAD does not affect the creation of new database objects." 881DONTLOAD does not affect the creation of new database objects."
882 ;; (message "Object Translate: %s" file) 882 ;; (message "Object Translate: %s" file)
883 (when (file-exists-p file) 883 (when (and file (file-exists-p file))
884 (let* ((default-directory (file-name-directory file)) 884 (let* ((default-directory (file-name-directory file))
885 (tab (semanticdb-file-table-object-from-hash file)) 885 (tab (semanticdb-file-table-object-from-hash file))
886 (fullfile nil)) 886 (fullfile nil))
diff --git a/lisp/comint.el b/lisp/comint.el
index 5548d19ad30..2349fc0edd9 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -347,7 +347,7 @@ This variable is buffer-local."
347 " +\\)" 347 " +\\)"
348 (regexp-opt 348 (regexp-opt
349 '("password" "Password" "passphrase" "Passphrase" 349 '("password" "Password" "passphrase" "Passphrase"
350 "pass phrase" "Pass phrase")) 350 "pass phrase" "Pass phrase" "Response"))
351 "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?\ 351 "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?\
352\\(?: for [^:]+\\)?:\\s *\\'") 352\\(?: for [^:]+\\)?:\\s *\\'")
353 "Regexp matching prompts for passwords in the inferior process. 353 "Regexp matching prompts for passwords in the inferior process.
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 7c96b526f41..d443d6c160c 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -594,7 +594,7 @@ WIDGET is the widget to apply the filter entries of MENU on."
594 ("-function\\'" function) 594 ("-function\\'" function)
595 ("-functions\\'" (repeat function)) 595 ("-functions\\'" (repeat function))
596 ("-list\\'" (repeat sexp)) 596 ("-list\\'" (repeat sexp))
597 ("-alist\\'" (repeat (cons sexp sexp)))) 597 ("-alist\\'" (alist :key-type sexp :value-type sexp)))
598 "Alist of (MATCH TYPE). 598 "Alist of (MATCH TYPE).
599 599
600MATCH should be a regexp matching the name of a symbol, and TYPE should 600MATCH should be a regexp matching the name of a symbol, and TYPE should
@@ -1033,9 +1033,36 @@ If given a prefix (or a COMMENT argument), also prompt for a comment."
1033 (put variable 'saved-variable-comment comment))) 1033 (put variable 'saved-variable-comment comment)))
1034 (put variable 'customized-value nil) 1034 (put variable 'customized-value nil)
1035 (put variable 'customized-variable-comment nil) 1035 (put variable 'customized-variable-comment nil)
1036 (custom-save-all) 1036 (if (custom-file t)
1037 (custom-save-all)
1038 (message "Setting `%s' temporarily since \"emacs -q\" would overwrite customizations"
1039 variable)
1040 (set variable value))
1037 value) 1041 value)
1038 1042
1043;; Some parts of Emacs might prompt the user to save customizations,
1044;; during startup before customizations are loaded. This function
1045;; handles this corner case by avoiding calling `custom-save-variable'
1046;; too early, which could wipe out existing customizations.
1047
1048;;;###autoload
1049(defun customize-push-and-save (list-var elts)
1050 "Add ELTS to LIST-VAR and save for future sessions, safely.
1051ELTS should be a list. This function adds each entry to the
1052value of LIST-VAR using `add-to-list'.
1053
1054If Emacs is initialized, call `customize-save-variable' to save
1055the resulting list value now. Otherwise, add an entry to
1056`after-init-hook' to save it after initialization."
1057 (dolist (entry elts)
1058 (add-to-list list-var entry))
1059 (if after-init-time
1060 (let ((coding-system-for-read nil))
1061 (customize-save-variable list-var (eval list-var)))
1062 (add-hook 'after-init-hook
1063 `(lambda ()
1064 (customize-push-and-save ',list-var ',elts)))))
1065
1039;;;###autoload 1066;;;###autoload
1040(defun customize () 1067(defun customize ()
1041 "Select a customization buffer which you can use to set user options. 1068 "Select a customization buffer which you can use to set user options.
@@ -1806,6 +1833,7 @@ item in another window.\n\n"))
1806;; We want simple widgets to be displayed by default, but complex 1833;; We want simple widgets to be displayed by default, but complex
1807;; widgets to be hidden. 1834;; widgets to be hidden.
1808 1835
1836;; This widget type is obsolete as of Emacs 24.1.
1809(widget-put (get 'item 'widget-type) :custom-show t) 1837(widget-put (get 'item 'widget-type) :custom-show t)
1810(widget-put (get 'editable-field 'widget-type) 1838(widget-put (get 'editable-field 'widget-type)
1811 :custom-show (lambda (_widget value) 1839 :custom-show (lambda (_widget value)
@@ -2234,6 +2262,7 @@ and `face'."
2234 (setq widget nil))))) 2262 (setq widget nil)))))
2235 (widget-setup)) 2263 (widget-setup))
2236 2264
2265(make-obsolete 'custom-show "this widget type is no longer supported." "24.1")
2237(defun custom-show (widget value) 2266(defun custom-show (widget value)
2238 "Non-nil if WIDGET should be shown with VALUE by default." 2267 "Non-nil if WIDGET should be shown with VALUE by default."
2239 (let ((show (widget-get widget :custom-show))) 2268 (let ((show (widget-get widget :custom-show)))
@@ -4378,23 +4407,27 @@ Click on \"More\" \(or position point there and press RETURN)
4378if only the first line of the docstring is shown.")) 4407if only the first line of the docstring is shown."))
4379 :group 'customize) 4408 :group 'customize)
4380 4409
4381(defun custom-file () 4410(defun custom-file (&optional no-error)
4382 "Return the file name for saving customizations." 4411 "Return the file name for saving customizations."
4383 (file-chase-links 4412 (let ((file
4384 (or custom-file 4413 (or custom-file
4385 (let ((user-init-file user-init-file) 4414 (let ((user-init-file user-init-file)
4386 (default-init-file 4415 (default-init-file
4387 (if (eq system-type 'ms-dos) "~/_emacs" "~/.emacs"))) 4416 (if (eq system-type 'ms-dos) "~/_emacs" "~/.emacs")))
4388 (when (null user-init-file) 4417 (when (null user-init-file)
4389 (if (or (file-exists-p default-init-file) 4418 (if (or (file-exists-p default-init-file)
4390 (and (eq system-type 'windows-nt) 4419 (and (eq system-type 'windows-nt)
4391 (file-exists-p "~/_emacs"))) 4420 (file-exists-p "~/_emacs")))
4392 ;; Started with -q, i.e. the file containing 4421 ;; Started with -q, i.e. the file containing
4393 ;; Custom settings hasn't been read. Saving 4422 ;; Custom settings hasn't been read. Saving
4394 ;; settings there would overwrite other settings. 4423 ;; settings there would overwrite other settings.
4395 (error "Saving settings from \"emacs -q\" would overwrite existing customizations")) 4424 (if no-error
4396 (setq user-init-file default-init-file)) 4425 nil
4397 user-init-file)))) 4426 (error "Saving settings from \"emacs -q\" would overwrite existing customizations"))
4427 (setq user-init-file default-init-file)))
4428 user-init-file))))
4429 (and file
4430 (file-chase-links file))))
4398 4431
4399;; If recentf-mode is non-nil, this is defined. 4432;; If recentf-mode is non-nil, this is defined.
4400(declare-function recentf-expand-file-name "recentf" (name)) 4433(declare-function recentf-expand-file-name "recentf" (name))
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 7f926c85e56..04a9e728b22 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -157,7 +157,7 @@ remove them from your saved Custom file.\n\n"))
157 ;; Load the theme settings. 157 ;; Load the theme settings.
158 (when theme 158 (when theme
159 (unless (eq theme 'user) 159 (unless (eq theme 'user)
160 (load-theme theme t)) 160 (load-theme theme nil t))
161 (dolist (setting (get theme 'theme-settings)) 161 (dolist (setting (get theme 'theme-settings))
162 (if (eq (car setting) 'theme-value) 162 (if (eq (car setting) 'theme-value)
163 (progn (push (nth 1 setting) vars) 163 (progn (push (nth 1 setting) vars)
@@ -326,7 +326,7 @@ SPEC, if non-nil, should be a face spec to which to set the widget."
326 (unless (eq theme 'user) 326 (unless (eq theme 'user)
327 (unless (custom-theme-name-valid-p theme) 327 (unless (custom-theme-name-valid-p theme)
328 (error "Invalid theme name `%s'" theme)) 328 (error "Invalid theme name `%s'" theme))
329 (load-theme theme t)) 329 (load-theme theme nil t))
330 (let ((settings (reverse (get theme 'theme-settings)))) 330 (let ((settings (reverse (get theme 'theme-settings))))
331 (dolist (setting settings) 331 (dolist (setting settings)
332 (funcall (if (eq (car setting) 'theme-value) 332 (funcall (if (eq (car setting) 'theme-value)
diff --git a/lisp/custom.el b/lisp/custom.el
index 8295777f1f1..4f69c741468 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -120,8 +120,10 @@ the :set function.
120For variables in preloaded files, you can simply use this 120For variables in preloaded files, you can simply use this
121function for the :initialize property. For autoloaded variables, 121function for the :initialize property. For autoloaded variables,
122you will also need to add an autoload stanza calling this 122you will also need to add an autoload stanza calling this
123function, and another one setting the standard-value property. 123function, and another one setting the standard-value property."
124See `send-mail-function' in sendmail.el for an example." 124 ;; No longer true:
125 ;; "See `send-mail-function' in sendmail.el for an example."
126
125 ;; Until the var is actually initialized, it is kept unbound. 127 ;; Until the var is actually initialized, it is kept unbound.
126 ;; This seemed to be at least as good as setting it to an arbitrary 128 ;; This seemed to be at least as good as setting it to an arbitrary
127 ;; value like nil (evaluating `value' is not an option because it 129 ;; value like nil (evaluating `value' is not an option because it
@@ -215,7 +217,8 @@ The following keywords are meaningful:
215 variable. It takes two arguments, the symbol and value 217 variable. It takes two arguments, the symbol and value
216 given in the `defcustom' call. The default is 218 given in the `defcustom' call. The default is
217 `custom-initialize-reset'. 219 `custom-initialize-reset'.
218:set VALUE should be a function to set the value of the symbol. 220:set VALUE should be a function to set the value of the symbol
221 when using the Customize user interface.
219 It takes two arguments, the symbol to set and the value to 222 It takes two arguments, the symbol to set and the value to
220 give it. The default choice of function is `set-default'. 223 give it. The default choice of function is `set-default'.
221:get VALUE should be a function to extract the value of symbol. 224:get VALUE should be a function to extract the value of symbol.
@@ -854,25 +857,18 @@ See `custom-known-themes' for a list of known themes."
854 ;; Add a new setting: 857 ;; Add a new setting:
855 (t 858 (t
856 (unless old 859 (unless old
857 ;; If the user changed the value outside of Customize, we 860 ;; If the user changed a variable outside of Customize, save
858 ;; first save the current value to a fake theme, `changed'. 861 ;; the value to a fake theme, `changed'. If the theme is
859 ;; This ensures that the user-set value comes back if the 862 ;; later disabled, we use this to bring back the old value.
860 ;; theme is later disabled. 863 ;;
861 (cond ((and (eq prop 'theme-value) 864 ;; For faces, we just use `face-new-frame-defaults' to
862 (boundp symbol)) 865 ;; recompute when the theme is disabled.
863 (let ((sv (get symbol 'standard-value)) 866 (when (and (eq prop 'theme-value)
864 (val (symbol-value symbol))) 867 (boundp symbol))
865 (unless (and sv (equal (eval (car sv)) val)) 868 (let ((sv (get symbol 'standard-value))
866 (setq old `((changed ,(custom-quote val))))))) 869 (val (symbol-value symbol)))
867 ((and (facep symbol) 870 (unless (and sv (equal (eval (car sv)) val))
868 (not (face-attr-match-p 871 (setq old `((changed ,(custom-quote val))))))))
869 symbol
870 (custom-fix-face-spec
871 (face-spec-choose
872 (get symbol 'face-defface-spec))))))
873 (setq old `((changed
874 (,(append '(t) (custom-face-attributes-get
875 symbol nil)))))))))
876 (put symbol prop (cons (list theme value) old)) 872 (put symbol prop (cons (list theme value) old))
877 (put theme 'theme-settings 873 (put theme 'theme-settings
878 (cons (list prop symbol theme value) theme-settings)))))) 874 (cons (list prop symbol theme value) theme-settings))))))
@@ -1119,20 +1115,29 @@ Emacs theme directory (a directory named \"themes\" in
1119 :risky t 1115 :risky t
1120 :version "24.1") 1116 :version "24.1")
1121 1117
1122(defun load-theme (theme &optional no-enable) 1118(defun load-theme (theme &optional no-confirm no-enable)
1123 "Load Custom theme named THEME from its file. 1119 "Load Custom theme named THEME from its file.
1124Normally, this also enables THEME. If optional arg NO-ENABLE is
1125non-nil, load THEME but don't enable it.
1126
1127The theme file is named THEME-theme.el, in one of the directories 1120The theme file is named THEME-theme.el, in one of the directories
1128specified by `custom-theme-load-path'. 1121specified by `custom-theme-load-path'.
1129 1122
1123If THEME is not in `custom-safe-themes', prompt the user for
1124confirmation, unless optional arg NO-CONFIRM is non-nil.
1125
1126Normally, this function also enables THEME; if optional arg
1127NO-ENABLE is non-nil, load the theme but don't enable it.
1128
1129This function is normally called through Customize when setting
1130`custom-enabled-themes'. If used directly in your init file, it
1131should be called with a non-nil NO-CONFIRM argument, or after
1132`custom-safe-themes' has been loaded.
1133
1130Return t if THEME was successfully loaded, nil otherwise." 1134Return t if THEME was successfully loaded, nil otherwise."
1131 (interactive 1135 (interactive
1132 (list 1136 (list
1133 (intern (completing-read "Load custom theme: " 1137 (intern (completing-read "Load custom theme: "
1134 (mapcar 'symbol-name 1138 (mapcar 'symbol-name
1135 (custom-available-themes)))))) 1139 (custom-available-themes))))
1140 nil nil))
1136 (unless (custom-theme-name-valid-p theme) 1141 (unless (custom-theme-name-valid-p theme)
1137 (error "Invalid theme name `%s'" theme)) 1142 (error "Invalid theme name `%s'" theme))
1138 ;; If reloading, clear out the old theme settings. 1143 ;; If reloading, clear out the old theme settings.
@@ -1152,7 +1157,8 @@ Return t if THEME was successfully loaded, nil otherwise."
1152 (setq hash (sha1 (current-buffer))) 1157 (setq hash (sha1 (current-buffer)))
1153 ;; Check file safety with `custom-safe-themes', prompting the 1158 ;; Check file safety with `custom-safe-themes', prompting the
1154 ;; user if necessary. 1159 ;; user if necessary.
1155 (when (or (and (memq 'default custom-safe-themes) 1160 (when (or no-confirm
1161 (and (memq 'default custom-safe-themes)
1156 (equal (file-name-directory fn) 1162 (equal (file-name-directory fn)
1157 (expand-file-name "themes/" data-directory))) 1163 (expand-file-name "themes/" data-directory)))
1158 (member hash custom-safe-themes) 1164 (member hash custom-safe-themes)
@@ -1211,10 +1217,7 @@ query also about adding HASH to `custom-safe-themes'."
1211 ;; Offer to save to `custom-safe-themes'. 1217 ;; Offer to save to `custom-safe-themes'.
1212 (and (or custom-file user-init-file) 1218 (and (or custom-file user-init-file)
1213 (y-or-n-p "Treat this theme as safe in future sessions? ") 1219 (y-or-n-p "Treat this theme as safe in future sessions? ")
1214 (let ((coding-system-for-read nil)) 1220 (customize-push-and-save 'custom-safe-themes (list hash)))
1215 (push hash custom-safe-themes)
1216 (customize-save-variable 'custom-safe-themes
1217 custom-safe-themes)))
1218 t))))) 1221 t)))))
1219 1222
1220(defun custom-theme-name-valid-p (name) 1223(defun custom-theme-name-valid-p (name)
@@ -1291,7 +1294,10 @@ This list does not include the `user' theme, which is set by
1291Customize and always takes precedence over other Custom Themes. 1294Customize and always takes precedence over other Custom Themes.
1292 1295
1293This variable cannot be defined inside a Custom theme; there, it 1296This variable cannot be defined inside a Custom theme; there, it
1294is simply ignored." 1297is simply ignored.
1298
1299Setting this variable through Customize calls `enable-theme' or
1300`load-theme' for each theme in the list."
1295 :group 'customize 1301 :group 'customize
1296 :type '(repeat symbol) 1302 :type '(repeat symbol)
1297 :set-after '(custom-theme-directory custom-theme-load-path 1303 :set-after '(custom-theme-directory custom-theme-load-path
@@ -1345,11 +1351,33 @@ See `custom-enabled-themes' for a list of enabled themes."
1345 ;; If the face spec specified by this theme is in the 1351 ;; If the face spec specified by this theme is in the
1346 ;; saved-face property, reset that property. 1352 ;; saved-face property, reset that property.
1347 (when (equal (nth 3 s) (get symbol 'saved-face)) 1353 (when (equal (nth 3 s) (get symbol 'saved-face))
1348 (put symbol 'saved-face (and val (cadr (car val))))) 1354 (put symbol 'saved-face (and val (cadr (car val)))))))))
1349 (custom-theme-recalc-face symbol))))) 1355 ;; Recompute faces on all frames.
1356 (dolist (frame (frame-list))
1357 ;; We must reset the fg and bg color frame parameters, or
1358 ;; `face-set-after-frame-default' will use the existing
1359 ;; parameters, which could be from the disabled theme.
1360 (set-frame-parameter frame 'background-color
1361 (custom--frame-color-default
1362 frame :background "background" "Background"
1363 "unspecified-bg" "white"))
1364 (set-frame-parameter frame 'foreground-color
1365 (custom--frame-color-default
1366 frame :foreground "foreground" "Foreground"
1367 "unspecified-fg" "black"))
1368 (face-set-after-frame-default frame))
1350 (setq custom-enabled-themes 1369 (setq custom-enabled-themes
1351 (delq theme custom-enabled-themes))))) 1370 (delq theme custom-enabled-themes)))))
1352 1371
1372(defun custom--frame-color-default (frame attribute resource-attr resource-class
1373 tty-default x-default)
1374 (let ((col (face-attribute 'default attribute t)))
1375 (cond
1376 ((and col (not (eq col 'unspecified))) col)
1377 ((null (window-system frame)) tty-default)
1378 ((setq col (x-get-resource resource-attr resource-class)) col)
1379 (t x-default))))
1380
1353(defun custom-variable-theme-value (variable) 1381(defun custom-variable-theme-value (variable)
1354 "Return (list VALUE) indicating the custom theme value of VARIABLE. 1382 "Return (list VALUE) indicating the custom theme value of VARIABLE.
1355That is to say, it specifies what the value should be according to 1383That is to say, it specifies what the value should be according to
@@ -1381,7 +1409,7 @@ This function returns nil if no custom theme specifies a value for VARIABLE."
1381 (face-spec-recalc face frame))) 1409 (face-spec-recalc face frame)))
1382 1410
1383 1411
1384;;; XEmacs compability functions 1412;;; XEmacs compatibility functions
1385 1413
1386;; In XEmacs, when you reset a Custom Theme, you have to specify the 1414;; In XEmacs, when you reset a Custom Theme, you have to specify the
1387;; theme to reset it to. We just apply the next available theme, so 1415;; theme to reset it to. We just apply the next available theme, so
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 00e2ec802e2..540b93faad8 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -206,7 +206,8 @@ starting with or containing `no-'. If you set this variable to
206expanding `yes-or-no-' signals an error because `-' is not part of a word; 206expanding `yes-or-no-' signals an error because `-' is not part of a word;
207but expanding `yes-or-no' looks for a word starting with `no'. 207but expanding `yes-or-no' looks for a word starting with `no'.
208 208
209The recommended value is \"\\\\sw\\\\|\\\\s_\"." 209The recommended value is nil, which will make dabbrev default to
210using \"\\\\sw\\\\|\\\\s_\"."
210 :type '(choice (const nil) 211 :type '(choice (const nil)
211 regexp) 212 regexp)
212 :group 'dabbrev) 213 :group 'dabbrev)
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 8e4b3b5c6a6..3103fbd5a7f 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -56,9 +56,9 @@ into this list; they also should call `dired-log' to log the errors.")
56 "Compare file at point with file FILE using `diff'. 56 "Compare file at point with file FILE using `diff'.
57FILE defaults to the file at the mark. (That's the mark set by 57FILE defaults to the file at the mark. (That's the mark set by
58\\[set-mark-command], not by Dired's \\[dired-mark] command.) 58\\[set-mark-command], not by Dired's \\[dired-mark] command.)
59The prompted-for file is the first file given to `diff'. 59The prompted-for FILE is the first file given to `diff'.
60With prefix arg, prompt for second argument SWITCHES, 60With prefix arg, prompt for second argument SWITCHES,
61which is options for `diff'." 61which is the string of command switches for `diff'."
62 (interactive 62 (interactive
63 (let* ((current (dired-get-filename t)) 63 (let* ((current (dired-get-filename t))
64 ;; Get the file at the mark. 64 ;; Get the file at the mark.
@@ -514,22 +514,25 @@ to the end of the list of defaults just after the default value."
514 514
515;; This is an extra function so that you can redefine it, e.g., to use gmhist. 515;; This is an extra function so that you can redefine it, e.g., to use gmhist.
516(defun dired-read-shell-command (prompt arg files) 516(defun dired-read-shell-command (prompt arg files)
517 "Read a dired shell command prompting with PROMPT. 517 "Read a dired shell command.
518Passes the prefix argument ARG to `dired-mark-prompt', so that it 518PROMPT should be a format string with one \"%s\" format sequence,
519can be used in the prompt to indicate which FILES are affected. 519which is replaced by the value returned by `dired-mark-prompt',
520Normally reads the command with `read-shell-command', but if the 520with ARG and FILES as its arguments. FILES should be a list of
521`dired-x' packages is loaded, uses `dired-guess-shell-command' to offer 521file names. The result is used as the prompt.
522a smarter default choice of shell command." 522
523This normally reads using `read-shell-command', but if the
524`dired-x' package is loaded, use `dired-guess-shell-command' to
525offer a smarter default choice of shell command."
523 (minibuffer-with-setup-hook 526 (minibuffer-with-setup-hook
524 (lambda () 527 (lambda ()
525 (set (make-local-variable 'minibuffer-default-add-function) 528 (set (make-local-variable 'minibuffer-default-add-function)
526 'minibuffer-default-add-dired-shell-commands)) 529 'minibuffer-default-add-dired-shell-commands))
527 (setq prompt (format prompt (dired-mark-prompt arg files))) 530 (setq prompt (format prompt (dired-mark-prompt arg files)))
528 (if (featurep 'dired-x) 531 (if (functionp 'dired-guess-shell-command)
529 (dired-mark-pop-up nil 'shell files 532 (dired-mark-pop-up nil 'shell files
530 #'dired-guess-shell-command prompt files) 533 'dired-guess-shell-command prompt files)
531 (dired-mark-pop-up nil 'shell files 534 (dired-mark-pop-up nil 'shell files
532 #'read-shell-command prompt nil nil)))) 535 'read-shell-command prompt nil nil))))
533 536
534;;;###autoload 537;;;###autoload
535(defun dired-do-async-shell-command (command &optional arg file-list) 538(defun dired-do-async-shell-command (command &optional arg file-list)
@@ -699,6 +702,9 @@ can be produced by `dired-get-marked-files', for example."
699;; Commands that delete or redisplay part of the dired buffer. 702;; Commands that delete or redisplay part of the dired buffer.
700 703
701(defun dired-kill-line (&optional arg) 704(defun dired-kill-line (&optional arg)
705 "Kill the current line (not the files).
706With a prefix argument, kill that many lines starting with the current line.
707\(A negative argument kills backward.)"
702 (interactive "P") 708 (interactive "P")
703 (setq arg (prefix-numeric-value arg)) 709 (setq arg (prefix-numeric-value arg))
704 (let (buffer-read-only file) 710 (let (buffer-read-only file)
@@ -1008,7 +1014,7 @@ See Info node `(emacs)Subdir switches' for more details."
1008 (dired-uncache 1014 (dired-uncache
1009 (if (consp dired-directory) (car dired-directory) dired-directory)) 1015 (if (consp dired-directory) (car dired-directory) dired-directory))
1010 (dired-map-over-marks (let ((fname (dired-get-filename)) 1016 (dired-map-over-marks (let ((fname (dired-get-filename))
1011 ;; Postphone readin hook till we map 1017 ;; Postpone readin hook till we map
1012 ;; over all marked files (Bug#6810). 1018 ;; over all marked files (Bug#6810).
1013 (dired-after-readin-hook nil)) 1019 (dired-after-readin-hook nil))
1014 (message "Redisplaying... %s" fname) 1020 (message "Redisplaying... %s" fname)
@@ -2493,8 +2499,9 @@ with the command \\[tags-loop-continue]."
2493;;;###autoload 2499;;;###autoload
2494(defun dired-show-file-type (file &optional deref-symlinks) 2500(defun dired-show-file-type (file &optional deref-symlinks)
2495 "Print the type of FILE, according to the `file' command. 2501 "Print the type of FILE, according to the `file' command.
2496If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is 2502If you give a prefix to this command, and FILE is a symbolic
2497true then the type of the file linked to by FILE is printed instead." 2503link, then the type of the file linked to by FILE is printed
2504instead."
2498 (interactive (list (dired-get-filename t) current-prefix-arg)) 2505 (interactive (list (dired-get-filename t) current-prefix-arg))
2499 (let (process-file-side-effects) 2506 (let (process-file-side-effects)
2500 (with-temp-buffer 2507 (with-temp-buffer
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index ca89d07ea7f..0f2cfd4973f 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -1056,12 +1056,11 @@ You can set this variable in your ~/.emacs. For example, to add rules for
1056`.foo' and `.bar' files, write 1056`.foo' and `.bar' files, write
1057 1057
1058 \(setq dired-guess-shell-alist-user 1058 \(setq dired-guess-shell-alist-user
1059 (list (list \"\\\\.foo\\\\'\" \"FOO-COMMAND\");; fixed rule 1059 '((\"\\\\.foo\\\\'\" \"FOO-COMMAND\")
1060 ;; possibly more rules ... 1060 (\"\\\\.bar\\\\'\"
1061 (list \"\\\\.bar\\\\'\";; rule with condition test 1061 (if condition
1062 '(if condition 1062 \"BAR-COMMAND-1\"
1063 \"BAR-COMMAND-1\" 1063 \"BAR-COMMAND-2\"))))"
1064 \"BAR-COMMAND-2\")))\)"
1065 :group 'dired-x 1064 :group 'dired-x
1066 :type '(alist :key-type regexp :value-type (repeat sexp))) 1065 :type '(alist :key-type regexp :value-type (repeat sexp)))
1067 1066
@@ -1072,7 +1071,7 @@ You can set this variable in your ~/.emacs. For example, to add rules for
1072 :type 'boolean) 1071 :type 'boolean)
1073 1072
1074(defun dired-guess-default (files) 1073(defun dired-guess-default (files)
1075 "Guess a shell commands for FILES. Return command or list of commands. 1074 "Return a shell command, or a list of commands, appropriate for FILES.
1076See `dired-guess-shell-alist-user'." 1075See `dired-guess-shell-alist-user'."
1077 1076
1078 (let* ((case-fold-search dired-guess-shell-case-fold-search) 1077 (let* ((case-fold-search dired-guess-shell-case-fold-search)
@@ -1104,8 +1103,8 @@ See `dired-guess-shell-alist-user'."
1104 ;; Return commands or nil if flist is still non-nil. 1103 ;; Return commands or nil if flist is still non-nil.
1105 ;; Evaluate the commands in order that any logical testing will be done. 1104 ;; Evaluate the commands in order that any logical testing will be done.
1106 (if (cdr cmds) 1105 (if (cdr cmds)
1107 (mapcar #'eval cmds) 1106 (delete-dups (mapcar #'eval cmds))
1108 (eval (car cmds))))) ; single command 1107 (eval (car cmds))))) ; single command
1109 1108
1110(defun dired-guess-shell-command (prompt files) 1109(defun dired-guess-shell-command (prompt files)
1111 "Ask user with PROMPT for a shell command, guessing a default from FILES." 1110 "Ask user with PROMPT for a shell command, guessing a default from FILES."
@@ -1406,7 +1405,7 @@ Considers buffers closer to the car of `buffer-list' to be more recent."
1406 1405
1407(defun dired-mark-sexp (predicate &optional unflag-p) 1406(defun dired-mark-sexp (predicate &optional unflag-p)
1408 "Mark files for which PREDICATE returns non-nil. 1407 "Mark files for which PREDICATE returns non-nil.
1409With a prefix arg, unflag those files instead. 1408With a prefix arg, unmark or unflag those files instead.
1410 1409
1411PREDICATE is a lisp expression that can refer to the following symbols: 1410PREDICATE is a lisp expression that can refer to the following symbols:
1412 1411
diff --git a/lisp/dired.el b/lisp/dired.el
index 43b2170d13a..01d41bba27d 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -78,10 +78,22 @@ If nil, `dired-listing-switches' is used."
78 :type 'file) 78 :type 'file)
79 79
80(defcustom dired-use-ls-dired 'unspecified 80(defcustom dired-use-ls-dired 'unspecified
81 "Non-nil means Dired should use \"ls --dired\". 81 "Non-nil means Dired should pass the \"--dired\" option to \"ls\".
82The special value of `unspecified' means to check explicitly, and 82The special value of `unspecified' means to check explicitly, and
83save the result in this variable. This is performed the first 83save the result in this variable. This is performed the first
84time `dired-insert-directory' is called." 84time `dired-insert-directory' is called.
85
86Note that if you set this option to nil, either through choice or
87because your \"ls\" program does not support \"--dired\", Dired
88will fail to parse some \"unusual\" file names, e.g. those with leading
89spaces. You might want to install ls from GNU Coreutils, which does
90support this option. Alternatively, you might want to use Emacs's
91own emulation of \"ls\", by using:
92 \(setq ls-lisp-use-insert-directory-program nil)
93 \(require 'ls-lisp)
94This is used by default on MS Windows, which does not have an \"ls\" program.
95Note that `ls-lisp' does not support as many options as GNU ls, though.
96For more details, see Info node `(emacs)ls in Lisp'."
85 :group 'dired 97 :group 'dired
86 :type '(choice (const :tag "Check for --dired support" unspecified) 98 :type '(choice (const :tag "Check for --dired support" unspecified)
87 (const :tag "Do not use --dired" nil) 99 (const :tag "Do not use --dired" nil)
@@ -238,8 +250,6 @@ This is what the do-commands look for, and what the mark-commands store.")
238;; (> baud-rate search-slow-speed) 250;; (> baud-rate search-slow-speed)
239 "Non-nil means Dired shrinks the display buffer to fit the marked files.") 251 "Non-nil means Dired shrinks the display buffer to fit the marked files.")
240 252
241(defvar dired-flagging-regexp nil);; Last regexp used to flag files.
242
243(defvar dired-file-version-alist) 253(defvar dired-file-version-alist)
244 254
245;;;###autoload 255;;;###autoload
@@ -341,11 +351,11 @@ Subexpression 2 must end right before the \\n or \\r.")
341 351
342(defface dired-flagged 352(defface dired-flagged
343 '((t (:inherit font-lock-warning-face))) 353 '((t (:inherit font-lock-warning-face)))
344 "Face used for flagged files." 354 "Face used for files flagged for deletion."
345 :group 'dired-faces 355 :group 'dired-faces
346 :version "22.1") 356 :version "22.1")
347(defvar dired-flagged-face 'dired-flagged 357(defvar dired-flagged-face 'dired-flagged
348 "Face name used for flagged files.") 358 "Face name used for files flagged for deletion.")
349 359
350(defface dired-warning 360(defface dired-warning
351 ;; Inherit from font-lock-warning-face since with min-colors 8 361 ;; Inherit from font-lock-warning-face since with min-colors 8
@@ -485,7 +495,16 @@ Return value is the number of files marked, or nil if none were marked."
485 `(let ((inhibit-read-only t) count) 495 `(let ((inhibit-read-only t) count)
486 (save-excursion 496 (save-excursion
487 (setq count 0) 497 (setq count 0)
488 (if ,msg (message "Marking %ss..." ,msg)) 498 (when ,msg
499 (message "%s %ss%s..."
500 (cond ((eq dired-marker-char ?\040) "Unmarking")
501 ((eq dired-del-marker dired-marker-char)
502 "Flagging")
503 (t "Marking"))
504 ,msg
505 (if (eq dired-del-marker dired-marker-char)
506 " for deletion"
507 "")))
489 (goto-char (point-min)) 508 (goto-char (point-min))
490 (while (not (eobp)) 509 (while (not (eobp))
491 (if ,predicate 510 (if ,predicate
@@ -506,24 +525,31 @@ Return value is the number of files marked, or nil if none were marked."
506(defmacro dired-map-over-marks (body arg &optional show-progress 525(defmacro dired-map-over-marks (body arg &optional show-progress
507 distinguish-one-marked) 526 distinguish-one-marked)
508 "Eval BODY with point on each marked line. Return a list of BODY's results. 527 "Eval BODY with point on each marked line. Return a list of BODY's results.
509If no marked file could be found, execute BODY on the current line. 528If no marked file could be found, execute BODY on the current
510ARG, if non-nil, specifies the files to use instead of the marked files. 529line. ARG, if non-nil, specifies the files to use instead of the
511 If ARG is an integer, use the next ARG (or previous -ARG, if 530marked files.
512 ARG<0) files. In that case, point is dragged along. This is 531
513 so that commands on the next ARG (instead of the marked) files 532If ARG is an integer, use the next ARG (or previous -ARG, if
514 can be chained easily. 533ARG<0) files. In that case, point is dragged along. This is so
515 For any other non-nil value of ARG, use the current file. 534that commands on the next ARG (instead of the marked) files can
535be chained easily.
536For any other non-nil value of ARG, use the current file.
537
516If optional third arg SHOW-PROGRESS evaluates to non-nil, 538If optional third arg SHOW-PROGRESS evaluates to non-nil,
517 redisplay the dired buffer after each file is processed. 539redisplay the dired buffer after each file is processed.
518No guarantee is made about the position on the marked line. 540
519 BODY must ensure this itself if it depends on this. 541No guarantee is made about the position on the marked line. BODY
520Search starts at the beginning of the buffer, thus the car of the list 542must ensure this itself if it depends on this.
521 corresponds to the line nearest to the buffer's bottom. This 543
522 is also true for (positive and negative) integer values of ARG. 544Search starts at the beginning of the buffer, thus the car of the
545list corresponds to the line nearest to the buffer's bottom.
546This is also true for (positive and negative) integer values of
547ARG.
548
523BODY should not be too long as it is expanded four times. 549BODY should not be too long as it is expanded four times.
524 550
525If DISTINGUISH-ONE-MARKED is non-nil, then if we find just one marked file, 551If DISTINGUISH-ONE-MARKED is non-nil, then if we find just one
526return (t FILENAME) instead of (FILENAME)." 552marked file, return (t FILENAME) instead of (FILENAME)."
527 ;; 553 ;;
528 ;;Warning: BODY must not add new lines before point - this may cause an 554 ;;Warning: BODY must not add new lines before point - this may cause an
529 ;;endless loop. 555 ;;endless loop.
@@ -696,7 +722,6 @@ shell wildcards appended to select certain files). If DIRNAME is a cons,
696its first element is taken as the directory name and the rest as an explicit 722its first element is taken as the directory name and the rest as an explicit
697list of files to make directory entries for. 723list of files to make directory entries for.
698\\<dired-mode-map>\ 724\\<dired-mode-map>\
699You can move around in it with the usual commands.
700You can flag files for deletion with \\[dired-flag-file-deletion] and then 725You can flag files for deletion with \\[dired-flag-file-deletion] and then
701delete them by typing \\[dired-do-flagged-delete]. 726delete them by typing \\[dired-do-flagged-delete].
702Type \\[describe-mode] after entering Dired for more info. 727Type \\[describe-mode] after entering Dired for more info.
@@ -1106,9 +1131,13 @@ If HDR is non-nil, insert a header line with the directory name."
1106 (or (if (eq dired-use-ls-dired 'unspecified) 1131 (or (if (eq dired-use-ls-dired 'unspecified)
1107 ;; Check whether "ls --dired" gives exit code 0, and 1132 ;; Check whether "ls --dired" gives exit code 0, and
1108 ;; save the answer in `dired-use-ls-dired'. 1133 ;; save the answer in `dired-use-ls-dired'.
1109 (setq dired-use-ls-dired 1134 (or (setq dired-use-ls-dired
1110 (eq (call-process insert-directory-program nil nil nil "--dired") 1135 (eq 0 (call-process insert-directory-program
1111 0)) 1136 nil nil nil "--dired")))
1137 (progn
1138 (message "ls does not support --dired; \
1139see `dired-use-ls-dired' for more details.")
1140 nil))
1112 dired-use-ls-dired) 1141 dired-use-ls-dired)
1113 (file-remote-p dir))) 1142 (file-remote-p dir)))
1114 (setq switches (concat "--dired " switches))) 1143 (setq switches (concat "--dired " switches)))
@@ -1162,7 +1191,7 @@ If HDR is non-nil, insert a header line with the directory name."
1162 (insert " wildcard " (file-name-nondirectory dir) "\n"))))) 1191 (insert " wildcard " (file-name-nondirectory dir) "\n")))))
1163 1192
1164(defun dired-insert-set-properties (beg end) 1193(defun dired-insert-set-properties (beg end)
1165 "Make the file names highlight when the mouse is on them." 1194 "Add various text properties to the lines in the region."
1166 (save-excursion 1195 (save-excursion
1167 (goto-char beg) 1196 (goto-char beg)
1168 (while (< (point) end) 1197 (while (< (point) end)
@@ -1789,8 +1818,8 @@ In Dired, you are \"editing\" a list of the files in a directory and
1789 files for later commands or \"flag\" them for deletion, either file 1818 files for later commands or \"flag\" them for deletion, either file
1790 by file or all files matching certain criteria. 1819 by file or all files matching certain criteria.
1791You can move using the usual cursor motion commands.\\<dired-mode-map> 1820You can move using the usual cursor motion commands.\\<dired-mode-map>
1792Letters no longer insert themselves. Digits are prefix arguments. 1821The buffer is read-only. Digits are prefix arguments.
1793Instead, type \\[dired-flag-file-deletion] to flag a file for Deletion. 1822Type \\[dired-flag-file-deletion] to flag a file `D' for deletion.
1794Type \\[dired-mark] to Mark a file or subdirectory for later commands. 1823Type \\[dired-mark] to Mark a file or subdirectory for later commands.
1795 Most commands operate on the marked files and use the current file 1824 Most commands operate on the marked files and use the current file
1796 if no files are marked. Use a numeric prefix argument to operate on 1825 if no files are marked. Use a numeric prefix argument to operate on
@@ -1798,9 +1827,9 @@ Type \\[dired-mark] to Mark a file or subdirectory for later commands.
1798 to operate on the current file only. Prefix arguments override marks. 1827 to operate on the current file only. Prefix arguments override marks.
1799 Mark-using commands display a list of failures afterwards. Type \\[dired-summary] 1828 Mark-using commands display a list of failures afterwards. Type \\[dired-summary]
1800 to see why something went wrong. 1829 to see why something went wrong.
1801Type \\[dired-unmark] to Unmark a file or all files of a subdirectory. 1830Type \\[dired-unmark] to Unmark a file or all files of an inserted subdirectory.
1802Type \\[dired-unmark-backward] to back up one line and unflag. 1831Type \\[dired-unmark-backward] to back up one line and unmark or unflag.
1803Type \\[dired-do-flagged-delete] to eXecute the deletions requested. 1832Type \\[dired-do-flagged-delete] to delete (eXecute) the files flagged `D'.
1804Type \\[dired-find-file] to Find the current line's file 1833Type \\[dired-find-file] to Find the current line's file
1805 (or dired it in another buffer, if it is a directory). 1834 (or dired it in another buffer, if it is a directory).
1806Type \\[dired-find-file-other-window] to find file or dired directory in Other window. 1835Type \\[dired-find-file-other-window] to find file or dired directory in Other window.
@@ -1810,12 +1839,12 @@ Type \\[dired-do-copy] to Copy files.
1810Type \\[dired-sort-toggle-or-edit] to toggle Sorting by name/date or change the `ls' switches. 1839Type \\[dired-sort-toggle-or-edit] to toggle Sorting by name/date or change the `ls' switches.
1811Type \\[revert-buffer] to read all currently expanded directories aGain. 1840Type \\[revert-buffer] to read all currently expanded directories aGain.
1812 This retains all marks and hides subdirs again that were hidden before. 1841 This retains all marks and hides subdirs again that were hidden before.
1813SPC and DEL can be used to move down and up by lines. 1842Use `SPC' and `DEL' to move down and up by lines.
1814 1843
1815If Dired ever gets confused, you can either type \\[revert-buffer] \ 1844If Dired ever gets confused, you can either type \\[revert-buffer] \
1816to read the 1845to read the
1817directories again, type \\[dired-do-redisplay] \ 1846directories again, type \\[dired-do-redisplay] \
1818to relist a single or the marked files or a 1847to relist the file at point or the marked files or a
1819subdirectory, or type \\[dired-build-subdir-alist] to parse the buffer 1848subdirectory, or type \\[dired-build-subdir-alist] to parse the buffer
1820again for the directory tree. 1849again for the directory tree.
1821 1850
@@ -2818,8 +2847,12 @@ also offers to kill buffers visiting deleted files and directories."
2818 (if (= 1 count) "" "s")) 2847 (if (= 1 count) "" "s"))
2819 2848
2820(defun dired-mark-prompt (arg files) 2849(defun dired-mark-prompt (arg files)
2821 "Return a string for use in a prompt, either the current file 2850 "Return a string suitable for use in a Dired prompt.
2822name, or the marker and a count of marked files." 2851ARG is normally the prefix argument for the calling command.
2852FILES should be a list of file names.
2853
2854The return value has a form like \"foo.txt\", \"[next 3 files]\",
2855or \"* [3 files]\"."
2823 ;; distinguish-one-marked can cause the first element to be just t. 2856 ;; distinguish-one-marked can cause the first element to be just t.
2824 (if (eq (car files) t) (setq files (cdr files))) 2857 (if (eq (car files) t) (setq files (cdr files)))
2825 (let ((count (length files))) 2858 (let ((count (length files)))
@@ -3015,8 +3048,9 @@ If on a subdir headerline, mark all its files except `.' and `..'."
3015 (dired-mark arg))) 3048 (dired-mark arg)))
3016 3049
3017(defun dired-unmark-backward (arg) 3050(defun dired-unmark-backward (arg)
3018 "In Dired, move up lines and remove deletion flag there. 3051 "In Dired, move up lines and remove marks or deletion flags there.
3019Optional prefix ARG says how many lines to unflag; default is one line." 3052Optional prefix ARG says how many lines to unmark/unflag; default
3053is one line."
3020 (interactive "p") 3054 (interactive "p")
3021 (dired-unmark (- arg))) 3055 (dired-unmark (- arg)))
3022 3056
@@ -3110,14 +3144,14 @@ The match is against the non-directory part of the filename. Use `^'
3110 3144
3111(defun dired-mark-symlinks (unflag-p) 3145(defun dired-mark-symlinks (unflag-p)
3112 "Mark all symbolic links. 3146 "Mark all symbolic links.
3113With prefix argument, unflag all those files." 3147With prefix argument, unmark or unflag all those files."
3114 (interactive "P") 3148 (interactive "P")
3115 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char))) 3149 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
3116 (dired-mark-if (looking-at dired-re-sym) "symbolic link"))) 3150 (dired-mark-if (looking-at dired-re-sym) "symbolic link")))
3117 3151
3118(defun dired-mark-directories (unflag-p) 3152(defun dired-mark-directories (unflag-p)
3119 "Mark all directory file lines except `.' and `..'. 3153 "Mark all directory file lines except `.' and `..'.
3120With prefix argument, unflag all those files." 3154With prefix argument, unmark or unflag all those files."
3121 (interactive "P") 3155 (interactive "P")
3122 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char))) 3156 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
3123 (dired-mark-if (and (looking-at dired-re-dir) 3157 (dired-mark-if (and (looking-at dired-re-dir)
@@ -3126,7 +3160,7 @@ With prefix argument, unflag all those files."
3126 3160
3127(defun dired-mark-executables (unflag-p) 3161(defun dired-mark-executables (unflag-p)
3128 "Mark all executable files. 3162 "Mark all executable files.
3129With prefix argument, unflag all those files." 3163With prefix argument, unmark or unflag all those files."
3130 (interactive "P") 3164 (interactive "P")
3131 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char))) 3165 (let ((dired-marker-char (if unflag-p ?\040 dired-marker-char)))
3132 (dired-mark-if (looking-at dired-re-exe) "executable file"))) 3166 (dired-mark-if (looking-at dired-re-exe) "executable file")))
@@ -3136,7 +3170,7 @@ With prefix argument, unflag all those files."
3136 3170
3137(defun dired-flag-auto-save-files (&optional unflag-p) 3171(defun dired-flag-auto-save-files (&optional unflag-p)
3138 "Flag for deletion files whose names suggest they are auto save files. 3172 "Flag for deletion files whose names suggest they are auto save files.
3139A prefix argument says to unflag those files instead." 3173A prefix argument says to unmark or unflag those files instead."
3140 (interactive "P") 3174 (interactive "P")
3141 (let ((dired-marker-char (if unflag-p ?\040 dired-del-marker))) 3175 (let ((dired-marker-char (if unflag-p ?\040 dired-del-marker)))
3142 (dired-mark-if 3176 (dired-mark-if
@@ -3176,7 +3210,7 @@ A prefix argument says to unflag those files instead."
3176 3210
3177(defun dired-flag-backup-files (&optional unflag-p) 3211(defun dired-flag-backup-files (&optional unflag-p)
3178 "Flag all backup files (names ending with `~') for deletion. 3212 "Flag all backup files (names ending with `~') for deletion.
3179With prefix argument, unflag these files." 3213With prefix argument, unmark or unflag these files."
3180 (interactive "P") 3214 (interactive "P")
3181 (let ((dired-marker-char (if unflag-p ?\s dired-del-marker))) 3215 (let ((dired-marker-char (if unflag-p ?\s dired-del-marker)))
3182 (dired-mark-if 3216 (dired-mark-if
@@ -3629,16 +3663,16 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3629;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command 3663;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
3630;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown 3664;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
3631;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff 3665;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
3632;;;;;; dired-diff) "dired-aux" "dired-aux.el" "7efcfe4f9e0913ae4a87be014010c27f") 3666;;;;;; dired-diff) "dired-aux" "dired-aux.el" "ab62f310329f404f96a29e4f0ab8df73")
3633;;; Generated autoloads from dired-aux.el 3667;;; Generated autoloads from dired-aux.el
3634 3668
3635(autoload 'dired-diff "dired-aux" "\ 3669(autoload 'dired-diff "dired-aux" "\
3636Compare file at point with file FILE using `diff'. 3670Compare file at point with file FILE using `diff'.
3637FILE defaults to the file at the mark. (That's the mark set by 3671FILE defaults to the file at the mark. (That's the mark set by
3638\\[set-mark-command], not by Dired's \\[dired-mark] command.) 3672\\[set-mark-command], not by Dired's \\[dired-mark] command.)
3639The prompted-for file is the first file given to `diff'. 3673The prompted-for FILE is the first file given to `diff'.
3640With prefix arg, prompt for second argument SWITCHES, 3674With prefix arg, prompt for second argument SWITCHES,
3641which is options for `diff'. 3675which is the string of command switches for `diff'.
3642 3676
3643\(fn FILE &optional SWITCHES)" t nil) 3677\(fn FILE &optional SWITCHES)" t nil)
3644 3678
@@ -4081,15 +4115,16 @@ with the command \\[tags-loop-continue].
4081 4115
4082(autoload 'dired-show-file-type "dired-aux" "\ 4116(autoload 'dired-show-file-type "dired-aux" "\
4083Print the type of FILE, according to the `file' command. 4117Print the type of FILE, according to the `file' command.
4084If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is 4118If you give a prefix to this command, and FILE is a symbolic
4085true then the type of the file linked to by FILE is printed instead. 4119link, then the type of the file linked to by FILE is printed
4120instead.
4086 4121
4087\(fn FILE &optional DEREF-SYMLINKS)" t nil) 4122\(fn FILE &optional DEREF-SYMLINKS)" t nil)
4088 4123
4089;;;*** 4124;;;***
4090 4125
4091;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump) 4126;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump)
4092;;;;;; "dired-x" "dired-x.el" "cdeb2935dc1d33819b12981ba5272073") 4127;;;;;; "dired-x" "dired-x.el" "219648338c42c7912fa336680b434db0")
4093;;; Generated autoloads from dired-x.el 4128;;; Generated autoloads from dired-x.el
4094 4129
4095(autoload 'dired-jump "dired-x" "\ 4130(autoload 'dired-jump "dired-x" "\
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index 7a9043a6a0a..3befedac256 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -94,9 +94,27 @@ Valid symbols are `truncation', `wrap', `escape', `control',
94 (while (< i 256) 94 (while (< i 256)
95 (aset vector i (aref dt i)) 95 (aset vector i (aref dt i))
96 (setq i (1+ i))) 96 (setq i (1+ i)))
97 (describe-vector vector)) 97 (describe-vector
98 vector 'display-table-print-array))
98 (help-mode)))) 99 (help-mode))))
99 100
101(defun display-table-print-array (desc)
102 (insert "[")
103 (let ((column (current-column))
104 (width (window-width))
105 string)
106 (dotimes (i (length desc))
107 (setq string (format "%s" (aref desc i)))
108 (cond
109 ((>= (+ (current-column) (length string) 1)
110 width)
111 (insert "\n")
112 (insert (make-string column ? )))
113 ((> i 0)
114 (insert " ")))
115 (insert string)))
116 (insert "]\n"))
117
100;;;###autoload 118;;;###autoload
101(defun describe-current-display-table () 119(defun describe-current-display-table ()
102 "Describe the display table in use in the selected window and buffer." 120 "Describe the display table in use in the selected window and buffer."
diff --git a/lisp/dynamic-setting.el b/lisp/dynamic-setting.el
index 81531c4a21f..167da69d1ca 100644
--- a/lisp/dynamic-setting.el
+++ b/lisp/dynamic-setting.el
@@ -86,7 +86,9 @@ current form for the frame (i.e. hinting or somesuch changed)."
86Changes can be 86Changes can be
87 The monospace font. If `font-use-system-font' is nil, the font 87 The monospace font. If `font-use-system-font' is nil, the font
88 is not changed. 88 is not changed.
89 The normal font.
89 Xft parameters, like DPI and hinting. 90 Xft parameters, like DPI and hinting.
91 The Gtk+ theme name.
90 The tool bar style." 92 The tool bar style."
91 (interactive "e") 93 (interactive "e")
92 (let ((type (nth 1 event)) 94 (let ((type (nth 1 event))
diff --git a/lisp/emacs-lisp/benchmark.el b/lisp/emacs-lisp/benchmark.el
index 86063c512c6..aa84a075b76 100644
--- a/lisp/emacs-lisp/benchmark.el
+++ b/lisp/emacs-lisp/benchmark.el
@@ -39,9 +39,8 @@
39 (setq ,t1 (current-time)) 39 (setq ,t1 (current-time))
40 ,@forms 40 ,@forms
41 (setq ,t2 (current-time)) 41 (setq ,t2 (current-time))
42 (+ (* (- (car ,t2) (car ,t1)) 65536.0) 42 (float-time (time-subtract ,t2 ,t1)))))
43 (- (nth 1 ,t2) (nth 1 ,t1)) 43
44 (* (- (nth 2 ,t2) (nth 2 ,t1)) 1.0e-6)))))
45(put 'benchmark-elapse 'edebug-form-spec t) 44(put 'benchmark-elapse 'edebug-form-spec t)
46(put 'benchmark-elapse 'lisp-indent-function 0) 45(put 'benchmark-elapse 'lisp-indent-function 0)
47 46
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 2fa339e62fe..157749500e7 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -102,7 +102,7 @@ and `debugger-reenable' to temporarily disable debug-on-entry.")
102(setq debugger 'debug) 102(setq debugger 'debug)
103;;;###autoload 103;;;###autoload
104(defun debug (&rest debugger-args) 104(defun debug (&rest debugger-args)
105 "Enter debugger. To return, type \\<debugger-mode-map>`\\[debugger-continue]'. 105 "Enter debugger. \\<debugger-mode-map>`\\[debugger-continue]' returns from the debugger.
106Arguments are mainly for use when this is called from the internals 106Arguments are mainly for use when this is called from the internals
107of the evaluator. 107of the evaluator.
108 108
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 1db98ac39c8..4fda2bf1d52 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -253,8 +253,14 @@ No problems result if this variable is not bound.
253 `(let ((parent (char-table-parent ,syntax))) 253 `(let ((parent (char-table-parent ,syntax)))
254 (unless (and parent 254 (unless (and parent
255 (not (eq parent (standard-syntax-table)))) 255 (not (eq parent (standard-syntax-table))))
256 (set-char-table-parent ,syntax (syntax-table))))))) 256 (set-char-table-parent ,syntax (syntax-table)))))
257 257 ,(when declare-abbrev
258 `(unless (or (abbrev-table-get ,abbrev :parents)
259 ;; This can happen if the major mode defines
260 ;; the abbrev-table to be its parent's.
261 (eq ,abbrev local-abbrev-table))
262 (abbrev-table-put ,abbrev :parents
263 (list local-abbrev-table))))))
258 (use-local-map ,map) 264 (use-local-map ,map)
259 ,(when syntax `(set-syntax-table ,syntax)) 265 ,(when syntax `(set-syntax-table ,syntax))
260 ,(when abbrev `(setq local-abbrev-table ,abbrev)) 266 ,(when abbrev `(setq local-abbrev-table ,abbrev))
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index 73af3a5708f..b89b6decfc9 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -282,7 +282,7 @@ FUNSYM must be a symbol of a defined function."
282 ;; the function so that non-local exists are still recorded. TBD: 282 ;; the function so that non-local exists are still recorded. TBD:
283 ;; I haven't tested non-local exits at all, so no guarantees. 283 ;; I haven't tested non-local exits at all, so no guarantees.
284 ;; 284 ;;
285 ;; The 1st element is the total amount of time in usecs that have 285 ;; The 1st element is the total amount of time in seconds that has
286 ;; been spent inside this function. This number is added to on 286 ;; been spent inside this function. This number is added to on
287 ;; function exit. 287 ;; function exit.
288 ;; 288 ;;
@@ -424,9 +424,7 @@ Use optional LIST if provided instead."
424 424
425 425
426(defsubst elp-elapsed-time (start end) 426(defsubst elp-elapsed-time (start end)
427 (+ (* (- (car end) (car start)) 65536.0) 427 (float-time (time-subtract end start)))
428 (- (car (cdr end)) (car (cdr start)))
429 (/ (- (car (cdr (cdr end))) (car (cdr (cdr start)))) 1000000.0)))
430 428
431(defun elp-wrapper (funsym interactive-p args) 429(defun elp-wrapper (funsym interactive-p args)
432 "This function has been instrumented for profiling by the ELP. 430 "This function has been instrumented for profiling by the ELP.
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 9c4a3e9832c..0194af2e3a8 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -141,6 +141,15 @@ See the functions `find-function' and `find-variable'."
141 (dolist (suffix (get-load-suffixes) (nreverse suffixes)) 141 (dolist (suffix (get-load-suffixes) (nreverse suffixes))
142 (unless (string-match "elc" suffix) (push suffix suffixes))))) 142 (unless (string-match "elc" suffix) (push suffix suffixes)))))
143 143
144(defun find-library--load-name (library)
145 (let ((name library))
146 (dolist (dir load-path)
147 (let ((rel (file-relative-name library dir)))
148 (if (and (not (string-match "\\`\\.\\./" rel))
149 (< (length rel) (length name)))
150 (setq name rel))))
151 (unless (equal name library) name)))
152
144(defun find-library-name (library) 153(defun find-library-name (library)
145 "Return the absolute file name of the Emacs Lisp source of LIBRARY. 154 "Return the absolute file name of the Emacs Lisp source of LIBRARY.
146LIBRARY should be a string (the name of the library)." 155LIBRARY should be a string (the name of the library)."
@@ -148,13 +157,23 @@ LIBRARY should be a string (the name of the library)."
148 ;; the same name. 157 ;; the same name.
149 (if (string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library) 158 (if (string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library)
150 (setq library (replace-match "" t t library))) 159 (setq library (replace-match "" t t library)))
151 (or 160 (or
152 (locate-file library 161 (locate-file library
153 (or find-function-source-path load-path) 162 (or find-function-source-path load-path)
154 (find-library-suffixes)) 163 (find-library-suffixes))
155 (locate-file library 164 (locate-file library
156 (or find-function-source-path load-path) 165 (or find-function-source-path load-path)
157 load-file-rep-suffixes) 166 load-file-rep-suffixes)
167 (when (file-name-absolute-p library)
168 (let ((rel (find-library--load-name library)))
169 (when rel
170 (or
171 (locate-file rel
172 (or find-function-source-path load-path)
173 (find-library-suffixes))
174 (locate-file rel
175 (or find-function-source-path load-path)
176 load-file-rep-suffixes)))))
158 (error "Can't find library %s" library))) 177 (error "Can't find library %s" library)))
159 178
160(defvar find-function-C-source-directory 179(defvar find-function-C-source-directory
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 114e9755039..c8620aaa439 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -525,7 +525,6 @@ if that value is non-nil."
525 "Keymap for Lisp Interaction mode. 525 "Keymap for Lisp Interaction mode.
526All commands in `lisp-mode-shared-map' are inherited by this map.") 526All commands in `lisp-mode-shared-map' are inherited by this map.")
527 527
528(defvar lisp-interaction-mode-abbrev-table lisp-mode-abbrev-table)
529(define-derived-mode lisp-interaction-mode emacs-lisp-mode "Lisp Interaction" 528(define-derived-mode lisp-interaction-mode emacs-lisp-mode "Lisp Interaction"
530 "Major mode for typing and evaluating Lisp forms. 529 "Major mode for typing and evaluating Lisp forms.
531Like Lisp mode except that \\[eval-print-last-sexp] evals the Lisp expression 530Like Lisp mode except that \\[eval-print-last-sexp] evals the Lisp expression
@@ -790,25 +789,25 @@ Reinitialize the face according to the `defface' specification."
790 ;; `defface' is macroexpanded to `custom-declare-face'. 789 ;; `defface' is macroexpanded to `custom-declare-face'.
791 ((eq (car form) 'custom-declare-face) 790 ((eq (car form) 'custom-declare-face)
792 ;; Reset the face. 791 ;; Reset the face.
793 (setq face-new-frame-defaults 792 (let ((face-symbol (eval (nth 1 form) lexical-binding)))
794 (assq-delete-all (eval (nth 1 form) lexical-binding) 793 (setq face-new-frame-defaults
795 face-new-frame-defaults)) 794 (assq-delete-all face-symbol face-new-frame-defaults))
796 (put (eval (nth 1 form) lexical-binding) 'face-defface-spec nil) 795 (put face-symbol 'face-defface-spec nil)
797 ;; Setting `customized-face' to the new spec after calling 796 (put face-symbol 'face-documentation (nth 3 form))
798 ;; the form, but preserving the old saved spec in `saved-face', 797 ;; Setting `customized-face' to the new spec after calling
799 ;; imitates the situation when the new face spec is set 798 ;; the form, but preserving the old saved spec in `saved-face',
800 ;; temporarily for the current session in the customize 799 ;; imitates the situation when the new face spec is set
801 ;; buffer, thus allowing `face-user-default-spec' to use the 800 ;; temporarily for the current session in the customize
802 ;; new customized spec instead of the saved spec. 801 ;; buffer, thus allowing `face-user-default-spec' to use the
803 ;; Resetting `saved-face' temporarily to nil is needed to let 802 ;; new customized spec instead of the saved spec.
804 ;; `defface' change the spec, regardless of a saved spec. 803 ;; Resetting `saved-face' temporarily to nil is needed to let
805 (prog1 `(prog1 ,form 804 ;; `defface' change the spec, regardless of a saved spec.
806 (put ,(nth 1 form) 'saved-face 805 (prog1 `(prog1 ,form
807 ',(get (eval (nth 1 form) lexical-binding) 806 (put ,(nth 1 form) 'saved-face
808 'saved-face)) 807 ',(get face-symbol 'saved-face))
809 (put ,(nth 1 form) 'customized-face 808 (put ,(nth 1 form) 'customized-face
810 ,(nth 2 form))) 809 ,(nth 2 form)))
811 (put (eval (nth 1 form) lexical-binding) 'saved-face nil))) 810 (put face-symbol 'saved-face nil))))
812 ((eq (car form) 'progn) 811 ((eq (car form) 'progn)
813 (cons 'progn (mapcar 'eval-defun-1 (cdr form)))) 812 (cons 'progn (mapcar 'eval-defun-1 (cdr form))))
814 (t form))) 813 (t form)))
diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el
index 2f168180cf6..4c83e7e2e0d 100644
--- a/lisp/emacs-lisp/testcover.el
+++ b/lisp/emacs-lisp/testcover.el
@@ -28,7 +28,7 @@
28;; * Use `testcover-mark-all' to add overlay "splotches" to the Lisp file's 28;; * Use `testcover-mark-all' to add overlay "splotches" to the Lisp file's
29;; buffer to show where coverage is lacking. Normally, a red splotch 29;; buffer to show where coverage is lacking. Normally, a red splotch
30;; indicates the form was never evaluated; a brown splotch means it always 30;; indicates the form was never evaluated; a brown splotch means it always
31;; evaluted to the same value. 31;; evaluated to the same value.
32;; * Use `testcover-next-mark' (bind it to a key!) to jump to the next spot 32;; * Use `testcover-next-mark' (bind it to a key!) to jump to the next spot
33;; that has a splotch. 33;; that has a splotch.
34 34
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index 0a035175041..0e007ff7176 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -110,38 +110,16 @@ of SECS seconds since the epoch. SECS may be a fraction."
110(defun timer-relative-time (time secs &optional usecs) 110(defun timer-relative-time (time secs &optional usecs)
111 "Advance TIME by SECS seconds and optionally USECS microseconds. 111 "Advance TIME by SECS seconds and optionally USECS microseconds.
112SECS may be either an integer or a floating point number." 112SECS may be either an integer or a floating point number."
113 ;; FIXME: we should just use (time-add time (list 0 secs usecs)) 113 (let ((delta (if (floatp secs)
114 (let ((high (car time)) 114 (seconds-to-time secs)
115 (low (if (consp (cdr time)) (nth 1 time) (cdr time))) 115 (list (floor secs 65536) (mod secs 65536)))))
116 (micro (if (numberp (car-safe (cdr-safe (cdr time)))) 116 (if usecs
117 (nth 2 time) 117 (setq delta (time-add delta (list 0 0 usecs))))
118 0))) 118 (time-add time delta)))
119 ;; Add
120 (if usecs (setq micro (+ micro usecs)))
121 (if (floatp secs)
122 (setq micro (+ micro (floor (* 1000000 (- secs (floor secs)))))))
123 (setq low (+ low (floor secs)))
124
125 ;; Normalize
126 ;; `/' rounds towards zero while `mod' returns a positive number,
127 ;; so we can't rely on (= a (+ (* 100 (/ a 100)) (mod a 100))).
128 (setq low (+ low (/ micro 1000000) (if (< micro 0) -1 0)))
129 (setq micro (mod micro 1000000))
130 (setq high (+ high (/ low 65536) (if (< low 0) -1 0)))
131 (setq low (logand low 65535))
132
133 (list high low (and (/= micro 0) micro))))
134 119
135(defun timer--time-less-p (t1 t2) 120(defun timer--time-less-p (t1 t2)
136 "Say whether time value T1 is less than time value T2." 121 "Say whether time value T1 is less than time value T2."
137 ;; FIXME just use time-less-p. 122 (time-less-p (timer--time t1) (timer--time t2)))
138 (destructuring-bind (high1 low1 micro1) (timer--time t1)
139 (destructuring-bind (high2 low2 micro2) (timer--time t2)
140 (or (< high1 high2)
141 (and (= high1 high2)
142 (or (< low1 low2)
143 (and (= low1 low2)
144 (< micro1 micro2))))))))
145 123
146(defun timer-inc-time (timer secs &optional usecs) 124(defun timer-inc-time (timer secs &optional usecs)
147 "Increment the time set in TIMER by SECS seconds and USECS microseconds. 125 "Increment the time set in TIMER by SECS seconds and USECS microseconds.
@@ -273,10 +251,7 @@ how many will really happen.")
273 "Calculate number of seconds from when TIMER will run, until TIME. 251 "Calculate number of seconds from when TIMER will run, until TIME.
274TIMER is a timer, and stands for the time when its next repeat is scheduled. 252TIMER is a timer, and stands for the time when its next repeat is scheduled.
275TIME is a time-list." 253TIME is a time-list."
276 ;; FIXME: (float-time (time-subtract (timer--time timer) time)) 254 (float-time (time-subtract time (timer--time timer))))
277 (let ((high (- (car time) (timer--high-seconds timer)))
278 (low (- (nth 1 time) (timer--low-seconds timer))))
279 (+ low (* high 65536))))
280 255
281(defun timer-event-handler (timer) 256(defun timer-event-handler (timer)
282 "Call the handler for the timer TIMER. 257 "Call the handler for the timer TIMER.
diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el
index 1553aeae0d5..18411f7d2ef 100644
--- a/lisp/emacs-lock.el
+++ b/lisp/emacs-lock.el
@@ -1,9 +1,10 @@
1;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked 1;;; emacs-lock.el --- protect buffers against killing or exiting -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1994, 1997, 2001-2011 Free Software Foundation, Inc 3;; Copyright (C) 2011 Free Software Foundation, Inc
4 4
5;; Author: Tom Wurgler <twurgler@goodyear.com> 5;; Author: Juanma Barranquero <lekktu@gmail.com>
6;; Created: 12/8/94 6;; Inspired by emacs-lock.el by Tom Wurgler <twurgler@goodyear.com>
7;; Maintainer: FSF
7;; Keywords: extensions, processes 8;; Keywords: extensions, processes
8 9
9;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -23,78 +24,220 @@
23 24
24;;; Commentary: 25;;; Commentary:
25 26
26;; This code sets a buffer-local variable to t if toggle-emacs-lock is run, 27;; This package defines a minor mode Emacs Lock to mark a buffer as
27;; then if the user attempts to exit Emacs, the locked buffer name will be 28;; protected against accidental killing, or exiting Emacs, or both.
28;; displayed and the exit aborted. This is just a way of protecting 29;; Buffers associated with inferior modes, like shell or telnet, can
29;; yourself from yourself. For example, if you have a shell running a big 30;; be treated specially, by auto-unlocking them if their interior
30;; program and exiting Emacs would abort that program, you may want to lock 31;; processes are dead.
31;; that buffer, then if you forget about it after a while, you won't
32;; accidentally exit Emacs. To unlock the buffer, just goto the buffer and
33;; run toggle-emacs-lock again.
34 32
35;;; Code: 33;;; Code:
36 34
37(defvar emacs-lock-from-exiting nil 35(defgroup emacs-lock nil
38 "Whether Emacs is locked to prevent exiting. See `check-emacs-lock'.") 36 "Emacs-Lock mode."
39(make-variable-buffer-local 'emacs-lock-from-exiting) 37 :version "24.1"
40 38 :group 'convenience)
41(defvar emacs-lock-buffer-locked nil 39
42 "Whether a shell or telnet buffer was locked when its process was killed.") 40(defcustom emacs-lock-default-locking-mode 'all
43(make-variable-buffer-local 'emacs-lock-buffer-locked) 41 "Default locking mode of Emacs-Locked buffers.
44(put 'emacs-lock-buffer-locked 'permanent-local t) 42
43Its value is used as the default for `emacs-lock-mode' (which
44see) the first time that Emacs Lock mode is turned on in a buffer
45without passing an explicit locking mode.
46
47Possible values are:
48 exit -- Emacs cannot exit while the buffer is locked
49 kill -- the buffer cannot be killed, but Emacs can exit as usual
50 all -- the buffer is locked against both actions
51 nil -- the buffer is not locked"
52 :type '(choice
53 (const :tag "Do not allow Emacs to exit" exit)
54 (const :tag "Do not allow killing the buffer" kill)
55 (const :tag "Do not allow killing the buffer or exiting Emacs" all)
56 (const :tag "Do not lock the buffer" nil))
57 :group 'emacs-lock
58 :version "24.1")
59
60;; Note: as auto-unlocking can lead to data loss, it would be better
61;; to default to nil; but the value below is for compatibility with
62;; the old emacs-lock.el.
63(defcustom emacs-lock-unlockable-modes '((shell-mode . all)
64 (telnet-mode . all))
65 "Alist of auto-unlockable modes.
66Each element is a pair (MAJOR-MODE . ACTION), where ACTION is
67one of `kill', `exit' or `all'. Buffers with matching major
68modes are auto-unlocked for the specific action if their
69inferior processes are not alive. If this variable is t, all
70buffers associated to inferior processes are auto-unlockable
71for both actions (NOT RECOMMENDED)."
72 :type '(choice
73 (const :tag "All buffers with inferior processes" t)
74 (repeat :tag "Selected modes"
75 (cons :tag "Set auto-unlock for"
76 (symbol :tag "Major mode")
77 (radio
78 (const :tag "Allow exiting" exit)
79 (const :tag "Allow killing" kill)
80 (const :tag "Allow both" all)))))
81 :group 'emacs-lock
82 :version "24.1")
83
84(defvar emacs-lock-mode nil
85 "If non-nil, the current buffer is locked.
86It can be one of the following values:
87 exit -- Emacs cannot exit while the buffer is locked
88 kill -- the buffer cannot be killed, but Emacs can exit as usual
89 all -- the buffer is locked against both actions
90 nil -- the buffer is not locked")
91(make-variable-buffer-local 'emacs-lock-mode)
92(put 'emacs-lock-mode 'permanent-local t)
93
94(defvar emacs-lock--old-mode nil
95 "Most recent locking mode set on the buffer.
96Internal use only.")
97(make-variable-buffer-local 'emacs-lock--old-mode)
98(put 'emacs-lock--old-mode 'permanent-local t)
99
100(defvar emacs-lock--try-unlocking nil
101 "Non-nil if current buffer should be checked for auto-unlocking.
102Internal use only.")
103(make-variable-buffer-local 'emacs-lock--try-unlocking)
104(put 'emacs-lock--try-unlocking 'permanent-local t)
105
106(defun emacs-lock-live-process-p (buffer-or-name)
107 "Return t if BUFFER-OR-NAME is associated with a live process."
108 (let ((proc (get-buffer-process buffer-or-name)))
109 (and proc (process-live-p proc))))
110
111(defun emacs-lock--can-auto-unlock (action)
112 "Return t if the current buffer can auto-unlock for ACTION.
113ACTION must be one of `kill' or `exit'.
114See `emacs-lock-unlockable-modes'."
115 (and emacs-lock--try-unlocking
116 (not (emacs-lock-live-process-p (current-buffer)))
117 (or (eq emacs-lock-unlockable-modes t)
118 (let ((unlock (cdr (assq major-mode emacs-lock-unlockable-modes))))
119 (or (eq unlock 'all) (eq unlock action))))))
120
121(defun emacs-lock--exit-locked-buffer ()
122 "Return the name of the first exit-locked buffer found."
123 (save-current-buffer
124 (catch :found
125 (dolist (buffer (buffer-list))
126 (set-buffer buffer)
127 (unless (or (emacs-lock--can-auto-unlock 'exit)
128 (memq emacs-lock-mode '(nil kill)))
129 (throw :found (buffer-name))))
130 nil)))
131
132(defun emacs-lock--kill-emacs-hook ()
133 "Signal an error if any buffer is exit-locked.
134Used from `kill-emacs-hook' (which see)."
135 (let ((buffer-name (emacs-lock--exit-locked-buffer)))
136 (when buffer-name
137 (error "Emacs cannot exit because buffer %S is locked" buffer-name))))
138
139(defun emacs-lock--kill-emacs-query-functions ()
140 "Display a message if any buffer is exit-locked.
141Return a value appropriate for `kill-emacs-query-functions' (which see)."
142 (let ((locked (emacs-lock--exit-locked-buffer)))
143 (or (not locked)
144 (progn
145 (message "Emacs cannot exit because buffer %S is locked" locked)
146 nil))))
147
148(defun emacs-lock--kill-buffer-query-functions ()
149 "Display a message if the current buffer is kill-locked.
150Return a value appropriate for `kill-buffer-query-functions' (which see)."
151 (or (emacs-lock--can-auto-unlock 'kill)
152 (memq emacs-lock-mode '(nil exit))
153 (progn
154 (message "Buffer %S is locked and cannot be killed" (buffer-name))
155 nil)))
156
157(defun emacs-lock--set-mode (mode arg)
158 "Setter function for `emacs-lock-mode'."
159 (setq emacs-lock-mode
160 (cond ((memq arg '(all exit kill))
161 ;; explicit locking mode arg, use it
162 arg)
163 ((and (eq arg current-prefix-arg) (consp current-prefix-arg))
164 ;; called with C-u M-x emacs-lock-mode, so ask the user
165 (intern (completing-read "Locking mode: "
166 '("all" "exit" "kill")
167 nil t nil nil
168 (symbol-name
169 emacs-lock-default-locking-mode))))
170 ((eq mode t)
171 ;; turn on, so use previous setting, or customized default
172 (or emacs-lock--old-mode emacs-lock-default-locking-mode))
173 (t
174 ;; anything else (turn off)
175 mode))))
176
177;;;###autoload
178(define-minor-mode emacs-lock-mode
179 "Toggle Emacs Lock mode in the current buffer.
180
181With \\[universal-argument], ask for the locking mode to be used.
182With other prefix ARG, turn mode on if ARG is positive, off otherwise.
183
184Initially, if the user does not pass an explicit locking mode, it defaults
185to `emacs-lock-default-locking-mode' (which see); afterwards, the locking
186mode most recently set on the buffer is used instead.
187
188When called from Elisp code, ARG can be any locking mode:
189
190 exit -- Emacs cannot exit while the buffer is locked
191 kill -- the buffer cannot be killed, but Emacs can exit as usual
192 all -- the buffer is locked against both actions
193
194Other values are interpreted as usual."
195 :init-value nil
196 :lighter (""
197 (emacs-lock--try-unlocking " locked:" " Locked:")
198 (:eval (symbol-name emacs-lock-mode)))
199 :group 'emacs-lock
200 :variable (emacs-lock-mode .
201 (lambda (mode)
202 (emacs-lock--set-mode mode arg)))
203 (when emacs-lock-mode
204 (setq emacs-lock--old-mode emacs-lock-mode)
205 (setq emacs-lock--try-unlocking
206 (and (if (eq emacs-lock-unlockable-modes t)
207 (emacs-lock-live-process-p (current-buffer))
208 (assq major-mode emacs-lock-unlockable-modes))
209 t))))
45 210
46(defun check-emacs-lock () 211(unless noninteractive
47 "Check if variable `emacs-lock-from-exiting' is t for any buffer. 212 (add-hook 'kill-buffer-query-functions 'emacs-lock--kill-buffer-query-functions)
48If any locked buffer is found, signal error and display the buffer's name." 213 ;; We set a hook in both kill-emacs-hook and kill-emacs-query-functions because
49 (save-excursion 214 ;; we really want to use k-e-q-f to stop as soon as possible, but don't want to
215 ;; be caught by surprise if someone calls `kill-emacs' instead.
216 (add-hook 'kill-emacs-hook 'emacs-lock--kill-emacs-hook)
217 (add-hook 'kill-emacs-query-functions 'emacs-lock--kill-emacs-query-functions))
218
219(defun emacs-lock-unload-function ()
220 "Unload the Emacs Lock library."
221 (catch :continue
50 (dolist (buffer (buffer-list)) 222 (dolist (buffer (buffer-list))
51 (set-buffer buffer) 223 (set-buffer buffer)
52 (when emacs-lock-from-exiting 224 (when emacs-lock-mode
53 (error "Emacs is locked from exit due to buffer: %s" (buffer-name)))))) 225 (if (y-or-n-p (format "Buffer %S is locked, unlock it? " (buffer-name)))
226 (emacs-lock-mode -1)
227 (message "Unloading of feature `emacs-lock' aborted.")
228 (throw :continue t))))
229 ;; continue standard unloading
230 nil))
54 231
55(defun toggle-emacs-lock () 232;;; Compatibility
56 "Toggle `emacs-lock-from-exiting' for the current buffer.
57See `check-emacs-lock'."
58 (interactive)
59 (setq emacs-lock-from-exiting (not emacs-lock-from-exiting))
60 (if emacs-lock-from-exiting
61 (message "Buffer is now locked")
62 (message "Buffer is now unlocked")))
63
64(defun emacs-lock-check-buffer-lock ()
65 "Check if variable `emacs-lock-from-exiting' is t for a buffer.
66If the buffer is locked, signal error and display its name."
67 (when emacs-lock-from-exiting
68 (error "Buffer `%s' is locked, can't delete it" (buffer-name))))
69
70; These next defuns make it so if you exit a shell that is locked, the lock
71; is shut off for that shell so you can exit Emacs. Same for telnet.
72; Also, if a shell or a telnet buffer was locked and the process killed,
73; turn the lock back on again if the process is restarted.
74
75(defun emacs-lock-shell-sentinel ()
76 (set-process-sentinel
77 (get-buffer-process (buffer-name)) (function emacs-lock-clear-sentinel)))
78
79(defun emacs-lock-clear-sentinel (_proc _str)
80 (if emacs-lock-from-exiting
81 (progn
82 (setq emacs-lock-from-exiting nil)
83 (setq emacs-lock-buffer-locked t)
84 (message "Buffer is now unlocked"))
85 (setq emacs-lock-buffer-locked nil)))
86 233
87(defun emacs-lock-was-buffer-locked () 234(define-obsolete-variable-alias 'emacs-lock-from-exiting 'emacs-lock-mode "24.1")
88 (if emacs-lock-buffer-locked
89 (setq emacs-lock-from-exiting t)))
90 235
91(unless noninteractive 236(defun toggle-emacs-lock ()
92 (add-hook 'kill-emacs-hook 'check-emacs-lock)) 237 "Toggle `emacs-lock-from-exiting' for the current buffer."
93(add-hook 'kill-buffer-hook 'emacs-lock-check-buffer-lock) 238 (interactive)
94(add-hook 'shell-mode-hook 'emacs-lock-was-buffer-locked) 239 (call-interactively 'emacs-lock-mode))
95(add-hook 'shell-mode-hook 'emacs-lock-shell-sentinel) 240(make-obsolete 'toggle-emacs-lock 'emacs-lock-mode "24.1")
96(add-hook 'telnet-mode-hook 'emacs-lock-was-buffer-locked)
97(add-hook 'telnet-mode-hook 'emacs-lock-shell-sentinel)
98 241
99(provide 'emacs-lock) 242(provide 'emacs-lock)
100 243
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index f06428d81eb..9d0eb6c0d14 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -617,7 +617,10 @@
617 (or (viper-overlay-p viper-replace-overlay) 617 (or (viper-overlay-p viper-replace-overlay)
618 (viper-set-replace-overlay (point-min) (point-min))) 618 (viper-set-replace-overlay (point-min) (point-min)))
619 (viper-hide-replace-overlay) 619 (viper-hide-replace-overlay)
620 (if abbrev-mode (expand-abbrev)) 620 ;; Expand abbrevs iff the previous character has word syntax.
621 (and abbrev-mode
622 (eq (char-syntax (preceding-char)) ?w)
623 (expand-abbrev))
621 (if (and auto-fill-function (> (current-column) fill-column)) 624 (if (and auto-fill-function (> (current-column) fill-column))
622 (funcall auto-fill-function)) 625 (funcall auto-fill-function))
623 ;; don't leave whitespace lines around 626 ;; don't leave whitespace lines around
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 3d9b0c8646f..1560f2a9049 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,8 @@
12011-07-04 Vivek Dasmohapatra <vivek@etla.org>
2
3 * erc.el (erc-generate-new-buffer-name): Reuse old buffer names
4 when reconnecting (bug#5563).
5
12011-06-23 Lars Magne Ingebrigtsen <larsi@gnus.org> 62011-06-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 7
3 * erc.el (erc-ssl): Made into a synonym for erc-tls, which 8 * erc.el (erc-ssl): Made into a synonym for erc-tls, which
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 36097cf0c12..a4040b239c1 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1555,26 +1555,33 @@ symbol, it may have these values:
1555(defun erc-generate-new-buffer-name (server port target &optional proc) 1555(defun erc-generate-new-buffer-name (server port target &optional proc)
1556 "Create a new buffer name based on the arguments." 1556 "Create a new buffer name based on the arguments."
1557 (when (numberp port) (setq port (number-to-string port))) 1557 (when (numberp port) (setq port (number-to-string port)))
1558 (let* ((buf-name (or target 1558 (let ((buf-name (or target
1559 (or (let ((name (concat server ":" port))) 1559 (or (let ((name (concat server ":" port)))
1560 (when (> (length name) 1) 1560 (when (> (length name) 1)
1561 name)) 1561 name))
1562 ; This fallback should in fact never happen 1562 ;; This fallback should in fact never happen
1563 "*erc-server-buffer*")))) 1563 "*erc-server-buffer*")))
1564 buffer-name)
1564 ;; Reuse existing buffers, but not if the buffer is a connected server 1565 ;; Reuse existing buffers, but not if the buffer is a connected server
1565 ;; buffer and not if its associated with a different server than the 1566 ;; buffer and not if its associated with a different server than the
1566 ;; current ERC buffer. 1567 ;; current ERC buffer.
1567 (if (and erc-reuse-buffers 1568 ;; if buf-name is taken by a different connection (or by something !erc)
1568 (get-buffer buf-name) 1569 ;; then see if "buf-name/server" meets the same criteria
1569 (or target 1570 (dolist (candidate (list buf-name (concat buf-name "/" server)))
1570 (with-current-buffer (get-buffer buf-name) 1571 (if (and (not buffer-name)
1571 (and (erc-server-buffer-p) 1572 erc-reuse-buffers
1572 (not (erc-server-process-alive))))) 1573 (get-buffer candidate)
1573 (with-current-buffer (get-buffer buf-name) 1574 (or target
1574 (and (string= erc-session-server server) 1575 (with-current-buffer (get-buffer candidate)
1575 (erc-port-equal erc-session-port port)))) 1576 (and (erc-server-buffer-p)
1576 buf-name 1577 (not (erc-server-process-alive)))))
1577 (generate-new-buffer-name buf-name)))) 1578 (with-current-buffer (get-buffer candidate)
1579 (and (string= erc-session-server server)
1580 (erc-port-equal erc-session-port port))))
1581 (setq buffer-name candidate)))
1582 ;; if buffer-name is unset, neither candidate worked out for us,
1583 ;; fallback to the old <N> uniquification method:
1584 (or buffer-name (generate-new-buffer-name buf-name)) ))
1578 1585
1579(defun erc-get-buffer-create (server port target &optional proc) 1586(defun erc-get-buffer-create (server port target &optional proc)
1580 "Create a new buffer based on the arguments." 1587 "Create a new buffer based on the arguments."
@@ -2362,7 +2369,7 @@ If STRING is nil, the function does nothing."
2362 (cond ((integerp elt) ; POSITION 2369 (cond ((integerp elt) ; POSITION
2363 (incf (car list) shift)) 2370 (incf (car list) shift))
2364 ((or (atom elt) ; nil, EXTENT 2371 ((or (atom elt) ; nil, EXTENT
2365 ;; (eq t (car elt)) ; (t HIGH . LOW) 2372 ;; (eq t (car elt)) ; (t . TIME)
2366 (markerp (car elt))) ; (MARKER . DISTANCE) 2373 (markerp (car elt))) ; (MARKER . DISTANCE)
2367 nil) 2374 nil)
2368 ((integerp (car elt)) ; (BEGIN . END) 2375 ((integerp (car elt)) ; (BEGIN . END)
@@ -6493,4 +6500,3 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL."
6493;; indent-tabs-mode: t 6500;; indent-tabs-mode: t
6494;; tab-width: 8 6501;; tab-width: 8
6495;; End: 6502;; End:
6496
diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el
index f08fec8f8fa..259072d9750 100644
--- a/lisp/eshell/em-smart.el
+++ b/lisp/eshell/em-smart.el
@@ -120,6 +120,7 @@ only if that output can be presented in its entirely in the Eshell window."
120(defcustom eshell-smart-display-navigate-list 120(defcustom eshell-smart-display-navigate-list
121 '(insert-parentheses 121 '(insert-parentheses
122 mouse-yank-at-click 122 mouse-yank-at-click
123 mouse-yank-primary
123 mouse-yank-secondary 124 mouse-yank-secondary
124 yank-pop 125 yank-pop
125 yank-rectangle 126 yank-rectangle
diff --git a/lisp/faces.el b/lisp/faces.el
index c29d8c9bfd8..302f8af35ac 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1821,109 +1821,6 @@ Return nil if it has no specified face."
1821 (cond ((memq 'background-color face) (cdr (memq 'background-color face))) 1821 (cond ((memq 'background-color face) (cdr (memq 'background-color face)))
1822 ((memq ':background face) (cadr (memq ':background face))))) 1822 ((memq ':background face) (cadr (memq ':background face)))))
1823 (t nil)))) ; Invalid face value. 1823 (t nil)))) ; Invalid face value.
1824
1825;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1826;;; Background mode.
1827;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1828
1829(defcustom frame-background-mode nil
1830 "The brightness of the background.
1831Set this to the symbol `dark' if your background color is dark,
1832`light' if your background is light, or nil (automatic by default)
1833if you want Emacs to examine the brightness for you. Don't set this
1834variable with `setq'; this won't have the expected effect."
1835 :group 'faces
1836 :set #'(lambda (var value)
1837 (set-default var value)
1838 (mapc 'frame-set-background-mode (frame-list)))
1839 :initialize 'custom-initialize-changed
1840 :type '(choice (const dark)
1841 (const light)
1842 (const :tag "automatic" nil)))
1843
1844
1845(declare-function x-get-resource "frame.c"
1846 (attribute class &optional component subclass))
1847
1848(defvar inhibit-frame-set-background-mode nil)
1849
1850(defun frame-set-background-mode (frame &optional keep-face-specs)
1851 "Set up display-dependent faces on FRAME.
1852Display-dependent faces are those which have different definitions
1853according to the `background-mode' and `display-type' frame parameters.
1854
1855If optional arg KEEP-FACE-SPECS is non-nil, don't recalculate
1856face specs for the new background mode."
1857 (unless inhibit-frame-set-background-mode
1858 (let* ((bg-resource
1859 (and (window-system frame)
1860 (x-get-resource "backgroundMode" "BackgroundMode")))
1861 (bg-color (frame-parameter frame 'background-color))
1862 (terminal-bg-mode (terminal-parameter frame 'background-mode))
1863 (tty-type (tty-type frame))
1864 (default-bg-mode
1865 (if (or (window-system frame)
1866 (and tty-type
1867 (string-match "^\\(xterm\\|\\rxvt\\|dtterm\\|eterm\\)"
1868 tty-type)))
1869 'light
1870 'dark))
1871 (non-default-bg-mode (if (eq default-bg-mode 'light) 'dark 'light))
1872 (bg-mode
1873 (cond (frame-background-mode)
1874 (bg-resource (intern (downcase bg-resource)))
1875 (terminal-bg-mode)
1876 ((equal bg-color "unspecified-fg") ; inverted colors
1877 non-default-bg-mode)
1878 ((not (color-values bg-color frame))
1879 default-bg-mode)
1880 ((>= (apply '+ (color-values bg-color frame))
1881 ;; Just looking at the screen, colors whose
1882 ;; values add up to .6 of the white total
1883 ;; still look dark to me.
1884 (* (apply '+ (color-values "white" frame)) .6))
1885 'light)
1886 (t 'dark)))
1887 (display-type
1888 (cond ((null (window-system frame))
1889 (if (tty-display-color-p frame) 'color 'mono))
1890 ((display-color-p frame)
1891 'color)
1892 ((x-display-grayscale-p frame)
1893 'grayscale)
1894 (t 'mono)))
1895 (old-bg-mode
1896 (frame-parameter frame 'background-mode))
1897 (old-display-type
1898 (frame-parameter frame 'display-type)))
1899
1900 (unless (and (eq bg-mode old-bg-mode) (eq display-type old-display-type))
1901 (let ((locally-modified-faces nil)
1902 ;; Prevent face-spec-recalc from calling this function
1903 ;; again, resulting in a loop (bug#911).
1904 (inhibit-frame-set-background-mode t)
1905 (params (list (cons 'background-mode bg-mode)
1906 (cons 'display-type display-type))))
1907 (if keep-face-specs
1908 (modify-frame-parameters frame params)
1909 ;; If we are recomputing face specs, first collect a list
1910 ;; of faces that don't match their face-specs. These are
1911 ;; the faces modified on FRAME, and we avoid changing them
1912 ;; below. Use a negative list to avoid consing (we assume
1913 ;; most faces are unmodified).
1914 (dolist (face (face-list))
1915 (and (not (get face 'face-override-spec))
1916 (not (face-spec-match-p face
1917 (face-user-default-spec face)
1918 (selected-frame)))
1919 (push face locally-modified-faces)))
1920 ;; Now change to the new frame parameters
1921 (modify-frame-parameters frame params)
1922 ;; For all unmodified named faces, choose face specs
1923 ;; matching the new frame parameters.
1924 (dolist (face (face-list))
1925 (unless (memq face locally-modified-faces)
1926 (face-spec-recalc face frame)))))))))
1927 1824
1928 1825
1929;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1826;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2020,7 +1917,8 @@ settings, X resources, and `face-new-frame-defaults'.
2020Finally, apply any relevant face attributes found amongst the 1917Finally, apply any relevant face attributes found amongst the
2021frame parameters in PARAMETERS." 1918frame parameters in PARAMETERS."
2022 (let ((window-system-p (memq (window-system frame) '(x w32)))) 1919 (let ((window-system-p (memq (window-system frame) '(x w32))))
2023 (dolist (face (nreverse (face-list))) ;Why reverse? --Stef 1920 ;; The `reverse' is so that `default' goes first.
1921 (dolist (face (nreverse (face-list)))
2024 (condition-case () 1922 (condition-case ()
2025 (progn 1923 (progn
2026 ;; Initialize faces from face spec and custom theme. 1924 ;; Initialize faces from face spec and custom theme.
@@ -2211,7 +2109,7 @@ terminal type to a different value."
2211 2109
2212(defface link 2110(defface link
2213 '((((class color) (min-colors 88) (background light)) 2111 '((((class color) (min-colors 88) (background light))
2214 :foreground "blue1" :underline t) 2112 :foreground "RoyalBlue3" :underline t)
2215 (((class color) (background light)) 2113 (((class color) (background light))
2216 :foreground "blue" :underline t) 2114 :foreground "blue" :underline t)
2217 (((class color) (min-colors 88) (background dark)) 2115 (((class color) (min-colors 88) (background dark))
diff --git a/lisp/files.el b/lisp/files.el
index 7b97b730111..0b253fcc297 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1341,8 +1341,8 @@ automatically choosing a major mode, use \\[find-file-literally]."
1341 (confirm-nonexistent-file-or-buffer))) 1341 (confirm-nonexistent-file-or-buffer)))
1342 (let ((value (find-file-noselect filename nil nil wildcards))) 1342 (let ((value (find-file-noselect filename nil nil wildcards)))
1343 (if (listp value) 1343 (if (listp value)
1344 (mapcar 'switch-to-buffer (nreverse value)) 1344 (mapcar #'pop-to-buffer-same-window (nreverse value))
1345 (switch-to-buffer value)))) 1345 (pop-to-buffer-same-window value))))
1346 1346
1347(defun find-file-other-window (filename &optional wildcards) 1347(defun find-file-other-window (filename &optional wildcards)
1348 "Edit file FILENAME, in another window. 1348 "Edit file FILENAME, in another window.
@@ -2060,7 +2060,11 @@ unless NOMODES is non-nil."
2060 ((not warn) nil) 2060 ((not warn) nil)
2061 ((and error (file-attributes buffer-file-name)) 2061 ((and error (file-attributes buffer-file-name))
2062 (setq buffer-read-only t) 2062 (setq buffer-read-only t)
2063 "File exists, but cannot be read") 2063 (if (and (file-symlink-p buffer-file-name)
2064 (not (file-exists-p
2065 (file-chase-links buffer-file-name))))
2066 "Symbolic link that points to nonexistent file"
2067 "File exists, but cannot be read"))
2064 ((not buffer-read-only) 2068 ((not buffer-read-only)
2065 (if (and warn 2069 (if (and warn
2066 ;; No need to warn if buffer is auto-saved 2070 ;; No need to warn if buffer is auto-saved
@@ -2268,7 +2272,12 @@ since only a single case-insensitive search through the alist is made."
2268 ("\\.icn\\'" . icon-mode) 2272 ("\\.icn\\'" . icon-mode)
2269 ("\\.sim\\'" . simula-mode) 2273 ("\\.sim\\'" . simula-mode)
2270 ("\\.mss\\'" . scribe-mode) 2274 ("\\.mss\\'" . scribe-mode)
2275 ;; The Fortran standard does not say anything about file extensions.
2276 ;; .f90 was widely used for F90, now we seem to be trapped into
2277 ;; using a different extension for each language revision.
2278 ;; Anyway, the following extensions are supported by gfortran.
2271 ("\\.f9[05]\\'" . f90-mode) 2279 ("\\.f9[05]\\'" . f90-mode)
2280 ("\\.f0[38]\\'" . f90-mode)
2272 ("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode 2281 ("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode
2273 ("\\.\\(pro\\|PRO\\)\\'" . idlwave-mode) 2282 ("\\.\\(pro\\|PRO\\)\\'" . idlwave-mode)
2274 ("\\.srt\\'" . srecode-template-mode) 2283 ("\\.srt\\'" . srecode-template-mode)
@@ -2938,16 +2947,7 @@ n -- to ignore the local variables list.")
2938 (setq char nil))) 2947 (setq char nil)))
2939 (kill-buffer buf) 2948 (kill-buffer buf)
2940 (when (and offer-save (= char ?!) unsafe-vars) 2949 (when (and offer-save (= char ?!) unsafe-vars)
2941 (dolist (elt unsafe-vars) 2950 (customize-push-and-save 'safe-local-variable-values unsafe-vars))
2942 (add-to-list 'safe-local-variable-values elt))
2943 ;; When this is called from desktop-restore-file-buffer,
2944 ;; coding-system-for-read may be non-nil. Reset it before
2945 ;; writing to .emacs.
2946 (if (or custom-file user-init-file)
2947 (let ((coding-system-for-read nil))
2948 (customize-save-variable
2949 'safe-local-variable-values
2950 safe-local-variable-values))))
2951 (memq char '(?! ?\s ?y)))))) 2951 (memq char '(?! ?\s ?y))))))
2952 2952
2953(defun hack-local-variables-prop-line (&optional mode-only) 2953(defun hack-local-variables-prop-line (&optional mode-only)
@@ -4698,7 +4698,7 @@ and `view-read-only' is non-nil, enter view mode."
4698 (view-mode-enter)) 4698 (view-mode-enter))
4699 (t (setq buffer-read-only (not buffer-read-only)) 4699 (t (setq buffer-read-only (not buffer-read-only))
4700 (force-mode-line-update))) 4700 (force-mode-line-update)))
4701 (if (vc-backend buffer-file-name) 4701 (if (memq (vc-backend buffer-file-name) '(RCS SCCS))
4702 (message "%s" (substitute-command-keys 4702 (message "%s" (substitute-command-keys
4703 (concat "File is under version-control; " 4703 (concat "File is under version-control; "
4704 "use \\[vc-next-action] to check in/out")))))) 4704 "use \\[vc-next-action] to check in/out"))))))
@@ -4778,7 +4778,10 @@ visited a file in a nonexistent directory.
4778 4778
4779Noninteractively, the second (optional) argument PARENTS, if 4779Noninteractively, the second (optional) argument PARENTS, if
4780non-nil, says whether to create parent directories that don't 4780non-nil, says whether to create parent directories that don't
4781exist. Interactively, this happens by default." 4781exist. Interactively, this happens by default.
4782
4783If creating the directory or directories fail, an error will be
4784raised."
4782 (interactive 4785 (interactive
4783 (list (read-file-name "Make directory: " default-directory default-directory 4786 (list (read-file-name "Make directory: " default-directory default-directory
4784 nil nil) 4787 nil nil)
@@ -5564,7 +5567,8 @@ default directory. However, if FULL is non-nil, they are absolute."
5564 contents) 5567 contents)
5565 (while dirs 5568 (while dirs
5566 (when (or (null (car dirs)) ; Possible if DIRPART is not wild. 5569 (when (or (null (car dirs)) ; Possible if DIRPART is not wild.
5567 (file-directory-p (directory-file-name (car dirs)))) 5570 (and (file-directory-p (directory-file-name (car dirs)))
5571 (file-readable-p (car dirs))))
5568 (let ((this-dir-contents 5572 (let ((this-dir-contents
5569 ;; Filter out "." and ".." 5573 ;; Filter out "." and ".."
5570 (delq nil 5574 (delq nil
diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index a2b196dc029..491110bc898 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -86,8 +86,7 @@ them for `find-ls-option'."
86 86
87(defcustom find-grep-options 87(defcustom find-grep-options
88 (if (or (eq system-type 'berkeley-unix) 88 (if (or (eq system-type 'berkeley-unix)
89 (string-match "solaris2" system-configuration) 89 (string-match "solaris2\\|irix" system-configuration))
90 (string-match "irix" system-configuration))
91 "-s" "-q") 90 "-s" "-q")
92 "Option to grep to be as silent as possible. 91 "Option to grep to be as silent as possible.
93On Berkeley systems, this is `-s'; on Posix, and with GNU grep, `-q' does it. 92On Berkeley systems, this is `-s'; on Posix, and with GNU grep, `-q' does it.
diff --git a/lisp/follow.el b/lisp/follow.el
index 9bf472e547c..94a542f1016 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -118,7 +118,7 @@
118;; (setq pixel-vertical-clip-threshold 30) 118;; (setq pixel-vertical-clip-threshold 30)
119 119
120 120
121;; The correct way to cofigurate Follow mode, or any other mode for 121;; The correct way to configurate Follow mode, or any other mode for
122;; that matter, is to create one or more functions that do 122;; that matter, is to create one or more functions that do
123;; whatever you would like to do. These functions are then added to 123;; whatever you would like to do. These functions are then added to
124;; a hook. 124;; a hook.
@@ -189,7 +189,7 @@
189;; positions in the text? Here are two simple methods to use: 189;; positions in the text? Here are two simple methods to use:
190;; 190;;
191;; 1) Use multiple frames; `follow' mode only affects windows displayed 191;; 1) Use multiple frames; `follow' mode only affects windows displayed
192;; in the same frame. (My apoligies to you who can't use frames.) 192;; in the same frame. (My apologies to you who can't use frames.)
193;; 193;;
194;; 2) Bind `follow-mode' to key so you can turn it off whenever 194;; 2) Bind `follow-mode' to key so you can turn it off whenever
195;; you want to view two locations. Of course, `follow' mode can 195;; you want to view two locations. Of course, `follow' mode can
@@ -209,15 +209,15 @@
209;; 209;;
210;; Follow mode does this in three places: 210;; Follow mode does this in three places:
211;; 1) After each user command. 211;; 1) After each user command.
212;; 2) After a process output has been perfomed. 212;; 2) After a process output has been performed.
213;; 3) When a scrollbar has been moved. 213;; 3) When a scrollbar has been moved.
214;; 214;;
215;; This will cover most situations. (Let me know if there are other 215;; This will cover most situations. (Let me know if there are other
216;; situations that should be covered.) 216;; situations that should be covered.)
217;; 217;;
218;; Note that only the selected window is checked, for the reason of 218;; Note that only the selected window is checked, for the reason of
219;; efficiency and code complexity. (I.e. it is possible to make a 219;; efficiency and code complexity. (I.e. it is possible to make a
220;; non-selected windows unaligned. It will, however, pop right back 220;; non-selected window unaligned. It will, however, pop right back
221;; when it is selected.) 221;; when it is selected.)
222 222
223;;}}} 223;;}}}
@@ -244,7 +244,7 @@
244;; (funcall (symbol-function 'set) 'bar ...) 244;; (funcall (symbol-function 'set) 'bar ...)
245;; 245;;
246;; Note: When this file is interpreted, `eval-when-compile' is 246;; Note: When this file is interpreted, `eval-when-compile' is
247;; evaluted. Since it doesn't hurt to evaluate it, but it is a bit 247;; evaluated. Since it doesn't hurt to evaluate it, but it is a bit
248;; annoying, we test if the byte-compiler has been loaded. This can, 248;; annoying, we test if the byte-compiler has been loaded. This can,
249;; of course, lead to some occasional unintended evaluation... 249;; of course, lead to some occasional unintended evaluation...
250;; 250;;
@@ -456,7 +456,7 @@ Used by `follow-window-size-change'.")
456;; the variable is not set. 456;; the variable is not set.
457 457
458(defsubst follow-debug-message (&rest args) 458(defsubst follow-debug-message (&rest args)
459 "Like message, but only active when `follow-debug' is non-nil." 459 "Like `message', but only active when `follow-debug' is non-nil."
460 (if (and (boundp 'follow-debug) follow-debug) 460 (if (and (boundp 'follow-debug) follow-debug)
461 (apply 'message args))) 461 (apply 'message args)))
462 462
@@ -1000,7 +1000,7 @@ Note that this handles the case when the cache has been set to nil."
1000 res)) 1000 res))
1001 1001
1002 1002
1003;; Make sure WIN always starts at the beginning of an whole screen 1003;; Make sure WIN always starts at the beginning of a whole screen
1004;; line. If WIN is not aligned the start is updated which probably 1004;; line. If WIN is not aligned the start is updated which probably
1005;; will lead to a redisplay of the screen later on. 1005;; will lead to a redisplay of the screen later on.
1006;; 1006;;
@@ -1057,8 +1057,8 @@ Return the selected window."
1057 win)) 1057 win))
1058 1058
1059 1059
1060;; Lets select a window showing the end. Make sure we only select it if it 1060;; Lets select a window showing the end. Make sure we only select it if
1061;; it wasn't just moved here. (i.e. M-> shall not unconditionally place 1061;; it wasn't just moved here. (I.e. M-> shall not unconditionally place
1062;; the point in the selected window.) 1062;; the point in the selected window.)
1063;; 1063;;
1064;; (Compatibility cludge: in Emacs `window-end' is equal to `point-max'; 1064;; (Compatibility cludge: in Emacs `window-end' is equal to `point-max';
@@ -1134,7 +1134,7 @@ Otherwise, return nil."
1134 "Reposition the WINDOWS around WIN. 1134 "Reposition the WINDOWS around WIN.
1135Should the point be too close to the roof we redisplay everything 1135Should the point be too close to the roof we redisplay everything
1136from the top. WINDOWS should contain a list of windows to 1136from the top. WINDOWS should contain a list of windows to
1137redisplay, it is assumed that WIN is a member of the list. 1137redisplay; it is assumed that WIN is a member of the list.
1138Should WINDOWS be nil, the windows displaying the 1138Should WINDOWS be nil, the windows displaying the
1139same buffer as WIN, in the current frame, are used. 1139same buffer as WIN, in the current frame, are used.
1140Should WIN be nil, the selected window is used. 1140Should WIN be nil, the selected window is used.
@@ -1231,7 +1231,7 @@ should be a member of WINDOWS, starts at position START."
1231 (setq done t res (point))) 1231 (setq done t res (point)))
1232 ((= win-start start) ; Perfect match, use this value 1232 ((= win-start start) ; Perfect match, use this value
1233 (setq done t res (point))) 1233 (setq done t res (point)))
1234 ((< win-start start) ; Walked to far, use preious result 1234 ((< win-start start) ; Walked to far, use previous result
1235 (setq done t)) 1235 (setq done t))
1236 (t ; Store result for next iteration 1236 (t ; Store result for next iteration
1237 (setq res (point)))))) 1237 (setq res (point))))))
@@ -1241,12 +1241,12 @@ should be a member of WINDOWS, starts at position START."
1241;;{{{ Avoid tail recenter 1241;;{{{ Avoid tail recenter
1242 1242
1243;; This sets the window internal flag `force_start'. The effect is that 1243;; This sets the window internal flag `force_start'. The effect is that
1244;; windows only displaying the tail isn't recentered. 1244;; windows only displaying the tail aren't recentered.
1245;; Has to be called before every redisplay... (Great isn't it?) 1245;; Has to be called before every redisplay... (Great isn't it?)
1246;; 1246;;
1247;; XEmacs doesn't recenter the tail, GOOD! 1247;; XEmacs doesn't recenter the tail, GOOD!
1248;; 1248;;
1249;; A window displaying only the tail, is a windows whose 1249;; A window displaying only the tail, is a window whose
1250;; window-start position is equal to (point-max) of the buffer it 1250;; window-start position is equal to (point-max) of the buffer it
1251;; displays. 1251;; displays.
1252;; 1252;;
@@ -1487,12 +1487,12 @@ non-first windows in Follow mode."
1487;;;; Scroll-bar support code. 1487;;;; Scroll-bar support code.
1488 1488
1489;; Why is it needed? Well, if the selected window is in follow mode, 1489;; Why is it needed? Well, if the selected window is in follow mode,
1490;; all its follower stick to it blindly. If one of them is scrolled, 1490;; all its followers stick to it blindly. If one of them is scrolled,
1491;; it immediately returns to the original position when the mouse is 1491;; it immediately returns to the original position when the mouse is
1492;; released. If the selected window is not a follower of the dragged 1492;; released. If the selected window is not a follower of the dragged
1493;; window the windows will be unaligned. 1493;; window the windows will be unaligned.
1494 1494
1495;; The advices doesn't get compiled. Aestetically, this might be a 1495;; The advices don't get compiled. Aesthetically, this might be a
1496;; problem but in practical life it isn't. 1496;; problem but in practical life it isn't.
1497 1497
1498;; Discussion: Now when the other windows in the chain follow the 1498;; Discussion: Now when the other windows in the chain follow the
@@ -1700,8 +1700,8 @@ magic stuff before the real process filter is called."
1700;;}}} 1700;;}}}
1701;;{{{ Start/stop interception of processes. 1701;;{{{ Start/stop interception of processes.
1702 1702
1703;; Normally, all new processed are intercepted by our `set-process-filter'. 1703;; Normally, all new processes are intercepted by our `set-process-filter'.
1704;; This is needed to intercept old processed that were started before we were 1704;; This is needed to intercept old processes that were started before we were
1705;; loaded, and processes we have forgotten by calling 1705;; loaded, and processes we have forgotten by calling
1706;; `follow-stop-intercept-process-output'. 1706;; `follow-stop-intercept-process-output'.
1707 1707
@@ -1749,7 +1749,7 @@ report this using the `report-emacs-bug' function."
1749 1749
1750;; The following section is a naive method to make buffers with 1750;; The following section is a naive method to make buffers with
1751;; process output to work with Follow mode. Whenever the start of the 1751;; process output to work with Follow mode. Whenever the start of the
1752;; window displaying the buffer is moved, we moves it back to its 1752;; window displaying the buffer is moved, we move it back to its
1753;; original position and try to select a new window. (If we fail, 1753;; original position and try to select a new window. (If we fail,
1754;; the normal redisplay functions of Emacs will scroll it right 1754;; the normal redisplay functions of Emacs will scroll it right
1755;; back!) 1755;; back!)
@@ -1767,7 +1767,7 @@ report this using the `report-emacs-bug' function."
1767 1767
1768 ;; If input is pending, the `sit-for' below won't redraw the 1768 ;; If input is pending, the `sit-for' below won't redraw the
1769 ;; display. In that case, calling `follow-avoid-tail-recenter' may 1769 ;; display. In that case, calling `follow-avoid-tail-recenter' may
1770 ;; provoke the process hadnling code to sceduling a redisplay. 1770 ;; provoke the process handling code to schedule a redisplay.
1771 ;(or (input-pending-p) 1771 ;(or (input-pending-p)
1772 ; (follow-avoid-tail-recenter)) 1772 ; (follow-avoid-tail-recenter))
1773 1773
@@ -1788,7 +1788,7 @@ report this using the `report-emacs-bug' function."
1788 (inhibit-read-only t)) 1788 (inhibit-read-only t))
1789 (save-excursion 1789 (save-excursion
1790 (goto-char (process-mark proc)) 1790 (goto-char (process-mark proc))
1791 ;; `insert-before-markers' just in case the users next 1791 ;; `insert-before-markers' just in case the user's next
1792 ;; command is M-y. 1792 ;; command is M-y.
1793 (insert-before-markers output) 1793 (insert-before-markers output)
1794 (set-marker (process-mark proc) (point))) 1794 (set-marker (process-mark proc) (point)))
@@ -1848,7 +1848,7 @@ report this using the `report-emacs-bug' function."
1848 (t 1848 (t
1849 (follow-debug-message "filter: nothing"))) 1849 (follow-debug-message "filter: nothing")))
1850 1850
1851 ;; Here we have slected a window. Make sure the 1851 ;; Here we have selected a window. Make sure the
1852 ;; windows are aligned and the point is visible 1852 ;; windows are aligned and the point is visible
1853 ;; in the selected window. 1853 ;; in the selected window.
1854 (if (and (not (follow-pos-visible 1854 (if (and (not (follow-pos-visible
@@ -1866,7 +1866,7 @@ report this using the `report-emacs-bug' function."
1866 ;; return to the original window. 1866 ;; return to the original window.
1867 (if return-to-orig-win 1867 (if return-to-orig-win
1868 (select-window orig-win)) 1868 (select-window orig-win))
1869 ;; Restore the orignal buffer, unless the filter explicitly 1869 ;; Restore the original buffer, unless the filter explicitly
1870 ;; changed buffer or killed the old buffer. 1870 ;; changed buffer or killed the old buffer.
1871 (if (and (eq buf (current-buffer)) 1871 (if (and (eq buf (current-buffer))
1872 (buffer-name old-buffer)) 1872 (buffer-name old-buffer))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index e4dc6f11479..6902ce98ab1 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -254,6 +254,7 @@ for buffers in Rmail mode, and size is irrelevant otherwise."
254If nil, use the default decoration (typically the minimum available). 254If nil, use the default decoration (typically the minimum available).
255If t, use the maximum decoration available. 255If t, use the maximum decoration available.
256If a number, use that level of decoration (or if not available the maximum). 256If a number, use that level of decoration (or if not available the maximum).
257The higher the number, the more decoration is done.
257If a list, each element should be a cons pair of the form (MAJOR-MODE . LEVEL), 258If a list, each element should be a cons pair of the form (MAJOR-MODE . LEVEL),
258where MAJOR-MODE is a symbol or t (meaning the default). For example: 259where MAJOR-MODE is a symbol or t (meaning the default). For example:
259 ((c-mode . t) (c++-mode . 2) (t . 1)) 260 ((c-mode . t) (c++-mode . 2) (t . 1))
@@ -1856,19 +1857,13 @@ Sets various variables using `font-lock-defaults' and
1856 (((class color) (min-colors 8) (background light)) 1857 (((class color) (min-colors 8) (background light))
1857 (:foreground "red")) 1858 (:foreground "red"))
1858 (((class color) (min-colors 8) (background dark)) 1859 (((class color) (min-colors 8) (background dark))
1859 ) 1860 (:foreground "yellow"))
1860 (t (:weight bold :slant italic))) 1861 (t (:weight bold :slant italic)))
1861 "Font Lock mode face used to highlight comments." 1862 "Font Lock mode face used to highlight comments."
1862 :group 'font-lock-faces) 1863 :group 'font-lock-faces)
1863 1864
1864(defface font-lock-comment-delimiter-face 1865(defface font-lock-comment-delimiter-face
1865 '((default :inherit font-lock-comment-face) 1866 '((default :inherit font-lock-comment-face))
1866 (((class grayscale)))
1867 (((class color) (min-colors 16)))
1868 (((class color) (min-colors 8) (background light))
1869 :foreground "red")
1870 (((class color) (min-colors 8) (background dark))
1871 :foreground "red1"))
1872 "Font Lock mode face used to highlight comment delimiters." 1867 "Font Lock mode face used to highlight comment delimiters."
1873 :group 'font-lock-faces) 1868 :group 'font-lock-faces)
1874 1869
@@ -1904,7 +1899,7 @@ Sets various variables using `font-lock-defaults' and
1904(defface font-lock-builtin-face 1899(defface font-lock-builtin-face
1905 '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold)) 1900 '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
1906 (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold)) 1901 (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
1907 (((class color) (min-colors 88) (background light)) (:foreground "MediumOrchid4")) 1902 (((class color) (min-colors 88) (background light)) (:foreground "dark slate blue"))
1908 (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue")) 1903 (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue"))
1909 (((class color) (min-colors 16) (background light)) (:foreground "Orchid")) 1904 (((class color) (min-colors 16) (background light)) (:foreground "Orchid"))
1910 (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue")) 1905 (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue"))
diff --git a/lisp/frame.el b/lisp/frame.el
index 3ceec2657e7..d6f82750347 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -847,6 +847,116 @@ If there is no frame by that name, signal an error."
847 (if frame 847 (if frame
848 (select-frame-set-input-focus frame) 848 (select-frame-set-input-focus frame)
849 (error "There is no frame named `%s'" name)))) 849 (error "There is no frame named `%s'" name))))
850
851
852;;;; Background mode.
853
854(defcustom frame-background-mode nil
855 "The brightness of the background.
856Set this to the symbol `dark' if your background color is dark,
857`light' if your background is light, or nil (automatic by default)
858if you want Emacs to examine the brightness for you. Don't set this
859variable with `setq'; this won't have the expected effect."
860 :group 'faces
861 :set #'(lambda (var value)
862 (set-default var value)
863 (mapc 'frame-set-background-mode (frame-list)))
864 :initialize 'custom-initialize-changed
865 :type '(choice (const dark)
866 (const light)
867 (const :tag "automatic" nil)))
868
869(declare-function x-get-resource "frame.c"
870 (attribute class &optional component subclass))
871
872(defvar inhibit-frame-set-background-mode nil)
873
874(defun frame-set-background-mode (frame &optional keep-face-specs)
875 "Set up display-dependent faces on FRAME.
876Display-dependent faces are those which have different definitions
877according to the `background-mode' and `display-type' frame parameters.
878
879If optional arg KEEP-FACE-SPECS is non-nil, don't recalculate
880face specs for the new background mode."
881 (unless inhibit-frame-set-background-mode
882 (let* ((frame-default-bg-mode (frame-terminal-default-bg-mode frame))
883 (bg-color (frame-parameter frame 'background-color))
884 (tty-type (tty-type frame))
885 (default-bg-mode
886 (if (or (window-system frame)
887 (and tty-type
888 (string-match "^\\(xterm\\|\\rxvt\\|dtterm\\|eterm\\)"
889 tty-type)))
890 'light
891 'dark))
892 (non-default-bg-mode (if (eq default-bg-mode 'light) 'dark 'light))
893 (bg-mode
894 (cond (frame-default-bg-mode)
895 ((equal bg-color "unspecified-fg") ; inverted colors
896 non-default-bg-mode)
897 ((not (color-values bg-color frame))
898 default-bg-mode)
899 ((>= (apply '+ (color-values bg-color frame))
900 ;; Just looking at the screen, colors whose
901 ;; values add up to .6 of the white total
902 ;; still look dark to me.
903 (* (apply '+ (color-values "white" frame)) .6))
904 'light)
905 (t 'dark)))
906 (display-type
907 (cond ((null (window-system frame))
908 (if (tty-display-color-p frame) 'color 'mono))
909 ((display-color-p frame)
910 'color)
911 ((x-display-grayscale-p frame)
912 'grayscale)
913 (t 'mono)))
914 (old-bg-mode
915 (frame-parameter frame 'background-mode))
916 (old-display-type
917 (frame-parameter frame 'display-type)))
918
919 (unless (and (eq bg-mode old-bg-mode) (eq display-type old-display-type))
920 (let ((locally-modified-faces nil)
921 ;; Prevent face-spec-recalc from calling this function
922 ;; again, resulting in a loop (bug#911).
923 (inhibit-frame-set-background-mode t)
924 (params (list (cons 'background-mode bg-mode)
925 (cons 'display-type display-type))))
926 (if keep-face-specs
927 (modify-frame-parameters frame params)
928 ;; If we are recomputing face specs, first collect a list
929 ;; of faces that don't match their face-specs. These are
930 ;; the faces modified on FRAME, and we avoid changing them
931 ;; below. Use a negative list to avoid consing (we assume
932 ;; most faces are unmodified).
933 (dolist (face (face-list))
934 (and (not (get face 'face-override-spec))
935 (not (face-spec-match-p face
936 (face-user-default-spec face)
937 (selected-frame)))
938 (push face locally-modified-faces)))
939 ;; Now change to the new frame parameters
940 (modify-frame-parameters frame params)
941 ;; For all unmodified named faces, choose face specs
942 ;; matching the new frame parameters.
943 (dolist (face (face-list))
944 (unless (memq face locally-modified-faces)
945 (face-spec-recalc face frame)))))))))
946
947(defun frame-terminal-default-bg-mode (frame)
948 "Return the default background mode of FRAME.
949This checks the `frame-background-mode' variable, the X resource
950named \"backgroundMode\" (if FRAME is an X frame), and finally
951the `background-mode' terminal parameter."
952 (or frame-background-mode
953 (let ((bg-resource
954 (and (window-system frame)
955 (x-get-resource "backgroundMode" "BackgroundMode"))))
956 (if bg-resource
957 (intern (downcase bg-resource))))
958 (terminal-parameter frame 'background-mode)))
959
850 960
851;;;; Frame configurations 961;;;; Frame configurations
852 962
diff --git a/lisp/fringe.el b/lisp/fringe.el
index ce24bb60100..fa5ebb6f0c6 100644
--- a/lisp/fringe.el
+++ b/lisp/fringe.el
@@ -192,7 +192,7 @@ frame parameter is used."
192 (concat 192 (concat
193 "Select fringe mode for " 193 "Select fringe mode for "
194 (if all-frames "all frames" "selected frame") 194 (if all-frames "all frames" "selected frame")
195 " (type ? for list): ") 195 ": ")
196 fringe-styles nil t)) 196 fringe-styles nil t))
197 (style (assoc (downcase mode) fringe-styles))) 197 (style (assoc (downcase mode) fringe-styles)))
198 (if style (cdr style) 198 (if style (cdr style)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 839bd519d49..e3321ab30c5 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,314 @@
12011-07-14 Andrew Cohen <cohen@andy.bu.edu>
2
3 * nnimap.el (nnimap-request-thread): Ensure search is performed in
4 correct group.
5
6 * gnus-int.el (gnus-request-thread): Add group argument.
7
8 * gnus-sum.el (gnus-summary-refer-thread): Use it.
9
102011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11
12 * gnus-group.el (gnus-read-ephemeral-emacs-bug-group): `debbugs-*'
13 renamed to `debbugs-gnu-*'.
14
152011-07-08 Daiki Ueno <ueno@unixuser.org>
16
17 * plstore.el: Revert the editing feature since it is not urgent.
18 (plstore-mode, plstore-mode-toggle-display, plstore-mode-original)
19 (plstore-mode-decoded): Remove.
20
212011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
22
23 * gnus-msg.el (gnus-bug): Don't insert user variables. It usually
24 isn't very interesting any more, and it leaks potentially secret data.
25 (gnus-debug): Removed.
26
27 * gnus-art.el (gnus-ignored-headers): Removed obsolete and non-working
28 use of :custom-show.
29
302011-07-07 Daiki Ueno <ueno@unixuser.org>
31
32 * plstore.el: Add documentation.
33 (plstore-mode): New mode to edit plstore file.
34 (plstore-mode-toggle-display, plstore-mode-original)
35 (plstore-mode-decoded): New command.
36 (plstore--encode, plstore--decode, plstore--write-contents-functions)
37 (plstore--insert-buffer, plstore--make): New function.
38 (plstore-open, plstore-save): Simplify by using them.
39
402011-07-06 Glenn Morris <rgm@gnu.org>
41
42 * gnus-group.el (gnus-read-ephemeral-emacs-bug-group): Silence compiler.
43
442011-07-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
45
46 * gnus.el (gnus-refer-article-method): Remove mention of nnspool, which
47 no longer is much used.
48 (gnus-summary-line-format): Link to "Marking Articles" instead of "Read
49 Articles".
50
512011-04-03 Kan-Ru Chen <kanru@kanru.info>
52
53 * nnir.el (nnir-notmuch-program, nnir-notmuch-additional-switches)
54 (nnir-notmuch-remove-prefix, nnir-engines, nnir-run-notmuch): New nnir
55 `notmuch' backend.
56
572011-07-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
58
59 * mm-decode.el (mm-text-html-renderer): Doc fix.
60
61 * gnus-msg.el (gnus-bug): Fix the MML tag.
62
63 * pop3.el (pop3-open-server): -ERR is a valid response to CAPA.
64
652011-07-05 Daiki Ueno <ueno@unixuser.org>
66
67 * gnus-start.el (gnus-get-unread-articles): Don't connect to the
68 secondary methods if started with `gnus-no-server'.
69
702011-07-05 Juanma Barranquero <lekktu@gmail.com>
71
72 * message.el (message-return-action): Fix typo in docstring.
73
742011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
75
76 * gnus-group.el (gnus-read-ephemeral-bug-group): Allow fetching several
77 bug reports at once.
78
79 * nnimap.el (nnimap-request-scan): Say that splitting has finished.
80
812011-07-04 Katsumi Yamaoka <yamaoka@jpl.org>
82
83 * nndraft.el: Require gnus-group.
84 (nndraft-request-list): Declare.
85
86 * nndraft.el (nndraft-update-unread-articles): Don't show group having
87 no unread article unless it matches gnus-permanently-visible-groups.
88
89 * nndraft.el (nndraft-update-unread-articles): New function.
90 (nndraft-request-associate-buffer): Use it to update the number of
91 unread articles for the nndraft groups in the group buffer when saving
92 or killing a draft message.
93
942011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
95
96 * gnus-group.el (gnus-read-ephemeral-bug-group): Bind the coding
97 systems to binary before writing and reading the mbox files.
98
99 * gnus.el (gnus-summary-line-format): Link to the info node for %U
100 instead of trying to list them all (bug#8978).
101
1022011-07-03 Wolfgang Jenkner <wjenkner@inode.at> (tiny change)
103
104 * pop3.el (pop3-open-server): Use :end-of-capability.
105
1062011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
107
108 * gnus-group.el (gnus-read-ephemeral-emacs-bug-group): Make sure that
109 the id is always a number.
110
111 * gnus-group.el (gnus-read-ephemeral-emacs-bug-group): Hook into
112 debbugs mode, if possible.
113
1142011-07-02 Daiki Ueno <ueno@unixuser.org>
115
116 * auth-source.el (auth-source-token-passphrase-callback-function):
117 Reindent.
118 (epg-context-operation): Remove unnecessary autoload.
119
1202011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
121
122 * gnus.el (gnus-list-debbugs): New command.
123
124 * gnus-group.el (gnus-bug-group-download-format-alist): Get the
125 mboxstat instead of the maintbox, since the stat seems to be fuller.
126
127 * gnus-msg.el (gnus-configure-posting-styles): Don't try to select dead
128 summary buffers.
129
130 * message.el (message-get-reply-headers): Delete all duplicates,
131 instead of the first.
132 (message-get-reply-headers): Ensure that we have progress while
133 deleting duplicates.
134
135 * gnus-msg.el (gnus-configure-posting-styles): Get the local
136 gnus-posting-style value from the summary buffer to make it easier to
137 make that a per-buffer conf.
138
1392011-07-02 Andrew Cohen <cohen@andy.bu.edu>
140
141 * nnir.el (nnir-run-imap): Allow halting a search when an article is
142 found by setting `shortcut' in 'query.
143 (nnir-request-article): Use `shortcut' setting when requesting article
144 by Message-ID.
145
1462011-07-02 Teodor Zlatanov <tzz@lifelogs.com>
147
148 * gnus-msg.el (gnus-bug): Give the Version and Package headers to
149 debbugs with the X-Debbugs-Package and X-Debbugs-Version headers.
150 Bring the pseudo-headers back too.
151
1522011-07-01 Daiki Ueno <ueno@unixuser.org>
153
154 * auth-source.el (auth-source-token-passphrase-callback-function):
155 Simplify and remove EPA dependency.
156
1572011-07-01 Andrew Cohen <cohen@andy.bu.edu>
158
159 * nnir.el (nnir-request-article): Fix error message text.
160
1612011-07-01 Daiki Ueno <ueno@unixuser.org>
162
163 * auth-source.el (plstore-delete): Autoload.
164 (auth-source-plstore-search): Support delete operation.
165 * plstore.el (plstore-delete): New function.
166
1672011-07-01 Katsumi Yamaoka <yamaoka@jpl.org>
168
169 * gnus-draft.el (gnus-draft-clear-marks): Revert last change;
170 mark actually existing articles as unread rather than the ones that
171 active asserts.
172
1732011-07-01 Paul Eggert <eggert@cs.ucla.edu>
174
175 * nntp.el (nntp-record-command):
176 * gnus-util.el (gnus-message-with-timestamp-1):
177 Use format-time-string rather than decoding time stamps by hand.
178 This is simpler and insulates the code from potential changes to
179 current-time format.
180
1812011-07-01 Katsumi Yamaoka <yamaoka@jpl.org>
182
183 * gnus-draft.el (gnus-draft-clear-marks): Mark deleted articles as read.
184
1852011-07-01 Daiki Ueno <ueno@unixuser.org>
186
187 * plstore.el (plstore-select-keys, plstore-encrypt-to): New variable.
188 (plstore-save): Support public key encryption.
189 (plstore--init-from-buffer): New function.
190 (plstore-open): Use it; fix error when opening a non-existent file.
191 (plstore-revert): Use plstore--init-from-buffer.
192
1932011-07-01 Daiki Ueno <ueno@unixuser.org>
194
195 * auth-source.el (auth-source-backend): Fix :initarg for data slot.
196
1972011-06-30 Katsumi Yamaoka <yamaoka@jpl.org>
198
199 * mml2015.el (mml2015-use): Replace string-match-p with string-match
200 for old Emacsen.
201
2022011-06-30 Daiki Ueno <ueno@unixuser.org>
203
204 * mml2015.el (mml2015-use): Don't try to load PGG on Emacs 24, when EPG
205 is not fully working.
206
2072011-06-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
208
209 * dgnushack.el: Autoload sha1 on XEmacs.
210
211 * gnus-group.el (gnus-read-ephemeral-emacs-bug-group): Take an optional
212 quit window configuration.
213
214 * auth-source.el (epg-context-set-passphrase-callback): Remove
215 duplicate autoload.
216
2172011-06-30 Andrew Cohen <cohen@andy.bu.edu>
218
219 * nnir.el (nnir-request-article): Allow requesting articles by
220 Message-ID with nnimap.
221
222 * gnus-sum.el (gnus-refer-article-methods): Allow (nnir) entry to use
223 current server.
224
2252011-06-30 Teodor Zlatanov <tzz@lifelogs.com>
226
227 * auth-source.el: Autoload EPA/EPG functions.
228 (auth-source-netrc-use-gpg-tokens): Clarify that it should not be
229 changed when EPA/EPG is not available.
230 (auth-source-backend): Rename "arg" member to "data".
231 (auth-source-backend-parse, auth-source-plstore-search)
232 (auth-source-plstore-create): Use it.
233
2342011-06-30 Andrew Cohen <cohen@andy.bu.edu>
235
236 * gnus-art.el (gnus-request-article-this-buffer): Use existing function
237 `gnus-refer-article-methods'.
238
2392011-06-30 Teodor Zlatanov <tzz@lifelogs.com>
240
241 * auth-source.el: Require EPA and EPG.
242 (auth-source-passphrase-alist): New variable.
243 (auth-source-passphrase-callback-function)
244 (auth-source-token-passphrase-callback-function): Callbacks for the
245 netrc field encryption (GPG tokens).
246 (auth-source-epa-extract-gpg-token, auth-source-epa-make-gpg-token):
247 Symmetric encryption and decryption of the netrc GPG tokens.
248 (auth-source-netrc-normalize): Use them, simplifying the closure.
249
2502011-06-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
251
252 * nnimap.el (nnimap-split-incoming-mail): If `nnimap-split-fancy' is
253 non-nil, and `nnimap-split-methods' is nil, use the former.
254
2552011-06-30 Daiki Ueno <ueno@unixuser.org>
256
257 * plstore.el (plstore-revert): New function.
258 (plstore-open): Use it; hide the buffer from user.
259
2602011-06-30 Daiki Ueno <ueno@unixuser.org>
261
262 * auth-source.el (auth-source-backend): New member "arg".
263 (auth-source-backend-parse): Handle new backend 'plstore.
264 * plstore.el: New file.
265
2662011-06-30 Glenn Morris <rgm@gnu.org>
267
268 * gnus-fun.el (gnus-convert-image-to-x-face-command): Doc fix.
269
270 * mm-util.el (mm-charset-synonym-alist): Move definition before use.
271
2722011-06-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
273
274 * nnimap.el (nnimap-process-expiry-targets): Say what target we're
275 expiring articles to.
276
277 * mm-util.el (mm-charset-to-coding-system): Recognise all ANSI.x3.4
278 variations as ASCII (bug#5458).
279
2802011-06-30 Katsumi Yamaoka <yamaoka@jpl.org>
281
282 * nnmh.el (nnmh-request-list-1): Work on MS Windows.
283
2842011-06-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
285
286 * message.el (message-point-in-header-p): Tweak the function to default
287 to saying that we're not in the headers if there is no separator at
288 all. This makes it possible to use the Message version of `M-q' in
289 buffers with no headers (bug#7987).
290 (message-point-in-header-p): Fix last checkin to work with an empty
291 mail-header-separator, too.
292
293 * auth-source.el (auth-source-netrc-saver): If the user says "don't ask
294 again, save the choice via customize.
295
2962011-06-29 Lars Magne Ingebrigtsen <larsi@gnus.org>
297
298 * message.el (message-send-mail-function): Add `sendmail-query-once'.
299
300 * nnimap.el (nnimap-finish-retrieve-group-infos): If the server has
301 ended the connection, bail out before waiting infinitely on a new
302 connection.
303
3042011-06-28 Teodor Zlatanov <tzz@lifelogs.com>
305
306 * gnus-msg.el (gnus-bug): Add Package and Version pseudo-headers to bug
307 reports.
308
309 * gnus.el (gnus-bug-package): Use "gnus."
310 (gnus-maintainer): Direct bug reports to submit@debbugs.gnu.org.
311
12011-06-26 Lars Magne Ingebrigtsen <larsi@gnus.org> 3122011-06-26 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 313
3 * gnus-art.el (gnus-article-stop-animations): New function to stop any 314 * gnus-art.el (gnus-article-stop-animations): New function to stop any
diff --git a/lisp/gnus/ChangeLog.2 b/lisp/gnus/ChangeLog.2
index 4882032f284..779c84296f4 100644
--- a/lisp/gnus/ChangeLog.2
+++ b/lisp/gnus/ChangeLog.2
@@ -9243,7 +9243,7 @@
9243 (nnmaildir--with-nntp-buffer, nnmaildir--with-work-buffer, 9243 (nnmaildir--with-nntp-buffer, nnmaildir--with-work-buffer,
9244 nnmaildir--with-nov-buffer, nnmaildir--with-move-buffer, 9244 nnmaildir--with-nov-buffer, nnmaildir--with-move-buffer,
9245 nnmaildir--group-ls): New macros/functions. Use them. 9245 nnmaildir--group-ls): New macros/functions. Use them.
9246 (nnmaildir--unlink): Evalutate argument only once. 9246 (nnmaildir--unlink): Evaluate argument only once.
9247 9247
92482002-03-27 Jesper Harder <harder@ifa.au.dk> 92482002-03-27 Jesper Harder <harder@ifa.au.dk>
9249 9249
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index c9cfc14fc55..e249e97e826 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -43,6 +43,7 @@
43(require 'mm-util) 43(require 'mm-util)
44(require 'gnus-util) 44(require 'gnus-util)
45(require 'assoc) 45(require 'assoc)
46
46(eval-when-compile (require 'cl)) 47(eval-when-compile (require 'cl))
47(require 'eieio) 48(require 'eieio)
48 49
@@ -56,6 +57,19 @@
56 57
57(autoload 'rfc2104-hash "rfc2104") 58(autoload 'rfc2104-hash "rfc2104")
58 59
60(autoload 'plstore-open "plstore")
61(autoload 'plstore-find "plstore")
62(autoload 'plstore-put "plstore")
63(autoload 'plstore-delete "plstore")
64(autoload 'plstore-save "plstore")
65(autoload 'plstore-get-file "plstore")
66
67(autoload 'epg-make-context "epg")
68(autoload 'epg-context-set-passphrase-callback "epg")
69(autoload 'epg-decrypt-string "epg")
70(autoload 'epg-context-set-armor "epg")
71(autoload 'epg-encrypt-string "epg")
72
59(defvar secrets-enabled) 73(defvar secrets-enabled)
60 74
61(defgroup auth-source nil 75(defgroup auth-source nil
@@ -75,6 +89,9 @@ let-binding."
75 (const :tag "30 Minutes" 1800) 89 (const :tag "30 Minutes" 1800)
76 (integer :tag "Seconds"))) 90 (integer :tag "Seconds")))
77 91
92;;; The slots below correspond with the `auth-source-search' spec,
93;;; so a backend with :host set, for instance, would match only
94;;; searches for that host. Normally they are nil.
78(defclass auth-source-backend () 95(defclass auth-source-backend ()
79 ((type :initarg :type 96 ((type :initarg :type
80 :initform 'netrc 97 :initform 'netrc
@@ -100,6 +117,9 @@ let-binding."
100 :type t 117 :type t
101 :custom string 118 :custom string
102 :documentation "The backend protocol.") 119 :documentation "The backend protocol.")
120 (data :initarg :data
121 :initform nil
122 :documentation "Internal backend data.")
103 (create-function :initarg :create-function 123 (create-function :initarg :create-function
104 :initform ignore 124 :initform ignore
105 :type function 125 :type function
@@ -159,7 +179,8 @@ let-binding."
159 179
160(defcustom auth-source-netrc-use-gpg-tokens 'never 180(defcustom auth-source-netrc-use-gpg-tokens 'never
161 "Set this to tell auth-source when to create GPG password 181 "Set this to tell auth-source when to create GPG password
162tokens in netrc files. It's either an alist or `never'." 182tokens in netrc files. It's either an alist or `never'.
183Note that if EPA/EPG is not available, this should NOT be used."
163 :group 'auth-source 184 :group 'auth-source
164 :version "23.2" ;; No Gnus 185 :version "23.2" ;; No Gnus
165 :type `(choice 186 :type `(choice
@@ -264,9 +285,9 @@ can get pretty complex."
264 (const :format "" :value :user) 285 (const :format "" :value :user)
265 (choice 286 (choice
266 :tag "Personality/Username" 287 :tag "Personality/Username"
267 (const :tag "Any" t) 288 (const :tag "Any" t)
268 (string 289 (string
269 :tag "Name"))))))))) 290 :tag "Name")))))))))
270 291
271(defcustom auth-source-gpg-encrypt-to t 292(defcustom auth-source-gpg-encrypt-to t
272 "List of recipient keys that `authinfo.gpg' encrypted to. 293 "List of recipient keys that `authinfo.gpg' encrypted to.
@@ -307,8 +328,8 @@ If the value is not a list, symmetric encryption will be used."
307 328
308(defun auth-source-do-warn (&rest msg) 329(defun auth-source-do-warn (&rest msg)
309 (apply 330 (apply
310 ;; set logger to either the function in auth-source-debug or 'message 331 ;; set logger to either the function in auth-source-debug or 'message
311 ;; note that it will be 'message if auth-source-debug is nil 332 ;; note that it will be 'message if auth-source-debug is nil
312 (if (functionp auth-source-debug) 333 (if (functionp auth-source-debug)
313 auth-source-debug 334 auth-source-debug
314 'message) 335 'message)
@@ -375,12 +396,20 @@ with \"[a/b/c] \" if CHOICES is '\(?a ?b ?c\)."
375 396
376 ;; a file name with parameters 397 ;; a file name with parameters
377 ((stringp (plist-get entry :source)) 398 ((stringp (plist-get entry :source))
378 (auth-source-backend 399 (if (equal (file-name-extension (plist-get entry :source)) "plist")
379 (plist-get entry :source) 400 (auth-source-backend
380 :source (plist-get entry :source) 401 (plist-get entry :source)
381 :type 'netrc 402 :source (plist-get entry :source)
382 :search-function 'auth-source-netrc-search 403 :type 'plstore
383 :create-function 'auth-source-netrc-create)) 404 :search-function 'auth-source-plstore-search
405 :create-function 'auth-source-plstore-create
406 :data (plstore-open (plist-get entry :source)))
407 (auth-source-backend
408 (plist-get entry :source)
409 :source (plist-get entry :source)
410 :type 'netrc
411 :search-function 'auth-source-netrc-search
412 :create-function 'auth-source-netrc-create)))
384 413
385 ;; the Secrets API. We require the package, in order to have a 414 ;; the Secrets API. We require the package, in order to have a
386 ;; defined value for `secrets-enabled'. 415 ;; defined value for `secrets-enabled'.
@@ -654,7 +683,7 @@ must call it to obtain the actual value."
654 (when auth-source-do-cache 683 (when auth-source-do-cache
655 (auth-source-remember spec found))) 684 (auth-source-remember spec found)))
656 685
657 found)) 686 found))
658 687
659(defun auth-source-search-backends (backends spec max create delete require) 688(defun auth-source-search-backends (backends spec max create delete require)
660 (let (matches) 689 (let (matches)
@@ -776,7 +805,7 @@ while \(:host t) would find all host entries."
776 805
777(defun auth-source-specmatchp (spec stored) 806(defun auth-source-specmatchp (spec stored)
778 (let ((keys (loop for i below (length spec) by 2 807 (let ((keys (loop for i below (length spec) by 2
779 collect (nth i spec)))) 808 collect (nth i spec))))
780 (not (eq 809 (not (eq
781 (dolist (key keys) 810 (dolist (key keys)
782 (unless (auth-source-search-collection (plist-get stored key) 811 (unless (auth-source-search-collection (plist-get stored key)
@@ -811,10 +840,10 @@ while \(:host t) would find all host entries."
811 (unless (listp values) 840 (unless (listp values)
812 (setq values (list values))) 841 (setq values (list values)))
813 (mapcar (lambda (value) 842 (mapcar (lambda (value)
814 (if (numberp value) 843 (if (numberp value)
815 (format "%s" value) 844 (format "%s" value)
816 value)) 845 value))
817 values)) 846 values))
818 847
819;;; Backend specific parsing: netrc/authinfo backend 848;;; Backend specific parsing: netrc/authinfo backend
820 849
@@ -859,7 +888,7 @@ Note that the MAX parameter is used so we can exit the parse early."
859 (base64-encode-string 888 (base64-encode-string
860 (buffer-string))))) 889 (buffer-string)))))
861 (lambda () (base64-decode-string 890 (lambda () (base64-decode-string
862 (rot13-string v))))))) 891 (rot13-string v)))))))
863 (goto-char (point-min)) 892 (goto-char (point-min))
864 ;; Go through the file, line by line. 893 ;; Go through the file, line by line.
865 (while (and (not (eobp)) 894 (while (and (not (eobp))
@@ -926,7 +955,7 @@ Note that the MAX parameter is used so we can exit the parse early."
926 (null require) 955 (null require)
927 ;; every element of require is in the normalized list 956 ;; every element of require is in the normalized list
928 (let ((normalized (nth 0 (auth-source-netrc-normalize 957 (let ((normalized (nth 0 (auth-source-netrc-normalize
929 (list alist) file)))) 958 (list alist) file))))
930 (loop for req in require 959 (loop for req in require
931 always (plist-get normalized req))))) 960 always (plist-get normalized req)))))
932 (decf max) 961 (decf max)
@@ -962,56 +991,59 @@ Note that the MAX parameter is used so we can exit the parse early."
962 991
963 (nreverse result)))))) 992 (nreverse result))))))
964 993
965(defmacro with-auth-source-epa-overrides (&rest body) 994(defvar auth-source-passphrase-alist nil)
966 `(let ((file-name-handler-alist 995
967 ',(if (boundp 'epa-file-handler) 996(defun auth-source-token-passphrase-callback-function (context key-id file)
968 (remove (symbol-value 'epa-file-handler) 997 (let* ((file (file-truename file))
969 file-name-handler-alist) 998 (entry (assoc file auth-source-passphrase-alist))
970 file-name-handler-alist)) 999 passphrase)
971 (,(if (boundp 'find-file-hook) 'find-file-hook 'find-file-hooks) 1000 ;; return the saved passphrase, calling a function if needed
972 ',(remove 1001 (or (copy-sequence (if (functionp (cdr entry))
973 'epa-file-find-file-hook 1002 (funcall (cdr entry))
974 (if (boundp 'find-file-hook) 1003 (cdr entry)))
975 (symbol-value 'find-file-hook) 1004 (progn
976 (symbol-value 'find-file-hooks)))) 1005 (unless entry
977 (auto-mode-alist 1006 (setq entry (list file))
978 ',(if (boundp 'epa-file-auto-mode-alist-entry) 1007 (push entry auth-source-passphrase-alist))
979 (remove (symbol-value 'epa-file-auto-mode-alist-entry) 1008 (setq passphrase
980 auto-mode-alist) 1009 (read-passwd
981 auto-mode-alist))) 1010 (format "Passphrase for %s tokens: " file)
982 ,@body)) 1011 t))
983 1012 (setcdr entry (lexical-let ((p (copy-sequence passphrase)))
1013 (lambda () p)))
1014 passphrase))))
1015
1016;; (auth-source-epa-extract-gpg-token "gpg:LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tClZlcnNpb246IEdudVBHIHYxLjQuMTEgKEdOVS9MaW51eCkKCmpBMEVBd01DT25qMjB1ak9rZnRneVI3K21iNm9aZWhuLzRad3cySkdlbnVaKzRpeEswWDY5di9icDI1U1dsQT0KPS9yc2wKLS0tLS1FTkQgUEdQIE1FU1NBR0UtLS0tLQo=" "~/.netrc")
1017(defun auth-source-epa-extract-gpg-token (secret file)
1018 "Pass either the decoded SECRET or the gpg:BASE64DATA version.
1019FILE is the file from which we obtained this token."
1020 (when (string-match "^gpg:\\(.+\\)" secret)
1021 (setq secret (base64-decode-string (match-string 1 secret))))
1022 (let ((context (epg-make-context 'OpenPGP))
1023 plain)
1024 (epg-context-set-passphrase-callback
1025 context
1026 (cons #'auth-source-token-passphrase-callback-function
1027 file))
1028 (epg-decrypt-string context secret)))
1029
1030;; (insert (auth-source-epa-make-gpg-token "mysecret" "~/.netrc"))
984(defun auth-source-epa-make-gpg-token (secret file) 1031(defun auth-source-epa-make-gpg-token (secret file)
985 (require 'epa nil t) 1032 (let ((context (epg-make-context 'OpenPGP))
986 (unless (featurep 'epa) 1033 (pp-escape-newlines nil)
987 (error "EPA could not be loaded.")) 1034 cipher)
988 (let* ((base (file-name-sans-extension file)) 1035 (epg-context-set-armor context t)
989 (passkey (format "gpg:-%s" base)) 1036 (epg-context-set-passphrase-callback
990 (stash (concat base ".gpg")) 1037 context
991 ;; temporarily disable EPA 1038 (cons #'auth-source-token-passphrase-callback-function
992 (stashfile 1039 file))
993 (with-auth-source-epa-overrides 1040 (setq cipher (epg-encrypt-string context secret nil))
994 (make-temp-file "gpg-token" nil 1041 (with-temp-buffer
995 stash))) 1042 (insert cipher)
996 (epa-file-passphrase-alist 1043 (base64-encode-region (point-min) (point-max) t)
997 `((,stashfile 1044 (concat "gpg:" (buffer-substring-no-properties
998 . ,(password-read 1045 (point-min)
999 (format 1046 (point-max))))))
1000 "token pass for %s? "
1001 file)
1002 passkey)))))
1003 (write-region secret nil stashfile)
1004 ;; temporarily disable EPA
1005 (unwind-protect
1006 (with-auth-source-epa-overrides
1007 (with-temp-buffer
1008 (insert-file-contents stashfile)
1009 (base64-encode-region (point-min) (point-max) t)
1010 (concat "gpg:"
1011 (buffer-substring-no-properties
1012 (point-min)
1013 (point-max)))))
1014 (delete-file stashfile))))
1015 1047
1016(defun auth-source-netrc-normalize (alist filename) 1048(defun auth-source-netrc-normalize (alist filename)
1017 (mapcar (lambda (entry) 1049 (mapcar (lambda (entry)
@@ -1029,65 +1061,27 @@ Note that the MAX parameter is used so we can exit the parse early."
1029 1061
1030 ;; send back the secret in a function (lexical binding) 1062 ;; send back the secret in a function (lexical binding)
1031 (when (equal k "secret") 1063 (when (equal k "secret")
1032 (setq v (lexical-let ((v v) 1064 (setq v (lexical-let ((lexv v)
1033 (filename filename) 1065 (token-decoder nil))
1034 (base (file-name-nondirectory 1066 (when (string-match "^gpg:" lexv)
1035 filename)) 1067 ;; it's a GPG token: create a token decoder
1036 (token-decoder nil) 1068 ;; which unsets itself once
1037 (gpgdata nil) 1069 (setq token-decoder
1038 (stash nil)) 1070 (lambda (val)
1039 (setq stash (concat base ".gpg")) 1071 (prog1
1040 (when (string-match "gpg:\\(.+\\)" v) 1072 (auth-source-epa-extract-gpg-token
1041 (require 'epa nil t) 1073 val
1042 (unless (featurep 'epa) 1074 filename)
1043 (error "EPA could not be loaded.")) 1075 (setq token-decoder nil)))))
1044 (setq gpgdata (base64-decode-string 1076 (lambda ()
1045 (match-string 1 v))) 1077 (when token-decoder
1046 ;; it's a GPG token 1078 (setq lexv (funcall token-decoder lexv)))
1047 (setq 1079 lexv))))
1048 token-decoder 1080 (setq ret (plist-put ret
1049 (lambda (gpgdata) 1081 (intern (concat ":" k))
1050;;; FIXME: this relies on .gpg files being handled by EPA/EPG 1082 v))))
1051 (let* ((passkey (format "gpg:-%s" base)) 1083 ret))
1052 ;; temporarily disable EPA 1084 alist))
1053 (stashfile
1054 (with-auth-source-epa-overrides
1055 (make-temp-file "gpg-token" nil
1056 stash)))
1057 (epa-file-passphrase-alist
1058 `((,stashfile
1059 . ,(password-read
1060 (format
1061 "token pass for %s? "
1062 filename)
1063 passkey)))))
1064 (unwind-protect
1065 (progn
1066 ;; temporarily disable EPA
1067 (with-auth-source-epa-overrides
1068 (write-region gpgdata
1069 nil
1070 stashfile))
1071 (setq
1072 v
1073 (with-temp-buffer
1074 (insert-file-contents stashfile)
1075 (buffer-substring-no-properties
1076 (point-min)
1077 (point-max)))))
1078 (delete-file stashfile)))
1079 ;; clear out the decoder at end
1080 (setq token-decoder nil
1081 gpgdata nil))))
1082 (lambda ()
1083 (when token-decoder
1084 (funcall token-decoder gpgdata))
1085 v))))
1086 (setq ret (plist-put ret
1087 (intern (concat ":" k))
1088 v))))
1089 ret))
1090 alist))
1091 1085
1092;;; (setq secret (plist-get (nth 0 (auth-source-search :host t :type 'netrc :K 1 :max 1)) :secret)) 1086;;; (setq secret (plist-get (nth 0 (auth-source-search :host t :type 'netrc :K 1 :max 1)) :secret))
1093;;; (funcall secret) 1087;;; (funcall secret)
@@ -1097,7 +1091,7 @@ Note that the MAX parameter is used so we can exit the parse early."
1097 &key backend require create delete 1091 &key backend require create delete
1098 type max host user port 1092 type max host user port
1099 &allow-other-keys) 1093 &allow-other-keys)
1100"Given a property list SPEC, return search matches from the :backend. 1094 "Given a property list SPEC, return search matches from the :backend.
1101See `auth-source-search' for details on SPEC." 1095See `auth-source-search' for details on SPEC."
1102 ;; just in case, check that the type is correct (null or same as the backend) 1096 ;; just in case, check that the type is correct (null or same as the backend)
1103 (assert (or (null type) (eq type (oref backend type))) 1097 (assert (or (null type) (eq type (oref backend type)))
@@ -1147,9 +1141,9 @@ See `auth-source-search' for details on SPEC."
1147 ;; we know (because of an assertion in auth-source-search) that the 1141 ;; we know (because of an assertion in auth-source-search) that the
1148 ;; :create parameter is either t or a list (which includes nil) 1142 ;; :create parameter is either t or a list (which includes nil)
1149 (create-extra (if (eq t create) nil create)) 1143 (create-extra (if (eq t create) nil create))
1150 (current-data (car (auth-source-search :max 1 1144 (current-data (car (auth-source-search :max 1
1151 :host host 1145 :host host
1152 :port port))) 1146 :port port)))
1153 (required (append base-required create-extra)) 1147 (required (append base-required create-extra))
1154 (file (oref backend source)) 1148 (file (oref backend source))
1155 (add "") 1149 (add "")
@@ -1185,8 +1179,8 @@ See `auth-source-search' for details on SPEC."
1185 (let* ((data (aget valist r)) 1179 (let* ((data (aget valist r))
1186 ;; take the first element if the data is a list 1180 ;; take the first element if the data is a list
1187 (data (or (auth-source-netrc-element-or-first data) 1181 (data (or (auth-source-netrc-element-or-first data)
1188 (plist-get current-data 1182 (plist-get current-data
1189 (intern (format ":%s" r) obarray)))) 1183 (intern (format ":%s" r) obarray))))
1190 ;; this is the default to be offered 1184 ;; this is the default to be offered
1191 (given-default (aget auth-source-creation-defaults r)) 1185 (given-default (aget auth-source-creation-defaults r))
1192 ;; the default supplementals are simple: 1186 ;; the default supplementals are simple:
@@ -1233,8 +1227,8 @@ See `auth-source-search' for details on SPEC."
1233 (cond 1227 (cond
1234 ((and (null data) (eq r 'secret)) 1228 ((and (null data) (eq r 'secret))
1235 ;; Special case prompt for passwords. 1229 ;; Special case prompt for passwords.
1236;; TODO: make the default (setq auth-source-netrc-use-gpg-tokens `((,(if (boundp 'epa-file-auto-mode-alist-entry) (car (symbol-value 'epa-file-auto-mode-alist-entry)) "\\.gpg\\'") nil) (t gpg))) 1230 ;; TODO: make the default (setq auth-source-netrc-use-gpg-tokens `((,(if (boundp 'epa-file-auto-mode-alist-entry) (car (symbol-value 'epa-file-auto-mode-alist-entry)) "\\.gpg\\'") nil) (t gpg)))
1237;; TODO: or maybe leave as (setq auth-source-netrc-use-gpg-tokens 'never) 1231 ;; TODO: or maybe leave as (setq auth-source-netrc-use-gpg-tokens 'never)
1238 (let* ((ep (format "Use GPG password tokens in %s?" file)) 1232 (let* ((ep (format "Use GPG password tokens in %s?" file))
1239 (gpg-encrypt 1233 (gpg-encrypt
1240 (cond 1234 (cond
@@ -1251,7 +1245,7 @@ See `auth-source-search' for details on SPEC."
1251 (setq ret (cdr item)) 1245 (setq ret (cdr item))
1252 (setq check nil))))) 1246 (setq check nil)))))
1253 (t 'never))) 1247 (t 'never)))
1254 (plain (read-passwd prompt))) 1248 (plain (read-passwd prompt)))
1255 ;; ask if we don't know what to do (in which case 1249 ;; ask if we don't know what to do (in which case
1256 ;; auth-source-netrc-use-gpg-tokens must be a list) 1250 ;; auth-source-netrc-use-gpg-tokens must be a list)
1257 (unless gpg-encrypt 1251 (unless gpg-encrypt
@@ -1299,9 +1293,9 @@ See `auth-source-search' for details on SPEC."
1299 (secret "password") 1293 (secret "password")
1300 (port "port") ; redundant but clearer 1294 (port "port") ; redundant but clearer
1301 (t (symbol-name r))) 1295 (t (symbol-name r)))
1302 (if (string-match "[\" ]" data) 1296 (if (string-match "[\" ]" data)
1303 (format "%S" data) 1297 (format "%S" data)
1304 data))))) 1298 data)))))
1305 (setq add (concat add (funcall printer))))))) 1299 (setq add (concat add (funcall printer)))))))
1306 1300
1307 (plist-put 1301 (plist-put
@@ -1363,9 +1357,10 @@ Respects `auth-source-save-behavior'. Uses
1363 (help-mode)))) 1357 (help-mode))))
1364 (?n (setq add "" 1358 (?n (setq add ""
1365 done t)) 1359 done t))
1366 (?N (setq add "" 1360 (?N
1367 done t 1361 (setq add ""
1368 auth-source-save-behavior nil)) 1362 done t)
1363 (customize-save-variable 'auth-source-save-behavior nil))
1369 (?e (setq add (read-string "Line to add: " add))) 1364 (?e (setq add (read-string "Line to add: " add)))
1370 (t nil))) 1365 (t nil)))
1371 1366
@@ -1456,11 +1451,11 @@ authentication tokens:
1456 (eq t (plist-get spec k))) 1451 (eq t (plist-get spec k)))
1457 nil 1452 nil
1458 (list k (plist-get spec k)))) 1453 (list k (plist-get spec k))))
1459 search-keys))) 1454 search-keys)))
1460 ;; needed keys (always including host, login, port, and secret) 1455 ;; needed keys (always including host, login, port, and secret)
1461 (returned-keys (mm-delete-duplicates (append 1456 (returned-keys (mm-delete-duplicates (append
1462 '(:host :login :port :secret) 1457 '(:host :login :port :secret)
1463 search-keys))) 1458 search-keys)))
1464 (items (loop for item in (apply 'secrets-search-items coll search-spec) 1459 (items (loop for item in (apply 'secrets-search-items coll search-spec)
1465 unless (and (stringp label) 1460 unless (and (stringp label)
1466 (not (string-match label item))) 1461 (not (string-match label item)))
@@ -1502,6 +1497,210 @@ authentication tokens:
1502 ;; (apply 'secrets-create-item (auth-get-source entry) name passwd spec) 1497 ;; (apply 'secrets-create-item (auth-get-source entry) name passwd spec)
1503 (debug spec)) 1498 (debug spec))
1504 1499
1500;;; Backend specific parsing: PLSTORE backend
1501
1502(defun* auth-source-plstore-search (&rest
1503 spec
1504 &key backend create delete label
1505 type max host user port
1506 &allow-other-keys)
1507 "Search the PLSTORE; spec is like `auth-source'."
1508 (let* ((store (oref backend data))
1509 (max (or max 5000)) ; sanity check: default to stop at 5K
1510 (ignored-keys '(:create :delete :max :backend :require))
1511 (search-keys (loop for i below (length spec) by 2
1512 unless (memq (nth i spec) ignored-keys)
1513 collect (nth i spec)))
1514 ;; build a search spec without the ignored keys
1515 ;; if a search key is nil or t (match anything), we skip it
1516 (search-spec (apply 'append (mapcar
1517 (lambda (k)
1518 (let ((v (plist-get spec k)))
1519 (if (or (null v)
1520 (eq t v))
1521 nil
1522 (if (stringp v)
1523 (setq v (list v)))
1524 (list k v))))
1525 search-keys)))
1526 ;; needed keys (always including host, login, port, and secret)
1527 (returned-keys (mm-delete-duplicates (append
1528 '(:host :login :port :secret)
1529 search-keys)))
1530 (items (plstore-find store search-spec))
1531 (item-names (mapcar #'car items))
1532 (items (butlast items (- (length items) max)))
1533 ;; convert the item to a full plist
1534 (items (mapcar (lambda (item)
1535 (let* ((plist (copy-tree (cdr item)))
1536 (secret (plist-member plist :secret)))
1537 (if secret
1538 (setcar
1539 (cdr secret)
1540 (lexical-let ((v (car (cdr secret))))
1541 (lambda () v))))
1542 plist))
1543 items))
1544 ;; ensure each item has each key in `returned-keys'
1545 (items (mapcar (lambda (plist)
1546 (append
1547 (apply 'append
1548 (mapcar (lambda (req)
1549 (if (plist-get plist req)
1550 nil
1551 (list req nil)))
1552 returned-keys))
1553 plist))
1554 items)))
1555 (cond
1556 ;; if we need to create an entry AND none were found to match
1557 ((and create
1558 (not items))
1559
1560 ;; create based on the spec and record the value
1561 (setq items (or
1562 ;; if the user did not want to create the entry
1563 ;; in the file, it will be returned
1564 (apply (slot-value backend 'create-function) spec)
1565 ;; if not, we do the search again without :create
1566 ;; to get the updated data.
1567
1568 ;; the result will be returned, even if the search fails
1569 (apply 'auth-source-plstore-search
1570 (plist-put spec :create nil)))))
1571 ((and delete
1572 item-names)
1573 (dolist (item-name item-names)
1574 (plstore-delete store item-name))
1575 (plstore-save store)))
1576 items))
1577
1578(defun* auth-source-plstore-create (&rest spec
1579 &key backend
1580 secret host user port create
1581 &allow-other-keys)
1582 (let* ((base-required '(host user port secret))
1583 (base-secret '(secret))
1584 ;; we know (because of an assertion in auth-source-search) that the
1585 ;; :create parameter is either t or a list (which includes nil)
1586 (create-extra (if (eq t create) nil create))
1587 (current-data (car (auth-source-search :max 1
1588 :host host
1589 :port port)))
1590 (required (append base-required create-extra))
1591 (file (oref backend source))
1592 (add "")
1593 ;; `valist' is an alist
1594 valist
1595 ;; `artificial' will be returned if no creation is needed
1596 artificial
1597 secret-artificial)
1598
1599 ;; only for base required elements (defined as function parameters):
1600 ;; fill in the valist with whatever data we may have from the search
1601 ;; we complete the first value if it's a list and use the value otherwise
1602 (dolist (br base-required)
1603 (when (symbol-value br)
1604 (let ((br-choice (cond
1605 ;; all-accepting choice (predicate is t)
1606 ((eq t (symbol-value br)) nil)
1607 ;; just the value otherwise
1608 (t (symbol-value br)))))
1609 (when br-choice
1610 (aput 'valist br br-choice)))))
1611
1612 ;; for extra required elements, see if the spec includes a value for them
1613 (dolist (er create-extra)
1614 (let ((name (concat ":" (symbol-name er)))
1615 (keys (loop for i below (length spec) by 2
1616 collect (nth i spec))))
1617 (dolist (k keys)
1618 (when (equal (symbol-name k) name)
1619 (aput 'valist er (plist-get spec k))))))
1620
1621 ;; for each required element
1622 (dolist (r required)
1623 (let* ((data (aget valist r))
1624 ;; take the first element if the data is a list
1625 (data (or (auth-source-netrc-element-or-first data)
1626 (plist-get current-data
1627 (intern (format ":%s" r) obarray))))
1628 ;; this is the default to be offered
1629 (given-default (aget auth-source-creation-defaults r))
1630 ;; the default supplementals are simple:
1631 ;; for the user, try `given-default' and then (user-login-name);
1632 ;; otherwise take `given-default'
1633 (default (cond
1634 ((and (not given-default) (eq r 'user))
1635 (user-login-name))
1636 (t given-default)))
1637 (printable-defaults (list
1638 (cons 'user
1639 (or
1640 (auth-source-netrc-element-or-first
1641 (aget valist 'user))
1642 (plist-get artificial :user)
1643 "[any user]"))
1644 (cons 'host
1645 (or
1646 (auth-source-netrc-element-or-first
1647 (aget valist 'host))
1648 (plist-get artificial :host)
1649 "[any host]"))
1650 (cons 'port
1651 (or
1652 (auth-source-netrc-element-or-first
1653 (aget valist 'port))
1654 (plist-get artificial :port)
1655 "[any port]"))))
1656 (prompt (or (aget auth-source-creation-prompts r)
1657 (case r
1658 (secret "%p password for %u@%h: ")
1659 (user "%p user name for %h: ")
1660 (host "%p host name for user %u: ")
1661 (port "%p port for %u@%h: "))
1662 (format "Enter %s (%%u@%%h:%%p): " r)))
1663 (prompt (auth-source-format-prompt
1664 prompt
1665 `((?u ,(aget printable-defaults 'user))
1666 (?h ,(aget printable-defaults 'host))
1667 (?p ,(aget printable-defaults 'port))))))
1668
1669 ;; Store the data, prompting for the password if needed.
1670 (setq data
1671 (cond
1672 ((and (null data) (eq r 'secret))
1673 ;; Special case prompt for passwords.
1674 (read-passwd prompt))
1675 ((null data)
1676 (when default
1677 (setq prompt
1678 (if (string-match ": *\\'" prompt)
1679 (concat (substring prompt 0 (match-beginning 0))
1680 " (default " default "): ")
1681 (concat prompt "(default " default ") "))))
1682 (read-string prompt nil nil default))
1683 (t (or data default))))
1684
1685 (when data
1686 (if (member r base-secret)
1687 (setq secret-artificial
1688 (plist-put secret-artificial
1689 (intern (concat ":" (symbol-name r)))
1690 data))
1691 (setq artificial (plist-put artificial
1692 (intern (concat ":" (symbol-name r)))
1693 data))))))
1694 (plstore-put (oref backend data)
1695 (sha1 (format "%s@%s:%s"
1696 (plist-get artificial :user)
1697 (plist-get artificial :host)
1698 (plist-get artificial :port)))
1699 artificial secret-artificial)
1700 (if (y-or-n-p (format "Save auth info to file %s? "
1701 (plstore-get-file (oref backend data))))
1702 (plstore-save (oref backend data)))))
1703
1505;;; older API 1704;;; older API
1506 1705
1507;;; (auth-source-user-or-password '("login" "password") "imap.myhost.com" t "tzz") 1706;;; (auth-source-user-or-password '("login" "password") "imap.myhost.com" t "tzz")
@@ -1576,14 +1775,14 @@ MODE can be \"login\" or \"password\"."
1576 (cond 1775 (cond
1577 ((equal "password" m) 1776 ((equal "password" m)
1578 (push (if (plist-get choice :secret) 1777 (push (if (plist-get choice :secret)
1579 (funcall (plist-get choice :secret)) 1778 (funcall (plist-get choice :secret))
1580 nil) found)) 1779 nil) found))
1581 ((equal "login" m) 1780 ((equal "login" m)
1582 (push (plist-get choice :user) found))))) 1781 (push (plist-get choice :user) found)))))
1583 (setq found (nreverse found)) 1782 (setq found (nreverse found))
1584 (setq found (if listy found (car-safe found))))) 1783 (setq found (if listy found (car-safe found)))))
1585 1784
1586 found)) 1785 found))
1587 1786
1588(provide 'auth-source) 1787(provide 'auth-source)
1589 1788
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 6c3ad01eabf..7255be416eb 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -163,8 +163,7 @@
163 "*All headers that start with this regexp will be hidden. 163 "*All headers that start with this regexp will be hidden.
164This variable can also be a list of regexps of headers to be ignored. 164This variable can also be a list of regexps of headers to be ignored.
165If `gnus-visible-headers' is non-nil, this variable will be ignored." 165If `gnus-visible-headers' is non-nil, this variable will be ignored."
166 :type '(choice :custom-show nil 166 :type '(choice regexp
167 regexp
168 (repeat regexp)) 167 (repeat regexp))
169 :group 'gnus-article-hiding) 168 :group 'gnus-article-hiding)
170 169
@@ -6832,23 +6831,16 @@ If given a prefix, show the hidden text instead."
6832 (numberp article)) 6831 (numberp article))
6833 (let ((gnus-override-method gnus-override-method) 6832 (let ((gnus-override-method gnus-override-method)
6834 (methods (and (stringp article) 6833 (methods (and (stringp article)
6835 gnus-refer-article-method)) 6834 (with-current-buffer gnus-summary-buffer
6835 (gnus-refer-article-methods))))
6836 (backend (car (gnus-find-method-for-group 6836 (backend (car (gnus-find-method-for-group
6837 gnus-newsgroup-name))) 6837 gnus-newsgroup-name)))
6838 result 6838 result
6839 (inhibit-read-only t)) 6839 (inhibit-read-only t))
6840 (if (or (not (listp methods))
6841 (and (symbolp (car methods))
6842 (assq (car methods) nnoo-definition-alist)))
6843 (setq methods (list methods)))
6844 (when (and (null gnus-override-method) 6840 (when (and (null gnus-override-method)
6845 methods) 6841 methods)
6846 (setq gnus-override-method (pop methods))) 6842 (setq gnus-override-method (pop methods)))
6847 (while (not result) 6843 (while (not result)
6848 (when (eq gnus-override-method 'current)
6849 (setq gnus-override-method
6850 (with-current-buffer gnus-summary-buffer
6851 gnus-current-select-method)))
6852 (erase-buffer) 6844 (erase-buffer)
6853 (gnus-kill-all-overlays) 6845 (gnus-kill-all-overlays)
6854 (let ((gnus-newsgroup-name group)) 6846 (let ((gnus-newsgroup-name group))
diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el
index 1709b1c4a05..40f5abda4f8 100644
--- a/lisp/gnus/gnus-draft.el
+++ b/lisp/gnus/gnus-draft.el
@@ -327,8 +327,7 @@ If DONT-POP is nil, display the buffer after setting it up."
327(defun gnus-draft-clear-marks () 327(defun gnus-draft-clear-marks ()
328 (setq gnus-newsgroup-reads nil 328 (setq gnus-newsgroup-reads nil
329 gnus-newsgroup-marked nil 329 gnus-newsgroup-marked nil
330 gnus-newsgroup-unreads 330 gnus-newsgroup-unreads (nndraft-articles)))
331 (gnus-uncompress-range (gnus-active gnus-newsgroup-name))))
332 331
333(provide 'gnus-draft) 332(provide 'gnus-draft)
334 333
diff --git a/lisp/gnus/gnus-fun.el b/lisp/gnus/gnus-fun.el
index cb495623af2..1cc11383893 100644
--- a/lisp/gnus/gnus-fun.el
+++ b/lisp/gnus/gnus-fun.el
@@ -54,10 +54,7 @@
54 "convert -scale 48x48! %s xbm:- | xbm2xface.pl" 54 "convert -scale 48x48! %s xbm:- | xbm2xface.pl"
55 "Command for converting an image to an X-Face. 55 "Command for converting an image to an X-Face.
56The command must take a image filename (use \"%s\") as input. 56The command must take a image filename (use \"%s\") as input.
57The output must be the Face header data on stdout in PNG format. 57The output must be the X-Face header data on stdout in PNG format."
58
59By default it takes a GIF filename and output the X-Face header data
60on stdout."
61 :version "22.1" 58 :version "22.1"
62 :group 'gnus-fun 59 :group 'gnus-fun
63 :type '(choice (const :tag "giftopnm, netpbm (GIF input only)" 60 :type '(choice (const :tag "giftopnm, netpbm (GIF input only)"
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 518f215a7ba..2ea2a5c9bc7 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -2415,7 +2415,7 @@ Valid input formats include:
2415 (gnus-read-ephemeral-gmane-group group start range))) 2415 (gnus-read-ephemeral-gmane-group group start range)))
2416 2416
2417(defcustom gnus-bug-group-download-format-alist 2417(defcustom gnus-bug-group-download-format-alist
2418 '((emacs . "http://debbugs.gnu.org/%s;mbox=yes;mboxmaint=yes") 2418 '((emacs . "http://debbugs.gnu.org/%s;mboxstat=yes")
2419 (debian 2419 (debian
2420 . "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s&mbox=yes;mboxmaint=yes")) 2420 . "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s&mbox=yes;mboxmaint=yes"))
2421 "Alist of symbols for bug trackers and the corresponding URL format string. 2421 "Alist of symbols for bug trackers and the corresponding URL format string.
@@ -2428,23 +2428,28 @@ the bug number, and browsing the URL must return mbox output."
2428 :version "24.1" 2428 :version "24.1"
2429 :type '(repeat (cons (symbol) (string :tag "URL format string")))) 2429 :type '(repeat (cons (symbol) (string :tag "URL format string"))))
2430 2430
2431(defun gnus-read-ephemeral-bug-group (number mbox-url) 2431(defun gnus-read-ephemeral-bug-group (ids mbox-url &optional window-conf)
2432 "Browse bug NUMBER as ephemeral group." 2432 "Browse bug NUMBER as ephemeral group."
2433 (interactive (list (read-string "Enter bug number: " 2433 (interactive (list (read-string "Enter bug number: "
2434 (thing-at-point 'word) nil) 2434 (thing-at-point 'word) nil)
2435 ;; FIXME: Add completing-read from 2435 ;; FIXME: Add completing-read from
2436 ;; `gnus-emacs-bug-group-download-format' ... 2436 ;; `gnus-emacs-bug-group-download-format' ...
2437 (cdr (assoc 'emacs gnus-bug-group-download-format-alist)))) 2437 (cdr (assoc 'emacs gnus-bug-group-download-format-alist))))
2438 (when (stringp number) 2438 (when (stringp ids)
2439 (setq number (string-to-number number))) 2439 (setq ids (string-to-number ids)))
2440 (let ((tmpfile (mm-make-temp-file "gnus-temp-group-"))) 2440 (unless (listp ids)
2441 (setq ids (list ids)))
2442 (let ((tmpfile (mm-make-temp-file "gnus-temp-group-"))
2443 (coding-system-for-write 'binary)
2444 (coding-system-for-read 'binary))
2441 (with-temp-file tmpfile 2445 (with-temp-file tmpfile
2442 (url-insert-file-contents (format mbox-url number)) 2446 (dolist (id ids)
2447 (url-insert-file-contents (format mbox-url id)))
2443 (goto-char (point-min)) 2448 (goto-char (point-min))
2444 ;; Add the debbugs address so that we can respond to reports easily. 2449 ;; Add the debbugs address so that we can respond to reports easily.
2445 (while (re-search-forward "^To: " nil t) 2450 (while (re-search-forward "^To: " nil t)
2446 (end-of-line) 2451 (end-of-line)
2447 (insert (format ", %s@%s" number 2452 (insert (format ", %s@%s" (car ids)
2448 (gnus-replace-in-string 2453 (gnus-replace-in-string
2449 (gnus-replace-in-string mbox-url "^http://" "") 2454 (gnus-replace-in-string mbox-url "^http://" "")
2450 "/.*$" "")))) 2455 "/.*$" ""))))
@@ -2452,7 +2457,8 @@ the bug number, and browsing the URL must return mbox output."
2452 (gnus-group-read-ephemeral-group 2457 (gnus-group-read-ephemeral-group
2453 "gnus-read-ephemeral-bug" 2458 "gnus-read-ephemeral-bug"
2454 `(nndoc ,tmpfile 2459 `(nndoc ,tmpfile
2455 (nndoc-article-type mbox)))) 2460 (nndoc-article-type mbox))
2461 nil window-conf))
2456 (delete-file tmpfile))) 2462 (delete-file tmpfile)))
2457 2463
2458(defun gnus-read-ephemeral-debian-bug-group (number) 2464(defun gnus-read-ephemeral-debian-bug-group (number)
@@ -2463,13 +2469,23 @@ the bug number, and browsing the URL must return mbox output."
2463 number 2469 number
2464 (cdr (assoc 'debian gnus-bug-group-download-format-alist)))) 2470 (cdr (assoc 'debian gnus-bug-group-download-format-alist))))
2465 2471
2466(defun gnus-read-ephemeral-emacs-bug-group (number) 2472(defvar debbugs-gnu-bug-number) ; debbugs-gnu
2467 "Browse Emacs bug NUMBER as ephemeral group." 2473
2468 (interactive (list (read-string "Enter bug number: " 2474(defun gnus-read-ephemeral-emacs-bug-group (ids &optional window-conf)
2469 (thing-at-point 'word) nil))) 2475 "Browse Emacs bugs IDS as an ephemeral group."
2476 (interactive (list (string-to-number
2477 (read-string "Enter bug number: "
2478 (thing-at-point 'word) nil))))
2479 (unless (listp ids)
2480 (setq ids (list ids)))
2470 (gnus-read-ephemeral-bug-group 2481 (gnus-read-ephemeral-bug-group
2471 number 2482 ids
2472 (cdr (assoc 'emacs gnus-bug-group-download-format-alist)))) 2483 (cdr (assoc 'emacs gnus-bug-group-download-format-alist))
2484 window-conf)
2485 (when (fboundp 'debbugs-gnu-summary-mode)
2486 (with-current-buffer (window-buffer (selected-window))
2487 (debbugs-gnu-summary-mode 1)
2488 (set (make-local-variable 'debbugs-gnu-bug-number) (car ids)))))
2473 2489
2474(defun gnus-group-jump-to-group (group &optional prompt) 2490(defun gnus-group-jump-to-group (group &optional prompt)
2475 "Jump to newsgroup GROUP. 2491 "Jump to newsgroup GROUP.
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index ef15a479892..b9b191cd09c 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -516,11 +516,12 @@ If BUFFER, insert the article in that group."
516 article (gnus-group-real-name group) 516 article (gnus-group-real-name group)
517 (nth 1 gnus-command-method) buffer))) 517 (nth 1 gnus-command-method) buffer)))
518 518
519(defun gnus-request-thread (header) 519(defun gnus-request-thread (header group)
520 "Request the headers in the thread containing the article specified by HEADER." 520 "Request the headers in the thread containing the article specified by HEADER."
521 (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name))) 521 (let ((gnus-command-method (gnus-find-method-for-group group)))
522 (funcall (gnus-get-function gnus-command-method 'request-thread) 522 (funcall (gnus-get-function gnus-command-method 'request-thread)
523 header))) 523 header
524 (gnus-group-real-name group))))
524 525
525(defun gnus-warp-to-article () 526(defun gnus-warp-to-article ()
526 "Warps from an article in a virtual group to the article in its 527 "Warps from an article in a virtual group to the article in its
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index e256446c016..9d3ec25c03a 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1455,24 +1455,22 @@ If YANK is non-nil, include the original article."
1455 (goto-char (point-min))) 1455 (goto-char (point-min)))
1456 (message-pop-to-buffer "*Gnus Bug*")) 1456 (message-pop-to-buffer "*Gnus Bug*"))
1457 (let ((message-this-is-mail t)) 1457 (let ((message-this-is-mail t))
1458 (message-setup `((To . ,gnus-maintainer) (Subject . "")))) 1458 (message-setup `((To . ,gnus-maintainer)
1459 (Subject . "")
1460 (X-Debbugs-Package
1461 . ,(format "%s" gnus-bug-package))
1462 (X-Debbugs-Version
1463 . ,(format "%s" (gnus-continuum-version))))))
1459 (when gnus-bug-create-help-buffer 1464 (when gnus-bug-create-help-buffer
1460 (push `(gnus-bug-kill-buffer) message-send-actions)) 1465 (push `(gnus-bug-kill-buffer) message-send-actions))
1461 (goto-char (point-min)) 1466 (goto-char (point-min))
1462 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$")) 1467 (message-goto-body)
1463 (forward-line 1) 1468 (insert "\n\n\n\n\n")
1464 (insert (gnus-version) "\n" 1469 (insert (gnus-version) "\n"
1465 (emacs-version) "\n") 1470 (emacs-version) "\n")
1466 (when (and (boundp 'nntp-server-type) 1471 (when (and (boundp 'nntp-server-type)
1467 (stringp nntp-server-type)) 1472 (stringp nntp-server-type))
1468 (insert nntp-server-type)) 1473 (insert nntp-server-type))
1469 (insert "\n\n\n\n\n")
1470 (let (text)
1471 (with-current-buffer (gnus-get-buffer-create " *gnus environment info*")
1472 (erase-buffer)
1473 (gnus-debug)
1474 (setq text (buffer-string)))
1475 (insert "<#part type=application/emacs-lisp disposition=inline description=\"User settings\">\n" text "\n<#/part>"))
1476 (goto-char (point-min)) 1474 (goto-char (point-min))
1477 (search-forward "Subject: " nil t) 1475 (search-forward "Subject: " nil t)
1478 (message ""))) 1476 (message "")))
@@ -1492,62 +1490,6 @@ If YANK is non-nil, include the original article."
1492 (with-current-buffer buffer 1490 (with-current-buffer buffer
1493 (message-yank-buffer gnus-article-buffer)))) 1491 (message-yank-buffer gnus-article-buffer))))
1494 1492
1495(defun gnus-debug ()
1496 "Attempts to go through the Gnus source file and report what variables have been changed.
1497The source file has to be in the Emacs load path."
1498 (interactive)
1499 (let ((files gnus-debug-files)
1500 (point (point))
1501 file expr olist sym)
1502 (gnus-message 4 "Please wait while we snoop your variables...")
1503 (sit-for 0)
1504 ;; Go through all the files looking for non-default values for variables.
1505 (with-current-buffer (gnus-get-buffer-create " *gnus bug info*")
1506 (while files
1507 (erase-buffer)
1508 (when (and (setq file (locate-library (pop files)))
1509 (file-exists-p file))
1510 (insert-file-contents file)
1511 (goto-char (point-min))
1512 (if (not (re-search-forward "^;;* *Internal variables" nil t))
1513 (gnus-message 4 "Malformed sources in file %s" file)
1514 (narrow-to-region (point-min) (point))
1515 (goto-char (point-min))
1516 (while (setq expr (ignore-errors (read (current-buffer))))
1517 (ignore-errors
1518 (and (or (eq (car expr) 'defvar)
1519 (eq (car expr) 'defcustom))
1520 (stringp (nth 3 expr))
1521 (not (memq (nth 1 expr) gnus-debug-exclude-variables))
1522 (or (not (boundp (nth 1 expr)))
1523 (not (equal (eval (nth 2 expr))
1524 (symbol-value (nth 1 expr)))))
1525 (push (nth 1 expr) olist)))))))
1526 (kill-buffer (current-buffer)))
1527 (when (setq olist (nreverse olist))
1528 (insert "------------------ Environment follows ------------------\n\n"))
1529 (while olist
1530 (if (boundp (car olist))
1531 (ignore-errors
1532 (gnus-pp
1533 `(setq ,(car olist)
1534 ,(if (or (consp (setq sym (symbol-value (car olist))))
1535 (and (symbolp sym)
1536 (not (or (eq sym nil)
1537 (eq sym t)))))
1538 (list 'quote (symbol-value (car olist)))
1539 (symbol-value (car olist))))))
1540 (insert ";; (makeunbound '" (symbol-name (car olist)) ")\n"))
1541 (setq olist (cdr olist)))
1542 (insert "\n\n")
1543 ;; Remove any control chars - they seem to cause trouble for some
1544 ;; mailers. (Byte-compiled output from the stuff above.)
1545 (goto-char point)
1546 (while (re-search-forward (mm-string-to-multibyte
1547 "[\000-\010\013-\037\200-\237]") nil t)
1548 (replace-match (format "\\%03o" (string-to-char (match-string 0)))
1549 t t))))
1550
1551;;; Treatment of rejected articles. 1493;;; Treatment of rejected articles.
1552;;; Bounced mail. 1494;;; Bounced mail.
1553 1495
@@ -1788,7 +1730,10 @@ this is a reply."
1788 "Configure posting styles according to `gnus-posting-styles'." 1730 "Configure posting styles according to `gnus-posting-styles'."
1789 (unless gnus-inhibit-posting-styles 1731 (unless gnus-inhibit-posting-styles
1790 (let ((group (or group-name gnus-newsgroup-name "")) 1732 (let ((group (or group-name gnus-newsgroup-name ""))
1791 (styles gnus-posting-styles) 1733 (styles (if (gnus-buffer-live-p gnus-summary-buffer)
1734 (with-current-buffer gnus-summary-buffer
1735 gnus-posting-styles)
1736 gnus-posting-styles))
1792 style match attribute value v results 1737 style match attribute value v results
1793 filep name address element) 1738 filep name address element)
1794 ;; If the group has a posting-style parameter, add it at the end with a 1739 ;; If the group has a posting-style parameter, add it at the end with a
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index aa9af012a1c..7c63d5e2653 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -1043,7 +1043,7 @@ If LEVEL is non-nil, the news will be set up at level LEVEL."
1043 1043
1044 ;; Find the number of unread articles in each non-dead group. 1044 ;; Find the number of unread articles in each non-dead group.
1045 (let ((gnus-read-active-file (and (not level) gnus-read-active-file))) 1045 (let ((gnus-read-active-file (and (not level) gnus-read-active-file)))
1046 (gnus-get-unread-articles level)))) 1046 (gnus-get-unread-articles level dont-connect))))
1047 1047
1048(defun gnus-call-subscribe-functions (method group) 1048(defun gnus-call-subscribe-functions (method group)
1049 "Call METHOD to subscribe GROUP. 1049 "Call METHOD to subscribe GROUP.
@@ -1606,7 +1606,7 @@ If SCAN, request a scan of that group as well."
1606 1606
1607;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb' 1607;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb'
1608;; and compute how many unread articles there are in each group. 1608;; and compute how many unread articles there are in each group.
1609(defun gnus-get-unread-articles (&optional level) 1609(defun gnus-get-unread-articles (&optional level dont-connect)
1610 (setq gnus-server-method-cache nil) 1610 (setq gnus-server-method-cache nil)
1611 (require 'gnus-agent) 1611 (require 'gnus-agent)
1612 (let* ((newsrc (cdr gnus-newsrc-alist)) 1612 (let* ((newsrc (cdr gnus-newsrc-alist))
@@ -1702,12 +1702,13 @@ If SCAN, request a scan of that group as well."
1702 1702
1703 ;; If we have primary/secondary select methods, but no groups from 1703 ;; If we have primary/secondary select methods, but no groups from
1704 ;; them, we still want to issue a retrieval request from them. 1704 ;; them, we still want to issue a retrieval request from them.
1705 (dolist (method (cons gnus-select-method 1705 (unless dont-connect
1706 gnus-secondary-select-methods)) 1706 (dolist (method (cons gnus-select-method
1707 (when (and (not (assoc method type-cache)) 1707 gnus-secondary-select-methods))
1708 (gnus-check-backend-function 'request-list (car method))) 1708 (when (and (not (assoc method type-cache))
1709 (with-current-buffer nntp-server-buffer 1709 (gnus-check-backend-function 'request-list (car method)))
1710 (gnus-read-active-file-1 method nil)))) 1710 (with-current-buffer nntp-server-buffer
1711 (gnus-read-active-file-1 method nil)))))
1711 1712
1712 ;; Start early async retrieval of data. 1713 ;; Start early async retrieval of data.
1713 (let ((done-methods nil) 1714 (let ((done-methods nil)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 4c059e9332a..5a817e12104 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -8970,7 +8970,7 @@ variable."
8970 'list gnus-newsgroup-headers 8970 'list gnus-newsgroup-headers
8971 (if (gnus-check-backend-function 8971 (if (gnus-check-backend-function
8972 'request-thread gnus-newsgroup-name) 8972 'request-thread gnus-newsgroup-name)
8973 (gnus-request-thread header) 8973 (gnus-request-thread header gnus-newsgroup-name)
8974 (let* ((last (if (numberp limit) 8974 (let* ((last (if (numberp limit)
8975 (min (+ (mail-header-number header) 8975 (min (+ (mail-header-number header)
8976 limit) 8976 limit)
@@ -9050,7 +9050,12 @@ variable."
9050 (dolist (method gnus-refer-article-method) 9050 (dolist (method gnus-refer-article-method)
9051 (push (if (eq 'current method) 9051 (push (if (eq 'current method)
9052 gnus-current-select-method 9052 gnus-current-select-method
9053 method) 9053 (if (eq 'nnir (car method))
9054 (list
9055 'nnir
9056 (or (cadr method)
9057 (gnus-method-to-server gnus-current-select-method)))
9058 method))
9054 out)) 9059 out))
9055 (nreverse out))) 9060 (nreverse out)))
9056 ;; One single select method. 9061 ;; One single select method.
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 3f66b45aaab..7155c7f9607 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -540,8 +540,7 @@ but also to the ones displayed in the echo area."
540 540
541(eval-when-compile 541(eval-when-compile
542 (defmacro gnus-message-with-timestamp-1 (format-string args) 542 (defmacro gnus-message-with-timestamp-1 (format-string args)
543 (let ((timestamp '((format-time-string "%Y%m%dT%H%M%S" time) 543 (let ((timestamp '(format-time-string "%Y%m%dT%H%M%S.%3N> " time)))
544 "." (format "%03d" (/ (nth 2 time) 1000)) "> ")))
545 (if (featurep 'xemacs) 544 (if (featurep 'xemacs)
546 `(let (str time) 545 `(let (str time)
547 (if (or (and (null ,format-string) (null ,args)) 546 (if (or (and (null ,format-string) (null ,args))
@@ -554,10 +553,10 @@ but also to the ones displayed in the echo area."
554 (cond ((eq gnus-add-timestamp-to-message 'log) 553 (cond ((eq gnus-add-timestamp-to-message 'log)
555 (setq time (current-time)) 554 (setq time (current-time))
556 (display-message 'no-log str) 555 (display-message 'no-log str)
557 (log-message 'message (concat ,@timestamp str))) 556 (log-message 'message (concat ,timestamp str)))
558 (gnus-add-timestamp-to-message 557 (gnus-add-timestamp-to-message
559 (setq time (current-time)) 558 (setq time (current-time))
560 (display-message 'message (concat ,@timestamp str))) 559 (display-message 'message (concat ,timestamp str)))
561 (t 560 (t
562 (display-message 'message str)))) 561 (display-message 'message str))))
563 str) 562 str)
@@ -571,7 +570,7 @@ but also to the ones displayed in the echo area."
571 (setq time (current-time)) 570 (setq time (current-time))
572 (with-current-buffer (get-buffer-create "*Messages*") 571 (with-current-buffer (get-buffer-create "*Messages*")
573 (goto-char (point-max)) 572 (goto-char (point-max))
574 (insert ,@timestamp str "\n") 573 (insert ,timestamp str "\n")
575 (forward-line (- message-log-max)) 574 (forward-line (- message-log-max))
576 (delete-region (point-min) (point)) 575 (delete-region (point-min) (point))
577 (goto-char (point-max)))) 576 (goto-char (point-max))))
@@ -585,7 +584,7 @@ but also to the ones displayed in the echo area."
585 (and ,format-string str) 584 (and ,format-string str)
586 (message nil)) 585 (message nil))
587 (setq time (current-time)) 586 (setq time (current-time))
588 (message "%s" (concat ,@timestamp str)) 587 (message "%s" (concat ,timestamp str))
589 str)) 588 str))
590 (t 589 (t
591 (apply 'message ,format-string ,args)))))))) 590 (apply 'message ,format-string ,args))))))))
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 20986d25942..ac7db0e1d69 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1423,10 +1423,6 @@ no need to set this variable."
1423 1423
1424(defcustom gnus-refer-article-method 'current 1424(defcustom gnus-refer-article-method 'current
1425 "Preferred method for fetching an article by Message-ID. 1425 "Preferred method for fetching an article by Message-ID.
1426If you are reading news from the local spool (with nnspool), fetching
1427articles by Message-ID is painfully slow. By setting this method to an
1428nntp method, you might get acceptable results.
1429
1430The value of this variable must be a valid select method as discussed 1426The value of this variable must be a valid select method as discussed
1431in the documentation of `gnus-select-method'. 1427in the documentation of `gnus-select-method'.
1432 1428
@@ -2655,9 +2651,13 @@ such as a mark that says whether an article is stored in the cache
2655(defvar gnus-have-read-active-file nil) 2651(defvar gnus-have-read-active-file nil)
2656 2652
2657(defconst gnus-maintainer 2653(defconst gnus-maintainer
2658 "bugs@gnus.org (The Gnus Bugfixing Girls + Boys)" 2654 "submit@debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)"
2659 "The mail address of the Gnus maintainers.") 2655 "The mail address of the Gnus maintainers.")
2660 2656
2657(defconst gnus-bug-package
2658 "gnus"
2659 "The package to use in the bug submission.")
2660
2661(defvar gnus-info-nodes 2661(defvar gnus-info-nodes
2662 '((gnus-group-mode "(gnus)Group Buffer") 2662 '((gnus-group-mode "(gnus)Group Buffer")
2663 (gnus-summary-mode "(gnus)Summary Buffer") 2663 (gnus-summary-mode "(gnus)Summary Buffer")
@@ -2962,8 +2962,8 @@ with some simple extensions.
2962 on level one 2962 on level one
2963%R \"A\" if this article has been replied to, \" \" 2963%R \"A\" if this article has been replied to, \" \"
2964 otherwise (character) 2964 otherwise (character)
2965%U Status of this article (character, \"R\", \"K\", 2965%U \"Read\" status of this article.
2966 \"-\" or \" \") 2966 See Info node `(gnus)Marking Articles'
2967%[ Opening bracket (character, \"[\" or \"<\") 2967%[ Opening bracket (character, \"[\" or \"<\")
2968%] Closing bracket (character, \"]\" or \">\") 2968%] Closing bracket (character, \"]\" or \">\")
2969%> Spaces of length thread-level (string) 2969%> Spaces of length thread-level (string)
@@ -4381,6 +4381,13 @@ prompt the user for the name of an NNTP server to use."
4381 (gnus-1 arg dont-connect slave) 4381 (gnus-1 arg dont-connect slave)
4382 (gnus-final-warning))) 4382 (gnus-final-warning)))
4383 4383
4384(autoload 'debbugs-emacs "debbugs-gnu")
4385(defun gnus-list-debbugs ()
4386 "List all open Gnus bug reports."
4387 (interactive)
4388 (debbugs-emacs '("important" "normal" "minor" "wishlist")
4389 "gnus"))
4390
4384;; Allow redefinition of Gnus functions. 4391;; Allow redefinition of Gnus functions.
4385 4392
4386(gnus-ems-redefine) 4393(gnus-ems-redefine)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 58740c32e9c..7d7cc01225b 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -659,6 +659,7 @@ Done before generating the new subject of a forward."
659(defcustom message-send-mail-function 659(defcustom message-send-mail-function
660 (cond ((eq send-mail-function 'smtpmail-send-it) 'message-smtpmail-send-it) 660 (cond ((eq send-mail-function 'smtpmail-send-it) 'message-smtpmail-send-it)
661 ((eq send-mail-function 'feedmail-send-it) 'feedmail-send-it) 661 ((eq send-mail-function 'feedmail-send-it) 'feedmail-send-it)
662 ((eq send-mail-function 'sendmail-query-once) 'sendmail-query-once)
662 ((eq send-mail-function 'mailclient-send-it) 663 ((eq send-mail-function 'mailclient-send-it)
663 'message-send-mail-with-mailclient) 664 'message-send-mail-with-mailclient)
664 (t (message-send-mail-function))) 665 (t (message-send-mail-function)))
@@ -1184,7 +1185,7 @@ It is a vector of the following headers:
1184(defvar message-send-actions nil 1185(defvar message-send-actions nil
1185 "A list of actions to be performed upon successful sending of a message.") 1186 "A list of actions to be performed upon successful sending of a message.")
1186(defvar message-return-action nil 1187(defvar message-return-action nil
1187 "Action to return to the caller after sending or postphoning a message.") 1188 "Action to return to the caller after sending or postponing a message.")
1188(defvar message-exit-actions nil 1189(defvar message-exit-actions nil
1189 "A list of actions to be performed upon exiting after sending a message.") 1190 "A list of actions to be performed upon exiting after sending a message.")
1190(defvar message-kill-actions nil 1191(defvar message-kill-actions nil
@@ -3424,8 +3425,12 @@ Message buffers and is not meant to be called directly."
3424(defun message-point-in-header-p () 3425(defun message-point-in-header-p ()
3425 "Return t if point is in the header." 3426 "Return t if point is in the header."
3426 (save-excursion 3427 (save-excursion
3427 (not (re-search-backward 3428 (and
3428 (concat "^" (regexp-quote mail-header-separator) "\n") nil t)))) 3429 (not
3430 (re-search-backward
3431 (concat "^" (regexp-quote mail-header-separator) "\n") nil t))
3432 (re-search-forward
3433 (concat "^" (regexp-quote mail-header-separator) "\n") nil t))))
3429 3434
3430(defun message-do-auto-fill () 3435(defun message-do-auto-fill ()
3431 "Like `do-auto-fill', but don't fill in message header." 3436 "Like `do-auto-fill', but don't fill in message header."
@@ -6744,10 +6749,13 @@ want to get rid of this query permanently.")))
6744 addr)) 6749 addr))
6745 (cons (downcase (mail-strip-quoted-names addr)) addr))) 6750 (cons (downcase (mail-strip-quoted-names addr)) addr)))
6746 (message-tokenize-header recipients))) 6751 (message-tokenize-header recipients)))
6747 ;; Remove first duplicates. (Why not all duplicates? Is this a bug?) 6752 ;; Remove all duplicates.
6748 (let ((s recipients)) 6753 (let ((s recipients))
6749 (while s 6754 (while s
6750 (setq recipients (delq (assoc (car (pop s)) s) recipients)))) 6755 (let ((address (car (pop s))))
6756 (while (assoc address s)
6757 (setq recipients (delq (assoc address s) recipients)
6758 s (delq (assoc address s) s))))))
6751 6759
6752 ;; Remove hierarchical lists that are contained within each other, 6760 ;; Remove hierarchical lists that are contained within each other,
6753 ;; if message-hierarchical-addresses is defined. 6761 ;; if message-hierarchical-addresses is defined.
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index f543920446b..a51c6630ac5 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -114,14 +114,14 @@
114 "Render of HTML contents. 114 "Render of HTML contents.
115It is one of defined renderer types, or a rendering function. 115It is one of defined renderer types, or a rendering function.
116The defined renderer types are: 116The defined renderer types are:
117`shr': use Gnus simple HTML renderer; 117`shr': use the built-in Gnus HTML renderer;
118`gnus-w3m' : use Gnus renderer based on w3m; 118`gnus-w3m': use Gnus renderer based on w3m;
119`w3m' : use emacs-w3m; 119`w3m': use emacs-w3m;
120`w3m-standalone': use w3m; 120`w3m-standalone': use plain w3m;
121`links': use links; 121`links': use links;
122`lynx' : use lynx; 122`lynx': use lynx;
123`w3' : use Emacs/W3; 123`w3': use Emacs/W3;
124`html2text' : use html2text; 124`html2text': use html2text;
125nil : use external viewer (default web browser)." 125nil : use external viewer (default web browser)."
126 :version "24.1" 126 :version "24.1"
127 :type '(choice (const shr) 127 :type '(choice (const shr)
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 435c3bba00f..d57b61dac83 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -300,34 +300,6 @@ system object in XEmacs."
300 ;; no-MULE XEmacs: 300 ;; no-MULE XEmacs:
301 (car (memq cs (mm-get-coding-system-list)))))) 301 (car (memq cs (mm-get-coding-system-list))))))
302 302
303(defun mm-codepage-setup (number &optional alias)
304 "Create a coding system cpNUMBER.
305The coding system is created using `codepage-setup'. If ALIAS is
306non-nil, an alias is created and added to
307`mm-charset-synonym-alist'. If ALIAS is a string, it's used as
308the alias. Else windows-NUMBER is used."
309 (interactive
310 (let ((completion-ignore-case t)
311 (candidates (if (fboundp 'cp-supported-codepages)
312 (cp-supported-codepages)
313 ;; Removed in Emacs 23 (unicode), so signal an error:
314 (error "`codepage-setup' not present in this Emacs version"))))
315 (list (gnus-completing-read "Setup DOS Codepage" candidates
316 t nil nil "437"))))
317 (when alias
318 (setq alias (if (stringp alias)
319 (intern alias)
320 (intern (format "windows-%s" number)))))
321 (let* ((cp (intern (format "cp%s" number))))
322 (unless (mm-coding-system-p cp)
323 (if (fboundp 'codepage-setup) ; silence compiler
324 (codepage-setup number)
325 (error "`codepage-setup' not present in this Emacs version")))
326 (when (and alias
327 ;; Don't add alias if setup of cp failed.
328 (mm-coding-system-p cp))
329 (add-to-list 'mm-charset-synonym-alist (cons alias cp)))))
330
331(defvar mm-charset-synonym-alist 303(defvar mm-charset-synonym-alist
332 `( 304 `(
333 ;; Not in XEmacs, but it's not a proper MIME charset anyhow. 305 ;; Not in XEmacs, but it's not a proper MIME charset anyhow.
@@ -376,6 +348,34 @@ the alias. Else windows-NUMBER is used."
376 348
377See `mm-codepage-iso-8859-list' and `mm-codepage-ibm-list'.") 349See `mm-codepage-iso-8859-list' and `mm-codepage-ibm-list'.")
378 350
351(defun mm-codepage-setup (number &optional alias)
352 "Create a coding system cpNUMBER.
353The coding system is created using `codepage-setup'. If ALIAS is
354non-nil, an alias is created and added to
355`mm-charset-synonym-alist'. If ALIAS is a string, it's used as
356the alias. Else windows-NUMBER is used."
357 (interactive
358 (let ((completion-ignore-case t)
359 (candidates (if (fboundp 'cp-supported-codepages)
360 (cp-supported-codepages)
361 ;; Removed in Emacs 23 (unicode), so signal an error:
362 (error "`codepage-setup' not present in this Emacs version"))))
363 (list (gnus-completing-read "Setup DOS Codepage" candidates
364 t nil nil "437"))))
365 (when alias
366 (setq alias (if (stringp alias)
367 (intern alias)
368 (intern (format "windows-%s" number)))))
369 (let* ((cp (intern (format "cp%s" number))))
370 (unless (mm-coding-system-p cp)
371 (if (fboundp 'codepage-setup) ; silence compiler
372 (codepage-setup number)
373 (error "`codepage-setup' not present in this Emacs version")))
374 (when (and alias
375 ;; Don't add alias if setup of cp failed.
376 (mm-coding-system-p cp))
377 (add-to-list 'mm-charset-synonym-alist (cons alias cp)))))
378
379(defcustom mm-codepage-iso-8859-list 379(defcustom mm-codepage-iso-8859-list
380 (list 1250 ;; Windows-1250 is a variant of Latin-2 heavily used by Microsoft 380 (list 1250 ;; Windows-1250 is a variant of Latin-2 heavily used by Microsoft
381 ;; Outlook users in Czech republic. Use this to allow reading of 381 ;; Outlook users in Czech republic. Use this to allow reading of
@@ -550,7 +550,8 @@ is not available."
550 (let ((cs (cdr (assq charset mm-charset-override-alist)))) 550 (let ((cs (cdr (assq charset mm-charset-override-alist))))
551 (and cs (mm-coding-system-p cs) cs)))) 551 (and cs (mm-coding-system-p cs) cs))))
552 ;; ascii 552 ;; ascii
553 ((eq charset 'us-ascii) 553 ((or (eq charset 'us-ascii)
554 (string-match "ansi.x3.4" (symbol-name charset)))
554 'ascii) 555 'ascii)
555 ;; Check to see whether we can handle this charset. (This depends 556 ;; Check to see whether we can handle this charset. (This depends
556 ;; on there being some coding system matching each `mime-charset' 557 ;; on there being some coding system matching each `mime-charset'
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index df106bb6de8..7d8a4119c0e 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -55,9 +55,15 @@
55 'epg) 55 'epg)
56 (error)) 56 (error))
57 (progn 57 (progn
58 (ignore-errors (require 'pgg)) 58 (let ((abs-file (locate-library "pgg")))
59 (and (fboundp 'pgg-sign-region) 59 ;; Don't load PGG if it is marked as obsolete
60 'pgg)) 60 ;; (Emacs 24).
61 (when (and abs-file
62 (not (string-match "/obsolete/[^/]*\\'"
63 abs-file)))
64 (ignore-errors (require 'pgg))
65 (and (fboundp 'pgg-sign-region)
66 'pgg))))
61 (progn (ignore-errors 67 (progn (ignore-errors
62 (load "mc-toplev")) 68 (load "mc-toplev"))
63 (and (fboundp 'mc-encrypt-generic) 69 (and (fboundp 'mc-encrypt-generic)
diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el
index 006348869ef..f528222dd16 100644
--- a/lisp/gnus/nndraft.el
+++ b/lisp/gnus/nndraft.el
@@ -24,14 +24,21 @@
24 24
25;;; Code: 25;;; Code:
26 26
27;; For Emacs <22.2 and XEmacs.
28(eval-and-compile
29 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
30
27(require 'nnheader) 31(require 'nnheader)
28(require 'nnmail) 32(require 'nnmail)
29(require 'gnus-start) 33(require 'gnus-start)
34(require 'gnus-group)
30(require 'nnmh) 35(require 'nnmh)
31(require 'nnoo) 36(require 'nnoo)
32(require 'mm-util) 37(require 'mm-util)
33(eval-when-compile (require 'cl)) 38(eval-when-compile (require 'cl))
34 39
40(declare-function nndraft-request-list "nnmh" (&rest args))
41
35(nnoo-declare nndraft 42(nnoo-declare nndraft
36 nnmh) 43 nnmh)
37 44
@@ -161,6 +168,25 @@ are generated if and only if they are also in `message-draft-headers'.")
161 (message-headers-to-generate 168 (message-headers-to-generate
162 nndraft-required-headers message-draft-headers nil)))) 169 nndraft-required-headers message-draft-headers nil))))
163 170
171(defun nndraft-update-unread-articles ()
172 "Update groups' unread articles in the group buffer."
173 (nndraft-request-list)
174 (with-current-buffer gnus-group-buffer
175 (let* ((groups (mapcar (lambda (elem)
176 (gnus-group-prefixed-name (car elem)
177 (list 'nndraft "")))
178 (nnmail-get-active)))
179 (gnus-group-marked (copy-sequence groups))
180 (inhibit-read-only t))
181 (gnus-group-get-new-news-this-group nil t)
182 (dolist (group groups)
183 (unless (and gnus-permanently-visible-groups
184 (string-match gnus-permanently-visible-groups
185 group))
186 (gnus-group-goto-group group)
187 (when (zerop (gnus-group-group-unread))
188 (gnus-delete-line)))))))
189
164(deffoo nndraft-request-associate-buffer (group) 190(deffoo nndraft-request-associate-buffer (group)
165 "Associate the current buffer with some article in the draft group." 191 "Associate the current buffer with some article in the draft group."
166 (nndraft-open-server "") 192 (nndraft-open-server "")
@@ -182,6 +208,10 @@ are generated if and only if they are also in `message-draft-headers'.")
182 'write-contents-hooks))) 208 'write-contents-hooks)))
183 (gnus-make-local-hook hook) 209 (gnus-make-local-hook hook)
184 (add-hook hook 'nndraft-generate-headers nil t)) 210 (add-hook hook 'nndraft-generate-headers nil t))
211 (gnus-make-local-hook 'after-save-hook)
212 (add-hook 'after-save-hook 'nndraft-update-unread-articles nil t)
213 (message-add-action '(nndraft-update-unread-articles)
214 'exit 'postpone 'kill)
185 article)) 215 article))
186 216
187(deffoo nndraft-request-group (group &optional server dont-check info) 217(deffoo nndraft-request-group (group &optional server dont-check info)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 2cfc88987f6..ef5bee71629 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -880,15 +880,18 @@ textual parts.")
880 (with-temp-buffer 880 (with-temp-buffer
881 (mm-disable-multibyte) 881 (mm-disable-multibyte)
882 (when (nnimap-request-article article group server (current-buffer)) 882 (when (nnimap-request-article article group server (current-buffer))
883 (nnheader-message 7 "Expiring article %s:%d" group article)
884 (when (functionp target) 883 (when (functionp target)
885 (setq target (funcall target group))) 884 (setq target (funcall target group)))
886 (when (and target 885 (if (and target
887 (not (eq target 'delete))) 886 (not (eq target 'delete)))
888 (if (or (gnus-request-group target t) 887 (if (or (gnus-request-group target t)
889 (gnus-request-create-group target)) 888 (gnus-request-create-group target))
890 (nnmail-expiry-target-group target group) 889 (progn
891 (setq target nil))) 890 (nnmail-expiry-target-group target group)
891 (nnheader-message 7 "Expiring article %s:%d to %s"
892 group article target))
893 (setq target nil))
894 (nnheader-message 7 "Expiring article %s:%d" group article))
892 (when target 895 (when target
893 (push article deleted-articles)))))))) 896 (push article deleted-articles))))))))
894 ;; Change back to the current group again. 897 ;; Change back to the current group again.
@@ -953,7 +956,8 @@ textual parts.")
953 nnimap-inbox 956 nnimap-inbox
954 nnimap-split-methods) 957 nnimap-split-methods)
955 (nnheader-message 7 "nnimap %s splitting mail..." server) 958 (nnheader-message 7 "nnimap %s splitting mail..." server)
956 (nnimap-split-incoming-mail))) 959 (nnimap-split-incoming-mail)
960 (nnheader-message 7 "nnimap %s splitting mail...done" server)))
957 961
958(defun nnimap-marks-to-flags (marks) 962(defun nnimap-marks-to-flags (marks)
959 (let (flags flag) 963 (let (flags flag)
@@ -1227,6 +1231,10 @@ textual parts.")
1227 1231
1228(deffoo nnimap-finish-retrieve-group-infos (server infos sequences) 1232(deffoo nnimap-finish-retrieve-group-infos (server infos sequences)
1229 (when (and sequences 1233 (when (and sequences
1234 ;; Check that the process is still alive.
1235 (get-buffer-process (nnimap-buffer))
1236 (memq (process-status (get-buffer-process (nnimap-buffer)))
1237 '(open run))
1230 (nnimap-possibly-change-group nil server)) 1238 (nnimap-possibly-change-group nil server))
1231 (with-current-buffer (nnimap-buffer) 1239 (with-current-buffer (nnimap-buffer)
1232 ;; Wait for the final data to trickle in. 1240 ;; Wait for the final data to trickle in.
@@ -1557,8 +1565,9 @@ textual parts.")
1557(declare-function gnus-fetch-headers "gnus-sum" 1565(declare-function gnus-fetch-headers "gnus-sum"
1558 (articles &optional limit force-new dependencies)) 1566 (articles &optional limit force-new dependencies))
1559 1567
1560(deffoo nnimap-request-thread (header) 1568(deffoo nnimap-request-thread (header &optional group server)
1561 (let* ((id (mail-header-id header)) 1569 (when (nnimap-possibly-change-group group server)
1570 (let* ((id (mail-header-id header))
1562 (refs (split-string 1571 (refs (split-string
1563 (or (mail-header-references header) 1572 (or (mail-header-references header)
1564 ""))) 1573 "")))
@@ -1576,7 +1585,7 @@ textual parts.")
1576 (gnus-fetch-headers 1585 (gnus-fetch-headers
1577 (and (car result) (delete 0 (mapcar #'string-to-number 1586 (and (car result) (delete 0 (mapcar #'string-to-number
1578 (cdr (assoc "SEARCH" (cdr result)))))) 1587 (cdr (assoc "SEARCH" (cdr result))))))
1579 nil t)))) 1588 nil t)))))
1580 1589
1581(defun nnimap-possibly-change-group (group server) 1590(defun nnimap-possibly-change-group (group server)
1582 (let ((open-result t)) 1591 (let ((open-result t))
@@ -1798,9 +1807,14 @@ textual parts.")
1798(defun nnimap-split-incoming-mail () 1807(defun nnimap-split-incoming-mail ()
1799 (with-current-buffer (nnimap-buffer) 1808 (with-current-buffer (nnimap-buffer)
1800 (let ((nnimap-incoming-split-list nil) 1809 (let ((nnimap-incoming-split-list nil)
1801 (nnmail-split-methods (if (eq nnimap-split-methods 'default) 1810 (nnmail-split-methods
1802 nnmail-split-methods 1811 (cond
1803 nnimap-split-methods)) 1812 ((eq nnimap-split-methods 'default)
1813 nnmail-split-methods)
1814 (nnimap-split-methods
1815 nnimap-split-methods)
1816 (nnimap-split-fancy
1817 'nnmail-split-fancy)))
1804 (nnmail-split-fancy (or nnimap-split-fancy 1818 (nnmail-split-fancy (or nnimap-split-fancy
1805 nnmail-split-fancy)) 1819 nnmail-split-fancy))
1806 (nnmail-inhibit-default-split-group t) 1820 (nnmail-inhibit-default-split-group t)
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index eaaac3f88ce..8099cc2a7cc 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -499,6 +499,31 @@ arrive at the correct group name, \"mail.misc\"."
499 :type '(directory) 499 :type '(directory)
500 :group 'nnir) 500 :group 'nnir)
501 501
502(defcustom nnir-notmuch-program "notmuch"
503 "*Name of notmuch search executable."
504 :type '(string)
505 :group 'nnir)
506
507(defcustom nnir-notmuch-additional-switches '()
508 "*A list of strings, to be given as additional arguments to notmuch.
509
510Note that this should be a list. Ie, do NOT use the following:
511 (setq nnir-notmuch-additional-switches \"-i -w\") ; wrong
512Instead, use this:
513 (setq nnir-notmuch-additional-switches '(\"-i\" \"-w\"))"
514 :type '(repeat (string))
515 :group 'nnir)
516
517(defcustom nnir-notmuch-remove-prefix (concat (getenv "HOME") "/Mail/")
518 "*The prefix to remove from each file name returned by notmuch
519in order to get a group name (albeit with / instead of .). This is a
520regular expression.
521
522This variable is very similar to `nnir-namazu-remove-prefix', except
523that it is for notmuch, not Namazu."
524 :type '(regexp)
525 :group 'nnir)
526
502;;; Developer Extension Variable: 527;;; Developer Extension Variable:
503 528
504(defvar nnir-engines 529(defvar nnir-engines
@@ -519,6 +544,8 @@ arrive at the correct group name, \"mail.misc\"."
519 ((group . "Swish-e Group spec: "))) 544 ((group . "Swish-e Group spec: ")))
520 (namazu nnir-run-namazu 545 (namazu nnir-run-namazu
521 ()) 546 ())
547 (notmuch nnir-run-notmuch
548 ())
522 (hyrex nnir-run-hyrex 549 (hyrex nnir-run-hyrex
523 ((group . "Hyrex Group spec: "))) 550 ((group . "Hyrex Group spec: ")))
524 (find-grep nnir-run-find-grep 551 (find-grep nnir-run-find-grep
@@ -657,22 +684,40 @@ Add an entry here when adding a new search engine.")
657 'nov))) 684 'nov)))
658 685
659(deffoo nnir-request-article (article &optional group server to-buffer) 686(deffoo nnir-request-article (article &optional group server to-buffer)
660 (if (stringp article) 687 (if (and (stringp article)
688 (not (eq 'nnimap (car (gnus-server-to-method server)))))
661 (nnheader-report 689 (nnheader-report
662 'nnir 690 'nnir
663 "nnir-retrieve-headers doesn't grok message ids: %s" 691 "nnir-request-article only groks message ids for nnimap servers: %s"
664 article) 692 server)
665 (save-excursion 693 (save-excursion
666 (let ((artfullgroup (nnir-article-group article)) 694 (let ((article article)
667 (artno (nnir-article-number article))) 695 query)
668 (message "Requesting article %d from group %s" 696 (when (stringp article)
669 artno artfullgroup) 697 (setq gnus-override-method (gnus-server-to-method server))
670 (if to-buffer 698 (setq query
671 (with-current-buffer to-buffer 699 (list
672 (let ((gnus-article-decode-hook nil)) 700 (cons 'query (format "HEADER Message-ID %s" article))
673 (gnus-request-article-this-buffer artno artfullgroup))) 701 (cons 'unique-id article)
674 (gnus-request-article artno artfullgroup)) 702 (cons 'criteria "")
675 (cons artfullgroup artno))))) 703 (cons 'shortcut t)))
704 (unless (and (equal query nnir-current-query)
705 (equal server nnir-current-server))
706 (setq nnir-artlist (nnir-run-imap query server))
707 (setq nnir-current-query query)
708 (setq nnir-current-server server))
709 (setq article 1))
710 (unless (zerop (length nnir-artlist))
711 (let ((artfullgroup (nnir-article-group article))
712 (artno (nnir-article-number article)))
713 (message "Requesting article %d from group %s"
714 artno artfullgroup)
715 (if to-buffer
716 (with-current-buffer to-buffer
717 (let ((gnus-article-decode-hook nil))
718 (gnus-request-article-this-buffer artno artfullgroup)))
719 (gnus-request-article artno artfullgroup))
720 (cons artfullgroup artno)))))))
676 721
677(deffoo nnir-request-move-article (article group server accept-form 722(deffoo nnir-request-move-article (article group server accept-form
678 &optional last internal-move-group) 723 &optional last internal-move-group)
@@ -774,7 +819,7 @@ ready to be added to the list of search results."
774(defun nnir-run-imap (query srv &optional groups) 819(defun nnir-run-imap (query srv &optional groups)
775 "Run a search against an IMAP back-end server. 820 "Run a search against an IMAP back-end server.
776This uses a custom query language parser; see `nnir-imap-make-query' for 821This uses a custom query language parser; see `nnir-imap-make-query' for
777details on the language and supported extensions" 822details on the language and supported extensions."
778 (save-excursion 823 (save-excursion
779 (let ((qstring (cdr (assq 'query query))) 824 (let ((qstring (cdr (assq 'query query)))
780 (server (cadr (gnus-server-to-method srv))) 825 (server (cadr (gnus-server-to-method srv)))
@@ -787,33 +832,36 @@ details on the language and supported extensions"
787 (message "Opening server %s" server) 832 (message "Opening server %s" server)
788 (apply 833 (apply
789 'vconcat 834 'vconcat
790 (mapcar 835 (catch 'found
791 (lambda (group) 836 (mapcar
792 (let (artlist) 837 (lambda (group)
793 (condition-case () 838 (let (artlist)
794 (when (nnimap-possibly-change-group 839 (condition-case ()
795 (gnus-group-short-name group) server) 840 (when (nnimap-possibly-change-group
796 (with-current-buffer (nnimap-buffer) 841 (gnus-group-short-name group) server)
797 (message "Searching %s..." group) 842 (with-current-buffer (nnimap-buffer)
798 (let ((arts 0) 843 (message "Searching %s..." group)
799 (result (nnimap-command "UID SEARCH %s" 844 (let ((arts 0)
800 (if (string= criteria "") 845 (result (nnimap-command "UID SEARCH %s"
801 qstring 846 (if (string= criteria "")
802 (nnir-imap-make-query 847 qstring
803 criteria qstring))))) 848 (nnir-imap-make-query
804 (mapc 849 criteria qstring)))))
805 (lambda (artnum) 850 (mapc
806 (let ((artn (string-to-number artnum))) 851 (lambda (artnum)
807 (when (> artn 0) 852 (let ((artn (string-to-number artnum)))
808 (push (vector group artn 100) 853 (when (> artn 0)
809 artlist) 854 (push (vector group artn 100)
810 (setq arts (1+ arts))))) 855 artlist)
811 (and (car result) (cdr (assoc "SEARCH" (cdr result))))) 856 (when (assq 'shortcut query)
812 (message "Searching %s... %d matches" group arts))) 857 (throw 'found (list artlist)))
813 (message "Searching %s...done" group)) 858 (setq arts (1+ arts)))))
814 (quit nil)) 859 (and (car result) (cdr (assoc "SEARCH" (cdr result)))))
815 (nreverse artlist))) 860 (message "Searching %s... %d matches" group arts)))
816 groups))))) 861 (message "Searching %s...done" group))
862 (quit nil))
863 (nreverse artlist)))
864 groups))))))
817 865
818(defun nnir-imap-make-query (criteria qstring) 866(defun nnir-imap-make-query (criteria qstring)
819 "Parse the query string and criteria into an appropriate IMAP search 867 "Parse the query string and criteria into an appropriate IMAP search
@@ -1317,6 +1365,80 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
1317 (> (nnir-artitem-rsv x) 1365 (> (nnir-artitem-rsv x)
1318 (nnir-artitem-rsv y))))))))) 1366 (nnir-artitem-rsv y)))))))))
1319 1367
1368(defun nnir-run-notmuch (query server &optional group)
1369 "Run QUERY against notmuch.
1370Returns a vector of (group name, file name) pairs (also vectors,
1371actually)."
1372
1373 ;; (when group
1374 ;; (error "The notmuch backend cannot search specific groups"))
1375
1376 (save-excursion
1377 (let ( (qstring (cdr (assq 'query query)))
1378 (groupspec (cdr (assq 'group query)))
1379 (prefix (nnir-read-server-parm 'nnir-notmuch-remove-prefix server))
1380 artlist
1381 (article-pattern (if (string= (gnus-group-server server) "nnmaildir")
1382 ":[0-9]+"
1383 "^[0-9]+$"))
1384 artno dirnam filenam)
1385
1386 (when (equal "" qstring)
1387 (error "notmuch: You didn't enter anything"))
1388
1389 (set-buffer (get-buffer-create nnir-tmp-buffer))
1390 (erase-buffer)
1391
1392 (if groupspec
1393 (message "Doing notmuch query %s on %s..." qstring groupspec)
1394 (message "Doing notmuch query %s..." qstring))
1395
1396 (let* ((cp-list `( ,nnir-notmuch-program
1397 nil ; input from /dev/null
1398 t ; output
1399 nil ; don't redisplay
1400 "search"
1401 "--format=text"
1402 "--output=files"
1403 ,@(nnir-read-server-parm 'nnir-notmuch-additional-switches server)
1404 ,qstring ; the query, in notmuch format
1405 ))
1406 (exitstatus
1407 (progn
1408 (message "%s args: %s" nnir-notmuch-program
1409 (mapconcat 'identity (cddddr cp-list) " ")) ;; ???
1410 (apply 'call-process cp-list))))
1411 (unless (or (null exitstatus)
1412 (zerop exitstatus))
1413 (nnheader-report 'nnir "Couldn't run notmuch: %s" exitstatus)
1414 ;; notmuch failure reason is in this buffer, show it if
1415 ;; the user wants it.
1416 (when (> gnus-verbose 6)
1417 (display-buffer nnir-tmp-buffer))))
1418
1419 ;; The results are output in the format of:
1420 ;; absolute-path-name
1421 (goto-char (point-min))
1422 (while (not (eobp))
1423 (setq filenam (buffer-substring-no-properties (line-beginning-position)
1424 (line-end-position))
1425 artno (file-name-nondirectory filenam)
1426 dirnam (file-name-directory filenam))
1427 (forward-line 1)
1428
1429 ;; don't match directories
1430 (when (string-match article-pattern artno)
1431 (when (not (null dirnam))
1432
1433 ;; maybe limit results to matching groups.
1434 (when (or (not groupspec)
1435 (string-match groupspec dirnam))
1436 (nnir-add-result dirnam artno "" prefix server artlist)))))
1437
1438 (message "Massaging notmuch output...done")
1439
1440 artlist)))
1441
1320(defun nnir-run-find-grep (query server &optional grouplist) 1442(defun nnir-run-find-grep (query server &optional grouplist)
1321 "Run find and grep to obtain matching articles." 1443 "Run find and grep to obtain matching articles."
1322 (let* ((method (gnus-server-to-method server)) 1444 (let* ((method (gnus-server-to-method server))
diff --git a/lisp/gnus/nnmh.el b/lisp/gnus/nnmh.el
index 5fa1a89cf48..ec270eba2ce 100644
--- a/lisp/gnus/nnmh.el
+++ b/lisp/gnus/nnmh.el
@@ -210,7 +210,9 @@ as unread by Gnus.")
210 (max 0) 210 (max 0)
211 min rdir num subdirectoriesp file) 211 min rdir num subdirectoriesp file)
212 ;; Recurse down directories. 212 ;; Recurse down directories.
213 (setq subdirectoriesp (> (nth 1 (file-attributes dir)) 2)) 213 (setq subdirectoriesp
214 ;; nth 1 of file-attributes always 1 on MS Windows :(
215 (/= (nth 1 (file-attributes (file-truename dir))) 2))
214 (dolist (rdir files) 216 (dolist (rdir files)
215 (if (or (not subdirectoriesp) 217 (if (or (not subdirectoriesp)
216 (file-regular-p rdir)) 218 (file-regular-p rdir))
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index a8ffc6576ca..986fd51a613 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -338,10 +338,8 @@ backend doesn't catch this error.")
338 "Record the command STRING." 338 "Record the command STRING."
339 (with-current-buffer (get-buffer-create "*nntp-log*") 339 (with-current-buffer (get-buffer-create "*nntp-log*")
340 (goto-char (point-max)) 340 (goto-char (point-max))
341 (let ((time (current-time))) 341 (insert (format-time-string "%Y%m%dT%H%M%S.%3N")
342 (insert (format-time-string "%Y%m%dT%H%M%S" time) 342 " " nntp-address " " string "\n")))
343 "." (format "%03d" (/ (nth 2 time) 1000))
344 " " nntp-address " " string "\n"))))
345 343
346(defun nntp-report (&rest args) 344(defun nntp-report (&rest args)
347 "Report an error from the nntp backend. The first string in ARGS 345 "Report an error from the nntp backend. The first string in ARGS
diff --git a/lisp/gnus/plstore.el b/lisp/gnus/plstore.el
new file mode 100644
index 00000000000..5f9a61aa843
--- /dev/null
+++ b/lisp/gnus/plstore.el
@@ -0,0 +1,438 @@
1;;; plstore.el --- secure plist store -*- lexical-binding: t -*-
2;; Copyright (C) 2011 Free Software Foundation, Inc.
3
4;; Author: Daiki Ueno <ueno@unixuser.org>
5;; Keywords: PGP, GnuPG
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;; Plist based data store providing search and partial encryption.
25;;
26;; Creating:
27;;
28;; ;; Open a new store associated with ~/.emacs.d/auth.plist.
29;; (setq store (plstore-open (expand-file-name "~/.emacs.d/auth.plist")))
30;; ;; Both `:host' and `:port' are public property.
31;; (plstore-put store "foo" '(:host "foo.example.org" :port 80) nil)
32;; ;; No encryption will be needed.
33;; (plstore-save store)
34;;
35;; ;; `:user' is marked as secret.
36;; (plstore-put store "bar" '(:host "bar.example.org") '(:user "test"))
37;; ;; `:password' is marked as secret.
38;; (plstore-put store "baz" '(:host "baz.example.org") '(:password "test"))
39;; ;; Those secret properties are encrypted together.
40;; (plstore-save store)
41;;
42;; ;; Kill the buffer visiting ~/.emacs.d/auth.plist.
43;; (plstore-close store)
44;;
45;; Searching:
46;;
47;; (setq store (plstore-open (expand-file-name "~/.emacs.d/auth.plist")))
48;;
49;; ;; As the entry "foo" associated with "foo.example.org" has no
50;; ;; secret properties, no need to decryption.
51;; (plstore-find store '(:host ("foo.example.org")))
52;;
53;; ;; As the entry "bar" associated with "bar.example.org" has a
54;; ;; secret property `:user', Emacs tries to decrypt the secret (and
55;; ;; thus you will need to input passphrase).
56;; (plstore-find store '(:host ("bar.example.org")))
57;;
58;; ;; While the entry "baz" associated with "baz.example.org" has also
59;; ;; a secret property `:password', it is encrypted together with
60;; ;; `:user' of "bar", so no need to decrypt the secret.
61;; (plstore-find store '(:host ("bar.example.org")))
62;;
63;; (plstore-close store)
64;;
65;; Editing:
66;;
67;; Currently not supported but in the future plstore will provide a
68;; major mode to edit PLSTORE files.
69
70;;; Code:
71
72(require 'epg)
73
74(defgroup plstore nil
75 "Searchable, partially encrypted, persistent plist store"
76 :version "24.1"
77 :group 'files)
78
79(defcustom plstore-select-keys 'silent
80 "Control whether or not to pop up the key selection dialog.
81
82If t, always asks user to select recipients.
83If nil, query user only when `plstore-encrypt-to' is not set.
84If neither t nor nil, doesn't ask user. In this case, symmetric
85encryption is used."
86 :type '(choice (const :tag "Ask always" t)
87 (const :tag "Ask when recipients are not set" nil)
88 (const :tag "Don't ask" silent))
89 :group 'plstore)
90
91(defvar plstore-encrypt-to nil
92 "*Recipient(s) used for encrypting secret entries.
93May either be a string or a list of strings.")
94
95(put 'plstore-encrypt-to 'safe-local-variable
96 (lambda (val)
97 (or (stringp val)
98 (and (listp val)
99 (catch 'safe
100 (mapc (lambda (elt)
101 (unless (stringp elt)
102 (throw 'safe nil)))
103 val)
104 t)))))
105
106(put 'plstore-encrypt-to 'permanent-local t)
107
108(defvar plstore-cache-passphrase-for-symmetric-encryption nil)
109(defvar plstore-passphrase-alist nil)
110
111(defun plstore-passphrase-callback-function (_context _key-id plstore)
112 (if plstore-cache-passphrase-for-symmetric-encryption
113 (let* ((file (file-truename (plstore--get-buffer plstore)))
114 (entry (assoc file plstore-passphrase-alist))
115 passphrase)
116 (or (copy-sequence (cdr entry))
117 (progn
118 (unless entry
119 (setq entry (list file)
120 plstore-passphrase-alist
121 (cons entry
122 plstore-passphrase-alist)))
123 (setq passphrase
124 (read-passwd (format "Passphrase for PLSTORE %s: "
125 (plstore--get-buffer plstore))))
126 (setcdr entry (copy-sequence passphrase))
127 passphrase)))
128 (read-passwd (format "Passphrase for PLSTORE %s: "
129 (plstore--get-buffer plstore)))))
130
131(defun plstore-progress-callback-function (_context _what _char current total
132 handback)
133 (if (= current total)
134 (message "%s...done" handback)
135 (message "%s...%d%%" handback
136 (if (> total 0) (floor (* (/ current (float total)) 100)) 0))))
137
138(defun plstore--get-buffer (this)
139 (aref this 0))
140
141(defun plstore--get-alist (this)
142 (aref this 1))
143
144(defun plstore--get-encrypted-data (this)
145 (aref this 2))
146
147(defun plstore--get-secret-alist (this)
148 (aref this 3))
149
150(defun plstore--get-merged-alist (this)
151 (aref this 4))
152
153(defun plstore--set-buffer (this buffer)
154 (aset this 0 buffer))
155
156(defun plstore--set-alist (this plist)
157 (aset this 1 plist))
158
159(defun plstore--set-encrypted-data (this encrypted-data)
160 (aset this 2 encrypted-data))
161
162(defun plstore--set-secret-alist (this secret-alist)
163 (aset this 3 secret-alist))
164
165(defun plstore--set-merged-alist (this merged-alist)
166 (aset this 4 merged-alist))
167
168(defun plstore-get-file (this)
169 (buffer-file-name (plstore--get-buffer this)))
170
171(defun plstore--make (&optional buffer alist encrypted-data secret-alist
172 merged-alist)
173 (vector buffer alist encrypted-data secret-alist merged-alist))
174
175(defun plstore--init-from-buffer (plstore)
176 (goto-char (point-min))
177 (when (looking-at ";;; public entries")
178 (forward-line)
179 (plstore--set-alist plstore (read (point-marker)))
180 (forward-sexp)
181 (forward-char)
182 (when (looking-at ";;; secret entries")
183 (forward-line)
184 (plstore--set-encrypted-data plstore (read (point-marker))))
185 (plstore--merge-secret plstore)))
186
187;;;###autoload
188(defun plstore-open (file)
189 "Create a plstore instance associated with FILE."
190 (let* ((filename (file-truename file))
191 (buffer (or (find-buffer-visiting filename)
192 (generate-new-buffer (format " plstore %s" filename))))
193 (store (plstore--make buffer)))
194 (with-current-buffer buffer
195 ;; In the future plstore will provide a major mode called
196 ;; `plstore-mode' to edit PLSTORE files.
197 (if (eq major-mode 'plstore-mode)
198 (error "%s is opened for editing; kill the buffer first" file))
199 (erase-buffer)
200 (condition-case nil
201 (insert-file-contents-literally file)
202 (error))
203 (setq buffer-file-name (file-truename file))
204 (set-buffer-modified-p nil)
205 (plstore--init-from-buffer store)
206 store)))
207
208(defun plstore-revert (plstore)
209 "Replace current data in PLSTORE with the file on disk."
210 (with-current-buffer (plstore--get-buffer plstore)
211 (revert-buffer t t)
212 (plstore--init-from-buffer plstore)))
213
214(defun plstore-close (plstore)
215 "Destroy a plstore instance PLSTORE."
216 (kill-buffer (plstore--get-buffer plstore)))
217
218(defun plstore--merge-secret (plstore)
219 (let ((alist (plstore--get-secret-alist plstore))
220 modified-alist
221 modified-plist
222 modified-entry
223 entry
224 plist
225 placeholder)
226 (plstore--set-merged-alist
227 plstore
228 (copy-tree (plstore--get-alist plstore)))
229 (setq modified-alist (plstore--get-merged-alist plstore))
230 (while alist
231 (setq entry (car alist)
232 alist (cdr alist)
233 plist (cdr entry)
234 modified-entry (assoc (car entry) modified-alist)
235 modified-plist (cdr modified-entry))
236 (while plist
237 (setq placeholder
238 (plist-member
239 modified-plist
240 (intern (concat ":secret-"
241 (substring (symbol-name (car plist)) 1)))))
242 (if placeholder
243 (setcar placeholder (car plist)))
244 (setq modified-plist
245 (plist-put modified-plist (car plist) (car (cdr plist))))
246 (setq plist (nthcdr 2 plist)))
247 (setcdr modified-entry modified-plist))))
248
249(defun plstore--decrypt (plstore)
250 (if (plstore--get-encrypted-data plstore)
251 (let ((context (epg-make-context 'OpenPGP))
252 plain)
253 (epg-context-set-passphrase-callback
254 context
255 (cons #'plstore-passphrase-callback-function
256 plstore))
257 (epg-context-set-progress-callback
258 context
259 (cons #'plstore-progress-callback-function
260 (format "Decrypting %s" (plstore-get-file plstore))))
261 (setq plain
262 (epg-decrypt-string context
263 (plstore--get-encrypted-data plstore)))
264 (plstore--set-secret-alist plstore (car (read-from-string plain)))
265 (plstore--merge-secret plstore)
266 (plstore--set-encrypted-data plstore nil))))
267
268(defun plstore--match (entry keys skip-if-secret-found)
269 (let ((result t) key-name key-value prop-value secret-name)
270 (while keys
271 (setq key-name (car keys)
272 key-value (car (cdr keys))
273 prop-value (plist-get (cdr entry) key-name))
274 (unless (member prop-value key-value)
275 (if skip-if-secret-found
276 (progn
277 (setq secret-name
278 (intern (concat ":secret-"
279 (substring (symbol-name key-name) 1))))
280 (if (plist-member (cdr entry) secret-name)
281 (setq result 'secret)
282 (setq result nil
283 keys nil)))
284 (setq result nil
285 keys nil)))
286 (setq keys (nthcdr 2 keys)))
287 result))
288
289(defun plstore-find (plstore keys)
290 "Perform search on PLSTORE with KEYS.
291KEYS is a plist."
292 (let (entries alist entry match decrypt plist)
293 ;; First, go through the merged plist alist and collect entries
294 ;; matched with keys.
295 (setq alist (plstore--get-merged-alist plstore))
296 (while alist
297 (setq entry (car alist)
298 alist (cdr alist)
299 match (plstore--match entry keys t))
300 (if (eq match 'secret)
301 (setq decrypt t)
302 (when match
303 (setq plist (cdr entry))
304 (while plist
305 (if (string-match "\\`:secret-" (symbol-name (car plist)))
306 (setq decrypt t
307 plist nil))
308 (setq plist (nthcdr 2 plist)))
309 (setq entries (cons entry entries)))))
310 ;; Second, decrypt the encrypted plist and try again.
311 (when decrypt
312 (setq entries nil)
313 (plstore--decrypt plstore)
314 (setq alist (plstore--get-merged-alist plstore))
315 (while alist
316 (setq entry (car alist)
317 alist (cdr alist)
318 match (plstore--match entry keys nil))
319 (if match
320 (setq entries (cons entry entries)))))
321 (nreverse entries)))
322
323(defun plstore-get (plstore name)
324 "Get an entry with NAME in PLSTORE."
325 (let ((entry (assoc name (plstore--get-merged-alist plstore)))
326 plist)
327 (setq plist (cdr entry))
328 (while plist
329 (if (string-match "\\`:secret-" (symbol-name (car plist)))
330 (progn
331 (plstore--decrypt plstore)
332 (setq entry (assoc name (plstore--get-merged-alist plstore))
333 plist nil))
334 (setq plist (nthcdr 2 plist))))
335 entry))
336
337(defun plstore-put (plstore name keys secret-keys)
338 "Put an entry with NAME in PLSTORE.
339KEYS is a plist containing non-secret data.
340SECRET-KEYS is a plist containing secret data."
341 (let (entry
342 plist
343 secret-plist
344 symbol)
345 (if secret-keys
346 (plstore--decrypt plstore))
347 (while secret-keys
348 (setq symbol
349 (intern (concat ":secret-"
350 (substring (symbol-name (car secret-keys)) 1))))
351 (setq plist (plist-put plist symbol t)
352 secret-plist (plist-put secret-plist
353 (car secret-keys) (car (cdr secret-keys)))
354 secret-keys (nthcdr 2 secret-keys)))
355 (while keys
356 (setq symbol
357 (intern (concat ":secret-"
358 (substring (symbol-name (car keys)) 1))))
359 (setq plist (plist-put plist (car keys) (car (cdr keys)))
360 keys (nthcdr 2 keys)))
361 (setq entry (assoc name (plstore--get-alist plstore)))
362 (if entry
363 (setcdr entry plist)
364 (plstore--set-alist
365 plstore
366 (cons (cons name plist) (plstore--get-alist plstore))))
367 (when secret-plist
368 (setq entry (assoc name (plstore--get-secret-alist plstore)))
369 (if entry
370 (setcdr entry secret-plist)
371 (plstore--set-secret-alist
372 plstore
373 (cons (cons name secret-plist) (plstore--get-secret-alist plstore)))))
374 (plstore--merge-secret plstore)))
375
376(defun plstore-delete (plstore name)
377 "Delete an entry with NAME from PLSTORE."
378 (let ((entry (assoc name (plstore--get-alist plstore))))
379 (if entry
380 (plstore--set-alist
381 plstore
382 (delq entry (plstore--get-alist plstore))))
383 (setq entry (assoc name (plstore--get-secret-alist plstore)))
384 (if entry
385 (plstore--set-secret-alist
386 plstore
387 (delq entry (plstore--get-secret-alist plstore))))
388 (setq entry (assoc name (plstore--get-merged-alist plstore)))
389 (if entry
390 (plstore--set-merged-alist
391 plstore
392 (delq entry (plstore--get-merged-alist plstore))))))
393
394(defvar pp-escape-newlines)
395(defun plstore--insert-buffer (plstore)
396 (insert ";;; public entries -*- mode: plstore -*- \n"
397 (pp-to-string (plstore--get-alist plstore)))
398 (if (plstore--get-secret-alist plstore)
399 (let ((context (epg-make-context 'OpenPGP))
400 (pp-escape-newlines nil)
401 (recipients
402 (cond
403 ((listp plstore-encrypt-to) plstore-encrypt-to)
404 ((stringp plstore-encrypt-to) (list plstore-encrypt-to))))
405 cipher)
406 (epg-context-set-armor context t)
407 (epg-context-set-passphrase-callback
408 context
409 (cons #'plstore-passphrase-callback-function
410 plstore))
411 (setq cipher (epg-encrypt-string
412 context
413 (pp-to-string
414 (plstore--get-secret-alist plstore))
415 (if (or (eq plstore-select-keys t)
416 (and (null plstore-select-keys)
417 (not (local-variable-p 'plstore-encrypt-to
418 (current-buffer)))))
419 (epa-select-keys
420 context
421 "Select recipents for encryption.
422If no one is selected, symmetric encryption will be performed. "
423 recipients)
424 (if plstore-encrypt-to
425 (epg-list-keys context recipients)))))
426 (goto-char (point-max))
427 (insert ";;; secret entries\n" (pp-to-string cipher)))))
428
429(defun plstore-save (plstore)
430 "Save the contents of PLSTORE associated with a FILE."
431 (with-current-buffer (plstore--get-buffer plstore)
432 (erase-buffer)
433 (plstore--insert-buffer plstore)
434 (save-buffer)))
435
436(provide 'plstore)
437
438;;; plstore.el ends here
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el
index 90e11b3ca8f..e29ddb0d44e 100644
--- a/lisp/gnus/pop3.el
+++ b/lisp/gnus/pop3.el
@@ -306,7 +306,8 @@ Returns the process associated with the connection."
306 (t 306 (t
307 (or pop3-stream-type 'network))) 307 (or pop3-stream-type 'network)))
308 :capability-command "CAPA\r\n" 308 :capability-command "CAPA\r\n"
309 :end-of-command "^\\.\r?\n\\|^\\(-ERR\\|+OK \\).*\n" 309 :end-of-command "^\\(-ERR\\|+OK \\).*\n"
310 :end-of-capability "^\\.\r?\n\\|^-ERR"
310 :success "^\\+OK.*\n" 311 :success "^\\+OK.*\n"
311 :return-list t 312 :return-list t
312 :starttls-function 313 :starttls-function
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 7082cfc57ad..f75f4e20219 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -271,7 +271,7 @@ stopping if the top or bottom edge of the image is reached."
271;; Adjust frame and image size. 271;; Adjust frame and image size.
272 272
273(defun image-mode-fit-frame () 273(defun image-mode-fit-frame ()
274 "Fit the frame to the current image. 274 "Toggle whether to fit the frame to the current image.
275This function assumes the current frame has only one window." 275This function assumes the current frame has only one window."
276 ;; FIXME: This does not take into account decorations like mode-line, 276 ;; FIXME: This does not take into account decorations like mode-line,
277 ;; minibuffer, header-line, ... 277 ;; minibuffer, header-line, ...
diff --git a/lisp/image.el b/lisp/image.el
index 91c0f3c9292..b67367ad436 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -389,6 +389,7 @@ IMAGE must be an image created with `create-image' or `defimage'.
389IMAGE is displayed by putting an overlay into the current buffer with a 389IMAGE is displayed by putting an overlay into the current buffer with a
390`before-string' STRING that has a `display' property whose value is the 390`before-string' STRING that has a `display' property whose value is the
391image. STRING is defaulted if you omit it. 391image. STRING is defaulted if you omit it.
392The overlay created will have the `put-overlay' property set to t.
392POS may be an integer or marker. 393POS may be an integer or marker.
393AREA is where to display the image. AREA nil or omitted means 394AREA is where to display the image. AREA nil or omitted means
394display it in the text area, a value of `left-margin' means 395display it in the text area, a value of `left-margin' means
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 2cfaa81d4c7..13edc0269dd 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -127,9 +127,9 @@ OTHER-MODES is a list of cross references to other help modes.")
127 127
128(defun info-lookup-add-help (&rest arg) 128(defun info-lookup-add-help (&rest arg)
129 "Add or update a help specification. 129 "Add or update a help specification.
130Function arguments are one or more options of the form 130Function arguments are specified as keyword/argument pairs:
131 131
132 KEYWORD ARGUMENT 132 \(KEYWORD . ARGUMENT)
133 133
134KEYWORD is either `:topic', `:mode', `:regexp', `:ignore-case', 134KEYWORD is either `:topic', `:mode', `:regexp', `:ignore-case',
135 `:doc-spec', `:parse-rule', or `:other-modes'. 135 `:doc-spec', `:parse-rule', or `:other-modes'.
diff --git a/lisp/info.el b/lisp/info.el
index bca41c29d0f..cbdc8cc7ab3 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -464,6 +464,7 @@ be last in the list.")
464 "Insert the contents of an Info file in the current buffer. 464 "Insert the contents of an Info file in the current buffer.
465Do the right thing if the file has been compressed or zipped." 465Do the right thing if the file has been compressed or zipped."
466 (let* ((tail Info-suffix-list) 466 (let* ((tail Info-suffix-list)
467 (jka-compr-verbose nil)
467 (lfn (if (fboundp 'msdos-long-file-names) 468 (lfn (if (fboundp 'msdos-long-file-names)
468 (msdos-long-file-names) 469 (msdos-long-file-names)
469 t)) 470 t))
@@ -621,7 +622,7 @@ in `Info-file-supports-index-cookies-list'."
621Optional argument FILE-OR-NODE specifies the file to examine; 622Optional argument FILE-OR-NODE specifies the file to examine;
622the default is the top-level directory of Info. 623the default is the top-level directory of Info.
623Called from a program, FILE-OR-NODE may specify an Info node of the form 624Called from a program, FILE-OR-NODE may specify an Info node of the form
624`(FILENAME)NODENAME'. 625\"(FILENAME)NODENAME\".
625Optional argument BUFFER specifies the Info buffer name; 626Optional argument BUFFER specifies the Info buffer name;
626the default buffer name is *info*. If BUFFER exists, 627the default buffer name is *info*. If BUFFER exists,
627just switch to BUFFER. Otherwise, create a new buffer 628just switch to BUFFER. Otherwise, create a new buffer
@@ -728,6 +729,11 @@ just return nil (no error)."
728 (append Info-directory-list 729 (append Info-directory-list
729 Info-additional-directory-list) 730 Info-additional-directory-list)
730 Info-directory-list))))) 731 Info-directory-list)))))
732 ;; Fall back on the installation directory if we can't find
733 ;; the info node anywhere else.
734 (when installation-directory
735 (setq dirs (append dirs (list (expand-file-name
736 "info" installation-directory)))))
731 ;; Search the directory list for file FILENAME. 737 ;; Search the directory list for file FILENAME.
732 (while (and dirs (not found)) 738 (while (and dirs (not found))
733 (setq temp (expand-file-name filename (car dirs))) 739 (setq temp (expand-file-name filename (car dirs)))
@@ -1572,7 +1578,12 @@ If FORK is a string, it is the name to use for the new buffer."
1572(defvar Info-read-node-completion-table) 1578(defvar Info-read-node-completion-table)
1573 1579
1574(defun Info-read-node-name-2 (dirs suffixes string pred action) 1580(defun Info-read-node-name-2 (dirs suffixes string pred action)
1575 "Virtual completion table for file names input in Info node names." 1581 "Internal function used to complete Info node names.
1582Return a completion table for Info files---the FILENAME part of a
1583node named \"(FILENAME)NODENAME\". DIRS is a list of Info
1584directories to search if FILENAME is not absolute; SUFFIXES is a
1585list of valid filename suffixes for Info files. See
1586`try-completion' for a description of the remaining arguments."
1576 (setq suffixes (remove "" suffixes)) 1587 (setq suffixes (remove "" suffixes))
1577 (when (file-name-absolute-p string) 1588 (when (file-name-absolute-p string)
1578 (setq dirs (list (file-name-directory string)))) 1589 (setq dirs (list (file-name-directory string))))
@@ -1602,10 +1613,9 @@ If FORK is a string, it is the name to use for the new buffer."
1602 (push (if string-dir (concat string-dir file) file) names))))) 1613 (push (if string-dir (concat string-dir file) file) names)))))
1603 (complete-with-action action names string pred))) 1614 (complete-with-action action names string pred)))
1604 1615
1605;; This function is used as the "completion table" while reading a node name.
1606;; It does completion using the alist in Info-read-node-completion-table
1607;; unless STRING starts with an open-paren.
1608(defun Info-read-node-name-1 (string predicate code) 1616(defun Info-read-node-name-1 (string predicate code)
1617 "Internal function used by `Info-read-node-name'.
1618See `completing-read' for a description of arguments and usage."
1609 (cond 1619 (cond
1610 ;; First complete embedded file names. 1620 ;; First complete embedded file names.
1611 ((string-match "\\`([^)]*\\'" string) 1621 ((string-match "\\`([^)]*\\'" string)
@@ -1618,7 +1628,6 @@ If FORK is a string, it is the name to use for the new buffer."
1618 (substring string 1) 1628 (substring string 1)
1619 predicate 1629 predicate
1620 code)) 1630 code))
1621
1622 ;; If a file name was given, then any node is fair game. 1631 ;; If a file name was given, then any node is fair game.
1623 ((string-match "\\`(" string) 1632 ((string-match "\\`(" string)
1624 (cond 1633 (cond
@@ -1630,9 +1639,10 @@ If FORK is a string, it is the name to use for the new buffer."
1630 code Info-read-node-completion-table string predicate)))) 1639 code Info-read-node-completion-table string predicate))))
1631 1640
1632;; Arrange to highlight the proper letters in the completion list buffer. 1641;; Arrange to highlight the proper letters in the completion list buffer.
1633
1634
1635(defun Info-read-node-name (prompt) 1642(defun Info-read-node-name (prompt)
1643 "Read an Info node name with completion, prompting with PROMPT.
1644A node name can have the form \"NODENAME\", referring to a node
1645in the current Info file, or \"(FILENAME)NODENAME\"."
1636 (let* ((completion-ignore-case t) 1646 (let* ((completion-ignore-case t)
1637 (Info-read-node-completion-table (Info-build-node-completions)) 1647 (Info-read-node-completion-table (Info-build-node-completions))
1638 (nodename (completing-read prompt 'Info-read-node-name-1 nil t))) 1648 (nodename (completing-read prompt 'Info-read-node-name-1 nil t)))
@@ -2092,7 +2102,7 @@ If SAME-FILE is non-nil, do not move to a different Info file."
2092 )) 2102 ))
2093 2103
2094(defun Info-directory-toc-nodes (filename) 2104(defun Info-directory-toc-nodes (filename)
2095 "Directory-specific implementation of `Info-directory-toc-nodes'." 2105 "Directory-specific implementation of `Info-toc-nodes'."
2096 `(,filename 2106 `(,filename
2097 ("Top" nil nil nil))) 2107 ("Top" nil nil nil)))
2098 2108
@@ -3281,7 +3291,6 @@ MATCHES is a list of index matches found by `Info-apropos-matches'.")
3281 "Collect STRING matches from all known Info files on your system. 3291 "Collect STRING matches from all known Info files on your system.
3282Return a list of matches where each element is in the format 3292Return a list of matches where each element is in the format
3283\((FILENAME INDEXTEXT NODENAME LINENUMBER))." 3293\((FILENAME INDEXTEXT NODENAME LINENUMBER))."
3284 (interactive "sIndex apropos: ")
3285 (unless (string= string "") 3294 (unless (string= string "")
3286 (let ((pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^\n]+\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?" 3295 (let ((pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^\n]+\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?"
3287 (regexp-quote string))) 3296 (regexp-quote string)))
@@ -3646,7 +3655,6 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
3646 (define-key map "\C-m" 'Info-follow-nearest-node) 3655 (define-key map "\C-m" 'Info-follow-nearest-node)
3647 (define-key map "\t" 'Info-next-reference) 3656 (define-key map "\t" 'Info-next-reference)
3648 (define-key map "\e\t" 'Info-prev-reference) 3657 (define-key map "\e\t" 'Info-prev-reference)
3649 (define-key map [(shift tab)] 'Info-prev-reference)
3650 (define-key map [backtab] 'Info-prev-reference) 3658 (define-key map [backtab] 'Info-prev-reference)
3651 (define-key map "1" 'Info-nth-menu-item) 3659 (define-key map "1" 'Info-nth-menu-item)
3652 (define-key map "2" 'Info-nth-menu-item) 3660 (define-key map "2" 'Info-nth-menu-item)
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 455cbe697d6..a9657c17b9f 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -1206,22 +1206,8 @@ Setup char-width-table appropriate for non-CJK language environment."
1206 1206
1207;;; Setting unicode-category-table. 1207;;; Setting unicode-category-table.
1208 1208
1209;; This macro is to build unicode-category-table at compile time so 1209(setq unicode-category-table
1210;; that C code can access the table efficiently. 1210 (unicode-property-table-internal 'general-category))
1211(defmacro build-unicode-category-table ()
1212 (let ((table (make-char-table 'unicode-category-table nil)))
1213 (dotimes (i #x110000)
1214 (if (or (< i #xD800)
1215 (and (>= i #xF900) (< i #x30000))
1216 (and (>= i #xE0000) (< i #xE0200)))
1217 (aset table i (get-char-code-property i 'general-category))))
1218 (set-char-table-range table '(#xE000 . #xF8FF) 'Co)
1219 (set-char-table-range table '(#xF0000 . #xFFFFD) 'Co)
1220 (set-char-table-range table '(#x100000 . #x10FFFD) 'Co)
1221 (optimize-char-table table 'eq)
1222 table))
1223
1224(setq unicode-category-table (build-unicode-category-table))
1225(map-char-table #'(lambda (key val) 1211(map-char-table #'(lambda (key val)
1226 (if (and val 1212 (if (and val
1227 (or (and (/= (aref (symbol-name val) 0) ?M) 1213 (or (and (/= (aref (symbol-name val) 0) ?M)
diff --git a/lisp/international/charprop.el b/lisp/international/charprop.el
index 5c3efcc9d07..919666010b1 100644
--- a/lisp/international/charprop.el
+++ b/lisp/international/charprop.el
@@ -1,8 +1,4 @@
1;; Copyright (C) 1991-2010 Unicode, Inc. 1;; Automatically generated by unidata-gen.el.
2;; This file was generated from the Unicode data file at
3;; http://www.unicode.org/Public/UNIDATA/UnicodeData.txt.
4;; See lisp/international/README for the copyright and permission notice.
5
6;; FILE: uni-name.el 2;; FILE: uni-name.el
7(define-char-code-property 'name "uni-name.el" 3(define-char-code-property 'name "uni-name.el"
8 "Unicode character name. 4 "Unicode character name.
@@ -45,7 +41,7 @@ Property value is an integer or a floating point.")
45;; FILE: uni-mirrored.el 41;; FILE: uni-mirrored.el
46(define-char-code-property 'mirrored "uni-mirrored.el" 42(define-char-code-property 'mirrored "uni-mirrored.el"
47 "Unicode bidi mirrored flag. 43 "Unicode bidi mirrored flag.
48Property value is a symbol `Y' or `N'.") 44Property value is a symbol `Y' or `N'. See also the property `mirroring'.")
49;; FILE: uni-old-name.el 45;; FILE: uni-old-name.el
50(define-char-code-property 'old-name "uni-old-name.el" 46(define-char-code-property 'old-name "uni-old-name.el"
51 "Unicode old names as published in Unicode 1.0. 47 "Unicode old names as published in Unicode 1.0.
@@ -66,6 +62,11 @@ Property value is a character.")
66(define-char-code-property 'titlecase "uni-titlecase.el" 62(define-char-code-property 'titlecase "uni-titlecase.el"
67 "Unicode simple titlecase mapping. 63 "Unicode simple titlecase mapping.
68Property value is a character.") 64Property value is a character.")
65;; FILE: uni-mirrored.el
66(define-char-code-property 'mirroring "uni-mirrored.el"
67 "Unicode bidi-mirroring characters.
68Property value is a character that has the corresponding mirroring image,
69or nil for non-mirrored character.")
69;; Local Variables: 70;; Local Variables:
70;; coding: utf-8 71;; coding: utf-8
71;; no-byte-compile: t 72;; no-byte-compile: t
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index b3f17bb3fcf..6a73aaaa838 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -397,7 +397,11 @@ If CODING-SYSTEM specifies a certain type of EOL conversion, the coding
397systems set by this function will use that type of EOL conversion. 397systems set by this function will use that type of EOL conversion.
398 398
399A coding system that requires automatic detection of text+encoding 399A coding system that requires automatic detection of text+encoding
400\(e.g. undecided, unix) can't be preferred." 400\(e.g. undecided, unix) can't be preferred.
401
402To prefer, for instance, utf-8, say the following:
403
404 \(prefer-coding-system 'utf-8)"
401 (interactive "zPrefer coding system: ") 405 (interactive "zPrefer coding system: ")
402 (if (not (and coding-system (coding-system-p coding-system))) 406 (if (not (and coding-system (coding-system-p coding-system)))
403 (error "Invalid coding system `%s'" coding-system)) 407 (error "Invalid coding system `%s'" coding-system))
@@ -2709,16 +2713,6 @@ See also `locale-charset-language-names', `locale-language-names',
2709 2713
2710;;; Character property 2714;;; Character property
2711 2715
2712;; Each element has the form (PROP . TABLE).
2713;; PROP is a symbol representing a character property.
2714;; TABLE is a char-table containing the property value for each character.
2715;; TABLE may be a name of file to load to build a char-table.
2716;; Don't modify this variable directly but use `define-char-code-property'.
2717
2718(defvar char-code-property-alist nil
2719 "Alist of character property name vs char-table containing property values.
2720Internal use only.")
2721
2722(put 'char-code-property-table 'char-table-extra-slots 5) 2716(put 'char-code-property-table 'char-table-extra-slots 5)
2723 2717
2724(defun define-char-code-property (name table &optional docstring) 2718(defun define-char-code-property (name table &optional docstring)
@@ -2770,32 +2764,23 @@ See also the documentation of `get-char-code-property' and
2770 2764
2771(defun get-char-code-property (char propname) 2765(defun get-char-code-property (char propname)
2772 "Return the value of CHAR's PROPNAME property." 2766 "Return the value of CHAR's PROPNAME property."
2773 (let ((slot (assq propname char-code-property-alist))) 2767 (let ((table (unicode-property-table-internal propname)))
2774 (if slot 2768 (if table
2775 (let (table value func) 2769 (let ((func (char-table-extra-slot table 1)))
2776 (if (stringp (cdr slot))
2777 (load (cdr slot) nil t))
2778 (setq table (cdr slot)
2779 value (aref table char)
2780 func (char-table-extra-slot table 1))
2781 (if (functionp func) 2770 (if (functionp func)
2782 (setq value (funcall func char value table))) 2771 (funcall func char (aref table char) table)
2783 value) 2772 (get-unicode-property-internal table char)))
2784 (plist-get (aref char-code-property-table char) propname)))) 2773 (plist-get (aref char-code-property-table char) propname))))
2785 2774
2786(defun put-char-code-property (char propname value) 2775(defun put-char-code-property (char propname value)
2787 "Store CHAR's PROPNAME property with VALUE. 2776 "Store CHAR's PROPNAME property with VALUE.
2788It can be retrieved with `(get-char-code-property CHAR PROPNAME)'." 2777It can be retrieved with `(get-char-code-property CHAR PROPNAME)'."
2789 (let ((slot (assq propname char-code-property-alist))) 2778 (let ((table (unicode-property-table-internal propname)))
2790 (if slot 2779 (if table
2791 (let (table func) 2780 (let ((func (char-table-extra-slot table 2)))
2792 (if (stringp (cdr slot))
2793 (load (cdr slot) nil t))
2794 (setq table (cdr slot)
2795 func (char-table-extra-slot table 2))
2796 (if (functionp func) 2781 (if (functionp func)
2797 (funcall func char value table) 2782 (funcall func char value table)
2798 (aset table char value))) 2783 (put-unicode-property-internal table char value)))
2799 (let* ((plist (aref char-code-property-table char)) 2784 (let* ((plist (aref char-code-property-table char))
2800 (x (plist-put plist propname value))) 2785 (x (plist-put plist propname value)))
2801 (or (eq x plist) 2786 (or (eq x plist)
@@ -2805,13 +2790,9 @@ It can be retrieved with `(get-char-code-property CHAR PROPNAME)'."
2805(defun char-code-property-description (prop value) 2790(defun char-code-property-description (prop value)
2806 "Return a description string of character property PROP's value VALUE. 2791 "Return a description string of character property PROP's value VALUE.
2807If there's no description string for VALUE, return nil." 2792If there's no description string for VALUE, return nil."
2808 (let ((slot (assq prop char-code-property-alist))) 2793 (let ((table (unicode-property-table-internal prop)))
2809 (if slot 2794 (if table
2810 (let (table func) 2795 (let ((func (char-table-extra-slot table 3)))
2811 (if (stringp (cdr slot))
2812 (load (cdr slot) nil t))
2813 (setq table (cdr slot)
2814 func (char-table-extra-slot table 3))
2815 (if (functionp func) 2796 (if (functionp func)
2816 (funcall func value)))))) 2797 (funcall func value))))))
2817 2798
diff --git a/lisp/international/uni-bidi.el b/lisp/international/uni-bidi.el
index 9e571ef9d0d..e7682c6d8ff 100644
--- a/lisp/international/uni-bidi.el
+++ b/lisp/international/uni-bidi.el
Binary files differ
diff --git a/lisp/international/uni-category.el b/lisp/international/uni-category.el
index 80538f7b416..a4455decc52 100644
--- a/lisp/international/uni-category.el
+++ b/lisp/international/uni-category.el
Binary files differ
diff --git a/lisp/international/uni-combining.el b/lisp/international/uni-combining.el
index 2ee74d8b818..227b9d0af79 100644
--- a/lisp/international/uni-combining.el
+++ b/lisp/international/uni-combining.el
Binary files differ
diff --git a/lisp/international/uni-comment.el b/lisp/international/uni-comment.el
index dcc717977c7..c9743064bd4 100644
--- a/lisp/international/uni-comment.el
+++ b/lisp/international/uni-comment.el
Binary files differ
diff --git a/lisp/international/uni-decimal.el b/lisp/international/uni-decimal.el
index 22207a224b0..2c424ffb5de 100644
--- a/lisp/international/uni-decimal.el
+++ b/lisp/international/uni-decimal.el
Binary files differ
diff --git a/lisp/international/uni-decomposition.el b/lisp/international/uni-decomposition.el
index f35bcebfed8..b0bf07bbe85 100644
--- a/lisp/international/uni-decomposition.el
+++ b/lisp/international/uni-decomposition.el
Binary files differ
diff --git a/lisp/international/uni-digit.el b/lisp/international/uni-digit.el
index 692dea1edc8..fc52fd8c28c 100644
--- a/lisp/international/uni-digit.el
+++ b/lisp/international/uni-digit.el
Binary files differ
diff --git a/lisp/international/uni-lowercase.el b/lisp/international/uni-lowercase.el
index 7cc601159f0..41890018204 100644
--- a/lisp/international/uni-lowercase.el
+++ b/lisp/international/uni-lowercase.el
Binary files differ
diff --git a/lisp/international/uni-mirrored.el b/lisp/international/uni-mirrored.el
index 5129a93396d..006cf575591 100644
--- a/lisp/international/uni-mirrored.el
+++ b/lisp/international/uni-mirrored.el
Binary files differ
diff --git a/lisp/international/uni-name.el b/lisp/international/uni-name.el
index 5b9e8323d21..7fac18b278d 100644
--- a/lisp/international/uni-name.el
+++ b/lisp/international/uni-name.el
Binary files differ
diff --git a/lisp/international/uni-numeric.el b/lisp/international/uni-numeric.el
index 278ad683fe4..d16e8c00870 100644
--- a/lisp/international/uni-numeric.el
+++ b/lisp/international/uni-numeric.el
Binary files differ
diff --git a/lisp/international/uni-old-name.el b/lisp/international/uni-old-name.el
index 2e283492408..4e704e5cdd0 100644
--- a/lisp/international/uni-old-name.el
+++ b/lisp/international/uni-old-name.el
Binary files differ
diff --git a/lisp/international/uni-titlecase.el b/lisp/international/uni-titlecase.el
index 729a469d103..b8098c81876 100644
--- a/lisp/international/uni-titlecase.el
+++ b/lisp/international/uni-titlecase.el
Binary files differ
diff --git a/lisp/international/uni-uppercase.el b/lisp/international/uni-uppercase.el
index 0714b14794f..899276eb725 100644
--- a/lisp/international/uni-uppercase.el
+++ b/lisp/international/uni-uppercase.el
Binary files differ
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 7f018ab14c7..50e7b331c85 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2226,10 +2226,13 @@ If there is no completion possible, say so and continue searching."
2226;; Searching 2226;; Searching
2227 2227
2228(defvar isearch-search-fun-function nil 2228(defvar isearch-search-fun-function nil
2229 "Override `isearch-search-fun'. 2229 "Overrides the default `isearch-search-fun' behaviour.
2230This function should return the search function for Isearch to use. 2230This variable's value should be a function, which will be called
2231It will call this function with three arguments 2231with no arguments, and should return a function that takes three
2232as if it were `search-forward'.") 2232arguments: STRING, BOUND, and NOERROR.
2233
2234This returned function will be used by `isearch-search-string' to
2235search for the first occurrence of STRING or its translation.")
2233 2236
2234(defun isearch-search-fun () 2237(defun isearch-search-fun ()
2235 "Return the function to use for the search. 2238 "Return the function to use for the search.
diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el
index fda9804bbb8..e1cf2a661ed 100644
--- a/lisp/jka-cmpr-hook.el
+++ b/lisp/jka-cmpr-hook.el
@@ -340,7 +340,7 @@ Return the new status of auto compression (non-nil means on)."
340 (t (jka-compr-uninstall))))) 340 (t (jka-compr-uninstall)))))
341 341
342(defmacro with-auto-compression-mode (&rest body) 342(defmacro with-auto-compression-mode (&rest body)
343 "Evalute BODY with automatic file compression and uncompression enabled." 343 "Evaluate BODY with automatic file compression and uncompression enabled."
344 (declare (indent 0)) 344 (declare (indent 0))
345 (let ((already-installed (make-symbol "already-installed"))) 345 (let ((already-installed (make-symbol "already-installed")))
346 `(let ((,already-installed (jka-compr-installed-p))) 346 `(let ((,already-installed (jka-compr-installed-p)))
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index 37c9d40ec65..1893e982bbb 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -97,6 +97,11 @@ NOTE: Not used in MS-DOS and Windows systems."
97 :type 'string 97 :type 'string
98 :group 'jka-compr) 98 :group 'jka-compr)
99 99
100(defcustom jka-compr-verbose t
101 "If non-nil, output messages whenever compressing or uncompressing files."
102 :type 'boolean
103 :group 'jka-compr)
104
100(defvar jka-compr-use-shell 105(defvar jka-compr-use-shell
101 (not (memq system-type '(ms-dos windows-nt)))) 106 (not (memq system-type '(ms-dos windows-nt))))
102 107
@@ -309,6 +314,7 @@ There should be no more than seven characters after the final `/'."
309 314
310 (and 315 (and
311 compress-message 316 compress-message
317 jka-compr-verbose
312 (message "%s %s..." compress-message base-name)) 318 (message "%s %s..." compress-message base-name))
313 319
314 (jka-compr-run-real-handler 'write-region 320 (jka-compr-run-real-handler 'write-region
@@ -341,6 +347,7 @@ There should be no more than seven characters after the final `/'."
341 347
342 (and 348 (and
343 compress-message 349 compress-message
350 jka-compr-verbose
344 (message "%s %s...done" compress-message base-name)) 351 (message "%s %s...done" compress-message base-name))
345 352
346 (cond 353 (cond
@@ -404,6 +411,7 @@ There should be no more than seven characters after the final `/'."
404 411
405 (and 412 (and
406 uncompress-message 413 uncompress-message
414 jka-compr-verbose
407 (message "%s %s..." uncompress-message base-name)) 415 (message "%s %s..." uncompress-message base-name))
408 416
409 (condition-case error-code 417 (condition-case error-code
@@ -479,6 +487,7 @@ There should be no more than seven characters after the final `/'."
479 487
480 (and 488 (and
481 uncompress-message 489 uncompress-message
490 jka-compr-verbose
482 (message "%s %s...done" uncompress-message base-name)) 491 (message "%s %s...done" uncompress-message base-name))
483 492
484 (and 493 (and
@@ -534,6 +543,7 @@ There should be no more than seven characters after the final `/'."
534 543
535 (and 544 (and
536 uncompress-message 545 uncompress-message
546 jka-compr-verbose
537 (message "%s %s..." uncompress-message base-name)) 547 (message "%s %s..." uncompress-message base-name))
538 548
539 ;; Here we must read the output of uncompress program 549 ;; Here we must read the output of uncompress program
@@ -554,6 +564,7 @@ There should be no more than seven characters after the final `/'."
554 564
555 (and 565 (and
556 uncompress-message 566 uncompress-message
567 jka-compr-verbose
557 (message "%s %s...done" uncompress-message base-name)) 568 (message "%s %s...done" uncompress-message base-name))
558 569
559 (write-region 570 (write-region
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index bbf59e4e376..75de9a9f9b2 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -5,7 +5,7 @@
5 5
6;;;### (autoloads (5x5-crack 5x5-crack-xor-mutate 5x5-crack-mutating-best 6;;;### (autoloads (5x5-crack 5x5-crack-xor-mutate 5x5-crack-mutating-best
7;;;;;; 5x5-crack-mutating-current 5x5-crack-randomly 5x5) "5x5" 7;;;;;; 5x5-crack-mutating-current 5x5-crack-randomly 5x5) "5x5"
8;;;;;; "play/5x5.el" (19932 573)) 8;;;;;; "play/5x5.el" (19968 28627))
9;;; Generated autoloads from play/5x5.el 9;;; Generated autoloads from play/5x5.el
10 10
11(autoload '5x5 "5x5" "\ 11(autoload '5x5 "5x5" "\
@@ -16,18 +16,21 @@ squares you must fill the grid.
16 16
175x5 keyboard bindings are: 175x5 keyboard bindings are:
18\\<5x5-mode-map> 18\\<5x5-mode-map>
19Flip \\[5x5-flip-current] 19Flip \\[5x5-flip-current]
20Move up \\[5x5-up] 20Move up \\[5x5-up]
21Move down \\[5x5-down] 21Move down \\[5x5-down]
22Move left \\[5x5-left] 22Move left \\[5x5-left]
23Move right \\[5x5-right] 23Move right \\[5x5-right]
24Start new game \\[5x5-new-game] 24Start new game \\[5x5-new-game]
25New game with random grid \\[5x5-randomize] 25New game with random grid \\[5x5-randomize]
26Random cracker \\[5x5-crack-randomly] 26Random cracker \\[5x5-crack-randomly]
27Mutate current cracker \\[5x5-crack-mutating-current] 27Mutate current cracker \\[5x5-crack-mutating-current]
28Mutate best cracker \\[5x5-crack-mutating-best] 28Mutate best cracker \\[5x5-crack-mutating-best]
29Mutate xor cracker \\[5x5-crack-xor-mutate] 29Mutate xor cracker \\[5x5-crack-xor-mutate]
30Quit current game \\[5x5-quit-game] 30Solve with Calc \\[5x5-solve-suggest]
31Rotate left Calc Solutions \\[5x5-solve-rotate-left]
32Rotate right Calc Solutions \\[5x5-solve-rotate-right]
33Quit current game \\[5x5-quit-game]
31 34
32\(fn &optional SIZE)" t nil) 35\(fn &optional SIZE)" t nil)
33 36
@@ -486,7 +489,7 @@ A replacement function for `newline-and-indent', aligning as it goes.
486 489
487;;;### (autoloads (outlineify-sticky allout-mode allout-mode-p allout-auto-activation 490;;;### (autoloads (outlineify-sticky allout-mode allout-mode-p allout-auto-activation
488;;;;;; allout-setup allout-auto-activation-helper) "allout" "allout.el" 491;;;;;; allout-setup allout-auto-activation-helper) "allout" "allout.el"
489;;;;;; (19931 11784)) 492;;;;;; (19981 40664))
490;;; Generated autoloads from allout.el 493;;; Generated autoloads from allout.el
491 494
492(autoload 'allout-auto-activation-helper "allout" "\ 495(autoload 'allout-auto-activation-helper "allout" "\
@@ -844,7 +847,7 @@ for details on preparing emacs for automatic allout activation.
844 847
845;;;### (autoloads (allout-widgets-mode allout-widgets-auto-activation 848;;;### (autoloads (allout-widgets-mode allout-widgets-auto-activation
846;;;;;; allout-widgets-setup allout-widgets) "allout-widgets" "allout-widgets.el" 849;;;;;; allout-widgets-setup allout-widgets) "allout-widgets" "allout-widgets.el"
847;;;;;; (19931 11784)) 850;;;;;; (19981 40664))
848;;; Generated autoloads from allout-widgets.el 851;;; Generated autoloads from allout-widgets.el
849 852
850(let ((loads (get 'allout-widgets 'custom-loads))) (if (member '"allout-widgets" loads) nil (put 'allout-widgets 'custom-loads (cons '"allout-widgets" loads)))) 853(let ((loads (get 'allout-widgets 'custom-loads))) (if (member '"allout-widgets" loads) nil (put 'allout-widgets 'custom-loads (cons '"allout-widgets" loads))))
@@ -903,7 +906,7 @@ outline hot-spot navigation (see `allout-mode').
903;;;*** 906;;;***
904 907
905;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp" 908;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp"
906;;;;;; "net/ange-ftp.el" (19931 11784)) 909;;;;;; "net/ange-ftp.el" (19977 43600))
907;;; Generated autoloads from net/ange-ftp.el 910;;; Generated autoloads from net/ange-ftp.el
908 911
909(defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir) 912(defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir)
@@ -1015,7 +1018,7 @@ Used in `antlr-mode'. Also a useful function in `java-mode-hook'.
1015;;;*** 1018;;;***
1016 1019
1017;;;### (autoloads (appt-activate appt-add) "appt" "calendar/appt.el" 1020;;;### (autoloads (appt-activate appt-add) "appt" "calendar/appt.el"
1018;;;;;; (19922 19303)) 1021;;;;;; (19956 37456))
1019;;; Generated autoloads from calendar/appt.el 1022;;; Generated autoloads from calendar/appt.el
1020 1023
1021(autoload 'appt-add "appt" "\ 1024(autoload 'appt-add "appt" "\
@@ -1469,7 +1472,7 @@ Special commands:
1469;;;*** 1472;;;***
1470 1473
1471;;;### (autoloads (auth-source-cache-expiry) "auth-source" "gnus/auth-source.el" 1474;;;### (autoloads (auth-source-cache-expiry) "auth-source" "gnus/auth-source.el"
1472;;;;;; (19845 45374)) 1475;;;;;; (19981 40664))
1473;;; Generated autoloads from gnus/auth-source.el 1476;;; Generated autoloads from gnus/auth-source.el
1474 1477
1475(defvar auth-source-cache-expiry 7200 "\ 1478(defvar auth-source-cache-expiry 7200 "\
@@ -1759,7 +1762,7 @@ definition of \"random distance\".)
1759;;;*** 1762;;;***
1760 1763
1761;;;### (autoloads (display-battery-mode battery) "battery" "battery.el" 1764;;;### (autoloads (display-battery-mode battery) "battery" "battery.el"
1762;;;;;; (19845 45374)) 1765;;;;;; (19976 22732))
1763;;; Generated autoloads from battery.el 1766;;; Generated autoloads from battery.el
1764 (put 'battery-mode-line-string 'risky-local-variable t) 1767 (put 'battery-mode-line-string 'risky-local-variable t)
1765 1768
@@ -1791,7 +1794,7 @@ seconds.
1791;;;*** 1794;;;***
1792 1795
1793;;;### (autoloads (benchmark benchmark-run-compiled benchmark-run) 1796;;;### (autoloads (benchmark benchmark-run-compiled benchmark-run)
1794;;;;;; "benchmark" "emacs-lisp/benchmark.el" (19845 45374)) 1797;;;;;; "benchmark" "emacs-lisp/benchmark.el" (19981 40664))
1795;;; Generated autoloads from emacs-lisp/benchmark.el 1798;;; Generated autoloads from emacs-lisp/benchmark.el
1796 1799
1797(autoload 'benchmark-run "benchmark" "\ 1800(autoload 'benchmark-run "benchmark" "\
@@ -1824,7 +1827,7 @@ For non-interactive use see also `benchmark-run' and
1824;;;*** 1827;;;***
1825 1828
1826;;;### (autoloads (bibtex-search-entry bibtex-mode bibtex-initialize) 1829;;;### (autoloads (bibtex-search-entry bibtex-mode bibtex-initialize)
1827;;;;;; "bibtex" "textmodes/bibtex.el" (19931 11784)) 1830;;;;;; "bibtex" "textmodes/bibtex.el" (19971 4823))
1828;;; Generated autoloads from textmodes/bibtex.el 1831;;; Generated autoloads from textmodes/bibtex.el
1829 1832
1830(autoload 'bibtex-initialize "bibtex" "\ 1833(autoload 'bibtex-initialize "bibtex" "\
@@ -1903,8 +1906,10 @@ is limited to the current buffer. Optional arg START is buffer position
1903where the search starts. If it is nil, start search at beginning of buffer. 1906where the search starts. If it is nil, start search at beginning of buffer.
1904If DISPLAY is non-nil, display the buffer containing KEY. 1907If DISPLAY is non-nil, display the buffer containing KEY.
1905Otherwise, use `set-buffer'. 1908Otherwise, use `set-buffer'.
1906When called interactively, GLOBAL is t if there is a prefix arg or the current 1909When called interactively, START is nil, DISPLAY is t.
1907mode is not `bibtex-mode', START is nil, and DISPLAY is t. 1910Also, GLOBAL is t if the current mode is not `bibtex-mode'
1911or `bibtex-search-entry-globally' is non-nil.
1912A prefix arg negates the value of `bibtex-search-entry-globally'.
1908 1913
1909\(fn KEY &optional GLOBAL START DISPLAY)" t nil) 1914\(fn KEY &optional GLOBAL START DISPLAY)" t nil)
1910 1915
@@ -2271,7 +2276,7 @@ Incremental search of bookmarks, hiding the non-matches as we go.
2271;;;;;; browse-url-at-mouse browse-url-at-point browse-url browse-url-of-region 2276;;;;;; browse-url-at-mouse browse-url-at-point browse-url browse-url-of-region
2272;;;;;; browse-url-of-dired-file browse-url-of-buffer browse-url-of-file 2277;;;;;; browse-url-of-dired-file browse-url-of-buffer browse-url-of-file
2273;;;;;; browse-url-browser-function) "browse-url" "net/browse-url.el" 2278;;;;;; browse-url-browser-function) "browse-url" "net/browse-url.el"
2274;;;;;; (19911 48973)) 2279;;;;;; (19973 46551))
2275;;; Generated autoloads from net/browse-url.el 2280;;; Generated autoloads from net/browse-url.el
2276 2281
2277(defvar browse-url-browser-function (cond ((memq system-type '(windows-nt ms-dos cygwin)) 'browse-url-default-windows-browser) ((memq system-type '(darwin)) 'browse-url-default-macosx-browser) (t 'browse-url-default-browser)) "\ 2282(defvar browse-url-browser-function (cond ((memq system-type '(windows-nt ms-dos cygwin)) 'browse-url-default-windows-browser) ((memq system-type '(darwin)) 'browse-url-default-macosx-browser) (t 'browse-url-default-browser)) "\
@@ -2593,7 +2598,7 @@ Return a vector containing the lines from `bruce-phrases-file'.
2593;;;*** 2598;;;***
2594 2599
2595;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next) 2600;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next)
2596;;;;;; "bs" "bs.el" (19870 57559)) 2601;;;;;; "bs" "bs.el" (19976 22732))
2597;;; Generated autoloads from bs.el 2602;;; Generated autoloads from bs.el
2598 2603
2599(autoload 'bs-cycle-next "bs" "\ 2604(autoload 'bs-cycle-next "bs" "\
@@ -2676,7 +2681,7 @@ Like `bug-reference-mode', but only buttonize in comments and strings.
2676;;;;;; batch-byte-compile-if-not-done display-call-tree byte-compile 2681;;;;;; batch-byte-compile-if-not-done display-call-tree byte-compile
2677;;;;;; compile-defun byte-compile-file byte-recompile-directory 2682;;;;;; compile-defun byte-compile-file byte-recompile-directory
2678;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning) 2683;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning)
2679;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (19940 49234)) 2684;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (19968 28627))
2680;;; Generated autoloads from emacs-lisp/bytecomp.el 2685;;; Generated autoloads from emacs-lisp/bytecomp.el
2681(put 'byte-compile-dynamic 'safe-local-variable 'booleanp) 2686(put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
2682(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp) 2687(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
@@ -2834,8 +2839,8 @@ from the cursor position.
2834 2839
2835;;;### (autoloads (defmath calc-embedded-activate calc-embedded calc-grab-rectangle 2840;;;### (autoloads (defmath calc-embedded-activate calc-embedded calc-grab-rectangle
2836;;;;;; calc-grab-region full-calc-keypad calc-keypad calc-eval quick-calc 2841;;;;;; calc-grab-region full-calc-keypad calc-keypad calc-eval quick-calc
2837;;;;;; full-calc calc calc-dispatch) "calc" "calc/calc.el" (19845 2842;;;;;; full-calc calc calc-dispatch) "calc" "calc/calc.el" (19943
2838;;;;;; 45374)) 2843;;;;;; 25429))
2839;;; Generated autoloads from calc/calc.el 2844;;; Generated autoloads from calc/calc.el
2840 (define-key ctl-x-map "*" 'calc-dispatch) 2845 (define-key ctl-x-map "*" 'calc-dispatch)
2841 2846
@@ -2942,8 +2947,8 @@ See the documentation for `calculator-mode' for more information.
2942 2947
2943;;;*** 2948;;;***
2944 2949
2945;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19923 2950;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19956
2946;;;;;; 40175)) 2951;;;;;; 37456))
2947;;; Generated autoloads from calendar/calendar.el 2952;;; Generated autoloads from calendar/calendar.el
2948 2953
2949(autoload 'calendar "calendar" "\ 2954(autoload 'calendar "calendar" "\
@@ -3048,7 +3053,7 @@ Obsoletes `c-forward-into-nomenclature'.
3048;;;*** 3053;;;***
3049 3054
3050;;;### (autoloads (c-guess-basic-syntax) "cc-engine" "progmodes/cc-engine.el" 3055;;;### (autoloads (c-guess-basic-syntax) "cc-engine" "progmodes/cc-engine.el"
3051;;;;;; (19893 19022)) 3056;;;;;; (19981 40664))
3052;;; Generated autoloads from progmodes/cc-engine.el 3057;;; Generated autoloads from progmodes/cc-engine.el
3053 3058
3054(autoload 'c-guess-basic-syntax "cc-engine" "\ 3059(autoload 'c-guess-basic-syntax "cc-engine" "\
@@ -3058,9 +3063,109 @@ Return the syntactic context of the current line.
3058 3063
3059;;;*** 3064;;;***
3060 3065
3066;;;### (autoloads (c-guess-install c-guess-region-no-install c-guess-region
3067;;;;;; c-guess-buffer-no-install c-guess-buffer c-guess-no-install
3068;;;;;; c-guess) "cc-guess" "progmodes/cc-guess.el" (19981 40664))
3069;;; Generated autoloads from progmodes/cc-guess.el
3070
3071(defvar c-guess-guessed-offsets-alist nil "\
3072Currently guessed offsets-alist.")
3073
3074(defvar c-guess-guessed-basic-offset nil "\
3075Currently guessed basic-offset.")
3076
3077(autoload 'c-guess "cc-guess" "\
3078Guess the style in the region up to `c-guess-region-max', and install it.
3079
3080The style is given a name based on the file's absolute file name.
3081
3082If given a prefix argument (or if the optional argument ACCUMULATE is
3083non-nil) then the previous guess is extended, otherwise a new guess is
3084made from scratch.
3085
3086\(fn &optional ACCUMULATE)" t nil)
3087
3088(autoload 'c-guess-no-install "cc-guess" "\
3089Guess the style in the region up to `c-guess-region-max'; don't install it.
3090
3091If given a prefix argument (or if the optional argument ACCUMULATE is
3092non-nil) then the previous guess is extended, otherwise a new guess is
3093made from scratch.
3094
3095\(fn &optional ACCUMULATE)" t nil)
3096
3097(autoload 'c-guess-buffer "cc-guess" "\
3098Guess the style on the whole current buffer, and install it.
3099
3100The style is given a name based on the file's absolute file name.
3101
3102If given a prefix argument (or if the optional argument ACCUMULATE is
3103non-nil) then the previous guess is extended, otherwise a new guess is
3104made from scratch.
3105
3106\(fn &optional ACCUMULATE)" t nil)
3107
3108(autoload 'c-guess-buffer-no-install "cc-guess" "\
3109Guess the style on the whole current buffer; don't install it.
3110
3111If given a prefix argument (or if the optional argument ACCUMULATE is
3112non-nil) then the previous guess is extended, otherwise a new guess is
3113made from scratch.
3114
3115\(fn &optional ACCUMULATE)" t nil)
3116
3117(autoload 'c-guess-region "cc-guess" "\
3118Guess the style on the region and install it.
3119
3120The style is given a name based on the file's absolute file name.
3121
3122If given a prefix argument (or if the optional argument ACCUMULATE is
3123non-nil) then the previous guess is extended, otherwise a new guess is
3124made from scratch.
3125
3126\(fn START END &optional ACCUMULATE)" t nil)
3127
3128(autoload 'c-guess-region-no-install "cc-guess" "\
3129Guess the style on the region; don't install it.
3130
3131Every line of code in the region is examined and values for the following two
3132variables are guessed:
3133
3134* `c-basic-offset', and
3135* the indentation values of the various syntactic symbols in
3136 `c-offsets-alist'.
3137
3138The guessed values are put into `c-guess-guessed-basic-offset' and
3139`c-guess-guessed-offsets-alist'.
3140
3141Frequencies of use are taken into account when guessing, so minor
3142inconsistencies in the indentation style shouldn't produce wrong guesses.
3143
3144If given a prefix argument (or if the optional argument ACCUMULATE is
3145non-nil) then the previous examination is extended, otherwise a new
3146guess is made from scratch.
3147
3148Note that the larger the region to guess in, the slower the guessing.
3149So you can limit the region with `c-guess-region-max'.
3150
3151\(fn START END &optional ACCUMULATE)" t nil)
3152
3153(autoload 'c-guess-install "cc-guess" "\
3154Install the latest guessed style into the current buffer.
3155\(This guessed style is a combination of `c-guess-guessed-basic-offset',
3156`c-guess-guessed-offsets-alist' and `c-offsets-alist'.)
3157
3158The style is entered into CC Mode's style system by
3159`c-add-style'. Its name is either STYLE-NAME, or a name based on
3160the absolute file name of the file if STYLE-NAME is nil.
3161
3162\(fn &optional STYLE-NAME)" t nil)
3163
3164;;;***
3165
3061;;;### (autoloads (awk-mode pike-mode idl-mode java-mode objc-mode 3166;;;### (autoloads (awk-mode pike-mode idl-mode java-mode objc-mode
3062;;;;;; c++-mode c-mode c-initialize-cc-mode) "cc-mode" "progmodes/cc-mode.el" 3167;;;;;; c++-mode c-mode c-initialize-cc-mode) "cc-mode" "progmodes/cc-mode.el"
3063;;;;;; (19938 7518)) 3168;;;;;; (19981 40664))
3064;;; Generated autoloads from progmodes/cc-mode.el 3169;;; Generated autoloads from progmodes/cc-mode.el
3065 3170
3066(autoload 'c-initialize-cc-mode "cc-mode" "\ 3171(autoload 'c-initialize-cc-mode "cc-mode" "\
@@ -3237,7 +3342,7 @@ Key bindings:
3237;;;*** 3342;;;***
3238 3343
3239;;;### (autoloads (c-set-offset c-add-style c-set-style) "cc-styles" 3344;;;### (autoloads (c-set-offset c-add-style c-set-style) "cc-styles"
3240;;;;;; "progmodes/cc-styles.el" (19845 45374)) 3345;;;;;; "progmodes/cc-styles.el" (19981 40664))
3241;;; Generated autoloads from progmodes/cc-styles.el 3346;;; Generated autoloads from progmodes/cc-styles.el
3242 3347
3243(autoload 'c-set-style "cc-styles" "\ 3348(autoload 'c-set-style "cc-styles" "\
@@ -3298,7 +3403,7 @@ and exists only for compatibility reasons.
3298 3403
3299;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program 3404;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program
3300;;;;;; declare-ccl-program ccl-dump ccl-compile) "ccl" "international/ccl.el" 3405;;;;;; declare-ccl-program ccl-dump ccl-compile) "ccl" "international/ccl.el"
3301;;;;;; (19845 45374)) 3406;;;;;; (19943 25429))
3302;;; Generated autoloads from international/ccl.el 3407;;; Generated autoloads from international/ccl.el
3303 3408
3304(autoload 'ccl-compile "ccl" "\ 3409(autoload 'ccl-compile "ccl" "\
@@ -3559,7 +3664,7 @@ See the documentation of `define-ccl-program' for the detail of CCL program.
3559;;;*** 3664;;;***
3560 3665
3561;;;### (autoloads (cconv-closure-convert) "cconv" "emacs-lisp/cconv.el" 3666;;;### (autoloads (cconv-closure-convert) "cconv" "emacs-lisp/cconv.el"
3562;;;;;; (19869 36706)) 3667;;;;;; (19943 25429))
3563;;; Generated autoloads from emacs-lisp/cconv.el 3668;;; Generated autoloads from emacs-lisp/cconv.el
3564 3669
3565(autoload 'cconv-closure-convert "cconv" "\ 3670(autoload 'cconv-closure-convert "cconv" "\
@@ -3573,10 +3678,19 @@ Returns a form where all lambdas don't have any free variables.
3573 3678
3574;;;*** 3679;;;***
3575 3680
3576;;;### (autoloads (cfengine-mode) "cfengine" "progmodes/cfengine.el" 3681;;;### (autoloads (cfengine-mode cfengine3-mode) "cfengine" "progmodes/cfengine.el"
3577;;;;;; (19845 45374)) 3682;;;;;; (19981 40664))
3578;;; Generated autoloads from progmodes/cfengine.el 3683;;; Generated autoloads from progmodes/cfengine.el
3579 3684
3685(autoload 'cfengine3-mode "cfengine" "\
3686Major mode for editing cfengine input.
3687There are no special keybindings by default.
3688
3689Action blocks are treated as defuns, i.e. \\[beginning-of-defun] moves
3690to the action header.
3691
3692\(fn)" t nil)
3693
3580(autoload 'cfengine-mode "cfengine" "\ 3694(autoload 'cfengine-mode "cfengine" "\
3581Major mode for editing cfengine input. 3695Major mode for editing cfengine input.
3582There are no special keybindings by default. 3696There are no special keybindings by default.
@@ -4045,7 +4159,7 @@ If FRAME cannot display COLOR, return nil.
4045;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list 4159;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list
4046;;;;;; comint-redirect-send-command-to-process comint-redirect-send-command 4160;;;;;; comint-redirect-send-command-to-process comint-redirect-send-command
4047;;;;;; comint-run make-comint make-comint-in-buffer) "comint" "comint.el" 4161;;;;;; comint-run make-comint make-comint-in-buffer) "comint" "comint.el"
4048;;;;;; (19931 11784)) 4162;;;;;; (19981 40664))
4049;;; Generated autoloads from comint.el 4163;;; Generated autoloads from comint.el
4050 4164
4051(defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\ 4165(defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\
@@ -4177,8 +4291,8 @@ on third call it again advances points to the next difference and so on.
4177;;;;;; compilation-shell-minor-mode compilation-mode compilation-start 4291;;;;;; compilation-shell-minor-mode compilation-mode compilation-start
4178;;;;;; compile compilation-disable-input compile-command compilation-search-path 4292;;;;;; compile compilation-disable-input compile-command compilation-search-path
4179;;;;;; compilation-ask-about-save compilation-window-height compilation-start-hook 4293;;;;;; compilation-ask-about-save compilation-window-height compilation-start-hook
4180;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (19913 4294;;;;;; compilation-mode-hook) "compile" "progmodes/compile.el" (19968
4181;;;;;; 4309)) 4295;;;;;; 28627))
4182;;; Generated autoloads from progmodes/compile.el 4296;;; Generated autoloads from progmodes/compile.el
4183 4297
4184(defvar compilation-mode-hook nil "\ 4298(defvar compilation-mode-hook nil "\
@@ -4602,7 +4716,7 @@ If FIX is non-nil, run `copyright-fix-years' instead.
4602;;;*** 4716;;;***
4603 4717
4604;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode) 4718;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
4605;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (19931 11784)) 4719;;;;;; "cperl-mode" "progmodes/cperl-mode.el" (19975 1875))
4606;;; Generated autoloads from progmodes/cperl-mode.el 4720;;; Generated autoloads from progmodes/cperl-mode.el
4607(put 'cperl-indent-level 'safe-local-variable 'integerp) 4721(put 'cperl-indent-level 'safe-local-variable 'integerp)
4608(put 'cperl-brace-offset 'safe-local-variable 'integerp) 4722(put 'cperl-brace-offset 'safe-local-variable 'integerp)
@@ -4879,8 +4993,8 @@ INHERIT-INPUT-METHOD.
4879 4993
4880;;;*** 4994;;;***
4881 4995
4882;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (19863 4996;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (19978
4883;;;;;; 8742)) 4997;;;;;; 37530))
4884;;; Generated autoloads from textmodes/css-mode.el 4998;;; Generated autoloads from textmodes/css-mode.el
4885 4999
4886(autoload 'css-mode "css-mode" "\ 5000(autoload 'css-mode "css-mode" "\
@@ -4947,10 +5061,10 @@ Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings.
4947;;;;;; customize-rogue customize-unsaved customize-face-other-window 5061;;;;;; customize-rogue customize-unsaved customize-face-other-window
4948;;;;;; customize-face customize-changed-options customize-option-other-window 5062;;;;;; customize-face customize-changed-options customize-option-other-window
4949;;;;;; customize-option customize-group-other-window customize-group 5063;;;;;; customize-option customize-group-other-window customize-group
4950;;;;;; customize-mode customize customize-save-variable customize-set-variable 5064;;;;;; customize-mode customize customize-push-and-save customize-save-variable
4951;;;;;; customize-set-value custom-menu-sort-alphabetically custom-buffer-sort-alphabetically 5065;;;;;; customize-set-variable customize-set-value custom-menu-sort-alphabetically
4952;;;;;; custom-browse-sort-alphabetically) "cus-edit" "cus-edit.el" 5066;;;;;; custom-buffer-sort-alphabetically custom-browse-sort-alphabetically)
4953;;;;;; (19886 45771)) 5067;;;;;; "cus-edit" "cus-edit.el" (19980 19797))
4954;;; Generated autoloads from cus-edit.el 5068;;; Generated autoloads from cus-edit.el
4955 5069
4956(defvar custom-browse-sort-alphabetically nil "\ 5070(defvar custom-browse-sort-alphabetically nil "\
@@ -5016,6 +5130,17 @@ If given a prefix (or a COMMENT argument), also prompt for a comment.
5016 5130
5017\(fn VARIABLE VALUE &optional COMMENT)" t nil) 5131\(fn VARIABLE VALUE &optional COMMENT)" t nil)
5018 5132
5133(autoload 'customize-push-and-save "cus-edit" "\
5134Add ELTS to LIST-VAR and save for future sessions, safely.
5135ELTS should be a list. This function adds each entry to the
5136value of LIST-VAR using `add-to-list'.
5137
5138If Emacs is initialized, call `customize-save-variable' to save
5139the resulting list value now. Otherwise, add an entry to
5140`after-init-hook' to save it after initialization.
5141
5142\(fn LIST-VAR ELTS)" nil nil)
5143
5019(autoload 'customize "cus-edit" "\ 5144(autoload 'customize "cus-edit" "\
5020Select a customization buffer which you can use to set user options. 5145Select a customization buffer which you can use to set user options.
5021User options are structured into \"groups\". 5146User options are structured into \"groups\".
@@ -5253,8 +5378,8 @@ The format is suitable for use with `easy-menu-define'.
5253;;;*** 5378;;;***
5254 5379
5255;;;### (autoloads (customize-themes describe-theme custom-theme-visit-theme 5380;;;### (autoloads (customize-themes describe-theme custom-theme-visit-theme
5256;;;;;; customize-create-theme) "cus-theme" "cus-theme.el" (19886 5381;;;;;; customize-create-theme) "cus-theme" "cus-theme.el" (19980
5257;;;;;; 45771)) 5382;;;;;; 19797))
5258;;; Generated autoloads from cus-theme.el 5383;;; Generated autoloads from cus-theme.el
5259 5384
5260(autoload 'customize-create-theme "cus-theme" "\ 5385(autoload 'customize-create-theme "cus-theme" "\
@@ -5572,7 +5697,7 @@ There is some minimal font-lock support (see vars
5572;;;*** 5697;;;***
5573 5698
5574;;;### (autoloads (cancel-debug-on-entry debug-on-entry debug) "debug" 5699;;;### (autoloads (cancel-debug-on-entry debug-on-entry debug) "debug"
5575;;;;;; "emacs-lisp/debug.el" (19942 4565)) 5700;;;;;; "emacs-lisp/debug.el" (19961 55377))
5576;;; Generated autoloads from emacs-lisp/debug.el 5701;;; Generated autoloads from emacs-lisp/debug.el
5577 5702
5578(setq debugger 'debug) 5703(setq debugger 'debug)
@@ -5670,8 +5795,8 @@ START and END delimits the corners of text rectangle.
5670 5795
5671;;;*** 5796;;;***
5672 5797
5673;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (19890 5798;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (19965
5674;;;;;; 42850)) 5799;;;;;; 52428))
5675;;; Generated autoloads from progmodes/delphi.el 5800;;; Generated autoloads from progmodes/delphi.el
5676 5801
5677(autoload 'delphi-mode "delphi" "\ 5802(autoload 'delphi-mode "delphi" "\
@@ -5718,7 +5843,7 @@ Coloring:
5718Turning on Delphi mode calls the value of the variable `delphi-mode-hook' 5843Turning on Delphi mode calls the value of the variable `delphi-mode-hook'
5719with no args, if that value is non-nil. 5844with no args, if that value is non-nil.
5720 5845
5721\(fn &optional SKIP-INITIAL-PARSING)" t nil) 5846\(fn)" t nil)
5722 5847
5723;;;*** 5848;;;***
5724 5849
@@ -6064,7 +6189,7 @@ Deuglify broken Outlook (Express) articles and redisplay.
6064;;;*** 6189;;;***
6065 6190
6066;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib" 6191;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib"
6067;;;;;; "calendar/diary-lib.el" (19923 40175)) 6192;;;;;; "calendar/diary-lib.el" (19975 1875))
6068;;; Generated autoloads from calendar/diary-lib.el 6193;;; Generated autoloads from calendar/diary-lib.el
6069 6194
6070(autoload 'diary "diary-lib" "\ 6195(autoload 'diary "diary-lib" "\
@@ -6191,7 +6316,7 @@ Optional arguments are passed to `dig-invoke'.
6191;;;*** 6316;;;***
6192 6317
6193;;;### (autoloads (dired-mode dired-noselect dired-other-frame dired-other-window 6318;;;### (autoloads (dired-mode dired-noselect dired-other-frame dired-other-window
6194;;;;;; dired dired-listing-switches) "dired" "dired.el" (19927 37312)) 6319;;;;;; dired dired-listing-switches) "dired" "dired.el" (19966 16984))
6195;;; Generated autoloads from dired.el 6320;;; Generated autoloads from dired.el
6196 6321
6197(defvar dired-listing-switches (purecopy "-al") "\ 6322(defvar dired-listing-switches (purecopy "-al") "\
@@ -6543,8 +6668,8 @@ Locate SOA record and increment the serial field.
6543;;;*** 6668;;;***
6544 6669
6545;;;### (autoloads (doc-view-bookmark-jump doc-view-minor-mode doc-view-mode-maybe 6670;;;### (autoloads (doc-view-bookmark-jump doc-view-minor-mode doc-view-mode-maybe
6546;;;;;; doc-view-mode doc-view-mode-p) "doc-view" "doc-view.el" (19913 6671;;;;;; doc-view-mode doc-view-mode-p) "doc-view" "doc-view.el" (19953
6547;;;;;; 4309)) 6672;;;;;; 8437))
6548;;; Generated autoloads from doc-view.el 6673;;; Generated autoloads from doc-view.el
6549 6674
6550(autoload 'doc-view-mode-p "doc-view" "\ 6675(autoload 'doc-view-mode-p "doc-view" "\
@@ -7715,7 +7840,7 @@ Display Ediff's registry.
7715;;;*** 7840;;;***
7716 7841
7717;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe) 7842;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe)
7718;;;;;; "ediff-util" "vc/ediff-util.el" (19931 11784)) 7843;;;;;; "ediff-util" "vc/ediff-util.el" (19981 40664))
7719;;; Generated autoloads from vc/ediff-util.el 7844;;; Generated autoloads from vc/ediff-util.el
7720 7845
7721(autoload 'ediff-toggle-multiframe "ediff-util" "\ 7846(autoload 'ediff-toggle-multiframe "ediff-util" "\
@@ -7989,8 +8114,8 @@ optional prefix argument REINIT is non-nil.
7989;;;*** 8114;;;***
7990 8115
7991;;;### (autoloads (elp-results elp-instrument-package elp-instrument-list 8116;;;### (autoloads (elp-results elp-instrument-package elp-instrument-list
7992;;;;;; elp-instrument-function) "elp" "emacs-lisp/elp.el" (19845 8117;;;;;; elp-instrument-function) "elp" "emacs-lisp/elp.el" (19981
7993;;;;;; 45374)) 8118;;;;;; 40664))
7994;;; Generated autoloads from emacs-lisp/elp.el 8119;;; Generated autoloads from emacs-lisp/elp.el
7995 8120
7996(autoload 'elp-instrument-function "elp" "\ 8121(autoload 'elp-instrument-function "elp" "\
@@ -8025,7 +8150,7 @@ displayed.
8025;;;*** 8150;;;***
8026 8151
8027;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el" 8152;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
8028;;;;;; (19942 4565)) 8153;;;;;; (19978 37530))
8029;;; Generated autoloads from mail/emacsbug.el 8154;;; Generated autoloads from mail/emacsbug.el
8030 8155
8031(autoload 'report-emacs-bug "emacsbug" "\ 8156(autoload 'report-emacs-bug "emacsbug" "\
@@ -8454,7 +8579,7 @@ Look at CONFIG and try to expand GROUP.
8454;;;*** 8579;;;***
8455 8580
8456;;;### (autoloads (erc-handle-irc-url erc erc-select-read-args) "erc" 8581;;;### (autoloads (erc-handle-irc-url erc erc-select-read-args) "erc"
8457;;;;;; "erc/erc.el" (19903 54862)) 8582;;;;;; "erc/erc.el" (19981 40664))
8458;;; Generated autoloads from erc/erc.el 8583;;; Generated autoloads from erc/erc.el
8459 8584
8460(autoload 'erc-select-read-args "erc" "\ 8585(autoload 'erc-select-read-args "erc" "\
@@ -9802,7 +9927,7 @@ This is used only in conjunction with `expand-add-abbrevs'.
9802 9927
9803;;;*** 9928;;;***
9804 9929
9805;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (19931 11784)) 9930;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (19975 1875))
9806;;; Generated autoloads from progmodes/f90.el 9931;;; Generated autoloads from progmodes/f90.el
9807 9932
9808(autoload 'f90-mode "f90" "\ 9933(autoload 'f90-mode "f90" "\
@@ -9829,6 +9954,10 @@ Variables controlling indentation style and extra features:
9829`f90-program-indent' 9954`f90-program-indent'
9830 Extra indentation within program/module/subroutine/function blocks 9955 Extra indentation within program/module/subroutine/function blocks
9831 (default 2). 9956 (default 2).
9957`f90-associate-indent'
9958 Extra indentation within associate blocks (default 2).
9959`f90-critical-indent'
9960 Extra indentation within critical/block blocks (default 2).
9832`f90-continuation-indent' 9961`f90-continuation-indent'
9833 Extra indentation applied to continuation lines (default 5). 9962 Extra indentation applied to continuation lines (default 5).
9834`f90-comment-region' 9963`f90-comment-region'
@@ -10284,7 +10413,7 @@ result is a string that should be ready for the command line.
10284;;;*** 10413;;;***
10285 10414
10286;;;### (autoloads (find-grep-dired find-name-dired find-dired) "find-dired" 10415;;;### (autoloads (find-grep-dired find-name-dired find-dired) "find-dired"
10287;;;;;; "find-dired.el" (19864 29553)) 10416;;;;;; "find-dired.el" (19980 19797))
10288;;; Generated autoloads from find-dired.el 10417;;; Generated autoloads from find-dired.el
10289 10418
10290(autoload 'find-dired "find-dired" "\ 10419(autoload 'find-dired "find-dired" "\
@@ -10418,7 +10547,7 @@ Visit the file you click on in another window.
10418;;;;;; find-variable find-variable-noselect find-function-other-frame 10547;;;;;; find-variable find-variable-noselect find-function-other-frame
10419;;;;;; find-function-other-window find-function find-function-noselect 10548;;;;;; find-function-other-window find-function find-function-noselect
10420;;;;;; find-function-search-for-symbol find-library) "find-func" 10549;;;;;; find-function-search-for-symbol find-library) "find-func"
10421;;;;;; "emacs-lisp/find-func.el" (19845 45374)) 10550;;;;;; "emacs-lisp/find-func.el" (19981 40664))
10422;;; Generated autoloads from emacs-lisp/find-func.el 10551;;; Generated autoloads from emacs-lisp/find-func.el
10423 10552
10424(autoload 'find-library "find-func" "\ 10553(autoload 'find-library "find-func" "\
@@ -10654,7 +10783,7 @@ to get the effect of a C-q.
10654;;;*** 10783;;;***
10655 10784
10656;;;### (autoloads (flymake-mode-off flymake-mode-on flymake-mode) 10785;;;### (autoloads (flymake-mode-off flymake-mode-on flymake-mode)
10657;;;;;; "flymake" "progmodes/flymake.el" (19890 42850)) 10786;;;;;; "flymake" "progmodes/flymake.el" (19976 22732))
10658;;; Generated autoloads from progmodes/flymake.el 10787;;; Generated autoloads from progmodes/flymake.el
10659 10788
10660(autoload 'flymake-mode "flymake" "\ 10789(autoload 'flymake-mode "flymake" "\
@@ -10678,7 +10807,7 @@ Turn flymake mode off.
10678 10807
10679;;;### (autoloads (flyspell-buffer flyspell-region flyspell-mode-off 10808;;;### (autoloads (flyspell-buffer flyspell-region flyspell-mode-off
10680;;;;;; turn-off-flyspell turn-on-flyspell flyspell-mode flyspell-prog-mode) 10809;;;;;; turn-off-flyspell turn-on-flyspell flyspell-mode flyspell-prog-mode)
10681;;;;;; "flyspell" "textmodes/flyspell.el" (19931 11784)) 10810;;;;;; "flyspell" "textmodes/flyspell.el" (19981 40664))
10682;;; Generated autoloads from textmodes/flyspell.el 10811;;; Generated autoloads from textmodes/flyspell.el
10683 10812
10684(autoload 'flyspell-prog-mode "flyspell" "\ 10813(autoload 'flyspell-prog-mode "flyspell" "\
@@ -10873,7 +11002,7 @@ Visit a file in Forms mode in other window.
10873;;;*** 11002;;;***
10874 11003
10875;;;### (autoloads (fortran-mode) "fortran" "progmodes/fortran.el" 11004;;;### (autoloads (fortran-mode) "fortran" "progmodes/fortran.el"
10876;;;;;; (19905 10215)) 11005;;;;;; (19956 37456))
10877;;; Generated autoloads from progmodes/fortran.el 11006;;; Generated autoloads from progmodes/fortran.el
10878 11007
10879(autoload 'fortran-mode "fortran" "\ 11008(autoload 'fortran-mode "fortran" "\
@@ -11208,7 +11337,7 @@ DEFAULT-MAP specifies the default key map for ICON-LIST.
11208;;;*** 11337;;;***
11209 11338
11210;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server 11339;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server
11211;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (19931 11784)) 11340;;;;;; gnus-slave-no-server) "gnus" "gnus/gnus.el" (19978 37530))
11212;;; Generated autoloads from gnus/gnus.el 11341;;; Generated autoloads from gnus/gnus.el
11213(when (fboundp 'custom-autoload) 11342(when (fboundp 'custom-autoload)
11214 (custom-autoload 'gnus-select-method "gnus")) 11343 (custom-autoload 'gnus-select-method "gnus"))
@@ -11261,7 +11390,7 @@ prompt the user for the name of an NNTP server to use.
11261;;;;;; gnus-agent-get-undownloaded-list gnus-agent-delete-group 11390;;;;;; gnus-agent-get-undownloaded-list gnus-agent-delete-group
11262;;;;;; gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize 11391;;;;;; gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize
11263;;;;;; gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent" 11392;;;;;; gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent"
11264;;;;;; "gnus/gnus-agent.el" (19903 54862)) 11393;;;;;; "gnus/gnus-agent.el" (19953 61266))
11265;;; Generated autoloads from gnus/gnus-agent.el 11394;;; Generated autoloads from gnus/gnus-agent.el
11266 11395
11267(autoload 'gnus-unplugged "gnus-agent" "\ 11396(autoload 'gnus-unplugged "gnus-agent" "\
@@ -11352,7 +11481,7 @@ If CLEAN, obsolete (ignore).
11352;;;*** 11481;;;***
11353 11482
11354;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el" 11483;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
11355;;;;;; (19931 34253)) 11484;;;;;; (19981 40664))
11356;;; Generated autoloads from gnus/gnus-art.el 11485;;; Generated autoloads from gnus/gnus-art.el
11357 11486
11358(autoload 'gnus-article-prepare-display "gnus-art" "\ 11487(autoload 'gnus-article-prepare-display "gnus-art" "\
@@ -11494,7 +11623,7 @@ Convenience method to turn on gnus-dired-mode.
11494;;;*** 11623;;;***
11495 11624
11496;;;### (autoloads (gnus-draft-reminder) "gnus-draft" "gnus/gnus-draft.el" 11625;;;### (autoloads (gnus-draft-reminder) "gnus-draft" "gnus/gnus-draft.el"
11497;;;;;; (19881 27850)) 11626;;;;;; (19981 40664))
11498;;; Generated autoloads from gnus/gnus-draft.el 11627;;; Generated autoloads from gnus/gnus-draft.el
11499 11628
11500(autoload 'gnus-draft-reminder "gnus-draft" "\ 11629(autoload 'gnus-draft-reminder "gnus-draft" "\
@@ -11506,8 +11635,8 @@ Reminder user if there are unsent drafts.
11506 11635
11507;;;### (autoloads (gnus-convert-png-to-face gnus-convert-face-to-png 11636;;;### (autoloads (gnus-convert-png-to-face gnus-convert-face-to-png
11508;;;;;; gnus-face-from-file gnus-x-face-from-file gnus-insert-random-x-face-header 11637;;;;;; gnus-face-from-file gnus-x-face-from-file gnus-insert-random-x-face-header
11509;;;;;; gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (19845 11638;;;;;; gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (19980
11510;;;;;; 45374)) 11639;;;;;; 19797))
11511;;; Generated autoloads from gnus/gnus-fun.el 11640;;; Generated autoloads from gnus/gnus-fun.el
11512 11641
11513(autoload 'gnus-random-x-face "gnus-fun" "\ 11642(autoload 'gnus-random-x-face "gnus-fun" "\
@@ -11570,7 +11699,7 @@ If gravatars are already displayed, remove them.
11570;;;*** 11699;;;***
11571 11700
11572;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group) 11701;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
11573;;;;;; "gnus-group" "gnus/gnus-group.el" (19940 49234)) 11702;;;;;; "gnus-group" "gnus/gnus-group.el" (19981 40664))
11574;;; Generated autoloads from gnus/gnus-group.el 11703;;; Generated autoloads from gnus/gnus-group.el
11575 11704
11576(autoload 'gnus-fetch-group "gnus-group" "\ 11705(autoload 'gnus-fetch-group "gnus-group" "\
@@ -11745,7 +11874,7 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\") returns:
11745;;;*** 11874;;;***
11746 11875
11747;;;### (autoloads (gnus-button-reply gnus-button-mailto gnus-msg-mail) 11876;;;### (autoloads (gnus-button-reply gnus-button-mailto gnus-msg-mail)
11748;;;;;; "gnus-msg" "gnus/gnus-msg.el" (19845 45374)) 11877;;;;;; "gnus-msg" "gnus/gnus-msg.el" (19978 37530))
11749;;; Generated autoloads from gnus/gnus-msg.el 11878;;; Generated autoloads from gnus/gnus-msg.el
11750 11879
11751(autoload 'gnus-msg-mail "gnus-msg" "\ 11880(autoload 'gnus-msg-mail "gnus-msg" "\
@@ -11866,7 +11995,7 @@ Add NUM into sorted LIST by side effect.
11866;;;*** 11995;;;***
11867 11996
11868;;;### (autoloads (gnus-registry-install-hooks gnus-registry-initialize) 11997;;;### (autoloads (gnus-registry-install-hooks gnus-registry-initialize)
11869;;;;;; "gnus-registry" "gnus/gnus-registry.el" (19942 4565)) 11998;;;;;; "gnus-registry" "gnus/gnus-registry.el" (19976 22732))
11870;;; Generated autoloads from gnus/gnus-registry.el 11999;;; Generated autoloads from gnus/gnus-registry.el
11871 12000
11872(autoload 'gnus-registry-initialize "gnus-registry" "\ 12001(autoload 'gnus-registry-initialize "gnus-registry" "\
@@ -11922,7 +12051,7 @@ Update the format specification near point.
11922;;;*** 12051;;;***
11923 12052
11924;;;### (autoloads (gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" 12053;;;### (autoloads (gnus-declare-backend) "gnus-start" "gnus/gnus-start.el"
11925;;;;;; (19906 31087)) 12054;;;;;; (19953 61266))
11926;;; Generated autoloads from gnus/gnus-start.el 12055;;; Generated autoloads from gnus/gnus-start.el
11927 12056
11928(autoload 'gnus-declare-backend "gnus-start" "\ 12057(autoload 'gnus-declare-backend "gnus-start" "\
@@ -11933,7 +12062,7 @@ Declare back end NAME with ABILITIES as a Gnus back end.
11933;;;*** 12062;;;***
11934 12063
11935;;;### (autoloads (gnus-summary-bookmark-jump) "gnus-sum" "gnus/gnus-sum.el" 12064;;;### (autoloads (gnus-summary-bookmark-jump) "gnus-sum" "gnus/gnus-sum.el"
11936;;;;;; (19942 4565)) 12065;;;;;; (19981 40664))
11937;;; Generated autoloads from gnus/gnus-sum.el 12066;;; Generated autoloads from gnus/gnus-sum.el
11938 12067
11939(autoload 'gnus-summary-bookmark-jump "gnus-sum" "\ 12068(autoload 'gnus-summary-bookmark-jump "gnus-sum" "\
@@ -12056,7 +12185,7 @@ Retrieve MAIL-ADDRESS gravatar and returns it.
12056 12185
12057;;;### (autoloads (zrgrep rgrep lgrep grep-find grep grep-mode grep-compute-defaults 12186;;;### (autoloads (zrgrep rgrep lgrep grep-find grep grep-mode grep-compute-defaults
12058;;;;;; grep-process-setup grep-setup-hook grep-find-command grep-command 12187;;;;;; grep-process-setup grep-setup-hook grep-find-command grep-command
12059;;;;;; grep-window-height) "grep" "progmodes/grep.el" (19930 13389)) 12188;;;;;; grep-window-height) "grep" "progmodes/grep.el" (19980 19797))
12060;;; Generated autoloads from progmodes/grep.el 12189;;; Generated autoloads from progmodes/grep.el
12061 12190
12062(defvar grep-window-height nil "\ 12191(defvar grep-window-height nil "\
@@ -12332,7 +12461,7 @@ Variables: `handwrite-linespace' (default 12)
12332;;;*** 12461;;;***
12333 12462
12334;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el" 12463;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el"
12335;;;;;; (19889 21967)) 12464;;;;;; (19981 40664))
12336;;; Generated autoloads from play/hanoi.el 12465;;; Generated autoloads from play/hanoi.el
12337 12466
12338(autoload 'hanoi "hanoi" "\ 12467(autoload 'hanoi "hanoi" "\
@@ -12536,7 +12665,7 @@ different regions. With numeric argument ARG, behaves like
12536;;;### (autoloads (doc-file-to-info doc-file-to-man describe-categories 12665;;;### (autoloads (doc-file-to-info doc-file-to-man describe-categories
12537;;;;;; describe-syntax describe-variable variable-at-point describe-function-1 12666;;;;;; describe-syntax describe-variable variable-at-point describe-function-1
12538;;;;;; find-lisp-object-file-name help-C-file-name describe-function) 12667;;;;;; find-lisp-object-file-name help-C-file-name describe-function)
12539;;;;;; "help-fns" "help-fns.el" (19938 7518)) 12668;;;;;; "help-fns" "help-fns.el" (19977 43600))
12540;;; Generated autoloads from help-fns.el 12669;;; Generated autoloads from help-fns.el
12541 12670
12542(autoload 'describe-function "help-fns" "\ 12671(autoload 'describe-function "help-fns" "\
@@ -12632,8 +12761,8 @@ gives the window that lists the options.")
12632 12761
12633;;;### (autoloads (help-xref-on-pp help-insert-xref-button help-xref-button 12762;;;### (autoloads (help-xref-on-pp help-insert-xref-button help-xref-button
12634;;;;;; help-make-xrefs help-buffer help-setup-xref help-mode-finish 12763;;;;;; help-make-xrefs help-buffer help-setup-xref help-mode-finish
12635;;;;;; help-mode-setup help-mode) "help-mode" "help-mode.el" (19886 12764;;;;;; help-mode-setup help-mode) "help-mode" "help-mode.el" (19958
12636;;;;;; 45771)) 12765;;;;;; 33091))
12637;;; Generated autoloads from help-mode.el 12766;;; Generated autoloads from help-mode.el
12638 12767
12639(autoload 'help-mode "help-mode" "\ 12768(autoload 'help-mode "help-mode" "\
@@ -13278,7 +13407,7 @@ argument VERBOSE non-nil makes the function verbose.
13278;;;*** 13407;;;***
13279 13408
13280;;;### (autoloads (global-hl-line-mode hl-line-mode) "hl-line" "hl-line.el" 13409;;;### (autoloads (global-hl-line-mode hl-line-mode) "hl-line" "hl-line.el"
13281;;;;;; (19845 45374)) 13410;;;;;; (19976 22732))
13282;;; Generated autoloads from hl-line.el 13411;;; Generated autoloads from hl-line.el
13283 13412
13284(autoload 'hl-line-mode "hl-line" "\ 13413(autoload 'hl-line-mode "hl-line" "\
@@ -13311,6 +13440,10 @@ or call the function `global-hl-line-mode'.")
13311Global minor mode to highlight the line about point in the current window. 13440Global minor mode to highlight the line about point in the current window.
13312With ARG, turn Global-Hl-Line mode on if ARG is positive, off otherwise. 13441With ARG, turn Global-Hl-Line mode on if ARG is positive, off otherwise.
13313 13442
13443If `global-hl-line-sticky-flag' is non-nil, Global Hl-Line mode
13444highlights the line about the current buffer's point in all
13445windows.
13446
13314Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and 13447Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and
13315`global-hl-line-highlight' on `pre-command-hook' and `post-command-hook'. 13448`global-hl-line-highlight' on `pre-command-hook' and `post-command-hook'.
13316 13449
@@ -14215,12 +14348,12 @@ Toggle inline image minor mode.
14215 14348
14216;;;*** 14349;;;***
14217 14350
14218;;;### (autoloads (imagemagick-register-types create-animated-image 14351;;;### (autoloads (imagemagick-register-types defimage find-image
14219;;;;;; defimage find-image remove-images insert-sliced-image insert-image 14352;;;;;; remove-images insert-sliced-image insert-image put-image
14220;;;;;; put-image create-image image-type-auto-detected-p image-type-available-p 14353;;;;;; create-image image-type-auto-detected-p image-type-available-p
14221;;;;;; image-type image-type-from-file-name image-type-from-file-header 14354;;;;;; image-type image-type-from-file-name image-type-from-file-header
14222;;;;;; image-type-from-buffer image-type-from-data) "image" "image.el" 14355;;;;;; image-type-from-buffer image-type-from-data) "image" "image.el"
14223;;;;;; (19939 28373)) 14356;;;;;; (19956 37456))
14224;;; Generated autoloads from image.el 14357;;; Generated autoloads from image.el
14225 14358
14226(autoload 'image-type-from-data "image" "\ 14359(autoload 'image-type-from-data "image" "\
@@ -14396,22 +14529,6 @@ Example:
14396 14529
14397(put 'defimage 'doc-string-elt '3) 14530(put 'defimage 'doc-string-elt '3)
14398 14531
14399(autoload 'create-animated-image "image" "\
14400Create an animated image, and begin animating it.
14401FILE-OR-DATA is an image file name or image data.
14402Optional TYPE is a symbol describing the image type. If TYPE is omitted
14403or nil, try to determine the image type from its first few bytes
14404of image data. If that doesn't work, and FILE-OR-DATA is a file name,
14405use its file extension as image type.
14406Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
14407Optional PROPS are additional image attributes to assign to the image,
14408like, e.g. `:mask MASK'.
14409Value is the image created, or nil if images of type TYPE are not supported.
14410
14411Images should not be larger than specified by `max-image-size'.
14412
14413\(fn FILE-OR-DATA &optional TYPE DATA-P &rest PROPS)" nil nil)
14414
14415(autoload 'imagemagick-register-types "image" "\ 14532(autoload 'imagemagick-register-types "image" "\
14416Register file types that can be handled by ImageMagick. 14533Register file types that can be handled by ImageMagick.
14417This adds the file types returned by `imagemagick-types' 14534This adds the file types returned by `imagemagick-types'
@@ -14632,7 +14749,7 @@ Image files are those whose name has an extension in
14632;;;*** 14749;;;***
14633 14750
14634;;;### (autoloads (image-bookmark-jump image-mode-as-text image-minor-mode 14751;;;### (autoloads (image-bookmark-jump image-mode-as-text image-minor-mode
14635;;;;;; image-mode) "image-mode" "image-mode.el" (19939 28373)) 14752;;;;;; image-mode) "image-mode" "image-mode.el" (19951 19539))
14636;;; Generated autoloads from image-mode.el 14753;;; Generated autoloads from image-mode.el
14637 14754
14638(autoload 'image-mode "image-mode" "\ 14755(autoload 'image-mode "image-mode" "\
@@ -14890,7 +15007,7 @@ of `inferior-lisp-program'). Runs the hooks from
14890;;;;;; Info-goto-emacs-key-command-node Info-goto-emacs-command-node 15007;;;;;; Info-goto-emacs-key-command-node Info-goto-emacs-command-node
14891;;;;;; Info-mode info-finder info-apropos Info-index Info-directory 15008;;;;;; Info-mode info-finder info-apropos Info-index Info-directory
14892;;;;;; Info-on-current-buffer info-standalone info-emacs-manual 15009;;;;;; Info-on-current-buffer info-standalone info-emacs-manual
14893;;;;;; info info-other-window) "info" "info.el" (19867 52471)) 15010;;;;;; info info-other-window) "info" "info.el" (19967 7755))
14894;;; Generated autoloads from info.el 15011;;; Generated autoloads from info.el
14895 15012
14896(autoload 'info-other-window "info" "\ 15013(autoload 'info-other-window "info" "\
@@ -15616,8 +15733,8 @@ You can bind this to the key C-c i in GNUS or mail by adding to
15616 15733
15617;;;*** 15734;;;***
15618 15735
15619;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (19931 15736;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (19946
15620;;;;;; 11784)) 15737;;;;;; 29209))
15621;;; Generated autoloads from iswitchb.el 15738;;; Generated autoloads from iswitchb.el
15622 15739
15623(defvar iswitchb-mode nil "\ 15740(defvar iswitchb-mode nil "\
@@ -15743,7 +15860,7 @@ by `jka-compr-installed'.
15743 15860
15744;;;*** 15861;;;***
15745 15862
15746;;;### (autoloads (js-mode) "js" "progmodes/js.el" (19914 25180)) 15863;;;### (autoloads (js-mode) "js" "progmodes/js.el" (19981 40664))
15747;;; Generated autoloads from progmodes/js.el 15864;;; Generated autoloads from progmodes/js.el
15748 15865
15749(autoload 'js-mode "js" "\ 15866(autoload 'js-mode "js" "\
@@ -16131,7 +16248,7 @@ use either \\[customize] or the function `latin1-display'.")
16131;;;*** 16248;;;***
16132 16249
16133;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el" 16250;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el"
16134;;;;;; (19917 1372)) 16251;;;;;; (19961 55377))
16135;;; Generated autoloads from progmodes/ld-script.el 16252;;; Generated autoloads from progmodes/ld-script.el
16136 16253
16137(autoload 'ld-script-mode "ld-script" "\ 16254(autoload 'ld-script-mode "ld-script" "\
@@ -16229,8 +16346,8 @@ See `linum-mode' for more information on Linum mode.
16229 16346
16230;;;*** 16347;;;***
16231 16348
16232;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (19845 16349;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (19975
16233;;;;;; 45374)) 16350;;;;;; 1875))
16234;;; Generated autoloads from loadhist.el 16351;;; Generated autoloads from loadhist.el
16235 16352
16236(autoload 'unload-feature "loadhist" "\ 16353(autoload 'unload-feature "loadhist" "\
@@ -16341,8 +16458,8 @@ uses the current buffer.
16341 16458
16342;;;*** 16459;;;***
16343 16460
16344;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (19863 16461;;;### (autoloads (log-view-mode) "log-view" "vc/log-view.el" (19946
16345;;;;;; 8742)) 16462;;;;;; 1612))
16346;;; Generated autoloads from vc/log-view.el 16463;;; Generated autoloads from vc/log-view.el
16347 16464
16348(autoload 'log-view-mode "log-view" "\ 16465(autoload 'log-view-mode "log-view" "\
@@ -16746,8 +16863,8 @@ matches may be returned from the message body.
16746;;;*** 16863;;;***
16747 16864
16748;;;### (autoloads (define-mail-abbrev build-mail-abbrevs mail-abbrevs-setup 16865;;;### (autoloads (define-mail-abbrev build-mail-abbrevs mail-abbrevs-setup
16749;;;;;; mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (19845 16866;;;;;; mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (19968
16750;;;;;; 45374)) 16867;;;;;; 28627))
16751;;; Generated autoloads from mail/mailabbrev.el 16868;;; Generated autoloads from mail/mailabbrev.el
16752 16869
16753(defvar mail-abbrevs-mode nil "\ 16870(defvar mail-abbrevs-mode nil "\
@@ -16856,7 +16973,7 @@ The mail client is taken to be the handler of mailto URLs.
16856 16973
16857;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode 16974;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode
16858;;;;;; makefile-gmake-mode makefile-automake-mode makefile-mode) 16975;;;;;; makefile-gmake-mode makefile-automake-mode makefile-mode)
16859;;;;;; "make-mode" "progmodes/make-mode.el" (19890 42850)) 16976;;;;;; "make-mode" "progmodes/make-mode.el" (19968 28627))
16860;;; Generated autoloads from progmodes/make-mode.el 16977;;; Generated autoloads from progmodes/make-mode.el
16861 16978
16862(autoload 'makefile-mode "make-mode" "\ 16979(autoload 'makefile-mode "make-mode" "\
@@ -17094,7 +17211,7 @@ Returns non-nil if the new state is enabled.
17094;;;;;; message-forward-make-body message-forward message-recover 17211;;;;;; message-forward-make-body message-forward message-recover
17095;;;;;; message-supersede message-cancel-news message-followup message-wide-reply 17212;;;;;; message-supersede message-cancel-news message-followup message-wide-reply
17096;;;;;; message-reply message-news message-mail message-mode) "message" 17213;;;;;; message-reply message-news message-mail message-mode) "message"
17097;;;;;; "gnus/message.el" (19940 49234)) 17214;;;;;; "gnus/message.el" (19980 19797))
17098;;; Generated autoloads from gnus/message.el 17215;;; Generated autoloads from gnus/message.el
17099 17216
17100(define-mail-user-agent 'message-user-agent 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook) 17217(define-mail-user-agent 'message-user-agent 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook)
@@ -17260,7 +17377,7 @@ which specify the range to operate on.
17260;;;*** 17377;;;***
17261 17378
17262;;;### (autoloads (metapost-mode metafont-mode) "meta-mode" "progmodes/meta-mode.el" 17379;;;### (autoloads (metapost-mode metafont-mode) "meta-mode" "progmodes/meta-mode.el"
17263;;;;;; (19845 45374)) 17380;;;;;; (19968 28627))
17264;;; Generated autoloads from progmodes/meta-mode.el 17381;;; Generated autoloads from progmodes/meta-mode.el
17265 17382
17266(autoload 'metafont-mode "meta-mode" "\ 17383(autoload 'metafont-mode "meta-mode" "\
@@ -17566,7 +17683,7 @@ Returns non-nil if the new state is enabled.
17566;;;*** 17683;;;***
17567 17684
17568;;;### (autoloads (list-dynamic-libraries butterfly) "misc" "misc.el" 17685;;;### (autoloads (list-dynamic-libraries butterfly) "misc" "misc.el"
17569;;;;;; (19913 4309)) 17686;;;;;; (19968 28627))
17570;;; Generated autoloads from misc.el 17687;;; Generated autoloads from misc.el
17571 17688
17572(autoload 'butterfly "misc" "\ 17689(autoload 'butterfly "misc" "\
@@ -17678,7 +17795,7 @@ whose file names match the specified wildcard.
17678;;;*** 17795;;;***
17679 17796
17680;;;### (autoloads (mixal-mode) "mixal-mode" "progmodes/mixal-mode.el" 17797;;;### (autoloads (mixal-mode) "mixal-mode" "progmodes/mixal-mode.el"
17681;;;;;; (19931 11784)) 17798;;;;;; (19961 55377))
17682;;; Generated autoloads from progmodes/mixal-mode.el 17799;;; Generated autoloads from progmodes/mixal-mode.el
17683 17800
17684(autoload 'mixal-mode "mixal-mode" "\ 17801(autoload 'mixal-mode "mixal-mode" "\
@@ -17776,7 +17893,7 @@ Assume text has been decoded if DECODED is non-nil.
17776 17893
17777;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt 17894;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
17778;;;;;; mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt) 17895;;;;;; mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
17779;;;;;; "mml2015" "gnus/mml2015.el" (19845 45374)) 17896;;;;;; "mml2015" "gnus/mml2015.el" (19981 40664))
17780;;; Generated autoloads from gnus/mml2015.el 17897;;; Generated autoloads from gnus/mml2015.el
17781 17898
17782(autoload 'mml2015-decrypt "mml2015" "\ 17899(autoload 'mml2015-decrypt "mml2015" "\
@@ -17977,7 +18094,7 @@ primary selection and region.
17977 18094
17978;;;*** 18095;;;***
17979 18096
17980;;;### (autoloads (mpc) "mpc" "mpc.el" (19863 8742)) 18097;;;### (autoloads (mpc) "mpc" "mpc.el" (19946 1612))
17981;;; Generated autoloads from mpc.el 18098;;; Generated autoloads from mpc.el
17982 18099
17983(autoload 'mpc "mpc" "\ 18100(autoload 'mpc "mpc" "\
@@ -18410,7 +18527,7 @@ listed in the PORTS list.
18410;;;*** 18527;;;***
18411 18528
18412;;;### (autoloads (open-network-stream) "network-stream" "net/network-stream.el" 18529;;;### (autoloads (open-network-stream) "network-stream" "net/network-stream.el"
18413;;;;;; (19906 31087)) 18530;;;;;; (19976 22732))
18414;;; Generated autoloads from net/network-stream.el 18531;;; Generated autoloads from net/network-stream.el
18415 18532
18416(autoload 'open-network-stream "network-stream" "\ 18533(autoload 'open-network-stream "network-stream" "\
@@ -18474,8 +18591,22 @@ values:
18474 capability command, and should return the command to switch on 18591 capability command, and should return the command to switch on
18475 STARTTLS if the server supports STARTTLS, and nil otherwise. 18592 STARTTLS if the server supports STARTTLS, and nil otherwise.
18476 18593
18594:always-query-capabilies says whether to query the server for
18595 capabilities, even if we're doing a `plain' network connection.
18596
18597:client-certificate should either be a list where the first
18598 element is the certificate key file name, and the second
18599 element is the certificate file name itself, or `t', which
18600 means that `auth-source' will be queried for the key and the
18601 certificate. This parameter will only be used when doing TLS
18602 or STARTTLS connections.
18603
18604If :use-starttls-if-possible is non-nil, do opportunistic
18605STARTTLS upgrades even if Emacs doesn't have built-in TLS
18606functionality.
18607
18477:nowait is a boolean that says the connection should be made 18608:nowait is a boolean that says the connection should be made
18478asynchronously, if possible. 18609 asynchronously, if possible.
18479 18610
18480\(fn NAME BUFFER HOST SERVICE &rest PARAMETERS)" nil nil) 18611\(fn NAME BUFFER HOST SERVICE &rest PARAMETERS)" nil nil)
18481 18612
@@ -19218,7 +19349,7 @@ exported source code blocks by language.
19218;;;*** 19349;;;***
19219 19350
19220;;;### (autoloads (inferior-octave) "octave-inf" "progmodes/octave-inf.el" 19351;;;### (autoloads (inferior-octave) "octave-inf" "progmodes/octave-inf.el"
19221;;;;;; (19894 39890)) 19352;;;;;; (19968 28627))
19222;;; Generated autoloads from progmodes/octave-inf.el 19353;;; Generated autoloads from progmodes/octave-inf.el
19223 19354
19224(autoload 'inferior-octave "octave-inf" "\ 19355(autoload 'inferior-octave "octave-inf" "\
@@ -19241,7 +19372,7 @@ startup file, `~/.emacs-octave'.
19241;;;*** 19372;;;***
19242 19373
19243;;;### (autoloads (octave-mode) "octave-mod" "progmodes/octave-mod.el" 19374;;;### (autoloads (octave-mode) "octave-mod" "progmodes/octave-mod.el"
19244;;;;;; (19894 39890)) 19375;;;;;; (19968 28627))
19245;;; Generated autoloads from progmodes/octave-mod.el 19376;;; Generated autoloads from progmodes/octave-mod.el
19246 19377
19247(autoload 'octave-mode "octave-mod" "\ 19378(autoload 'octave-mode "octave-mod" "\
@@ -20979,16 +21110,16 @@ unknown are returned as nil.
20979 21110
20980;;;*** 21111;;;***
20981 21112
20982;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (19899 21113;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (19968
20983;;;;;; 57784)) 21114;;;;;; 28627))
20984;;; Generated autoloads from progmodes/pascal.el 21115;;; Generated autoloads from progmodes/pascal.el
20985 21116
20986(autoload 'pascal-mode "pascal" "\ 21117(autoload 'pascal-mode "pascal" "\
20987Major mode for editing Pascal code. \\<pascal-mode-map> 21118Major mode for editing Pascal code. \\<pascal-mode-map>
20988TAB indents for Pascal code. Delete converts tabs to spaces as it moves back. 21119TAB indents for Pascal code. Delete converts tabs to spaces as it moves back.
20989 21120
20990\\[pascal-complete-word] completes the word around current point with respect to position in code 21121\\[completion-at-point] completes the word around current point with respect to position in code
20991\\[pascal-show-completions] shows all possible completions at this point. 21122\\[completion-help-at-point] shows all possible completions at this point.
20992 21123
20993Other useful functions are: 21124Other useful functions are:
20994 21125
@@ -21174,8 +21305,8 @@ Completion for GNU/Linux `mount'.
21174 21305
21175;;;*** 21306;;;***
21176 21307
21177;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (19845 21308;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (19961
21178;;;;;; 45374)) 21309;;;;;; 55377))
21179;;; Generated autoloads from pcmpl-rpm.el 21310;;; Generated autoloads from pcmpl-rpm.el
21180 21311
21181(autoload 'pcomplete/rpm "pcmpl-rpm" "\ 21312(autoload 'pcomplete/rpm "pcmpl-rpm" "\
@@ -21244,8 +21375,8 @@ Includes files as well as host names followed by a colon.
21244 21375
21245;;;### (autoloads (pcomplete-shell-setup pcomplete-comint-setup pcomplete-list 21376;;;### (autoloads (pcomplete-shell-setup pcomplete-comint-setup pcomplete-list
21246;;;;;; pcomplete-help pcomplete-expand pcomplete-continue pcomplete-expand-and-complete 21377;;;;;; pcomplete-help pcomplete-expand pcomplete-continue pcomplete-expand-and-complete
21247;;;;;; pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (19931 21378;;;;;; pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (19964
21248;;;;;; 11784)) 21379;;;;;; 31562))
21249;;; Generated autoloads from pcomplete.el 21380;;; Generated autoloads from pcomplete.el
21250 21381
21251(autoload 'pcomplete "pcomplete" "\ 21382(autoload 'pcomplete "pcomplete" "\
@@ -21529,6 +21660,17 @@ they are not defaultly assigned to keys.
21529 21660
21530;;;*** 21661;;;***
21531 21662
21663;;;### (autoloads (plstore-open) "plstore" "gnus/plstore.el" (19981
21664;;;;;; 40664))
21665;;; Generated autoloads from gnus/plstore.el
21666
21667(autoload 'plstore-open "plstore" "\
21668Create a plstore instance associated with FILE.
21669
21670\(fn FILE)" nil nil)
21671
21672;;;***
21673
21532;;;### (autoloads (po-find-file-coding-system) "po" "textmodes/po.el" 21674;;;### (autoloads (po-find-file-coding-system) "po" "textmodes/po.el"
21533;;;;;; (19845 45374)) 21675;;;;;; (19845 45374))
21534;;; Generated autoloads from textmodes/po.el 21676;;; Generated autoloads from textmodes/po.el
@@ -22225,7 +22367,7 @@ are both set to t.
22225 22367
22226;;;*** 22368;;;***
22227 22369
22228;;;### (autoloads (proced) "proced" "proced.el" (19886 45771)) 22370;;;### (autoloads (proced) "proced" "proced.el" (19975 1875))
22229;;; Generated autoloads from proced.el 22371;;; Generated autoloads from proced.el
22230 22372
22231(autoload 'proced "proced" "\ 22373(autoload 'proced "proced" "\
@@ -22288,8 +22430,8 @@ The default value is '(\"/usr/local/share/emacs/fonts/bdf\").")
22288 22430
22289;;;*** 22431;;;***
22290 22432
22291;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (19890 22433;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (19961
22292;;;;;; 42850)) 22434;;;;;; 55377))
22293;;; Generated autoloads from progmodes/ps-mode.el 22435;;; Generated autoloads from progmodes/ps-mode.el
22294 22436
22295(autoload 'ps-mode "ps-mode" "\ 22437(autoload 'ps-mode "ps-mode" "\
@@ -22537,8 +22679,8 @@ If EXTENSION is any other symbol, it is ignored.
22537 22679
22538;;;*** 22680;;;***
22539 22681
22540;;;### (autoloads (jython-mode python-mode run-python) "python" "progmodes/python.el" 22682;;;### (autoloads (jython-mode python-mode python-after-info-look
22541;;;;;; (19931 11784)) 22683;;;;;; run-python) "python" "progmodes/python.el" (19975 1875))
22542;;; Generated autoloads from progmodes/python.el 22684;;; Generated autoloads from progmodes/python.el
22543 22685
22544(add-to-list 'interpreter-mode-alist (cons (purecopy "jython") 'jython-mode)) 22686(add-to-list 'interpreter-mode-alist (cons (purecopy "jython") 'jython-mode))
@@ -22570,6 +22712,12 @@ behavior, change `python-remove-cwd-from-path' to nil.
22570 22712
22571\(fn &optional CMD NOSHOW NEW)" t nil) 22713\(fn &optional CMD NOSHOW NEW)" t nil)
22572 22714
22715(autoload 'python-after-info-look "python" "\
22716Set up info-look for Python.
22717Used with `eval-after-load'.
22718
22719\(fn)" nil nil)
22720
22573(autoload 'python-mode "python" "\ 22721(autoload 'python-mode "python" "\
22574Major mode for editing Python files. 22722Major mode for editing Python files.
22575Turns on Font Lock mode unconditionally since it is currently required 22723Turns on Font Lock mode unconditionally since it is currently required
@@ -22641,7 +22789,7 @@ them into characters should be done separately.
22641;;;;;; quail-defrule quail-install-decode-map quail-install-map 22789;;;;;; quail-defrule quail-install-decode-map quail-install-map
22642;;;;;; quail-define-rules quail-show-keyboard-layout quail-set-keyboard-layout 22790;;;;;; quail-define-rules quail-show-keyboard-layout quail-set-keyboard-layout
22643;;;;;; quail-define-package quail-use-package quail-title) "quail" 22791;;;;;; quail-define-package quail-use-package quail-title) "quail"
22644;;;;;; "international/quail.el" (19931 11784)) 22792;;;;;; "international/quail.el" (19943 25429))
22645;;; Generated autoloads from international/quail.el 22793;;; Generated autoloads from international/quail.el
22646 22794
22647(autoload 'quail-title "quail" "\ 22795(autoload 'quail-title "quail" "\
@@ -22945,7 +23093,7 @@ Display `quickurl-list' as a formatted list using `quickurl-list-mode'.
22945;;;*** 23093;;;***
22946 23094
22947;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc" 23095;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc"
22948;;;;;; "net/rcirc.el" (19942 4565)) 23096;;;;;; "net/rcirc.el" (19968 28627))
22949;;; Generated autoloads from net/rcirc.el 23097;;; Generated autoloads from net/rcirc.el
22950 23098
22951(autoload 'rcirc "rcirc" "\ 23099(autoload 'rcirc "rcirc" "\
@@ -22993,7 +23141,7 @@ See \\[compile].
22993;;;*** 23141;;;***
22994 23142
22995;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el" 23143;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el"
22996;;;;;; (19938 7518)) 23144;;;;;; (19975 1875))
22997;;; Generated autoloads from emacs-lisp/re-builder.el 23145;;; Generated autoloads from emacs-lisp/re-builder.el
22998 23146
22999(defalias 'regexp-builder 're-builder) 23147(defalias 'regexp-builder 're-builder)
@@ -23322,7 +23470,7 @@ Here are all local bindings.
23322;;;*** 23470;;;***
23323 23471
23324;;;### (autoloads (reftex-all-document-files) "reftex-parse" "textmodes/reftex-parse.el" 23472;;;### (autoloads (reftex-all-document-files) "reftex-parse" "textmodes/reftex-parse.el"
23325;;;;;; (19845 45374)) 23473;;;;;; (19980 19797))
23326;;; Generated autoloads from textmodes/reftex-parse.el 23474;;; Generated autoloads from textmodes/reftex-parse.el
23327 23475
23328(autoload 'reftex-all-document-files "reftex-parse" "\ 23476(autoload 'reftex-all-document-files "reftex-parse" "\
@@ -23407,7 +23555,7 @@ Extract diary entries from the region.
23407 23555
23408;;;*** 23556;;;***
23409 23557
23410;;;### (autoloads (repeat) "repeat" "repeat.el" (19845 45374)) 23558;;;### (autoloads (repeat) "repeat" "repeat.el" (19951 19539))
23411;;; Generated autoloads from repeat.el 23559;;; Generated autoloads from repeat.el
23412 23560
23413(autoload 'repeat "repeat" "\ 23561(autoload 'repeat "repeat" "\
@@ -23589,7 +23737,7 @@ variable.
23589;;;;;; rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers 23737;;;;;; rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers
23590;;;;;; rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers 23738;;;;;; rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers
23591;;;;;; rmail-user-mail-address-regexp rmail-movemail-variant-p) 23739;;;;;; rmail-user-mail-address-regexp rmail-movemail-variant-p)
23592;;;;;; "rmail" "mail/rmail.el" (19845 45374)) 23740;;;;;; "rmail" "mail/rmail.el" (19976 23054))
23593;;; Generated autoloads from mail/rmail.el 23741;;; Generated autoloads from mail/rmail.el
23594 23742
23595(autoload 'rmail-movemail-variant-p "rmail" "\ 23743(autoload 'rmail-movemail-variant-p "rmail" "\
@@ -23642,7 +23790,7 @@ If nil, display all header fields except those matched by
23642 23790
23643(custom-autoload 'rmail-displayed-headers "rmail" t) 23791(custom-autoload 'rmail-displayed-headers "rmail" t)
23644 23792
23645(defvar rmail-retry-ignored-headers (purecopy "^x-authentication-warning:\\|^x-detected-operating-system:\\|^x-spam[-a-z]*:\\|content-type:\\|content-transfer-encoding:\\|mime-version:") "\ 23793(defvar rmail-retry-ignored-headers (purecopy "^x-authentication-warning:\\|^x-detected-operating-system:\\|^x-spam[-a-z]*:\\|content-type:\\|content-transfer-encoding:\\|mime-version:\\|message-id:") "\
23646Headers that should be stripped when retrying a failed message.") 23794Headers that should be stripped when retrying a failed message.")
23647 23795
23648(custom-autoload 'rmail-retry-ignored-headers "rmail" t) 23796(custom-autoload 'rmail-retry-ignored-headers "rmail" t)
@@ -24068,8 +24216,8 @@ In Ruler mode, Emacs displays a ruler in the header line.
24068 24216
24069;;;*** 24217;;;***
24070 24218
24071;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (19845 24219;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (19965
24072;;;;;; 45374)) 24220;;;;;; 52428))
24073;;; Generated autoloads from emacs-lisp/rx.el 24221;;; Generated autoloads from emacs-lisp/rx.el
24074 24222
24075(autoload 'rx-to-string "rx" "\ 24223(autoload 'rx-to-string "rx" "\
@@ -24299,6 +24447,11 @@ CHAR
24299 like `and', but makes the match accessible with `match-end', 24447 like `and', but makes the match accessible with `match-end',
24300 `match-beginning', and `match-string'. 24448 `match-beginning', and `match-string'.
24301 24449
24450`(submatch-n N SEXP1 SEXP2 ...)'
24451`(group-n N SEXP1 SEXP2 ...)'
24452 like `group', but make it an explicitly-numbered group with
24453 group number N.
24454
24302`(or SEXP1 SEXP2 ...)' 24455`(or SEXP1 SEXP2 ...)'
24303`(| SEXP1 SEXP2 ...)' 24456`(| SEXP1 SEXP2 ...)'
24304 matches anything that matches SEXP1 or SEXP2, etc. If all 24457 matches anything that matches SEXP1 or SEXP2, etc. If all
@@ -24505,7 +24658,7 @@ during scrolling.
24505;;;*** 24658;;;***
24506 24659
24507;;;### (autoloads (semantic-mode semantic-default-submodes) "semantic" 24660;;;### (autoloads (semantic-mode semantic-default-submodes) "semantic"
24508;;;;;; "cedet/semantic.el" (19845 45374)) 24661;;;;;; "cedet/semantic.el" (19981 40664))
24509;;; Generated autoloads from cedet/semantic.el 24662;;; Generated autoloads from cedet/semantic.el
24510 24663
24511(defvar semantic-default-submodes '(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode) "\ 24664(defvar semantic-default-submodes '(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode) "\
@@ -24556,7 +24709,7 @@ Semantic mode.
24556;;;;;; mail-yank-prefix mail-setup-hook mail-personal-alias-file 24709;;;;;; mail-yank-prefix mail-setup-hook mail-personal-alias-file
24557;;;;;; mail-default-reply-to mail-archive-file-name mail-header-separator 24710;;;;;; mail-default-reply-to mail-archive-file-name mail-header-separator
24558;;;;;; send-mail-function mail-interactive mail-self-blind mail-specify-envelope-from 24711;;;;;; send-mail-function mail-interactive mail-self-blind mail-specify-envelope-from
24559;;;;;; mail-from-style) "sendmail" "mail/sendmail.el" (19935 31309)) 24712;;;;;; mail-from-style) "sendmail" "mail/sendmail.el" (19980 19797))
24560;;; Generated autoloads from mail/sendmail.el 24713;;; Generated autoloads from mail/sendmail.el
24561 24714
24562(defvar mail-from-style 'default "\ 24715(defvar mail-from-style 'default "\
@@ -24835,8 +24988,8 @@ Like `mail' command, but display mail buffer in another frame.
24835;;;*** 24988;;;***
24836 24989
24837;;;### (autoloads (server-save-buffers-kill-terminal server-mode 24990;;;### (autoloads (server-save-buffers-kill-terminal server-mode
24838;;;;;; server-force-delete server-start) "server" "server.el" (19902 24991;;;;;; server-force-delete server-start) "server" "server.el" (19975
24839;;;;;; 34006)) 24992;;;;;; 1875))
24840;;; Generated autoloads from server.el 24993;;; Generated autoloads from server.el
24841 24994
24842(put 'server-host 'risky-local-variable t) 24995(put 'server-host 'risky-local-variable t)
@@ -24899,7 +25052,7 @@ only these files will be asked to be saved.
24899 25052
24900;;;*** 25053;;;***
24901 25054
24902;;;### (autoloads (ses-mode) "ses" "ses.el" (19845 45374)) 25055;;;### (autoloads (ses-mode) "ses" "ses.el" (19980 19797))
24903;;; Generated autoloads from ses.el 25056;;; Generated autoloads from ses.el
24904 25057
24905(autoload 'ses-mode "ses" "\ 25058(autoload 'ses-mode "ses" "\
@@ -25139,7 +25292,7 @@ Set up file shadowing.
25139;;;*** 25292;;;***
25140 25293
25141;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el" 25294;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el"
25142;;;;;; (19935 983)) 25295;;;;;; (19964 31562))
25143;;; Generated autoloads from shell.el 25296;;; Generated autoloads from shell.el
25144 25297
25145(defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\ 25298(defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\
@@ -25188,8 +25341,8 @@ Otherwise, one argument `-i' is passed to the shell.
25188 25341
25189;;;*** 25342;;;***
25190 25343
25191;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (19942 25344;;;### (autoloads (shr-insert-document) "shr" "gnus/shr.el" (19976
25192;;;;;; 4565)) 25345;;;;;; 22732))
25193;;; Generated autoloads from gnus/shr.el 25346;;; Generated autoloads from gnus/shr.el
25194 25347
25195(autoload 'shr-insert-document "shr" "\ 25348(autoload 'shr-insert-document "shr" "\
@@ -25396,7 +25549,7 @@ symmetrical ones, and the same character twice for the others.
25396;;;*** 25549;;;***
25397 25550
25398;;;### (autoloads (smerge-start-session smerge-mode smerge-ediff) 25551;;;### (autoloads (smerge-start-session smerge-mode smerge-ediff)
25399;;;;;; "smerge-mode" "vc/smerge-mode.el" (19931 11784)) 25552;;;;;; "smerge-mode" "vc/smerge-mode.el" (19946 1612))
25400;;; Generated autoloads from vc/smerge-mode.el 25553;;; Generated autoloads from vc/smerge-mode.el
25401 25554
25402(autoload 'smerge-ediff "smerge-mode" "\ 25555(autoload 'smerge-ediff "smerge-mode" "\
@@ -25439,7 +25592,7 @@ interactively. If there's no argument, do it at the current buffer.
25439;;;*** 25592;;;***
25440 25593
25441;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail" 25594;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
25442;;;;;; "mail/smtpmail.el" (19940 49234)) 25595;;;;;; "mail/smtpmail.el" (19978 37530))
25443;;; Generated autoloads from mail/smtpmail.el 25596;;; Generated autoloads from mail/smtpmail.el
25444 25597
25445(autoload 'smtpmail-send-it "smtpmail" "\ 25598(autoload 'smtpmail-send-it "smtpmail" "\
@@ -25745,8 +25898,8 @@ From a program takes two point or marker arguments, BEG and END.
25745 25898
25746;;;*** 25899;;;***
25747 25900
25748;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (19867 25901;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (19976
25749;;;;;; 52471)) 25902;;;;;; 22732))
25750;;; Generated autoloads from gnus/spam.el 25903;;; Generated autoloads from gnus/spam.el
25751 25904
25752(autoload 'spam-initialize "spam" "\ 25905(autoload 'spam-initialize "spam" "\
@@ -27306,7 +27459,7 @@ Connect to the Emacs talk group from the current X display or tty frame.
27306 27459
27307;;;*** 27460;;;***
27308 27461
27309;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (19886 45771)) 27462;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (19977 43600))
27310;;; Generated autoloads from tar-mode.el 27463;;; Generated autoloads from tar-mode.el
27311 27464
27312(autoload 'tar-mode "tar-mode" "\ 27465(autoload 'tar-mode "tar-mode" "\
@@ -27486,7 +27639,7 @@ subprocess started.
27486;;;*** 27639;;;***
27487 27640
27488;;;### (autoloads (testcover-this-defun) "testcover" "emacs-lisp/testcover.el" 27641;;;### (autoloads (testcover-this-defun) "testcover" "emacs-lisp/testcover.el"
27489;;;;;; (19845 45374)) 27642;;;;;; (19943 25429))
27490;;; Generated autoloads from emacs-lisp/testcover.el 27643;;; Generated autoloads from emacs-lisp/testcover.el
27491 27644
27492(autoload 'testcover-this-defun "testcover" "\ 27645(autoload 'testcover-this-defun "testcover" "\
@@ -27984,7 +28137,7 @@ Compose Thai characters in the current buffer.
27984 28137
27985;;;### (autoloads (list-at-point number-at-point symbol-at-point 28138;;;### (autoloads (list-at-point number-at-point symbol-at-point
27986;;;;;; sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing) 28139;;;;;; sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing)
27987;;;;;; "thingatpt" "thingatpt.el" (19918 22236)) 28140;;;;;; "thingatpt" "thingatpt.el" (19980 19797))
27988;;; Generated autoloads from thingatpt.el 28141;;; Generated autoloads from thingatpt.el
27989 28142
27990(autoload 'forward-thing "thingatpt" "\ 28143(autoload 'forward-thing "thingatpt" "\
@@ -28402,7 +28555,7 @@ With ARG, turn time stamping on if and only if arg is positive.
28402;;;;;; timeclock-workday-remaining-string timeclock-reread-log timeclock-query-out 28555;;;;;; timeclock-workday-remaining-string timeclock-reread-log timeclock-query-out
28403;;;;;; timeclock-change timeclock-status-string timeclock-out timeclock-in 28556;;;;;; timeclock-change timeclock-status-string timeclock-out timeclock-in
28404;;;;;; timeclock-modeline-display) "timeclock" "calendar/timeclock.el" 28557;;;;;; timeclock-modeline-display) "timeclock" "calendar/timeclock.el"
28405;;;;;; (19909 7240)) 28558;;;;;; (19981 40664))
28406;;; Generated autoloads from calendar/timeclock.el 28559;;; Generated autoloads from calendar/timeclock.el
28407 28560
28408(autoload 'timeclock-modeline-display "timeclock" "\ 28561(autoload 'timeclock-modeline-display "timeclock" "\
@@ -28808,7 +28961,7 @@ BUFFER defaults to `trace-buffer'.
28808;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion 28961;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion
28809;;;;;; tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers 28962;;;;;; tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers
28810;;;;;; tramp-file-name-handler tramp-syntax tramp-mode) "tramp" 28963;;;;;; tramp-file-name-handler tramp-syntax tramp-mode) "tramp"
28811;;;;;; "net/tramp.el" (19924 47209)) 28964;;;;;; "net/tramp.el" (19981 40664))
28812;;; Generated autoloads from net/tramp.el 28965;;; Generated autoloads from net/tramp.el
28813 28966
28814(defvar tramp-mode t "\ 28967(defvar tramp-mode t "\
@@ -28946,7 +29099,7 @@ Discard Tramp from loading remote files.
28946;;;*** 29099;;;***
28947 29100
28948;;;### (autoloads (tramp-ftp-enable-ange-ftp) "tramp-ftp" "net/tramp-ftp.el" 29101;;;### (autoloads (tramp-ftp-enable-ange-ftp) "tramp-ftp" "net/tramp-ftp.el"
28949;;;;;; (19931 11784)) 29102;;;;;; (19946 29209))
28950;;; Generated autoloads from net/tramp-ftp.el 29103;;; Generated autoloads from net/tramp-ftp.el
28951 29104
28952(autoload 'tramp-ftp-enable-ange-ftp "tramp-ftp" "\ 29105(autoload 'tramp-ftp-enable-ange-ftp "tramp-ftp" "\
@@ -29044,7 +29197,7 @@ First column's text sSs Second column's text
29044;;;;;; type-break type-break-mode type-break-keystroke-threshold 29197;;;;;; type-break type-break-mode type-break-keystroke-threshold
29045;;;;;; type-break-good-break-interval type-break-good-rest-interval 29198;;;;;; type-break-good-break-interval type-break-good-rest-interval
29046;;;;;; type-break-interval type-break-mode) "type-break" "type-break.el" 29199;;;;;; type-break-interval type-break-mode) "type-break" "type-break.el"
29047;;;;;; (19919 43103)) 29200;;;;;; (19981 40664))
29048;;; Generated autoloads from type-break.el 29201;;; Generated autoloads from type-break.el
29049 29202
29050(defvar type-break-mode nil "\ 29203(defvar type-break-mode nil "\
@@ -29805,7 +29958,7 @@ Setup variables that expose info about you and your system.
29805;;;*** 29958;;;***
29806 29959
29807;;;### (autoloads (url-queue-retrieve) "url-queue" "url/url-queue.el" 29960;;;### (autoloads (url-queue-retrieve) "url-queue" "url/url-queue.el"
29808;;;;;; (19942 4565)) 29961;;;;;; (19943 25429))
29809;;; Generated autoloads from url/url-queue.el 29962;;; Generated autoloads from url/url-queue.el
29810 29963
29811(autoload 'url-queue-retrieve "url-queue" "\ 29964(autoload 'url-queue-retrieve "url-queue" "\
@@ -30057,8 +30210,8 @@ If FILE-NAME is non-nil, save the result to FILE-NAME.
30057;;;;;; vc-print-log vc-retrieve-tag vc-create-tag vc-merge vc-insert-headers 30210;;;;;; vc-print-log vc-retrieve-tag vc-create-tag vc-merge vc-insert-headers
30058;;;;;; vc-revision-other-window vc-root-diff vc-ediff vc-version-ediff 30211;;;;;; vc-revision-other-window vc-root-diff vc-ediff vc-version-ediff
30059;;;;;; vc-diff vc-version-diff vc-register vc-next-action vc-before-checkin-hook 30212;;;;;; vc-diff vc-version-diff vc-register vc-next-action vc-before-checkin-hook
30060;;;;;; vc-checkin-hook vc-checkout-hook) "vc" "vc/vc.el" (19888 30213;;;;;; vc-checkin-hook vc-checkout-hook) "vc" "vc/vc.el" (19976
30061;;;;;; 1100)) 30214;;;;;; 22732))
30062;;; Generated autoloads from vc/vc.el 30215;;; Generated autoloads from vc/vc.el
30063 30216
30064(defvar vc-checkout-hook nil "\ 30217(defvar vc-checkout-hook nil "\
@@ -30601,7 +30754,7 @@ Key bindings:
30601;;;*** 30754;;;***
30602 30755
30603;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el" 30756;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el"
30604;;;;;; (19931 11784)) 30757;;;;;; (19973 46551))
30605;;; Generated autoloads from progmodes/verilog-mode.el 30758;;; Generated autoloads from progmodes/verilog-mode.el
30606 30759
30607(autoload 'verilog-mode "verilog-mode" "\ 30760(autoload 'verilog-mode "verilog-mode" "\
@@ -31382,7 +31535,7 @@ Convert Vietnamese characters of the current buffer to `VIQR' mnemonics.
31382;;;;;; view-mode view-buffer-other-frame view-buffer-other-window 31535;;;;;; view-mode view-buffer-other-frame view-buffer-other-window
31383;;;;;; view-buffer view-file-other-frame view-file-other-window 31536;;;;;; view-buffer view-file-other-frame view-file-other-window
31384;;;;;; view-file kill-buffer-if-not-modified view-remove-frame-by-deleting) 31537;;;;;; view-file kill-buffer-if-not-modified view-remove-frame-by-deleting)
31385;;;;;; "view" "view.el" (19886 45771)) 31538;;;;;; "view" "view.el" (19958 33091))
31386;;; Generated autoloads from view.el 31539;;; Generated autoloads from view.el
31387 31540
31388(defvar view-remove-frame-by-deleting t "\ 31541(defvar view-remove-frame-by-deleting t "\
@@ -31469,15 +31622,16 @@ EXIT-ACTION to `kill-buffer-if-not-modified' avoids this.
31469 31622
31470(autoload 'view-buffer-other-window "view" "\ 31623(autoload 'view-buffer-other-window "view" "\
31471View BUFFER in View mode in another window. 31624View BUFFER in View mode in another window.
31472Return to previous buffer when done, unless optional NOT-RETURN is 31625Emacs commands editing the buffer contents are not available;
31473non-nil. Emacs commands editing the buffer contents are not available; 31626instead, a special set of commands (mostly letters and
31474instead, a special set of commands (mostly letters and punctuation) are 31627punctuation) are defined for moving around in the buffer.
31475defined for moving around in the buffer.
31476Space scrolls forward, Delete scrolls backward. 31628Space scrolls forward, Delete scrolls backward.
31477For a list of all View commands, type H or h while viewing. 31629For a list of all View commands, type H or h while viewing.
31478 31630
31479This command runs the normal hook `view-mode-hook'. 31631This command runs the normal hook `view-mode-hook'.
31480 31632
31633Optional argument NOT-RETURN is ignored.
31634
31481Optional argument EXIT-ACTION is either nil or a function with buffer as 31635Optional argument EXIT-ACTION is either nil or a function with buffer as
31482argument. This function is called when finished viewing buffer. Use 31636argument. This function is called when finished viewing buffer. Use
31483this argument instead of explicitly setting `view-exit-action'. 31637this argument instead of explicitly setting `view-exit-action'.
@@ -31486,15 +31640,16 @@ this argument instead of explicitly setting `view-exit-action'.
31486 31640
31487(autoload 'view-buffer-other-frame "view" "\ 31641(autoload 'view-buffer-other-frame "view" "\
31488View BUFFER in View mode in another frame. 31642View BUFFER in View mode in another frame.
31489Return to previous buffer when done, unless optional NOT-RETURN is 31643Emacs commands editing the buffer contents are not available;
31490non-nil. Emacs commands editing the buffer contents are not available; 31644instead, a special set of commands (mostly letters and
31491instead, a special set of commands (mostly letters and punctuation) are 31645punctuation) are defined for moving around in the buffer.
31492defined for moving around in the buffer.
31493Space scrolls forward, Delete scrolls backward. 31646Space scrolls forward, Delete scrolls backward.
31494For a list of all View commands, type H or h while viewing. 31647For a list of all View commands, type H or h while viewing.
31495 31648
31496This command runs the normal hook `view-mode-hook'. 31649This command runs the normal hook `view-mode-hook'.
31497 31650
31651Optional argument NOT-RETURN is ignored.
31652
31498Optional argument EXIT-ACTION is either nil or a function with buffer as 31653Optional argument EXIT-ACTION is either nil or a function with buffer as
31499argument. This function is called when finished viewing buffer. Use 31654argument. This function is called when finished viewing buffer. Use
31500this argument instead of explicitly setting `view-exit-action'. 31655this argument instead of explicitly setting `view-exit-action'.
@@ -31595,31 +31750,20 @@ entry for the selected window, purge that entry from
31595 31750
31596(autoload 'view-mode-enter "view" "\ 31751(autoload 'view-mode-enter "view" "\
31597Enter View mode and set up exit from view mode depending on optional arguments. 31752Enter View mode and set up exit from view mode depending on optional arguments.
31598RETURN-TO non-nil means add RETURN-TO as an element to the buffer 31753Optional argument QUIT-RESTORE if non-nil must specify a valid
31599local alist `view-return-to-alist'. Save EXIT-ACTION in buffer 31754entry for quitting and restoring any window showing the current
31600local variable `view-exit-action'. It should be either nil or a 31755buffer. This entry replaces any parameter installed by
31756`display-buffer' and is used by `view-mode-exit'.
31757
31758Optional argument EXIT-ACTION, if non-nil, must specify a
31601function that takes a buffer as argument. This function will be 31759function that takes a buffer as argument. This function will be
31602called by `view-mode-exit'. 31760called by `view-mode-exit'.
31603 31761
31604RETURN-TO is either nil, meaning do nothing when exiting view
31605mode, or must have the format (WINDOW OLD-WINDOW . OLD-BUF-INFO).
31606WINDOW is the window used for viewing. OLD-WINDOW is nil or the
31607window to select after viewing. OLD-BUF-INFO tells what to do
31608with WINDOW when exiting. It is one of:
316091) nil Do nothing.
316102) t Delete WINDOW or, if it is the only window and
31611 `view-remove-frame-by-deleting' is non-nil, its
31612 frame.
316133) (OLD-BUFF START POINT) Display buffer OLD-BUFF with displayed text
31614 starting at START and point at POINT in WINDOW.
316154) quit-window Do `quit-window' in WINDOW.
316165) keep-frame Like case 2) but do not delete the frame.
31617
31618For a list of all View commands, type H or h while viewing. 31762For a list of all View commands, type H or h while viewing.
31619 31763
31620This function runs the normal hook `view-mode-hook'. 31764This function runs the normal hook `view-mode-hook'.
31621 31765
31622\(fn &optional RETURN-TO EXIT-ACTION)" nil nil) 31766\(fn &optional QUIT-RESTORE EXIT-ACTION)" nil nil)
31623 31767
31624(autoload 'View-exit-and-edit "view" "\ 31768(autoload 'View-exit-and-edit "view" "\
31625Exit View mode and make the current buffer editable. 31769Exit View mode and make the current buffer editable.
@@ -32246,8 +32390,8 @@ With arg, turn widget mode on if and only if arg is positive.
32246;;;*** 32390;;;***
32247 32391
32248;;;### (autoloads (widget-setup widget-insert widget-delete widget-create 32392;;;### (autoloads (widget-setup widget-insert widget-delete widget-create
32249;;;;;; widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19927 32393;;;;;; widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19968
32250;;;;;; 37225)) 32394;;;;;; 28627))
32251;;; Generated autoloads from wid-edit.el 32395;;; Generated autoloads from wid-edit.el
32252 32396
32253(autoload 'widgetp "wid-edit" "\ 32397(autoload 'widgetp "wid-edit" "\
@@ -32363,7 +32507,7 @@ With arg, turn Winner mode on if and only if arg is positive.
32363;;;*** 32507;;;***
32364 32508
32365;;;### (autoloads (woman-bookmark-jump woman-find-file woman-dired-find-file 32509;;;### (autoloads (woman-bookmark-jump woman-find-file woman-dired-find-file
32366;;;;;; woman woman-locale) "woman" "woman.el" (19886 45771)) 32510;;;;;; woman woman-locale) "woman" "woman.el" (19981 40664))
32367;;; Generated autoloads from woman.el 32511;;; Generated autoloads from woman.el
32368 32512
32369(defvar woman-locale nil "\ 32513(defvar woman-locale nil "\
@@ -32872,7 +33016,7 @@ Zone out, completely.
32872;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el" 33016;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el"
32873;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el" 33017;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el"
32874;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-fns.el" 33018;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-fns.el"
32875;;;;;; "w32-vars.el" "x-dnd.el") (19942 4644 183664)) 33019;;;;;; "w32-vars.el" "x-dnd.el") (19981 41048 99944))
32876 33020
32877;;;*** 33021;;;***
32878 33022
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 943eac42b02..0b569199935 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -115,20 +115,28 @@ from a file."
115(defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks) 115(defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks)
116(defvar unload-feature-special-hooks 116(defvar unload-feature-special-hooks
117 '(after-change-functions after-insert-file-functions 117 '(after-change-functions after-insert-file-functions
118 after-make-frame-functions auto-fill-function before-change-functions 118 after-make-frame-functions auto-coding-functions
119 auto-fill-function before-change-functions
119 blink-paren-function buffer-access-fontify-functions 120 blink-paren-function buffer-access-fontify-functions
120 choose-completion-string-functions comint-output-filter-functions 121 choose-completion-string-functions
121 command-line-functions comment-indent-function compilation-finish-functions 122 comint-output-filter-functions command-line-functions
123 comment-indent-function compilation-finish-functions
122 delete-frame-functions disabled-command-function 124 delete-frame-functions disabled-command-function
123 find-file-not-found-functions font-lock-beginning-of-syntax-function 125 fill-nobreak-predicate find-directory-functions
124 font-lock-fontify-buffer-function font-lock-fontify-region-function 126 find-file-not-found-functions
125 font-lock-mark-block-function font-lock-syntactic-face-function 127 font-lock-beginning-of-syntax-function
126 font-lock-unfontify-buffer-function font-lock-unfontify-region-function 128 font-lock-fontify-buffer-function
127 kill-buffer-query-functions kill-emacs-query-functions lisp-indent-function 129 font-lock-fontify-region-function
128 mouse-position-function redisplaylay-end-trigger-functions 130 font-lock-mark-block-function
129 suspend-tty-functions temp-buffer-show-function window-scroll-functions 131 font-lock-syntactic-face-function
130 window-size-change-functions write-contents-functions write-file-functions 132 font-lock-unfontify-buffer-function
131 write-region-annotate-functions) 133 font-lock-unfontify-region-function
134 kill-buffer-query-functions kill-emacs-query-functions
135 lisp-indent-function mouse-position-function
136 redisplaylay-end-trigger-functions suspend-tty-functions
137 temp-buffer-show-function window-scroll-functions
138 window-size-change-functions write-contents-functions
139 write-file-functions write-region-annotate-functions)
132 "A list of special hooks from Info node `(elisp)Standard Hooks'. 140 "A list of special hooks from Info node `(elisp)Standard Hooks'.
133 141
134These are symbols with hooklike values whose names don't end in 142These are symbols with hooklike values whose names don't end in
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 4c677523689..792827dd913 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -123,11 +123,11 @@
123;; multilingual text. 123;; multilingual text.
124(load "international/mule-cmds") 124(load "international/mule-cmds")
125(load "case-table") 125(load "case-table")
126(load "international/characters")
127(load "composite")
128;; This file doesn't exist when building a development version of Emacs 126;; This file doesn't exist when building a development version of Emacs
129;; from the repository. It is generated just after temacs is built. 127;; from the repository. It is generated just after temacs is built.
130(load "international/charprop.el" t) 128(load "international/charprop.el" t)
129(load "international/characters")
130(load "composite")
131 131
132;; Load language-specific files. 132;; Load language-specific files.
133(load "language/chinese") 133(load "language/chinese")
diff --git a/lisp/longlines.el b/lisp/longlines.el
index 387ce394f50..e81a235a17b 100644
--- a/lisp/longlines.el
+++ b/lisp/longlines.el
@@ -95,11 +95,15 @@ This is used when `longlines-show-hard-newlines' is on."
95 95
96;;;###autoload 96;;;###autoload
97(define-minor-mode longlines-mode 97(define-minor-mode longlines-mode
98 "Toggle Long Lines mode. 98 "Minor mode to wrap long lines.
99In Long Lines mode, long lines are wrapped if they extend beyond 99In Long Lines mode, long lines are wrapped if they extend beyond
100`fill-column'. The soft newlines used for line wrapping will not 100`fill-column'. The soft newlines used for line wrapping will not
101show up when the text is yanked or saved to disk. 101show up when the text is yanked or saved to disk.
102 102
103With no argument, this command toggles Flyspell mode.
104With a prefix argument ARG, turn Flyspell minor mode on if ARG is positive,
105otherwise turn it off.
106
103If the variable `longlines-auto-wrap' is non-nil, lines are automatically 107If the variable `longlines-auto-wrap' is non-nil, lines are automatically
104wrapped whenever the buffer is changed. You can always call 108wrapped whenever the buffer is changed. You can always call
105`fill-paragraph' to fill individual paragraphs. 109`fill-paragraph' to fill individual paragraphs.
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index 934637ecbbd..f4b29958aab 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -351,7 +351,7 @@
351;; systems with non-classic /bin/[r]mail behavior 351;; systems with non-classic /bin/[r]mail behavior
352;; guard against nil user-mail-address in generating MESSAGE-ID: 352;; guard against nil user-mail-address in generating MESSAGE-ID:
353;; feedmail-queue-slug-suspect-regexp is now a variable to 353;; feedmail-queue-slug-suspect-regexp is now a variable to
354;; accomodate non-ASCII environments (thanks to 354;; accommodate non-ASCII environments (thanks to
355;; Makoto.Nakagawa@jp.compaq.com for this suggestion) 355;; Makoto.Nakagawa@jp.compaq.com for this suggestion)
356;; feedmail-buffer-to-smtp, to parallel feedmail-buffer-to-smtpmail 356;; feedmail-buffer-to-smtp, to parallel feedmail-buffer-to-smtpmail
357;; patchlevel 10, 22 April 2001 357;; patchlevel 10, 22 April 2001
@@ -1633,22 +1633,21 @@ local gurus."
1633 ;; no evil. 1633 ;; no evil.
1634 (feedmail-say-debug ">in-> feedmail-buffer-to-smtpmail %s" addr-listoid) 1634 (feedmail-say-debug ">in-> feedmail-buffer-to-smtpmail %s" addr-listoid)
1635 (require 'smtpmail) 1635 (require 'smtpmail)
1636 (if (not (smtpmail-via-smtp addr-listoid prepped)) 1636 (let ((result (smtpmail-via-smtp addr-listoid prepped)))
1637 (progn 1637 (when result
1638 (set-buffer errors-to) 1638 (set-buffer errors-to)
1639 (insert "Send via smtpmail failed. Probable SMTP protocol error.\n") 1639 (insert "Send via smtpmail failed: %s" result)
1640 (insert "Look for details below or in the *Messages* buffer.\n\n") 1640 (let ((case-fold-search t)
1641 (let ((case-fold-search t) 1641 ;; don't be overconfident about the name of the trace buffer
1642 ;; don't be overconfident about the name of the trace buffer 1642 (tracer (concat "trace.*smtp.*" (regexp-quote smtpmail-smtp-server))))
1643 (tracer (concat "trace.*smtp.*" (regexp-quote smtpmail-smtp-server)))) 1643 (mapcar
1644 (mapcar 1644 (lambda (buffy)
1645 (lambda (buffy) 1645 (if (string-match tracer (buffer-name buffy))
1646 (if (string-match tracer (buffer-name buffy)) 1646 (progn
1647 (progn 1647 (insert "SMTP Trace from " (buffer-name buffy) "\n---------------")
1648 (insert "SMTP Trace from " (buffer-name buffy) "\n---------------") 1648 (insert-buffer-substring buffy)
1649 (insert-buffer-substring buffy) 1649 (insert "\n\n"))))
1650 (insert "\n\n")))) 1650 (buffer-list))))))
1651 (buffer-list))))))
1652 1651
1653(declare-function smtp-via-smtp "ext:smtp" (sender recipients smtp-text-buffer)) 1652(declare-function smtp-via-smtp "ext:smtp" (sender recipients smtp-text-buffer))
1654(defvar smtp-server) 1653(defvar smtp-server)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 02f78635e26..c43ec9e5611 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3025,9 +3025,13 @@ or forward if N is negative."
3025MSG-POS is a marker pointing at the error message in the grep buffer. 3025MSG-POS is a marker pointing at the error message in the grep buffer.
3026BAD-MARKER is a marker that ought to point at where to move to, 3026BAD-MARKER is a marker that ought to point at where to move to,
3027but probably is garbage." 3027but probably is garbage."
3028 (let* ((message (car (get-text-property msg-pos 'message (marker-buffer msg-pos)))) 3028
3029 (column (car message)) 3029 (let* ((message-loc (compilation--message->loc
3030 (linenum (cadr message)) 3030 (get-text-property msg-pos 'compilation-message
3031 (marker-buffer msg-pos))))
3032 (column (car message-loc))
3033 (linenum (cadr message-loc))
3034 line-text
3031 pos 3035 pos
3032 msgnum msgbeg msgend 3036 msgnum msgbeg msgend
3033 header-field 3037 header-field
@@ -3041,10 +3045,18 @@ but probably is garbage."
3041 (save-excursion 3045 (save-excursion
3042 ;; Find the line that the error message points at. 3046 ;; Find the line that the error message points at.
3043 (goto-char (point-min)) 3047 (goto-char (point-min))
3044 (forward-line linenum) 3048 (forward-line (1- linenum))
3045 (setq pos (point)) 3049 (setq pos (point))
3046 3050
3047 ;; Find which message that's in, 3051 ;; Find the text at the start of the line,
3052 ;; before the first = sign.
3053 ;; This text has a good chance of being also in the
3054 ;; decoded message.
3055 (save-excursion
3056 (skip-chars-forward "^=\n")
3057 (setq line-text (buffer-substring pos (point))))
3058
3059 ;; Find which message this position is in,
3048 ;; and the limits of that message. 3060 ;; and the limits of that message.
3049 (setq msgnum (rmail-what-message pos)) 3061 (setq msgnum (rmail-what-message pos))
3050 (setq msgbeg (rmail-msgbeg msgnum)) 3062 (setq msgbeg (rmail-msgbeg msgnum))
@@ -3071,11 +3083,23 @@ but probably is garbage."
3071 (rmail-show-message msgnum) 3083 (rmail-show-message msgnum)
3072 3084
3073 ;; Move to the right position within the displayed message. 3085 ;; Move to the right position within the displayed message.
3086 ;; Or at least try. The decoded message's lines may not
3087 ;; correspond to the lines in the inbox file.
3088 (goto-char (point-min))
3074 (if header-field 3089 (if header-field
3075 (re-search-forward (concat "^" (regexp-quote header-field)) nil t) 3090 (progn
3076 (search-forward "\n\n" nil t)) 3091 (re-search-forward (concat "^" (regexp-quote header-field)) nil t)
3077 (forward-line line-number-within) 3092 (forward-line line-number-within))
3078 (forward-char column))) 3093 (search-forward "\n\n" nil t)
3094 (if (re-search-forward (concat "^" (regexp-quote line-text)) nil t)
3095 (goto-char (match-beginning 0))))
3096 (if (eobp)
3097 ;; If the decoded message doesn't have enough lines,
3098 ;; go to the beginning rather than the end.
3099 (goto-char (point-min))
3100 ;; Otherwise, go to the right column.
3101 (if column
3102 (forward-char column)))))
3079 3103
3080(defun rmail-what-message (&optional pos) 3104(defun rmail-what-message (&optional pos)
3081 "Return message number POS (or point) is in." 3105 "Return message number POS (or point) is in."
@@ -4379,7 +4403,7 @@ With prefix argument N moves forward N messages with these labels.
4379 4403
4380;;;*** 4404;;;***
4381 4405
4382;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "30ab95e291380f184dff5fa6cde75520") 4406;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "a7d3e7205efa4e20ca9038c9b260ce83")
4383;;; Generated autoloads from rmailmm.el 4407;;; Generated autoloads from rmailmm.el
4384 4408
4385(autoload 'rmail-mime "rmailmm" "\ 4409(autoload 'rmail-mime "rmailmm" "\
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 651defeaf46..597068562b5 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -153,20 +153,21 @@ MIME entities.")
153;;; MIME-entity object 153;;; MIME-entity object
154 154
155(defun rmail-mime-entity (type disposition transfer-encoding 155(defun rmail-mime-entity (type disposition transfer-encoding
156 display header tagline body children handler) 156 display header tagline body children handler
157 &optional truncated)
157 "Retrun a newly created MIME-entity object from arguments. 158 "Retrun a newly created MIME-entity object from arguments.
158 159
159A MIME-entity is a vector of 9 elements: 160A MIME-entity is a vector of 10 elements:
160 161
161 [TYPE DISPOSITION TRANSFER-ENCODING DISPLAY HEADER TAGLINE BODY 162 [TYPE DISPOSITION TRANSFER-ENCODING DISPLAY HEADER TAGLINE BODY
162 CHILDREN HANDLER] 163 CHILDREN HANDLER TRUNCATED]
163 164
164TYPE and DISPOSITION correspond to MIME headers Content-Type and 165TYPE and DISPOSITION correspond to MIME headers Content-Type and
165Cotent-Disposition respectively, and has this format: 166Content-Disposition respectively, and have this format:
166 167
167 \(VALUE (ATTRIBUTE . VALUE) (ATTRIBUTE . VALUE) ...) 168 \(VALUE (ATTRIBUTE . VALUE) (ATTRIBUTE . VALUE) ...)
168 169
169VALUE is a string and ATTRIBUTE is a symbol. 170Each VALUE is a string and each ATTRIBUTE is a string.
170 171
171Consider the following header, for example: 172Consider the following header, for example:
172 173
@@ -192,8 +193,8 @@ has these values:
192 raw: displayed by the raw MIME data (for the header and body only) 193 raw: displayed by the raw MIME data (for the header and body only)
193 194
194HEADER and BODY are vectors [BEG END DISPLAY-FLAG], where BEG and 195HEADER and BODY are vectors [BEG END DISPLAY-FLAG], where BEG and
195END specify the region of the header or body lines in RMAIL's 196END are markers that specify the region of the header or body lines
196data (mbox) buffer, and DISPLAY-FLAG non-nil means that the 197in RMAIL's data (mbox) buffer, and DISPLAY-FLAG non-nil means that the
197header or body is, by default, displayed by the decoded 198header or body is, by default, displayed by the decoded
198presentation form. 199presentation form.
199 200
@@ -208,9 +209,12 @@ entity have one or more children. A \"message/rfc822\" entity
208has just one child. Any other entity has no child. 209has just one child. Any other entity has no child.
209 210
210HANDLER is a function to insert the entity according to DISPLAY. 211HANDLER is a function to insert the entity according to DISPLAY.
211It is called with one argument ENTITY." 212It is called with one argument ENTITY.
213
214TRUNCATED is non-nil if the text of this entity was truncated."
215
212 (vector type disposition transfer-encoding 216 (vector type disposition transfer-encoding
213 display header tagline body children handler)) 217 display header tagline body children handler truncated))
214 218
215;; Accessors for a MIME-entity object. 219;; Accessors for a MIME-entity object.
216(defsubst rmail-mime-entity-type (entity) (aref entity 0)) 220(defsubst rmail-mime-entity-type (entity) (aref entity 0))
@@ -222,6 +226,9 @@ It is called with one argument ENTITY."
222(defsubst rmail-mime-entity-body (entity) (aref entity 6)) 226(defsubst rmail-mime-entity-body (entity) (aref entity 6))
223(defsubst rmail-mime-entity-children (entity) (aref entity 7)) 227(defsubst rmail-mime-entity-children (entity) (aref entity 7))
224(defsubst rmail-mime-entity-handler (entity) (aref entity 8)) 228(defsubst rmail-mime-entity-handler (entity) (aref entity 8))
229(defsubst rmail-mime-entity-truncated (entity) (aref entity 9))
230(defsubst rmail-mime-entity-set-truncated (entity truncated)
231 (aset entity 9 truncated))
225 232
226(defsubst rmail-mime-message-p () 233(defsubst rmail-mime-message-p ()
227 "Non-nil if and only if the current message is a MIME." 234 "Non-nil if and only if the current message is a MIME."
@@ -237,6 +244,10 @@ It is called with one argument ENTITY."
237 (directory (button-get button 'directory)) 244 (directory (button-get button 'directory))
238 (data (button-get button 'data)) 245 (data (button-get button 'data))
239 (ofilename filename)) 246 (ofilename filename))
247 (if (and (not (stringp data))
248 (rmail-mime-entity-truncated data))
249 (unless (y-or-n-p "This entity is truncated; save anyway? ")
250 (error "Aborted")))
240 (setq filename (expand-file-name 251 (setq filename (expand-file-name
241 (read-file-name (format "Save as (default: %s): " filename) 252 (read-file-name (format "Save as (default: %s): " filename)
242 directory 253 directory
@@ -387,6 +398,11 @@ The value is a vector [ INDEX HEADER TAGLINE BODY END], where
387 (if (and rmail-mime-mbox-buffer (= (aref segment 1) (point-min))) 398 (if (and rmail-mime-mbox-buffer (= (aref segment 1) (point-min)))
388 (let ((new (aref (rmail-mime-entity-display entity) 1))) 399 (let ((new (aref (rmail-mime-entity-display entity) 1)))
389 (aset new 0 t)))) 400 (aset new 0 t))))
401 ;; Query as a warning before showing if truncated.
402 (if (and (not (stringp entity))
403 (rmail-mime-entity-truncated entity))
404 (unless (y-or-n-p "This entity is truncated; show anyway? ")
405 (error "Aborted")))
390 ;; Enter the shown mode. 406 ;; Enter the shown mode.
391 (rmail-mime-shown-mode entity) 407 (rmail-mime-shown-mode entity)
392 ;; Force this body shown. 408 ;; Force this body shown.
@@ -531,7 +547,7 @@ HEADER is a header component of a MIME-entity object (see
531 (beg (point)) 547 (beg (point))
532 (segment (rmail-mime-entity-segment (point) entity))) 548 (segment (rmail-mime-entity-segment (point) entity)))
533 549
534 (or (integerp (aref body 0)) 550 (or (integerp (aref body 0)) (markerp (aref body 0))
535 (let ((data (buffer-string))) 551 (let ((data (buffer-string)))
536 (aset body 0 data) 552 (aset body 0 data)
537 (delete-region (point-min) (point-max)))) 553 (delete-region (point-min) (point-max))))
@@ -688,7 +704,7 @@ directly."
688 (segment (rmail-mime-entity-segment (point) entity)) 704 (segment (rmail-mime-entity-segment (point) entity))
689 beg data size) 705 beg data size)
690 706
691 (if (integerp (aref body 0)) 707 (if (or (integerp (aref body 0)) (markerp (aref body 0)))
692 (setq data entity 708 (setq data entity
693 size (car bulk-data)) 709 size (car bulk-data))
694 (if (stringp (aref body 0)) 710 (if (stringp (aref body 0))
@@ -816,7 +832,7 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
816 (let ((boundary (cdr (assq 'boundary content-type))) 832 (let ((boundary (cdr (assq 'boundary content-type)))
817 (subtype (cadr (split-string (car content-type) "/"))) 833 (subtype (cadr (split-string (car content-type) "/")))
818 (index 0) 834 (index 0)
819 beg end next entities) 835 beg end next entities truncated)
820 (unless boundary 836 (unless boundary
821 (rmail-mm-get-boundary-error-message 837 (rmail-mm-get-boundary-error-message
822 "No boundary defined" content-type content-disposition 838 "No boundary defined" content-type content-disposition
@@ -845,7 +861,7 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
845 (setq beg (point-min)) 861 (setq beg (point-min))
846 862
847 (while (or (and (search-forward boundary nil t) 863 (while (or (and (search-forward boundary nil t)
848 (setq end (match-beginning 0))) 864 (setq truncated nil end (match-beginning 0)))
849 ;; If the boundary does not appear at all, 865 ;; If the boundary does not appear at all,
850 ;; the message was truncated. 866 ;; the message was truncated.
851 ;; Handle the rest of the truncated message 867 ;; Handle the rest of the truncated message
@@ -854,7 +870,7 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
854 (and (save-excursion 870 (and (save-excursion
855 (skip-chars-forward "\n") 871 (skip-chars-forward "\n")
856 (> (point-max) (point))) 872 (> (point-max) (point)))
857 (setq end (point-max)))) 873 (setq truncated t end (point-max))))
858 ;; If this is the last boundary according to RFC 2046, hide the 874 ;; If this is the last boundary according to RFC 2046, hide the
859 ;; epilogue, else hide the boundary only. Use a marker for 875 ;; epilogue, else hide the boundary only. Use a marker for
860 ;; `next' because `rmail-mime-show' may change the buffer. 876 ;; `next' because `rmail-mime-show' may change the buffer.
@@ -862,7 +878,7 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
862 (setq next (point-max-marker))) 878 (setq next (point-max-marker)))
863 ((looking-at "[ \t]*\n") 879 ((looking-at "[ \t]*\n")
864 (setq next (copy-marker (match-end 0) t))) 880 (setq next (copy-marker (match-end 0) t)))
865 ((= end (point-max)) 881 (truncated
866 ;; We're handling what's left of a truncated message. 882 ;; We're handling what's left of a truncated message.
867 (setq next (point-max-marker))) 883 (setq next (point-max-marker)))
868 (t 884 (t
@@ -886,6 +902,7 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
886 ;; Display a tagline. 902 ;; Display a tagline.
887 (aset (aref (rmail-mime-entity-display child) 1) 1 903 (aset (aref (rmail-mime-entity-display child) 1) 1
888 (aset (rmail-mime-entity-tagline child) 2 t)) 904 (aset (rmail-mime-entity-tagline child) 2 t))
905 (rmail-mime-entity-set-truncated child truncated)
889 (push child entities))) 906 (push child entities)))
890 907
891 (delete-region end next) 908 (delete-region end next)
@@ -1112,9 +1129,10 @@ modified."
1112 1129
1113 (if parse-tag 1130 (if parse-tag
1114 (let* ((is-inline (string= (car content-disposition) "inline")) 1131 (let* ((is-inline (string= (car content-disposition) "inline"))
1115 (header (vector (point-min) end nil)) 1132 (hdr-end (copy-marker end))
1133 (header (vector (point-min-marker) hdr-end nil))
1116 (tagline (vector parse-tag (cons nil nil) t)) 1134 (tagline (vector parse-tag (cons nil nil) t))
1117 (body (vector end (point-max) is-inline)) 1135 (body (vector hdr-end (point-max-marker) is-inline))
1118 (new (vector (aref header 2) (aref tagline 2) (aref body 2))) 1136 (new (vector (aref header 2) (aref tagline 2) (aref body 2)))
1119 children handler entity) 1137 children handler entity)
1120 (cond ((string-match "multipart/.*" (car content-type)) 1138 (cond ((string-match "multipart/.*" (car content-type))
@@ -1163,11 +1181,11 @@ modified."
1163 ;; Hide headers and handle the part. 1181 ;; Hide headers and handle the part.
1164 (put-text-property (point-min) (point-max) 'rmail-mime-entity 1182 (put-text-property (point-min) (point-max) 'rmail-mime-entity
1165 (rmail-mime-entity 1183 (rmail-mime-entity
1166 content-type content-disposition 1184 content-type content-disposition
1167 content-transfer-encoding 1185 content-transfer-encoding
1168 (vector (vector 'raw nil 'raw) (vector 'raw nil 'raw)) 1186 (vector (vector 'raw nil 'raw) (vector 'raw nil 'raw))
1169 (vector nil nil 'raw) (vector "" (cons nil nil) nil) 1187 (vector nil nil 'raw) (vector "" (cons nil nil) nil)
1170 (vector nil nil 'raw) nil nil)) 1188 (vector nil nil 'raw) nil nil))
1171 (save-restriction 1189 (save-restriction
1172 (cond ((string= (car content-type) "message/rfc822") 1190 (cond ((string= (car content-type) "message/rfc822")
1173 (narrow-to-region end (point-max))) 1191 (narrow-to-region end (point-max)))
@@ -1391,6 +1409,8 @@ This is the usual value of `rmail-insert-mime-forwarded-message-function'."
1391 (re-search-forward regexp nil t)) 1409 (re-search-forward regexp nil t))
1392 ;; Next, search the body. 1410 ;; Next, search the body.
1393 (if (and entity 1411 (if (and entity
1412 ;; RMS: I am not sure why, but sometimes this is a string.
1413 (not (stringp entity))
1394 (let* ((content-type (rmail-mime-entity-type entity)) 1414 (let* ((content-type (rmail-mime-entity-type entity))
1395 (charset (cdr (assq 'charset (cdr content-type))))) 1415 (charset (cdr (assq 'charset (cdr content-type)))))
1396 (or (not (string-match "text/.*" (car content-type))) 1416 (or (not (string-match "text/.*" (car content-type)))
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index c1405ec5ff3..fe20ad921da 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -138,25 +138,9 @@ Otherwise, let mailer send back a message to report errors."
138 :group 'sendmail 138 :group 'sendmail
139 :version "23.1") 139 :version "23.1")
140 140
141;; Prevent problems with `window-system' not having the correct value
142;; when loaddefs.el is loaded. `custom-reevaluate-setting' needs the
143;; standard value.
144;;;###autoload
145(put 'send-mail-function 'standard-value
146 ;; MS-Windows can access the clipboard even under -nw.
147 '((if (or (and window-system (eq system-type 'darwin))
148 (eq system-type 'windows-nt))
149 'mailclient-send-it
150 'sendmail-send-it)))
151
152;; Useful to set in site-init.el 141;; Useful to set in site-init.el
153;;;###autoload 142;;;###autoload
154(defcustom send-mail-function 143(defcustom send-mail-function 'sendmail-query-once
155 (if (or (and window-system (eq system-type 'darwin))
156 ;; MS-Windows can access the clipboard even under -nw.
157 (eq system-type 'windows-nt))
158 'mailclient-send-it
159 'sendmail-send-it)
160 "Function to call to send the current buffer as mail. 144 "Function to call to send the current buffer as mail.
161The headers should be delimited by a line which is 145The headers should be delimited by a line which is
162not a valid RFC822 header or continuation line, 146not a valid RFC822 header or continuation line,
@@ -164,14 +148,56 @@ that matches the variable `mail-header-separator'.
164This is used by the default mail-sending commands. See also 148This is used by the default mail-sending commands. See also
165`message-send-mail-function' for use with the Message package." 149`message-send-mail-function' for use with the Message package."
166 :type '(radio (function-item sendmail-send-it :tag "Use Sendmail package") 150 :type '(radio (function-item sendmail-send-it :tag "Use Sendmail package")
151 (function-item sendmail-query-once :tag "Query the user")
167 (function-item smtpmail-send-it :tag "Use SMTPmail package") 152 (function-item smtpmail-send-it :tag "Use SMTPmail package")
168 (function-item feedmail-send-it :tag "Use Feedmail package") 153 (function-item feedmail-send-it :tag "Use Feedmail package")
169 (function-item mailclient-send-it :tag "Use Mailclient package") 154 (function-item mailclient-send-it :tag "Use Mailclient package")
170 function) 155 function)
171 :initialize 'custom-initialize-delay 156 :version "24.1"
172 :group 'sendmail) 157 :group 'sendmail)
173 158
174;;;###autoload(custom-initialize-delay 'send-mail-function nil) 159(defvar sendmail-query-once-function 'query
160 "Either a function to send email, or the symbol `query'.")
161
162;;;###autoload
163(defun sendmail-query-once ()
164 "Send an email via `sendmail-query-once-function'.
165If `sendmail-query-once-function' is `query', ask the user what
166function to use, and then save that choice."
167 (when (equal sendmail-query-once-function 'query)
168 (let* ((default
169 (cond
170 ((or (and window-system (eq system-type 'darwin))
171 (eq system-type 'windows-nt))
172 'mailclient-send-it)
173 ((and sendmail-program
174 (executable-find sendmail-program))
175 'sendmail-send-it)))
176 (function
177 (if (or (not default)
178 ;; We have detected no OS-level mail senders, or we
179 ;; have already configured smtpmail, so we use the
180 ;; internal SMTP service.
181 (and (boundp 'smtpmail-smtp-server)
182 smtpmail-smtp-server))
183 'smtpmail-send-it
184 ;; Query the user.
185 (unwind-protect
186 (progn
187 (pop-to-buffer "*Mail Help*")
188 (erase-buffer)
189 (insert "Sending mail from Emacs hasn't been set up yet.\n\n"
190 "Type `y' to configure outgoing SMTP, or `n' to use\n"
191 "the default mail sender on your system.\n\n"
192 "To change this again at a later date, customize the\n"
193 "`send-mail-function' variable.\n")
194 (goto-char (point-min))
195 (if (y-or-n-p "Configure outgoing SMTP in Emacs? ")
196 'smtpmail-send-it
197 default))
198 (kill-buffer (current-buffer))))))
199 (customize-save-variable 'sendmail-query-once-function function)))
200 (funcall sendmail-query-once-function))
175 201
176;;;###autoload 202;;;###autoload
177(defcustom mail-header-separator (purecopy "--text follows this line--") 203(defcustom mail-header-separator (purecopy "--text follows this line--")
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 3fd2d9ddf21..073e2fa4a3c 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -71,9 +71,11 @@
71 :group 'mail) 71 :group 'mail)
72 72
73 73
74(defvar smtpmail-default-smtp-server nil 74(defcustom smtpmail-default-smtp-server nil
75 "Specify default SMTP server. 75 "Specify default SMTP server.
76This only has effect if you specify it before loading the smtpmail library.") 76This only has effect if you specify it before loading the smtpmail library."
77 :type '(choice (const nil) string)
78 :group 'smtpmail)
77 79
78(defcustom smtpmail-smtp-server 80(defcustom smtpmail-smtp-server
79 (or (getenv "SMTPSERVER") smtpmail-default-smtp-server) 81 (or (getenv "SMTPSERVER") smtpmail-default-smtp-server)
@@ -96,13 +98,14 @@ don't define this value."
96 98
97(defcustom smtpmail-stream-type nil 99(defcustom smtpmail-stream-type nil
98 "Connection type SMTP connections. 100 "Connection type SMTP connections.
99This may be either nil (plain connection) or `starttls' (use the 101This may be either nil (possibly upgraded to STARTTLS if
100starttls mechanism to turn on TLS security after opening the 102possible), or `starttls' (refuse to send if STARTTLS isn't
101stream)." 103available), or `plain' (never use STARTTLS).."
102 :version "24.1" 104 :version "24.1"
103 :group 'smtpmail 105 :group 'smtpmail
104 :type '(choice (const :tag "Plain" nil) 106 :type '(choice (const :tag "Possibly upgrade to STARTTLS" nil)
105 (const starttls))) 107 (const :tag "Always use STARTTLS" starttls)
108 (const :tag "Never use STARTTLS" plain)))
106 109
107(defcustom smtpmail-sendto-domain nil 110(defcustom smtpmail-sendto-domain nil
108 "Local domain name without a host name. 111 "Local domain name without a host name.
diff --git a/lisp/man.el b/lisp/man.el
index 7a9e6e3cca5..ed24e35f0ea 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -276,7 +276,9 @@ This regexp should not start with a `^' character.")
276This regular expression should start with a `^' character.") 276This regular expression should start with a `^' character.")
277 277
278(defvar Man-reference-regexp 278(defvar Man-reference-regexp
279 (concat "\\(" Man-name-regexp "\\)[ \t]*(\\(" Man-section-regexp "\\))") 279 (concat "\\(" Man-name-regexp
280 "\\(\n[ \t]+" Man-name-regexp "\\)*\\)[ \t]*(\\("
281 Man-section-regexp "\\))")
280 "Regular expression describing a reference to another manpage.") 282 "Regular expression describing a reference to another manpage.")
281 283
282(defvar Man-apropos-regexp 284(defvar Man-apropos-regexp
@@ -597,8 +599,8 @@ and the `Man-section-translations-alist' variables)."
597 (cond 599 (cond
598 ;; "chmod(2V)" case ? 600 ;; "chmod(2V)" case ?
599 ((string-match (concat "^" Man-reference-regexp "$") ref) 601 ((string-match (concat "^" Man-reference-regexp "$") ref)
600 (setq name (match-string 1 ref) 602 (setq name (replace-regexp-in-string "[\n\t ]" "" (match-string 1 ref))
601 section (match-string 2 ref))) 603 section (match-string 3 ref)))
602 ;; "2v chmod" case ? 604 ;; "2v chmod" case ?
603 ((string-match (concat "^\\(" Man-section-regexp 605 ((string-match (concat "^\\(" Man-section-regexp
604 "\\) +\\(" Man-name-regexp "\\)$") ref) 606 "\\) +\\(" Man-name-regexp "\\)$") ref)
@@ -1106,7 +1108,7 @@ Same for the ANSI bold and normal escape sequences."
1106 (put-text-property (match-beginning 0) 1108 (put-text-property (match-beginning 0)
1107 (match-end 0) 1109 (match-end 0)
1108 'face Man-overstrike-face))) 1110 'face Man-overstrike-face)))
1109 (message "%s man page formatted" Man-arguments)) 1111 (message "%s man page formatted" (Man-page-from-arguments Man-arguments)))
1110 1112
1111(defun Man-highlight-references (&optional xref-man-type) 1113(defun Man-highlight-references (&optional xref-man-type)
1112 "Highlight the references on mouse-over. 1114 "Highlight the references on mouse-over.
@@ -1255,12 +1257,11 @@ manpage command."
1255 (Man-mode) 1257 (Man-mode)
1256 1258
1257 (if (not Man-page-list) 1259 (if (not Man-page-list)
1258 (let ((args Man-arguments)) 1260 (let ((args Man-arguments))
1259 (kill-buffer (current-buffer)) 1261 (kill-buffer (current-buffer))
1260 (error "Can't find the %s manpage" args))) 1262 (error "Can't find the %s manpage"
1261 1263 (Man-page-from-arguments args)))
1262 (set-buffer-modified-p nil) 1264 (set-buffer-modified-p nil))))
1263 ))
1264 ;; Restore case-fold-search before calling 1265 ;; Restore case-fold-search before calling
1265 ;; Man-notify-when-ready because it may switch buffers. 1266 ;; Man-notify-when-ready because it may switch buffers.
1266 1267
@@ -1271,6 +1272,18 @@ manpage command."
1271 (error "%s" err-mess)) 1272 (error "%s" err-mess))
1272 )))) 1273 ))))
1273 1274
1275(defun Man-page-from-arguments (args)
1276 ;; Skip arguments and only print the page name.
1277 (mapconcat
1278 'identity
1279 (delete nil
1280 (mapcar
1281 (lambda (elem)
1282 (and (not (string-match "^-" elem))
1283 elem))
1284 (split-string args " ")))
1285 " "))
1286
1274 1287
1275;; ====================================================================== 1288;; ======================================================================
1276;; set up manual mode in buffer and build alists 1289;; set up manual mode in buffer and build alists
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 437bd523841..caae40ed8c5 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1135,17 +1135,18 @@ mail status in mode line"))
1135 (let ((menu (make-sparse-keymap "Line Wrapping"))) 1135 (let ((menu (make-sparse-keymap "Line Wrapping")))
1136 1136
1137 (define-key menu [word-wrap] 1137 (define-key menu [word-wrap]
1138 `(menu-item ,(purecopy "Word Wrap (Visual Line mode)") 1138 `(menu-item
1139 (lambda () 1139 ,(purecopy "Word Wrap (Visual Line mode)")
1140 (interactive) 1140 (lambda ()
1141 (unless visual-line-mode 1141 (interactive)
1142 (visual-line-mode 1)) 1142 (unless visual-line-mode
1143 (message ,(purecopy "Visual-Line mode enabled"))) 1143 (visual-line-mode 1))
1144 :help ,(purecopy "Wrap long lines at word boundaries") 1144 (message ,(purecopy "Visual-Line mode enabled")))
1145 :button (:radio . (and (null truncate-lines) 1145 :help ,(purecopy "Wrap long lines at word boundaries")
1146 (not (truncated-partial-width-window-p)) 1146 :button (:radio . (and (null truncate-lines)
1147 word-wrap)) 1147 (not (truncated-partial-width-window-p))
1148 :visible (menu-bar-menu-frame-live-and-visible-p))) 1148 word-wrap))
1149 :visible (menu-bar-menu-frame-live-and-visible-p)))
1149 1150
1150 (define-key menu [truncate] 1151 (define-key menu [truncate]
1151 `(menu-item ,(purecopy "Truncate Long Lines") 1152 `(menu-item ,(purecopy "Truncate Long Lines")
@@ -1238,78 +1239,88 @@ mail status in mode line"))
1238 menu-bar-separator) 1239 menu-bar-separator)
1239 1240
1240 (define-key menu [blink-cursor-mode] 1241 (define-key menu [blink-cursor-mode]
1241 (menu-bar-make-mm-toggle blink-cursor-mode 1242 (menu-bar-make-mm-toggle
1242 "Blinking Cursor" 1243 blink-cursor-mode
1243 "Whether the cursor blinks (Blink Cursor mode)")) 1244 "Blink Cursor"
1245 "Whether the cursor blinks (Blink Cursor mode)"))
1244 (define-key menu [cursor-separator] 1246 (define-key menu [cursor-separator]
1245 menu-bar-separator) 1247 menu-bar-separator)
1246 1248
1247 (define-key menu [save-place] 1249 (define-key menu [save-place]
1248 (menu-bar-make-toggle toggle-save-place-globally save-place 1250 (menu-bar-make-toggle
1249 "Save Place in Files between Sessions" 1251 toggle-save-place-globally save-place
1250 "Saving place in files %s" 1252 "Save Place in Files between Sessions"
1251 "Visit files of previous session when restarting Emacs" 1253 "Saving place in files %s"
1252 (require 'saveplace) 1254 "Visit files of previous session when restarting Emacs"
1253 ;; Do it by name, to avoid a free-variable 1255 (require 'saveplace)
1254 ;; warning during byte compilation. 1256 ;; Do it by name, to avoid a free-variable
1255 (set-default 1257 ;; warning during byte compilation.
1256 'save-place (not (symbol-value 'save-place))))) 1258 (set-default
1259 'save-place (not (symbol-value 'save-place)))))
1257 1260
1258 (define-key menu [uniquify] 1261 (define-key menu [uniquify]
1259 (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style 1262 (menu-bar-make-toggle
1260 "Use Directory Names in Buffer Names" 1263 toggle-uniquify-buffer-names uniquify-buffer-name-style
1261 "Directory name in buffer names (uniquify) %s" 1264 "Use Directory Names in Buffer Names"
1262 "Uniquify buffer names by adding parent directory names" 1265 "Directory name in buffer names (uniquify) %s"
1263 (require 'uniquify) 1266 "Uniquify buffer names by adding parent directory names"
1264 (setq uniquify-buffer-name-style 1267 (require 'uniquify)
1265 (if (not uniquify-buffer-name-style) 1268 (setq uniquify-buffer-name-style
1266 'forward)))) 1269 (if (not uniquify-buffer-name-style)
1270 'forward))))
1267 1271
1268 (define-key menu [edit-options-separator] 1272 (define-key menu [edit-options-separator]
1269 menu-bar-separator) 1273 menu-bar-separator)
1270 (define-key menu [cua-mode] 1274 (define-key menu [cua-mode]
1271 (menu-bar-make-mm-toggle cua-mode 1275 (menu-bar-make-mm-toggle
1272 "C-x/C-c/C-v Cut and Paste (CUA)" 1276 cua-mode
1273 "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste" 1277 "Use CUA Keys (Cut/Paste with C-x/C-c/C-v)"
1274 (:visible (or (not (boundp 'cua-enable-cua-keys)) 1278 "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste"
1275 cua-enable-cua-keys)))) 1279 (:visible (or (not (boundp 'cua-enable-cua-keys))
1280 cua-enable-cua-keys))))
1276 1281
1277 (define-key menu [cua-emulation-mode] 1282 (define-key menu [cua-emulation-mode]
1278 (menu-bar-make-mm-toggle cua-mode 1283 (menu-bar-make-mm-toggle
1279 "Shift movement mark region (CUA)" 1284 cua-mode
1280 "Use shifted movement keys to set and extend the region" 1285 "Shift movement mark region (CUA)"
1281 (:visible (and (boundp 'cua-enable-cua-keys) 1286 "Use shifted movement keys to set and extend the region"
1282 (not cua-enable-cua-keys))))) 1287 (:visible (and (boundp 'cua-enable-cua-keys)
1288 (not cua-enable-cua-keys)))))
1283 1289
1284 (define-key menu [case-fold-search] 1290 (define-key menu [case-fold-search]
1285 (menu-bar-make-toggle toggle-case-fold-search case-fold-search 1291 (menu-bar-make-toggle
1286 "Case-Insensitive Search" 1292 toggle-case-fold-search case-fold-search
1287 "Case-Insensitive Search %s" 1293 "Ignore Case for Search"
1288 "Ignore letter-case in search commands")) 1294 "Case-Insensitive Search %s"
1295 "Ignore letter-case in search commands"))
1289 1296
1290 (define-key menu [auto-fill-mode] 1297 (define-key menu [auto-fill-mode]
1291 `(menu-item ,(purecopy "Auto Fill in Text Modes") 1298 `(menu-item
1292 menu-bar-text-mode-auto-fill 1299 ,(purecopy "Auto Fill in Text Modes")
1293 :help ,(purecopy "Automatically fill text while typing (Auto Fill mode)") 1300 menu-bar-text-mode-auto-fill
1294 :button (:toggle . (if (listp text-mode-hook) 1301 :help ,(purecopy "Automatically fill text while typing (Auto Fill mode)")
1295 (member 'turn-on-auto-fill text-mode-hook) 1302 :button (:toggle . (if (listp text-mode-hook)
1296 (eq 'turn-on-auto-fill text-mode-hook))))) 1303 (member 'turn-on-auto-fill text-mode-hook)
1304 (eq 'turn-on-auto-fill text-mode-hook)))))
1297 1305
1298 (define-key menu [line-wrapping] 1306 (define-key menu [line-wrapping]
1299 `(menu-item ,(purecopy "Line Wrapping in this Buffer") ,menu-bar-line-wrapping-menu)) 1307 `(menu-item ,(purecopy "Line Wrapping in this Buffer")
1308 ,menu-bar-line-wrapping-menu))
1300 1309
1301 1310
1302 (define-key menu [highlight-separator] 1311 (define-key menu [highlight-separator]
1303 menu-bar-separator) 1312 menu-bar-separator)
1304 (define-key menu [highlight-paren-mode] 1313 (define-key menu [highlight-paren-mode]
1305 (menu-bar-make-mm-toggle show-paren-mode 1314 (menu-bar-make-mm-toggle
1306 "Paren Match Highlighting" 1315 show-paren-mode
1307 "Highlight matching/mismatched parentheses at cursor (Show Paren mode)")) 1316 "Highlight Matching Parentheses"
1317 "Highlight matching/mismatched parentheses at cursor (Show Paren mode)"))
1308 (define-key menu [transient-mark-mode] 1318 (define-key menu [transient-mark-mode]
1309 (menu-bar-make-mm-toggle transient-mark-mode 1319 (menu-bar-make-mm-toggle
1310 "Active Region Highlighting" 1320 transient-mark-mode
1311 "Make text in active region stand out in color (Transient Mark mode)" 1321 "Highlight Active Region"
1312 (:enable (not cua-mode)))) 1322 "Make text in active region stand out in color (Transient Mark mode)"
1323 (:enable (not cua-mode))))
1313 menu)) 1324 menu))
1314 1325
1315 1326
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 93e486adb0f..df4edcc75e1 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,86 @@
12011-07-12 Bill Wohler <wohler@newt.com>
2
3 Release MH-E version 8.2.91.
4
5 * mh-e.el (Version, mh-version): Update for release 8.2.91.
6
7 * mh-compat.el (mh-pop-to-buffer-same-window): Add compatibility
8 function to call switch-to-buffer on systems that lack
9 pop-to-buffer-same-window.
10 * mh-folder.el (mh-inc-folder, mh-modify, mh-scan-folder)
11 (mh-make-folder): Call mh-pop-to-buffer-same-window instead of
12 switch-to-buffer. The previous change which used pop-to-buffer
13 produced the wrong behavior.
14
152011-07-12 Henrique Martins <henrique@martins.cc> (tiny change)
16
17 * mh-xface.el (mh-picon-get-image): Remove quote from block
18 argument.
19 * mh-mime.el (mh-mh-directive-present-p): Ditto.
20
212011-07-10 Bill Wohler <wohler@newt.com>
22
23 Release MH-E version 8.2.90.
24
25 * mh-e.el (Version, mh-version): Update for release 8.2.90.
26
27 * mh-utils.el (mh-sub-folders-actual): Remove FIXME question.
28
29 * mh-mime.el (mh-decode-message-subject): Fix case of Subject.
30
31 * mh-folder.el (mh-inc-folder, mh-modify, mh-scan-folder)
32 (mh-make-folder): Replace calls to switch-to-buffer with of
33 pop-to-buffer. The former is intended for interactive use only and
34 generates warnings in Emacs 24.
35
362011-07-09 Bill Wohler <wohler@newt.com>
37
38 * mh-speed.el (mh-speed-toggle,mh-speed-view): Document "ignored"
39 arguments to keep checkdoc happy.
40
41 * mh-search.el (mh-flists-execute): Ditto.
42
43 * mh-funcs.el (mh-undo-folder): Ditto.
44
45 * mh-comp.el (mh-user-agent-compose): Ditto.
46
47 * mh-xface.el (mh-face-to-png, mh-uncompface)
48 (mh-picon-file-contents): Only call set-buffer-multibyte if it
49 exists, which it doesn't in XEmacs.
50
512011-07-04 Bill Wohler <wohler@newt.com>
52
53 * mh-e.el: Just require mh-loaddefs since loading it in an
54 eval-and-compile block causes compilation errors in XEmacs.
55
56 * mh-acros.el, mh-comp.el, mh-e.el, mh-folder.el, mh-letter.el:
57 * mh-mime.el, mh-search.el, mh-seq.el: Shush XEmacs compiler in
58 mh-do-in-xemacs block.
59
60 * mh-compat.el (mh-window-full-height-p): Add compatibility
61 function for XEmacs.
62 * mh-show.el (mh-show-msg): Use it, and avoid compiler warning on
63 XEmacs.
64
65 * mh-letter.el (mh-letter-mode-map, mh-letter-complete)
66 (mh-complete-word): Remove FIXME comments since these functions
67 are still needed in other Emacsen. However, they can probably
68 stand to be generalized like completion-at-point.
69 (mh-letter-complete-or-space): Remove unused variable.
70
712011-07-03 Bill Wohler <wohler@newt.com>
72
73 * mh-compat.el (mh-test-completion): Add compatibility function
74 for XEmacs.
75 * mh-alias.el (mh-alias-letter-expand-alias): Use it, and avoid
76 compiler warning on XEmacs.
77
78 * mh-utils.el:
79 * mh-mime.el: Shush XEmacs compiler in mh-do-in-xemacs block.
80
81 * mh-folder.el: Use boundp instead of fboundp when testing
82 existence of desktop-buffer-mode-handlers.
83
12011-05-10 Jim Meyering <meyering@redhat.com> 842011-05-10 Jim Meyering <meyering@redhat.com>
2 85
3 Fix doubled-word typos. 86 Fix doubled-word typos.
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index c1964d5a4ea..2144eef7308 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -132,9 +132,10 @@ check if variable `transient-mark-mode' is active."
132 (boundp 'mark-active) mark-active)))) 132 (boundp 'mark-active) mark-active))))
133 133
134;; Shush compiler. 134;; Shush compiler.
135(defvar struct) ; XEmacs 135(mh-do-in-xemacs
136(defvar x) ; XEmacs 136 (defvar struct)
137(defvar y) ; XEmacs 137 (defvar x)
138 (defvar y))
138 139
139;;;###mh-autoload 140;;;###mh-autoload
140(defmacro mh-defstruct (name-spec &rest fields) 141(defmacro mh-defstruct (name-spec &rest fields)
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index 2df6025bf09..d1b3ccebf46 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -316,8 +316,7 @@ Blind aliases or users from /etc/passwd are not expanded."
316 res) 316 res)
317 res))) 317 res)))
318 ((t) (all-completions string mh-alias-alist pred)) 318 ((t) (all-completions string mh-alias-alist pred))
319 ((lambda) (if (fboundp 'test-completion) 319 ((lambda) (mh-test-completion string mh-alias-alist pred)))))))))
320 (test-completion string mh-alias-alist pred))))))))))
321 320
322 321
323;;; Alias File Updating 322;;; Alias File Updating
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index 169679e88ae..882a8771e28 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -213,7 +213,7 @@ Elements look like (HEADER . VALUE) where both HEADER and VALUE
213are strings. 213are strings.
214 214
215CONTINUE, SWITCH-FUNCTION, YANK-ACTION, SEND-ACTIONS, and 215CONTINUE, SWITCH-FUNCTION, YANK-ACTION, SEND-ACTIONS, and
216RETURN-ACTION are ignored." 216RETURN-ACTION and any additional arguments are IGNORED."
217 (mh-find-path) 217 (mh-find-path)
218 (let ((mh-error-if-no-draft t)) 218 (let ((mh-error-if-no-draft t))
219 (mh-send to "" subject) 219 (mh-send to "" subject)
@@ -223,7 +223,8 @@ RETURN-ACTION are ignored."
223 (setq other-headers (cdr other-headers))))) 223 (setq other-headers (cdr other-headers)))))
224 224
225;; Shush compiler. 225;; Shush compiler.
226(defvar sendmail-coding-system) ; XEmacs 226(mh-do-in-xemacs
227 (defvar sendmail-coding-system))
227 228
228;;;###autoload 229;;;###autoload
229(defun mh-send-letter (&optional arg) 230(defun mh-send-letter (&optional arg)
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 01a0f26b9e8..16dfe05b094 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -251,6 +251,18 @@ The argument STRING is ignored."
251 (buffer-substring-no-properties 251 (buffer-substring-no-properties
252 (match-beginning num) (match-end num))) 252 (match-beginning num) (match-end num)))
253 253
254(defun-mh mh-pop-to-buffer-same-window
255 pop-to-buffer-same-window (&optional buffer-or-name norecord label)
256 "Pop to buffer specified by BUFFER-OR-NAME in the selected window.
257Another window will be used only if the buffer can't be shown in
258the selected window, usually because it is dedicated to another
259buffer. Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are
260as for `pop-to-buffer'. This macro is used by Emacs versions that
261lack the `pop-to-buffer-same-window' function, introduced in
262Emacs 24. The function `switch-to-buffer' is used instead and
263LABEL is ignored."
264 (switch-to-buffer buffer-or-name norecord))
265
254(defun-mh mh-replace-regexp-in-string replace-regexp-in-string 266(defun-mh mh-replace-regexp-in-string replace-regexp-in-string
255 (regexp rep string &optional fixedcase literal subexp start) 267 (regexp rep string &optional fixedcase literal subexp start)
256 "Replace REGEXP with REP everywhere in STRING and return result. 268 "Replace REGEXP with REP everywhere in STRING and return result.
@@ -260,6 +272,12 @@ The arguments FIXEDCASE, SUBEXP, and START, used by
260`replace-in-string' are ignored." 272`replace-in-string' are ignored."
261 (replace-in-string string regexp rep literal)) 273 (replace-in-string string regexp rep literal))
262 274
275(defun-mh mh-test-completion
276 test-completion (string collection &optional predicate)
277 "Return non-nil if STRING is a valid completion.
278XEmacs does not have `test-completion'. This function returns nil
279on that system." nil)
280
263;; Copy of constant from url-util.el in Emacs 22; needed by Emacs 21. 281;; Copy of constant from url-util.el in Emacs 22; needed by Emacs 21.
264(if (not (boundp 'url-unreserved-chars)) 282(if (not (boundp 'url-unreserved-chars))
265 (defconst mh-url-unreserved-chars 283 (defconst mh-url-unreserved-chars
@@ -296,6 +314,16 @@ The arguments RETURN-TO and EXIT-ACTION are ignored."
296 (if exit-action nil) 314 (if exit-action nil)
297 (view-mode 1)) 315 (view-mode 1))
298 316
317(defun-mh mh-window-full-height-p
318 window-full-height-p (&optional WINDOW)
319 "Return non-nil if WINDOW is not the result of a vertical split.
320This function is defined in XEmacs as it lacks
321`window-full-height-p'. The values of the functions
322`window-height' and `frame-height' are compared instead. The
323argument WINDOW is ignored."
324 (= (1+ (window-height))
325 (frame-height)))
326
299(defmacro mh-write-file-functions () 327(defmacro mh-write-file-functions ()
300 "Return `write-file-functions' if it exists. 328 "Return `write-file-functions' if it exists.
301Otherwise return `local-write-file-hooks'. 329Otherwise return `local-write-file-hooks'.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 90803d183d2..51b41e854b0 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -5,7 +5,7 @@
5 5
6;; Author: Bill Wohler <wohler@newt.com> 6;; Author: Bill Wohler <wohler@newt.com>
7;; Maintainer: Bill Wohler <wohler@newt.com> 7;; Maintainer: Bill Wohler <wohler@newt.com>
8;; Version: 8.2 8;; Version: 8.2.91
9;; Keywords: mail 9;; Keywords: mail
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -27,7 +27,7 @@
27 27
28;; MH-E is an Emacs interface to the MH mail system. 28;; MH-E is an Emacs interface to the MH mail system.
29 29
30;; MH-E is supported in GNU Emacs 21 and 22, as well as XEmacs 21 30;; MH-E is supported in GNU Emacs 21 and higher, as well as XEmacs 21
31;; (except for versions 21.5.9-21.5.16). It is compatible with MH 31;; (except for versions 21.5.9-21.5.16). It is compatible with MH
32;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils 32;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils
33;; 1.0 and higher. Gnus is also required; version 5.10 or higher is 33;; 1.0 and higher. Gnus is also required; version 5.10 or higher is
@@ -90,10 +90,7 @@
90;; Provide functions to the rest of MH-E. However, mh-e.el must not 90;; Provide functions to the rest of MH-E. However, mh-e.el must not
91;; use any definitions in files that require mh-e from mh-loaddefs, 91;; use any definitions in files that require mh-e from mh-loaddefs,
92;; for if it does it will introduce a require loop. 92;; for if it does it will introduce a require loop.
93(eval-and-compile 93(require 'mh-loaddefs)
94 ;; Load it during compilation as well, since it defines the macro
95 ;; mh-require-cl.
96 (load "mh-loaddefs" nil 'nomessage))
97 94
98(mh-require-cl) 95(mh-require-cl)
99 96
@@ -130,7 +127,7 @@
130;; Try to keep variables local to a single file. Provide accessors if 127;; Try to keep variables local to a single file. Provide accessors if
131;; variables are shared. Use this section as a last resort. 128;; variables are shared. Use this section as a last resort.
132 129
133(defconst mh-version "8.2" "Version number of MH-E.") 130(defconst mh-version "8.2.91" "Version number of MH-E.")
134 131
135;; Variants 132;; Variants
136 133
@@ -616,7 +613,8 @@ Output is expected to be shown to user, not parsed by MH-E."
616 (mh-exchange-point-and-mark-preserving-active-mark)) 613 (mh-exchange-point-and-mark-preserving-active-mark))
617 614
618;; Shush compiler. 615;; Shush compiler.
619(defvar mark-active) ; XEmacs 616(mh-do-in-xemacs
617 (defvar mark-active))
620 618
621(defun mh-exchange-point-and-mark-preserving-active-mark () 619(defun mh-exchange-point-and-mark-preserving-active-mark ()
622 "Put the mark where point is now, and point where the mark is now. 620 "Put the mark where point is now, and point where the mark is now.
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index aab40c7be13..1d9a79d0deb 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -77,7 +77,7 @@ the MH mail system."
77;;; Desktop Integration 77;;; Desktop Integration
78 78
79;; desktop-buffer-mode-handlers appeared in Emacs 22. 79;; desktop-buffer-mode-handlers appeared in Emacs 22.
80(if (fboundp 'desktop-buffer-mode-handlers) 80(if (boundp 'desktop-buffer-mode-handlers)
81 (add-to-list 'desktop-buffer-mode-handlers 81 (add-to-list 'desktop-buffer-mode-handlers
82 '(mh-folder-mode . mh-restore-desktop-buffer))) 82 '(mh-folder-mode . mh-restore-desktop-buffer)))
83 83
@@ -526,7 +526,8 @@ font-lock is done highlighting.")
526;; Shush compiler. 526;; Shush compiler.
527(defvar desktop-save-buffer) 527(defvar desktop-save-buffer)
528(defvar font-lock-auto-fontify) 528(defvar font-lock-auto-fontify)
529(defvar font-lock-defaults) ; XEmacs 529(mh-do-in-xemacs
530 (defvar font-lock-defaults))
530 531
531;; Ensure new buffers won't get this mode if default major-mode is nil. 532;; Ensure new buffers won't get this mode if default major-mode is nil.
532(put 'mh-folder-mode 'mode-class 'special) 533(put 'mh-folder-mode 'mode-class 'special)
@@ -794,7 +795,7 @@ instead."
794 (setq threading-needed-flag mh-show-threads-flag) 795 (setq threading-needed-flag mh-show-threads-flag)
795 (setq mh-previous-window-config config)) 796 (setq mh-previous-window-config config))
796 ((not (eq (current-buffer) (get-buffer folder))) 797 ((not (eq (current-buffer) (get-buffer folder)))
797 (switch-to-buffer folder) 798 (mh-pop-to-buffer-same-window folder)
798 (setq mh-previous-window-config config)))) 799 (setq mh-previous-window-config config))))
799 (mh-get-new-mail file) 800 (mh-get-new-mail file)
800 (when (and threading-needed-flag 801 (when (and threading-needed-flag
@@ -854,7 +855,7 @@ From a program, edit MESSAGE; nil means edit current message."
854 855
855 ;; Just show the edit buffer... 856 ;; Just show the edit buffer...
856 (delete-other-windows) 857 (delete-other-windows)
857 (switch-to-buffer edit-buffer))) 858 (mh-pop-to-buffer-same-window edit-buffer)))
858 859
859;;;###mh-autoload 860;;;###mh-autoload
860(defun mh-next-button (&optional backward-flag) 861(defun mh-next-button (&optional backward-flag)
@@ -1704,7 +1705,7 @@ DONT-EXEC-PENDING is non-nil."
1704 (unless dont-exec-pending 1705 (unless dont-exec-pending
1705 (mh-process-or-undo-commands folder) 1706 (mh-process-or-undo-commands folder)
1706 (mh-reset-threads-and-narrowing)) 1707 (mh-reset-threads-and-narrowing))
1707 (switch-to-buffer folder))) 1708 (mh-pop-to-buffer-same-window folder)))
1708 (mh-regenerate-headers range) 1709 (mh-regenerate-headers range)
1709 (if (zerop (buffer-size)) 1710 (if (zerop (buffer-size))
1710 (if (equal range "all") 1711 (if (equal range "all")
@@ -1785,7 +1786,7 @@ Also removes all content from the folder buffer."
1785(defun mh-make-folder (name) 1786(defun mh-make-folder (name)
1786 "Create a new mail folder called NAME. 1787 "Create a new mail folder called NAME.
1787Make it the current folder." 1788Make it the current folder."
1788 (switch-to-buffer name) 1789 (mh-pop-to-buffer-same-window name)
1789 (setq buffer-read-only nil) 1790 (setq buffer-read-only nil)
1790 (erase-buffer) 1791 (erase-buffer)
1791 (if mh-adaptive-cmd-note-flag 1792 (if mh-adaptive-cmd-note-flag
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index dfac684ed50..46a04c38845 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -349,7 +349,7 @@ See `mh-store-msg' for a description of DIRECTORY."
349 (error "Error occurred during execution of %s" command))))) 349 (error "Error occurred during execution of %s" command)))))
350 350
351;;;###mh-autoload 351;;;###mh-autoload
352(defun mh-undo-folder (&rest _ignored) 352(defun mh-undo-folder (&rest ignored)
353 "Undo all refiles and deletes in the current folder. 353 "Undo all refiles and deletes in the current folder.
354Arguments are IGNORED (for `revert-buffer')." 354Arguments are IGNORED (for `revert-buffer')."
355 (interactive) 355 (interactive)
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index 2ced886c05e..f269faf3a51 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -185,7 +185,7 @@ semi-obsolete and is only used if `mail-citation-hook' is nil.")
185 "\C-c\C-w" mh-check-whom 185 "\C-c\C-w" mh-check-whom
186 "\C-c\C-y" mh-yank-cur-msg 186 "\C-c\C-y" mh-yank-cur-msg
187 "\C-c\M-d" mh-insert-auto-fields 187 "\C-c\M-d" mh-insert-auto-fields
188 "\M-\t" mh-letter-complete ;; FIXME: completion-at-point 188 "\M-\t" mh-letter-complete
189 "\t" mh-letter-next-header-field-or-indent 189 "\t" mh-letter-next-header-field-or-indent
190 [backtab] mh-letter-previous-header-field) 190 [backtab] mh-letter-previous-header-field)
191 191
@@ -273,7 +273,8 @@ searching for `mh-mail-header-separator' in the buffer."
273;;; MH-Letter Mode 273;;; MH-Letter Mode
274 274
275;; Shush compiler. 275;; Shush compiler.
276(defvar font-lock-defaults) ; XEmacs 276(mh-do-in-xemacs
277 (defvar font-lock-defaults))
277 278
278;; Ensure new buffers won't get this mode if default major-mode is nil. 279;; Ensure new buffers won't get this mode if default major-mode is nil.
279(put 'mh-letter-mode 'mode-class 'special) 280(put 'mh-letter-mode 'mode-class 'special)
@@ -502,10 +503,13 @@ This provides alias and folder completion in header fields according to
502 (or (funcall func) #'ignore) 503 (or (funcall func) #'ignore)
503 mh-letter-complete-function))) 504 mh-letter-complete-function)))
504 505
505(defalias 'mh-letter-complete 506;; TODO Now that completion-at-point performs the task of
506 (if (fboundp 'completion-at-point) #'completion-at-point 507;; mh-letter-complete, perhaps mh-letter-complete along with
507 (lambda () 508;; mh-complete-word should be rewritten as a more general function for
508 "Perform completion on header field or word preceding point. 509;; XEmacs, renamed to mh-completion-at-point, and moved to
510;; mh-compat.el.
511(defun-mh mh-letter-complete completion-at-point ()
512 "Perform completion on header field or word preceding point.
509 513
510If the field contains addresses (for example, \"To:\" or \"Cc:\") 514If the field contains addresses (for example, \"To:\" or \"Cc:\")
511or folders (for example, \"Fcc:\") then this command will provide 515or folders (for example, \"Fcc:\") then this command will provide
@@ -521,7 +525,7 @@ alias completion. In the body of the message, this command runs
521 (end (nth 1 data)) 525 (end (nth 1 data))
522 (table (nth 2 data))) 526 (table (nth 2 data)))
523 (mh-complete-word (buffer-substring-no-properties start end) 527 (mh-complete-word (buffer-substring-no-properties start end)
524 table start end)))))))) 528 table start end))))))
525 529
526(defun mh-letter-complete-or-space (arg) 530(defun mh-letter-complete-or-space (arg)
527 "Perform completion or insert space. 531 "Perform completion or insert space.
@@ -531,8 +535,7 @@ this command to perform completion in the header. Otherwise, a
531space is inserted; use a prefix argument ARG to specify more than 535space is inserted; use a prefix argument ARG to specify more than
532one space." 536one space."
533 (interactive "p") 537 (interactive "p")
534 (let ((func nil) 538 (let ((end-of-prev (save-excursion
535 (end-of-prev (save-excursion
536 (goto-char (mh-beginning-of-word)) 539 (goto-char (mh-beginning-of-word))
537 (mh-beginning-of-word -1)))) 540 (mh-beginning-of-word -1))))
538 (cond ((not mh-compose-space-does-completion-flag) 541 (cond ((not mh-compose-space-does-completion-flag)
@@ -889,7 +892,6 @@ downcasing the field name."
889 892
890;;;###mh-autoload 893;;;###mh-autoload
891(defun mh-complete-word (word choices begin end) 894(defun mh-complete-word (word choices begin end)
892 ;; FIXME: Only needed when completion-at-point doesn't exist.
893 "Complete WORD from CHOICES. 895 "Complete WORD from CHOICES.
894Any match found replaces the text from BEGIN to END." 896Any match found replaces the text from BEGIN to END."
895 (let ((completion (try-completion word choices)) 897 (let ((completion (try-completion word choices))
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 48c6a3793ef..0327b64a33f 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -511,7 +511,7 @@ decoding the same message multiple times."
511 (when mh-decode-mime-flag 511 (when mh-decode-mime-flag
512 (save-excursion 512 (save-excursion
513 (let ((buffer-read-only nil)) 513 (let ((buffer-read-only nil))
514 (rfc2047-decode-region (progn (mh-goto-header-field "subject:") (point)) 514 (rfc2047-decode-region (progn (mh-goto-header-field "Subject:") (point))
515 (progn (mh-header-field-end) (point))))))) 515 (progn (mh-header-field-end) (point)))))))
516 516
517;;;###mh-autoload 517;;;###mh-autoload
@@ -835,7 +835,7 @@ being used to highlight the signature in a MIME part."
835;;; Button Display 835;;; Button Display
836 836
837;; Shush compiler. 837;; Shush compiler.
838(when (featurep 'xemacs) 838(mh-do-in-xemacs
839 (defvar dots) 839 (defvar dots)
840 (defvar type) 840 (defvar type)
841 (defvar ov)) 841 (defvar ov))
@@ -885,7 +885,8 @@ by commands like \"K v\" which operate on individual MIME parts."
885;; Shush compiler. 885;; Shush compiler.
886(defvar mm-verify-function-alist) ; < Emacs 22 886(defvar mm-verify-function-alist) ; < Emacs 22
887(defvar mm-decrypt-function-alist) ; < Emacs 22 887(defvar mm-decrypt-function-alist) ; < Emacs 22
888(defvar pressed-details) ; XEmacs 888(mh-do-in-xemacs
889 (defvar pressed-details))
889 890
890(defun mh-insert-mime-security-button (handle) 891(defun mh-insert-mime-security-button (handle)
891 "Display buttons for PGP message, HANDLE." 892 "Display buttons for PGP message, HANDLE."
@@ -1689,19 +1690,19 @@ buffer, while END defaults to the end of the buffer."
1689 (unless begin (setq begin (point-min))) 1690 (unless begin (setq begin (point-min)))
1690 (unless end (setq end (point-max))) 1691 (unless end (setq end (point-max)))
1691 (save-excursion 1692 (save-excursion
1692 (block 'search-for-mh-directive 1693 (block search-for-mh-directive
1693 (goto-char begin) 1694 (goto-char begin)
1694 (while (re-search-forward "^#" end t) 1695 (while (re-search-forward "^#" end t)
1695 (let ((s (buffer-substring-no-properties 1696 (let ((s (buffer-substring-no-properties
1696 (point) (mh-line-end-position)))) 1697 (point) (mh-line-end-position))))
1697 (cond ((equal s "")) 1698 (cond ((equal s ""))
1698 ((string-match "^forw[ \t\n]+" s) 1699 ((string-match "^forw[ \t\n]+" s)
1699 (return-from 'search-for-mh-directive t)) 1700 (return-from search-for-mh-directive t))
1700 (t (let ((first-token (car (split-string s "[ \t;@]")))) 1701 (t (let ((first-token (car (split-string s "[ \t;@]"))))
1701 (when (and first-token 1702 (when (and first-token
1702 (string-match mh-media-type-regexp 1703 (string-match mh-media-type-regexp
1703 first-token)) 1704 first-token))
1704 (return-from 'search-for-mh-directive t))))))) 1705 (return-from search-for-mh-directive t)))))))
1705 nil))) 1706 nil)))
1706 1707
1707(defun mh-minibuffer-read-type (filename &optional default) 1708(defun mh-minibuffer-read-type (filename &optional default)
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
index a90a26ab2a4..a547dd8d80a 100644
--- a/lisp/mh-e/mh-search.el
+++ b/lisp/mh-e/mh-search.el
@@ -321,7 +321,8 @@ folder containing the index search results."
321 count (> (hash-table-count msg-hash) 0))))))) 321 count (> (hash-table-count msg-hash) 0)))))))
322 322
323;; Shush compiler. 323;; Shush compiler.
324(defvar pick-folder) ; XEmacs 324(mh-do-in-xemacs
325 (defvar pick-folder))
325 326
326(defun mh-search-folder (folder window-config) 327(defun mh-search-folder (folder window-config)
327 "Search FOLDER for messages matching a pattern. 328 "Search FOLDER for messages matching a pattern.
@@ -401,8 +402,9 @@ or nothing to search all folders."
401 (mh-index-sequenced-messages folders mh-tick-seq)) 402 (mh-index-sequenced-messages folders mh-tick-seq))
402 403
403;; Shush compiler. 404;; Shush compiler.
404(defvar mh-mairix-folder) ; XEmacs 405(mh-do-in-xemacs
405(defvar mh-flists-search-folders) ; XEmacs 406 (defvar mh-mairix-folder)
407 (defvar mh-flists-search-folders))
406 408
407;;;###mh-autoload 409;;;###mh-autoload
408(defun mh-index-sequenced-messages (folders sequence) 410(defun mh-index-sequenced-messages (folders sequence)
@@ -452,12 +454,12 @@ search all folders."
452 454
453(defvar mh-flists-search-folders) 455(defvar mh-flists-search-folders)
454 456
455(defun mh-flists-execute (&rest args) 457(defun mh-flists-execute (&rest ignored)
456 "Execute flists. 458 "Execute flists.
457Search for messages belonging to `mh-flists-sequence' in the 459Search for messages belonging to `mh-flists-sequence' in the
458folders specified by `mh-flists-search-folders'. If 460folders specified by `mh-flists-search-folders'. If
459`mh-recursive-folders-flag' is t, then the folders are searched 461`mh-recursive-folders-flag' is t, then the folders are searched
460recursively. All parameters ARGS are ignored." 462recursively. All arguments are IGNORED."
461 (set-buffer (get-buffer-create mh-temp-index-buffer)) 463 (set-buffer (get-buffer-create mh-temp-index-buffer))
462 (erase-buffer) 464 (erase-buffer)
463 (unless (executable-find "sh") 465 (unless (executable-find "sh")
@@ -1442,7 +1444,8 @@ being the list of messages originally from that folder."
1442 mh-index-data) 1444 mh-index-data)
1443 1445
1444;; Shush compiler 1446;; Shush compiler
1445(defvar mh-speed-flists-inhibit-flag) ; XEmacs 1447(mh-do-in-xemacs
1448 (defvar mh-speed-flists-inhibit-flag))
1446 1449
1447;;;###mh-autoload 1450;;;###mh-autoload
1448(defun mh-index-execute-commands () 1451(defun mh-index-execute-commands ()
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index 145b689c6b9..fc3e5c08143 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -198,7 +198,8 @@ MESSAGE appears."
198 " ")))) 198 " "))))
199 199
200;; Shush compiler. 200;; Shush compiler.
201(defvar tool-bar-mode) ; XEmacs 201(mh-do-in-xemacs
202 (defvar tool-bar-mode))
202(defvar tool-bar-map) 203(defvar tool-bar-map)
203 204
204;;;###mh-autoload 205;;;###mh-autoload
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index 5c2f08cefe5..7b5593ba608 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -146,9 +146,7 @@ displayed."
146 (if (not clean-message-header) 146 (if (not clean-message-header)
147 (mh-start-of-uncleaned-message))) 147 (mh-start-of-uncleaned-message)))
148 (mh-display-msg msg folder))) 148 (mh-display-msg msg folder)))
149 (unless (if (fboundp 'window-full-height-p) 149 (unless (mh-window-full-height-p) ; not vertically split
150 (window-full-height-p)
151 (= (1+ (window-height)) (frame-height))) ; not vertically split
152 (shrink-window (- (window-height) (or mh-summary-height 150 (shrink-window (- (window-height) (or mh-summary-height
153 (mh-summary-height))))) 151 (mh-summary-height)))))
154 (mh-recenter nil) 152 (mh-recenter nil)
diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el
index b782081c85c..5c3679e8ce6 100644
--- a/lisp/mh-e/mh-speed.el
+++ b/lisp/mh-e/mh-speed.el
@@ -126,9 +126,9 @@ With non-nil FORCE, the update is always carried out."
126 ;; Otherwise on to your regular programming 126 ;; Otherwise on to your regular programming
127 (t t))) 127 (t t)))
128 128
129(defun mh-speed-toggle (&rest args) 129(defun mh-speed-toggle (&rest ignored)
130 "Toggle the display of child folders in the speedbar. 130 "Toggle the display of child folders in the speedbar.
131The optional ARGS from speedbar are ignored." 131The optional arguments from speedbar are IGNORED."
132 (interactive) 132 (interactive)
133 (declare (ignore args)) 133 (declare (ignore args))
134 (beginning-of-line) 134 (beginning-of-line)
@@ -165,9 +165,9 @@ The optional ARGS from speedbar are ignored."
165 (mh-line-beginning-position) (1+ (line-beginning-position)) 165 (mh-line-beginning-position) (1+ (line-beginning-position))
166 `(mh-expanded t))))))) 166 `(mh-expanded t)))))))
167 167
168(defun mh-speed-view (&rest args) 168(defun mh-speed-view (&rest ignored)
169 "Visits the selected folder just as if you had used \\<mh-folder-mode-map>\\[mh-visit-folder]. 169 "Visits the selected folder just as if you had used \\<mh-folder-mode-map>\\[mh-visit-folder].
170The optional ARGS from speedbar are ignored." 170The optional arguments from speedbar are IGNORED."
171 (interactive) 171 (interactive)
172 (declare (ignore args)) 172 (declare (ignore args))
173 (let* ((folder (get-text-property (mh-line-beginning-position) 'mh-folder)) 173 (let* ((folder (get-text-property (mh-line-beginning-position) 'mh-folder))
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index 4394e1b1b22..6132af17dab 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -596,7 +596,6 @@ Expects FOLDER to have already been normalized with
596 (setq name (substring name 0 (1- (length name))))) 596 (setq name (substring name 0 (1- (length name)))))
597 (push 597 (push
598 (cons name 598 (cons name
599 ;; FIXME: what is this used for? --Stef
600 (search-forward "(others)" (mh-line-end-position) t)) 599 (search-forward "(others)" (mh-line-end-position) t))
601 results)))) 600 results))))
602 (forward-line 1)))) 601 (forward-line 1))))
@@ -732,8 +731,9 @@ See Info node `(elisp) Programmed Completion' for details."
732 (t (file-directory-p path)))))))) 731 (t (file-directory-p path))))))))
733 732
734;; Shush compiler. 733;; Shush compiler.
735(defvar completion-root-regexp) ; XEmacs 734(mh-do-in-xemacs
736(defvar minibuffer-completing-file-name) ; XEmacs 735 (defvar completion-root-regexp)
736 (defvar minibuffer-completing-file-name))
737 737
738(defun mh-folder-completing-read (prompt default allow-root-folder-flag) 738(defun mh-folder-completing-read (prompt default allow-root-folder-flag)
739 "Read folder name with PROMPT and default result DEFAULT. 739 "Read folder name with PROMPT and default result DEFAULT.
diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el
index 027d79a948a..179b552d536 100644
--- a/lisp/mh-e/mh-xface.el
+++ b/lisp/mh-e/mh-xface.el
@@ -125,7 +125,8 @@ in this order is used."
125(defun mh-face-to-png (data) 125(defun mh-face-to-png (data)
126 "Convert base64 encoded DATA to png image." 126 "Convert base64 encoded DATA to png image."
127 (with-temp-buffer 127 (with-temp-buffer
128 (set-buffer-multibyte nil) 128 (if (fboundp 'set-buffer-multibyte)
129 (set-buffer-multibyte nil))
129 (insert data) 130 (insert data)
130 (ignore-errors (base64-decode-region (point-min) (point-max))) 131 (ignore-errors (base64-decode-region (point-min) (point-max)))
131 (buffer-string))) 132 (buffer-string)))
@@ -133,7 +134,8 @@ in this order is used."
133(defun mh-uncompface (data) 134(defun mh-uncompface (data)
134 "Run DATA through `uncompface' to generate bitmap." 135 "Run DATA through `uncompface' to generate bitmap."
135 (with-temp-buffer 136 (with-temp-buffer
136 (set-buffer-multibyte nil) 137 (if (fboundp 'set-buffer-multibyte)
138 (set-buffer-multibyte nil))
137 (insert data) 139 (insert data)
138 (when (and mh-uncompface-executable 140 (when (and mh-uncompface-executable
139 (equal (call-process-region (point-min) (point-max) 141 (equal (call-process-region (point-min) (point-max)
@@ -205,7 +207,7 @@ The directories are searched for in the order they appear in the list.")
205 (cond (cached-value (return-from mh-picon-get-image cached-value)) 207 (cond (cached-value (return-from mh-picon-get-image cached-value))
206 ((not host-list) (return-from mh-picon-get-image nil))) 208 ((not host-list) (return-from mh-picon-get-image nil)))
207 (setq match 209 (setq match
208 (block 'loop 210 (block loop
209 ;; u@h search 211 ;; u@h search
210 (loop for dir in mh-picon-existing-directory-list 212 (loop for dir in mh-picon-existing-directory-list
211 do (loop for type in mh-picon-image-types 213 do (loop for type in mh-picon-image-types
@@ -213,15 +215,15 @@ The directories are searched for in the order they appear in the list.")
213 for file1 = (format "%s/%s.%s" 215 for file1 = (format "%s/%s.%s"
214 dir canonical-address type) 216 dir canonical-address type)
215 when (file-exists-p file1) 217 when (file-exists-p file1)
216 do (return-from 'loop file1) 218 do (return-from loop file1)
217 ;; [path]user 219 ;; [path]user
218 for file2 = (format "%s/%s.%s" dir user type) 220 for file2 = (format "%s/%s.%s" dir user type)
219 when (file-exists-p file2) 221 when (file-exists-p file2)
220 do (return-from 'loop file2) 222 do (return-from loop file2)
221 ;; [path]host 223 ;; [path]host
222 for file3 = (format "%s/%s.%s" dir host type) 224 for file3 = (format "%s/%s.%s" dir host type)
223 when (file-exists-p file3) 225 when (file-exists-p file3)
224 do (return-from 'loop file3))) 226 do (return-from loop file3)))
225 ;; facedb search 227 ;; facedb search
226 ;; Search order for user@foo.net: 228 ;; Search order for user@foo.net:
227 ;; [path]net/foo/user 229 ;; [path]net/foo/user
@@ -239,11 +241,11 @@ The directories are searched for in the order they appear in the list.")
239 do (loop for type in mh-picon-image-types 241 do (loop for type in mh-picon-image-types
240 for z1 = (format "%s.%s" y type) 242 for z1 = (format "%s.%s" y type)
241 when (file-exists-p z1) 243 when (file-exists-p z1)
242 do (return-from 'loop z1) 244 do (return-from loop z1)
243 for z2 = (format "%s/face.%s" 245 for z2 = (format "%s/face.%s"
244 y type) 246 y type)
245 when (file-exists-p z2) 247 when (file-exists-p z2)
246 do (return-from 'loop z2))))))) 248 do (return-from loop z2)))))))
247 (setf (gethash canonical-address mh-picon-cache) 249 (setf (gethash canonical-address mh-picon-cache)
248 (mh-picon-file-contents match))))) 250 (mh-picon-file-contents match)))))
249 251
@@ -271,7 +273,8 @@ file contents as a string is returned. If FILE is nil, then both
271elements of the list are nil." 273elements of the list are nil."
272 (if (stringp file) 274 (if (stringp file)
273 (with-temp-buffer 275 (with-temp-buffer
274 (set-buffer-multibyte nil) 276 (if (fboundp 'set-buffer-multibyte)
277 (set-buffer-multibyte nil))
275 (let ((type (and (string-match ".*\\.\\(...\\)$" file) 278 (let ((type (and (string-match ".*\\.\\(...\\)$" file)
276 (intern (match-string 1 file))))) 279 (intern (match-string 1 file)))))
277 (insert-file-contents-literally file) 280 (insert-file-contents-literally file)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 32ddfe99707..d62b377954d 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1442,7 +1442,9 @@ we entered `completion-in-region-mode'.")
1442(defun completion-in-region (start end collection &optional predicate) 1442(defun completion-in-region (start end collection &optional predicate)
1443 "Complete the text between START and END using COLLECTION. 1443 "Complete the text between START and END using COLLECTION.
1444Return nil if there is no valid completion, else t. 1444Return nil if there is no valid completion, else t.
1445Point needs to be somewhere between START and END." 1445Point needs to be somewhere between START and END.
1446PREDICATE (a function called with no arguments) says when to
1447exit."
1446 (assert (<= start (point)) (<= (point) end)) 1448 (assert (<= start (point)) (<= (point) end))
1447 (with-wrapper-hook 1449 (with-wrapper-hook
1448 ;; FIXME: Maybe we should use this hook to provide a "display 1450 ;; FIXME: Maybe we should use this hook to provide a "display
@@ -1634,30 +1636,43 @@ The completion method is determined by `completion-at-point-functions'."
1634 1636
1635;;; Key bindings. 1637;;; Key bindings.
1636 1638
1637(define-obsolete-variable-alias 'minibuffer-local-must-match-filename-map
1638 'minibuffer-local-filename-must-match-map "23.1")
1639
1640(let ((map minibuffer-local-map)) 1639(let ((map minibuffer-local-map))
1641 (define-key map "\C-g" 'abort-recursive-edit) 1640 (define-key map "\C-g" 'abort-recursive-edit)
1642 (define-key map "\r" 'exit-minibuffer) 1641 (define-key map "\r" 'exit-minibuffer)
1643 (define-key map "\n" 'exit-minibuffer)) 1642 (define-key map "\n" 'exit-minibuffer))
1644 1643
1645(let ((map minibuffer-local-completion-map)) 1644(defvar minibuffer-local-completion-map
1646 (define-key map "\t" 'minibuffer-complete) 1645 (let ((map (make-sparse-keymap)))
1647 ;; M-TAB is already abused for many other purposes, so we should find 1646 (set-keymap-parent map minibuffer-local-map)
1648 ;; another binding for it. 1647 (define-key map "\t" 'minibuffer-complete)
1649 ;; (define-key map "\e\t" 'minibuffer-force-complete) 1648 ;; M-TAB is already abused for many other purposes, so we should find
1650 (define-key map " " 'minibuffer-complete-word) 1649 ;; another binding for it.
1651 (define-key map "?" 'minibuffer-completion-help)) 1650 ;; (define-key map "\e\t" 'minibuffer-force-complete)
1651 (define-key map " " 'minibuffer-complete-word)
1652 (define-key map "?" 'minibuffer-completion-help)
1653 map)
1654 "Local keymap for minibuffer input with completion.")
1655
1656(defvar minibuffer-local-must-match-map
1657 (let ((map (make-sparse-keymap)))
1658 (set-keymap-parent map minibuffer-local-completion-map)
1659 (define-key map "\r" 'minibuffer-complete-and-exit)
1660 (define-key map "\n" 'minibuffer-complete-and-exit)
1661 map)
1662 "Local keymap for minibuffer input with completion, for exact match.")
1652 1663
1653(let ((map minibuffer-local-must-match-map)) 1664(defvar minibuffer-local-filename-completion-map
1654 (define-key map "\r" 'minibuffer-complete-and-exit) 1665 (let ((map (make-sparse-keymap)))
1655 (define-key map "\n" 'minibuffer-complete-and-exit)) 1666 (define-key map " " nil)
1667 map)
1668 "Local keymap for minibuffer input with completion for filenames.
1669Gets combined either with `minibuffer-local-completion-map' or
1670with `minibuffer-local-must-match-map'.")
1656 1671
1657(let ((map minibuffer-local-filename-completion-map)) 1672(defvar minibuffer-local-filename-must-match-map (make-sparse-keymap))
1658 (define-key map " " nil)) 1673(make-obsolete-variable 'minibuffer-local-filename-must-match-map nil "24.1")
1659(let ((map minibuffer-local-filename-must-match-map)) 1674(define-obsolete-variable-alias 'minibuffer-local-must-match-filename-map
1660 (define-key map " " nil)) 1675 'minibuffer-local-filename-must-match-map "23.1")
1661 1676
1662(let ((map minibuffer-local-ns-map)) 1677(let ((map minibuffer-local-ns-map))
1663 (define-key map " " 'exit-minibuffer) 1678 (define-key map " " 'exit-minibuffer)
@@ -2732,13 +2747,22 @@ See `completing-read' for the meaning of the arguments."
2732 (minibuffer-completion-predicate predicate) 2747 (minibuffer-completion-predicate predicate)
2733 (minibuffer-completion-confirm (unless (eq require-match t) 2748 (minibuffer-completion-confirm (unless (eq require-match t)
2734 require-match)) 2749 require-match))
2735 (keymap (if require-match 2750 (base-keymap (if require-match
2736 (if (memq minibuffer-completing-file-name '(nil lambda))
2737 minibuffer-local-must-match-map 2751 minibuffer-local-must-match-map
2738 minibuffer-local-filename-must-match-map) 2752 minibuffer-local-completion-map))
2739 (if (memq minibuffer-completing-file-name '(nil lambda)) 2753 (keymap (if (memq minibuffer-completing-file-name '(nil lambda))
2740 minibuffer-local-completion-map 2754 base-keymap
2741 minibuffer-local-filename-completion-map))) 2755 ;; Layer minibuffer-local-filename-completion-map
2756 ;; on top of the base map.
2757 ;; Use make-composed-keymap so that set-keymap-parent
2758 ;; doesn't modify minibuffer-local-filename-completion-map.
2759 (let ((map (make-composed-keymap
2760 minibuffer-local-filename-completion-map)))
2761 ;; Set base-keymap as the parent, so that nil bindings
2762 ;; in minibuffer-local-filename-completion-map can
2763 ;; override bindings in base-keymap.
2764 (set-keymap-parent map base-keymap)
2765 map)))
2742 (result (read-from-minibuffer prompt initial-input keymap 2766 (result (read-from-minibuffer prompt initial-input keymap
2743 nil hist def inherit-input-method))) 2767 nil hist def inherit-input-method)))
2744 (when (and (equal result "") def) 2768 (when (and (equal result "") def)
diff --git a/lisp/mouse-sel.el b/lisp/mouse-sel.el
index 1f601377ad4..50d221b6fa0 100644
--- a/lisp/mouse-sel.el
+++ b/lisp/mouse-sel.el
@@ -202,14 +202,10 @@ If nil, point will always be placed at the beginning of the region."
202With prefix ARG, turn Mouse Sel mode on if and only if ARG is positive. 202With prefix ARG, turn Mouse Sel mode on if and only if ARG is positive.
203Returns the new status of Mouse Sel mode (non-nil means on). 203Returns the new status of Mouse Sel mode (non-nil means on).
204 204
205When Mouse Sel mode is enabled, mouse selection is enhanced in various ways: 205When Mouse Sel mode is enabled, mouse selection is enhanced in
206various ways:
206 207
207- Clicking mouse-1 starts (cancels) selection, dragging extends it. 208- Double-clicking on symbol constituents selects symbols.
208
209- Clicking or dragging mouse-3 extends the selection as well.
210
211- Double-clicking on word constituents selects words.
212Double-clicking on symbol constituents selects symbols.
213Double-clicking on quotes or parentheses selects sexps. 209Double-clicking on quotes or parentheses selects sexps.
214Double-clicking on whitespace selects whitespace. 210Double-clicking on whitespace selects whitespace.
215Triple-clicking selects lines. 211Triple-clicking selects lines.
@@ -224,14 +220,8 @@ mouse-sel sets the variables `interprogram-cut-function' and
224- Clicking mouse-2 inserts the contents of the primary selection at 220- Clicking mouse-2 inserts the contents of the primary selection at
225the mouse position (or point, if `mouse-yank-at-point' is non-nil). 221the mouse position (or point, if `mouse-yank-at-point' is non-nil).
226 222
227- Pressing mouse-2 while selecting or extending copies selection 223- mouse-2 while selecting or extending copies selection to the
228to the kill ring. Pressing mouse-1 or mouse-3 kills it. 224kill ring; mouse-1 or mouse-3 kills it."
229
230- Double-clicking mouse-3 also kills selection.
231
232- M-mouse-1, M-mouse-2 & M-mouse-3 work similarly to mouse-1, mouse-2
233& mouse-3, but operate on the X secondary selection rather than the
234primary selection and region."
235 :global t 225 :global t
236 :group 'mouse-sel 226 :group 'mouse-sel
237 (if mouse-sel-mode 227 (if mouse-sel-mode
@@ -286,8 +276,17 @@ primary selection and region."
286 (setq mouse-secondary-overlay (make-overlay 1 1)) 276 (setq mouse-secondary-overlay (make-overlay 1 1))
287 (overlay-put mouse-secondary-overlay 'face 'secondary-selection)) 277 (overlay-put mouse-secondary-overlay 'face 'secondary-selection))
288 278
279(defconst mouse-sel-primary-overlay
280 (let ((ol (make-overlay (point-min) (point-min))))
281 (delete-overlay ol)
282 (overlay-put ol 'face 'region)
283 ol)
284 "An overlay which records the current primary selection.
285This is used by Mouse Sel mode only.")
286
289(defconst mouse-sel-selection-alist 287(defconst mouse-sel-selection-alist
290 '((SECONDARY mouse-secondary-overlay mouse-sel-secondary-thing)) 288 '((PRIMARY mouse-sel-primary-overlay mouse-sel-primary-thing)
289 (SECONDARY mouse-secondary-overlay mouse-sel-secondary-thing))
291 "Alist associating selections with variables. 290 "Alist associating selections with variables.
292Each element is of the form: 291Each element is of the form:
293 292
diff --git a/lisp/mouse.el b/lisp/mouse.el
index f35069763bd..63395619f44 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -687,7 +687,9 @@ This should be bound to a mouse click event type."
687 687
688(defun mouse-set-region (click) 688(defun mouse-set-region (click)
689 "Set the region to the text dragged over, and copy to kill ring. 689 "Set the region to the text dragged over, and copy to kill ring.
690This should be bound to a mouse drag event." 690This should be bound to a mouse drag event.
691See the `mouse-drag-copy-region' variable to control whether this
692command alters the kill ring or not."
691 (interactive "e") 693 (interactive "e")
692 (mouse-minibuffer-check click) 694 (mouse-minibuffer-check click)
693 (select-window (posn-window (event-start click))) 695 (select-window (posn-window (event-start click)))
@@ -2092,17 +2094,19 @@ choose a font."
2092(global-set-key [double-mouse-1] 'mouse-set-point) 2094(global-set-key [double-mouse-1] 'mouse-set-point)
2093(global-set-key [triple-mouse-1] 'mouse-set-point) 2095(global-set-key [triple-mouse-1] 'mouse-set-point)
2094 2096
2095;; Clicking on the fringes causes hscrolling: 2097(defun mouse--strip-first-event (_prompt)
2096(global-set-key [left-fringe mouse-1] 'mouse-set-point) 2098 (substring (this-single-command-raw-keys) 1))
2097(global-set-key [right-fringe mouse-1] 'mouse-set-point) 2099
2100(define-key function-key-map [left-fringe mouse-1] 'mouse--strip-first-event)
2101(define-key function-key-map [right-fringe mouse-1] 'mouse--strip-first-event)
2098 2102
2099(global-set-key [mouse-2] 'mouse-yank-primary) 2103(global-set-key [mouse-2] 'mouse-yank-primary)
2100;; Allow yanking also when the corresponding cursor is "in the fringe". 2104;; Allow yanking also when the corresponding cursor is "in the fringe".
2101(global-set-key [right-fringe mouse-2] 'mouse-yank-at-click) 2105(define-key function-key-map [right-fringe mouse-2] 'mouse--strip-first-event)
2102(global-set-key [left-fringe mouse-2] 'mouse-yank-at-click) 2106(define-key function-key-map [left-fringe mouse-2] 'mouse--strip-first-event)
2103(global-set-key [mouse-3] 'mouse-save-then-kill) 2107(global-set-key [mouse-3] 'mouse-save-then-kill)
2104(global-set-key [right-fringe mouse-3] 'mouse-save-then-kill) 2108(define-key function-key-map [right-fringe mouse-3] 'mouse--strip-first-event)
2105(global-set-key [left-fringe mouse-3] 'mouse-save-then-kill) 2109(define-key function-key-map [left-fringe mouse-3] 'mouse--strip-first-event)
2106 2110
2107;; By binding these to down-going events, we let the user use the up-going 2111;; By binding these to down-going events, we let the user use the up-going
2108;; event to make the selection, saving a click. 2112;; event to make the selection, saving a click.
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index ac12030471e..e18b42a275f 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -214,13 +214,7 @@
214 214
215;;;###autoload 215;;;###autoload
216(defcustom browse-url-browser-function 216(defcustom browse-url-browser-function
217 (cond 217 'browse-url-default-browser
218 ((memq system-type '(windows-nt ms-dos cygwin))
219 'browse-url-default-windows-browser)
220 ((memq system-type '(darwin))
221 'browse-url-default-macosx-browser)
222 (t
223 'browse-url-default-browser))
224 "Function to display the current buffer in a WWW browser. 218 "Function to display the current buffer in a WWW browser.
225This is used by the `browse-url-at-point', `browse-url-at-mouse', and 219This is used by the `browse-url-at-point', `browse-url-at-mouse', and
226`browse-url-of-file' commands. 220`browse-url-of-file' commands.
@@ -908,12 +902,13 @@ a random existing one. A non-nil interactive prefix argument reverses
908the effect of `browse-url-new-window-flag'. 902the effect of `browse-url-new-window-flag'.
909 903
910When called non-interactively, optional second argument NEW-WINDOW is 904When called non-interactively, optional second argument NEW-WINDOW is
911used instead of `browse-url-new-window-flag'. 905used instead of `browse-url-new-window-flag'."
912
913The order attempted is gnome-moz-remote, Mozilla, Firefox,
914Galeon, Konqueror, Netscape, Mosaic, Lynx in an xterm, and then W3."
915 (apply 906 (apply
916 (cond 907 (cond
908 ((memq system-type '(windows-nt ms-dos cygwin))
909 'browse-url-default-windows-browser)
910 ((memq system-type '(darwin))
911 'browse-url-default-macosx-browser)
917 ((browse-url-can-use-xdg-open) 'browse-url-xdg-open) 912 ((browse-url-can-use-xdg-open) 'browse-url-xdg-open)
918 ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz) 913 ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
919 ((executable-find browse-url-mozilla-program) 'browse-url-mozilla) 914 ((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el
index a8989398e15..bb09d8945c9 100644
--- a/lisp/net/network-stream.el
+++ b/lisp/net/network-stream.el
@@ -98,6 +98,10 @@ values:
98 98
99:end-of-command specifies a regexp matching the end of a command. 99:end-of-command specifies a regexp matching the end of a command.
100 100
101:end-of-capability specifies a regexp matching the end of the
102 response to the command specified for :capability-command.
103 It defaults to the regexp specified for :end-of-command.
104
101:success specifies a regexp matching a message indicating a 105:success specifies a regexp matching a message indicating a
102 successful STARTTLS negotiation. For instance, the default 106 successful STARTTLS negotiation. For instance, the default
103 should be \"^3\" for an NNTP connection. 107 should be \"^3\" for an NNTP connection.
@@ -203,11 +207,14 @@ functionality.
203 (success-string (plist-get parameters :success)) 207 (success-string (plist-get parameters :success))
204 (capability-command (plist-get parameters :capability-command)) 208 (capability-command (plist-get parameters :capability-command))
205 (eoc (plist-get parameters :end-of-command)) 209 (eoc (plist-get parameters :end-of-command))
210 (eo-capa (or (plist-get parameters :end-of-capability)
211 eoc))
206 ;; Return (STREAM GREETING CAPABILITIES RESULTING-TYPE) 212 ;; Return (STREAM GREETING CAPABILITIES RESULTING-TYPE)
207 (stream (make-network-process :name name :buffer buffer 213 (stream (make-network-process :name name :buffer buffer
208 :host host :service service)) 214 :host host :service service))
209 (greeting (network-stream-get-response stream start eoc)) 215 (greeting (network-stream-get-response stream start eoc))
210 (capabilities (network-stream-command stream capability-command eoc)) 216 (capabilities (network-stream-command stream capability-command
217 eo-capa))
211 (resulting-type 'plain) 218 (resulting-type 'plain)
212 (builtin-starttls (and (fboundp 'gnutls-available-p) 219 (builtin-starttls (and (fboundp 'gnutls-available-p)
213 (gnutls-available-p))) 220 (gnutls-available-p)))
@@ -250,14 +257,22 @@ functionality.
250 ;; Requery capabilities for protocols that require it; i.e., 257 ;; Requery capabilities for protocols that require it; i.e.,
251 ;; EHLO for SMTP. 258 ;; EHLO for SMTP.
252 (when (plist-get parameters :always-query-capabilities) 259 (when (plist-get parameters :always-query-capabilities)
253 (network-stream-command stream capability-command eoc))) 260 (network-stream-command stream capability-command eo-capa)))
254 (when (string-match success-string 261 (when (string-match success-string
255 (network-stream-command stream starttls-command eoc)) 262 (network-stream-command stream starttls-command eoc))
256 ;; The server said it was OK to begin STARTTLS negotiations. 263 ;; The server said it was OK to begin STARTTLS negotiations.
257 (if builtin-starttls 264 (if builtin-starttls
258 (let ((cert (network-stream-certificate host service parameters))) 265 (let ((cert (network-stream-certificate host service parameters)))
259 (gnutls-negotiate :process stream :hostname host 266 (condition-case nil
260 :keylist (and cert (list cert)))) 267 (gnutls-negotiate :process stream :hostname host
268 :keylist (and cert (list cert)))
269 ;; If we get a gnutls-specific error (for instance if
270 ;; the certificate the server gives us is completely
271 ;; syntactically invalid), then close the connection
272 ;; and possibly (further down) try to create a
273 ;; non-encrypted connection.
274 (gnutls-error
275 (delete-process stream))))
261 (unless (starttls-negotiate stream) 276 (unless (starttls-negotiate stream)
262 (delete-process stream))) 277 (delete-process stream)))
263 (if (memq (process-status stream) '(open run)) 278 (if (memq (process-status stream) '(open run))
@@ -271,21 +286,17 @@ functionality.
271 (network-stream-get-response stream start eoc))) 286 (network-stream-get-response stream start eoc)))
272 ;; Re-get the capabilities, which may have now changed. 287 ;; Re-get the capabilities, which may have now changed.
273 (setq capabilities 288 (setq capabilities
274 (network-stream-command stream capability-command eoc)))) 289 (network-stream-command stream capability-command eo-capa))))
275 290
276 ;; If TLS is mandatory, close the connection if it's unencrypted. 291 ;; If TLS is mandatory, close the connection if it's unencrypted.
277 (when (and (or require-tls 292 (when (and require-tls
278 ;; The server said it was possible to do STARTTLS,
279 ;; and we wanted to use it...
280 (and starttls-command
281 (plist-get parameters :use-starttls-if-possible)))
282 ;; ... but Emacs wasn't able to -- either no built-in 293 ;; ... but Emacs wasn't able to -- either no built-in
283 ;; support, or no gnutls-cli installed. 294 ;; support, or no gnutls-cli installed.
284 (eq resulting-type 'plain)) 295 (eq resulting-type 'plain))
285 (setq error 296 (setq error
286 (if require-tls 297 (if require-tls
287 "Server does not support TLS" 298 "Server does not support TLS"
288 "Server supports STARTTLS, but Emacs does not have support for it")) 299 "Server supports STARTTLS, but Emacs does not have support for it"))
289 (delete-process stream) 300 (delete-process stream)
290 (setq stream nil)) 301 (setq stream nil))
291 ;; Return value: 302 ;; Return value:
@@ -353,7 +364,9 @@ functionality.
353 ?p service)))))) 364 ?p service))))))
354 (list stream 365 (list stream
355 (network-stream-get-response stream start eoc) 366 (network-stream-get-response stream start eoc)
356 (network-stream-command stream capability-command eoc) 367 (network-stream-command stream capability-command
368 (or (plist-get parameters :end-of-capability)
369 eoc))
357 'plain))) 370 'plain)))
358 371
359(provide 'network-stream) 372(provide 'network-stream)
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el
index b7b0b61f4e1..42c698876cd 100644
--- a/lisp/net/soap-client.el
+++ b/lisp/net/soap-client.el
@@ -729,9 +729,7 @@ traverse an element tree."
729 (incf nprocessed) 729 (incf nprocessed)
730 (soap-resolve-references-for-element e wsdl) 730 (soap-resolve-references-for-element e wsdl)
731 (setf (soap-element-namespace-tag e) nstag)))))) 731 (setf (soap-element-namespace-tag e) nstag))))))
732 (soap-namespace-elements ns)))) 732 (soap-namespace-elements ns)))))
733
734 (message "Processed %d" nprocessed))
735 wsdl) 733 wsdl)
736 734
737;;;;; Loading WSDL from XML documents 735;;;;; Loading WSDL from XML documents
@@ -1714,10 +1712,6 @@ operations in a WSDL document."
1714 ;; error) 1712 ;; error)
1715 (warn "Error in SOAP response: HTTP code %s" 1713 (warn "Error in SOAP response: HTTP code %s"
1716 url-http-response-status)) 1714 url-http-response-status))
1717 (when (> (buffer-size) 1000000)
1718 (soap-warning
1719 "Received large message: %s bytes"
1720 (buffer-size)))
1721 (let ((mime-part (mm-dissect-buffer t t))) 1715 (let ((mime-part (mm-dissect-buffer t t)))
1722 (unless mime-part 1716 (unless mime-part
1723 (error "Failed to decode response from server")) 1717 (error "Failed to decode response from server"))
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 764ee35d45b..fcf523a7068 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -100,6 +100,15 @@ When called interactively, a Tramp connection has to be selected."
100 (when (bufferp buf) (kill-buffer buf))))) 100 (when (bufferp buf) (kill-buffer buf)))))
101 101
102;;;###tramp-autoload 102;;;###tramp-autoload
103(defun tramp-cleanup-this-connection ()
104 "Flush all connection related objects of the current buffer's connection."
105 (interactive)
106 (and (stringp default-directory)
107 (file-remote-p default-directory)
108 (tramp-cleanup-connection
109 (tramp-dissect-file-name default-directory 'noexpand))))
110
111;;;###tramp-autoload
103(defun tramp-cleanup-all-connections () 112(defun tramp-cleanup-all-connections ()
104 "Flush all Tramp internal objects. 113 "Flush all Tramp internal objects.
105This includes password cache, file cache, connection cache, buffers." 114This includes password cache, file cache, connection cache, buffers."
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 3c0642c3c78..460c9f0e118 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -23,9 +23,9 @@
23 23
24;;; Commentary: 24;;; Commentary:
25 25
26;; Tramp's main Emacs version for development is GNU Emacs 24. This 26;; Tramp's main Emacs version for development is Emacs 24. This
27;; package provides compatibility functions for GNU Emacs 22, GNU 27;; package provides compatibility functions for Emacs 22, Emacs 23,
28;; Emacs 23 and XEmacs 21.4+. 28;; XEmacs 21.4+ and SXEmacs 22.
29 29
30;;; Code: 30;;; Code:
31 31
@@ -286,9 +286,8 @@ Not actually used. Use `(format \"%o\" i)' instead?"
286 (tramp-compat-funcall 'file-attributes filename id-format) 286 (tramp-compat-funcall 'file-attributes filename id-format)
287 (wrong-number-of-arguments (file-attributes filename)))))) 287 (wrong-number-of-arguments (file-attributes filename))))))
288 288
289;; PRESERVE-UID-GID has been introduced with Emacs 23. It does not 289;; PRESERVE-UID-GID does not exist in XEmacs.
290;; hurt to ignore it for other (X)Emacs versions. 290;; PRESERVE-SELINUX-CONTEXT has been introduced with Emacs 24.1.
291;; PRESERVE-SELINUX-CONTEXT has been introduced with Emacs 24.
292(defun tramp-compat-copy-file 291(defun tramp-compat-copy-file
293 (filename newname &optional ok-if-already-exists keep-date 292 (filename newname &optional ok-if-already-exists keep-date
294 preserve-uid-gid preserve-selinux-context) 293 preserve-uid-gid preserve-selinux-context)
@@ -484,10 +483,7 @@ exiting if process is running."
484 (tramp-compat-funcall 'set-process-query-on-exit-flag process flag) 483 (tramp-compat-funcall 'set-process-query-on-exit-flag process flag)
485 (tramp-compat-funcall 'process-kill-without-query process flag))) 484 (tramp-compat-funcall 'process-kill-without-query process flag)))
486 485
487(add-hook 'tramp-unload-hook 486;; There exist different implementations for this function.
488 (lambda ()
489 (unload-feature 'tramp-compat 'force)))
490
491(defun tramp-compat-coding-system-change-eol-conversion (coding-system eol-type) 487(defun tramp-compat-coding-system-change-eol-conversion (coding-system eol-type)
492 "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. 488 "Return a coding system like CODING-SYSTEM but with given EOL-TYPE.
493EOL-TYPE can be one of `dos', `unix', or `mac'." 489EOL-TYPE can be one of `dos', `unix', or `mac'."
@@ -506,6 +502,10 @@ EOL-TYPE can be one of `dos', `unix', or `mac'."
506 "`dos', `unix', or `mac'"))))) 502 "`dos', `unix', or `mac'")))))
507 (t (error "Can't change EOL conversion -- is MULE missing?")))) 503 (t (error "Can't change EOL conversion -- is MULE missing?"))))
508 504
505(add-hook 'tramp-unload-hook
506 (lambda ()
507 (unload-feature 'tramp-compat 'force)))
508
509(provide 'tramp-compat) 509(provide 'tramp-compat)
510 510
511;;; TODO: 511;;; TODO:
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index e340ddc6cb0..1c6f0844be0 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -66,6 +66,9 @@ files conditionalize this setup based on the TERM environment variable."
66 :group 'tramp 66 :group 'tramp
67 :type 'string) 67 :type 'string)
68 68
69(defconst tramp-color-escape-sequence-regexp "\e[[;0-9]+m"
70 "Escape sequences produced by the \"ls\" command.")
71
69;; ksh on OpenBSD 4.5 requires that $PS1 contains a `#' character for 72;; ksh on OpenBSD 4.5 requires that $PS1 contains a `#' character for
70;; root users. It uses the `$' character for other users. In order 73;; root users. It uses the `$' character for other users. In order
71;; to guarantee a proper prompt, we use "#$ " for the prompt. 74;; to guarantee a proper prompt, we use "#$ " for the prompt.
@@ -484,7 +487,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
484;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"! 487;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"!
485;; IRIX64: /usr/bin 488;; IRIX64: /usr/bin
486(defcustom tramp-remote-path 489(defcustom tramp-remote-path
487 '(tramp-default-remote-path "/usr/sbin" "/usr/local/bin" 490 '(tramp-default-remote-path "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin"
488 "/local/bin" "/local/freeware/bin" "/local/gnu/bin" 491 "/local/bin" "/local/freeware/bin" "/local/gnu/bin"
489 "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin") 492 "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin")
490 "*List of directories to search for executables on remote host. 493 "*List of directories to search for executables on remote host.
@@ -2582,6 +2585,12 @@ This is like `dired-recursive-delete-directory' for Tramp files."
2582 (forward-line 1) 2585 (forward-line 1)
2583 (delete-region (match-beginning 0) (point))) 2586 (delete-region (match-beginning 0) (point)))
2584 2587
2588 ;; Some busyboxes are reluctant to discard colors.
2589 (unless (string-match "color" (tramp-get-connection-property v "ls" ""))
2590 (goto-char beg)
2591 (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
2592 (replace-match "")))
2593
2585 ;; The inserted file could be from somewhere else. 2594 ;; The inserted file could be from somewhere else.
2586 (when (and (not wildcard) (not full-directory-p)) 2595 (when (and (not wildcard) (not full-directory-p))
2587 (goto-char (point-max)) 2596 (goto-char (point-max))
@@ -2669,6 +2678,7 @@ the result will be a local, non-Tramp, filename."
2669 (let ((vec (tramp-get-connection-property proc "vector" nil))) 2678 (let ((vec (tramp-get-connection-property proc "vector" nil)))
2670 (when vec 2679 (when vec
2671 (tramp-message vec 5 "Sentinel called: `%s' `%s'" proc event) 2680 (tramp-message vec 5 "Sentinel called: `%s' `%s'" proc event)
2681 (tramp-flush-connection-property proc)
2672 (tramp-flush-directory-property vec ""))))) 2682 (tramp-flush-directory-property vec "")))))
2673 2683
2674;; We use BUFFER also as connection buffer during setup. Because of 2684;; We use BUFFER also as connection buffer during setup. Because of
@@ -2680,8 +2690,13 @@ the result will be a local, non-Tramp, filename."
2680 ;; When PROGRAM is nil, we just provide a tty. 2690 ;; When PROGRAM is nil, we just provide a tty.
2681 (let ((command 2691 (let ((command
2682 (when (stringp program) 2692 (when (stringp program)
2683 (format "cd %s; exec %s" 2693 (format "cd %s; exec env PS1=%s %s"
2684 (tramp-shell-quote-argument localname) 2694 (tramp-shell-quote-argument localname)
2695 ;; Use a human-friendly prompt, for example for `shell'.
2696 (tramp-shell-quote-argument
2697 (format "%s %s"
2698 (file-remote-p default-directory)
2699 tramp-initial-end-of-output))
2685 (mapconcat 'tramp-shell-quote-argument 2700 (mapconcat 'tramp-shell-quote-argument
2686 (cons program args) " ")))) 2701 (cons program args) " "))))
2687 (tramp-process-connection-type 2702 (tramp-process-connection-type
@@ -2721,9 +2736,7 @@ the result will be a local, non-Tramp, filename."
2721 v 'file-error 2736 v 'file-error
2722 "pty association is not supported for `%s'" name))))) 2737 "pty association is not supported for `%s'" name)))))
2723 (let ((p (tramp-get-connection-process v))) 2738 (let ((p (tramp-get-connection-process v)))
2724 ;; Set sentinel and query flag for this process. 2739 ;; Set query flag for this process.
2725 (tramp-set-connection-property p "vector" v)
2726 (set-process-sentinel p 'tramp-process-sentinel)
2727 (tramp-compat-set-process-query-on-exit-flag p t) 2740 (tramp-compat-set-process-query-on-exit-flag p t)
2728 ;; Return process. 2741 ;; Return process.
2729 p))) 2742 p)))
@@ -3834,10 +3847,9 @@ process to set up. VEC specifies the connection."
3834 (tramp-send-command vec "stty -oxtabs" t)) 3847 (tramp-send-command vec "stty -oxtabs" t))
3835 3848
3836 ;; Set `remote-tty' process property. 3849 ;; Set `remote-tty' process property.
3837 (ignore-errors 3850 (let ((tty (tramp-send-command-and-read vec "echo \\\"`tty`\\\"" 'noerror)))
3838 (let ((tty (tramp-send-command-and-read vec "echo \\\"`tty`\\\""))) 3851 (unless (zerop (length tty))
3839 (unless (zerop (length tty)) 3852 (tramp-compat-process-put proc 'remote-tty tty)))
3840 (tramp-compat-process-put proc 'remote-tty tty))))
3841 3853
3842 ;; Dump stty settings in the traces. 3854 ;; Dump stty settings in the traces.
3843 (when (>= tramp-verbose 9) 3855 (when (>= tramp-verbose 9)
@@ -4291,16 +4303,24 @@ connection if a previous connection has died for some reason."
4291 ;; This must be done in order to avoid our file name handler. 4303 ;; This must be done in order to avoid our file name handler.
4292 (p (let ((default-directory 4304 (p (let ((default-directory
4293 (tramp-compat-temporary-file-directory))) 4305 (tramp-compat-temporary-file-directory)))
4294 (start-process 4306 (apply
4307 'start-process
4295 (tramp-get-connection-name vec) 4308 (tramp-get-connection-name vec)
4296 (tramp-get-connection-buffer vec) 4309 (tramp-get-connection-buffer vec)
4297 tramp-encoding-shell)))) 4310 (if tramp-encoding-command-interactive
4311 (list tramp-encoding-shell
4312 tramp-encoding-command-interactive)
4313 (list tramp-encoding-shell))))))
4314
4315 ;; Set sentinel and query flag.
4316 (tramp-set-connection-property p "vector" vec)
4317 (set-process-sentinel p 'tramp-process-sentinel)
4318 (tramp-compat-set-process-query-on-exit-flag p nil)
4298 4319
4299 (tramp-message 4320 (tramp-message
4300 vec 6 "%s" (mapconcat 'identity (process-command p) " ")) 4321 vec 6 "%s" (mapconcat 'identity (process-command p) " "))
4301 4322
4302 ;; Check whether process is alive. 4323 ;; Check whether process is alive.
4303 (tramp-compat-set-process-query-on-exit-flag p nil)
4304 (tramp-barf-if-no-shell-prompt 4324 (tramp-barf-if-no-shell-prompt
4305 p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell) 4325 p 60 "Couldn't find local shell prompt %s" tramp-encoding-shell)
4306 4326
@@ -4488,9 +4508,10 @@ FMT and ARGS which are passed to `error'."
4488 (unless (tramp-send-command-and-check vec command) 4508 (unless (tramp-send-command-and-check vec command)
4489 (apply 'tramp-error vec 'file-error fmt args))) 4509 (apply 'tramp-error vec 'file-error fmt args)))
4490 4510
4491(defun tramp-send-command-and-read (vec command) 4511(defun tramp-send-command-and-read (vec command &optional noerror)
4492 "Run COMMAND and return the output, which must be a Lisp expression. 4512 "Run COMMAND and return the output, which must be a Lisp expression.
4493In case there is no valid Lisp expression, it raises an error" 4513In case there is no valid Lisp expression and NOERROR is nil, it
4514raises an error."
4494 (tramp-barf-unless-okay vec command "`%s' returns with error" command) 4515 (tramp-barf-unless-okay vec command "`%s' returns with error" command)
4495 (with-current-buffer (tramp-get-connection-buffer vec) 4516 (with-current-buffer (tramp-get-connection-buffer vec)
4496 ;; Read the expression. 4517 ;; Read the expression.
@@ -4500,16 +4521,21 @@ In case there is no valid Lisp expression, it raises an error"
4500 ;; Error handling. 4521 ;; Error handling.
4501 (when (re-search-forward "\\S-" (point-at-eol) t) 4522 (when (re-search-forward "\\S-" (point-at-eol) t)
4502 (error nil))) 4523 (error nil)))
4503 (error (tramp-error 4524 (error (unless noerror
4504 vec 'file-error 4525 (tramp-error
4505 "`%s' does not return a valid Lisp expression: `%s'" 4526 vec 'file-error
4506 command (buffer-string)))))) 4527 "`%s' does not return a valid Lisp expression: `%s'"
4528 command (buffer-string)))))))
4507 4529
4508(defun tramp-convert-file-attributes (vec attr) 4530(defun tramp-convert-file-attributes (vec attr)
4509 "Convert file-attributes ATTR generated by perl script, stat or ls. 4531 "Convert file-attributes ATTR generated by perl script, stat or ls.
4510Convert file mode bits to string and set virtual device number. 4532Convert file mode bits to string and set virtual device number.
4511Return ATTR." 4533Return ATTR."
4512 (when attr 4534 (when attr
4535 ;; Remove color escape sequences from symlink.
4536 (when (stringp (car attr))
4537 (while (string-match tramp-color-escape-sequence-regexp (car attr))
4538 (setcar attr (replace-match "" nil nil (car attr)))))
4513 ;; Convert last access time. 4539 ;; Convert last access time.
4514 (unless (listp (nth 4 attr)) 4540 (unless (listp (nth 4 attr))
4515 (setcar (nthcdr 4 attr) 4541 (setcar (nthcdr 4 attr)
@@ -4687,8 +4713,7 @@ This is used internally by `tramp-file-mode-from-int'."
4687 (when elt1 4713 (when elt1
4688 (or 4714 (or
4689 (tramp-send-command-and-read 4715 (tramp-send-command-and-read
4690 vec 4716 vec "echo \\\"`getconf PATH 2>/dev/null`\\\"" 'noerror)
4691 "x=`getconf PATH 2>/dev/null` && echo \\\"$x\\\" || echo nil")
4692 ;; Default if "getconf" is not available. 4717 ;; Default if "getconf" is not available.
4693 (progn 4718 (progn
4694 (tramp-message 4719 (tramp-message
@@ -4850,15 +4875,12 @@ This is used internally by `tramp-file-mode-from-int'."
4850 (let ((result (tramp-find-executable 4875 (let ((result (tramp-find-executable
4851 vec "stat" (tramp-get-remote-path vec))) 4876 vec "stat" (tramp-get-remote-path vec)))
4852 tmp) 4877 tmp)
4853 ;; Check whether stat(1) returns usable syntax. %s does not 4878 ;; Check whether stat(1) returns usable syntax. "%s" does not
4854 ;; work on older AIX systems. 4879 ;; work on older AIX systems.
4855 (when result 4880 (when result
4856 (setq tmp 4881 (setq tmp
4857 ;; We don't want to display an error message. 4882 (tramp-send-command-and-read
4858 (tramp-compat-with-temp-message (or (current-message) "") 4883 vec (format "%s -c '(\"%%N\" %%s)' /" result) 'noerror))
4859 (ignore-errors
4860 (tramp-send-command-and-read
4861 vec (format "%s -c '(\"%%N\" %%s)' /" result)))))
4862 (unless (and (listp tmp) (stringp (car tmp)) 4884 (unless (and (listp tmp) (stringp (car tmp))
4863 (string-match "^./.$" (car tmp)) 4885 (string-match "^./.$" (car tmp))
4864 (integerp (cadr tmp))) 4886 (integerp (cadr tmp)))
@@ -4871,11 +4893,8 @@ This is used internally by `tramp-file-mode-from-int'."
4871 (let ((result (tramp-find-executable 4893 (let ((result (tramp-find-executable
4872 vec "readlink" (tramp-get-remote-path vec)))) 4894 vec "readlink" (tramp-get-remote-path vec))))
4873 (when (and result 4895 (when (and result
4874 ;; We don't want to display an error message. 4896 (tramp-send-command-and-check
4875 (tramp-compat-with-temp-message (or (current-message) "") 4897 vec (format "%s --canonicalize-missing /" result)))
4876 (ignore-errors
4877 (tramp-send-command-and-check
4878 vec (format "%s --canonicalize-missing /" result)))))
4879 result)))) 4898 result))))
4880 4899
4881(defun tramp-get-remote-trash (vec) 4900(defun tramp-get-remote-trash (vec)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 9aff06031fc..82d878a6fa8 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -159,6 +159,9 @@ For encoding and deocding, commands like the following are executed:
159This variable can be used to change the \"/bin/sh\" part. See the 159This variable can be used to change the \"/bin/sh\" part. See the
160variable `tramp-encoding-command-switch' for the \"-c\" part. 160variable `tramp-encoding-command-switch' for the \"-c\" part.
161 161
162If the shell must be forced to be interactive, see
163`tramp-encoding-command-interactive'.
164
162Note that this variable is not used for remote commands. There are 165Note that this variable is not used for remote commands. There are
163mechanisms in tramp.el which automatically determine the right shell to 166mechanisms in tramp.el which automatically determine the right shell to
164use for the remote host." 167use for the remote host."
@@ -174,6 +177,13 @@ See the variable `tramp-encoding-shell' for more information."
174 :group 'tramp 177 :group 'tramp
175 :type 'string) 178 :type 'string)
176 179
180(defcustom tramp-encoding-command-interactive
181 (unless (string-match "cmd\\.exe" tramp-encoding-shell) "-i")
182 "*Use this switch together with `tramp-encoding-shell' for interactive shells.
183See the variable `tramp-encoding-shell' for more information."
184 :group 'tramp
185 :type '(choice (const nil) string))
186
177;;;###tramp-autoload 187;;;###tramp-autoload
178(defvar tramp-methods nil 188(defvar tramp-methods nil
179 "*Alist of methods for remote files. 189 "*Alist of methods for remote files.
diff --git a/lisp/nxml/rng-maint.el b/lisp/nxml/rng-maint.el
index d31740f0ca2..bd5b3136d54 100644
--- a/lisp/nxml/rng-maint.el
+++ b/lisp/nxml/rng-maint.el
@@ -224,19 +224,13 @@
224 224
225;;; Timing 225;;; Timing
226 226
227(defun rng-time-to-float (time)
228 (+ (* (nth 0 time) 65536.0)
229 (nth 1 time)
230 (/ (nth 2 time) 1000000.0)))
231
232(defun rng-time-function (function &rest args) 227(defun rng-time-function (function &rest args)
233 (let* ((start (current-time)) 228 (let* ((start (current-time))
234 (val (apply function args)) 229 (val (apply function args))
235 (end (current-time))) 230 (end (current-time)))
236 (message "%s ran in %g seconds" 231 (message "%s ran in %g seconds"
237 function 232 function
238 (- (rng-time-to-float end) 233 (float-time (time-subtract end start)))
239 (rng-time-to-float start)))
240 val)) 234 val))
241 235
242(defun rng-time-tokenize-buffer () 236(defun rng-time-tokenize-buffer ()
diff --git a/lisp/obsolete/old-emacs-lock.el b/lisp/obsolete/old-emacs-lock.el
new file mode 100644
index 00000000000..b45003fcecc
--- /dev/null
+++ b/lisp/obsolete/old-emacs-lock.el
@@ -0,0 +1,102 @@
1;;; emacs-lock.el --- prevents you from exiting Emacs if a buffer is locked
2
3;; Copyright (C) 1994, 1997, 2001-2011 Free Software Foundation, Inc
4
5;; Author: Tom Wurgler <twurgler@goodyear.com>
6;; Created: 12/8/94
7;; Keywords: extensions, processes
8;; Obsolete-since: 24.1
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25;;; Commentary:
26
27;; This code sets a buffer-local variable to t if toggle-emacs-lock is run,
28;; then if the user attempts to exit Emacs, the locked buffer name will be
29;; displayed and the exit aborted. This is just a way of protecting
30;; yourself from yourself. For example, if you have a shell running a big
31;; program and exiting Emacs would abort that program, you may want to lock
32;; that buffer, then if you forget about it after a while, you won't
33;; accidentally exit Emacs. To unlock the buffer, just goto the buffer and
34;; run toggle-emacs-lock again.
35
36;;; Code:
37
38(defvar emacs-lock-from-exiting nil
39 "Whether Emacs is locked to prevent exiting. See `check-emacs-lock'.")
40(make-variable-buffer-local 'emacs-lock-from-exiting)
41
42(defvar emacs-lock-buffer-locked nil
43 "Whether a shell or telnet buffer was locked when its process was killed.")
44(make-variable-buffer-local 'emacs-lock-buffer-locked)
45(put 'emacs-lock-buffer-locked 'permanent-local t)
46
47(defun check-emacs-lock ()
48 "Check if variable `emacs-lock-from-exiting' is t for any buffer.
49If any locked buffer is found, signal error and display the buffer's name."
50 (save-excursion
51 (dolist (buffer (buffer-list))
52 (set-buffer buffer)
53 (when emacs-lock-from-exiting
54 (error "Emacs is locked from exit due to buffer: %s" (buffer-name))))))
55
56(defun toggle-emacs-lock ()
57 "Toggle `emacs-lock-from-exiting' for the current buffer.
58See `check-emacs-lock'."
59 (interactive)
60 (setq emacs-lock-from-exiting (not emacs-lock-from-exiting))
61 (if emacs-lock-from-exiting
62 (message "Buffer is now locked")
63 (message "Buffer is now unlocked")))
64
65(defun emacs-lock-check-buffer-lock ()
66 "Check if variable `emacs-lock-from-exiting' is t for a buffer.
67If the buffer is locked, signal error and display its name."
68 (when emacs-lock-from-exiting
69 (error "Buffer `%s' is locked, can't delete it" (buffer-name))))
70
71; These next defuns make it so if you exit a shell that is locked, the lock
72; is shut off for that shell so you can exit Emacs. Same for telnet.
73; Also, if a shell or a telnet buffer was locked and the process killed,
74; turn the lock back on again if the process is restarted.
75
76(defun emacs-lock-shell-sentinel ()
77 (set-process-sentinel
78 (get-buffer-process (buffer-name)) (function emacs-lock-clear-sentinel)))
79
80(defun emacs-lock-clear-sentinel (_proc _str)
81 (if emacs-lock-from-exiting
82 (progn
83 (setq emacs-lock-from-exiting nil)
84 (setq emacs-lock-buffer-locked t)
85 (message "Buffer is now unlocked"))
86 (setq emacs-lock-buffer-locked nil)))
87
88(defun emacs-lock-was-buffer-locked ()
89 (if emacs-lock-buffer-locked
90 (setq emacs-lock-from-exiting t)))
91
92(unless noninteractive
93 (add-hook 'kill-emacs-hook 'check-emacs-lock))
94(add-hook 'kill-buffer-hook 'emacs-lock-check-buffer-lock)
95(add-hook 'shell-mode-hook 'emacs-lock-was-buffer-locked)
96(add-hook 'shell-mode-hook 'emacs-lock-shell-sentinel)
97(add-hook 'telnet-mode-hook 'emacs-lock-was-buffer-locked)
98(add-hook 'telnet-mode-hook 'emacs-lock-shell-sentinel)
99
100(provide 'emacs-lock)
101
102;;; emacs-lock.el ends here
diff --git a/lisp/pcmpl-linux.el b/lisp/pcmpl-linux.el
index 8090397627e..d75479fab3e 100644
--- a/lisp/pcmpl-linux.el
+++ b/lisp/pcmpl-linux.el
@@ -83,6 +83,19 @@
83 (forward-line))) 83 (forward-line)))
84 (pcomplete-uniqify-list points)))) 84 (pcomplete-uniqify-list points))))
85 85
86(defun pcomplete-pare-list (l r)
87 "Destructively remove from list L all elements matching any in list R.
88Test is done using `equal'."
89 (while (and l (and r (member (car l) r)))
90 (setq l (cdr l)))
91 (let ((m l))
92 (while m
93 (while (and (cdr m)
94 (and r (member (cadr m) r)))
95 (setcdr m (cddr m)))
96 (setq m (cdr m))))
97 l)
98
86(defun pcmpl-linux-mountable-directories () 99(defun pcmpl-linux-mountable-directories ()
87 "Return a list of mountable directory names." 100 "Return a list of mountable directory names."
88 (let (points) 101 (let (points)
diff --git a/lisp/play/animate.el b/lisp/play/animate.el
index 157a2fe7593..facdfa2f347 100644
--- a/lisp/play/animate.el
+++ b/lisp/play/animate.el
@@ -89,11 +89,15 @@
89 (insert-char char 1)) 89 (insert-char char 1))
90 90
91(defvar animate-n-steps 10 91(defvar animate-n-steps 10
92 "Number of steps to use `animate-string'.") 92"*Number of steps `animate-string' will place a char before its last position.")
93
94(defvar animation-buffer-name nil
95 "*String naming the default buffer for animations.
96When nil animations dipslayed in the buffer named *Animation*.")
93 97
94;;;###autoload 98;;;###autoload
95(defun animate-string (string vpos &optional hpos) 99(defun animate-string (string vpos &optional hpos)
96 "Display STRING starting at position VPOS, HPOS, using animation. 100 "Display STRING animations starting at position VPOS, HPOS.
97The characters start at randomly chosen places, 101The characters start at randomly chosen places,
98and all slide in parallel to their final positions, 102and all slide in parallel to their final positions,
99passing through `animate-n-steps' positions before the final ones. 103passing through `animate-n-steps' positions before the final ones.
@@ -138,14 +142,19 @@ in the current window."
138 142
139;;;###autoload 143;;;###autoload
140(defun animate-sequence (list-of-strings space) 144(defun animate-sequence (list-of-strings space)
141 "Display strings from LIST-OF-STRING with animation in a new buffer. 145 "Display animation strings from LIST-OF-STRING with buffer *Animation*.
142Strings will be separated from each other by SPACE lines." 146Strings will be separated from each other by SPACE lines.
147 When the variable `animation-buffer-name' is non-nil display
148animation in the buffer named by variable's value, creating the
149buffer if one does not exist."
143 (let ((vpos (/ (- (window-height) 150 (let ((vpos (/ (- (window-height)
144 1 ;; For the mode-line 151 1 ;; For the mode-line
145 (* (1- (length list-of-strings)) space) 152 (* (1- (length list-of-strings)) space)
146 (length list-of-strings)) 153 (length list-of-strings))
147 2))) 154 2)))
148 (switch-to-buffer (get-buffer-create "*Animation*")) 155 (switch-to-buffer (get-buffer-create
156 (or animation-buffer-name
157 "*Animation*")))
149 (erase-buffer) 158 (erase-buffer)
150 (sit-for 0) 159 (sit-for 0)
151 (while list-of-strings 160 (while list-of-strings
@@ -155,19 +164,25 @@ Strings will be separated from each other by SPACE lines."
155 164
156;;;###autoload 165;;;###autoload
157(defun animate-birthday-present (&optional name) 166(defun animate-birthday-present (&optional name)
158 "Display one's birthday present in a new buffer. 167 "Return a birthday present in the buffer *Birthday-Present*.
159You can specify the one's name by NAME; the default value is \"Sarah\"." 168When optional arg NAME is non-nil or called-interactively, prompt for
160 (interactive (list (read-string "Name (default Sarah): " 169NAME of birthday present receiver and return a birthday present in
161 nil nil "Sarah"))) 170the buffer *Birthday-Present-for-Name*."
171 (interactive (list (read-string "Birthday present for: "
172 nil nil)))
162 ;; Make a suitable buffer to display the birthday present in. 173 ;; Make a suitable buffer to display the birthday present in.
163 (switch-to-buffer (get-buffer-create (format "*%s*" name))) 174 (switch-to-buffer (get-buffer-create
175 (if name
176 (concat "*A-Present-for-" (capitalize name) "*")
177 "*Birthday-Present*")))
164 (erase-buffer) 178 (erase-buffer)
165 ;; Display the empty buffer. 179 ;; Display the empty buffer.
166 (sit-for 0) 180 (sit-for 0)
167 181
168 (animate-string "Happy Birthday," 6) 182 (if name
169 (animate-string (format "%s" name) 7) 183 (animate-string "Happy Birthday," 6)
170 184 (animate-string "Happy Birthday" 6))
185 (when name (animate-string (format "%s" (capitalize name)) 7))
171 (sit-for 1) 186 (sit-for 1)
172 187
173 (animate-string "You are my sunshine," 10 30) 188 (animate-string "You are my sunshine," 10 30)
diff --git a/lisp/play/hanoi.el b/lisp/play/hanoi.el
index ac78a86757c..31a6d6f425b 100644
--- a/lisp/play/hanoi.el
+++ b/lisp/play/hanoi.el
@@ -113,7 +113,7 @@ intermediate positions."
113 (prefix-numeric-value current-prefix-arg)))) 113 (prefix-numeric-value current-prefix-arg))))
114 (if (< nrings 0) 114 (if (< nrings 0)
115 (error "Negative number of rings")) 115 (error "Negative number of rings"))
116 (hanoi-internal nrings (make-list nrings 0) (hanoi-current-time-float))) 116 (hanoi-internal nrings (make-list nrings 0) (float-time)))
117 117
118;;;###autoload 118;;;###autoload
119(defun hanoi-unix () 119(defun hanoi-unix ()
@@ -123,7 +123,7 @@ second since 1970-01-01 00:00:00 GMT.
123 123
124Repent before ring 31 moves." 124Repent before ring 31 moves."
125 (interactive) 125 (interactive)
126 (let* ((start (ftruncate (hanoi-current-time-float))) 126 (let* ((start (ftruncate (float-time)))
127 (bits (loop repeat 32 127 (bits (loop repeat 32
128 for x = (/ start (expt 2.0 31)) then (* x 2.0) 128 for x = (/ start (expt 2.0 31)) then (* x 2.0)
129 collect (truncate (mod x 2.0)))) 129 collect (truncate (mod x 2.0))))
@@ -137,7 +137,7 @@ This is, necessarily (as of Emacs 20.3), a crock. When the
137current-time interface is made s2G-compliant, hanoi.el will need 137current-time interface is made s2G-compliant, hanoi.el will need
138to be updated." 138to be updated."
139 (interactive) 139 (interactive)
140 (let* ((start (ftruncate (hanoi-current-time-float))) 140 (let* ((start (ftruncate (float-time)))
141 (bits (loop repeat 64 141 (bits (loop repeat 64
142 for x = (/ start (expt 2.0 63)) then (* x 2.0) 142 for x = (/ start (expt 2.0 63)) then (* x 2.0)
143 collect (truncate (mod x 2.0)))) 143 collect (truncate (mod x 2.0))))
@@ -283,11 +283,6 @@ BITS must be of length nrings. Start at START-TIME."
283 (setq buffer-read-only t) 283 (setq buffer-read-only t)
284 (force-mode-line-update))) 284 (force-mode-line-update)))
285 285
286(defun hanoi-current-time-float ()
287 "Return values from current-time combined into a single float."
288 (destructuring-bind (high low micros) (current-time)
289 (+ (* high 65536.0) low (/ micros 1000000.0))))
290
291(defun hanoi-put-face (start end value &optional object) 286(defun hanoi-put-face (start end value &optional object)
292 "If hanoi-use-faces is non-nil, call put-text-property for face property." 287 "If hanoi-use-faces is non-nil, call put-text-property for face property."
293 (if hanoi-use-faces 288 (if hanoi-use-faces
@@ -383,7 +378,7 @@ BITS must be of length nrings. Start at START-TIME."
383 (/ (- tick flyward-ticks fly-ticks) 378 (/ (- tick flyward-ticks fly-ticks)
384 ticks-per-pole-step)))))))) 379 ticks-per-pole-step))))))))
385 (if hanoi-move-period 380 (if hanoi-move-period
386 (loop for elapsed = (- (hanoi-current-time-float) start-time) 381 (loop for elapsed = (- (float-time) start-time)
387 while (< elapsed hanoi-move-period) 382 while (< elapsed hanoi-move-period)
388 with tick-period = (/ (float hanoi-move-period) total-ticks) 383 with tick-period = (/ (float hanoi-move-period) total-ticks)
389 for tick = (ceiling (/ elapsed tick-period)) do 384 for tick = (ceiling (/ elapsed tick-period)) do
diff --git a/lisp/printing.el b/lisp/printing.el
index e66cca25933..9f98c2b6e29 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -4611,7 +4611,7 @@ bottom."
4611 4611
4612;;;###autoload 4612;;;###autoload
4613(defun pr-toggle-region () 4613(defun pr-toggle-region ()
4614 "Toggle auto region." 4614 "Toggle whether the region is automagically detected."
4615 (interactive) 4615 (interactive)
4616 (pr-toggle-region-menu t)) 4616 (pr-toggle-region-menu t))
4617 4617
@@ -5346,102 +5346,119 @@ If menu binding was not done, calls `pr-menu-bind'."
5346 5346
5347 5347
5348(defun pr-toggle-file-duplex-menu (&optional no-menu) 5348(defun pr-toggle-file-duplex-menu (&optional no-menu)
5349 "Toggle whether to print PostScript files in duplex mode."
5349 (interactive) 5350 (interactive)
5350 (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil 5351 (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil
5351 '("PostScript Print" "File") no-menu)) 5352 '("PostScript Print" "File") no-menu))
5352 5353
5353 5354
5354(defun pr-toggle-file-tumble-menu (&optional no-menu) 5355(defun pr-toggle-file-tumble-menu (&optional no-menu)
5356 "Toggle whether to print PostScript files in tumble mode."
5355 (interactive) 5357 (interactive)
5356 (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil 5358 (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil
5357 '("PostScript Print" "File") no-menu)) 5359 '("PostScript Print" "File") no-menu))
5358 5360
5359 5361
5360(defun pr-toggle-file-landscape-menu (&optional no-menu) 5362(defun pr-toggle-file-landscape-menu (&optional no-menu)
5363 "Toggle whether to print PostScript files in landscape orientation."
5361 (interactive) 5364 (interactive)
5362 (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil 5365 (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil
5363 '("PostScript Print" "File") no-menu)) 5366 '("PostScript Print" "File") no-menu))
5364 5367
5365 5368
5366(defun pr-toggle-ghostscript-menu (&optional no-menu) 5369(defun pr-toggle-ghostscript-menu (&optional no-menu)
5370 "Toggle whether to print using ghostscript."
5367 (interactive) 5371 (interactive)
5368 (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript" 5372 (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript"
5369 'postscript-process 2 12 'toggle nil no-menu)) 5373 'postscript-process 2 12 'toggle nil no-menu))
5370 5374
5371 5375
5372(defun pr-toggle-faces-menu (&optional no-menu) 5376(defun pr-toggle-faces-menu (&optional no-menu)
5377 "Toggle whether to print with face attributes."
5373 (interactive) 5378 (interactive)
5374 (pr-toggle 'pr-faces-p "Printing with faces" 5379 (pr-toggle 'pr-faces-p "Printing with faces"
5375 'postscript-process 1 12 'toggle nil no-menu)) 5380 'postscript-process 1 12 'toggle nil no-menu))
5376 5381
5377 5382
5378(defun pr-toggle-spool-menu (&optional no-menu) 5383(defun pr-toggle-spool-menu (&optional no-menu)
5384 "Toggle whether to spool printing in a buffer."
5379 (interactive) 5385 (interactive)
5380 (pr-toggle 'pr-spool-p "Spooling printing" 5386 (pr-toggle 'pr-spool-p "Spooling printing"
5381 'postscript-process 0 12 'toggle nil no-menu)) 5387 'postscript-process 0 12 'toggle nil no-menu))
5382 5388
5383 5389
5384(defun pr-toggle-duplex-menu (&optional no-menu) 5390(defun pr-toggle-duplex-menu (&optional no-menu)
5391 "Toggle whether to generate PostScript for a two-sided printer."
5385 (interactive) 5392 (interactive)
5386 (pr-toggle 'ps-spool-duplex "Printing duplex" 5393 (pr-toggle 'ps-spool-duplex "Printing duplex"
5387 'postscript-options 5 12 'toggle nil no-menu)) 5394 'postscript-options 5 12 'toggle nil no-menu))
5388 5395
5389 5396
5390(defun pr-toggle-tumble-menu (&optional no-menu) 5397(defun pr-toggle-tumble-menu (&optional no-menu)
5398 "Toggle how pages on opposite sides of a sheet are oriented."
5391 (interactive) 5399 (interactive)
5392 (pr-toggle 'ps-spool-tumble "Tumble" 5400 (pr-toggle 'ps-spool-tumble "Tumble"
5393 'postscript-options 6 12 'toggle nil no-menu)) 5401 'postscript-options 6 12 'toggle nil no-menu))
5394 5402
5395 5403
5396(defun pr-toggle-landscape-menu (&optional no-menu) 5404(defun pr-toggle-landscape-menu (&optional no-menu)
5405 "Toggle whether to print in landscape mode."
5397 (interactive) 5406 (interactive)
5398 (pr-toggle 'ps-landscape-mode "Landscape" 5407 (pr-toggle 'ps-landscape-mode "Landscape"
5399 'postscript-options 0 12 'toggle nil no-menu)) 5408 'postscript-options 0 12 'toggle nil no-menu))
5400 5409
5401 5410
5402(defun pr-toggle-upside-down-menu (&optional no-menu) 5411(defun pr-toggle-upside-down-menu (&optional no-menu)
5412 "Toggle whether to print upside-down (that is, rotated by 180 degrees)."
5403 (interactive) 5413 (interactive)
5404 (pr-toggle 'ps-print-upside-down "Upside-Down" 5414 (pr-toggle 'ps-print-upside-down "Upside-Down"
5405 'postscript-options 7 12 'toggle nil no-menu)) 5415 'postscript-options 7 12 'toggle nil no-menu))
5406 5416
5407 5417
5408(defun pr-toggle-line-menu (&optional no-menu) 5418(defun pr-toggle-line-menu (&optional no-menu)
5419 "Toggle whether to means print line numbers."
5409 (interactive) 5420 (interactive)
5410 (pr-toggle 'ps-line-number "Line number" 5421 (pr-toggle 'ps-line-number "Line number"
5411 'postscript-options 3 12 'toggle nil no-menu)) 5422 'postscript-options 3 12 'toggle nil no-menu))
5412 5423
5413 5424
5414(defun pr-toggle-zebra-menu (&optional no-menu) 5425(defun pr-toggle-zebra-menu (&optional no-menu)
5426 "Toggle whether to print zebra stripes."
5415 (interactive) 5427 (interactive)
5416 (pr-toggle 'ps-zebra-stripes "Zebra stripe" 5428 (pr-toggle 'ps-zebra-stripes "Zebra stripe"
5417 'postscript-options 4 12 'toggle nil no-menu)) 5429 'postscript-options 4 12 'toggle nil no-menu))
5418 5430
5419 5431
5420(defun pr-toggle-header-menu (&optional no-menu) 5432(defun pr-toggle-header-menu (&optional no-menu)
5433 "Toggle whether to print a header at the top of each page."
5421 (interactive) 5434 (interactive)
5422 (pr-toggle 'ps-print-header "Print header" 5435 (pr-toggle 'ps-print-header "Print header"
5423 'postscript-options 1 12 'toggle nil no-menu)) 5436 'postscript-options 1 12 'toggle nil no-menu))
5424 5437
5425 5438
5426(defun pr-toggle-header-frame-menu (&optional no-menu) 5439(defun pr-toggle-header-frame-menu (&optional no-menu)
5440 "Toggle whether to draw a gaudy frame around the header."
5427 (interactive) 5441 (interactive)
5428 (pr-toggle 'ps-print-header-frame "Print header frame" 5442 (pr-toggle 'ps-print-header-frame "Print header frame"
5429 'postscript-options 2 12 'toggle nil no-menu)) 5443 'postscript-options 2 12 'toggle nil no-menu))
5430 5444
5431 5445
5432(defun pr-toggle-lock-menu (&optional no-menu) 5446(defun pr-toggle-lock-menu (&optional no-menu)
5447 "Toggle whether the menu is locked while selecting toggle options."
5433 (interactive) 5448 (interactive)
5434 (pr-toggle 'pr-menu-lock "Menu lock" 5449 (pr-toggle 'pr-menu-lock "Menu lock"
5435 'printing 2 12 'toggle nil no-menu)) 5450 'printing 2 12 'toggle nil no-menu))
5436 5451
5437 5452
5438(defun pr-toggle-region-menu (&optional no-menu) 5453(defun pr-toggle-region-menu (&optional no-menu)
5454 "Toggle whether the region is automagically detected."
5439 (interactive) 5455 (interactive)
5440 (pr-toggle 'pr-auto-region "Auto region" 5456 (pr-toggle 'pr-auto-region "Auto region"
5441 'printing 0 12 'toggle nil no-menu)) 5457 'printing 0 12 'toggle nil no-menu))
5442 5458
5443 5459
5444(defun pr-toggle-mode-menu (&optional no-menu) 5460(defun pr-toggle-mode-menu (&optional no-menu)
5461 "Toggle whether major-mode specific printing is prefered over normal printing."
5445 (interactive) 5462 (interactive)
5446 (pr-toggle 'pr-auto-mode "Auto mode" 5463 (pr-toggle 'pr-auto-mode "Auto mode"
5447 'printing 1 12 'toggle nil no-menu)) 5464 'printing 1 12 'toggle nil no-menu))
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 0eec54fab6f..38f66b4504e 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -8712,6 +8712,35 @@ comment at the start of cc-engine.el for more info."
8712 (c-beginning-of-statement-1 containing-sexp) 8712 (c-beginning-of-statement-1 containing-sexp)
8713 (c-add-syntax 'annotation-var-cont (point))) 8713 (c-add-syntax 'annotation-var-cont (point)))
8714 8714
8715 ;; CASE G: a template list continuation?
8716 ;; Mostly a duplication of case 5D.3 to fix templates-19:
8717 ((and (c-major-mode-is 'c++-mode)
8718 (save-excursion
8719 (goto-char indent-point)
8720 (c-with-syntax-table c++-template-syntax-table
8721 (setq placeholder (c-up-list-backward)))
8722 (and placeholder
8723 (eq (char-after placeholder) ?<)
8724 (/= (char-before placeholder) ?<)
8725 (progn
8726 (goto-char (1+ placeholder))
8727 (not (looking-at c-<-op-cont-regexp))))))
8728 (c-with-syntax-table c++-template-syntax-table
8729 (goto-char placeholder)
8730 (c-beginning-of-statement-1 containing-sexp t)
8731 (if (save-excursion
8732 (c-backward-syntactic-ws containing-sexp)
8733 (eq (char-before) ?<))
8734 ;; In a nested template arglist.
8735 (progn
8736 (goto-char placeholder)
8737 (c-syntactic-skip-backward "^,;" containing-sexp t)
8738 (c-forward-syntactic-ws))
8739 (back-to-indentation)))
8740 ;; FIXME: Should use c-add-stmt-syntax, but it's not yet
8741 ;; template aware.
8742 (c-add-syntax 'template-args-cont (point) placeholder))
8743
8715 ;; CASE D: continued statement. 8744 ;; CASE D: continued statement.
8716 (t 8745 (t
8717 (c-beginning-of-statement-1 containing-sexp) 8746 (c-beginning-of-statement-1 containing-sexp)
diff --git a/lisp/progmodes/cc-guess.el b/lisp/progmodes/cc-guess.el
new file mode 100644
index 00000000000..6553021e783
--- /dev/null
+++ b/lisp/progmodes/cc-guess.el
@@ -0,0 +1,574 @@
1;;; cc-guess.el --- guess indentation values by scanning existing code
2
3;; Copyright (C) 1985, 1987, 1992-2006, 2011
4;; Free Software Foundation, Inc.
5
6;; Author: 1994-1995 Barry A. Warsaw
7;; 2011- Masatake YAMATO
8;; Maintainer: bug-cc-mode@gnu.org
9;; Created: August 1994, split from cc-mode.el
10;; Version: See cc-mode.el
11;; Keywords: c languages oop
12
13;; This file is part of GNU Emacs.
14
15;; GNU Emacs is free software: you can redistribute it and/or modify
16;; it under the terms of the GNU General Public License as published by
17;; the Free Software Foundation, either version 3 of the License, or
18;; (at your option) any later version.
19
20;; GNU Emacs is distributed in the hope that it will be useful,
21;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;; GNU General Public License for more details.
24
25;; You should have received a copy of the GNU General Public License
26;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
27
28;;; Commentary:
29;;
30;; This file contains routines that help guess the cc-mode style in a
31;; particular region/buffer. Here style means `c-offsets-alist' and
32;; `c-basic-offset'.
33;;
34;; The main entry point of this program is `c-guess' command but there
35;; are some variants.
36;;
37;; Suppose the major mode for the current buffer is one of the modes
38;; provided by cc-mode. `c-guess' guesses the indentation style by
39;; examining the indentation in the region between beginning of buffer
40;; and `c-guess-region-max'.
41
42;; and installs the guessed style. The name for installed style is given
43;; by `c-guess-style-name'.
44;;
45;; `c-guess-buffer' does the same but in the whole buffer.
46;; `c-guess-region' does the same but in the region between the point
47;; and the mark. `c-guess-no-install', `c-guess-buffer-no-install'
48;; and `c-guess-region-no-install' guess the indentation style but
49;; don't install it. You can review a guessed style with `c-guess-view'.
50;; After reviewing, use `c-guess-install' to install the style
51;; if you prefer it.
52;;
53;; If you want to reuse the guessed style in another buffer,
54;; run `c-set-style' command with the name of the guessed style:
55;; "*c-guess*:<name-of-file-which-examined-when-guessing>".
56;; Once the guessed style is installed explicitly with `c-guess-install'
57;; or implicitly with `c-guess', `c-guess-buffer', or `c-guess-region',
58;; a style name is given by `c-guess-style-name' with the above form.
59;;
60;; If you want to reuse the guessed style in future emacs sessions,
61;; you may want to put it to your .emacs. `c-guess-view' is for
62;; you. It emits emacs lisp code which defines the last guessed
63;; style, in a temporary buffer. You can put the emitted code into
64;; your .emacs. This command was suggested by Alan Mackenzie.
65
66;;; Code:
67
68(eval-when-compile
69 (let ((load-path
70 (if (and (boundp 'byte-compile-dest-file)
71 (stringp byte-compile-dest-file))
72 (cons (file-name-directory byte-compile-dest-file) load-path)
73 load-path)))
74 (load "cc-bytecomp" nil t)))
75
76(cc-require 'cc-defs)
77(cc-require 'cc-engine)
78(cc-require 'cc-styles)
79
80
81
82(defcustom c-guess-offset-threshold 10
83 "Threshold of acceptable offsets when examining indent information.
84Discard an examined offset if its absolute value is greater than this.
85
86The offset of a line included in the indent information returned by
87`c-guess-basic-syntax'."
88 :type 'integer
89 :group 'c)
90
91(defcustom c-guess-region-max 50000
92 "The maximum region size for examining indent information with `c-guess'.
93It takes a long time to examine indent information from a large region;
94this option helps you limit that time. `nil' means no limit."
95 :type 'integer
96 :group 'c)
97
98
99;;;###autoload
100(defvar c-guess-guessed-offsets-alist nil
101 "Currently guessed offsets-alist.")
102;;;###autoload
103(defvar c-guess-guessed-basic-offset nil
104 "Currently guessed basic-offset.")
105
106(defvar c-guess-accumulator nil)
107;; Accumulated examined indent information. Information is represented
108;; in a list. Each element in it has following structure:
109;;
110;; (syntactic-symbol ((indentation-offset1 . number-of-times1)
111;; (indentation-offset2 . number-of-times2)
112;; ...))
113;;
114;; This structure is built by `c-guess-accumulate-offset'.
115;;
116;; Here we call the pair (indentation-offset1 . number-of-times1) a
117;; counter. `c-guess-sort-accumulator' sorts the order of
118;; counters by number-of-times.
119;; Use `c-guess-dump-accumulator' to see the value.
120
121(defconst c-guess-conversions
122 '((c . c-lineup-C-comments)
123 (inher-cont . c-lineup-multi-inher)
124 (string . -1000)
125 (comment-intro . c-lineup-comment)
126 (arglist-cont-nonempty . c-lineup-arglist)
127 (arglist-close . c-lineup-close-paren)
128 (cpp-macro . -1000)))
129
130
131;;;###autoload
132(defun c-guess (&optional accumulate)
133 "Guess the style in the region up to `c-guess-region-max', and install it.
134
135The style is given a name based on the file's absolute file name.
136
137If given a prefix argument (or if the optional argument ACCUMULATE is
138non-nil) then the previous guess is extended, otherwise a new guess is
139made from scratch."
140 (interactive "P")
141 (c-guess-region (point-min)
142 (min (point-max) (or c-guess-region-max
143 (point-max)))
144 accumulate))
145
146;;;###autoload
147(defun c-guess-no-install (&optional accumulate)
148 "Guess the style in the region up to `c-guess-region-max'; don't install it.
149
150If given a prefix argument (or if the optional argument ACCUMULATE is
151non-nil) then the previous guess is extended, otherwise a new guess is
152made from scratch."
153 (interactive "P")
154 (c-guess-region-no-install (point-min)
155 (min (point-max) (or c-guess-region-max
156 (point-max)))
157 accumulate))
158
159;;;###autoload
160(defun c-guess-buffer (&optional accumulate)
161 "Guess the style on the whole current buffer, and install it.
162
163The style is given a name based on the file's absolute file name.
164
165If given a prefix argument (or if the optional argument ACCUMULATE is
166non-nil) then the previous guess is extended, otherwise a new guess is
167made from scratch."
168 (interactive "P")
169 (c-guess-region (point-min)
170 (point-max)
171 accumulate))
172
173;;;###autoload
174(defun c-guess-buffer-no-install (&optional accumulate)
175 "Guess the style on the whole current buffer; don't install it.
176
177If given a prefix argument (or if the optional argument ACCUMULATE is
178non-nil) then the previous guess is extended, otherwise a new guess is
179made from scratch."
180 (interactive "P")
181 (c-guess-region-no-install (point-min)
182 (point-max)
183 accumulate))
184
185;;;###autoload
186(defun c-guess-region (start end &optional accumulate)
187 "Guess the style on the region and install it.
188
189The style is given a name based on the file's absolute file name.
190
191If given a prefix argument (or if the optional argument ACCUMULATE is
192non-nil) then the previous guess is extended, otherwise a new guess is
193made from scratch."
194 (interactive "r\nP")
195 (c-guess-region-no-install start end accumulate)
196 (c-guess-install))
197
198
199(defsubst c-guess-empty-line-p ()
200 (eq (line-beginning-position)
201 (line-end-position)))
202
203;;;###autoload
204(defun c-guess-region-no-install (start end &optional accumulate)
205 "Guess the style on the region; don't install it.
206
207Every line of code in the region is examined and values for the following two
208variables are guessed:
209
210* `c-basic-offset', and
211* the indentation values of the various syntactic symbols in
212 `c-offsets-alist'.
213
214The guessed values are put into `c-guess-guessed-basic-offset' and
215`c-guess-guessed-offsets-alist'.
216
217Frequencies of use are taken into account when guessing, so minor
218inconsistencies in the indentation style shouldn't produce wrong guesses.
219
220If given a prefix argument (or if the optional argument ACCUMULATE is
221non-nil) then the previous examination is extended, otherwise a new
222guess is made from scratch.
223
224Note that the larger the region to guess in, the slower the guessing.
225So you can limit the region with `c-guess-region-max'."
226 (interactive "r\nP")
227 (let ((accumulator (when accumulate c-guess-accumulator)))
228 (setq c-guess-accumulator (c-guess-examine start end accumulator))
229 (let ((pair (c-guess-guess c-guess-accumulator)))
230 (setq c-guess-guessed-basic-offset (car pair)
231 c-guess-guessed-offsets-alist (cdr pair)))))
232
233
234(defun c-guess-examine (start end accumulator)
235 (let ((reporter (when (fboundp 'make-progress-reporter)
236 (make-progress-reporter "Examining Indentation "
237 start
238 end))))
239 (save-excursion
240 (goto-char start)
241 (while (< (point) end)
242 (unless (c-guess-empty-line-p)
243 (mapc (lambda (s)
244 (setq accumulator (or (c-guess-accumulate accumulator s)
245 accumulator)))
246 (c-save-buffer-state () (c-guess-basic-syntax))))
247 (when reporter (progress-reporter-update reporter (point)))
248 (forward-line 1)))
249 (when reporter (progress-reporter-done reporter)))
250 (c-guess-sort-accumulator accumulator))
251
252(defun c-guess-guess (accumulator)
253 ;; Guess basic-offset and offsets-alist from ACCUMULATOR,
254 ;; then return them as a cons: (basic-offset . offsets-alist).
255 ;; See the comments at `c-guess-accumulator' about the format
256 ;; ACCUMULATOR.
257 (let* ((basic-offset (c-guess-make-basic-offset accumulator))
258 (typical-offsets-alist (c-guess-make-offsets-alist
259 accumulator))
260 (symbolic-offsets-alist (c-guess-symbolize-offsets-alist
261 typical-offsets-alist
262 basic-offset))
263 (merged-offsets-alist (c-guess-merge-offsets-alists
264 (copy-tree c-guess-conversions)
265 symbolic-offsets-alist)))
266 (cons basic-offset merged-offsets-alist)))
267
268(defun c-guess-current-offset (relpos)
269 ;; Calculate relative indentation (point) to RELPOS.
270 (- (progn (back-to-indentation)
271 (current-column))
272 (save-excursion
273 (goto-char relpos)
274 (current-column))))
275
276(defun c-guess-accumulate (accumulator syntax-element)
277 ;; Add SYNTAX-ELEMENT to ACCUMULATOR.
278 (let ((symbol (car syntax-element))
279 (relpos (cadr syntax-element)))
280 (when (numberp relpos)
281 (let ((offset (c-guess-current-offset relpos)))
282 (when (< (abs offset) c-guess-offset-threshold)
283 (c-guess-accumulate-offset accumulator
284 symbol
285 offset))))))
286
287(defun c-guess-accumulate-offset (accumulator symbol offset)
288 ;; Added SYMBOL and OFFSET to ACCUMULATOR. See
289 ;; `c-guess-accumulator' about the structure of ACCUMULATOR.
290 (let* ((entry (assoc symbol accumulator))
291 (counters (cdr entry))
292 counter)
293 (if entry
294 (progn
295 (setq counter (assoc offset counters))
296 (if counter
297 (setcdr counter (1+ (cdr counter)))
298 (setq counters (cons (cons offset 1) counters))
299 (setcdr entry counters))
300 accumulator)
301 (cons (cons symbol (cons (cons offset 1) nil)) accumulator))))
302
303(defun c-guess-sort-accumulator (accumulator)
304 ;; Sort each element of ACCUMULATOR by the number-of-times. See
305 ;; `c-guess-accumulator' for more details.
306 (mapcar
307 (lambda (entry)
308 (let ((symbol (car entry))
309 (counters (cdr entry)))
310 (cons symbol (sort counters
311 (lambda (a b)
312 (if (> (cdr a) (cdr b))
313 t
314 (and
315 (eq (cdr a) (cdr b))
316 (< (car a) (car b)))))))))
317 accumulator))
318
319(defun c-guess-make-offsets-alist (accumulator)
320 ;; Throw away the rare cases in accumulator and make an offsets-alist structure.
321 (mapcar
322 (lambda (entry)
323 (cons (car entry)
324 (car (car (cdr entry)))))
325 accumulator))
326
327(defun c-guess-merge-offsets-alists (strong weak)
328 ;; Merge two offsets-alists into one.
329 ;; When two offsets-alists have the same symbol
330 ;; entry, give STRONG priority over WEAK.
331 (mapc
332 (lambda (weak-elt)
333 (unless (assoc (car weak-elt) strong)
334 (setq strong (cons weak-elt strong))))
335 weak)
336 strong)
337
338(defun c-guess-make-basic-offset (accumulator)
339 ;; As candidate for `c-basic-offset', find the most frequently appearing
340 ;; indentation-offset in ACCUMULATOR.
341 (let* (;; Drop the value related to `c' syntactic-symbol.
342 ;; (`c': Inside a multiline C style block comment.)
343 ;; The impact for values of `c' is too large for guessing
344 ;; `basic-offset' if the target source file is small and its license
345 ;; notice is at top of the file.
346 (accumulator (assq-delete-all 'c (copy-tree accumulator)))
347 ;; Drop syntactic-symbols from ACCUMULATOR.
348 (alist (apply #'append (mapcar (lambda (elts)
349 (mapcar (lambda (elt)
350 (cons (abs (car elt))
351 (cdr elt)))
352 (cdr elts)))
353 accumulator)))
354 ;; Gather all indentation-offsets other than 0.
355 ;; 0 is meaningless as `basic-offset'.
356 (offset-list (delete 0
357 (delete-dups (mapcar
358 (lambda (elt) (car elt))
359 alist))))
360 ;; Sum of number-of-times for offset:
361 ;; (offset . sum)
362 (summed (mapcar (lambda (offset)
363 (cons offset
364 (apply #'+
365 (mapcar (lambda (a)
366 (if (eq (car a) offset)
367 (cdr a)
368 0))
369 alist))))
370 offset-list)))
371 ;;
372 ;; Find the majority.
373 ;;
374 (let ((majority '(nil . 0)))
375 (while summed
376 (when (< (cdr majority) (cdr (car summed)))
377 (setq majority (car summed)))
378 (setq summed (cdr summed)))
379 (car majority))))
380
381(defun c-guess-symbolize-offsets-alist (offsets-alist basic-offset)
382 ;; Convert the representation of OFFSETS-ALIST to an alist using
383 ;; `+', `-', `++', `--', `*', or `/'. These symbols represent
384 ;; a value relative to BASIC-OFFSET. Their meaning can be found
385 ;; in the CC Mode manual.
386 (mapcar
387 (lambda (elt)
388 (let ((s (car elt))
389 (v (cdr elt)))
390 (cond
391 ((integerp v)
392 (cons s (c-guess-symbolize-integer v
393 basic-offset)))
394 (t elt))))
395 offsets-alist))
396
397(defun c-guess-symbolize-integer (int basic-offset)
398 (let ((aint (abs int)))
399 (cond
400 ((eq int basic-offset) '+)
401 ((eq aint basic-offset) '-)
402 ((eq int (* 2 basic-offset)) '++)
403 ((eq aint (* 2 basic-offset)) '--)
404 ((eq (* 2 int) basic-offset) '*)
405 ((eq (* 2 aint) basic-offset) '-)
406 (t int))))
407
408(defun c-guess-style-name ()
409 ;; Make a style name for the guessed style.
410 (format "*c-guess*:%s" (buffer-file-name)))
411
412(defun c-guess-make-style (basic-offset offsets-alist)
413 (when basic-offset
414 ;; Make a style from guessed values.
415 (let* ((offsets-alist (c-guess-merge-offsets-alists
416 offsets-alist
417 c-offsets-alist)))
418 `((c-basic-offset . ,basic-offset)
419 (c-offsets-alist . ,offsets-alist)))))
420
421;;;###autoload
422(defun c-guess-install (&optional style-name)
423 "Install the latest guessed style into the current buffer.
424\(This guessed style is a combination of `c-guess-guessed-basic-offset',
425`c-guess-guessed-offsets-alist' and `c-offsets-alist'.)
426
427The style is entered into CC Mode's style system by
428`c-add-style'. Its name is either STYLE-NAME, or a name based on
429the absolute file name of the file if STYLE-NAME is nil."
430 (interactive "sNew style name (empty for default name): ")
431 (let* ((style (c-guess-make-style c-guess-guessed-basic-offset
432 c-guess-guessed-offsets-alist)))
433 (if style
434 (let ((style-name (or (if (equal style-name "")
435 nil
436 style-name)
437 (c-guess-style-name))))
438 (c-add-style style-name style t)
439 (message "Style \"%s\" is installed" style-name))
440 (error "Not yet guessed"))))
441
442(defun c-guess-dump-accumulator ()
443 "Show `c-guess-accumulator'."
444 (interactive)
445 (with-output-to-temp-buffer "*Accumulated Examined Indent Information*"
446 (pp c-guess-accumulator)))
447
448(defun c-guess-reset-accumulator ()
449 "Reset `c-guess-accumulator'."
450 (interactive)
451 (setq c-guess-accumulator nil))
452
453(defun c-guess-dump-guessed-values ()
454 "Show `c-guess-guessed-basic-offset' and `c-guess-guessed-offsets-alist'."
455 (interactive)
456 (with-output-to-temp-buffer "*Guessed Values*"
457 (princ "basic-offset: \n\t")
458 (pp c-guess-guessed-basic-offset)
459 (princ "\n\n")
460 (princ "offsets-alist: \n")
461 (pp c-guess-guessed-offsets-alist)
462 ))
463
464(defun c-guess-dump-guessed-style (&optional printer)
465 "Show the guessed style.
466`pp' is used to print the style but if PRINTER is given,
467PRINTER is used instead. If PRINTER is not `nil', it
468is called with one argument, the guessed style."
469 (interactive)
470 (let ((style (c-guess-make-style c-guess-guessed-basic-offset
471 c-guess-guessed-offsets-alist)))
472 (if style
473 (with-output-to-temp-buffer "*Guessed Style*"
474 (funcall (if printer printer 'pp) style))
475 (error "Not yet guessed"))))
476
477(defun c-guess-guessed-syntactic-symbols ()
478 ;; Return syntactic symbols in c-guess-guessed-offsets-alist
479 ;; but not in c-guess-conversions.
480 (let ((alist c-guess-guessed-offsets-alist)
481 elt
482 (symbols nil))
483 (while alist
484 (setq elt (car alist)
485 alist (cdr alist))
486 (unless (assq (car elt) c-guess-conversions)
487 (setq symbols (cons (car elt)
488 symbols))))
489 symbols))
490
491(defun c-guess-view-reorder-offsets-alist-in-style (style guessed-syntactic-symbols)
492 ;; Reorder the `c-offsets-alist' field of STYLE.
493 ;; If an entry in `c-offsets-alist' holds a guessed value, move it to
494 ;; front in the field. In addition alphabetical sort by entry name is done.
495 (setq style (copy-tree style))
496 (let ((offsets-alist-cell (assq 'c-offsets-alist style))
497 (guessed-syntactic-symbols (c-guess-guessed-syntactic-symbols)))
498 (setcdr offsets-alist-cell
499 (sort (cdr offsets-alist-cell)
500 (lambda (a b)
501 (let ((a-guessed? (memq (car a) guessed-syntactic-symbols))
502 (b-guessed? (memq (car b) guessed-syntactic-symbols)))
503 (cond
504 ((or (and a-guessed? b-guessed?)
505 (not (or a-guessed? b-guessed?)))
506 (string-lessp (symbol-name (car a))
507 (symbol-name (car b))))
508 (a-guessed? t)
509 (b-guessed? nil)))))))
510 style)
511
512(defun c-guess-view-mark-guessed-entries (guessed-syntactic-symbols)
513 ;; Put " ; Guess value" markers on all entries which hold
514 ;; guessed values.
515 ;; `c-basic-offset' is always considered as holding a guessed value.
516 (let ((needs-markers (cons 'c-basic-offset
517 guessed-syntactic-symbols)))
518 (while needs-markers
519 (goto-char (point-min))
520 (when (search-forward (concat "("
521 (symbol-name (car needs-markers))
522 " ") nil t)
523 (move-end-of-line 1)
524 (comment-dwim nil)
525 (insert " Guessed value"))
526 (setq needs-markers
527 (cdr needs-markers)))))
528
529(defun c-guess-view (&optional with-name)
530 "Emit emacs lisp code which defines the last guessed style.
531So you can put the code into .emacs if you prefer the
532guessed code.
533\"STYLE NAME HERE\" is used as the name for the style in the
534emitted code. If WITH-NAME is given, it is used instead.
535WITH-NAME is expected as a string but if this function
536called interactively with prefix argument, the value for
537WITH-NAME is asked to the user."
538 (interactive "P")
539 (let* ((temporary-style-name (cond
540 ((stringp with-name) with-name)
541 (with-name (read-from-minibuffer
542 "New style name: "))
543 (t
544 "STYLE NAME HERE")))
545 (guessed-style-name (c-guess-style-name))
546 (current-style-name c-indentation-style)
547 (parent-style-name (if (string-equal guessed-style-name
548 current-style-name)
549 ;; The guessed style is already installed.
550 ;; It cannot be used as the parent style.
551 ;; Use the default style for the current
552 ;; major mode as the parent style.
553 (cc-choose-style-for-mode
554 major-mode
555 c-default-style)
556 ;; The guessed style is not installed yet.
557 current-style-name)))
558 (c-guess-dump-guessed-style
559 (lambda (style)
560 (let ((guessed-syntactic-symbols (c-guess-guessed-syntactic-symbols)))
561 (pp `(c-add-style ,temporary-style-name
562 ',(cons parent-style-name
563 (c-guess-view-reorder-offsets-alist-in-style
564 style
565 guessed-syntactic-symbols))))
566 (with-current-buffer standard-output
567 (lisp-interaction-mode)
568 (c-guess-view-mark-guessed-entries
569 guessed-syntactic-symbols)
570 (buffer-enable-undo)))))))
571
572
573(cc-provide 'cc-guess)
574;;; cc-guess.el ends here
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 86a963bcf55..a6459e1724f 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -295,6 +295,19 @@ the evaluated constant value at compile time."
295 ["Backslashify" c-backslash-region 295 ["Backslashify" c-backslash-region
296 (c-fn-region-is-active-p)])) 296 (c-fn-region-is-active-p)]))
297 "----" 297 "----"
298 ("Style..."
299 ["Set Style..." c-set-style t]
300 ["Show Current Style Name" (message
301 "Style Name: %s"
302 c-indentation-style) t]
303 ["Guess Style from this Buffer" c-guess-buffer-no-install t]
304 ["Install the Last Guessed Style..." c-guess-install
305 (and c-guess-guessed-offsets-alist
306 c-guess-guessed-basic-offset) ]
307 ["View the Last Guessed Style" c-guess-view
308 (and c-guess-guessed-offsets-alist
309 c-guess-guessed-basic-offset) ])
310 "----"
298 ("Toggle..." 311 ("Toggle..."
299 ["Syntactic indentation" c-toggle-syntactic-indentation 312 ["Syntactic indentation" c-toggle-syntactic-indentation
300 :style toggle :selected c-syntactic-indentation] 313 :style toggle :selected c-syntactic-indentation]
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 3a5a643a2a8..1adc6c2eac0 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -93,6 +93,7 @@
93(cc-require 'cc-cmds) 93(cc-require 'cc-cmds)
94(cc-require 'cc-align) 94(cc-require 'cc-align)
95(cc-require 'cc-menus) 95(cc-require 'cc-menus)
96(cc-require 'cc-guess)
96 97
97;; Silence the compiler. 98;; Silence the compiler.
98(cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs 99(cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs
@@ -553,11 +554,7 @@ that requires a literal mode spec at compile time."
553 (c-clear-found-types) 554 (c-clear-found-types)
554 555
555 ;; now set the mode style based on default-style 556 ;; now set the mode style based on default-style
556 (let ((style (if (stringp default-style) 557 (let ((style (cc-choose-style-for-mode mode default-style)))
557 default-style
558 (or (cdr (assq mode default-style))
559 (cdr (assq 'other default-style))
560 "gnu"))))
561 ;; Override style variables if `c-old-style-variable-behavior' is 558 ;; Override style variables if `c-old-style-variable-behavior' is
562 ;; set. Also override if we are using global style variables, 559 ;; set. Also override if we are using global style variables,
563 ;; have already initialized a style once, and are switching to a 560 ;; have already initialized a style once, and are switching to a
@@ -692,7 +689,8 @@ This function is called from the hook `before-hack-local-variables-hook'."
692 (c-count-cfss file-local-variables-alist)) 689 (c-count-cfss file-local-variables-alist))
693 (cfs-in-dir-count (c-count-cfss dir-local-variables-alist))) 690 (cfs-in-dir-count (c-count-cfss dir-local-variables-alist)))
694 (c-set-style stile 691 (c-set-style stile
695 (= cfs-in-file-and-dir-count cfs-in-dir-count))) 692 (and (= cfs-in-file-and-dir-count cfs-in-dir-count)
693 'keep-defaults)))
696 (c-set-style stile))) 694 (c-set-style stile)))
697 (when offsets 695 (when offsets
698 (mapc 696 (mapc
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el
index e161eb6d0f5..96cb15f2a72 100644
--- a/lisp/progmodes/cc-styles.el
+++ b/lisp/progmodes/cc-styles.el
@@ -650,6 +650,15 @@ any reason to call this function directly."
650 (setq c-style-variables-are-local-p t)) 650 (setq c-style-variables-are-local-p t))
651 )) 651 ))
652 652
653(defun cc-choose-style-for-mode (mode default-style)
654 "Return suitable style for MODE from DEFAULT-STYLE.
655DEFAULT-STYLE has the same format as `c-default-style'."
656 (if (stringp default-style)
657 default-style
658 (or (cdr (assq mode default-style))
659 (cdr (assq 'other default-style))
660 "gnu")))
661
653 662
654 663
655(cc-provide 'cc-styles) 664(cc-provide 'cc-styles)
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index d2a5d117635..58dc1737c5a 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1633,8 +1633,7 @@ as designated in the variable `c-file-style'.")
1633;; It isn't possible to specify a doc-string without specifying an 1633;; It isn't possible to specify a doc-string without specifying an
1634;; initial value with `defvar', so the following two variables have been 1634;; initial value with `defvar', so the following two variables have been
1635;; given doc-strings by setting the property `variable-documentation' 1635;; given doc-strings by setting the property `variable-documentation'
1636;; directly. C-h v will read this documentation only for versions of GNU 1636;; directly. It's really good not to have an initial value for
1637;; Emacs from 22.1. It's really good not to have an initial value for
1638;; variables like these that always should be dynamically bound, so it's 1637;; variables like these that always should be dynamically bound, so it's
1639;; worth the inconvenience. 1638;; worth the inconvenience.
1640 1639
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 22ece17cb28..7989c60f80c 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -3,6 +3,7 @@
3;; Copyright (C) 2001-2011 Free Software Foundation, Inc. 3;; Copyright (C) 2001-2011 Free Software Foundation, Inc.
4 4
5;; Author: Dave Love <fx@gnu.org> 5;; Author: Dave Love <fx@gnu.org>
6;; Maintainer: Ted Zlatanov <tzz@lifelogs.com>
6;; Keywords: languages 7;; Keywords: languages
7 8
8;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
@@ -28,6 +29,13 @@
28;; Possible customization for auto-mode selection: 29;; Possible customization for auto-mode selection:
29;; (push '(("^cfagent.conf\\'" . cfengine-mode)) auto-mode-alist) 30;; (push '(("^cfagent.conf\\'" . cfengine-mode)) auto-mode-alist)
30;; (push '(("^cf\\." . cfengine-mode)) auto-mode-alist) 31;; (push '(("^cf\\." . cfengine-mode)) auto-mode-alist)
32;; (push '(("\\.cf\\'" . cfengine-mode)) auto-mode-alist)
33
34;; Or, if you want to use the CFEngine 3.x support:
35
36;; (push '(("^cfagent.conf\\'" . cfengine3-mode)) auto-mode-alist)
37;; (push '(("^cf\\." . cfengine3-mode)) auto-mode-alist)
38;; (push '(("\\.cf\\'" . cfengine3-mode)) auto-mode-alist)
31 39
32;; This is not the same as the mode written by Rolf Ebert 40;; This is not the same as the mode written by Rolf Ebert
33;; <ebert@waporo.muc.de>, distributed with cfengine-2.0.5. It does 41;; <ebert@waporo.muc.de>, distributed with cfengine-2.0.5. It does
@@ -63,7 +71,27 @@
63 ;; cfservd 71 ;; cfservd
64 "admit" "grant" "deny") 72 "admit" "grant" "deny")
65 "List of the action keywords supported by Cfengine. 73 "List of the action keywords supported by Cfengine.
66This includes those for cfservd as well as cfagent.")) 74This includes those for cfservd as well as cfagent.")
75
76 (defconst cfengine3-defuns
77 (mapcar
78 'symbol-name
79 '(bundle body))
80 "List of the CFEngine 3.x defun headings.")
81
82 (defconst cfengine3-defuns-regex
83 (regexp-opt cfengine3-defuns t)
84 "Regex to match the CFEngine 3.x defuns.")
85
86 (defconst cfengine3-class-selector-regex "\\([[:alnum:]_().&|!]+\\)::")
87
88 (defconst cfengine3-category-regex "\\([[:alnum:]_]+\\):")
89
90 (defconst cfengine3-vartypes
91 (mapcar
92 'symbol-name
93 '(string int real slist ilist rlist irange rrange counter))
94 "List of the CFEngine 3.x variable types."))
67 95
68(defvar cfengine-font-lock-keywords 96(defvar cfengine-font-lock-keywords
69 `(;; Actions. 97 `(;; Actions.
@@ -82,6 +110,31 @@ This includes those for cfservd as well as cfagent."))
82 ;; File, acl &c in group: { token ... } 110 ;; File, acl &c in group: { token ... }
83 ("{[ \t]*\\([^ \t\n]+\\)" 1 font-lock-constant-face))) 111 ("{[ \t]*\\([^ \t\n]+\\)" 1 font-lock-constant-face)))
84 112
113(defvar cfengine3-font-lock-keywords
114 `(
115 (,(concat "^[ \t]*" cfengine3-class-selector-regex)
116 1 font-lock-keyword-face)
117 (,(concat "^[ \t]*" cfengine3-category-regex)
118 1 font-lock-builtin-face)
119 ;; Variables, including scope, e.g. module.var
120 ("[@$](\\([[:alnum:]_.]+\\))" 1 font-lock-variable-name-face)
121 ("[@$]{\\([[:alnum:]_.]+\\)}" 1 font-lock-variable-name-face)
122 ;; Variable definitions.
123 ("\\<\\([[:alnum:]_]+\\)[ \t]*=[ \t]*(" 1 font-lock-variable-name-face)
124
125 ;; CFEngine 3.x faces
126 ;; defuns
127 (,(concat "\\<" cfengine3-defuns-regex "\\>"
128 "[ \t]+\\<\\([[:alnum:]_]+\\)\\>"
129 "[ \t]+\\<\\([[:alnum:]_]+\\)\\((\\([^)]*\\))\\)?")
130 (1 font-lock-builtin-face)
131 (2 font-lock-constant-name-face)
132 (3 font-lock-function-name-face)
133 (5 font-lock-variable-name-face))
134 ;; variable types
135 (,(concat "\\<" (eval-when-compile (regexp-opt cfengine3-vartypes t)) "\\>")
136 1 font-lock-type-face)))
137
85(defvar cfengine-imenu-expression 138(defvar cfengine-imenu-expression
86 `((nil ,(concat "^[ \t]*" (eval-when-compile 139 `((nil ,(concat "^[ \t]*" (eval-when-compile
87 (regexp-opt cfengine-actions t)) 140 (regexp-opt cfengine-actions t))
@@ -197,6 +250,191 @@ Intended as the value of `indent-line-function'."
197 (fill-paragraph justify)) 250 (fill-paragraph justify))
198 t)) 251 t))
199 252
253(defun cfengine3-beginning-of-defun ()
254 "`beginning-of-defun' function for Cfengine 3 mode.
255Treats body/bundle blocks as defuns."
256 (unless (<= (current-column) (current-indentation))
257 (end-of-line))
258 (if (re-search-backward (concat "^[ \t]*" cfengine3-defuns-regex "\\>") nil t)
259 (beginning-of-line)
260 (goto-char (point-min)))
261 t)
262
263(defun cfengine3-end-of-defun ()
264 "`end-of-defun' function for Cfengine 3 mode.
265Treats body/bundle blocks as defuns."
266 (end-of-line)
267 (if (re-search-forward (concat "^[ \t]*" cfengine3-defuns-regex "\\>") nil t)
268 (beginning-of-line)
269 (goto-char (point-max)))
270 t)
271
272(defun cfengine3-indent-line ()
273 "Indent a line in Cfengine 3 mode.
274Intended as the value of `indent-line-function'."
275 (let ((pos (- (point-max) (point)))
276 parse)
277 (save-restriction
278 (narrow-to-defun)
279 (back-to-indentation)
280 (setq parse (parse-partial-sexp (point-min) (point)))
281 (message "%S" parse)
282 (cond
283 ;; body/bundle blocks start at 0
284 ((looking-at (concat cfengine3-defuns-regex "\\>"))
285 (indent-line-to 0))
286 ;; categories are indented one step
287 ((looking-at (concat cfengine3-category-regex "[ \t]*$"))
288 (indent-line-to cfengine-indent))
289 ;; class selectors are indented two steps
290 ((looking-at (concat cfengine3-class-selector-regex "[ \t]*$"))
291 (indent-line-to (* 2 cfengine-indent)))
292 ;; Outdent leading close brackets one step.
293 ((or (eq ?\} (char-after))
294 (eq ?\) (char-after)))
295 (condition-case ()
296 (indent-line-to (save-excursion
297 (forward-char)
298 (backward-sexp)
299 (current-column)))
300 (error nil)))
301 ;; inside a string and it starts before this line
302 ((and (nth 3 parse)
303 (< (nth 8 parse) (save-excursion (beginning-of-line) (point))))
304 (indent-line-to 0))
305 ;; inside a defun, but not a nested list (depth is 1)
306 ((= 1 (nth 0 parse))
307 (indent-line-to (* (+ 2 (nth 0 parse)) cfengine-indent)))
308 ;; Inside brackets/parens: indent to start column of non-comment
309 ;; token on line following open bracket or by one step from open
310 ;; bracket's column.
311 ((condition-case ()
312 (progn (indent-line-to (save-excursion
313 (backward-up-list)
314 (forward-char)
315 (skip-chars-forward " \t")
316 (cond
317 ((looking-at "[^\n#]")
318 (current-column))
319 ((looking-at "[^\n#]")
320 (current-column))
321 (t
322 (skip-chars-backward " \t")
323 (+ (current-column) -1
324 cfengine-indent)))))
325 t)
326 (error nil)))
327 ;; Else don't indent.
328 (t (indent-line-to 0))))
329 ;; If initial point was within line's indentation,
330 ;; position after the indentation. Else stay at same point in text.
331 (if (> (- (point-max) pos) (point))
332 (goto-char (- (point-max) pos)))))
333
334;; CFEngine 3.x grammar
335
336;; specification: blocks
337;; blocks: block | blocks block;
338;; block: bundle typeid blockid bundlebody
339;; | bundle typeid blockid usearglist bundlebody
340;; | body typeid blockid bodybody
341;; | body typeid blockid usearglist bodybody;
342
343;; typeid: id
344;; blockid: id
345;; usearglist: '(' aitems ')';
346;; aitems: aitem | aitem ',' aitems |;
347;; aitem: id
348
349;; bundlebody: '{' statements '}'
350;; statements: statement | statements statement;
351;; statement: category | classpromises;
352
353;; bodybody: '{' bodyattribs '}'
354;; bodyattribs: bodyattrib | bodyattribs bodyattrib;
355;; bodyattrib: class | selections;
356;; selections: selection | selections selection;
357;; selection: id ASSIGN rval ';' ;
358
359;; classpromises: classpromise | classpromises classpromise;
360;; classpromise: class | promises;
361;; promises: promise | promises promise;
362;; category: CATEGORY
363;; promise: promiser ARROW rval constraints ';' | promiser constraints ';';
364;; constraints: constraint | constraints ',' constraint |;
365;; constraint: id ASSIGN rval;
366;; class: CLASS
367;; id: ID
368;; rval: ID | QSTRING | NAKEDVAR | list | usefunction
369;; list: '{' litems '}' ;
370;; litems: litem | litem ',' litems |;
371;; litem: ID | QSTRING | NAKEDVAR | list | usefunction
372
373;; functionid: ID | NAKEDVAR
374;; promiser: QSTRING
375;; usefunction: functionid givearglist
376;; givearglist: '(' gaitems ')'
377;; gaitems: gaitem | gaitems ',' gaitem |;
378;; gaitem: ID | QSTRING | NAKEDVAR | list | usefunction
379
380;; # from lexer:
381
382;; bundle: "bundle"
383;; body: "body"
384;; COMMENT #[^\n]*
385;; NAKEDVAR [$@][(][a-zA-Z0-9_\200-\377.]+[)]|[$@][{][a-zA-Z0-9_\200-\377.]+[}]
386;; ID: [a-zA-Z0-9_\200-\377]+
387;; ASSIGN: "=>"
388;; ARROW: "->"
389;; QSTRING: \"((\\\")|[^"])*\"|\'((\\\')|[^'])*\'|`[^`]*`
390;; CLASS: [.|&!()a-zA-Z0-9_\200-\377]+::
391;; CATEGORY: [a-zA-Z_]+:
392
393(defun cfengine-common-settings ()
394 (set (make-local-variable 'syntax-propertize-function)
395 ;; In the main syntax-table, \ is marked as a punctuation, because
396 ;; of its use in DOS-style directory separators. Here we try to
397 ;; recognize the cases where \ is used as an escape inside strings.
398 (syntax-propertize-rules ("\\(\\(?:\\\\\\)+\\)\"" (1 "\\"))))
399 (set (make-local-variable 'parens-require-spaces) nil)
400 (set (make-local-variable 'comment-start) "# ")
401 (set (make-local-variable 'comment-start-skip)
402 "\\(\\(?:^\\|[^\\\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*")
403 ;; Like Lisp mode. Without this, we lose with, say,
404 ;; `backward-up-list' when there's an unbalanced quote in a
405 ;; preceding comment.
406 (set (make-local-variable 'parse-sexp-ignore-comments) t))
407
408(defun cfengine-common-syntax (table)
409 ;; the syntax defaults seem OK to give reasonable word movement
410 (modify-syntax-entry ?# "<" table)
411 (modify-syntax-entry ?\n ">#" table)
412 (modify-syntax-entry ?\" "\"" table)
413 ;; variable substitution:
414 (modify-syntax-entry ?$ "." table)
415 ;; Doze path separators:
416 (modify-syntax-entry ?\\ "." table))
417
418;;;###autoload
419(define-derived-mode cfengine3-mode prog-mode "CFEngine3"
420 "Major mode for editing cfengine input.
421There are no special keybindings by default.
422
423Action blocks are treated as defuns, i.e. \\[beginning-of-defun] moves
424to the action header."
425 (cfengine-common-settings)
426 (cfengine-common-syntax cfengine3-mode-syntax-table)
427
428 (set (make-local-variable 'indent-line-function) #'cfengine3-indent-line)
429 (setq font-lock-defaults
430 '(cfengine3-font-lock-keywords nil nil nil beginning-of-defun))
431
432 ;; use defuns as the essential syntax block
433 (set (make-local-variable 'beginning-of-defun-function)
434 #'cfengine3-beginning-of-defun)
435 (set (make-local-variable 'end-of-defun-function)
436 #'cfengine3-end-of-defun))
437
200;;;###autoload 438;;;###autoload
201(define-derived-mode cfengine-mode prog-mode "Cfengine" 439(define-derived-mode cfengine-mode prog-mode "Cfengine"
202 "Major mode for editing cfengine input. 440 "Major mode for editing cfengine input.
@@ -204,25 +442,15 @@ There are no special keybindings by default.
204 442
205Action blocks are treated as defuns, i.e. \\[beginning-of-defun] moves 443Action blocks are treated as defuns, i.e. \\[beginning-of-defun] moves
206to the action header." 444to the action header."
207 (modify-syntax-entry ?# "<" cfengine-mode-syntax-table) 445 (cfengine-common-settings)
208 (modify-syntax-entry ?\n ">#" cfengine-mode-syntax-table) 446 (cfengine-common-syntax cfengine-mode-syntax-table)
447
209 ;; Shell commands can be quoted by single, double or back quotes. 448 ;; Shell commands can be quoted by single, double or back quotes.
210 ;; It's debatable whether we should define string syntax, but it 449 ;; It's debatable whether we should define string syntax, but it
211 ;; should avoid potential confusion in some cases. 450 ;; should avoid potential confusion in some cases.
212 (modify-syntax-entry ?\" "\"" cfengine-mode-syntax-table)
213 (modify-syntax-entry ?\' "\"" cfengine-mode-syntax-table) 451 (modify-syntax-entry ?\' "\"" cfengine-mode-syntax-table)
214 (modify-syntax-entry ?\` "\"" cfengine-mode-syntax-table) 452 (modify-syntax-entry ?\` "\"" cfengine-mode-syntax-table)
215 ;; variable substitution:
216 (modify-syntax-entry ?$ "." cfengine-mode-syntax-table)
217 ;; Doze path separators:
218 (modify-syntax-entry ?\\ "." cfengine-mode-syntax-table)
219 ;; Otherwise, syntax defaults seem OK to give reasonable word
220 ;; movement.
221 453
222 (set (make-local-variable 'parens-require-spaces) nil)
223 (set (make-local-variable 'comment-start) "# ")
224 (set (make-local-variable 'comment-start-skip)
225 "\\(\\(?:^\\|[^\\\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*")
226 (set (make-local-variable 'indent-line-function) #'cfengine-indent-line) 454 (set (make-local-variable 'indent-line-function) #'cfengine-indent-line)
227 (set (make-local-variable 'outline-regexp) "[ \t]*\\(\\sw\\|\\s_\\)+:+") 455 (set (make-local-variable 'outline-regexp) "[ \t]*\\(\\sw\\|\\s_\\)+:+")
228 (set (make-local-variable 'outline-level) #'cfengine-outline-level) 456 (set (make-local-variable 'outline-level) #'cfengine-outline-level)
@@ -233,20 +461,12 @@ to the action header."
233 '(cfengine-font-lock-keywords nil nil nil beginning-of-line)) 461 '(cfengine-font-lock-keywords nil nil nil beginning-of-line))
234 ;; Fixme: set the args of functions in evaluated classes to string 462 ;; Fixme: set the args of functions in evaluated classes to string
235 ;; syntax, and then obey syntax properties. 463 ;; syntax, and then obey syntax properties.
236 (set (make-local-variable 'syntax-propertize-function)
237 ;; In the main syntax-table, \ is marked as a punctuation, because
238 ;; of its use in DOS-style directory separators. Here we try to
239 ;; recognize the cases where \ is used as an escape inside strings.
240 (syntax-propertize-rules ("\\(\\(?:\\\\\\)+\\)\"" (1 "\\"))))
241 (setq imenu-generic-expression cfengine-imenu-expression) 464 (setq imenu-generic-expression cfengine-imenu-expression)
242 (set (make-local-variable 'beginning-of-defun-function) 465 (set (make-local-variable 'beginning-of-defun-function)
243 #'cfengine-beginning-of-defun) 466 #'cfengine-beginning-of-defun)
244 (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun) 467 (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun))
245 ;; Like Lisp mode. Without this, we lose with, say,
246 ;; `backward-up-list' when there's an unbalanced quote in a
247 ;; preceding comment.
248 (set (make-local-variable 'parse-sexp-ignore-comments) t))
249 468
469(provide 'cfengine3)
250(provide 'cfengine) 470(provide 'cfengine)
251 471
252;;; cfengine.el ends here 472;;; cfengine.el ends here
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 1a23cd112af..503698f0f7b 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -253,7 +253,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
253\\(?:-\\([0-9]+\\)?\\(?:\\.\\([0-9]+\\)\\)?\\)?:\ 253\\(?:-\\([0-9]+\\)?\\(?:\\.\\([0-9]+\\)\\)?\\)?:\
254\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ 254\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
255 *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\ 255 *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\
256\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)" 256 *[Ee]rror\\|\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
257 1 (2 . 4) (3 . 5) (6 . 7)) 257 1 (2 . 4) (3 . 5) (6 . 7))
258 258
259 (lcc 259 (lcc
@@ -400,15 +400,16 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?"
400 "^# Failed test [0-9]+ in \\([^ \t\r\n]+\\) at line \\([0-9]+\\)" 400 "^# Failed test [0-9]+ in \\([^ \t\r\n]+\\) at line \\([0-9]+\\)"
401 1 2) 401 1 2)
402 (perl--Test2 402 (perl--Test2
403 ;; Or when comparing got/want values, 403 ;; Or when comparing got/want values, with a "fail #n" if repeated
404 ;; # Test 2 got: "xx" (t-compilation-perl-2.t at line 10) 404 ;; # Test 2 got: "xx" (t-compilation-perl-2.t at line 10)
405 ;; # Test 3 got: "xx" (t-compilation-perl-2.t at line 10 fail #2)
405 ;; 406 ;;
406 ;; And under Test::Harness they're preceded by progress stuff with 407 ;; And under Test::Harness they're preceded by progress stuff with
407 ;; \r and "NOK", 408 ;; \r and "NOK",
408 ;; ... NOK 1# Test 1 got: "1234" (t/foo.t at line 46) 409 ;; ... NOK 1# Test 1 got: "1234" (t/foo.t at line 46)
409 ;; 410 ;;
410 "^\\(.*NOK.*\\)?# Test [0-9]+ got:.* (\\([^ \t\r\n]+\\) at line \ 411 "^\\(.*NOK.*\\)?# Test [0-9]+ got:.* (\\([^ \t\r\n]+\\) at line \
411\\([0-9]+\\))" 412\\([0-9]+\\)\\( fail #[0-9]+\\)?)"
412 2 3) 413 2 3)
413 (perl--Test::Harness 414 (perl--Test::Harness
414 ;; perl Test::Harness output, eg. 415 ;; perl Test::Harness output, eg.
@@ -2409,9 +2410,7 @@ and overlay is highlighted between MK and END-MK."
2409 ;; display the source in another window. 2410 ;; display the source in another window.
2410 (let ((pop-up-windows t)) 2411 (let ((pop-up-windows t))
2411 (pop-to-buffer (marker-buffer mk) 'other-window)) 2412 (pop-to-buffer (marker-buffer mk) 'other-window))
2412 (if (window-dedicated-p (selected-window)) 2413 (pop-to-buffer-same-window (marker-buffer mk)))
2413 (pop-to-buffer (marker-buffer mk))
2414 (switch-to-buffer (marker-buffer mk))))
2415 (unless (eq (goto-char mk) (point)) 2414 (unless (eq (goto-char mk) (point))
2416 ;; If narrowing gets in the way of going to the right place, widen. 2415 ;; If narrowing gets in the way of going to the right place, widen.
2417 (widen) 2416 (widen)
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 48df73a678f..ad3b777977c 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -613,7 +613,7 @@ One should tune up `cperl-close-paren-offset' as well."
613(defcustom cperl-syntaxify-by-font-lock 613(defcustom cperl-syntaxify-by-font-lock
614 (and cperl-can-font-lock 614 (and cperl-can-font-lock
615 (boundp 'parse-sexp-lookup-properties)) 615 (boundp 'parse-sexp-lookup-properties))
616 "*Non-nil means that CPerl uses `font-lock's routines for syntaxification." 616 "*Non-nil means that CPerl uses the `font-lock' routines for syntaxification."
617 :type '(choice (const message) boolean) 617 :type '(choice (const message) boolean)
618 :group 'cperl-speed) 618 :group 'cperl-speed)
619 619
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 8abf298bb76..385adf1af0a 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1860,7 +1860,11 @@ nil, we exit; otherwise we scan the next file."
1860Stops when a match is found. 1860Stops when a match is found.
1861To continue searching for next match, use command \\[tags-loop-continue]. 1861To continue searching for next match, use command \\[tags-loop-continue].
1862 1862
1863See documentation of variable `tags-file-name'." 1863If `file-list-form' is non-nil, it should be a form that, when
1864evaluated, will return a list of file names. The search will be
1865restricted to these files.
1866
1867Aleso see the documentation of the `tags-file-name' variable."
1864 (interactive "sTags search (regexp): ") 1868 (interactive "sTags search (regexp): ")
1865 (if (and (equal regexp "") 1869 (if (and (equal regexp "")
1866 (eq (car tags-loop-scan) 're-search-forward) 1870 (eq (car tags-loop-scan) 're-search-forward)
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 8f617b44dae..1c138f053d3 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1339,8 +1339,12 @@ With arg, turn Flymake mode on if and only if arg is positive."
1339 1339
1340 ;; Turning the mode ON. 1340 ;; Turning the mode ON.
1341 (flymake-mode 1341 (flymake-mode
1342 (if (not (flymake-can-syntax-check-file buffer-file-name)) 1342 (cond
1343 (flymake-log 2 "flymake cannot check syntax in buffer %s" (buffer-name)) 1343 ((not buffer-file-name)
1344 (message "Flymake unable to run without a buffer file name"))
1345 ((not (flymake-can-syntax-check-file buffer-file-name))
1346 (flymake-log 2 "flymake cannot check syntax in buffer %s" (buffer-name)))
1347 (t
1344 (add-hook 'after-change-functions 'flymake-after-change-function nil t) 1348 (add-hook 'after-change-functions 'flymake-after-change-function nil t)
1345 (add-hook 'after-save-hook 'flymake-after-save-hook nil t) 1349 (add-hook 'after-save-hook 'flymake-after-save-hook nil t)
1346 (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t) 1350 (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t)
@@ -1352,7 +1356,7 @@ With arg, turn Flymake mode on if and only if arg is positive."
1352 (run-at-time nil 1 'flymake-on-timer-event (current-buffer))) 1356 (run-at-time nil 1 'flymake-on-timer-event (current-buffer)))
1353 1357
1354 (when flymake-start-syntax-check-on-find-file 1358 (when flymake-start-syntax-check-on-find-file
1355 (flymake-start-syntax-check)))) 1359 (flymake-start-syntax-check)))))
1356 1360
1357 ;; Turning the mode OFF. 1361 ;; Turning the mode OFF.
1358 (t 1362 (t
@@ -1406,6 +1410,7 @@ With arg, turn Flymake mode on if and only if arg is positive."
1406 (cancel-timer flymake-timer) 1410 (cancel-timer flymake-timer)
1407 (setq flymake-timer nil))) 1411 (setq flymake-timer nil)))
1408 1412
1413;;;###autoload
1409(defun flymake-find-file-hook () 1414(defun flymake-find-file-hook ()
1410 ;;+(when flymake-start-syntax-check-on-find-file 1415 ;;+(when flymake-start-syntax-check-on-find-file
1411 ;;+ (flymake-log 3 "starting syntax check on file open") 1416 ;;+ (flymake-log 3 "starting syntax check on file open")
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 61055ef4342..87209a78ffb 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -104,7 +104,8 @@
104(require 'bindat) 104(require 'bindat)
105(eval-when-compile (require 'cl)) 105(eval-when-compile (require 'cl))
106 106
107(declare-function speedbar-change-initial-expansion-list "speedbar" (new-default)) 107(declare-function speedbar-change-initial-expansion-list
108 "speedbar" (new-default))
108(declare-function speedbar-timer-fn "speedbar" ()) 109(declare-function speedbar-timer-fn "speedbar" ())
109(declare-function speedbar-line-text "speedbar" (&optional p)) 110(declare-function speedbar-line-text "speedbar" (&optional p))
110(declare-function speedbar-change-expand-button-char "speedbar" (char)) 111(declare-function speedbar-change-expand-button-char "speedbar" (char))
@@ -190,7 +191,8 @@ as returned from \"-break-list\" by `gdb-json-partial-output'
190(defvar gdb-current-language nil) 191(defvar gdb-current-language nil)
191(defvar gdb-var-list nil 192(defvar gdb-var-list nil
192 "List of variables in watch window. 193 "List of variables in watch window.
193Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS HAS_MORE FP) 194Each element has the form
195 (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS HAS_MORE FP)
194where STATUS is nil (`unchanged'), `changed' or `out-of-scope', FP the frame 196where STATUS is nil (`unchanged'), `changed' or `out-of-scope', FP the frame
195address for root variables.") 197address for root variables.")
196(defvar gdb-main-file nil "Source file from which program execution begins.") 198(defvar gdb-main-file nil "Source file from which program execution begins.")
@@ -329,7 +331,7 @@ valid signal handlers.")
329 "Maximum size of `gdb-debug-log'. If nil, size is unlimited." 331 "Maximum size of `gdb-debug-log'. If nil, size is unlimited."
330 :group 'gdb 332 :group 'gdb
331 :type '(choice (integer :tag "Number of elements") 333 :type '(choice (integer :tag "Number of elements")
332 (const :tag "Unlimited" nil)) 334 (const :tag "Unlimited" nil))
333 :version "22.1") 335 :version "22.1")
334 336
335(defcustom gdb-non-stop-setting t 337(defcustom gdb-non-stop-setting t
@@ -367,13 +369,18 @@ Emacs always switches to the thread which caused the stop."
367 (set :tag "Selection of reasons..." 369 (set :tag "Selection of reasons..."
368 (const :tag "A breakpoint was reached." "breakpoint-hit") 370 (const :tag "A breakpoint was reached." "breakpoint-hit")
369 (const :tag "A watchpoint was triggered." "watchpoint-trigger") 371 (const :tag "A watchpoint was triggered." "watchpoint-trigger")
370 (const :tag "A read watchpoint was triggered." "read-watchpoint-trigger") 372 (const :tag "A read watchpoint was triggered."
371 (const :tag "An access watchpoint was triggered." "access-watchpoint-trigger") 373 "read-watchpoint-trigger")
374 (const :tag "An access watchpoint was triggered."
375 "access-watchpoint-trigger")
372 (const :tag "Function finished execution." "function-finished") 376 (const :tag "Function finished execution." "function-finished")
373 (const :tag "Location reached." "location-reached") 377 (const :tag "Location reached." "location-reached")
374 (const :tag "Watchpoint has gone out of scope" "watchpoint-scope") 378 (const :tag "Watchpoint has gone out of scope"
375 (const :tag "End of stepping range reached." "end-stepping-range") 379 "watchpoint-scope")
376 (const :tag "Signal received (like interruption)." "signal-received")) 380 (const :tag "End of stepping range reached."
381 "end-stepping-range")
382 (const :tag "Signal received (like interruption)."
383 "signal-received"))
377 (const :tag "None" nil)) 384 (const :tag "None" nil))
378 :group 'gdb-non-stop 385 :group 'gdb-non-stop
379 :version "23.2" 386 :version "23.2"
@@ -488,17 +495,17 @@ predefined macros."
488 :group 'gdb 495 :group 'gdb
489 :version "22.1") 496 :version "22.1")
490 497
491 (defcustom gdb-create-source-file-list t 498(defcustom gdb-create-source-file-list t
492 "Non-nil means create a list of files from which the executable was built. 499 "Non-nil means create a list of files from which the executable was built.
493 Set this to nil if the GUD buffer displays \"initializing...\" in the mode 500 Set this to nil if the GUD buffer displays \"initializing...\" in the mode
494 line for a long time when starting, possibly because your executable was 501 line for a long time when starting, possibly because your executable was
495 built from a large number of files. This allows quicker initialization 502 built from a large number of files. This allows quicker initialization
496 but means that these files are not automatically enabled for debugging, 503 but means that these files are not automatically enabled for debugging,
497 e.g., you won't be able to click in the fringe to set a breakpoint until 504 e.g., you won't be able to click in the fringe to set a breakpoint until
498 execution has already stopped there." 505 execution has already stopped there."
499 :type 'boolean 506 :type 'boolean
500 :group 'gdb 507 :group 'gdb
501 :version "23.1") 508 :version "23.1")
502 509
503(defcustom gdb-show-main nil 510(defcustom gdb-show-main nil
504 "Non-nil means display source file containing the main routine at startup. 511 "Non-nil means display source file containing the main routine at startup.
@@ -644,12 +651,12 @@ detailed description of this mode.
644 (interactive (list (gud-query-cmdline 'gdb))) 651 (interactive (list (gud-query-cmdline 'gdb)))
645 652
646 (when (and gud-comint-buffer 653 (when (and gud-comint-buffer
647 (buffer-name gud-comint-buffer) 654 (buffer-name gud-comint-buffer)
648 (get-buffer-process gud-comint-buffer) 655 (get-buffer-process gud-comint-buffer)
649 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))) 656 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
650 (gdb-restore-windows) 657 (gdb-restore-windows)
651 (error 658 (error
652 "Multiple debugging requires restarting in text command mode")) 659 "Multiple debugging requires restarting in text command mode"))
653 ;; 660 ;;
654 (gud-common-init command-line nil 'gud-gdbmi-marker-filter) 661 (gud-common-init command-line nil 'gud-gdbmi-marker-filter)
655 (set (make-local-variable 'gud-minor-mode) 'gdbmi) 662 (set (make-local-variable 'gud-minor-mode) 'gdbmi)
@@ -663,7 +670,7 @@ detailed description of this mode.
663 (hsize (getenv "HISTSIZE"))) 670 (hsize (getenv "HISTSIZE")))
664 (dolist (file (append '("~/.gdbinit") 671 (dolist (file (append '("~/.gdbinit")
665 (unless (string-equal (expand-file-name ".") 672 (unless (string-equal (expand-file-name ".")
666 (expand-file-name "~")) 673 (expand-file-name "~"))
667 '(".gdbinit")))) 674 '(".gdbinit"))))
668 (if (file-readable-p (setq file (expand-file-name file))) 675 (if (file-readable-p (setq file (expand-file-name file)))
669 (with-temp-buffer 676 (with-temp-buffer
@@ -763,7 +770,7 @@ detailed description of this mode.
763 'gdb-mouse-set-clear-breakpoint) 770 'gdb-mouse-set-clear-breakpoint)
764 (define-key gud-minor-mode-map [left-fringe mouse-1] 771 (define-key gud-minor-mode-map [left-fringe mouse-1]
765 'gdb-mouse-set-clear-breakpoint) 772 'gdb-mouse-set-clear-breakpoint)
766 (define-key gud-minor-mode-map [left-margin C-mouse-1] 773 (define-key gud-minor-mode-map [left-margin C-mouse-1]
767 'gdb-mouse-toggle-breakpoint-margin) 774 'gdb-mouse-toggle-breakpoint-margin)
768 (define-key gud-minor-mode-map [left-fringe C-mouse-1] 775 (define-key gud-minor-mode-map [left-fringe C-mouse-1]
769 'gdb-mouse-toggle-breakpoint-fringe) 776 'gdb-mouse-toggle-breakpoint-fringe)
@@ -786,7 +793,10 @@ detailed description of this mode.
786 (define-key gud-minor-mode-map [left-margin C-mouse-3] 793 (define-key gud-minor-mode-map [left-margin C-mouse-3]
787 'gdb-mouse-jump) 794 'gdb-mouse-jump)
788 795
789 (local-set-key "\C-i" 'gud-gdb-complete-command) 796 (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
797 nil 'local)
798 (local-set-key "\C-i" 'completion-at-point)
799
790 (setq gdb-first-prompt t) 800 (setq gdb-first-prompt t)
791 (setq gud-running nil) 801 (setq gud-running nil)
792 802
@@ -846,11 +856,11 @@ detailed description of this mode.
846 856
847 ;; find source file and compilation directory here 857 ;; find source file and compilation directory here
848 (gdb-input 858 (gdb-input
849 ; Needs GDB 6.2 onwards. 859 ; Needs GDB 6.2 onwards.
850 (list "-file-list-exec-source-files" 'gdb-get-source-file-list)) 860 (list "-file-list-exec-source-files" 'gdb-get-source-file-list))
851 (if gdb-create-source-file-list 861 (if gdb-create-source-file-list
852 (gdb-input 862 (gdb-input
853 ; Needs GDB 6.0 onwards. 863 ; Needs GDB 6.0 onwards.
854 (list "-file-list-exec-source-file" 'gdb-get-source-file))) 864 (list "-file-list-exec-source-file" 'gdb-get-source-file)))
855 (gdb-input 865 (gdb-input
856 (list "-gdb-show prompt" 'gdb-get-prompt))) 866 (list "-gdb-show prompt" 'gdb-get-prompt)))
@@ -859,7 +869,8 @@ detailed description of this mode.
859 (goto-char (point-min)) 869 (goto-char (point-min))
860 (if (re-search-forward "No symbol" nil t) 870 (if (re-search-forward "No symbol" nil t)
861 (progn 871 (progn
862 (message "This version of GDB doesn't support non-stop mode. Turning it off.") 872 (message
873 "This version of GDB doesn't support non-stop mode. Turning it off.")
863 (setq gdb-non-stop nil) 874 (setq gdb-non-stop nil)
864 (setq gdb-version "pre-7.0")) 875 (setq gdb-version "pre-7.0"))
865 (setq gdb-version "7.0+") 876 (setq gdb-version "7.0+")
@@ -882,8 +893,8 @@ detailed description of this mode.
882 (list t nil) nil "-c" 893 (list t nil) nil "-c"
883 (concat gdb-cpp-define-alist-program " " 894 (concat gdb-cpp-define-alist-program " "
884 gdb-cpp-define-alist-flags)))))) 895 gdb-cpp-define-alist-flags))))))
885 (define-list (split-string output "\n" t)) 896 (define-list (split-string output "\n" t))
886 (name)) 897 (name))
887 (setq gdb-define-alist nil) 898 (setq gdb-define-alist nil)
888 (dolist (define define-list) 899 (dolist (define define-list)
889 (setq name (nth 1 (split-string define "[( ]"))) 900 (setq name (nth 1 (split-string define "[( ]")))
@@ -893,13 +904,13 @@ detailed description of this mode.
893(defvar tooltip-use-echo-area) 904(defvar tooltip-use-echo-area)
894 905
895(defun gdb-tooltip-print (expr) 906(defun gdb-tooltip-print (expr)
896 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) 907 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
897 (goto-char (point-min)) 908 (goto-char (point-min))
898 (if (re-search-forward ".*value=\\(\".*\"\\)" nil t) 909 (if (re-search-forward ".*value=\\(\".*\"\\)" nil t)
899 (tooltip-show 910 (tooltip-show
900 (concat expr " = " (read (match-string 1))) 911 (concat expr " = " (read (match-string 1)))
901 (or gud-tooltip-echo-area tooltip-use-echo-area 912 (or gud-tooltip-echo-area tooltip-use-echo-area
902 (not (display-graphic-p))))))) 913 (not (display-graphic-p)))))))
903 914
904;; If expr is a macro for a function don't print because of possible dangerous 915;; If expr is a macro for a function don't print because of possible dangerous
905;; side-effects. Also printing a function within a tooltip generates an 916;; side-effects. Also printing a function within a tooltip generates an
@@ -923,13 +934,13 @@ detailed description of this mode.
923 934
924(defmacro gdb-if-arrow (arrow-position &rest body) 935(defmacro gdb-if-arrow (arrow-position &rest body)
925 `(if ,arrow-position 936 `(if ,arrow-position
926 (let ((buffer (marker-buffer ,arrow-position)) (line)) 937 (let ((buffer (marker-buffer ,arrow-position)) (line))
927 (if (equal buffer (window-buffer (posn-window end))) 938 (if (equal buffer (window-buffer (posn-window end)))
928 (with-current-buffer buffer 939 (with-current-buffer buffer
929 (when (or (equal start end) 940 (when (or (equal start end)
930 (equal (posn-point start) 941 (equal (posn-point start)
931 (marker-position ,arrow-position))) 942 (marker-position ,arrow-position)))
932 ,@body)))))) 943 ,@body))))))
933 944
934(defun gdb-mouse-until (event) 945(defun gdb-mouse-until (event)
935 "Continue running until a source line past the current line. 946 "Continue running until a source line past the current line.
@@ -1060,7 +1071,7 @@ With arg, enter name of variable to be watched in the minibuffer."
1060 (bindat-get-field result 'value) 1071 (bindat-get-field result 'value)
1061 nil 1072 nil
1062 (bindat-get-field result 'has_more) 1073 (bindat-get-field result 'has_more)
1063 gdb-frame-address))) 1074 gdb-frame-address)))
1064 (push var gdb-var-list) 1075 (push var gdb-var-list)
1065 (speedbar 1) 1076 (speedbar 1)
1066 (unless (string-equal 1077 (unless (string-equal
@@ -1091,20 +1102,20 @@ With arg, enter name of variable to be watched in the minibuffer."
1091 (setcar (nthcdr 4 var) (read (match-string 1))))) 1102 (setcar (nthcdr 4 var) (read (match-string 1)))))
1092 (gdb-speedbar-update)) 1103 (gdb-speedbar-update))
1093 1104
1094; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. 1105 ; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards.
1095(defun gdb-var-list-children (varnum) 1106(defun gdb-var-list-children (varnum)
1096 (gdb-input 1107 (gdb-input
1097 (list (concat "-var-update " varnum) 'ignore)) 1108 (list (concat "-var-update " varnum) 'ignore))
1098 (gdb-input 1109 (gdb-input
1099 (list (concat "-var-list-children --all-values " 1110 (list (concat "-var-list-children --all-values "
1100 varnum) 1111 varnum)
1101 `(lambda () (gdb-var-list-children-handler ,varnum))))) 1112 `(lambda () (gdb-var-list-children-handler ,varnum)))))
1102 1113
1103(defun gdb-var-list-children-handler (varnum) 1114(defun gdb-var-list-children-handler (varnum)
1104 (let* ((var-list nil) 1115 (let* ((var-list nil)
1105 (output (bindat-get-field (gdb-json-partial-output "child"))) 1116 (output (bindat-get-field (gdb-json-partial-output "child")))
1106 (children (bindat-get-field output 'children))) 1117 (children (bindat-get-field output 'children)))
1107 (catch 'child-already-watched 1118 (catch 'child-already-watched
1108 (dolist (var gdb-var-list) 1119 (dolist (var gdb-var-list)
1109 (if (string-equal varnum (car var)) 1120 (if (string-equal varnum (car var))
1110 (progn 1121 (progn
@@ -1147,11 +1158,11 @@ With arg, enter name of variable to be watched in the minibuffer."
1147 (interactive) 1158 (interactive)
1148 (let ((text (speedbar-line-text))) 1159 (let ((text (speedbar-line-text)))
1149 (string-match "\\(\\S-+\\)" text) 1160 (string-match "\\(\\S-+\\)" text)
1150 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) 1161 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
1151 (varnum (car var))) 1162 (varnum (car var)))
1152 (if (string-match "\\." (car var)) 1163 (if (string-match "\\." (car var))
1153 (message-box "Can only delete a root expression") 1164 (message-box "Can only delete a root expression")
1154 (gdb-var-delete-1 var varnum))))) 1165 (gdb-var-delete-1 var varnum)))))
1155 1166
1156(defun gdb-var-delete-children (varnum) 1167(defun gdb-var-delete-children (varnum)
1157 "Delete children of variable object at point from the speedbar." 1168 "Delete children of variable object at point from the speedbar."
@@ -1174,7 +1185,7 @@ With arg, enter name of variable to be watched in the minibuffer."
1174 (if (re-search-forward gdb-error-regexp nil t) 1185 (if (re-search-forward gdb-error-regexp nil t)
1175 (message-box "Invalid number or expression (%s)" value))) 1186 (message-box "Invalid number or expression (%s)" value)))
1176 1187
1177; Uses "-var-update --all-values". Needs GDB 6.4 onwards. 1188 ; Uses "-var-update --all-values". Needs GDB 6.4 onwards.
1178(defun gdb-var-update () 1189(defun gdb-var-update ()
1179 (if (not (gdb-pending-p 'gdb-var-update)) 1190 (if (not (gdb-pending-p 'gdb-var-update))
1180 (gdb-input 1191 (gdb-input
@@ -1210,38 +1221,38 @@ With arg, enter name of variable to be watched in the minibuffer."
1210 (gdb-var-delete-1 var varnum))))) 1221 (gdb-var-delete-1 var varnum)))))
1211 (let ((var-list nil) var1 1222 (let ((var-list nil) var1
1212 (children (bindat-get-field change 'new_children))) 1223 (children (bindat-get-field change 'new_children)))
1213 (if new-num 1224 (when new-num
1214 (progn 1225 (setq var1 (pop temp-var-list))
1215 (setq var1 (pop temp-var-list)) 1226 (while var1
1216 (while var1 1227 (if (string-equal varnum (car var1))
1217 (if (string-equal varnum (car var1)) 1228 (let ((new (string-to-number new-num))
1218 (let ((new (string-to-number new-num)) 1229 (previous (string-to-number (nth 2 var1))))
1219 (previous (string-to-number (nth 2 var1)))) 1230 (setcar (nthcdr 2 var1) new-num)
1220 (setcar (nthcdr 2 var1) new-num) 1231 (push var1 var-list)
1221 (push var1 var-list) 1232 (cond
1222 (cond ((> new previous) 1233 ((> new previous)
1223 ;; Add new children to list. 1234 ;; Add new children to list.
1224 (dotimes (dummy previous) 1235 (dotimes (dummy previous)
1225 (push (pop temp-var-list) var-list)) 1236 (push (pop temp-var-list) var-list))
1226 (dolist (child children) 1237 (dolist (child children)
1227 (let ((varchild 1238 (let ((varchild
1228 (list (bindat-get-field child 'name) 1239 (list (bindat-get-field child 'name)
1229 (bindat-get-field child 'exp) 1240 (bindat-get-field child 'exp)
1230 (bindat-get-field child 'numchild) 1241 (bindat-get-field child 'numchild)
1231 (bindat-get-field child 'type) 1242 (bindat-get-field child 'type)
1232 (bindat-get-field child 'value) 1243 (bindat-get-field child 'value)
1233 'changed 1244 'changed
1234 (bindat-get-field child 'has_more)))) 1245 (bindat-get-field child 'has_more))))
1235 (push varchild var-list)))) 1246 (push varchild var-list))))
1236 ;; Remove deleted children from list. 1247 ;; Remove deleted children from list.
1237 ((< new previous) 1248 ((< new previous)
1238 (dotimes (dummy new) 1249 (dotimes (dummy new)
1239 (push (pop temp-var-list) var-list)) 1250 (push (pop temp-var-list) var-list))
1240 (dotimes (dummy (- previous new)) 1251 (dotimes (dummy (- previous new))
1241 (pop temp-var-list))))) 1252 (pop temp-var-list)))))
1242 (push var1 var-list)) 1253 (push var1 var-list))
1243 (setq var1 (pop temp-var-list))) 1254 (setq var1 (pop temp-var-list)))
1244 (setq gdb-var-list (nreverse var-list))))))))) 1255 (setq gdb-var-list (nreverse var-list))))))))
1245 (setq gdb-pending-triggers 1256 (setq gdb-pending-triggers
1246 (delq 'gdb-var-update gdb-pending-triggers)) 1257 (delq 'gdb-var-update gdb-pending-triggers))
1247 (gdb-speedbar-update)) 1258 (gdb-speedbar-update))
@@ -1369,7 +1380,8 @@ this trigger is subscribed to `gdb-buf-publisher' and called with
1369 (when trigger 1380 (when trigger
1370 (gdb-add-subscriber gdb-buf-publisher 1381 (gdb-add-subscriber gdb-buf-publisher
1371 (cons (current-buffer) 1382 (cons (current-buffer)
1372 (gdb-bind-function-to-buffer trigger (current-buffer)))) 1383 (gdb-bind-function-to-buffer
1384 trigger (current-buffer))))
1373 (funcall trigger 'start)) 1385 (funcall trigger 'start))
1374 (current-buffer)))))) 1386 (current-buffer))))))
1375 1387
@@ -1783,8 +1795,8 @@ is running."
1783;; visited breakpoint is, use that window. 1795;; visited breakpoint is, use that window.
1784(defun gdb-display-source-buffer (buffer) 1796(defun gdb-display-source-buffer (buffer)
1785 (let* ((last-window (if gud-last-last-frame 1797 (let* ((last-window (if gud-last-last-frame
1786 (get-buffer-window 1798 (get-buffer-window
1787 (gud-find-file (car gud-last-last-frame))))) 1799 (gud-find-file (car gud-last-last-frame)))))
1788 (source-window (or last-window 1800 (source-window (or last-window
1789 (if (and gdb-source-window 1801 (if (and gdb-source-window
1790 (window-live-p gdb-source-window)) 1802 (window-live-p gdb-source-window))
@@ -1857,7 +1869,7 @@ is running."
1857 ;; Suppress "No registers." since GDB 6.8 and earlier duplicates MI 1869 ;; Suppress "No registers." since GDB 6.8 and earlier duplicates MI
1858 ;; error message on internal stream. Don't print to GUD buffer. 1870 ;; error message on internal stream. Don't print to GUD buffer.
1859 (unless (and (eq record-type 'gdb-internals) 1871 (unless (and (eq record-type 'gdb-internals)
1860 (string-equal (read arg1) "No registers.\n")) 1872 (string-equal (read arg1) "No registers.\n"))
1861 (funcall record-type arg1)))))) 1873 (funcall record-type arg1))))))
1862 1874
1863 (setq gdb-output-sink 'user) 1875 (setq gdb-output-sink 'user)
@@ -1881,15 +1893,15 @@ is running."
1881(defun gdb-thread-exited (output-field) 1893(defun gdb-thread-exited (output-field)
1882 "Handle =thread-exited async record: unset `gdb-thread-number' 1894 "Handle =thread-exited async record: unset `gdb-thread-number'
1883 if current thread exited and update threads list." 1895 if current thread exited and update threads list."
1884 (let* ((thread-id (bindat-get-field (gdb-json-string output-field) 'id))) 1896 (let* ((thread-id (bindat-get-field (gdb-json-string output-field) 'id)))
1885 (if (string= gdb-thread-number thread-id) 1897 (if (string= gdb-thread-number thread-id)
1886 (gdb-setq-thread-number nil)) 1898 (gdb-setq-thread-number nil))
1887 ;; When we continue current thread and it quickly exits, 1899 ;; When we continue current thread and it quickly exits,
1888 ;; gdb-pending-triggers left after gdb-running disallow us to 1900 ;; gdb-pending-triggers left after gdb-running disallow us to
1889 ;; properly call -thread-info without --thread option. Thus we 1901 ;; properly call -thread-info without --thread option. Thus we
1890 ;; need to use gdb-wait-for-pending. 1902 ;; need to use gdb-wait-for-pending.
1891 (gdb-wait-for-pending 1903 (gdb-wait-for-pending
1892 (gdb-emit-signal gdb-buf-publisher 'update-threads)))) 1904 (gdb-emit-signal gdb-buf-publisher 'update-threads))))
1893 1905
1894(defun gdb-thread-selected (output-field) 1906(defun gdb-thread-selected (output-field)
1895 "Handler for =thread-selected MI output record. 1907 "Handler for =thread-selected MI output record.
@@ -1909,7 +1921,8 @@ Sets `gdb-thread-number' to new id."
1909 (gdb-update)))) 1921 (gdb-update))))
1910 1922
1911(defun gdb-running (output-field) 1923(defun gdb-running (output-field)
1912 (let* ((thread-id (bindat-get-field (gdb-json-string output-field) 'thread-id))) 1924 (let* ((thread-id
1925 (bindat-get-field (gdb-json-string output-field) 'thread-id)))
1913 ;; We reset gdb-frame-number to nil if current thread has gone 1926 ;; We reset gdb-frame-number to nil if current thread has gone
1914 ;; running. This can't be done in gdb-thread-list-handler-custom 1927 ;; running. This can't be done in gdb-thread-list-handler-custom
1915 ;; because we need correct gdb-frame-number by the time 1928 ;; because we need correct gdb-frame-number by the time
@@ -1984,23 +1997,23 @@ current thread and update GDB buffers."
1984 ;; reasons 1997 ;; reasons
1985 (if (or (eq gdb-switch-reasons t) 1998 (if (or (eq gdb-switch-reasons t)
1986 (member reason gdb-switch-reasons)) 1999 (member reason gdb-switch-reasons))
1987 (when (not (string-equal gdb-thread-number thread-id)) 2000 (when (not (string-equal gdb-thread-number thread-id))
1988 (message (concat "Switched to thread " thread-id)) 2001 (message (concat "Switched to thread " thread-id))
1989 (gdb-setq-thread-number thread-id)) 2002 (gdb-setq-thread-number thread-id))
1990 (message (format "Thread %s stopped" thread-id))))) 2003 (message (format "Thread %s stopped" thread-id)))))
1991 2004
1992 ;; Print "(gdb)" to GUD console 2005 ;; Print "(gdb)" to GUD console
1993 (when gdb-first-done-or-error 2006 (when gdb-first-done-or-error
1994 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) 2007 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
1995 2008
1996 ;; In non-stop, we update information as soon as another thread gets 2009 ;; In non-stop, we update information as soon as another thread gets
1997 ;; stopped 2010 ;; stopped
1998 (when (or gdb-first-done-or-error 2011 (when (or gdb-first-done-or-error
1999 gdb-non-stop) 2012 gdb-non-stop)
2000 ;; In all-stop this updates gud-running properly as well. 2013 ;; In all-stop this updates gud-running properly as well.
2001 (gdb-update) 2014 (gdb-update)
2002 (setq gdb-first-done-or-error nil)) 2015 (setq gdb-first-done-or-error nil))
2003 (run-hook-with-args 'gdb-stopped-hooks result))) 2016 (run-hook-with-args 'gdb-stopped-hooks result)))
2004 2017
2005;; Remove the trimmings from log stream containing debugging messages 2018;; Remove the trimmings from log stream containing debugging messages
2006;; being produced by GDB's internals, use warning face and send to GUD 2019;; being produced by GDB's internals, use warning face and send to GUD
@@ -2020,7 +2033,7 @@ current thread and update GDB buffers."
2020;; Remove the trimmings from the console stream and send to GUD buffer 2033;; Remove the trimmings from the console stream and send to GUD buffer
2021;; (frontend MI commands should not print to this stream) 2034;; (frontend MI commands should not print to this stream)
2022(defun gdb-console (output-field) 2035(defun gdb-console (output-field)
2023 (setq gdb-filter-output 2036 (setq gdb-filter-output
2024 (gdb-concat-output 2037 (gdb-concat-output
2025 gdb-filter-output 2038 gdb-filter-output
2026 (read output-field)))) 2039 (read output-field))))
@@ -2033,11 +2046,11 @@ current thread and update GDB buffers."
2033 (setq token-number nil) 2046 (setq token-number nil)
2034 ;; MI error - send to minibuffer 2047 ;; MI error - send to minibuffer
2035 (when (eq type 'error) 2048 (when (eq type 'error)
2036 ;; Skip "msg=" from `output-field' 2049 ;; Skip "msg=" from `output-field'
2037 (message (read (substring output-field 4))) 2050 (message (read (substring output-field 4)))
2038 ;; Don't send to the console twice. (If it is a console error 2051 ;; Don't send to the console twice. (If it is a console error
2039 ;; it is also in the console stream.) 2052 ;; it is also in the console stream.)
2040 (setq output-field nil))) 2053 (setq output-field nil)))
2041 ;; Output from command from frontend. 2054 ;; Output from command from frontend.
2042 (setq gdb-output-sink 'emacs)) 2055 (setq gdb-output-sink 'emacs))
2043 2056
@@ -2215,11 +2228,11 @@ calling `gdb-table-string'."
2215 (append row-properties (list properties))) 2228 (append row-properties (list properties)))
2216 (setf (gdb-table-column-sizes table) 2229 (setf (gdb-table-column-sizes table)
2217 (gdb-mapcar* (lambda (x s) 2230 (gdb-mapcar* (lambda (x s)
2218 (let ((new-x 2231 (let ((new-x
2219 (max (abs x) (string-width (or s ""))))) 2232 (max (abs x) (string-width (or s "")))))
2220 (if right-align new-x (- new-x)))) 2233 (if right-align new-x (- new-x))))
2221 (gdb-table-column-sizes table) 2234 (gdb-table-column-sizes table)
2222 row)) 2235 row))
2223 ;; Avoid trailing whitespace at eol 2236 ;; Avoid trailing whitespace at eol
2224 (if (not (gdb-table-right-align table)) 2237 (if (not (gdb-table-right-align table))
2225 (setcar (last (gdb-table-column-sizes table)) 0)))) 2238 (setcar (last (gdb-table-column-sizes table)) 0))))
@@ -2308,8 +2321,8 @@ If NOPRESERVE is non-nil, window point is not restored after CUSTOM-DEFUN."
2308 '(set-window-point window p))))) 2321 '(set-window-point window p)))))
2309 2322
2310(defmacro def-gdb-trigger-and-handler (trigger-name gdb-command 2323(defmacro def-gdb-trigger-and-handler (trigger-name gdb-command
2311 handler-name custom-defun 2324 handler-name custom-defun
2312 &optional signal-list) 2325 &optional signal-list)
2313 "Define trigger and handler. 2326 "Define trigger and handler.
2314 2327
2315TRIGGER-NAME trigger is defined to send GDB-COMMAND. See 2328TRIGGER-NAME trigger is defined to send GDB-COMMAND. See
@@ -2353,29 +2366,29 @@ HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See
2353 (pending (bindat-get-field breakpoint 'pending)) 2366 (pending (bindat-get-field breakpoint 'pending))
2354 (func (bindat-get-field breakpoint 'func)) 2367 (func (bindat-get-field breakpoint 'func))
2355 (type (bindat-get-field breakpoint 'type))) 2368 (type (bindat-get-field breakpoint 'type)))
2356 (gdb-table-add-row table 2369 (gdb-table-add-row table
2357 (list 2370 (list
2358 (bindat-get-field breakpoint 'number) 2371 (bindat-get-field breakpoint 'number)
2359 type 2372 type
2360 (bindat-get-field breakpoint 'disp) 2373 (bindat-get-field breakpoint 'disp)
2361 (let ((flag (bindat-get-field breakpoint 'enabled))) 2374 (let ((flag (bindat-get-field breakpoint 'enabled)))
2362 (if (string-equal flag "y") 2375 (if (string-equal flag "y")
2363 (propertize "y" 'font-lock-face font-lock-warning-face) 2376 (propertize "y" 'font-lock-face font-lock-warning-face)
2364 (propertize "n" 'font-lock-face font-lock-comment-face))) 2377 (propertize "n" 'font-lock-face font-lock-comment-face)))
2365 (bindat-get-field breakpoint 'addr) 2378 (bindat-get-field breakpoint 'addr)
2366 (bindat-get-field breakpoint 'times) 2379 (bindat-get-field breakpoint 'times)
2367 (if (string-match ".*watchpoint" type) 2380 (if (string-match ".*watchpoint" type)
2368 (bindat-get-field breakpoint 'what) 2381 (bindat-get-field breakpoint 'what)
2369 (or pending at 2382 (or pending at
2370 (concat "in " 2383 (concat "in "
2371 (propertize (or func "unknown") 2384 (propertize (or func "unknown")
2372 'font-lock-face font-lock-function-name-face) 2385 'font-lock-face font-lock-function-name-face)
2373 (gdb-frame-location breakpoint))))) 2386 (gdb-frame-location breakpoint)))))
2374 ;; Add clickable properties only for breakpoints with file:line 2387 ;; Add clickable properties only for breakpoints with file:line
2375 ;; information 2388 ;; information
2376 (append (list 'gdb-breakpoint breakpoint) 2389 (append (list 'gdb-breakpoint breakpoint)
2377 (when func '(help-echo "mouse-2, RET: visit breakpoint" 2390 (when func '(help-echo "mouse-2, RET: visit breakpoint"
2378 mouse-face highlight)))))) 2391 mouse-face highlight))))))
2379 (insert (gdb-table-string table " ")) 2392 (insert (gdb-table-string table " "))
2380 (gdb-place-breakpoints))) 2393 (gdb-place-breakpoints)))
2381 2394
@@ -2389,7 +2402,7 @@ HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See
2389 (gdb-remove-breakpoint-icons (point-min) (point-max))))) 2402 (gdb-remove-breakpoint-icons (point-min) (point-max)))))
2390 (dolist (breakpoint gdb-breakpoints-list) 2403 (dolist (breakpoint gdb-breakpoints-list)
2391 (let* ((breakpoint (cdr breakpoint)) ; gdb-breakpoints-list is 2404 (let* ((breakpoint (cdr breakpoint)) ; gdb-breakpoints-list is
2392 ; an associative list 2405 ; an associative list
2393 (line (bindat-get-field breakpoint 'line))) 2406 (line (bindat-get-field breakpoint 'line)))
2394 (when line 2407 (when line
2395 (let ((file (bindat-get-field breakpoint 'fullname)) 2408 (let ((file (bindat-get-field breakpoint 'fullname))
@@ -2411,7 +2424,7 @@ HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See
2411 (gdb-input 2424 (gdb-input
2412 (list "-file-list-exec-source-file" 2425 (list "-file-list-exec-source-file"
2413 `(lambda () (gdb-get-location 2426 `(lambda () (gdb-get-location
2414 ,bptno ,line ,flag)))))))))) 2427 ,bptno ,line ,flag))))))))))
2415 2428
2416(defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"") 2429(defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"")
2417 2430
@@ -2422,7 +2435,7 @@ Put in buffer and place breakpoint icon."
2422 (catch 'file-not-found 2435 (catch 'file-not-found
2423 (if (re-search-forward gdb-source-file-regexp nil t) 2436 (if (re-search-forward gdb-source-file-regexp nil t)
2424 (delete (cons bptno "File not found") gdb-location-alist) 2437 (delete (cons bptno "File not found") gdb-location-alist)
2425 (push (cons bptno (match-string 1)) gdb-location-alist) 2438 (push (cons bptno (match-string 1)) gdb-location-alist)
2426 (gdb-resync) 2439 (gdb-resync)
2427 (unless (assoc bptno gdb-location-alist) 2440 (unless (assoc bptno gdb-location-alist)
2428 (push (cons bptno "File not found") gdb-location-alist) 2441 (push (cons bptno "File not found") gdb-location-alist)
@@ -2510,20 +2523,20 @@ If not in a source or disassembly buffer just set point."
2510 (if (get-text-property 0 'gdb-enabled obj) 2523 (if (get-text-property 0 'gdb-enabled obj)
2511 "-break-disable " 2524 "-break-disable "
2512 "-break-enable ") 2525 "-break-enable ")
2513 (get-text-property 0 'gdb-bptno obj))))))))) 2526 (get-text-property 0 'gdb-bptno obj)))))))))
2514 2527
2515(defun gdb-breakpoints-buffer-name () 2528(defun gdb-breakpoints-buffer-name ()
2516 (concat "*breakpoints of " (gdb-get-target-string) "*")) 2529 (concat "*breakpoints of " (gdb-get-target-string) "*"))
2517 2530
2518(def-gdb-display-buffer 2531(def-gdb-display-buffer
2519 gdb-display-breakpoints-buffer 2532 gdb-display-breakpoints-buffer
2520 'gdb-breakpoints-buffer 2533 'gdb-breakpoints-buffer
2521 "Display status of user-settable breakpoints.") 2534 "Display status of user-settable breakpoints.")
2522 2535
2523(def-gdb-frame-for-buffer 2536(def-gdb-frame-for-buffer
2524 gdb-frame-breakpoints-buffer 2537 gdb-frame-breakpoints-buffer
2525 'gdb-breakpoints-buffer 2538 'gdb-breakpoints-buffer
2526 "Display status of user-settable breakpoints in a new frame.") 2539 "Display status of user-settable breakpoints in a new frame.")
2527 2540
2528(defvar gdb-breakpoints-mode-map 2541(defvar gdb-breakpoints-mode-map
2529 (let ((map (make-sparse-keymap)) 2542 (let ((map (make-sparse-keymap))
@@ -2540,9 +2553,9 @@ If not in a source or disassembly buffer just set point."
2540 (define-key map "q" 'gdb-delete-frame-or-window) 2553 (define-key map "q" 'gdb-delete-frame-or-window)
2541 (define-key map "\r" 'gdb-goto-breakpoint) 2554 (define-key map "\r" 'gdb-goto-breakpoint)
2542 (define-key map "\t" (lambda () 2555 (define-key map "\t" (lambda ()
2543 (interactive) 2556 (interactive)
2544 (gdb-set-window-buffer 2557 (gdb-set-window-buffer
2545 (gdb-get-buffer-create 'gdb-threads-buffer) t))) 2558 (gdb-get-buffer-create 'gdb-threads-buffer) t)))
2546 (define-key map [mouse-2] 'gdb-goto-breakpoint) 2559 (define-key map [mouse-2] 'gdb-goto-breakpoint)
2547 (define-key map [follow-link] 'mouse-face) 2560 (define-key map [follow-link] 'mouse-face)
2548 map)) 2561 map))
@@ -2585,14 +2598,14 @@ corresponding to the mode line clicked."
2585 (concat "*threads of " (gdb-get-target-string) "*")) 2598 (concat "*threads of " (gdb-get-target-string) "*"))
2586 2599
2587(def-gdb-display-buffer 2600(def-gdb-display-buffer
2588 gdb-display-threads-buffer 2601 gdb-display-threads-buffer
2589 'gdb-threads-buffer 2602 'gdb-threads-buffer
2590 "Display GDB threads.") 2603 "Display GDB threads.")
2591 2604
2592(def-gdb-frame-for-buffer 2605(def-gdb-frame-for-buffer
2593 gdb-frame-threads-buffer 2606 gdb-frame-threads-buffer
2594 'gdb-threads-buffer 2607 'gdb-threads-buffer
2595 "Display GDB threads in a new frame.") 2608 "Display GDB threads in a new frame.")
2596 2609
2597(def-gdb-trigger-and-handler 2610(def-gdb-trigger-and-handler
2598 gdb-invalidate-threads (gdb-current-context-command "-thread-info") 2611 gdb-invalidate-threads (gdb-current-context-command "-thread-info")
@@ -2626,18 +2639,20 @@ corresponding to the mode line clicked."
2626 (define-key map "i" 'gdb-interrupt-thread) 2639 (define-key map "i" 'gdb-interrupt-thread)
2627 (define-key map "c" 'gdb-continue-thread) 2640 (define-key map "c" 'gdb-continue-thread)
2628 (define-key map "s" 'gdb-step-thread) 2641 (define-key map "s" 'gdb-step-thread)
2629 (define-key map "\t" (lambda () 2642 (define-key map "\t"
2630 (interactive) 2643 (lambda ()
2631 (gdb-set-window-buffer 2644 (interactive)
2632 (gdb-get-buffer-create 'gdb-breakpoints-buffer) t))) 2645 (gdb-set-window-buffer
2646 (gdb-get-buffer-create 'gdb-breakpoints-buffer) t)))
2633 (define-key map [mouse-2] 'gdb-select-thread) 2647 (define-key map [mouse-2] 'gdb-select-thread)
2634 (define-key map [follow-link] 'mouse-face) 2648 (define-key map [follow-link] 'mouse-face)
2635 map)) 2649 map))
2636 2650
2637(defvar gdb-threads-header 2651(defvar gdb-threads-header
2638 (list 2652 (list
2639 (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer 2653 (gdb-propertize-header
2640 "mouse-1: select" mode-line-highlight mode-line-inactive) 2654 "Breakpoints" gdb-breakpoints-buffer
2655 "mouse-1: select" mode-line-highlight mode-line-inactive)
2641 " " 2656 " "
2642 (gdb-propertize-header "Threads" gdb-threads-buffer 2657 (gdb-propertize-header "Threads" gdb-threads-buffer
2643 nil nil mode-line))) 2658 nil nil mode-line)))
@@ -2661,44 +2676,45 @@ corresponding to the mode line clicked."
2661 (set-marker gdb-thread-position nil) 2676 (set-marker gdb-thread-position nil)
2662 2677
2663 (dolist (thread (reverse threads-list)) 2678 (dolist (thread (reverse threads-list))
2664 (let ((running (string-equal (bindat-get-field thread 'state) "running"))) 2679 (let ((running (equal (bindat-get-field thread 'state) "running")))
2665 (add-to-list 'gdb-threads-list 2680 (add-to-list 'gdb-threads-list
2666 (cons (bindat-get-field thread 'id) 2681 (cons (bindat-get-field thread 'id)
2667 thread)) 2682 thread))
2668 (if running 2683 (if running
2669 (incf gdb-running-threads-count) 2684 (incf gdb-running-threads-count)
2670 (incf gdb-stopped-threads-count)) 2685 (incf gdb-stopped-threads-count))
2671 2686
2672 (gdb-table-add-row table 2687 (gdb-table-add-row table
2673 (list 2688 (list
2674 (bindat-get-field thread 'id) 2689 (bindat-get-field thread 'id)
2675 (concat 2690 (concat
2676 (if gdb-thread-buffer-verbose-names 2691 (if gdb-thread-buffer-verbose-names
2677 (concat (bindat-get-field thread 'target-id) " ") "") 2692 (concat (bindat-get-field thread 'target-id) " ") "")
2678 (bindat-get-field thread 'state) 2693 (bindat-get-field thread 'state)
2679 ;; Include frame information for stopped threads 2694 ;; Include frame information for stopped threads
2680 (if (not running) 2695 (if (not running)
2681 (concat 2696 (concat
2682 " in " (bindat-get-field thread 'frame 'func) 2697 " in " (bindat-get-field thread 'frame 'func)
2683 (if gdb-thread-buffer-arguments 2698 (if gdb-thread-buffer-arguments
2684 (concat 2699 (concat
2685 " (" 2700 " ("
2686 (let ((args (bindat-get-field thread 'frame 'args))) 2701 (let ((args (bindat-get-field thread 'frame 'args)))
2687 (mapconcat 2702 (mapconcat
2688 (lambda (arg) 2703 (lambda (arg)
2689 (apply 'format `("%s=%s" ,@(gdb-get-many-fields arg 'name 'value)))) 2704 (apply #'format "%s=%s"
2690 args ",")) 2705 (gdb-get-many-fields arg 'name 'value)))
2691 ")") 2706 args ","))
2692 "") 2707 ")")
2693 (if gdb-thread-buffer-locations 2708 "")
2694 (gdb-frame-location (bindat-get-field thread 'frame)) "") 2709 (if gdb-thread-buffer-locations
2695 (if gdb-thread-buffer-addresses 2710 (gdb-frame-location (bindat-get-field thread 'frame)) "")
2696 (concat " at " (bindat-get-field thread 'frame 'addr)) "")) 2711 (if gdb-thread-buffer-addresses
2697 ""))) 2712 (concat " at " (bindat-get-field thread 'frame 'addr)) ""))
2698 (list 2713 "")))
2699 'gdb-thread thread 2714 (list
2700 'mouse-face 'highlight 2715 'gdb-thread thread
2701 'help-echo "mouse-2, RET: select thread"))) 2716 'mouse-face 'highlight
2717 'help-echo "mouse-2, RET: select thread")))
2702 (when (string-equal gdb-thread-number 2718 (when (string-equal gdb-thread-number
2703 (bindat-get-field thread 'id)) 2719 (bindat-get-field thread 'id))
2704 (setq marked-line (length gdb-threads-list)))) 2720 (setq marked-line (length gdb-threads-list))))
@@ -2727,7 +2743,8 @@ be the value of 'gdb-thread property of the current line. If
2727 ,custom-defun 2743 ,custom-defun
2728 (error "Not recognized as thread line")))))) 2744 (error "Not recognized as thread line"))))))
2729 2745
2730(defmacro def-gdb-thread-buffer-simple-command (name buffer-command &optional doc) 2746(defmacro def-gdb-thread-buffer-simple-command (name buffer-command
2747 &optional doc)
2731 "Define a NAME which will call BUFFER-COMMAND with id of thread 2748 "Define a NAME which will call BUFFER-COMMAND with id of thread
2732on the current line." 2749on the current line."
2733 `(def-gdb-thread-buffer-command ,name 2750 `(def-gdb-thread-buffer-command ,name
@@ -2830,19 +2847,19 @@ line."
2830(defcustom gdb-memory-format "x" 2847(defcustom gdb-memory-format "x"
2831 "Display format of data items in memory window." 2848 "Display format of data items in memory window."
2832 :type '(choice (const :tag "Hexadecimal" "x") 2849 :type '(choice (const :tag "Hexadecimal" "x")
2833 (const :tag "Signed decimal" "d") 2850 (const :tag "Signed decimal" "d")
2834 (const :tag "Unsigned decimal" "u") 2851 (const :tag "Unsigned decimal" "u")
2835 (const :tag "Octal" "o") 2852 (const :tag "Octal" "o")
2836 (const :tag "Binary" "t")) 2853 (const :tag "Binary" "t"))
2837 :group 'gud 2854 :group 'gud
2838 :version "22.1") 2855 :version "22.1")
2839 2856
2840(defcustom gdb-memory-unit 4 2857(defcustom gdb-memory-unit 4
2841 "Unit size of data items in memory window." 2858 "Unit size of data items in memory window."
2842 :type '(choice (const :tag "Byte" 1) 2859 :type '(choice (const :tag "Byte" 1)
2843 (const :tag "Halfword" 2) 2860 (const :tag "Halfword" 2)
2844 (const :tag "Word" 4) 2861 (const :tag "Word" 4)
2845 (const :tag "Giant word" 8)) 2862 (const :tag "Giant word" 8))
2846 :group 'gud 2863 :group 'gud
2847 :version "23.2") 2864 :version "23.2")
2848 2865
@@ -2893,14 +2910,14 @@ in `gdb-memory-format'."
2893 (setq gdb-memory-next-page (bindat-get-field res 'next-page)) 2910 (setq gdb-memory-next-page (bindat-get-field res 'next-page))
2894 (setq gdb-memory-prev-page (bindat-get-field res 'prev-page)) 2911 (setq gdb-memory-prev-page (bindat-get-field res 'prev-page))
2895 (setq gdb-memory-last-address gdb-memory-address) 2912 (setq gdb-memory-last-address gdb-memory-address)
2896 (dolist (row memory) 2913 (dolist (row memory)
2897 (insert (concat (bindat-get-field row 'addr) ":")) 2914 (insert (concat (bindat-get-field row 'addr) ":"))
2898 (dolist (column (bindat-get-field row 'data)) 2915 (dolist (column (bindat-get-field row 'data))
2899 (insert (gdb-pad-string column 2916 (insert (gdb-pad-string column
2900 (+ 2 (gdb-memory-column-width 2917 (+ 2 (gdb-memory-column-width
2901 gdb-memory-unit 2918 gdb-memory-unit
2902 gdb-memory-format))))) 2919 gdb-memory-format)))))
2903 (newline))) 2920 (newline)))
2904 ;; Show last page instead of empty buffer when out of bounds 2921 ;; Show last page instead of empty buffer when out of bounds
2905 (progn 2922 (progn
2906 (let ((gdb-memory-address gdb-memory-last-address)) 2923 (let ((gdb-memory-address gdb-memory-last-address))
@@ -2925,7 +2942,7 @@ in `gdb-memory-format'."
2925 (define-key map "g" 'gdb-memory-unit-giant) 2942 (define-key map "g" 'gdb-memory-unit-giant)
2926 (define-key map "R" 'gdb-memory-set-rows) 2943 (define-key map "R" 'gdb-memory-set-rows)
2927 (define-key map "C" 'gdb-memory-set-columns) 2944 (define-key map "C" 'gdb-memory-set-columns)
2928 map)) 2945 map))
2929 2946
2930(defun gdb-memory-set-address-event (event) 2947(defun gdb-memory-set-address-event (event)
2931 "Handle a click on address field in memory buffer header." 2948 "Handle a click on address field in memory buffer header."
@@ -3115,8 +3132,8 @@ DOC is an optional documentation string."
3115 3132
3116(defvar gdb-memory-font-lock-keywords 3133(defvar gdb-memory-font-lock-keywords
3117 '(;; <__function.name+n> 3134 '(;; <__function.name+n>
3118 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 font-lock-function-name-face)) 3135 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
3119 ) 3136 (1 font-lock-function-name-face)))
3120 "Font lock keywords used in `gdb-memory-mode'.") 3137 "Font lock keywords used in `gdb-memory-mode'.")
3121 3138
3122(defvar gdb-memory-header 3139(defvar gdb-memory-header
@@ -3124,52 +3141,52 @@ DOC is an optional documentation string."
3124 (concat 3141 (concat
3125 "Start address[" 3142 "Start address["
3126 (propertize "-" 3143 (propertize "-"
3127 'face font-lock-warning-face 3144 'face font-lock-warning-face
3128 'help-echo "mouse-1: decrement address" 3145 'help-echo "mouse-1: decrement address"
3129 'mouse-face 'mode-line-highlight 3146 'mouse-face 'mode-line-highlight
3130 'local-map (gdb-make-header-line-mouse-map 3147 'local-map (gdb-make-header-line-mouse-map
3131 'mouse-1 3148 'mouse-1
3132 #'gdb-memory-show-previous-page)) 3149 #'gdb-memory-show-previous-page))
3133 "|" 3150 "|"
3134 (propertize "+" 3151 (propertize "+"
3135 'face font-lock-warning-face 3152 'face font-lock-warning-face
3136 'help-echo "mouse-1: increment address" 3153 'help-echo "mouse-1: increment address"
3137 'mouse-face 'mode-line-highlight 3154 'mouse-face 'mode-line-highlight
3138 'local-map (gdb-make-header-line-mouse-map 3155 'local-map (gdb-make-header-line-mouse-map
3139 'mouse-1 3156 'mouse-1
3140 #'gdb-memory-show-next-page)) 3157 #'gdb-memory-show-next-page))
3141 "]: " 3158 "]: "
3142 (propertize gdb-memory-address 3159 (propertize gdb-memory-address
3143 'face font-lock-warning-face 3160 'face font-lock-warning-face
3144 'help-echo "mouse-1: set start address" 3161 'help-echo "mouse-1: set start address"
3145 'mouse-face 'mode-line-highlight 3162 'mouse-face 'mode-line-highlight
3146 'local-map (gdb-make-header-line-mouse-map 3163 'local-map (gdb-make-header-line-mouse-map
3147 'mouse-1 3164 'mouse-1
3148 #'gdb-memory-set-address-event)) 3165 #'gdb-memory-set-address-event))
3149 " Rows: " 3166 " Rows: "
3150 (propertize (number-to-string gdb-memory-rows) 3167 (propertize (number-to-string gdb-memory-rows)
3151 'face font-lock-warning-face 3168 'face font-lock-warning-face
3152 'help-echo "mouse-1: set number of columns" 3169 'help-echo "mouse-1: set number of columns"
3153 'mouse-face 'mode-line-highlight 3170 'mouse-face 'mode-line-highlight
3154 'local-map (gdb-make-header-line-mouse-map 3171 'local-map (gdb-make-header-line-mouse-map
3155 'mouse-1 3172 'mouse-1
3156 #'gdb-memory-set-rows)) 3173 #'gdb-memory-set-rows))
3157 " Columns: " 3174 " Columns: "
3158 (propertize (number-to-string gdb-memory-columns) 3175 (propertize (number-to-string gdb-memory-columns)
3159 'face font-lock-warning-face 3176 'face font-lock-warning-face
3160 'help-echo "mouse-1: set number of columns" 3177 'help-echo "mouse-1: set number of columns"
3161 'mouse-face 'mode-line-highlight 3178 'mouse-face 'mode-line-highlight
3162 'local-map (gdb-make-header-line-mouse-map 3179 'local-map (gdb-make-header-line-mouse-map
3163 'mouse-1 3180 'mouse-1
3164 #'gdb-memory-set-columns)) 3181 #'gdb-memory-set-columns))
3165 " Display Format: " 3182 " Display Format: "
3166 (propertize gdb-memory-format 3183 (propertize gdb-memory-format
3167 'face font-lock-warning-face 3184 'face font-lock-warning-face
3168 'help-echo "mouse-3: select display format" 3185 'help-echo "mouse-3: select display format"
3169 'mouse-face 'mode-line-highlight 3186 'mouse-face 'mode-line-highlight
3170 'local-map gdb-memory-format-map) 3187 'local-map gdb-memory-format-map)
3171 " Unit Size: " 3188 " Unit Size: "
3172 (propertize (number-to-string gdb-memory-unit) 3189 (propertize (number-to-string gdb-memory-unit)
3173 'face font-lock-warning-face 3190 'face font-lock-warning-face
3174 'help-echo "mouse-3: select unit size" 3191 'help-echo "mouse-3: select unit size"
3175 'mouse-face 'mode-line-highlight 3192 'mouse-face 'mode-line-highlight
@@ -3210,18 +3227,18 @@ DOC is an optional documentation string."
3210 (concat "disassembly of " (gdb-get-target-string)))) 3227 (concat "disassembly of " (gdb-get-target-string))))
3211 3228
3212(def-gdb-display-buffer 3229(def-gdb-display-buffer
3213 gdb-display-disassembly-buffer 3230 gdb-display-disassembly-buffer
3214 'gdb-disassembly-buffer 3231 'gdb-disassembly-buffer
3215 "Display disassembly for current stack frame.") 3232 "Display disassembly for current stack frame.")
3216 3233
3217(def-gdb-preempt-display-buffer 3234(def-gdb-preempt-display-buffer
3218 gdb-preemptively-display-disassembly-buffer 3235 gdb-preemptively-display-disassembly-buffer
3219 'gdb-disassembly-buffer) 3236 'gdb-disassembly-buffer)
3220 3237
3221(def-gdb-frame-for-buffer 3238(def-gdb-frame-for-buffer
3222 gdb-frame-disassembly-buffer 3239 gdb-frame-disassembly-buffer
3223 'gdb-disassembly-buffer 3240 'gdb-disassembly-buffer
3224 "Display disassembly in a new frame.") 3241 "Display disassembly in a new frame.")
3225 3242
3226(def-gdb-auto-update-trigger gdb-invalidate-disassembly 3243(def-gdb-auto-update-trigger gdb-invalidate-disassembly
3227 (let* ((frame (gdb-current-buffer-frame)) 3244 (let* ((frame (gdb-current-buffer-frame))
@@ -3266,7 +3283,7 @@ DOC is an optional documentation string."
3266 (let ((map (make-sparse-keymap))) 3283 (let ((map (make-sparse-keymap)))
3267 (suppress-keymap map) 3284 (suppress-keymap map)
3268 (define-key map "q" 'kill-this-buffer) 3285 (define-key map "q" 'kill-this-buffer)
3269 map)) 3286 map))
3270 3287
3271(define-derived-mode gdb-disassembly-mode gdb-parent-mode "Disassembly" 3288(define-derived-mode gdb-disassembly-mode gdb-parent-mode "Disassembly"
3272 "Major mode for GDB disassembly information." 3289 "Major mode for GDB disassembly information."
@@ -3283,12 +3300,13 @@ DOC is an optional documentation string."
3283 (address (bindat-get-field (gdb-current-buffer-frame) 'addr)) 3300 (address (bindat-get-field (gdb-current-buffer-frame) 'addr))
3284 (table (make-gdb-table)) 3301 (table (make-gdb-table))
3285 (marked-line nil)) 3302 (marked-line nil))
3286 (dolist (instr instructions) 3303 (dolist (instr instructions)
3287 (gdb-table-add-row table 3304 (gdb-table-add-row table
3288 (list 3305 (list
3289 (bindat-get-field instr 'address) 3306 (bindat-get-field instr 'address)
3290 (apply 'format `("<%s+%s>:" ,@(gdb-get-many-fields instr 'func-name 'offset))) 3307 (apply #'format "<%s+%s>:"
3291 (bindat-get-field instr 'inst))) 3308 (gdb-get-many-fields instr 'func-name 'offset))
3309 (bindat-get-field instr 'inst)))
3292 (when (string-equal (bindat-get-field instr 'address) 3310 (when (string-equal (bindat-get-field instr 'address)
3293 address) 3311 address)
3294 (progn 3312 (progn
@@ -3297,17 +3315,18 @@ DOC is an optional documentation string."
3297 (if (string-equal gdb-frame-number "0") 3315 (if (string-equal gdb-frame-number "0")
3298 nil 3316 nil
3299 '((overlay-arrow . hollow-right-triangle))))))) 3317 '((overlay-arrow . hollow-right-triangle)))))))
3300 (insert (gdb-table-string table " ")) 3318 (insert (gdb-table-string table " "))
3301 (gdb-disassembly-place-breakpoints) 3319 (gdb-disassembly-place-breakpoints)
3302 ;; Mark current position with overlay arrow and scroll window to 3320 ;; Mark current position with overlay arrow and scroll window to
3303 ;; that point 3321 ;; that point
3304 (when marked-line 3322 (when marked-line
3305 (let ((window (get-buffer-window (current-buffer) 0))) 3323 (let ((window (get-buffer-window (current-buffer) 0)))
3306 (set-window-point window (gdb-mark-line marked-line gdb-disassembly-position)))) 3324 (set-window-point window (gdb-mark-line marked-line
3307 (setq mode-name 3325 gdb-disassembly-position))))
3308 (gdb-current-context-mode-name 3326 (setq mode-name
3309 (concat "Disassembly: " 3327 (gdb-current-context-mode-name
3310 (bindat-get-field (gdb-current-buffer-frame) 'func)))))) 3328 (concat "Disassembly: "
3329 (bindat-get-field (gdb-current-buffer-frame) 'func))))))
3311 3330
3312(defun gdb-disassembly-place-breakpoints () 3331(defun gdb-disassembly-place-breakpoints ()
3313 (gdb-remove-breakpoint-icons (point-min) (point-max)) 3332 (gdb-remove-breakpoint-icons (point-min) (point-max))
@@ -3328,7 +3347,8 @@ DOC is an optional documentation string."
3328 nil nil mode-line) 3347 nil nil mode-line)
3329 " " 3348 " "
3330 (gdb-propertize-header "Threads" gdb-threads-buffer 3349 (gdb-propertize-header "Threads" gdb-threads-buffer
3331 "mouse-1: select" mode-line-highlight mode-line-inactive))) 3350 "mouse-1: select" mode-line-highlight
3351 mode-line-inactive)))
3332 3352
3333;;; Breakpoints view 3353;;; Breakpoints view
3334(define-derived-mode gdb-breakpoints-mode gdb-parent-mode "Breakpoints" 3354(define-derived-mode gdb-breakpoints-mode gdb-parent-mode "Breakpoints"
@@ -3344,7 +3364,7 @@ DOC is an optional documentation string."
3344 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) 3364 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint)))
3345 (if breakpoint 3365 (if breakpoint
3346 (gud-basic-call 3366 (gud-basic-call
3347 (concat (if (string-equal "y" (bindat-get-field breakpoint 'enabled)) 3367 (concat (if (equal "y" (bindat-get-field breakpoint 'enabled))
3348 "-break-disable " 3368 "-break-disable "
3349 "-break-enable ") 3369 "-break-enable ")
3350 (bindat-get-field breakpoint 'number))) 3370 (bindat-get-field breakpoint 'number)))
@@ -3354,11 +3374,12 @@ DOC is an optional documentation string."
3354 "Delete the breakpoint at current line of breakpoints buffer." 3374 "Delete the breakpoint at current line of breakpoints buffer."
3355 (interactive) 3375 (interactive)
3356 (save-excursion 3376 (save-excursion
3357 (beginning-of-line) 3377 (beginning-of-line)
3358 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) 3378 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint)))
3359 (if breakpoint 3379 (if breakpoint
3360 (gud-basic-call (concat "-break-delete " (bindat-get-field breakpoint 'number))) 3380 (gud-basic-call (concat "-break-delete "
3361 (error "Not recognized as break/watchpoint line"))))) 3381 (bindat-get-field breakpoint 'number)))
3382 (error "Not recognized as break/watchpoint line")))))
3362 3383
3363(defun gdb-goto-breakpoint (&optional event) 3384(defun gdb-goto-breakpoint (&optional event)
3364 "Go to the location of breakpoint at current line of 3385 "Go to the location of breakpoint at current line of
@@ -3369,24 +3390,24 @@ breakpoints buffer."
3369 (let ((window (get-buffer-window gud-comint-buffer))) 3390 (let ((window (get-buffer-window gud-comint-buffer)))
3370 (if window (save-selected-window (select-window window)))) 3391 (if window (save-selected-window (select-window window))))
3371 (save-excursion 3392 (save-excursion
3372 (beginning-of-line) 3393 (beginning-of-line)
3373 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) 3394 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint)))
3374 (if breakpoint 3395 (if breakpoint
3375 (let ((bptno (bindat-get-field breakpoint 'number)) 3396 (let ((bptno (bindat-get-field breakpoint 'number))
3376 (file (bindat-get-field breakpoint 'fullname)) 3397 (file (bindat-get-field breakpoint 'fullname))
3377 (line (bindat-get-field breakpoint 'line))) 3398 (line (bindat-get-field breakpoint 'line)))
3378 (save-selected-window 3399 (save-selected-window
3379 (let* ((buffer (find-file-noselect 3400 (let* ((buffer (find-file-noselect
3380 (if (file-exists-p file) file 3401 (if (file-exists-p file) file
3381 (cdr (assoc bptno gdb-location-alist))))) 3402 (cdr (assoc bptno gdb-location-alist)))))
3382 (window (or (gdb-display-source-buffer buffer) 3403 (window (or (gdb-display-source-buffer buffer)
3383 (display-buffer buffer)))) 3404 (display-buffer buffer))))
3384 (setq gdb-source-window window) 3405 (setq gdb-source-window window)
3385 (with-current-buffer buffer 3406 (with-current-buffer buffer
3386 (goto-char (point-min)) 3407 (goto-char (point-min))
3387 (forward-line (1- (string-to-number line))) 3408 (forward-line (1- (string-to-number line)))
3388 (set-window-point window (point)))))) 3409 (set-window-point window (point))))))
3389 (error "Not recognized as break/watchpoint line"))))) 3410 (error "Not recognized as break/watchpoint line")))))
3390 3411
3391 3412
3392;; Frames buffer. This displays a perpetually correct bactrack trace. 3413;; Frames buffer. This displays a perpetually correct bactrack trace.
@@ -3418,21 +3439,21 @@ member."
3418 (let ((stack (bindat-get-field (gdb-json-partial-output "frame") 'stack)) 3439 (let ((stack (bindat-get-field (gdb-json-partial-output "frame") 'stack))
3419 (table (make-gdb-table))) 3440 (table (make-gdb-table)))
3420 (set-marker gdb-stack-position nil) 3441 (set-marker gdb-stack-position nil)
3421 (dolist (frame stack) 3442 (dolist (frame stack)
3422 (gdb-table-add-row table 3443 (gdb-table-add-row table
3423 (list 3444 (list
3424 (bindat-get-field frame 'level) 3445 (bindat-get-field frame 'level)
3425 "in" 3446 "in"
3426 (concat 3447 (concat
3427 (bindat-get-field frame 'func) 3448 (bindat-get-field frame 'func)
3428 (if gdb-stack-buffer-locations 3449 (if gdb-stack-buffer-locations
3429 (gdb-frame-location frame) "") 3450 (gdb-frame-location frame) "")
3430 (if gdb-stack-buffer-addresses 3451 (if gdb-stack-buffer-addresses
3431 (concat " at " (bindat-get-field frame 'addr)) ""))) 3452 (concat " at " (bindat-get-field frame 'addr)) "")))
3432 `(mouse-face highlight 3453 `(mouse-face highlight
3433 help-echo "mouse-2, RET: Select frame" 3454 help-echo "mouse-2, RET: Select frame"
3434 gdb-frame ,frame))) 3455 gdb-frame ,frame)))
3435 (insert (gdb-table-string table " "))) 3456 (insert (gdb-table-string table " ")))
3436 (when (and gdb-frame-number 3457 (when (and gdb-frame-number
3437 (gdb-buffer-shows-main-thread-p)) 3458 (gdb-buffer-shows-main-thread-p))
3438 (gdb-mark-line (1+ (string-to-number gdb-frame-number)) 3459 (gdb-mark-line (1+ (string-to-number gdb-frame-number))
@@ -3445,18 +3466,18 @@ member."
3445 (concat "stack frames of " (gdb-get-target-string)))) 3466 (concat "stack frames of " (gdb-get-target-string))))
3446 3467
3447(def-gdb-display-buffer 3468(def-gdb-display-buffer
3448 gdb-display-stack-buffer 3469 gdb-display-stack-buffer
3449 'gdb-stack-buffer 3470 'gdb-stack-buffer
3450 "Display backtrace of current stack.") 3471 "Display backtrace of current stack.")
3451 3472
3452(def-gdb-preempt-display-buffer 3473(def-gdb-preempt-display-buffer
3453 gdb-preemptively-display-stack-buffer 3474 gdb-preemptively-display-stack-buffer
3454 'gdb-stack-buffer nil t) 3475 'gdb-stack-buffer nil t)
3455 3476
3456(def-gdb-frame-for-buffer 3477(def-gdb-frame-for-buffer
3457 gdb-frame-stack-buffer 3478 gdb-frame-stack-buffer
3458 'gdb-stack-buffer 3479 'gdb-stack-buffer
3459 "Display backtrace of current stack in a new frame.") 3480 "Display backtrace of current stack in a new frame.")
3460 3481
3461(defvar gdb-frames-mode-map 3482(defvar gdb-frames-mode-map
3462 (let ((map (make-sparse-keymap))) 3483 (let ((map (make-sparse-keymap)))
@@ -3489,7 +3510,8 @@ member."
3489 (if (gdb-buffer-shows-main-thread-p) 3510 (if (gdb-buffer-shows-main-thread-p)
3490 (let ((new-level (bindat-get-field frame 'level))) 3511 (let ((new-level (bindat-get-field frame 'level)))
3491 (setq gdb-frame-number new-level) 3512 (setq gdb-frame-number new-level)
3492 (gdb-input (list (concat "-stack-select-frame " new-level) 'ignore)) 3513 (gdb-input (list (concat "-stack-select-frame " new-level)
3514 'ignore))
3493 (gdb-update)) 3515 (gdb-update))
3494 (error "Could not select frame for non-current thread")) 3516 (error "Could not select frame for non-current thread"))
3495 (error "Not recognized as frame line")))) 3517 (error "Not recognized as frame line"))))
@@ -3499,7 +3521,8 @@ member."
3499;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards. 3521;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards.
3500(def-gdb-trigger-and-handler 3522(def-gdb-trigger-and-handler
3501 gdb-invalidate-locals 3523 gdb-invalidate-locals
3502 (concat (gdb-current-context-command "-stack-list-locals") " --simple-values") 3524 (concat (gdb-current-context-command "-stack-list-locals")
3525 " --simple-values")
3503 gdb-locals-handler gdb-locals-handler-custom 3526 gdb-locals-handler gdb-locals-handler-custom
3504 '(start update)) 3527 '(start update))
3505 3528
@@ -3515,7 +3538,7 @@ member."
3515 (define-key map "\r" 'gud-watch) 3538 (define-key map "\r" 'gud-watch)
3516 (define-key map [mouse-2] 'gud-watch) 3539 (define-key map [mouse-2] 'gud-watch)
3517 map) 3540 map)
3518 "Keymap to create watch expression of a complex data type local variable.") 3541 "Keymap to create watch expression of a complex data type local variable.")
3519 3542
3520(defvar gdb-edit-locals-map-1 3543(defvar gdb-edit-locals-map-1
3521 (let ((map (make-sparse-keymap))) 3544 (let ((map (make-sparse-keymap)))
@@ -3523,7 +3546,7 @@ member."
3523 (define-key map "\r" 'gdb-edit-locals-value) 3546 (define-key map "\r" 'gdb-edit-locals-value)
3524 (define-key map [mouse-2] 'gdb-edit-locals-value) 3547 (define-key map [mouse-2] 'gdb-edit-locals-value)
3525 map) 3548 map)
3526 "Keymap to edit value of a simple data type local variable.") 3549 "Keymap to edit value of a simple data type local variable.")
3527 3550
3528(defun gdb-edit-locals-value (&optional event) 3551(defun gdb-edit-locals-value (&optional event)
3529 "Assign a value to a variable displayed in the locals buffer." 3552 "Assign a value to a variable displayed in the locals buffer."
@@ -3549,14 +3572,14 @@ member."
3549 (if (or (not value) 3572 (if (or (not value)
3550 (string-match "\\0x" value)) 3573 (string-match "\\0x" value))
3551 (add-text-properties 0 (length name) 3574 (add-text-properties 0 (length name)
3552 `(mouse-face highlight 3575 `(mouse-face highlight
3553 help-echo "mouse-2: create watch expression" 3576 help-echo "mouse-2: create watch expression"
3554 local-map ,gdb-locals-watch-map) 3577 local-map ,gdb-locals-watch-map)
3555 name) 3578 name)
3556 (add-text-properties 0 (length value) 3579 (add-text-properties 0 (length value)
3557 `(mouse-face highlight 3580 `(mouse-face highlight
3558 help-echo "mouse-2: edit value" 3581 help-echo "mouse-2: edit value"
3559 local-map ,gdb-edit-locals-map-1) 3582 local-map ,gdb-edit-locals-map-1)
3560 value)) 3583 value))
3561 (gdb-table-add-row 3584 (gdb-table-add-row
3562 table 3585 table
@@ -3568,7 +3591,8 @@ member."
3568 (insert (gdb-table-string table " ")) 3591 (insert (gdb-table-string table " "))
3569 (setq mode-name 3592 (setq mode-name
3570 (gdb-current-context-mode-name 3593 (gdb-current-context-mode-name
3571 (concat "Locals: " (bindat-get-field (gdb-current-buffer-frame) 'func)))))) 3594 (concat "Locals: "
3595 (bindat-get-field (gdb-current-buffer-frame) 'func))))))
3572 3596
3573(defvar gdb-locals-header 3597(defvar gdb-locals-header
3574 (list 3598 (list
@@ -3576,19 +3600,20 @@ member."
3576 nil nil mode-line) 3600 nil nil mode-line)
3577 " " 3601 " "
3578 (gdb-propertize-header "Registers" gdb-registers-buffer 3602 (gdb-propertize-header "Registers" gdb-registers-buffer
3579 "mouse-1: select" mode-line-highlight mode-line-inactive))) 3603 "mouse-1: select" mode-line-highlight
3604 mode-line-inactive)))
3580 3605
3581(defvar gdb-locals-mode-map 3606(defvar gdb-locals-mode-map
3582 (let ((map (make-sparse-keymap))) 3607 (let ((map (make-sparse-keymap)))
3583 (suppress-keymap map) 3608 (suppress-keymap map)
3584 (define-key map "q" 'kill-this-buffer) 3609 (define-key map "q" 'kill-this-buffer)
3585 (define-key map "\t" (lambda () 3610 (define-key map "\t" (lambda ()
3586 (interactive) 3611 (interactive)
3587 (gdb-set-window-buffer 3612 (gdb-set-window-buffer
3588 (gdb-get-buffer-create 3613 (gdb-get-buffer-create
3589 'gdb-registers-buffer 3614 'gdb-registers-buffer
3590 gdb-thread-number) t))) 3615 gdb-thread-number) t)))
3591 map)) 3616 map))
3592 3617
3593(define-derived-mode gdb-locals-mode gdb-parent-mode "Locals" 3618(define-derived-mode gdb-locals-mode gdb-parent-mode "Locals"
3594 "Major mode for gdb locals." 3619 "Major mode for gdb locals."
@@ -3600,18 +3625,18 @@ member."
3600 (concat "locals of " (gdb-get-target-string)))) 3625 (concat "locals of " (gdb-get-target-string))))
3601 3626
3602(def-gdb-display-buffer 3627(def-gdb-display-buffer
3603 gdb-display-locals-buffer 3628 gdb-display-locals-buffer
3604 'gdb-locals-buffer 3629 'gdb-locals-buffer
3605 "Display local variables of current stack and their values.") 3630 "Display local variables of current stack and their values.")
3606 3631
3607(def-gdb-preempt-display-buffer 3632(def-gdb-preempt-display-buffer
3608 gdb-preemptively-display-locals-buffer 3633 gdb-preemptively-display-locals-buffer
3609 'gdb-locals-buffer nil t) 3634 'gdb-locals-buffer nil t)
3610 3635
3611(def-gdb-frame-for-buffer 3636(def-gdb-frame-for-buffer
3612 gdb-frame-locals-buffer 3637 gdb-frame-locals-buffer
3613 'gdb-locals-buffer 3638 'gdb-locals-buffer
3614 "Display local variables of current stack and their values in a new frame.") 3639 "Display local variables of current stack and their values in a new frame.")
3615 3640
3616 3641
3617;; Registers buffer. 3642;; Registers buffer.
@@ -3631,7 +3656,8 @@ member."
3631 3656
3632(defun gdb-registers-handler-custom () 3657(defun gdb-registers-handler-custom ()
3633 (when gdb-register-names 3658 (when gdb-register-names
3634 (let ((register-values (bindat-get-field (gdb-json-partial-output) 'register-values)) 3659 (let ((register-values
3660 (bindat-get-field (gdb-json-partial-output) 'register-values))
3635 (table (make-gdb-table))) 3661 (table (make-gdb-table)))
3636 (dolist (register register-values) 3662 (dolist (register register-values)
3637 (let* ((register-number (bindat-get-field register 'number)) 3663 (let* ((register-number (bindat-get-field register 'number))
@@ -3641,7 +3667,8 @@ member."
3641 (gdb-table-add-row 3667 (gdb-table-add-row
3642 table 3668 table
3643 (list 3669 (list
3644 (propertize register-name 'font-lock-face font-lock-variable-name-face) 3670 (propertize register-name
3671 'font-lock-face font-lock-variable-name-face)
3645 (if (member register-number gdb-changed-registers) 3672 (if (member register-number gdb-changed-registers)
3646 (propertize value 'font-lock-face font-lock-warning-face) 3673 (propertize value 'font-lock-face font-lock-warning-face)
3647 value)) 3674 value))
@@ -3671,17 +3698,18 @@ member."
3671 (define-key map [mouse-2] 'gdb-edit-register-value) 3698 (define-key map [mouse-2] 'gdb-edit-register-value)
3672 (define-key map "q" 'kill-this-buffer) 3699 (define-key map "q" 'kill-this-buffer)
3673 (define-key map "\t" (lambda () 3700 (define-key map "\t" (lambda ()
3674 (interactive) 3701 (interactive)
3675 (gdb-set-window-buffer 3702 (gdb-set-window-buffer
3676 (gdb-get-buffer-create 3703 (gdb-get-buffer-create
3677 'gdb-locals-buffer 3704 'gdb-locals-buffer
3678 gdb-thread-number) t))) 3705 gdb-thread-number) t)))
3679 map)) 3706 map))
3680 3707
3681(defvar gdb-registers-header 3708(defvar gdb-registers-header
3682 (list 3709 (list
3683 (gdb-propertize-header "Locals" gdb-locals-buffer 3710 (gdb-propertize-header "Locals" gdb-locals-buffer
3684 "mouse-1: select" mode-line-highlight mode-line-inactive) 3711 "mouse-1: select" mode-line-highlight
3712 mode-line-inactive)
3685 " " 3713 " "
3686 (gdb-propertize-header "Registers" gdb-registers-buffer 3714 (gdb-propertize-header "Registers" gdb-registers-buffer
3687 nil nil mode-line))) 3715 nil nil mode-line)))
@@ -3696,17 +3724,17 @@ member."
3696 (concat "registers of " (gdb-get-target-string)))) 3724 (concat "registers of " (gdb-get-target-string))))
3697 3725
3698(def-gdb-display-buffer 3726(def-gdb-display-buffer
3699 gdb-display-registers-buffer 3727 gdb-display-registers-buffer
3700 'gdb-registers-buffer 3728 'gdb-registers-buffer
3701 "Display integer register contents.") 3729 "Display integer register contents.")
3702 3730
3703(def-gdb-preempt-display-buffer 3731(def-gdb-preempt-display-buffer
3704 gdb-preemptively-display-registers-buffer 3732 gdb-preemptively-display-registers-buffer
3705 'gdb-registers-buffer nil t) 3733 'gdb-registers-buffer nil t)
3706 3734
3707(def-gdb-frame-for-buffer 3735(def-gdb-frame-for-buffer
3708 gdb-frame-registers-buffer 3736 gdb-frame-registers-buffer
3709 'gdb-registers-buffer 3737 'gdb-registers-buffer
3710 "Display integer register contents in a new frame.") 3738 "Display integer register contents in a new frame.")
3711 3739
3712;; Needs GDB 6.4 onwards (used to fail with no stack). 3740;; Needs GDB 6.4 onwards (used to fail with no stack).
@@ -3723,14 +3751,16 @@ member."
3723(defun gdb-changed-registers-handler () 3751(defun gdb-changed-registers-handler ()
3724 (gdb-delete-pending 'gdb-get-changed-registers) 3752 (gdb-delete-pending 'gdb-get-changed-registers)
3725 (setq gdb-changed-registers nil) 3753 (setq gdb-changed-registers nil)
3726 (dolist (register-number (bindat-get-field (gdb-json-partial-output) 'changed-registers)) 3754 (dolist (register-number
3755 (bindat-get-field (gdb-json-partial-output) 'changed-registers))
3727 (push register-number gdb-changed-registers))) 3756 (push register-number gdb-changed-registers)))
3728 3757
3729(defun gdb-register-names-handler () 3758(defun gdb-register-names-handler ()
3730 ;; Don't use gdb-pending-triggers because this handler is called 3759 ;; Don't use gdb-pending-triggers because this handler is called
3731 ;; only once (in gdb-init-1) 3760 ;; only once (in gdb-init-1)
3732 (setq gdb-register-names nil) 3761 (setq gdb-register-names nil)
3733 (dolist (register-name (bindat-get-field (gdb-json-partial-output) 'register-names)) 3762 (dolist (register-name
3763 (bindat-get-field (gdb-json-partial-output) 'register-names))
3734 (push register-name gdb-register-names)) 3764 (push register-name gdb-register-names))
3735 (setq gdb-register-names (reverse gdb-register-names))) 3765 (setq gdb-register-names (reverse gdb-register-names)))
3736 3766
@@ -3755,7 +3785,8 @@ thread. Called from `gdb-update'."
3755 (if (not (gdb-pending-p 'gdb-get-main-selected-frame)) 3785 (if (not (gdb-pending-p 'gdb-get-main-selected-frame))
3756 (progn 3786 (progn
3757 (gdb-input 3787 (gdb-input
3758 (list (gdb-current-context-command "-stack-info-frame") 'gdb-frame-handler)) 3788 (list (gdb-current-context-command "-stack-info-frame")
3789 'gdb-frame-handler))
3759 (gdb-add-pending 'gdb-get-main-selected-frame)))) 3790 (gdb-add-pending 'gdb-get-main-selected-frame))))
3760 3791
3761(defun gdb-frame-handler () 3792(defun gdb-frame-handler ()
@@ -3806,10 +3837,10 @@ window and show BUF there, if the window is not used for GDB
3806already, in which case that window is splitted first." 3837already, in which case that window is splitted first."
3807 (let ((answer (get-buffer-window buf (or frame 0)))) 3838 (let ((answer (get-buffer-window buf (or frame 0))))
3808 (if answer 3839 (if answer
3809 (display-buffer buf nil (or frame 0)) ;Deiconify the frame if necessary. 3840 (display-buffer buf nil (or frame 0)) ;Deiconify frame if necessary.
3810 (let ((window (get-lru-window))) 3841 (let ((window (get-lru-window)))
3811 (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window)) 3842 (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window))
3812 'gdbmi) 3843 'gdbmi)
3813 (let ((largest (get-largest-window))) 3844 (let ((largest (get-largest-window)))
3814 (setq answer (split-window largest)) 3845 (setq answer (split-window largest))
3815 (set-window-buffer answer buf) 3846 (set-window-buffer answer buf)
@@ -3872,7 +3903,8 @@ SPLIT-HORIZONTAL and show BUF in the new window."
3872 (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer)) 3903 (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))
3873 (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) 3904 (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
3874 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) 3905 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
3875 (define-key menu [disassembly] '("Disassembly" . gdb-frame-disassembly-buffer)) 3906 (define-key menu [disassembly]
3907 '("Disassembly" . gdb-frame-disassembly-buffer))
3876 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) 3908 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
3877 (define-key menu [inferior] 3909 (define-key menu [inferior]
3878 '("IO" . gdb-frame-io-buffer)) 3910 '("IO" . gdb-frame-io-buffer))
@@ -3883,40 +3915,41 @@ SPLIT-HORIZONTAL and show BUF in the new window."
3883 3915
3884(let ((menu (make-sparse-keymap "GDB-MI"))) 3916(let ((menu (make-sparse-keymap "GDB-MI")))
3885 (define-key menu [gdb-customize] 3917 (define-key menu [gdb-customize]
3886 '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb)) 3918 '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb))
3887 :help "Customize Gdb Graphical Mode options.")) 3919 :help "Customize Gdb Graphical Mode options."))
3888 (define-key menu [gdb-many-windows] 3920 (define-key menu [gdb-many-windows]
3889 '(menu-item "Display Other Windows" gdb-many-windows 3921 '(menu-item "Display Other Windows" gdb-many-windows
3890 :help "Toggle display of locals, stack and breakpoint information" 3922 :help "Toggle display of locals, stack and breakpoint information"
3891 :button (:toggle . gdb-many-windows))) 3923 :button (:toggle . gdb-many-windows)))
3892 (define-key menu [gdb-restore-windows] 3924 (define-key menu [gdb-restore-windows]
3893 '(menu-item "Restore Window Layout" gdb-restore-windows 3925 '(menu-item "Restore Window Layout" gdb-restore-windows
3894 :help "Restore standard layout for debug session.")) 3926 :help "Restore standard layout for debug session."))
3895 (define-key menu [sep1] 3927 (define-key menu [sep1]
3896 '(menu-item "--")) 3928 '(menu-item "--"))
3897 (define-key menu [all-threads] 3929 (define-key menu [all-threads]
3898 '(menu-item "GUD controls all threads" 3930 '(menu-item "GUD controls all threads"
3899 (lambda () 3931 (lambda ()
3900 (interactive) 3932 (interactive)
3901 (setq gdb-gud-control-all-threads t)) 3933 (setq gdb-gud-control-all-threads t))
3902 :help "GUD start/stop commands apply to all threads" 3934 :help "GUD start/stop commands apply to all threads"
3903 :button (:radio . gdb-gud-control-all-threads))) 3935 :button (:radio . gdb-gud-control-all-threads)))
3904 (define-key menu [current-thread] 3936 (define-key menu [current-thread]
3905 '(menu-item "GUD controls current thread" 3937 '(menu-item "GUD controls current thread"
3906 (lambda () 3938 (lambda ()
3907 (interactive) 3939 (interactive)
3908 (setq gdb-gud-control-all-threads nil)) 3940 (setq gdb-gud-control-all-threads nil))
3909 :help "GUD start/stop commands apply to current thread only" 3941 :help "GUD start/stop commands apply to current thread only"
3910 :button (:radio . (not gdb-gud-control-all-threads)))) 3942 :button (:radio . (not gdb-gud-control-all-threads))))
3911 (define-key menu [sep2] 3943 (define-key menu [sep2]
3912 '(menu-item "--")) 3944 '(menu-item "--"))
3913 (define-key menu [gdb-customize-reasons] 3945 (define-key menu [gdb-customize-reasons]
3914 '(menu-item "Customize switching..." 3946 '(menu-item "Customize switching..."
3915 (lambda () 3947 (lambda ()
3916 (interactive) 3948 (interactive)
3917 (customize-option 'gdb-switch-reasons)))) 3949 (customize-option 'gdb-switch-reasons))))
3918 (define-key menu [gdb-switch-when-another-stopped] 3950 (define-key menu [gdb-switch-when-another-stopped]
3919 (menu-bar-make-toggle gdb-toggle-switch-when-another-stopped gdb-switch-when-another-stopped 3951 (menu-bar-make-toggle gdb-toggle-switch-when-another-stopped
3952 gdb-switch-when-another-stopped
3920 "Automatically switch to stopped thread" 3953 "Automatically switch to stopped thread"
3921 "GDB thread switching %s" 3954 "GDB thread switching %s"
3922 "Switch to stopped thread")) 3955 "Switch to stopped thread"))
@@ -3930,18 +3963,18 @@ SPLIT-HORIZONTAL and show BUF in the new window."
3930;; show up right before Run button. 3963;; show up right before Run button.
3931(define-key-after gud-tool-bar-map [all-threads] 3964(define-key-after gud-tool-bar-map [all-threads]
3932 '(menu-item "Switch to non-stop/A mode" gdb-control-all-threads 3965 '(menu-item "Switch to non-stop/A mode" gdb-control-all-threads
3933 :image (find-image '((:type xpm :file "gud/thread.xpm"))) 3966 :image (find-image '((:type xpm :file "gud/thread.xpm")))
3934 :visible (and (eq gud-minor-mode 'gdbmi) 3967 :visible (and (eq gud-minor-mode 'gdbmi)
3935 gdb-non-stop 3968 gdb-non-stop
3936 (not gdb-gud-control-all-threads))) 3969 (not gdb-gud-control-all-threads)))
3937 'run) 3970 'run)
3938 3971
3939(define-key-after gud-tool-bar-map [current-thread] 3972(define-key-after gud-tool-bar-map [current-thread]
3940 '(menu-item "Switch to non-stop/T mode" gdb-control-current-thread 3973 '(menu-item "Switch to non-stop/T mode" gdb-control-current-thread
3941 :image (find-image '((:type xpm :file "gud/all.xpm"))) 3974 :image (find-image '((:type xpm :file "gud/all.xpm")))
3942 :visible (and (eq gud-minor-mode 'gdbmi) 3975 :visible (and (eq gud-minor-mode 'gdbmi)
3943 gdb-non-stop 3976 gdb-non-stop
3944 gdb-gud-control-all-threads)) 3977 gdb-gud-control-all-threads))
3945 'all-threads) 3978 'all-threads)
3946 3979
3947(defun gdb-frame-gdb-buffer () 3980(defun gdb-frame-gdb-buffer ()
@@ -3960,15 +3993,16 @@ SPLIT-HORIZONTAL and show BUF in the new window."
3960 (let ((same-window-regexps nil)) 3993 (let ((same-window-regexps nil))
3961 (select-window (display-buffer gud-comint-buffer nil 0)))) 3994 (select-window (display-buffer gud-comint-buffer nil 0))))
3962 3995
3963(defun gdb-set-window-buffer (name &optional ignore-dedicated) 3996(defun gdb-set-window-buffer (name &optional ignore-dedicated window)
3964 "Set buffer of selected window to NAME and dedicate window. 3997 "Set buffer of selected window to NAME and dedicate window.
3965 3998
3966When IGNORE-DEDICATED is non-nil, buffer is set even if selected 3999When IGNORE-DEDICATED is non-nil, buffer is set even if selected
3967window is dedicated." 4000window is dedicated."
4001 (unless window (setq window (selected-window)))
3968 (when ignore-dedicated 4002 (when ignore-dedicated
3969 (set-window-dedicated-p (selected-window) nil)) 4003 (set-window-dedicated-p window nil))
3970 (set-window-buffer (selected-window) (get-buffer name)) 4004 (set-window-buffer window (get-buffer name))
3971 (set-window-dedicated-p (selected-window) t)) 4005 (set-window-dedicated-p window t))
3972 4006
3973(defun gdb-setup-windows () 4007(defun gdb-setup-windows ()
3974 "Layout the window pattern for `gdb-many-windows'." 4008 "Layout the window pattern for `gdb-many-windows'."
@@ -3977,35 +4011,35 @@ window is dedicated."
3977 (delete-other-windows) 4011 (delete-other-windows)
3978 (gdb-display-breakpoints-buffer) 4012 (gdb-display-breakpoints-buffer)
3979 (delete-other-windows) 4013 (delete-other-windows)
3980 ; Don't dedicate. 4014 ;; Don't dedicate.
3981 (pop-to-buffer gud-comint-buffer) 4015 (pop-to-buffer gud-comint-buffer)
3982 (split-window nil ( / ( * (window-height) 3) 4)) 4016 (let ((win0 (selected-window))
3983 (split-window nil ( / (window-height) 3)) 4017 (win1 (split-window nil ( / ( * (window-height) 3) 4)))
3984 (split-window-horizontally) 4018 (win2 (split-window nil ( / (window-height) 3)))
3985 (other-window 1) 4019 (win3 (split-window-horizontally)))
3986 (gdb-set-window-buffer (gdb-locals-buffer-name)) 4020 (gdb-set-window-buffer (gdb-locals-buffer-name) nil win3)
3987 (other-window 1) 4021 (select-window win2)
3988 (switch-to-buffer 4022 (set-window-buffer
3989 (if gud-last-last-frame 4023 win2
3990 (gud-find-file (car gud-last-last-frame)) 4024 (if gud-last-last-frame
3991 (if gdb-main-file 4025 (gud-find-file (car gud-last-last-frame))
3992 (gud-find-file gdb-main-file) 4026 (if gdb-main-file
3993 ;; Put buffer list in window if we 4027 (gud-find-file gdb-main-file)
3994 ;; can't find a source file. 4028 ;; Put buffer list in window if we
3995 (list-buffers-noselect)))) 4029 ;; can't find a source file.
3996 (setq gdb-source-window (selected-window)) 4030 (list-buffers-noselect))))
3997 (split-window-horizontally) 4031 (setq gdb-source-window (selected-window))
3998 (other-window 1) 4032 (let ((win4 (split-window-horizontally)))
3999 (gdb-set-window-buffer 4033 (gdb-set-window-buffer
4000 (gdb-get-buffer-create 'gdb-inferior-io)) 4034 (gdb-get-buffer-create 'gdb-inferior-io) nil win4))
4001 (other-window 1) 4035 (select-window win1)
4002 (gdb-set-window-buffer (gdb-stack-buffer-name)) 4036 (gdb-set-window-buffer (gdb-stack-buffer-name))
4003 (split-window-horizontally) 4037 (let ((win5 (split-window-horizontally)))
4004 (other-window 1) 4038 (gdb-set-window-buffer (if gdb-show-threads-by-default
4005 (gdb-set-window-buffer (if gdb-show-threads-by-default 4039 (gdb-threads-buffer-name)
4006 (gdb-threads-buffer-name) 4040 (gdb-breakpoints-buffer-name))
4007 (gdb-breakpoints-buffer-name))) 4041 nil win5))
4008 (other-window 1)) 4042 (select-window win0)))
4009 4043
4010(defcustom gdb-many-windows nil 4044(defcustom gdb-many-windows nil
4011 "If nil just pop up the GUD buffer unless `gdb-show-main' is t. 4045 "If nil just pop up the GUD buffer unless `gdb-show-main' is t.
@@ -4022,34 +4056,33 @@ of the debugged program. Non-nil means display the layout shown for
4022With arg, display additional buffers iff arg is positive." 4056With arg, display additional buffers iff arg is positive."
4023 (interactive "P") 4057 (interactive "P")
4024 (setq gdb-many-windows 4058 (setq gdb-many-windows
4025 (if (null arg) 4059 (if (null arg)
4026 (not gdb-many-windows) 4060 (not gdb-many-windows)
4027 (> (prefix-numeric-value arg) 0))) 4061 (> (prefix-numeric-value arg) 0)))
4028 (message (format "Display of other windows %sabled" 4062 (message (format "Display of other windows %sabled"
4029 (if gdb-many-windows "en" "dis"))) 4063 (if gdb-many-windows "en" "dis")))
4030 (if (and gud-comint-buffer 4064 (if (and gud-comint-buffer
4031 (buffer-name gud-comint-buffer)) 4065 (buffer-name gud-comint-buffer))
4032 (condition-case nil 4066 (condition-case nil
4033 (gdb-restore-windows) 4067 (gdb-restore-windows)
4034 (error nil)))) 4068 (error nil))))
4035 4069
4036(defun gdb-restore-windows () 4070(defun gdb-restore-windows ()
4037 "Restore the basic arrangement of windows used by gdb. 4071 "Restore the basic arrangement of windows used by gdb.
4038This arrangement depends on the value of `gdb-many-windows'." 4072This arrangement depends on the value of `gdb-many-windows'."
4039 (interactive) 4073 (interactive)
4040 (pop-to-buffer gud-comint-buffer) ;Select the right window and frame. 4074 (pop-to-buffer gud-comint-buffer) ;Select the right window and frame.
4041 (delete-other-windows) 4075 (delete-other-windows)
4042 (if gdb-many-windows 4076 (if gdb-many-windows
4043 (gdb-setup-windows) 4077 (gdb-setup-windows)
4044 (when (or gud-last-last-frame gdb-show-main) 4078 (when (or gud-last-last-frame gdb-show-main)
4045 (split-window) 4079 (let ((win (split-window)))
4046 (other-window 1) 4080 (set-window-buffer
4047 (switch-to-buffer 4081 win
4048 (if gud-last-last-frame 4082 (if gud-last-last-frame
4049 (gud-find-file (car gud-last-last-frame)) 4083 (gud-find-file (car gud-last-last-frame))
4050 (gud-find-file gdb-main-file))) 4084 (gud-find-file gdb-main-file)))
4051 (setq gdb-source-window (selected-window)) 4085 (setq gdb-source-window win)))))
4052 (other-window 1))))
4053 4086
4054(defun gdb-reset () 4087(defun gdb-reset ()
4055 "Exit a debugging session cleanly. 4088 "Exit a debugging session cleanly.
@@ -4057,23 +4090,23 @@ Kills the gdb buffers, and resets variables and the source buffers."
4057 (dolist (buffer (buffer-list)) 4090 (dolist (buffer (buffer-list))
4058 (unless (eq buffer gud-comint-buffer) 4091 (unless (eq buffer gud-comint-buffer)
4059 (with-current-buffer buffer 4092 (with-current-buffer buffer
4060 (if (eq gud-minor-mode 'gdbmi) 4093 (if (eq gud-minor-mode 'gdbmi)
4061 (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name)) 4094 (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name))
4062 (kill-buffer nil) 4095 (kill-buffer nil)
4063 (gdb-remove-breakpoint-icons (point-min) (point-max) t) 4096 (gdb-remove-breakpoint-icons (point-min) (point-max) t)
4064 (setq gud-minor-mode nil) 4097 (setq gud-minor-mode nil)
4065 (kill-local-variable 'tool-bar-map) 4098 (kill-local-variable 'tool-bar-map)
4066 (kill-local-variable 'gdb-define-alist)))))) 4099 (kill-local-variable 'gdb-define-alist))))))
4067 (setq gdb-disassembly-position nil) 4100 (setq gdb-disassembly-position nil)
4068 (setq overlay-arrow-variable-list 4101 (setq overlay-arrow-variable-list
4069 (delq 'gdb-disassembly-position overlay-arrow-variable-list)) 4102 (delq 'gdb-disassembly-position overlay-arrow-variable-list))
4070 (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) 4103 (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
4071 (setq gdb-stack-position nil) 4104 (setq gdb-stack-position nil)
4072 (setq overlay-arrow-variable-list 4105 (setq overlay-arrow-variable-list
4073 (delq 'gdb-stack-position overlay-arrow-variable-list)) 4106 (delq 'gdb-stack-position overlay-arrow-variable-list))
4074 (setq gdb-thread-position nil) 4107 (setq gdb-thread-position nil)
4075 (setq overlay-arrow-variable-list 4108 (setq overlay-arrow-variable-list
4076 (delq 'gdb-thread-position overlay-arrow-variable-list)) 4109 (delq 'gdb-thread-position overlay-arrow-variable-list))
4077 (if (boundp 'speedbar-frame) (speedbar-timer-fn)) 4110 (if (boundp 'speedbar-frame) (speedbar-timer-fn))
4078 (setq gud-running nil) 4111 (setq gud-running nil)
4079 (setq gdb-active-process nil) 4112 (setq gdb-active-process nil)
@@ -4085,12 +4118,12 @@ buffers, if required."
4085 (goto-char (point-min)) 4118 (goto-char (point-min))
4086 (if (re-search-forward gdb-source-file-regexp nil t) 4119 (if (re-search-forward gdb-source-file-regexp nil t)
4087 (setq gdb-main-file (match-string 1))) 4120 (setq gdb-main-file (match-string 1)))
4088 (if gdb-many-windows 4121 (if gdb-many-windows
4089 (gdb-setup-windows) 4122 (gdb-setup-windows)
4090 (gdb-get-buffer-create 'gdb-breakpoints-buffer) 4123 (gdb-get-buffer-create 'gdb-breakpoints-buffer)
4091 (if gdb-show-main 4124 (if gdb-show-main
4092 (let ((pop-up-windows t)) 4125 (let ((pop-up-windows t))
4093 (display-buffer (gud-find-file gdb-main-file)))))) 4126 (display-buffer (gud-find-file gdb-main-file))))))
4094 4127
4095;;from put-image 4128;;from put-image
4096(defun gdb-put-string (putstring pos &optional dprop &rest sprops) 4129(defun gdb-put-string (putstring pos &optional dprop &rest sprops)
@@ -4099,14 +4132,14 @@ PUTSTRING is displayed by putting an overlay into the current buffer with a
4099`before-string' string that has a `display' property whose value is 4132`before-string' string that has a `display' property whose value is
4100PUTSTRING." 4133PUTSTRING."
4101 (let ((string (make-string 1 ?x)) 4134 (let ((string (make-string 1 ?x))
4102 (buffer (current-buffer))) 4135 (buffer (current-buffer)))
4103 (setq putstring (copy-sequence putstring)) 4136 (setq putstring (copy-sequence putstring))
4104 (let ((overlay (make-overlay pos pos buffer)) 4137 (let ((overlay (make-overlay pos pos buffer))
4105 (prop (or dprop 4138 (prop (or dprop
4106 (list (list 'margin 'left-margin) putstring)))) 4139 (list (list 'margin 'left-margin) putstring))))
4107 (put-text-property 0 1 'display prop string) 4140 (put-text-property 0 1 'display prop string)
4108 (if sprops 4141 (if sprops
4109 (add-text-properties 0 1 sprops string)) 4142 (add-text-properties 0 1 sprops string))
4110 (overlay-put overlay 'put-break t) 4143 (overlay-put overlay 'put-break t)
4111 (overlay-put overlay 'before-string string)))) 4144 (overlay-put overlay 'before-string string))))
4112 4145
@@ -4119,7 +4152,7 @@ BUFFER nil or omitted means use the current buffer."
4119 (setq buffer (current-buffer))) 4152 (setq buffer (current-buffer)))
4120 (dolist (overlay (overlays-in start end)) 4153 (dolist (overlay (overlays-in start end))
4121 (when (overlay-get overlay 'put-break) 4154 (when (overlay-get overlay 'put-break)
4122 (delete-overlay overlay)))) 4155 (delete-overlay overlay))))
4123 4156
4124(defun gdb-put-breakpoint-icon (enabled bptno &optional line) 4157(defun gdb-put-breakpoint-icon (enabled bptno &optional line)
4125 (let* ((posns (gdb-line-posns (or line (line-number-at-pos)))) 4158 (let* ((posns (gdb-line-posns (or line (line-number-at-pos))))
@@ -4131,62 +4164,63 @@ BUFFER nil or omitted means use the current buffer."
4131 0 1 '(help-echo "mouse-1: clear bkpt, mouse-3: enable/disable bkpt") 4164 0 1 '(help-echo "mouse-1: clear bkpt, mouse-3: enable/disable bkpt")
4132 putstring) 4165 putstring)
4133 (if enabled 4166 (if enabled
4134 (add-text-properties 4167 (add-text-properties
4135 0 1 `(gdb-bptno ,bptno gdb-enabled t) putstring) 4168 0 1 `(gdb-bptno ,bptno gdb-enabled t) putstring)
4136 (add-text-properties 4169 (add-text-properties
4137 0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring)) 4170 0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring))
4138 (gdb-remove-breakpoint-icons start end) 4171 (gdb-remove-breakpoint-icons start end)
4139 (if (display-images-p) 4172 (if (display-images-p)
4140 (if (>= (or left-fringe-width 4173 (if (>= (or left-fringe-width
4141 (if source-window (car (window-fringes source-window))) 4174 (if source-window (car (window-fringes source-window)))
4142 gdb-buffer-fringe-width) 8) 4175 gdb-buffer-fringe-width) 8)
4143 (gdb-put-string 4176 (gdb-put-string
4144 nil (1+ start) 4177 nil (1+ start)
4145 `(left-fringe breakpoint 4178 `(left-fringe breakpoint
4146 ,(if enabled 4179 ,(if enabled
4147 'breakpoint-enabled 4180 'breakpoint-enabled
4148 'breakpoint-disabled)) 4181 'breakpoint-disabled))
4149 'gdb-bptno bptno 4182 'gdb-bptno bptno
4150 'gdb-enabled enabled) 4183 'gdb-enabled enabled)
4151 (when (< left-margin-width 2) 4184 (when (< left-margin-width 2)
4152 (save-current-buffer 4185 (save-current-buffer
4153 (setq left-margin-width 2) 4186 (setq left-margin-width 2)
4154 (if source-window 4187 (if source-window
4155 (set-window-margins 4188 (set-window-margins
4156 source-window 4189 source-window
4157 left-margin-width right-margin-width)))) 4190 left-margin-width right-margin-width))))
4158 (put-image 4191 (put-image
4159 (if enabled 4192 (if enabled
4160 (or breakpoint-enabled-icon 4193 (or breakpoint-enabled-icon
4161 (setq breakpoint-enabled-icon 4194 (setq breakpoint-enabled-icon
4162 (find-image `((:type xpm :data 4195 (find-image `((:type xpm :data
4163 ,breakpoint-xpm-data 4196 ,breakpoint-xpm-data
4164 :ascent 100 :pointer hand) 4197 :ascent 100 :pointer hand)
4165 (:type pbm :data 4198 (:type pbm :data
4166 ,breakpoint-enabled-pbm-data 4199 ,breakpoint-enabled-pbm-data
4167 :ascent 100 :pointer hand))))) 4200 :ascent 100 :pointer hand)))))
4168 (or breakpoint-disabled-icon 4201 (or breakpoint-disabled-icon
4169 (setq breakpoint-disabled-icon 4202 (setq breakpoint-disabled-icon
4170 (find-image `((:type xpm :data 4203 (find-image `((:type xpm :data
4171 ,breakpoint-xpm-data 4204 ,breakpoint-xpm-data
4172 :conversion disabled 4205 :conversion disabled
4173 :ascent 100 :pointer hand) 4206 :ascent 100 :pointer hand)
4174 (:type pbm :data 4207 (:type pbm :data
4175 ,breakpoint-disabled-pbm-data 4208 ,breakpoint-disabled-pbm-data
4176 :ascent 100 :pointer hand)))))) 4209 :ascent 100 :pointer hand))))))
4177 (+ start 1) 4210 (+ start 1)
4178 putstring 4211 putstring
4179 'left-margin)) 4212 'left-margin))
4180 (when (< left-margin-width 2) 4213 (when (< left-margin-width 2)
4181 (save-current-buffer 4214 (save-current-buffer
4182 (setq left-margin-width 2) 4215 (setq left-margin-width 2)
4183 (let ((window (get-buffer-window (current-buffer) 0))) 4216 (let ((window (get-buffer-window (current-buffer) 0)))
4184 (if window 4217 (if window
4185 (set-window-margins 4218 (set-window-margins
4186 window left-margin-width right-margin-width))))) 4219 window left-margin-width right-margin-width)))))
4187 (gdb-put-string 4220 (gdb-put-string
4188 (propertize putstring 4221 (propertize putstring
4189 'face (if enabled 'breakpoint-enabled 'breakpoint-disabled)) 4222 'face (if enabled
4223 'breakpoint-enabled 'breakpoint-disabled))
4190 (1+ start))))) 4224 (1+ start)))))
4191 4225
4192(defun gdb-remove-breakpoint-icons (start end &optional remove-margin) 4226(defun gdb-remove-breakpoint-icons (start end &optional remove-margin)
@@ -4197,8 +4231,8 @@ BUFFER nil or omitted means use the current buffer."
4197 (setq left-margin-width 0) 4231 (setq left-margin-width 0)
4198 (let ((window (get-buffer-window (current-buffer) 0))) 4232 (let ((window (get-buffer-window (current-buffer) 0)))
4199 (if window 4233 (if window
4200 (set-window-margins 4234 (set-window-margins
4201 window left-margin-width right-margin-width))))) 4235 window left-margin-width right-margin-width)))))
4202 4236
4203(provide 'gdb-mi) 4237(provide 'gdb-mi)
4204 4238
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index db8e82193b3..5561575ea20 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -1023,7 +1023,8 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]."
1023 (read-from-minibuffer "Confirm: " 1023 (read-from-minibuffer "Confirm: "
1024 command nil nil 'grep-find-history)) 1024 command nil nil 'grep-find-history))
1025 (add-to-history 'grep-find-history command)) 1025 (add-to-history 'grep-find-history command))
1026 (let ((default-directory dir)) 1026 (let ((default-directory dir)
1027 (process-connection-type nil))
1027 (compilation-start command 'grep-mode)) 1028 (compilation-start command 'grep-mode))
1028 ;; Set default-directory if we started rgrep in the *grep* buffer. 1029 ;; Set default-directory if we started rgrep in the *grep* buffer.
1029 (if (eq next-error-last-buffer (current-buffer)) 1030 (if (eq next-error-last-buffer (current-buffer))
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 259ee81c9ba..a54d1438368 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1581,7 +1581,8 @@ and source-file directory for your debugger."
1581;; Last group is for return value, e.g. "> test.py(2)foo()->None" 1581;; Last group is for return value, e.g. "> test.py(2)foo()->None"
1582;; Either file or function name may be omitted: "> <string>(0)?()" 1582;; Either file or function name may be omitted: "> <string>(0)?()"
1583(defvar gud-pdb-marker-regexp 1583(defvar gud-pdb-marker-regexp
1584 "^> \\([-a-zA-Z0-9_/.:\\]*\\|<string>\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|<module>\\)()\\(->[^\n]*\\)?\n") 1584 "^> \\([-a-zA-Z0-9_/.:\\]*\\|<string>\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|<module>\\)()\\(->[^\n\r]*\\)?[\n\r]")
1585
1585(defvar gud-pdb-marker-regexp-file-group 1) 1586(defvar gud-pdb-marker-regexp-file-group 1)
1586(defvar gud-pdb-marker-regexp-line-group 2) 1587(defvar gud-pdb-marker-regexp-line-group 2)
1587(defvar gud-pdb-marker-regexp-fnname-group 3) 1588(defvar gud-pdb-marker-regexp-fnname-group 3)
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index a0437ccf9ae..1bdcb4cfa89 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3306,8 +3306,8 @@ If one hasn't been set, or if it's stale, prompt for a new one."
3306 #'js--which-func-joiner) 3306 #'js--which-func-joiner)
3307 3307
3308 ;; Comments 3308 ;; Comments
3309 (setq comment-start "// ") 3309 (set (make-local-variable 'comment-start) "// ")
3310 (setq comment-end "") 3310 (set (make-local-variable 'comment-end) "")
3311 (set (make-local-variable 'fill-paragraph-function) 3311 (set (make-local-variable 'fill-paragraph-function)
3312 'js-c-fill-paragraph) 3312 'js-c-fill-paragraph)
3313 3313
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 1da819660d2..80358e1c651 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -4,10 +4,9 @@
4 4
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Maintainer: Michael Mauger <mmaug@yahoo.com> 6;; Maintainer: Michael Mauger <mmaug@yahoo.com>
7;; Version: 2.8 7;; Version: 3.0
8;; Keywords: comm languages processes 8;; Keywords: comm languages processes
9;; URL: http://savannah.gnu.org/projects/emacs/ 9;; URL: http://savannah.gnu.org/projects/emacs/
10;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode
11 10
12;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
13 12
@@ -46,7 +45,7 @@
46;; available in early versions of sql.el. This support has been 45;; available in early versions of sql.el. This support has been
47;; extended and formalized in later versions. Part of the impetus for 46;; extended and formalized in later versions. Part of the impetus for
48;; the improved support of SQL flavors was borne out of the current 47;; the improved support of SQL flavors was borne out of the current
49;; maintainer's consulting experience. In the past fifteen years, I 48;; maintainers consulting experience. In the past twenty years, I
50;; have used Oracle, Sybase, Informix, MySQL, Postgres, and SQLServer. 49;; have used Oracle, Sybase, Informix, MySQL, Postgres, and SQLServer.
51;; On some assignments, I have used two or more of these concurrently. 50;; On some assignments, I have used two or more of these concurrently.
52 51
@@ -130,7 +129,7 @@
130;; identifier characters. 129;; identifier characters.
131 130
132;; (sql-set-product-feature 'xyz 131;; (sql-set-product-feature 'xyz
133;; :syntax-alist ((?# . "w"))) 132;; :syntax-alist ((?# . "_")))
134 133
135;; 4) Define the interactive command interpreter for the database 134;; 4) Define the interactive command interpreter for the database
136;; product. 135;; product.
@@ -184,7 +183,7 @@
184;; (sql-set-product-feature 'xyz 183;; (sql-set-product-feature 'xyz
185;; :sqli-comint-func 'my-sql-comint-xyz) 184;; :sqli-comint-func 'my-sql-comint-xyz)
186 185
187;; 6) Define a convienence function to invoke the SQL interpreter. 186;; 6) Define a convenience function to invoke the SQL interpreter.
188 187
189;; (defun my-sql-xyz (&optional buffer) 188;; (defun my-sql-xyz (&optional buffer)
190;; "Run ixyz by XyzDB as an inferior process." 189;; "Run ixyz by XyzDB as an inferior process."
@@ -230,9 +229,18 @@
230(eval-when-compile 229(eval-when-compile
231 (require 'regexp-opt)) 230 (require 'regexp-opt))
232(require 'custom) 231(require 'custom)
232(require 'thingatpt)
233(eval-when-compile ;; needed in Emacs 19, 20 233(eval-when-compile ;; needed in Emacs 19, 20
234 (setq max-specpdl-size (max max-specpdl-size 2000))) 234 (setq max-specpdl-size (max max-specpdl-size 2000)))
235 235
236(defun sql-signum (n)
237 "Return 1, 0, or -1 to identify the sign of N."
238 (cond
239 ((not (numberp n)) nil)
240 ((< n 0) -1)
241 ((> n 0) 1)
242 (t 0)))
243
236(defvar font-lock-keyword-face) 244(defvar font-lock-keyword-face)
237(defvar font-lock-set-defaults) 245(defvar font-lock-set-defaults)
238(defvar font-lock-string-face) 246(defvar font-lock-string-face)
@@ -327,7 +335,8 @@ Customizing your password will store it in your ~/.emacs file."
327(defvar sql-product-alist 335(defvar sql-product-alist
328 '((ansi 336 '((ansi
329 :name "ANSI" 337 :name "ANSI"
330 :font-lock sql-mode-ansi-font-lock-keywords) 338 :font-lock sql-mode-ansi-font-lock-keywords
339 :statement sql-ansi-statement-starters)
331 340
332 (db2 341 (db2
333 :name "DB2" 342 :name "DB2"
@@ -392,7 +401,7 @@ Customizing your password will store it in your ~/.emacs file."
392 :sqli-comint-func sql-comint-ms 401 :sqli-comint-func sql-comint-ms
393 :prompt-regexp "^[0-9]*>" 402 :prompt-regexp "^[0-9]*>"
394 :prompt-length 5 403 :prompt-length 5
395 :syntax-alist ((?@ . "w")) 404 :syntax-alist ((?@ . "_"))
396 :terminator ("^go" . "go")) 405 :terminator ("^go" . "go"))
397 406
398 (mysql 407 (mysql
@@ -408,6 +417,7 @@ Customizing your password will store it in your ~/.emacs file."
408 :prompt-regexp "^mysql> " 417 :prompt-regexp "^mysql> "
409 :prompt-length 6 418 :prompt-length 6
410 :prompt-cont-regexp "^ -> " 419 :prompt-cont-regexp "^ -> "
420 :syntax-alist ((?# . "< b"))
411 :input-filter sql-remove-tabs-filter) 421 :input-filter sql-remove-tabs-filter)
412 422
413 (oracle 423 (oracle
@@ -417,11 +427,15 @@ Customizing your password will store it in your ~/.emacs file."
417 :sqli-options sql-oracle-options 427 :sqli-options sql-oracle-options
418 :sqli-login sql-oracle-login-params 428 :sqli-login sql-oracle-login-params
419 :sqli-comint-func sql-comint-oracle 429 :sqli-comint-func sql-comint-oracle
430 :list-all sql-oracle-list-all
431 :list-table sql-oracle-list-table
432 :completion-object sql-oracle-completion-object
420 :prompt-regexp "^SQL> " 433 :prompt-regexp "^SQL> "
421 :prompt-length 5 434 :prompt-length 5
422 :prompt-cont-regexp "^\\s-*\\d+> " 435 :prompt-cont-regexp "^\\s-*[[:digit:]]+ "
423 :syntax-alist ((?$ . "w") (?# . "w")) 436 :statement sql-oracle-statement-starters
424 :terminator ("\\(^/\\|;\\)" . "/") 437 :syntax-alist ((?$ . "_") (?# . "_"))
438 :terminator ("\\(^/\\|;\\)$" . "/")
425 :input-filter sql-placeholders-filter) 439 :input-filter sql-placeholders-filter)
426 440
427 (postgres 441 (postgres
@@ -434,11 +448,12 @@ Customizing your password will store it in your ~/.emacs file."
434 :sqli-comint-func sql-comint-postgres 448 :sqli-comint-func sql-comint-postgres
435 :list-all ("\\d+" . "\\dS+") 449 :list-all ("\\d+" . "\\dS+")
436 :list-table ("\\d+ %s" . "\\dS+ %s") 450 :list-table ("\\d+ %s" . "\\dS+ %s")
437 :prompt-regexp "^.*=[#>] " 451 :completion-object sql-postgres-completion-object
452 :prompt-regexp "^\\w*=[#>] "
438 :prompt-length 5 453 :prompt-length 5
439 :prompt-cont-regexp "^.*[-(][#>] " 454 :prompt-cont-regexp "^\\w*[-(][#>] "
440 :input-filter sql-remove-tabs-filter 455 :input-filter sql-remove-tabs-filter
441 :terminator ("\\(^\\s-*\\\\g\\|;\\)" . ";")) 456 :terminator ("\\(^\\s-*\\\\g$\\|;\\)" . "\\g"))
442 457
443 (solid 458 (solid
444 :name "Solid" 459 :name "Solid"
@@ -460,9 +475,10 @@ Customizing your password will store it in your ~/.emacs file."
460 :sqli-comint-func sql-comint-sqlite 475 :sqli-comint-func sql-comint-sqlite
461 :list-all ".tables" 476 :list-all ".tables"
462 :list-table ".schema %s" 477 :list-table ".schema %s"
478 :completion-object sql-sqlite-completion-object
463 :prompt-regexp "^sqlite> " 479 :prompt-regexp "^sqlite> "
464 :prompt-length 8 480 :prompt-length 8
465 :prompt-cont-regexp "^ ...> " 481 :prompt-cont-regexp "^ \.\.\.> "
466 :terminator ";") 482 :terminator ";")
467 483
468 (sybase 484 (sybase
@@ -474,7 +490,7 @@ Customizing your password will store it in your ~/.emacs file."
474 :sqli-comint-func sql-comint-sybase 490 :sqli-comint-func sql-comint-sybase
475 :prompt-regexp "^SQL> " 491 :prompt-regexp "^SQL> "
476 :prompt-length 5 492 :prompt-length 5
477 :syntax-alist ((?@ . "w")) 493 :syntax-alist ((?@ . "_"))
478 :terminator ("^go" . "go")) 494 :terminator ("^go" . "go"))
479 ) 495 )
480 "An alist of product specific configuration settings. 496 "An alist of product specific configuration settings.
@@ -513,10 +529,11 @@ may be any one of the following:
513 :sqli-comint-func name of a function which accepts no 529 :sqli-comint-func name of a function which accepts no
514 parameters that will use the values of 530 parameters that will use the values of
515 `sql-user', `sql-password', 531 `sql-user', `sql-password',
516 `sql-database' and `sql-server' to open a 532 `sql-database', `sql-server' and
517 comint buffer and connect to the 533 `sql-port' to open a comint buffer and
518 database. Do product specific 534 connect to the database. Do product
519 configuration of comint in this function. 535 specific configuration of comint in this
536 function.
520 537
521 :list-all Command string or function which produces 538 :list-all Command string or function which produces
522 a listing of all objects in the database. 539 a listing of all objects in the database.
@@ -535,6 +552,20 @@ may be any one of the following:
535 produces the standard list and the cdr 552 produces the standard list and the cdr
536 produces an enhanced list. 553 produces an enhanced list.
537 554
555 :completion-object A function that returns a list of
556 objects. Called with a single
557 parameter--if nil then list objects
558 accessible in the current schema, if
559 not-nil it is the name of a schema whose
560 objects should be listed.
561
562 :completion-column A function that returns a list of
563 columns. Called with a single
564 parameter--if nil then list objects
565 accessible in the current schema, if
566 not-nil it is the name of a schema whose
567 objects should be listed.
568
538 :prompt-regexp regular expression string that matches 569 :prompt-regexp regular expression string that matches
539 the prompt issued by the product 570 the prompt issued by the product
540 interpreter. 571 interpreter.
@@ -555,6 +586,9 @@ may be any one of the following:
555 filtered string. May also be a list of 586 filtered string. May also be a list of
556 such functions. 587 such functions.
557 588
589 :statement name of a variable containing a regexp that
590 matches the beginning of SQL statements.
591
558 :terminator the terminator to be sent after a 592 :terminator the terminator to be sent after a
559 `sql-send-string', `sql-send-region', 593 `sql-send-string', `sql-send-region',
560 `sql-send-paragraph' and 594 `sql-send-paragraph' and
@@ -574,7 +608,7 @@ using `sql-get-product-feature' to lookup the product specific
574settings.") 608settings.")
575 609
576(defvar sql-indirect-features 610(defvar sql-indirect-features
577 '(:font-lock :sqli-program :sqli-options :sqli-login)) 611 '(:font-lock :sqli-program :sqli-options :sqli-login :statement))
578 612
579(defcustom sql-connection-alist nil 613(defcustom sql-connection-alist nil
580 "An alist of connection parameters for interacting with a SQL 614 "An alist of connection parameters for interacting with a SQL
@@ -683,6 +717,13 @@ it automatically."
683 :version "22.2" 717 :version "22.2"
684 :group 'SQL) 718 :group 'SQL)
685 719
720(defvar sql-contains-names nil
721 "When non-nil, the current buffer contains database names.
722
723Globally should be set to nil; it will be non-nil in `sql-mode',
724`sql-interactive-mode' and list all buffers.")
725
726
686(defcustom sql-pop-to-buffer-after-send-region nil 727(defcustom sql-pop-to-buffer-after-send-region nil
687 "When non-nil, pop to the buffer SQL statements are sent to. 728 "When non-nil, pop to the buffer SQL statements are sent to.
688 729
@@ -770,6 +811,19 @@ is changed."
770 :type 'hook 811 :type 'hook
771 :group 'SQL) 812 :group 'SQL)
772 813
814;; Customization for ANSI
815
816(defcustom sql-ansi-statement-starters (regexp-opt '(
817 "create" "alter" "drop"
818 "select" "insert" "update" "delete" "merge"
819 "grant" "revoke"
820))
821 "Regexp of keywords that start SQL commands
822
823All products share this list; products should define a regexp to
824identify additional keywords in a variable defined by
825the :statement feature.")
826
773;; Customization for Oracle 827;; Customization for Oracle
774 828
775(defcustom sql-oracle-program "sqlplus" 829(defcustom sql-oracle-program "sqlplus"
@@ -795,18 +849,22 @@ You will find the file in your Orant\\bin directory."
795 :version "24.1" 849 :version "24.1"
796 :group 'SQL) 850 :group 'SQL)
797 851
852(defcustom sql-oracle-statement-starters (regexp-opt '("declare" "begin" "with"))
853 "Additional statement starting keywords in Oracle.")
854
798(defcustom sql-oracle-scan-on t 855(defcustom sql-oracle-scan-on t
799 "Non-nil if placeholders should be replaced in Oracle SQLi. 856 "Non-nil if placeholders should be replaced in Oracle SQLi.
800 857
801When non-nil, Emacs will scan text sent to sqlplus and prompt 858When non-nil, Emacs will scan text sent to sqlplus and prompt
802for replacement text for & placeholders as sqlplus does. This 859for replacement text for & placeholders as sqlplus does. This
803is needed on Windows where sqlplus output is buffered and the 860is needed on Windows where SQL*Plus output is buffered and the
804prompts are not shown until after the text is entered. 861prompts are not shown until after the text is entered.
805 862
806You will probably want to issue the following command in sqlplus 863You need to issue the following command in SQL*Plus to be safe:
807to be safe: 864
865 SET DEFINE OFF
808 866
809 SET SCAN OFF" 867In older versions of SQL*Plus, this was the SET SCAN OFF command."
810 :type 'boolean 868 :type 'boolean
811 :group 'SQL) 869 :group 'SQL)
812 870
@@ -833,7 +891,7 @@ Starts `sql-interactive-mode' after doing some setup."
833 :version "24.1" 891 :version "24.1"
834 :group 'SQL) 892 :group 'SQL)
835 893
836;; Customization for MySql 894;; Customization for MySQL
837 895
838(defcustom sql-mysql-program "mysql" 896(defcustom sql-mysql-program "mysql"
839 "Command to start mysql by TcX. 897 "Command to start mysql by TcX.
@@ -851,7 +909,7 @@ on Windows: \"-C\" \"-t\" \"-f\" \"-n\"."
851 :group 'SQL) 909 :group 'SQL)
852 910
853(defcustom sql-mysql-login-params '(user password database server) 911(defcustom sql-mysql-login-params '(user password database server)
854 "List of login parameters needed to connect to MySql." 912 "List of login parameters needed to connect to MySQL."
855 :type 'sql-login-params 913 :type 'sql-login-params
856 :version "24.1" 914 :version "24.1"
857 :group 'SQL) 915 :group 'SQL)
@@ -1085,13 +1143,13 @@ You can change `sql-prompt-length' on `sql-interactive-mode-hook'.")
1085 1143
1086Used by `sql-rename-buffer'.") 1144Used by `sql-rename-buffer'.")
1087 1145
1088(defun sql-buffer-live-p (buffer &optional product) 1146(defun sql-buffer-live-p (buffer &optional product connection)
1089 "Returns non-nil if the process associated with buffer is live. 1147 "Returns non-nil if the process associated with buffer is live.
1090 1148
1091BUFFER can be a buffer object or a buffer name. The buffer must 1149BUFFER can be a buffer object or a buffer name. The buffer must
1092be a live buffer, have an running process attached to it, be in 1150be a live buffer, have an running process attached to it, be in
1093`sql-interactive-mode', and, if PRODUCT is specified, it's 1151`sql-interactive-mode', and, if PRODUCT or CONNECTION are
1094`sql-product' must match." 1152specified, it's `sql-product' or `sql-connection' must match."
1095 1153
1096 (when buffer 1154 (when buffer
1097 (setq buffer (get-buffer buffer)) 1155 (setq buffer (get-buffer buffer))
@@ -1102,7 +1160,9 @@ be a live buffer, have an running process attached to it, be in
1102 (with-current-buffer buffer 1160 (with-current-buffer buffer
1103 (and (derived-mode-p 'sql-interactive-mode) 1161 (and (derived-mode-p 'sql-interactive-mode)
1104 (or (not product) 1162 (or (not product)
1105 (eq product sql-product))))))) 1163 (eq product sql-product))
1164 (or (not connection)
1165 (eq connection sql-connection)))))))
1106 1166
1107;; Keymap for sql-interactive-mode. 1167;; Keymap for sql-interactive-mode.
1108 1168
@@ -1136,6 +1196,8 @@ Based on `comint-mode-map'.")
1136 (define-key map (kbd "C-c C-i") 'sql-product-interactive) 1196 (define-key map (kbd "C-c C-i") 'sql-product-interactive)
1137 (define-key map (kbd "C-c C-l a") 'sql-list-all) 1197 (define-key map (kbd "C-c C-l a") 'sql-list-all)
1138 (define-key map (kbd "C-c C-l t") 'sql-list-table) 1198 (define-key map (kbd "C-c C-l t") 'sql-list-table)
1199 (define-key map [remap beginning-of-defun] 'sql-beginning-of-statement)
1200 (define-key map [remap end-of-defun] 'sql-end-of-statement)
1139 map) 1201 map)
1140 "Mode map used for `sql-mode'.") 1202 "Mode map used for `sql-mode'.")
1141 1203
@@ -1151,8 +1213,10 @@ Based on `comint-mode-map'.")
1151 ["Send Buffer" sql-send-buffer (sql-buffer-live-p sql-buffer)] 1213 ["Send Buffer" sql-send-buffer (sql-buffer-live-p sql-buffer)]
1152 ["Send String" sql-send-string (sql-buffer-live-p sql-buffer)] 1214 ["Send String" sql-send-string (sql-buffer-live-p sql-buffer)]
1153 "--" 1215 "--"
1154 ["List all objects" sql-list-all (sql-buffer-live-p sql-buffer)] 1216 ["List all objects" sql-list-all (and (sql-buffer-live-p sql-buffer)
1155 ["List table details" sql-list-table (sql-buffer-live-p sql-buffer)] 1217 (sql-get-product-feature sql-product :list-all))]
1218 ["List table details" sql-list-table (and (sql-buffer-live-p sql-buffer)
1219 (sql-get-product-feature sql-product :list-table))]
1156 "--" 1220 "--"
1157 ["Start SQLi session" sql-product-interactive 1221 ["Start SQLi session" sql-product-interactive
1158 :visible (not sql-connection-alist) 1222 :visible (not sql-connection-alist)
@@ -1194,8 +1258,8 @@ Based on `comint-mode-map'.")
1194 ["Rename Buffer" sql-rename-buffer t] 1258 ["Rename Buffer" sql-rename-buffer t]
1195 ["Save Connection" sql-save-connection (not sql-connection)] 1259 ["Save Connection" sql-save-connection (not sql-connection)]
1196 "--" 1260 "--"
1197 ["List all objects" sql-list-all t] 1261 ["List all objects" sql-list-all (sql-get-product-feature sql-product :list-all)]
1198 ["List table details" sql-list-table t])) 1262 ["List table details" sql-list-table (sql-get-product-feature sql-product :list-table)]))
1199 1263
1200;; Abbreviations -- if you want more of them, define them in your 1264;; Abbreviations -- if you want more of them, define them in your
1201;; ~/.emacs file. Abbrevs have to be enabled in your ~/.emacs, too. 1265;; ~/.emacs file. Abbrevs have to be enabled in your ~/.emacs, too.
@@ -1238,8 +1302,9 @@ Based on `comint-mode-map'.")
1238 (modify-syntax-entry ?' "\"" table) 1302 (modify-syntax-entry ?' "\"" table)
1239 ;; double quotes (") don't delimit strings 1303 ;; double quotes (") don't delimit strings
1240 (modify-syntax-entry ?\" "." table) 1304 (modify-syntax-entry ?\" "." table)
1241 ;; backslash is no escape character 1305 ;; Make these all punctuation
1242 (modify-syntax-entry ?\\ "." table) 1306 (mapc (lambda (c) (modify-syntax-entry c "." table))
1307 (string-to-list "!#$%&+,.:;<=>?@\\|"))
1243 table) 1308 table)
1244 "Syntax table used in `sql-mode' and `sql-interactive-mode'.") 1309 "Syntax table used in `sql-mode' and `sql-interactive-mode'.")
1245 1310
@@ -1298,20 +1363,45 @@ statement. The format of variable should be a valid
1298 1363
1299 ;; Remove keywords that are defined in ANSI 1364 ;; Remove keywords that are defined in ANSI
1300 (setq kwd keywords) 1365 (setq kwd keywords)
1301 (dolist (k keywords) 1366 ;; (dolist (k keywords)
1302 (catch 'next 1367 ;; (catch 'next
1303 (dolist (a sql-mode-ansi-font-lock-keywords) 1368 ;; (dolist (a sql-mode-ansi-font-lock-keywords)
1304 (when (and (eq face (cdr a)) 1369 ;; (when (and (eq face (cdr a))
1305 (eq (string-match (car a) k 0) 0) 1370 ;; (eq (string-match (car a) k 0) 0)
1306 (eq (match-end 0) (length k))) 1371 ;; (eq (match-end 0) (length k)))
1307 (setq kwd (delq k kwd)) 1372 ;; (setq kwd (delq k kwd))
1308 (throw 'next nil))))) 1373 ;; (throw 'next nil)))))
1309 1374
1310 ;; Create a properly formed font-lock-keywords item 1375 ;; Create a properly formed font-lock-keywords item
1311 (cons (concat (car bdy) 1376 (cons (concat (car bdy)
1312 (regexp-opt kwd t) 1377 (regexp-opt kwd t)
1313 (cdr bdy)) 1378 (cdr bdy))
1314 face)))) 1379 face)))
1380
1381 (defun sql-regexp-abbrev (keyword)
1382 (let ((brk (string-match "[~]" keyword))
1383 (len (length keyword))
1384 (sep "\\(?:")
1385 re i)
1386 (if (not brk)
1387 keyword
1388 (setq re (substring keyword 0 brk)
1389 i (+ 2 brk)
1390 brk (1+ brk))
1391 (while (<= i len)
1392 (setq re (concat re sep (substring keyword brk i))
1393 sep "\\|"
1394 i (1+ i)))
1395 (concat re "\\)?"))))
1396
1397 (defun sql-regexp-abbrev-list (&rest keyw-list)
1398 (let ((re nil)
1399 (sep "\\<\\(?:"))
1400 (while keyw-list
1401 (setq re (concat re sep (sql-regexp-abbrev (car keyw-list)))
1402 sep "\\|"
1403 keyw-list (cdr keyw-list)))
1404 (concat re "\\)\\>"))))
1315 1405
1316(eval-when-compile 1406(eval-when-compile
1317 (setq sql-mode-ansi-font-lock-keywords 1407 (setq sql-mode-ansi-font-lock-keywords
@@ -1346,6 +1436,7 @@ statement. The format of variable should be a valid
1346"user_defined_type_catalog" "user_defined_type_name" 1436"user_defined_type_catalog" "user_defined_type_name"
1347"user_defined_type_schema" 1437"user_defined_type_schema"
1348) 1438)
1439
1349 ;; ANSI Reserved keywords 1440 ;; ANSI Reserved keywords
1350 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil 1441 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
1351"absolute" "action" "add" "admin" "after" "aggregate" "alias" "all" 1442"absolute" "action" "add" "admin" "after" "aggregate" "alias" "all"
@@ -1395,6 +1486,7 @@ statement. The format of variable should be a valid
1395"substring" "sum" "system_user" "translate" "treat" "trim" "upper" 1486"substring" "sum" "system_user" "translate" "treat" "trim" "upper"
1396"user" 1487"user"
1397) 1488)
1489
1398 ;; ANSI Data Types 1490 ;; ANSI Data Types
1399 (sql-font-lock-keywords-builder 'font-lock-type-face nil 1491 (sql-font-lock-keywords-builder 'font-lock-type-face nil
1400"array" "binary" "bit" "blob" "boolean" "char" "character" "clob" 1492"array" "binary" "bit" "blob" "boolean" "char" "character" "clob"
@@ -1414,86 +1506,142 @@ function `regexp-opt'. Therefore, take a look at the source before
1414you define your own `sql-mode-ansi-font-lock-keywords'. You may want 1506you define your own `sql-mode-ansi-font-lock-keywords'. You may want
1415to add functions and PL/SQL keywords.") 1507to add functions and PL/SQL keywords.")
1416 1508
1509(defun sql-oracle-show-reserved-words ()
1510 ;; This function is for use by the maintainer of SQL.EL only.
1511 (interactive)
1512 (if (or (and (not (derived-mode-p 'sql-mode))
1513 (not (derived-mode-p 'sql-interactive-mode)))
1514 (not sql-buffer)
1515 (not (eq sql-product 'oracle)))
1516 (error "Not an Oracle buffer")
1517
1518 (let ((b "*RESERVED WORDS*"))
1519 (sql-execute sql-buffer b
1520 (concat "SELECT "
1521 " keyword "
1522 ", reserved AS \"Res\" "
1523 ", res_type AS \"Type\" "
1524 ", res_attr AS \"Attr\" "
1525 ", res_semi AS \"Semi\" "
1526 ", duplicate AS \"Dup\" "
1527 "FROM V$RESERVED_WORDS "
1528 "WHERE length > 1 "
1529 "AND SUBSTR(keyword, 1, 1) BETWEEN 'A' AND 'Z' "
1530 "ORDER BY 2 DESC, 3 DESC, 4 DESC, 5 DESC, 6 DESC, 1;")
1531 nil nil)
1532 (with-current-buffer b
1533 (set (make-local-variable 'sql-product) 'oracle)
1534 (sql-product-font-lock t nil)
1535 (font-lock-mode +1)))))
1536
1417(defvar sql-mode-oracle-font-lock-keywords 1537(defvar sql-mode-oracle-font-lock-keywords
1418 (eval-when-compile 1538 (eval-when-compile
1419 (list 1539 (list
1420 ;; Oracle SQL*Plus Commands 1540 ;; Oracle SQL*Plus Commands
1421 (cons 1541 ;; Only recognized in they start in column 1 and the
1422 (concat 1542 ;; abbreviation is followed by a space or the end of line.
1423 "^\\s-*\\(?:\\(?:" (regexp-opt '(
1424"@" "@@" "accept" "append" "archive" "attribute" "break"
1425"btitle" "change" "clear" "column" "connect" "copy" "define"
1426"del" "describe" "disconnect" "edit" "execute" "exit" "get" "help"
1427"host" "input" "list" "password" "pause" "print" "prompt" "recover"
1428"remark" "repfooter" "repheader" "run" "save" "show" "shutdown"
1429"spool" "start" "startup" "store" "timing" "ttitle" "undefine"
1430"variable" "whenever"
1431) t)
1432 1543
1433 "\\)\\|" 1544 "\\|"
1434 "\\(?:compute\\s-+\\(?:avg\\|cou\\|min\\|max\\|num\\|sum\\|std\\|var\\)\\)\\|" 1545 (list (concat "^" (sql-regexp-abbrev "rem~ark") "\\(?:\\s-.*\\)?$")
1435 "\\(?:set\\s-+\\(" 1546 0 'font-lock-comment-face t)
1436 1547
1437 (regexp-opt 1548 (list
1438 '("appi" "appinfo" "array" "arraysize" "auto" "autocommit" 1549 (concat
1439 "autop" "autoprint" "autorecovery" "autot" "autotrace" "blo" 1550 "^\\(?:"
1440 "blockterminator" "buffer" "closecursor" "cmds" "cmdsep" 1551 (sql-regexp-abbrev-list
1441 "colsep" "com" "compatibility" "con" "concat" "constraint" 1552 "[@]\\{1,2\\}" "acc~ept" "a~ppend" "archive" "attribute"
1442 "constraints" "copyc" "copycommit" "copytypecheck" "database" 1553 "bre~ak" "bti~tle" "c~hange" "cl~ear" "col~umn" "conn~ect"
1443 "def" "define" "document" "echo" "editf" "editfile" "emb" 1554 "copy" "def~ine" "del" "desc~ribe" "disc~onnect" "ed~it"
1444 "embedded" "esc" "escape" "feed" "feedback" "flagger" "flu" 1555 "exec~ute" "exit" "get" "help" "ho~st" "[$]" "i~nput" "l~ist"
1445 "flush" "hea" "heading" "heads" "headsep" "instance" "lin" 1556 "passw~ord" "pau~se" "pri~nt" "pro~mpt" "quit" "recover"
1446 "linesize" "lobof" "loboffset" "logsource" "long" "longc" 1557 "repf~ooter" "reph~eader" "r~un" "sav~e" "sho~w" "shutdown"
1447 "longchunksize" "maxdata" "newp" "newpage" "null" "num" 1558 "spo~ol" "sta~rt" "startup" "store" "tim~ing" "tti~tle"
1448 "numf" "numformat" "numwidth" "pages" "pagesize" "pau" 1559 "undef~ine" "var~iable" "whenever")
1449 "pause" "recsep" "recsepchar" "role" "scan" "serveroutput" 1560 "\\|"
1450 "shift" "shiftinout" "show" "showmode" "space" "sqlbl" 1561 (concat "\\(?:"
1451 "sqlblanklines" "sqlc" "sqlcase" "sqlco" "sqlcontinue" "sqln" 1562 (sql-regexp-abbrev "comp~ute")
1452 "sqlnumber" "sqlp" "sqlpluscompat" "sqlpluscompatibility" 1563 "\\s-+"
1453 "sqlpre" "sqlprefix" "sqlprompt" "sqlt" "sqlterminator" 1564 (sql-regexp-abbrev-list
1454 "statement_id" "suf" "suffix" "tab" "term" "termout" "ti" 1565 "avg" "cou~nt" "min~imum" "max~imum" "num~ber" "sum"
1455 "time" "timi" "timing" "transaction" "trim" "trimout" "trims" 1566 "std" "var~iance")
1456 "trimspool" "truncate" "und" "underline" "ver" "verify" "wra" 1567 "\\)")
1457 "wrap")) "\\)\\)" 1568 "\\|"
1458 1569 (concat "\\(?:set\\s-+"
1459 "\\)\\b.*" 1570 (sql-regexp-abbrev-list
1460 ) 1571 "appi~nfo" "array~size" "auto~commit" "autop~rint"
1461 'font-lock-doc-face) 1572 "autorecovery" "autot~race" "blo~ckterminator"
1462 '("^\\s-*rem\\(?:ark\\)?\\>.*" . font-lock-comment-face) 1573 "cmds~ep" "colsep" "com~patibility" "con~cat"
1574 "copyc~ommit" "copytypecheck" "def~ine" "describe"
1575 "echo" "editf~ile" "emb~edded" "esc~ape" "feed~back"
1576 "flagger" "flu~sh" "hea~ding" "heads~ep" "instance"
1577 "lin~esize" "lobof~fset" "long" "longc~hunksize"
1578 "mark~up" "newp~age" "null" "numf~ormat" "num~width"
1579 "pages~ize" "pau~se" "recsep" "recsepchar"
1580 "scan" "serverout~put" "shift~inout" "show~mode"
1581 "sqlbl~anklines" "sqlc~ase" "sqlco~ntinue"
1582 "sqln~umber" "sqlpluscompat~ibility" "sqlpre~fix"
1583 "sqlp~rompt" "sqlt~erminator" "suf~fix" "tab"
1584 "term~out" "ti~me" "timi~ng" "trim~out" "trims~pool"
1585 "und~erline" "ver~ify" "wra~p")
1586 "\\)")
1587
1588 "\\)\\(?:\\s-.*\\)?\\(?:[-]\n.*\\)*$")
1589 0 'font-lock-doc-face t)
1463 1590
1464 ;; Oracle Functions 1591 ;; Oracle Functions
1465 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil 1592 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
1466"abs" "acos" "add_months" "ascii" "asciistr" "asin" "atan" "atan2" 1593"abs" "acos" "add_months" "appendchildxml" "ascii" "asciistr" "asin"
1467"avg" "bfilename" "bin_to_num" "bitand" "cast" "ceil" "chartorowid" 1594"atan" "atan2" "avg" "bfilename" "bin_to_num" "bitand" "cardinality"
1468"chr" "coalesce" "compose" "concat" "convert" "corr" "cos" "cosh" 1595"cast" "ceil" "chartorowid" "chr" "cluster_id" "cluster_probability"
1469"count" "covar_pop" "covar_samp" "cume_dist" "current_date" 1596"cluster_set" "coalesce" "collect" "compose" "concat" "convert" "corr"
1470"current_timestamp" "current_user" "dbtimezone" "decode" "decompose" 1597"corr_k" "corr_s" "cos" "cosh" "count" "covar_pop" "covar_samp"
1471"dense_rank" "depth" "deref" "dump" "empty_clob" "existsnode" "exp" 1598"cube_table" "cume_dist" "currrent_date" "currrent_timestamp" "cv"
1472"extract" "extractvalue" "first" "first_value" "floor" "following" 1599"dataobj_to_partition" "dbtimezone" "decode" "decompose" "deletexml"
1473"from_tz" "greatest" "group_id" "grouping_id" "hextoraw" "initcap" 1600"dense_rank" "depth" "deref" "dump" "empty_blob" "empty_clob"
1474"instr" "lag" "last" "last_day" "last_value" "lead" "least" "length" 1601"existsnode" "exp" "extract" "extractvalue" "feature_id" "feature_set"
1475"ln" "localtimestamp" "lower" "lpad" "ltrim" "make_ref" "max" "min" 1602"feature_value" "first" "first_value" "floor" "from_tz" "greatest"
1476"mod" "months_between" "new_time" "next_day" "nls_charset_decl_len" 1603"grouping" "grouping_id" "group_id" "hextoraw" "initcap"
1604"insertchildxml" "insertchildxmlafter" "insertchildxmlbefore"
1605"insertxmlafter" "insertxmlbefore" "instr" "instr2" "instr4" "instrb"
1606"instrc" "iteration_number" "lag" "last" "last_day" "last_value"
1607"lead" "least" "length" "length2" "length4" "lengthb" "lengthc"
1608"listagg" "ln" "lnnvl" "localtimestamp" "log" "lower" "lpad" "ltrim"
1609"make_ref" "max" "median" "min" "mod" "months_between" "nanvl" "nchr"
1610"new_time" "next_day" "nlssort" "nls_charset_decl_len"
1477"nls_charset_id" "nls_charset_name" "nls_initcap" "nls_lower" 1611"nls_charset_id" "nls_charset_name" "nls_initcap" "nls_lower"
1478"nls_upper" "nlssort" "ntile" "nullif" "numtodsinterval" 1612"nls_upper" "nth_value" "ntile" "nullif" "numtodsinterval"
1479"numtoyminterval" "nvl" "nvl2" "over" "path" "percent_rank" 1613"numtoyminterval" "nvl" "nvl2" "ora_dst_affected" "ora_dst_convert"
1480"percentile_cont" "percentile_disc" "power" "preceding" "rank" 1614"ora_dst_error" "ora_hash" "path" "percentile_cont" "percentile_disc"
1481"ratio_to_report" "rawtohex" "rawtonhex" "reftohex" "regr_" 1615"percent_rank" "power" "powermultiset" "powermultiset_by_cardinality"
1482"regr_avgx" "regr_avgy" "regr_count" "regr_intercept" "regr_r2" 1616"prediction" "prediction_bounds" "prediction_cost"
1483"regr_slope" "regr_sxx" "regr_sxy" "regr_syy" "replace" "round" 1617"prediction_details" "prediction_probability" "prediction_set"
1484"row_number" "rowidtochar" "rowidtonchar" "rpad" "rtrim" 1618"presentnnv" "presentv" "previous" "rank" "ratio_to_report" "rawtohex"
1485"sessiontimezone" "sign" "sin" "sinh" "soundex" "sqrt" "stddev" 1619"rawtonhex" "ref" "reftohex" "regexp_count" "regexp_instr"
1486"stddev_pop" "stddev_samp" "substr" "sum" "sys_connect_by_path" 1620"regexp_replace" "regexp_substr" "regr_avgx" "regr_avgy" "regr_count"
1487"sys_context" "sys_dburigen" "sys_extract_utc" "sys_guid" "sys_typeid" 1621"regr_intercept" "regr_r2" "regr_slope" "regr_sxx" "regr_sxy"
1488"sys_xmlagg" "sys_xmlgen" "sysdate" "systimestamp" "tan" "tanh" 1622"regr_syy" "remainder" "replace" "round" "rowidtochar" "rowidtonchar"
1623"row_number" "rpad" "rtrim" "scn_to_timestamp" "sessiontimezone" "set"
1624"sign" "sin" "sinh" "soundex" "sqrt" "stats_binomial_test"
1625"stats_crosstab" "stats_f_test" "stats_ks_test" "stats_mode"
1626"stats_mw_test" "stats_one_way_anova" "stats_t_test_indep"
1627"stats_t_test_indepu" "stats_t_test_one" "stats_t_test_paired"
1628"stats_wsr_test" "stddev" "stddev_pop" "stddev_samp" "substr"
1629"substr2" "substr4" "substrb" "substrc" "sum" "sysdate" "systimestamp"
1630"sys_connect_by_path" "sys_context" "sys_dburigen" "sys_extract_utc"
1631"sys_guid" "sys_typeid" "sys_xmlagg" "sys_xmlgen" "tan" "tanh"
1632"timestamp_to_scn" "to_binary_double" "to_binary_float" "to_blob"
1489"to_char" "to_clob" "to_date" "to_dsinterval" "to_lob" "to_multi_byte" 1633"to_char" "to_clob" "to_date" "to_dsinterval" "to_lob" "to_multi_byte"
1490"to_nchar" "to_nclob" "to_number" "to_single_byte" "to_timestamp" 1634"to_nchar" "to_nclob" "to_number" "to_single_byte" "to_timestamp"
1491"to_timestamp_tz" "to_yminterval" "translate" "treat" "trim" "trunc" 1635"to_timestamp_tz" "to_yminterval" "translate" "treat" "trim" "trunc"
1492"tz_offset" "uid" "unbounded" "unistr" "updatexml" "upper" "user" 1636"tz_offset" "uid" "unistr" "updatexml" "upper" "user" "userenv"
1493"userenv" "var_pop" "var_samp" "variance" "vsize" "width_bucket" "xml" 1637"value" "variance" "var_pop" "var_samp" "vsize" "width_bucket"
1494"xmlagg" "xmlattribute" "xmlcolattval" "xmlconcat" "xmlelement" 1638"xmlagg" "xmlcast" "xmlcdata" "xmlcolattval" "xmlcomment" "xmlconcat"
1495"xmlforest" "xmlsequence" "xmltransform" 1639"xmldiff" "xmlelement" "xmlexists" "xmlforest" "xmlisvalid" "xmlparse"
1640"xmlpatch" "xmlpi" "xmlquery" "xmlroot" "xmlsequence" "xmlserialize"
1641"xmltable" "xmltransform"
1496) 1642)
1643
1644 ;; See the table V$RESERVED_WORDS
1497 ;; Oracle Keywords 1645 ;; Oracle Keywords
1498 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil 1646 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
1499"abort" "access" "accessed" "account" "activate" "add" "admin" 1647"abort" "access" "accessed" "account" "activate" "add" "admin"
@@ -1582,52 +1730,120 @@ to add functions and PL/SQL keywords.")
1582"varray" "version" "view" "wait" "when" "whenever" "where" "with" 1730"varray" "version" "view" "wait" "when" "whenever" "where" "with"
1583"without" "wnds" "wnps" "work" "write" "xmldata" "xmlschema" "xmltype" 1731"without" "wnds" "wnps" "work" "write" "xmldata" "xmlschema" "xmltype"
1584) 1732)
1733
1585 ;; Oracle Data Types 1734 ;; Oracle Data Types
1586 (sql-font-lock-keywords-builder 'font-lock-type-face nil 1735 (sql-font-lock-keywords-builder 'font-lock-type-face nil
1587"bfile" "blob" "byte" "char" "character" "clob" "date" "dec" "decimal" 1736"bfile" "binary_double" "binary_float" "blob" "byte" "char" "charbyte"
1588"double" "float" "int" "integer" "interval" "long" "national" "nchar" 1737"clob" "date" "day" "float" "interval" "local" "long" "longraw"
1589"nclob" "number" "numeric" "nvarchar2" "precision" "raw" "real" 1738"minute" "month" "nchar" "nclob" "number" "nvarchar2" "raw" "rowid" "second"
1590"rowid" "second" "smallint" "time" "timestamp" "urowid" "varchar" 1739"time" "timestamp" "urowid" "varchar2" "with" "year" "zone"
1591"varchar2" "varying" "year" "zone"
1592) 1740)
1593 1741
1594 ;; Oracle PL/SQL Attributes 1742 ;; Oracle PL/SQL Attributes
1595 (sql-font-lock-keywords-builder 'font-lock-builtin-face '("" . "\\b") 1743 (sql-font-lock-keywords-builder 'font-lock-builtin-face '("%" . "\\b")
1596"%bulk_rowcount" "%found" "%isopen" "%notfound" "%rowcount" "%rowtype" 1744"bulk_exceptions" "bulk_rowcount" "found" "isopen" "notfound"
1597"%type" 1745"rowcount" "rowtype" "type"
1598) 1746)
1599 1747
1600 ;; Oracle PL/SQL Functions 1748 ;; Oracle PL/SQL Functions
1601 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil 1749 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
1602"extend" "prior" 1750"delete" "trim" "extend" "exists" "first" "last" "count" "limit"
1751"prior" "next"
1752)
1753
1754 ;; Oracle PL/SQL Reserved words
1755 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
1756"all" "alter" "and" "any" "as" "asc" "at" "begin" "between" "by"
1757"case" "check" "clusters" "cluster" "colauth" "columns" "compress"
1758"connect" "crash" "create" "cursor" "declare" "default" "desc"
1759"distinct" "drop" "else" "end" "exception" "exclusive" "fetch" "for"
1760"from" "function" "goto" "grant" "group" "having" "identified" "if"
1761"in" "index" "indexes" "insert" "intersect" "into" "is" "like" "lock"
1762"minus" "mode" "nocompress" "not" "nowait" "null" "of" "on" "option"
1763"or" "order" "overlaps" "procedure" "public" "resource" "revoke"
1764"select" "share" "size" "sql" "start" "subtype" "tabauth" "table"
1765"then" "to" "type" "union" "unique" "update" "values" "view" "views"
1766"when" "where" "with"
1767
1768"true" "false"
1769"raise_application_error"
1603) 1770)
1604 1771
1605 ;; Oracle PL/SQL Keywords 1772 ;; Oracle PL/SQL Keywords
1606 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil 1773 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
1607"autonomous_transaction" "bulk" "char_base" "collect" "constant" 1774"a" "add" "agent" "aggregate" "array" "attribute" "authid" "avg"
1608"cursor" "declare" "do" "elsif" "exception_init" "execute" "exit" 1775"bfile_base" "binary" "blob_base" "block" "body" "both" "bound" "bulk"
1609"extends" "false" "fetch" "forall" "goto" "hour" "if" "interface" 1776"byte" "c" "call" "calling" "cascade" "char" "char_base" "character"
1610"loop" "minute" "number_base" "ocirowid" "opaque" "others" "rowtype" 1777"charset" "charsetform" "charsetid" "clob_base" "close" "collect"
1611"separate" "serially_reusable" "sql" "sqlcode" "sqlerrm" "subtype" 1778"comment" "commit" "committed" "compiled" "constant" "constructor"
1612"the" "timezone_abbr" "timezone_hour" "timezone_minute" 1779"context" "continue" "convert" "count" "current" "customdatum"
1613"timezone_region" "true" "varrying" "while" 1780"dangling" "data" "date" "date_base" "day" "define" "delete"
1781"deterministic" "double" "duration" "element" "elsif" "empty" "escape"
1782"except" "exceptions" "execute" "exists" "exit" "external" "final"
1783"fixed" "float" "forall" "force" "general" "hash" "heap" "hidden"
1784"hour" "immediate" "including" "indicator" "indices" "infinite"
1785"instantiable" "int" "interface" "interval" "invalidate" "isolation"
1786"java" "language" "large" "leading" "length" "level" "library" "like2"
1787"like4" "likec" "limit" "limited" "local" "long" "loop" "map" "max"
1788"maxlen" "member" "merge" "min" "minute" "mod" "modify" "month"
1789"multiset" "name" "nan" "national" "native" "nchar" "new" "nocopy"
1790"number_base" "object" "ocicoll" "ocidate" "ocidatetime" "ociduration"
1791"ociinterval" "ociloblocator" "ocinumber" "ociraw" "ociref"
1792"ocirefcursor" "ocirowid" "ocistring" "ocitype" "old" "only" "opaque"
1793"open" "operator" "oracle" "oradata" "organization" "orlany" "orlvary"
1794"others" "out" "overriding" "package" "parallel_enable" "parameter"
1795"parameters" "parent" "partition" "pascal" "pipe" "pipelined" "pragma"
1796"precision" "prior" "private" "raise" "range" "raw" "read" "record"
1797"ref" "reference" "relies_on" "rem" "remainder" "rename" "result"
1798"result_cache" "return" "returning" "reverse" "rollback" "row"
1799"sample" "save" "savepoint" "sb1" "sb2" "sb4" "second" "segment"
1800"self" "separate" "sequence" "serializable" "set" "short" "size_t"
1801"some" "sparse" "sqlcode" "sqldata" "sqlname" "sqlstate" "standard"
1802"static" "stddev" "stored" "string" "struct" "style" "submultiset"
1803"subpartition" "substitutable" "sum" "synonym" "tdo" "the" "time"
1804"timestamp" "timezone_abbr" "timezone_hour" "timezone_minute"
1805"timezone_region" "trailing" "transaction" "transactional" "trusted"
1806"ub1" "ub2" "ub4" "under" "unsigned" "untrusted" "use" "using"
1807"valist" "value" "variable" "variance" "varray" "varying" "void"
1808"while" "work" "wrapped" "write" "year" "zone"
1809;; Pragma
1810"autonomous_transaction" "exception_init" "inline"
1811"restrict_references" "serially_reusable"
1614) 1812)
1615 1813
1616 ;; Oracle PL/SQL Data Types 1814 ;; Oracle PL/SQL Data Types
1617 (sql-font-lock-keywords-builder 'font-lock-type-face nil 1815 (sql-font-lock-keywords-builder 'font-lock-type-face nil
1618"binary_integer" "boolean" "naturaln" "pls_integer" "positive" 1816"\"BINARY LARGE OBJECT\"" "\"CHAR LARGE OBJECT\"" "\"CHAR VARYING\""
1619"positiven" "record" "signtype" "string" 1817"\"CHARACTER LARGE OBJECT\"" "\"CHARACTER VARYING\""
1818"\"DOUBLE PRECISION\"" "\"INTERVAL DAY TO SECOND\""
1819"\"INTERVAL YEAR TO MONTH\"" "\"LONG RAW\"" "\"NATIONAL CHAR\""
1820"\"NATIONAL CHARACTER LARGE OBJECT\"" "\"NATIONAL CHARACTER\""
1821"\"NCHAR LARGE OBJECT\"" "\"NCHAR\"" "\"NCLOB\"" "\"NVARCHAR2\""
1822"\"TIME WITH TIME ZONE\"" "\"TIMESTAMP WITH LOCAL TIME ZONE\""
1823"\"TIMESTAMP WITH TIME ZONE\""
1824"bfile" "bfile_base" "binary_double" "binary_float" "binary_integer"
1825"blob" "blob_base" "boolean" "char" "character" "char_base" "clob"
1826"clob_base" "cursor" "date" "day" "dec" "decimal"
1827"dsinterval_unconstrained" "float" "int" "integer" "interval" "local"
1828"long" "mlslabel" "month" "natural" "naturaln" "nchar_cs" "number"
1829"number_base" "numeric" "pls_integer" "positive" "positiven" "raw"
1830"real" "ref" "rowid" "second" "signtype" "simple_double"
1831"simple_float" "simple_integer" "smallint" "string" "time" "timestamp"
1832"timestamp_ltz_unconstrained" "timestamp_tz_unconstrained"
1833"timestamp_unconstrained" "time_tz_unconstrained" "time_unconstrained"
1834"to" "urowid" "varchar" "varchar2" "with" "year"
1835"yminterval_unconstrained" "zone"
1620) 1836)
1621 1837
1622 ;; Oracle PL/SQL Exceptions 1838 ;; Oracle PL/SQL Exceptions
1623 (sql-font-lock-keywords-builder 'font-lock-warning-face nil 1839 (sql-font-lock-keywords-builder 'font-lock-warning-face nil
1624"access_into_null" "case_not_found" "collection_is_null" 1840"access_into_null" "case_not_found" "collection_is_null"
1625"cursor_already_open" "dup_val_on_index" "invalid_cursor" 1841"cursor_already_open" "dup_val_on_index" "invalid_cursor"
1626"invalid_number" "login_denied" "no_data_found" "not_logged_on" 1842"invalid_number" "login_denied" "no_data_found" "no_data_needed"
1627"program_error" "rowtype_mismatch" "self_is_null" "storage_error" 1843"not_logged_on" "program_error" "rowtype_mismatch" "self_is_null"
1628"subscript_beyond_count" "subscript_outside_limit" "sys_invalid_rowid" 1844"storage_error" "subscript_beyond_count" "subscript_outside_limit"
1629"timeout_on_resource" "too_many_rows" "value_error" "zero_divide" 1845"sys_invalid_rowid" "timeout_on_resource" "too_many_rows"
1630"exception" "notfound" 1846"value_error" "zero_divide"
1631))) 1847)))
1632 1848
1633 "Oracle SQL keywords used by font-lock. 1849 "Oracle SQL keywords used by font-lock.
@@ -2296,10 +2512,7 @@ also be configured."
2296 2512
2297 (let 2513 (let
2298 ;; Get the product-specific syntax-alist. 2514 ;; Get the product-specific syntax-alist.
2299 ((syntax-alist 2515 ((syntax-alist (sql-product-font-lock-syntax-alist)))
2300 (append
2301 (sql-get-product-feature sql-product :syntax-alist)
2302 '((?_ . "w") (?. . "w")))))
2303 2516
2304 ;; Get the product-specific keywords. 2517 ;; Get the product-specific keywords.
2305 (set (make-local-variable 'sql-mode-font-lock-keywords) 2518 (set (make-local-variable 'sql-mode-font-lock-keywords)
@@ -2388,9 +2601,30 @@ adds a fontification pattern to fontify identifiers ending in
2388 2601
2389;;; Functions to switch highlighting 2602;;; Functions to switch highlighting
2390 2603
2604(defun sql-product-syntax-table ()
2605 (let ((table (copy-syntax-table sql-mode-syntax-table)))
2606 (mapc (lambda (entry)
2607 (modify-syntax-entry (car entry) (cdr entry) table))
2608 (sql-get-product-feature sql-product :syntax-alist))
2609 table))
2610
2611(defun sql-product-font-lock-syntax-alist ()
2612 (append
2613 ;; Change all symbol character to word characters
2614 (mapcar
2615 (lambda (entry) (if (string= (substring (cdr entry) 0 1) "_")
2616 (cons (car entry)
2617 (concat "w" (substring (cdr entry) 1)))
2618 entry))
2619 (sql-get-product-feature sql-product :syntax-alist))
2620 '((?_ . "w"))))
2621
2391(defun sql-highlight-product () 2622(defun sql-highlight-product ()
2392 "Turn on the font highlighting for the SQL product selected." 2623 "Turn on the font highlighting for the SQL product selected."
2393 (when (derived-mode-p 'sql-mode) 2624 (when (derived-mode-p 'sql-mode)
2625 ;; Enhance the syntax table for the product
2626 (set-syntax-table (sql-product-syntax-table))
2627
2394 ;; Setup font-lock 2628 ;; Setup font-lock
2395 (sql-product-font-lock nil t) 2629 (sql-product-font-lock nil t)
2396 2630
@@ -2418,11 +2652,77 @@ adds a fontification pattern to fontify identifiers ending in
2418 ;; comint-line-beginning-position is defined in Emacs 21 2652 ;; comint-line-beginning-position is defined in Emacs 21
2419 (defun comint-line-beginning-position () 2653 (defun comint-line-beginning-position ()
2420 "Return the buffer position of the beginning of the line, after any prompt. 2654 "Return the buffer position of the beginning of the line, after any prompt.
2421The prompt is assumed to be any text at the beginning of the line matching 2655The prompt is assumed to be any text at the beginning of the line
2422the regular expression `comint-prompt-regexp', a buffer local variable." 2656matching the regular expression `comint-prompt-regexp', a buffer
2657local variable."
2423 (save-excursion (comint-bol nil) (point)))) 2658 (save-excursion (comint-bol nil) (point))))
2424 2659
2425 2660;;; Motion Functions
2661
2662(defun sql-statement-regexp (prod)
2663 (let* ((ansi-stmt (sql-get-product-feature 'ansi :statement))
2664 (prod-stmt (sql-get-product-feature prod :statement)))
2665 (concat "^\\<"
2666 (if prod-stmt
2667 ansi-stmt
2668 (concat "\\(" ansi-stmt "\\|" prod-stmt "\\)"))
2669 "\\>")))
2670
2671(defun sql-beginning-of-statement (arg)
2672 "Moves the cursor to the beginning of the current SQL statement."
2673 (interactive "p")
2674
2675 (let ((here (point))
2676 (regexp (sql-statement-regexp sql-product))
2677 last next)
2678
2679 ;; Go to the end of the statement before the start we desire
2680 (setq last (or (sql-end-of-statement (- arg))
2681 (point-min)))
2682 ;; And find the end after that
2683 (setq next (or (sql-end-of-statement 1)
2684 (point-max)))
2685
2686 ;; Our start must be between them
2687 (goto-char last)
2688 ;; Find an beginning-of-stmt that's not in a comment
2689 (while (and (re-search-forward regexp next t 1)
2690 (nth 7 (syntax-ppss)))
2691 (goto-char (match-end 0)))
2692 (goto-char
2693 (if (match-data)
2694 (match-beginning 0)
2695 last))
2696 (beginning-of-line)
2697 ;; If we didn't move, try again
2698 (when (= here (point))
2699 (sql-beginning-of-statement (* 2 (sql-signum arg))))))
2700
2701(defun sql-end-of-statement (arg)
2702 "Moves the cursor to the end of the current SQL statement."
2703 (interactive "p")
2704 (let ((term (sql-get-product-feature sql-product :terminator))
2705 (re-search (if (> 0 arg) 're-search-backward 're-search-forward))
2706 (here (point))
2707 (n 0))
2708 (when (consp term)
2709 (setq term (car term)))
2710 ;; Iterate until we've moved the desired number of stmt ends
2711 (while (not (= (sql-signum arg) 0))
2712 ;; if we're looking at the terminator, jump by 2
2713 (if (or (and (> 0 arg) (looking-back term))
2714 (and (< 0 arg) (looking-at term)))
2715 (setq n 2)
2716 (setq n 1))
2717 ;; If we found another end-of-stmt
2718 (if (not (apply re-search term nil t n nil))
2719 (setq arg 0)
2720 ;; count it if we're not in a comment
2721 (unless (nth 7 (syntax-ppss))
2722 (setq arg (- arg (sql-signum arg))))))
2723 (goto-char (if (match-data)
2724 (match-end 0)
2725 here))))
2426 2726
2427;;; Small functions 2727;;; Small functions
2428 2728
@@ -2456,7 +2756,7 @@ the regular expression `comint-prompt-regexp', a buffer local variable."
2456(defun sql-help-list-products (indent freep) 2756(defun sql-help-list-products (indent freep)
2457 "Generate listing of products available for use under SQLi. 2757 "Generate listing of products available for use under SQLi.
2458 2758
2459List products with :free-softare attribute set to FREEP. Indent 2759List products with :free-software attribute set to FREEP. Indent
2460each line with INDENT." 2760each line with INDENT."
2461 2761
2462 (let (sqli-func doc) 2762 (let (sqli-func doc)
@@ -2649,7 +2949,7 @@ function like this: (sql-get-login 'user 'password 'database)."
2649 nil (append '(:number t) plist))))))) 2949 nil (append '(:number t) plist)))))))
2650 what)) 2950 what))
2651 2951
2652(defun sql-find-sqli-buffer (&optional product) 2952(defun sql-find-sqli-buffer (&optional product connection)
2653 "Returns the name of the current default SQLi buffer or nil. 2953 "Returns the name of the current default SQLi buffer or nil.
2654In order to qualify, the SQLi buffer must be alive, be in 2954In order to qualify, the SQLi buffer must be alive, be in
2655`sql-interactive-mode' and have a process." 2955`sql-interactive-mode' and have a process."
@@ -2657,16 +2957,16 @@ In order to qualify, the SQLi buffer must be alive, be in
2657 (prod (or product sql-product))) 2957 (prod (or product sql-product)))
2658 (or 2958 (or
2659 ;; Current sql-buffer, if there is one. 2959 ;; Current sql-buffer, if there is one.
2660 (and (sql-buffer-live-p buf prod) 2960 (and (sql-buffer-live-p buf prod connection)
2661 buf) 2961 buf)
2662 ;; Global sql-buffer 2962 ;; Global sql-buffer
2663 (and (setq buf (default-value 'sql-buffer)) 2963 (and (setq buf (default-value 'sql-buffer))
2664 (sql-buffer-live-p buf prod) 2964 (sql-buffer-live-p buf prod connection)
2665 buf) 2965 buf)
2666 ;; Look thru each buffer 2966 ;; Look thru each buffer
2667 (car (apply 'append 2967 (car (apply 'append
2668 (mapcar (lambda (b) 2968 (mapcar (lambda (b)
2669 (and (sql-buffer-live-p b prod) 2969 (and (sql-buffer-live-p b prod connection)
2670 (list (buffer-name b)))) 2970 (list (buffer-name b))))
2671 (buffer-list))))))) 2971 (buffer-list)))))))
2672 2972
@@ -2722,7 +3022,8 @@ If you call it from anywhere else, it sets the global copy of
2722This is the buffer SQL strings are sent to. It is stored in the 3022This is the buffer SQL strings are sent to. It is stored in the
2723variable `sql-buffer'. See `sql-help' on how to create such a buffer." 3023variable `sql-buffer'. See `sql-help' on how to create such a buffer."
2724 (interactive) 3024 (interactive)
2725 (if (null (buffer-live-p (get-buffer sql-buffer))) 3025 (if (or (null sql-buffer)
3026 (null (buffer-live-p (get-buffer sql-buffer))))
2726 (message "%s has no SQLi buffer set." (buffer-name (current-buffer))) 3027 (message "%s has no SQLi buffer set." (buffer-name (current-buffer)))
2727 (if (null (get-buffer-process sql-buffer)) 3028 (if (null (get-buffer-process sql-buffer))
2728 (message "Buffer %s has no process." sql-buffer) 3029 (message "Buffer %s has no process." sql-buffer)
@@ -2932,37 +3233,58 @@ Allows the suppression of continuation prompts.")
2932 3233
2933;;; Strip out continuation prompts 3234;;; Strip out continuation prompts
2934 3235
3236(defvar sql-preoutput-hold nil)
3237
2935(defun sql-interactive-remove-continuation-prompt (oline) 3238(defun sql-interactive-remove-continuation-prompt (oline)
2936 "Strip out continuation prompts out of the OLINE. 3239 "Strip out continuation prompts out of the OLINE.
2937 3240
2938Added to the `comint-preoutput-filter-functions' hook in a SQL 3241Added to the `comint-preoutput-filter-functions' hook in a SQL
2939interactive buffer. If `sql-outut-newline-count' is greater than 3242interactive buffer. If `sql-output-newline-count' is greater than
2940zero, then an output line matching the continuation prompt is filtered 3243zero, then an output line matching the continuation prompt is filtered
2941out. If the count is one, then the prompt is replaced with a newline 3244out. If the count is zero, then a newline is inserted into the output
2942to force the output from the query to appear on a new line." 3245to force the output from the query to appear on a new line.
2943 (if (and sql-prompt-cont-regexp 3246
2944 sql-output-newline-count 3247The complication to this filter is that the continuation prompts
2945 (numberp sql-output-newline-count) 3248may arrive in multiple chunks. If they do, then the function
2946 (>= sql-output-newline-count 1)) 3249saves any unfiltered output in a buffer and prepends that buffer
2947 (progn 3250to the next chunk to properly match the broken-up prompt.
2948 (while (and oline 3251
2949 sql-output-newline-count 3252If the filter gets confused, it should reset and stop filtering
2950 (> sql-output-newline-count 0) 3253to avoid deleting non-prompt output."
2951 (string-match sql-prompt-cont-regexp oline)) 3254
2952 3255 (let (did-filter)
2953 (setq oline 3256 (setq oline (concat (or sql-preoutput-hold "") oline)
2954 (replace-match (if (and 3257 sql-preoutput-hold nil)
2955 (= 1 sql-output-newline-count) 3258
2956 sql-output-by-send) 3259 (if (and comint-prompt-regexp
2957 "\n" "") 3260 (integerp sql-output-newline-count)
2958 nil nil oline) 3261 (>= sql-output-newline-count 1))
2959 sql-output-newline-count 3262 (progn
2960 (1- sql-output-newline-count))) 3263 (while (and (not (string= oline ""))
2961 (if (= sql-output-newline-count 0) 3264 (> sql-output-newline-count 0)
2962 (setq sql-output-newline-count nil)) 3265 (string-match comint-prompt-regexp oline)
2963 (setq sql-output-by-send nil)) 3266 (= (match-beginning 0) 0))
2964 (setq sql-output-newline-count nil)) 3267
2965 oline) 3268 (setq oline (replace-match "" nil nil oline)
3269 sql-output-newline-count (1- sql-output-newline-count)
3270 did-filter t))
3271
3272 (if (= sql-output-newline-count 0)
3273 (setq sql-output-newline-count nil
3274 oline (concat "\n" oline)
3275 sql-output-by-send nil)
3276
3277 (setq sql-preoutput-hold oline
3278 oline ""))
3279
3280 (unless did-filter
3281 (setq oline (or sql-preoutput-hold "")
3282 sql-preoutput-hold nil
3283 sql-output-newline-count nil)))
3284
3285 (setq sql-output-newline-count nil))
3286
3287 oline))
2966 3288
2967;;; Sending the region to the SQLi buffer. 3289;;; Sending the region to the SQLi buffer.
2968 3290
@@ -3066,16 +3388,35 @@ If given the optional parameter VALUE, sets
3066 3388
3067;;; Redirect output functions 3389;;; Redirect output functions
3068 3390
3069(defun sql-redirect (command combuf &optional outbuf save-prior) 3391(defvar sql-debug-redirect nil
3392 "If non-nil, display messages related to the use of redirection.")
3393
3394(defun sql-str-literal (s)
3395 (concat "'" (replace-regexp-in-string "[']" "''" s) "'"))
3396
3397(defun sql-redirect (sqlbuf command &optional outbuf save-prior)
3070 "Execute the SQL command and send output to OUTBUF. 3398 "Execute the SQL command and send output to OUTBUF.
3071 3399
3072COMBUF must be an active SQL interactive buffer. OUTBUF may be 3400SQLBUF must be an active SQL interactive buffer. OUTBUF may be
3073an existing buffer, or the name of a non-existing buffer. If 3401an existing buffer, or the name of a non-existing buffer. If
3074omitted the output is sent to a temporary buffer which will be 3402omitted the output is sent to a temporary buffer which will be
3075killed after the command completes. COMMAND should be a string 3403killed after the command completes. COMMAND should be a string
3076of commands accepted by the SQLi program." 3404of commands accepted by the SQLi program. COMMAND may also be a
3077 3405list of SQLi command strings."
3078 (with-current-buffer combuf 3406
3407 (let* ((visible (and outbuf
3408 (not (string= " " (substring outbuf 0 1))))))
3409 (when visible
3410 (message "Executing SQL command..."))
3411 (if (consp command)
3412 (mapc (lambda (c) (sql-redirect-one sqlbuf c outbuf save-prior))
3413 command)
3414 (sql-redirect-one sqlbuf command outbuf save-prior))
3415 (when visible
3416 (message "Executing SQL command...done"))))
3417
3418(defun sql-redirect-one (sqlbuf command outbuf save-prior)
3419 (with-current-buffer sqlbuf
3079 (let ((buf (get-buffer-create (or outbuf " *SQL-Redirect*"))) 3420 (let ((buf (get-buffer-create (or outbuf " *SQL-Redirect*")))
3080 (proc (get-buffer-process (current-buffer))) 3421 (proc (get-buffer-process (current-buffer)))
3081 (comint-prompt-regexp (sql-get-product-feature sql-product 3422 (comint-prompt-regexp (sql-get-product-feature sql-product
@@ -3090,12 +3431,13 @@ of commands accepted by the SQLi program."
3090 (insert "\n")) 3431 (insert "\n"))
3091 (setq start (point))) 3432 (setq start (point)))
3092 3433
3434 (when sql-debug-redirect
3435 (message ">>SQL> %S" command))
3436
3093 ;; Run the command 3437 ;; Run the command
3094 (message "Executing SQL command...")
3095 (comint-redirect-send-command-to-process command buf proc nil t) 3438 (comint-redirect-send-command-to-process command buf proc nil t)
3096 (while (null comint-redirect-completed) 3439 (while (null comint-redirect-completed)
3097 (accept-process-output nil 1)) 3440 (accept-process-output nil 1))
3098 (message "Executing SQL command...done")
3099 3441
3100 ;; Clean up the output results 3442 ;; Clean up the output results
3101 (with-current-buffer buf 3443 (with-current-buffer buf
@@ -3107,12 +3449,16 @@ of commands accepted by the SQLi program."
3107 (goto-char start) 3449 (goto-char start)
3108 (when (looking-at (concat "^" (regexp-quote command) "[\\n]")) 3450 (when (looking-at (concat "^" (regexp-quote command) "[\\n]"))
3109 (delete-region (match-beginning 0) (match-end 0))) 3451 (delete-region (match-beginning 0) (match-end 0)))
3452 ;; Remove Ctrl-Ms
3453 (goto-char start)
3454 (while (re-search-forward "\r+$" nil t)
3455 (replace-match "" t t))
3110 (goto-char start))))) 3456 (goto-char start)))))
3111 3457
3112(defun sql-redirect-value (command combuf regexp &optional regexp-groups) 3458(defun sql-redirect-value (sqlbuf command regexp &optional regexp-groups)
3113 "Execute the SQL command and return part of result. 3459 "Execute the SQL command and return part of result.
3114 3460
3115COMBUF must be an active SQL interactive buffer. COMMAND should 3461SQLBUF must be an active SQL interactive buffer. COMMAND should
3116be a string of commands accepted by the SQLi program. From the 3462be a string of commands accepted by the SQLi program. From the
3117output, the REGEXP is repeatedly matched and the list of 3463output, the REGEXP is repeatedly matched and the list of
3118REGEXP-GROUPS submatches is returned. This behaves much like 3464REGEXP-GROUPS submatches is returned. This behaves much like
@@ -3122,18 +3468,19 @@ for each match."
3122 3468
3123 (let ((outbuf " *SQL-Redirect-values*") 3469 (let ((outbuf " *SQL-Redirect-values*")
3124 (results nil)) 3470 (results nil))
3125 (sql-redirect command combuf outbuf nil) 3471 (sql-redirect sqlbuf command outbuf nil)
3126 (with-current-buffer outbuf 3472 (with-current-buffer outbuf
3127 (while (re-search-forward regexp nil t) 3473 (while (re-search-forward regexp nil t)
3128 (push 3474 (push
3129 (cond 3475 (cond
3130 ;; no groups-return all of them 3476 ;; no groups-return all of them
3131 ((null regexp-groups) 3477 ((null regexp-groups)
3132 (let ((i 1) 3478 (let ((i (/ (length (match-data)) 2))
3133 (r nil)) 3479 (r nil))
3134 (while (match-beginning i) 3480 (while (> i 0)
3481 (setq i (1- i))
3135 (push (match-string i) r)) 3482 (push (match-string i) r))
3136 (nreverse r))) 3483 r))
3137 ;; one group specified 3484 ;; one group specified
3138 ((numberp regexp-groups) 3485 ((numberp regexp-groups)
3139 (match-string regexp-groups)) 3486 (match-string regexp-groups))
@@ -3152,10 +3499,14 @@ for each match."
3152 (error "sql-redirect-value: unknown REGEXP-GROUPS value - %s" 3499 (error "sql-redirect-value: unknown REGEXP-GROUPS value - %s"
3153 regexp-groups))) 3500 regexp-groups)))
3154 results))) 3501 results)))
3155 (nreverse results)))
3156 3502
3157(defun sql-execute (sqlbuf outbuf command arg) 3503 (when sql-debug-redirect
3158 "Executes a command in a SQL interacive buffer and captures the output. 3504 (message ">>SQL> = %S" (reverse results)))
3505
3506 (nreverse results)))
3507
3508(defun sql-execute (sqlbuf outbuf command enhanced arg)
3509 "Executes a command in a SQL interactive buffer and captures the output.
3159 3510
3160The commands are run in SQLBUF and the output saved in OUTBUF. 3511The commands are run in SQLBUF and the output saved in OUTBUF.
3161COMMAND must be a string, a function or a list of such elements. 3512COMMAND must be a string, a function or a list of such elements.
@@ -3168,9 +3519,9 @@ buffer is popped into a view window. "
3168 (lambda (c) 3519 (lambda (c)
3169 (cond 3520 (cond
3170 ((stringp c) 3521 ((stringp c)
3171 (sql-redirect (if arg (format c arg) c) sqlbuf outbuf) t) 3522 (sql-redirect sqlbuf (if arg (format c arg) c) outbuf) t)
3172 ((functionp c) 3523 ((functionp c)
3173 (apply c sqlbuf outbuf arg)) 3524 (apply c sqlbuf outbuf enhanced arg nil))
3174 (t (error "Unknown sql-execute item %s" c)))) 3525 (t (error "Unknown sql-execute item %s" c))))
3175 (if (consp command) command (cons command nil))) 3526 (if (consp command) command (cons command nil)))
3176 3527
@@ -3197,14 +3548,92 @@ buffer is popped into a view window. "
3197 (setq command (if enhanced 3548 (setq command (if enhanced
3198 (cdr command) 3549 (cdr command)
3199 (car command)))) 3550 (car command))))
3200 (sql-execute sqlbuf outbuf command arg))) 3551 (sql-execute sqlbuf outbuf command enhanced arg)))
3552
3553(defvar sql-completion-object nil
3554 "A list of database objects used for completion.
3555
3556The list is maintained in SQL interactive buffers.")
3557
3558(defvar sql-completion-column nil
3559 "A list of column names used for completion.
3560
3561The list is maintained in SQL interactive buffers.")
3562
3563(defun sql-build-completions-1 (schema completion-list feature)
3564 "Generate a list of objects in the database for use as completions."
3565 (let ((f (sql-get-product-feature sql-product feature)))
3566 (when f
3567 (set completion-list
3568 (let (cl)
3569 (dolist (e (append (symbol-value completion-list)
3570 (apply f (current-buffer) (cons schema nil)))
3571 cl)
3572 (unless (member e cl) (setq cl (cons e cl))))
3573 (sort cl (function string<)))))))
3574
3575(defun sql-build-completions (schema)
3576 "Generate a list of names in the database for use as completions."
3577 (sql-build-completions-1 schema 'sql-completion-object :completion-object)
3578 (sql-build-completions-1 schema 'sql-completion-column :completion-column))
3579
3580(defvar sql-completion-sqlbuf nil)
3581
3582(defun sql-try-completion (string collection &optional predicate)
3583 (when sql-completion-sqlbuf
3584 (with-current-buffer sql-completion-sqlbuf
3585 (let ((schema (and (string-match "\\`\\(\\sw\\(:?\\sw\\|\\s_\\)*\\)[.]" string)
3586 (downcase (match-string 1 string)))))
3587
3588 ;; If we haven't loaded any object name yet, load local schema
3589 (unless sql-completion-object
3590 (sql-build-completions nil))
3591
3592 ;; If they want another schema, load it if we haven't yet
3593 (when schema
3594 (let ((schema-dot (concat schema "."))
3595 (schema-len (1+ (length schema)))
3596 (names sql-completion-object)
3597 has-schema)
3598
3599 (while (and (not has-schema) names)
3600 (setq has-schema (and
3601 (>= (length (car names)) schema-len)
3602 (string= schema-dot
3603 (downcase (substring (car names)
3604 0 schema-len))))
3605 names (cdr names)))
3606 (unless has-schema
3607 (sql-build-completions schema)))))
3608
3609 ;; Try to find the completion
3610 (cond
3611 ((not predicate)
3612 (try-completion string sql-completion-object))
3613 ((eq predicate t)
3614 (all-completions string sql-completion-object))
3615 ((eq predicate 'lambda)
3616 (test-completion string sql-completion-object))
3617 ((eq (car predicate) 'boundaries)
3618 (completion-boundaries string sql-completion-object nil (cdr predicate)))))))
3201 3619
3202(defun sql-read-table-name (prompt) 3620(defun sql-read-table-name (prompt)
3203 "Read the name of a database table." 3621 "Read the name of a database table."
3204 ;; TODO: Fetch table/view names from database and provide completion. 3622 (let* ((tname
3205 ;; Also implement thing-at-point if the buffer has valid names in it 3623 (and (buffer-local-value 'sql-contains-names (current-buffer))
3206 ;; (i.e. sql-mode, sql-interactive-mode, or sql-list-all buffers) 3624 (thing-at-point-looking-at
3207 (read-from-minibuffer prompt)) 3625 (concat "\\_<\\sw\\(:?\\sw\\|\\s_\\)*"
3626 "\\(?:[.]+\\sw\\(?:\\sw\\|\\s_\\)*\\)*\\_>"))
3627 (buffer-substring-no-properties (match-beginning 0)
3628 (match-end 0))))
3629 (sql-completion-sqlbuf (sql-find-sqli-buffer))
3630 (product (with-current-buffer sql-completion-sqlbuf sql-product))
3631 (completion-ignore-case t))
3632
3633 (if (sql-get-product-feature product :completion-object)
3634 (completing-read prompt (function sql-try-completion)
3635 nil nil tname)
3636 (read-from-minibuffer prompt tname))))
3208 3637
3209(defun sql-list-all (&optional enhanced) 3638(defun sql-list-all (&optional enhanced)
3210 "List all database objects." 3639 "List all database objects."
@@ -3212,7 +3641,11 @@ buffer is popped into a view window. "
3212 (let ((sqlbuf (sql-find-sqli-buffer))) 3641 (let ((sqlbuf (sql-find-sqli-buffer)))
3213 (unless sqlbuf 3642 (unless sqlbuf
3214 (error "No SQL interactive buffer found")) 3643 (error "No SQL interactive buffer found"))
3215 (sql-execute-feature sqlbuf "*List All*" :list-all enhanced nil))) 3644 (sql-execute-feature sqlbuf "*List All*" :list-all enhanced nil)
3645 (with-current-buffer sqlbuf
3646 ;; Contains the name of database objects
3647 (set (make-local-variable 'sql-contains-names) t)
3648 (set (make-local-variable 'sql-buffer) sqlbuf))))
3216 3649
3217(defun sql-list-table (name &optional enhanced) 3650(defun sql-list-table (name &optional enhanced)
3218 "List the details of a database table. " 3651 "List the details of a database table. "
@@ -3226,7 +3659,6 @@ buffer is popped into a view window. "
3226 (error "No table name specified")) 3659 (error "No table name specified"))
3227 (sql-execute-feature sqlbuf (format "*List %s*" name) 3660 (sql-execute-feature sqlbuf (format "*List %s*" name)
3228 :list-table enhanced name))) 3661 :list-table enhanced name)))
3229
3230 3662
3231 3663
3232;;; SQL mode -- uses SQL interactive mode 3664;;; SQL mode -- uses SQL interactive mode
@@ -3277,6 +3709,8 @@ you must tell Emacs. Here's how to do that in your `~/.emacs' file:
3277 (set (make-local-variable 'paragraph-start) "[\n\f]") 3709 (set (make-local-variable 'paragraph-start) "[\n\f]")
3278 ;; Abbrevs 3710 ;; Abbrevs
3279 (setq abbrev-all-caps 1) 3711 (setq abbrev-all-caps 1)
3712 ;; Contains the name of database objects
3713 (set (make-local-variable 'sql-contains-names) t)
3280 ;; Catch changes to sql-product and highlight accordingly 3714 ;; Catch changes to sql-product and highlight accordingly
3281 (add-hook 'hack-local-variables-hook 'sql-highlight-product t t)) 3715 (add-hook 'hack-local-variables-hook 'sql-highlight-product t t))
3282 3716
@@ -3362,7 +3796,7 @@ you entered, right above the output it created.
3362 sql-product)) 3796 sql-product))
3363 3797
3364 ;; Setup the mode. 3798 ;; Setup the mode.
3365 (setq major-mode 'sql-interactive-mode) ;FIXME: Use define-derived-mode. 3799 (setq major-mode 'sql-interactive-mode)
3366 (setq mode-name 3800 (setq mode-name
3367 (concat "SQLi[" (or (sql-get-product-feature sql-product :name) 3801 (concat "SQLi[" (or (sql-get-product-feature sql-product :name)
3368 (symbol-name sql-product)) "]")) 3802 (symbol-name sql-product)) "]"))
@@ -3385,9 +3819,18 @@ you entered, right above the output it created.
3385 (setq abbrev-all-caps 1) 3819 (setq abbrev-all-caps 1)
3386 ;; Exiting the process will call sql-stop. 3820 ;; Exiting the process will call sql-stop.
3387 (set-process-sentinel (get-buffer-process (current-buffer)) 'sql-stop) 3821 (set-process-sentinel (get-buffer-process (current-buffer)) 'sql-stop)
3388 ;; Save the connection name 3822 ;; Save the connection and login params
3389 (make-local-variable 'sql-connection) 3823 (set (make-local-variable 'sql-user) sql-user)
3390 ;; Create a usefull name for renaming this buffer later. 3824 (set (make-local-variable 'sql-database) sql-database)
3825 (set (make-local-variable 'sql-server) sql-server)
3826 (set (make-local-variable 'sql-port) sql-port)
3827 (set (make-local-variable 'sql-connection) sql-connection)
3828 ;; Contains the name of database objects
3829 (set (make-local-variable 'sql-contains-names) t)
3830 ;; Keep track of existing object names
3831 (set (make-local-variable 'sql-completion-object) nil)
3832 (set (make-local-variable 'sql-completion-column) nil)
3833 ;; Create a useful name for renaming this buffer later.
3391 (set (make-local-variable 'sql-alternate-buffer-name) 3834 (set (make-local-variable 'sql-alternate-buffer-name)
3392 (sql-make-alternate-buffer-name)) 3835 (sql-make-alternate-buffer-name))
3393 ;; User stuff. Initialize before the hook. 3836 ;; User stuff. Initialize before the hook.
@@ -3398,6 +3841,7 @@ you entered, right above the output it created.
3398 (set (make-local-variable 'sql-prompt-cont-regexp) 3841 (set (make-local-variable 'sql-prompt-cont-regexp)
3399 (sql-get-product-feature sql-product :prompt-cont-regexp)) 3842 (sql-get-product-feature sql-product :prompt-cont-regexp))
3400 (make-local-variable 'sql-output-newline-count) 3843 (make-local-variable 'sql-output-newline-count)
3844 (make-local-variable 'sql-preoutput-hold)
3401 (make-local-variable 'sql-output-by-send) 3845 (make-local-variable 'sql-output-by-send)
3402 (add-hook 'comint-preoutput-filter-functions 3846 (add-hook 'comint-preoutput-filter-functions
3403 'sql-interactive-remove-continuation-prompt nil t) 3847 'sql-interactive-remove-continuation-prompt nil t)
@@ -3450,7 +3894,7 @@ Sentinels will always get the two parameters PROCESS and EVENT."
3450 nil t initial 'sql-connection-history default))) 3894 nil t initial 'sql-connection-history default)))
3451 3895
3452;;;###autoload 3896;;;###autoload
3453(defun sql-connect (connection) 3897(defun sql-connect (connection &optional new-name)
3454 "Connect to an interactive session using CONNECTION settings. 3898 "Connect to an interactive session using CONNECTION settings.
3455 3899
3456See `sql-connection-alist' to see how to define connections and 3900See `sql-connection-alist' to see how to define connections and
@@ -3462,7 +3906,8 @@ is specified in the connection settings."
3462 ;; Prompt for the connection from those defined in the alist 3906 ;; Prompt for the connection from those defined in the alist
3463 (interactive 3907 (interactive
3464 (if sql-connection-alist 3908 (if sql-connection-alist
3465 (list (sql-read-connection "Connection: " nil '(nil))) 3909 (list (sql-read-connection "Connection: " nil '(nil))
3910 current-prefix-arg)
3466 nil)) 3911 nil))
3467 3912
3468 ;; Are there connections defined 3913 ;; Are there connections defined
@@ -3500,14 +3945,15 @@ is specified in the connection settings."
3500 (unless (member token set-params) 3945 (unless (member token set-params)
3501 (if plist 3946 (if plist
3502 (cons token plist) 3947 (cons token plist)
3503 token))))) 3948 token))))))
3504 ;; Remember the connection
3505 (sql-connection connection))
3506 3949
3507 ;; Set the remaining parameters and start the 3950 ;; Set the remaining parameters and start the
3508 ;; interactive session 3951 ;; interactive session
3509 (eval `(let ((,param-var ',rem-params)) 3952 (eval `(let ((sql-connection ,connection)
3510 (sql-product-interactive sql-product))))) 3953 (,param-var ',rem-params))
3954 (sql-product-interactive sql-product
3955 new-name)))))
3956
3511 (message "SQL Connection <%s> does not exist" connection) 3957 (message "SQL Connection <%s> does not exist" connection)
3512 nil))) 3958 nil)))
3513 (message "No SQL Connections defined") 3959 (message "No SQL Connections defined")
@@ -3521,39 +3967,51 @@ optionally is saved to the user's init file."
3521 3967
3522 (interactive "sNew connection name: ") 3968 (interactive "sNew connection name: ")
3523 3969
3524 (if sql-connection 3970 (unless (derived-mode-p 'sql-interactive-mode)
3525 (message "This session was started by a connection; it's already been saved.") 3971 (error "Not in a SQL interactive mode!"))
3526 3972
3527 (let ((login (sql-get-product-feature sql-product :sqli-login)) 3973 ;; Capture the buffer local settings
3528 (alist sql-connection-alist) 3974 (let* ((buf (current-buffer))
3529 connect) 3975 (connection (buffer-local-value 'sql-connection buf))
3530 3976 (product (buffer-local-value 'sql-product buf))
3531 ;; Remove the existing connection if the user says so 3977 (user (buffer-local-value 'sql-user buf))
3532 (when (and (assoc name alist) 3978 (database (buffer-local-value 'sql-database buf))
3533 (yes-or-no-p (format "Replace connection definition <%s>? " name))) 3979 (server (buffer-local-value 'sql-server buf))
3534 (setq alist (assq-delete-all name alist))) 3980 (port (buffer-local-value 'sql-port buf)))
3535 3981
3536 ;; Add the new connection if it doesn't exist 3982 (if connection
3537 (if (assoc name alist) 3983 (message "This session was started by a connection; it's already been saved.")
3538 (message "Connection <%s> already exists" name) 3984
3539 (setq connect 3985 (let ((login (sql-get-product-feature product :sqli-login))
3540 (append (list name) 3986 (alist sql-connection-alist)
3541 (sql-for-each-login 3987 connect)
3542 `(product ,@login) 3988
3543 (lambda (token _plist) 3989 ;; Remove the existing connection if the user says so
3544 (cond 3990 (when (and (assoc name alist)
3545 ((eq token 'product) `(sql-product ',sql-product)) 3991 (yes-or-no-p (format "Replace connection definition <%s>? " name)))
3546 ((eq token 'user) `(sql-user ,sql-user)) 3992 (setq alist (assq-delete-all name alist)))
3547 ((eq token 'database) `(sql-database ,sql-database)) 3993
3548 ((eq token 'server) `(sql-server ,sql-server)) 3994 ;; Add the new connection if it doesn't exist
3549 ((eq token 'port) `(sql-port ,sql-port))))))) 3995 (if (assoc name alist)
3550 3996 (message "Connection <%s> already exists" name)
3551 (setq alist (append alist (list connect))) 3997 (setq connect
3552 3998 (append (list name)
3553 ;; confirm whether we want to save the connections 3999 (sql-for-each-login
3554 (if (yes-or-no-p "Save the connections for future sessions? ") 4000 `(product ,@login)
3555 (customize-save-variable 'sql-connection-alist alist) 4001 (lambda (token _plist)
3556 (customize-set-variable 'sql-connection-alist alist)))))) 4002 (cond
4003 ((eq token 'product) `(sql-product ',product))
4004 ((eq token 'user) `(sql-user ,user))
4005 ((eq token 'database) `(sql-database ,database))
4006 ((eq token 'server) `(sql-server ,server))
4007 ((eq token 'port) `(sql-port ,port)))))))
4008
4009 (setq alist (append alist (list connect)))
4010
4011 ;; confirm whether we want to save the connections
4012 (if (yes-or-no-p "Save the connections for future sessions? ")
4013 (customize-save-variable 'sql-connection-alist alist)
4014 (customize-set-variable 'sql-connection-alist alist)))))))
3557 4015
3558(defun sql-connection-menu-filter (tail) 4016(defun sql-connection-menu-filter (tail)
3559 "Generates menu entries for using each connection." 4017 "Generates menu entries for using each connection."
@@ -3561,7 +4019,10 @@ optionally is saved to the user's init file."
3561 (mapcar 4019 (mapcar
3562 (lambda (conn) 4020 (lambda (conn)
3563 (vector 4021 (vector
3564 (format "Connection <%s>" (car conn)) 4022 (format "Connection <%s>\t%s" (car conn)
4023 (let ((sql-user "") (sql-database "")
4024 (sql-server "") (sql-port 0))
4025 (eval `(let ,(cdr conn) (sql-make-alternate-buffer-name)))))
3565 (list 'sql-connect (car conn)) 4026 (list 'sql-connect (car conn))
3566 t)) 4027 t))
3567 sql-connection-alist) 4028 sql-connection-alist)
@@ -3599,10 +4060,10 @@ the call to \\[sql-product-interactive] with
3599 ;; Get the value of product that we need 4060 ;; Get the value of product that we need
3600 (setq product 4061 (setq product
3601 (cond 4062 (cond
3602 ((and product ; Product specified
3603 (symbolp product)) product)
3604 ((= (prefix-numeric-value product) 4) ; C-u, prompt for product 4063 ((= (prefix-numeric-value product) 4) ; C-u, prompt for product
3605 (sql-read-product "SQL product: " sql-product)) 4064 (sql-read-product "SQL product: " sql-product))
4065 ((and product ; Product specified
4066 (symbolp product)) product)
3606 (t sql-product))) ; Default to sql-product 4067 (t sql-product))) ; Default to sql-product
3607 4068
3608 ;; If we have a product and it has a interactive mode 4069 ;; If we have a product and it has a interactive mode
@@ -3610,7 +4071,7 @@ the call to \\[sql-product-interactive] with
3610 (when (sql-get-product-feature product :sqli-comint-func) 4071 (when (sql-get-product-feature product :sqli-comint-func)
3611 ;; If no new name specified, try to pop to an active SQL 4072 ;; If no new name specified, try to pop to an active SQL
3612 ;; interactive for the same product 4073 ;; interactive for the same product
3613 (let ((buf (sql-find-sqli-buffer product))) 4074 (let ((buf (sql-find-sqli-buffer product sql-connection)))
3614 (if (and (not new-name) buf) 4075 (if (and (not new-name) buf)
3615 (pop-to-buffer buf) 4076 (pop-to-buffer buf)
3616 4077
@@ -3629,23 +4090,24 @@ the call to \\[sql-product-interactive] with
3629 (sql-get-product-feature product :sqli-options)) 4090 (sql-get-product-feature product :sqli-options))
3630 4091
3631 ;; Set SQLi mode. 4092 ;; Set SQLi mode.
3632 (setq new-sqli-buffer (current-buffer))
3633 (let ((sql-interactive-product product)) 4093 (let ((sql-interactive-product product))
3634 (sql-interactive-mode)) 4094 (sql-interactive-mode))
3635 4095
3636 ;; Set the new buffer name 4096 ;; Set the new buffer name
4097 (setq new-sqli-buffer (current-buffer))
3637 (when new-name 4098 (when new-name
3638 (sql-rename-buffer new-name)) 4099 (sql-rename-buffer new-name))
3639
3640 ;; Set `sql-buffer' in the new buffer and the start buffer
3641 (setq sql-buffer (buffer-name new-sqli-buffer)) 4100 (setq sql-buffer (buffer-name new-sqli-buffer))
4101
4102 ;; Set `sql-buffer' in the start buffer
3642 (with-current-buffer start-buffer 4103 (with-current-buffer start-buffer
3643 (setq sql-buffer (buffer-name new-sqli-buffer)) 4104 (when (derived-mode-p 'sql-mode)
3644 (run-hooks 'sql-set-sqli-hook)) 4105 (setq sql-buffer (buffer-name new-sqli-buffer))
4106 (run-hooks 'sql-set-sqli-hook)))
3645 4107
3646 ;; All done. 4108 ;; All done.
3647 (message "Login...done") 4109 (message "Login...done")
3648 (pop-to-buffer sql-buffer))))) 4110 (pop-to-buffer new-sqli-buffer)))))
3649 (message "No default SQL product defined. Set `sql-product'."))) 4111 (message "No default SQL product defined. Set `sql-product'.")))
3650 4112
3651(defun sql-comint (product params) 4113(defun sql-comint (product params)
@@ -3720,6 +4182,157 @@ The default comes from `process-coding-system-alist' and
3720 (setq parameter options)) 4182 (setq parameter options))
3721 (sql-comint product parameter))) 4183 (sql-comint product parameter)))
3722 4184
4185(defun sql-oracle-save-settings (sqlbuf)
4186 "Saves most SQL*Plus settings so they may be reset by \\[sql-redirect]."
4187 ;; Note: does not capture the following settings:
4188 ;;
4189 ;; APPINFO
4190 ;; BTITLE
4191 ;; COMPATIBILITY
4192 ;; COPYTYPECHECK
4193 ;; MARKUP
4194 ;; RELEASE
4195 ;; REPFOOTER
4196 ;; REPHEADER
4197 ;; SQLPLUSCOMPATIBILITY
4198 ;; TTITLE
4199 ;; USER
4200 ;;
4201
4202 (append
4203 ;; (apply 'concat (append
4204 ;; '("SET")
4205
4206 ;; option value...
4207 (sql-redirect-value
4208 sqlbuf
4209 (concat "SHOW ARRAYSIZE AUTOCOMMIT AUTOPRINT AUTORECOVERY AUTOTRACE"
4210 " CMDSEP COLSEP COPYCOMMIT DESCRIBE ECHO EDITFILE EMBEDDED"
4211 " ESCAPE FLAGGER FLUSH HEADING INSTANCE LINESIZE LNO LOBOFFSET"
4212 " LOGSOURCE LONG LONGCHUNKSIZE NEWPAGE NULL NUMFORMAT NUMWIDTH"
4213 " PAGESIZE PAUSE PNO RECSEP SERVEROUTPUT SHIFTINOUT SHOWMODE"
4214 " SPOOL SQLBLANKLINES SQLCASE SQLCODE SQLCONTINUE SQLNUMBER"
4215 " SQLPROMPT SUFFIX TAB TERMOUT TIMING TRIMOUT TRIMSPOOL VERIFY")
4216 "^.+$"
4217 "SET \\&")
4218
4219 ;; option "c" (hex xx)
4220 (sql-redirect-value
4221 sqlbuf
4222 (concat "SHOW BLOCKTERMINATOR CONCAT DEFINE SQLPREFIX SQLTERMINATOR"
4223 " UNDERLINE HEADSEP RECSEPCHAR")
4224 "^\\(.+\\) (hex ..)$"
4225 "SET \\1")
4226
4227 ;; FEDDBACK ON for 99 or more rows
4228 ;; feedback OFF
4229 (sql-redirect-value
4230 sqlbuf
4231 "SHOW FEEDBACK"
4232 "^\\(?:FEEDBACK ON for \\([[:digit:]]+\\) or more rows\\|feedback \\(OFF\\)\\)"
4233 "SET FEEDBACK \\1\\2")
4234
4235 ;; wrap : lines will be wrapped
4236 ;; wrap : lines will be truncated
4237 (list (concat "SET WRAP "
4238 (if (string=
4239 (car (sql-redirect-value
4240 sqlbuf
4241 "SHOW WRAP"
4242 "^wrap : lines will be \\(wrapped\\|truncated\\)" 1))
4243 "wrapped")
4244 "ON" "OFF")))))
4245
4246(defun sql-oracle-restore-settings (sqlbuf saved-settings)
4247 "Restore the SQL*Plus settings in SAVED-SETTINGS."
4248
4249 ;; Remove any settings that haven't changed
4250 (mapc
4251 (lambda (one-cur-setting)
4252 (setq saved-settings (delete one-cur-setting saved-settings)))
4253 (sql-oracle-save-settings sqlbuf))
4254
4255 ;; Restore the changed settings
4256 (sql-redirect sqlbuf saved-settings))
4257
4258(defun sql-oracle-list-all (sqlbuf outbuf enhanced table-name)
4259 ;; Query from USER_OBJECTS or ALL_OBJECTS
4260 (let ((settings (sql-oracle-save-settings sqlbuf))
4261 (simple-sql
4262 (concat
4263 "SELECT INITCAP(x.object_type) AS SQL_EL_TYPE "
4264 ", x.object_name AS SQL_EL_NAME "
4265 "FROM user_objects x "
4266 "WHERE x.object_type NOT LIKE '%% BODY' "
4267 "ORDER BY 2, 1;"))
4268 (enhanced-sql
4269 (concat
4270 "SELECT INITCAP(x.object_type) AS SQL_EL_TYPE "
4271 ", x.owner ||'.'|| x.object_name AS SQL_EL_NAME "
4272 "FROM all_objects x "
4273 "WHERE x.object_type NOT LIKE '%% BODY' "
4274 "AND x.owner <> 'SYS' "
4275 "ORDER BY 2, 1;")))
4276
4277 (sql-redirect sqlbuf
4278 (concat "SET LINESIZE 80 PAGESIZE 50000 TRIMOUT ON"
4279 " TAB OFF TIMING OFF FEEDBACK OFF"))
4280
4281 (sql-redirect sqlbuf
4282 (list "COLUMN SQL_EL_TYPE HEADING \"Type\" FORMAT A19"
4283 "COLUMN SQL_EL_NAME HEADING \"Name\""
4284 (format "COLUMN SQL_EL_NAME FORMAT A%d"
4285 (if enhanced 60 35))))
4286
4287 (sql-redirect sqlbuf
4288 (if enhanced enhanced-sql simple-sql)
4289 outbuf)
4290
4291 (sql-redirect sqlbuf
4292 '("COLUMN SQL_EL_NAME CLEAR"
4293 "COLUMN SQL_EL_TYPE CLEAR"))
4294
4295 (sql-oracle-restore-settings sqlbuf settings)))
4296
4297(defun sql-oracle-list-table (sqlbuf outbuf enhanced table-name)
4298 "Implements :list-table under Oracle."
4299 (let ((settings (sql-oracle-save-settings sqlbuf)))
4300
4301 (sql-redirect sqlbuf
4302 (format
4303 (concat "SET LINESIZE %d PAGESIZE 50000"
4304 " DESCRIBE DEPTH 1 LINENUM OFF INDENT ON")
4305 (max 65 (min 120 (window-width)))))
4306
4307 (sql-redirect sqlbuf (format "DESCRIBE %s" table-name)
4308 outbuf)
4309
4310 (sql-oracle-restore-settings sqlbuf settings)))
4311
4312(defcustom sql-oracle-completion-types '("FUNCTION" "PACKAGE" "PROCEDURE"
4313 "SEQUENCE" "SYNONYM" "TABLE" "TRIGGER"
4314 "TYPE" "VIEW")
4315 "List of object types to include for completion under Oracle.
4316
4317See the distinct values in ALL_OBJECTS.OBJECT_TYPE for possible values."
4318 :version "24.1"
4319 :type '(repeat string)
4320 :group 'SQL)
4321
4322(defun sql-oracle-completion-object (sqlbuf schema)
4323 (sql-redirect-value
4324 sqlbuf
4325 (concat
4326 "SELECT CHR(1)||"
4327 (if schema
4328 (format "owner||'.'||object_name AS o FROM all_objects WHERE owner = %s AND "
4329 (sql-str-literal (upcase schema)))
4330 "object_name AS o FROM user_objects WHERE ")
4331 "temporary = 'N' AND generated = 'N' AND secondary = 'N' AND "
4332 "object_type IN ("
4333 (mapconcat (function sql-str-literal) sql-oracle-completion-types ",")
4334 ");")
4335 "^[\001]\\(.+\\)$" 1))
3723 4336
3724 4337
3725;;;###autoload 4338;;;###autoload
@@ -3858,6 +4471,9 @@ The default comes from `process-coding-system-alist' and
3858 (setq params (append options params)) 4471 (setq params (append options params))
3859 (sql-comint product params))) 4472 (sql-comint product params)))
3860 4473
4474(defun sql-sqlite-completion-object (sqlbuf schema)
4475 (sql-redirect-value sqlbuf ".tables" "\\sw\\(?:\\sw\\|\\s_\\)*" 0))
4476
3861 4477
3862 4478
3863;;;###autoload 4479;;;###autoload
@@ -4112,6 +4728,33 @@ Try to set `comint-output-filter-functions' like this:
4112 (setq params (append (list "-p" sql-port) params))) 4728 (setq params (append (list "-p" sql-port) params)))
4113 (sql-comint product params))) 4729 (sql-comint product params)))
4114 4730
4731(defun sql-postgres-completion-object (sqlbuf schema)
4732 (let (cl re fs a r)
4733 (sql-redirect sqlbuf "\\t on")
4734 (setq a (car (sql-redirect-value sqlbuf "\\a" "Output format is \\(.*\\)[.]$" 1)))
4735 (when (string= a "aligned")
4736 (sql-redirect sqlbuf "\\a"))
4737 (setq fs (or (car (sql-redirect-value sqlbuf "\\f" "Field separator is \"\\(.\\)[.]$" 1)) "|"))
4738
4739 (setq re (concat "^\\([^" fs "]*\\)" fs "\\([^" fs "]*\\)" fs "[^" fs "]*" fs "[^" fs "]*$"))
4740 (setq cl (if (not schema)
4741 (sql-redirect-value sqlbuf "\\d" re '(1 2))
4742 (append (sql-redirect-value sqlbuf (format "\\dt %s.*" schema) re '(1 2))
4743 (sql-redirect-value sqlbuf (format "\\dv %s.*" schema) re '(1 2))
4744 (sql-redirect-value sqlbuf (format "\\ds %s.*" schema) re '(1 2)))))
4745
4746 ;; Restore tuples and alignment to what they were
4747 (sql-redirect sqlbuf "\\t off")
4748 (when (not (string= a "aligned"))
4749 (sql-redirect sqlbuf "\\a"))
4750
4751 ;; Return the list of table names (public schema name can be omitted)
4752 (mapcar (lambda (tbl)
4753 (if (string= (car tbl) "public")
4754 (cadr tbl)
4755 (format "%s.%s" (car tbl) (cadr tbl))))
4756 cl)))
4757
4115 4758
4116 4759
4117;;;###autoload 4760;;;###autoload
@@ -4199,8 +4842,7 @@ The default comes from `process-coding-system-alist' and
4199 "Create comint buffer and connect to DB2." 4842 "Create comint buffer and connect to DB2."
4200 ;; Put all parameters to the program (if defined) in a list and call 4843 ;; Put all parameters to the program (if defined) in a list and call
4201 ;; make-comint. 4844 ;; make-comint.
4202 (sql-comint product options) 4845 (sql-comint product options))
4203)
4204 4846
4205;;;###autoload 4847;;;###autoload
4206(defun sql-linter (&optional buffer) 4848(defun sql-linter (&optional buffer)
@@ -4257,3 +4899,6 @@ buffer.
4257(provide 'sql) 4899(provide 'sql)
4258 4900
4259;;; sql.el ends here 4901;;; sql.el ends here
4902
4903; LocalWords: sql SQL SQLite sqlite Sybase Informix MySQL
4904; LocalWords: Postgres SQLServer SQLi
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 4e4d7b15053..97e188139e9 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -206,7 +206,8 @@ It creates the Imenu index for the buffer, if necessary."
206 (setq imenu--index-alist 206 (setq imenu--index-alist
207 (save-excursion (funcall imenu-create-index-function)))) 207 (save-excursion (funcall imenu-create-index-function))))
208 (error 208 (error
209 (message "which-func-ff-hook error: %S" err) 209 (unless (equal err '(error "This buffer cannot use `imenu-default-create-index-function'"))
210 (message "which-func-ff-hook error: %S" err))
210 (setq which-func-mode nil)))) 211 (setq which-func-mode nil))))
211 212
212(defun which-func-update () 213(defun which-func-update ()
diff --git a/lisp/rect.el b/lisp/rect.el
index ad914cab7d2..0756ec3bc0a 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -93,8 +93,9 @@ Point is at the end of the segment of this line within the rectangle."
93 "Call FUNCTION for each line of rectangle with corners at START, END. 93 "Call FUNCTION for each line of rectangle with corners at START, END.
94FUNCTION is called with two arguments: the start and end columns of the 94FUNCTION is called with two arguments: the start and end columns of the
95rectangle, plus ARGS extra arguments. Point is at the beginning of line when 95rectangle, plus ARGS extra arguments. Point is at the beginning of line when
96the function is called." 96the function is called.
97 (let (startcol startpt endcol endpt) 97The final point after the last operation will be returned."
98 (let (startcol startpt endcol endpt final-point)
98 (save-excursion 99 (save-excursion
99 (goto-char start) 100 (goto-char start)
100 (setq startcol (current-column)) 101 (setq startcol (current-column))
@@ -112,8 +113,9 @@ the function is called."
112 (goto-char startpt) 113 (goto-char startpt)
113 (while (< (point) endpt) 114 (while (< (point) endpt)
114 (apply function startcol endcol args) 115 (apply function startcol endcol args)
116 (setq final-point (point))
115 (forward-line 1))) 117 (forward-line 1)))
116 )) 118 final-point))
117 119
118(defun delete-rectangle-line (startcol endcol fill) 120(defun delete-rectangle-line (startcol endcol fill)
119 (when (= (move-to-column startcol (if fill t 'coerce)) startcol) 121 (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
@@ -323,7 +325,8 @@ Called from a program, takes three args; START, END and STRING."
323 (or (car string-rectangle-history) "")) 325 (or (car string-rectangle-history) ""))
324 nil 'string-rectangle-history 326 nil 'string-rectangle-history
325 (car string-rectangle-history))))) 327 (car string-rectangle-history)))))
326 (apply-on-rectangle 'string-rectangle-line start end string t)) 328 (goto-char
329 (apply-on-rectangle 'string-rectangle-line start end string t)))
327 330
328;;;###autoload 331;;;###autoload
329(defalias 'replace-rectangle 'string-rectangle) 332(defalias 'replace-rectangle 'string-rectangle)
diff --git a/lisp/register.el b/lisp/register.el
index 82a0cf33c3e..89a725f28c5 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -70,7 +70,7 @@
70DATA can be any value. 70DATA can be any value.
71PRINT-FUNC if provided controls how `list-registers' and 71PRINT-FUNC if provided controls how `list-registers' and
72`view-register' print the register. It should be a function 72`view-register' print the register. It should be a function
73recieving one argument DATA and print text that completes 73receiving one argument DATA and print text that completes
74this sentence: 74this sentence:
75 Register X contains [TEXT PRINTED BY PRINT-FUNC] 75 Register X contains [TEXT PRINTED BY PRINT-FUNC]
76JUMP-FUNC if provided, controls how `jump-to-register' jumps to the register. 76JUMP-FUNC if provided, controls how `jump-to-register' jumps to the register.
@@ -329,6 +329,8 @@ Interactively, second arg is non-nil if prefix arg is supplied."
329 "Don't know how to insert register %s" 329 "Don't know how to insert register %s"
330 (single-key-description register)) 330 (single-key-description register))
331 (funcall (registerv-insert-func val) (registerv-data val))) 331 (funcall (registerv-insert-func val) (registerv-data val)))
332 ((consp val)
333 (insert-rectangle val))
332 ((stringp val) 334 ((stringp val)
333 (insert-for-yank val)) 335 (insert-for-yank val))
334 ((numberp val) 336 ((numberp val)
diff --git a/lisp/replace.el b/lisp/replace.el
index 0578ed09b1c..fb98a714dff 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1140,7 +1140,8 @@ are not modified."
1140 "Show all lines in buffers BUFS containing a match for REGEXP. 1140 "Show all lines in buffers BUFS containing a match for REGEXP.
1141This function acts on multiple buffers; otherwise, it is exactly like 1141This function acts on multiple buffers; otherwise, it is exactly like
1142`occur'. When you invoke this command interactively, you must specify 1142`occur'. When you invoke this command interactively, you must specify
1143the buffer names that you want, one by one." 1143the buffer names that you want, one by one.
1144See also `multi-occur-in-matching-buffers'."
1144 (interactive 1145 (interactive
1145 (cons 1146 (cons
1146 (let* ((bufs (list (read-buffer "First buffer to search: " 1147 (let* ((bufs (list (read-buffer "First buffer to search: "
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index 54f2ba765b5..0c68bca4d2e 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -81,7 +81,8 @@ SIDE must be the symbol `left' or `right'."
81This is nil while loading `scroll-bar.el', and t afterward.") 81This is nil while loading `scroll-bar.el', and t afterward.")
82 82
83(defun set-scroll-bar-mode (value) 83(defun set-scroll-bar-mode (value)
84 "Set `scroll-bar-mode' to VALUE and put the new value into effect." 84 "Set the scroll bar mode to VALUE and put the new value into effect.
85See the `scroll-bar-mode' variable for possible values to use."
85 (if scroll-bar-mode 86 (if scroll-bar-mode
86 (setq previous-scroll-bar-mode scroll-bar-mode)) 87 (setq previous-scroll-bar-mode scroll-bar-mode))
87 88
diff --git a/lisp/server.el b/lisp/server.el
index 42da7a210c5..c91f10b6584 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -679,7 +679,7 @@ Server mode runs a process that accepts commands from the
679(defun server-eval-and-print (expr proc) 679(defun server-eval-and-print (expr proc)
680 "Eval EXPR and send the result back to client PROC." 680 "Eval EXPR and send the result back to client PROC."
681 (let ((v (eval (car (read-from-string expr))))) 681 (let ((v (eval (car (read-from-string expr)))))
682 (when (and v proc) 682 (when proc
683 (with-temp-buffer 683 (with-temp-buffer
684 (let ((standard-output (current-buffer))) 684 (let ((standard-output (current-buffer)))
685 (pp v) 685 (pp v)
@@ -1153,7 +1153,10 @@ The following commands are accepted by the client:
1153 "When done with a buffer, type \\[server-edit]"))))) 1153 "When done with a buffer, type \\[server-edit]")))))
1154 (when (and frame (null tty-name)) 1154 (when (and frame (null tty-name))
1155 (server-unselect-display frame))) 1155 (server-unselect-display frame)))
1156 (error (server-return-error proc err))))) 1156 ((quit error)
1157 (when (eq (car err) 'quit)
1158 (message "Quit emacsclient request"))
1159 (server-return-error proc err)))))
1157 1160
1158(defun server-return-error (proc err) 1161(defun server-return-error (proc err)
1159 (ignore-errors 1162 (ignore-errors
@@ -1200,12 +1203,12 @@ so don't mark these buffers specially, just visit them normally."
1200 (add-to-history 'file-name-history filen) 1203 (add-to-history 'file-name-history filen)
1201 (if (null obuf) 1204 (if (null obuf)
1202 (progn 1205 (progn
1203 (run-hooks 'pre-command-hook) 1206 (run-hooks 'pre-command-hook)
1204 (set-buffer (find-file-noselect filen))) 1207 (set-buffer (find-file-noselect filen)))
1205 (set-buffer obuf) 1208 (set-buffer obuf)
1206 ;; separately for each file, in sync with post-command hooks, 1209 ;; separately for each file, in sync with post-command hooks,
1207 ;; with the new buffer current: 1210 ;; with the new buffer current:
1208 (run-hooks 'pre-command-hook) 1211 (run-hooks 'pre-command-hook)
1209 (cond ((file-exists-p filen) 1212 (cond ((file-exists-p filen)
1210 (when (not (verify-visited-file-modtime obuf)) 1213 (when (not (verify-visited-file-modtime obuf))
1211 (revert-buffer t nil))) 1214 (revert-buffer t nil)))
@@ -1219,7 +1222,7 @@ so don't mark these buffers specially, just visit them normally."
1219 (server-goto-line-column (cdr file)) 1222 (server-goto-line-column (cdr file))
1220 (run-hooks 'server-visit-hook) 1223 (run-hooks 'server-visit-hook)
1221 ;; hooks may be specific to current buffer: 1224 ;; hooks may be specific to current buffer:
1222 (run-hooks 'post-command-hook)) 1225 (run-hooks 'post-command-hook))
1223 (unless nowait 1226 (unless nowait
1224 ;; When the buffer is killed, inform the clients. 1227 ;; When the buffer is killed, inform the clients.
1225 (add-hook 'kill-buffer-hook 'server-kill-buffer nil t) 1228 (add-hook 'kill-buffer-hook 'server-kill-buffer nil t)
diff --git a/lisp/ses.el b/lisp/ses.el
index 8b06f058fcd..9b2048eae83 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -56,6 +56,7 @@
56;;; Code: 56;;; Code:
57 57
58(require 'unsafep) 58(require 'unsafep)
59(eval-when-compile (require 'cl))
59 60
60 61
61;;---------------------------------------------------------------------------- 62;;----------------------------------------------------------------------------
@@ -272,18 +273,18 @@ default printer and then modify its output.")
272(eval-and-compile 273(eval-and-compile
273 (defconst ses-localvars 274 (defconst ses-localvars
274 '(ses--blank-line ses--cells ses--col-printers 275 '(ses--blank-line ses--cells ses--col-printers
275 ses--col-widths (ses--curcell . nil) ses--curcell-overlay 276 ses--col-widths ses--curcell ses--curcell-overlay
276 ses--default-printer 277 ses--default-printer
277 ses--deferred-narrow (ses--deferred-recalc 278 ses--deferred-narrow ses--deferred-recalc
278 . nil) (ses--deferred-write . nil) ses--file-format 279 ses--deferred-write ses--file-format
279 (ses--header-hscroll . -1) ; Flag for "initial recalc needed" 280 (ses--header-hscroll . -1) ; Flag for "initial recalc needed"
280 ses--header-row ses--header-string ses--linewidth 281 ses--header-row ses--header-string ses--linewidth
281 ses--numcols ses--numrows ses--symbolic-formulas 282 ses--numcols ses--numrows ses--symbolic-formulas
282 ses--data-marker ses--params-marker (ses--Dijkstra-attempt-nb 283 ses--data-marker ses--params-marker (ses--Dijkstra-attempt-nb . 0)
283 . 0) ses--Dijkstra-weight-bound 284 ses--Dijkstra-weight-bound
284 ;; Global variables that we override 285 ;; Global variables that we override
285 mode-line-process next-line-add-newlines transient-mark-mode) 286 mode-line-process next-line-add-newlines transient-mark-mode)
286 "Buffer-local variables used by SES.")) 287 "Buffer-local variables used by SES.")
287 288
288(defun ses-set-localvars () 289(defun ses-set-localvars ()
289 "Set buffer-local and initialize some SES variables." 290 "Set buffer-local and initialize some SES variables."
@@ -292,8 +293,11 @@ default printer and then modify its output.")
292 ((symbolp x) 293 ((symbolp x)
293 (set (make-local-variable x) nil)) 294 (set (make-local-variable x) nil))
294 ((consp x) 295 ((consp x)
295 (set (make-local-variable (car x)) (cdr x))) 296 (set (make-local-variable (car x)) (cdr x)))
296 (error "Unexpected elements `%S' in list `ses-localvars'")))) 297 (t (error "Unexpected elements `%S' in list `ses-localvars'" x))))))
298
299(eval-when-compile ; silence compiler
300 (ses-set-localvars))
297 301
298;;; This variable is documented as being permitted in file-locals: 302;;; This variable is documented as being permitted in file-locals:
299(put 'ses--symbolic-formulas 'safe-local-variable 'consp) 303(put 'ses--symbolic-formulas 'safe-local-variable 'consp)
@@ -3344,10 +3348,8 @@ TEST is evaluated."
3344;; These functions use the variables 'row' and 'col' that are dynamically bound 3348;; These functions use the variables 'row' and 'col' that are dynamically bound
3345;; by ses-print-cell. We define these variables at compile-time to make the 3349;; by ses-print-cell. We define these variables at compile-time to make the
3346;; compiler happy. 3350;; compiler happy.
3347(eval-when-compile 3351(defvar row)
3348 (dolist (x '(row col)) 3352(defvar col)
3349 (make-local-variable x)
3350 (set x nil)))
3351 3353
3352(defun ses-center (value &optional span fill) 3354(defun ses-center (value &optional span fill)
3353 "Print VALUE, centered within column. FILL is the fill character for 3355 "Print VALUE, centered within column. FILL is the fill character for
diff --git a/lisp/simple.el b/lisp/simple.el
index b36cf2ec3ec..64333402924 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1152,6 +1152,8 @@ display the result of expression evaluation."
1152(defun eval-expression (eval-expression-arg 1152(defun eval-expression (eval-expression-arg
1153 &optional eval-expression-insert-value) 1153 &optional eval-expression-insert-value)
1154 "Evaluate EVAL-EXPRESSION-ARG and print value in the echo area. 1154 "Evaluate EVAL-EXPRESSION-ARG and print value in the echo area.
1155When called interactively, read an Emacs Lisp expression and
1156evaluate it.
1155Value is also consed on to front of the variable `values'. 1157Value is also consed on to front of the variable `values'.
1156Optional argument EVAL-EXPRESSION-INSERT-VALUE non-nil (interactively, 1158Optional argument EVAL-EXPRESSION-INSERT-VALUE non-nil (interactively,
1157with prefix argument) means insert the result into the current buffer 1159with prefix argument) means insert the result into the current buffer
@@ -2531,7 +2533,11 @@ specifies the value of ERROR-BUFFER."
2531 (let ((output 2533 (let ((output
2532 (if (and error-file 2534 (if (and error-file
2533 (< 0 (nth 7 (file-attributes error-file)))) 2535 (< 0 (nth 7 (file-attributes error-file))))
2534 "some error output" 2536 (format "some error output%s"
2537 (if shell-command-default-error-buffer
2538 (format " to the \"%s\" buffer"
2539 shell-command-default-error-buffer)
2540 ""))
2535 "no output"))) 2541 "no output")))
2536 (cond ((null exit-status) 2542 (cond ((null exit-status)
2537 (message "(Shell command failed with error)")) 2543 (message "(Shell command failed with error)"))
@@ -5299,11 +5305,12 @@ The variable `selective-display' has a separate value for each buffer."
5299(defvaralias 'indicate-unused-lines 'indicate-empty-lines) 5305(defvaralias 'indicate-unused-lines 'indicate-empty-lines)
5300 5306
5301(defun toggle-truncate-lines (&optional arg) 5307(defun toggle-truncate-lines (&optional arg)
5302 "Toggle whether to fold or truncate long lines for the current buffer. 5308 "Toggle truncating of long lines for the current buffer.
5309When truncating is off, long lines are folded.
5303With prefix argument ARG, truncate long lines if ARG is positive, 5310With prefix argument ARG, truncate long lines if ARG is positive,
5304otherwise don't truncate them. Note that in side-by-side windows, 5311otherwise fold them. Note that in side-by-side windows, this
5305this command has no effect if `truncate-partial-width-windows' 5312command has no effect if `truncate-partial-width-windows' is
5306is non-nil." 5313non-nil."
5307 (interactive "P") 5314 (interactive "P")
5308 (setq truncate-lines 5315 (setq truncate-lines
5309 (if (null arg) 5316 (if (null arg)
@@ -5516,8 +5523,8 @@ The function should return non-nil if the two tokens do not match.")
5516 (minibuffer-message "Mismatched parentheses") 5523 (minibuffer-message "Mismatched parentheses")
5517 (message "Mismatched parentheses")) 5524 (message "Mismatched parentheses"))
5518 (if (minibufferp) 5525 (if (minibufferp)
5519 (minibuffer-message "Unmatched parenthesis") 5526 (minibuffer-message "No matching parenthesis found")
5520 (message "Unmatched parenthesis")))) 5527 (message "No matching parenthesis found"))))
5521 ((not blinkpos) nil) 5528 ((not blinkpos) nil)
5522 ((pos-visible-in-window-p blinkpos) 5529 ((pos-visible-in-window-p blinkpos)
5523 ;; Matching open within window, temporarily move to blinkpos but only 5530 ;; Matching open within window, temporarily move to blinkpos but only
diff --git a/lisp/startup.el b/lisp/startup.el
index 26c5a469330..6953ed25ed4 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -41,8 +41,9 @@
41(defcustom initial-buffer-choice nil 41(defcustom initial-buffer-choice nil
42 "Buffer to show after starting Emacs. 42 "Buffer to show after starting Emacs.
43If the value is nil and `inhibit-startup-screen' is nil, show the 43If the value is nil and `inhibit-startup-screen' is nil, show the
44startup screen. If the value is string, visit the specified file or 44startup screen. If the value is string, visit the specified file
45directory using `find-file'. If t, open the `*scratch*' buffer." 45or directory using `find-file'. If t, open the `*scratch*'
46buffer."
46 :type '(choice 47 :type '(choice
47 (const :tag "Startup screen" nil) 48 (const :tag "Startup screen" nil)
48 (directory :tag "Directory" :value "~/") 49 (directory :tag "Directory" :value "~/")
@@ -1293,7 +1294,7 @@ If this is nil, no message will be displayed."
1293;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1294;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1294 1295
1295(defconst fancy-startup-text 1296(defconst fancy-startup-text
1296 `((:face (variable-pitch (:foreground "red")) 1297 `((:face (variable-pitch font-lock-comment-face)
1297 "Welcome to " 1298 "Welcome to "
1298 :link ("GNU Emacs" 1299 :link ("GNU Emacs"
1299 ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/")) 1300 ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/"))
@@ -1350,7 +1351,7 @@ Each element in the list should be a list of strings or pairs
1350`:face FACE', like `fancy-splash-insert' accepts them.") 1351`:face FACE', like `fancy-splash-insert' accepts them.")
1351 1352
1352(defconst fancy-about-text 1353(defconst fancy-about-text
1353 `((:face (variable-pitch (:foreground "red")) 1354 `((:face (variable-pitch font-lock-comment-face)
1354 "This is " 1355 "This is "
1355 :link ("GNU Emacs" 1356 :link ("GNU Emacs"
1356 ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/")) 1357 ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/"))
@@ -1366,11 +1367,7 @@ Each element in the list should be a list of strings or pairs
1366 `("GNU" ,(lambda (_button) (describe-gnu-project)) 1367 `("GNU" ,(lambda (_button) (describe-gnu-project))
1367 "Display info on the GNU project."))) 1368 "Display info on the GNU project.")))
1368 " operating system.\n" 1369 " operating system.\n"
1369 :face ,(lambda () 1370 :face (variable-pitch font-lock-builtin-face)
1370 (list 'variable-pitch
1371 (list :foreground
1372 (if (eq (frame-parameter nil 'background-mode) 'dark)
1373 "cyan" "darkblue"))))
1374 "\n" 1371 "\n"
1375 ,(lambda () (emacs-version)) 1372 ,(lambda () (emacs-version))
1376 "\n" 1373 "\n"
@@ -1426,8 +1423,7 @@ Each element in the list should be a list of strings or pairs
1426 ,(lambda (_button) 1423 ,(lambda (_button)
1427 (browse-url "http://www.gnu.org/software/emacs/tour/")) 1424 (browse-url "http://www.gnu.org/software/emacs/tour/"))
1428 "Browse http://www.gnu.org/software/emacs/tour/") 1425 "Browse http://www.gnu.org/software/emacs/tour/")
1429 "\tSee an overview of Emacs features at gnu.org" 1426 "\tSee an overview of Emacs features at gnu.org"))
1430 ))
1431 "A list of texts to show in the middle part of the About screen. 1427 "A list of texts to show in the middle part of the About screen.
1432Each element in the list should be a list of strings or pairs 1428Each element in the list should be a list of strings or pairs
1433`:face FACE', like `fancy-splash-insert' accepts them.") 1429`:face FACE', like `fancy-splash-insert' accepts them.")
@@ -1537,93 +1533,91 @@ a face or button specification."
1537 1533
1538(defun fancy-startup-tail (&optional concise) 1534(defun fancy-startup-tail (&optional concise)
1539 "Insert the tail part of the splash screen into the current buffer." 1535 "Insert the tail part of the splash screen into the current buffer."
1540 (let ((fg (if (eq (frame-parameter nil 'background-mode) 'dark) 1536 (unless concise
1541 "cyan" "darkblue")))
1542 (unless concise
1543 (fancy-splash-insert
1544 :face 'variable-pitch
1545 "\nTo start... "
1546 :link `("Open a File"
1547 ,(lambda (_button) (call-interactively 'find-file))
1548 "Specify a new file's name, to edit the file")
1549 " "
1550 :link `("Open Home Directory"
1551 ,(lambda (_button) (dired "~"))
1552 "Open your home directory, to operate on its files")
1553 " "
1554 :link `("Customize Startup"
1555 ,(lambda (_button) (customize-group 'initialization))
1556 "Change initialization settings including this screen")
1557 "\n"))
1558 (fancy-splash-insert 1537 (fancy-splash-insert
1559 :face 'variable-pitch "To quit a partially entered command, type " 1538 :face 'variable-pitch
1560 :face 'default "Control-g" 1539 "\nTo start... "
1561 :face 'variable-pitch ".\n") 1540 :link `("Open a File"
1562 (fancy-splash-insert :face `(variable-pitch (:foreground ,fg)) 1541 ,(lambda (_button) (call-interactively 'find-file))
1563 "\nThis is " 1542 "Specify a new file's name, to edit the file")
1564 (emacs-version) 1543 " "
1565 "\n" 1544 :link `("Open Home Directory"
1566 :face '(variable-pitch (:height 0.8)) 1545 ,(lambda (_button) (dired "~"))
1567 emacs-copyright 1546 "Open your home directory, to operate on its files")
1568 "\n") 1547 " "
1569 (and auto-save-list-file-prefix 1548 :link `("Customize Startup"
1570 ;; Don't signal an error if the 1549 ,(lambda (_button) (customize-group 'initialization))
1571 ;; directory for auto-save-list files 1550 "Change initialization settings including this screen")
1572 ;; does not yet exist. 1551 "\n"))
1573 (file-directory-p (file-name-directory 1552 (fancy-splash-insert
1574 auto-save-list-file-prefix)) 1553 :face 'variable-pitch "To quit a partially entered command, type "
1575 (directory-files 1554 :face 'default "Control-g"
1576 (file-name-directory auto-save-list-file-prefix) 1555 :face 'variable-pitch ".\n")
1577 nil 1556 (fancy-splash-insert :face `(variable-pitch font-lock-builtin-face)
1578 (concat "\\`" 1557 "\nThis is "
1579 (regexp-quote (file-name-nondirectory 1558 (emacs-version)
1580 auto-save-list-file-prefix))) 1559 "\n"
1581 t) 1560 :face '(variable-pitch (:height 0.8))
1582 (fancy-splash-insert :face '(variable-pitch (:foreground "red")) 1561 emacs-copyright
1583 "\nIf an Emacs session crashed recently, " 1562 "\n")
1584 "type " 1563 (and auto-save-list-file-prefix
1585 :face '(fixed-pitch :foreground "red") 1564 ;; Don't signal an error if the
1586 "Meta-x recover-session RET" 1565 ;; directory for auto-save-list files
1587 :face '(variable-pitch (:foreground "red")) 1566 ;; does not yet exist.
1588 "\nto recover" 1567 (file-directory-p (file-name-directory
1589 " the files you were editing.")) 1568 auto-save-list-file-prefix))
1590 1569 (directory-files
1591 (when concise 1570 (file-name-directory auto-save-list-file-prefix)
1592 (fancy-splash-insert 1571 nil
1593 :face 'variable-pitch "\n" 1572 (concat "\\`"
1594 :link `("Dismiss this startup screen" 1573 (regexp-quote (file-name-nondirectory
1595 ,(lambda (_button) 1574 auto-save-list-file-prefix)))
1596 (when startup-screen-inhibit-startup-screen 1575 t)
1597 (customize-set-variable 'inhibit-startup-screen t) 1576 (fancy-splash-insert :face '(variable-pitch font-lock-comment-face)
1598 (customize-mark-to-save 'inhibit-startup-screen) 1577 "\nIf an Emacs session crashed recently, "
1599 (custom-save-all)) 1578 "type "
1600 (let ((w (get-buffer-window "*GNU Emacs*"))) 1579 :face '(fixed-pitch font-lock-comment-face)
1601 (and w (not (one-window-p)) (delete-window w))) 1580 "Meta-x recover-session RET"
1602 (kill-buffer "*GNU Emacs*"))) 1581 :face '(variable-pitch font-lock-comment-face)
1603 " ") 1582 "\nto recover"
1604 (when (or user-init-file custom-file) 1583 " the files you were editing."))
1605 (let ((checked (create-image "checked.xpm" 1584
1606 nil nil :ascent 'center)) 1585 (when concise
1607 (unchecked (create-image "unchecked.xpm" 1586 (fancy-splash-insert
1608 nil nil :ascent 'center))) 1587 :face 'variable-pitch "\n"
1609 (insert-button 1588 :link `("Dismiss this startup screen"
1610 " " 1589 ,(lambda (_button)
1611 :on-glyph checked 1590 (when startup-screen-inhibit-startup-screen
1612 :off-glyph unchecked 1591 (customize-set-variable 'inhibit-startup-screen t)
1613 'checked nil 'display unchecked 'follow-link t 1592 (customize-mark-to-save 'inhibit-startup-screen)
1614 'action (lambda (button) 1593 (custom-save-all))
1615 (if (overlay-get button 'checked) 1594 (let ((w (get-buffer-window "*GNU Emacs*")))
1616 (progn (overlay-put button 'checked nil) 1595 (and w (not (one-window-p)) (delete-window w)))
1617 (overlay-put button 'display 1596 (kill-buffer "*GNU Emacs*")))
1618 (overlay-get button :off-glyph)) 1597 " ")
1619 (setq startup-screen-inhibit-startup-screen 1598 (when (or user-init-file custom-file)
1620 nil)) 1599 (let ((checked (create-image "checked.xpm"
1621 (overlay-put button 'checked t) 1600 nil nil :ascent 'center))
1622 (overlay-put button 'display 1601 (unchecked (create-image "unchecked.xpm"
1623 (overlay-get button :on-glyph)) 1602 nil nil :ascent 'center)))
1624 (setq startup-screen-inhibit-startup-screen t))))) 1603 (insert-button
1625 (fancy-splash-insert :face '(variable-pitch (:height 0.9)) 1604 " "
1626 " Never show it again."))))) 1605 :on-glyph checked
1606 :off-glyph unchecked
1607 'checked nil 'display unchecked 'follow-link t
1608 'action (lambda (button)
1609 (if (overlay-get button 'checked)
1610 (progn (overlay-put button 'checked nil)
1611 (overlay-put button 'display
1612 (overlay-get button :off-glyph))
1613 (setq startup-screen-inhibit-startup-screen
1614 nil))
1615 (overlay-put button 'checked t)
1616 (overlay-put button 'display
1617 (overlay-get button :on-glyph))
1618 (setq startup-screen-inhibit-startup-screen t)))))
1619 (fancy-splash-insert :face '(variable-pitch (:height 0.9))
1620 " Never show it again."))))
1627 1621
1628(defun exit-splash-screen () 1622(defun exit-splash-screen ()
1629 "Stop displaying the splash screen buffer." 1623 "Stop displaying the splash screen buffer."
diff --git a/lisp/subr.el b/lisp/subr.el
index 4d2f3b1808c..94b28c007d1 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -490,6 +490,7 @@ SEQ must be a list, vector, or string. The comparison is done with `equal'."
490 "Return LIST with all occurrences of ELT removed. 490 "Return LIST with all occurrences of ELT removed.
491The comparison is done with `eq'. Contrary to `delq', this does not use 491The comparison is done with `eq'. Contrary to `delq', this does not use
492side-effects, and the argument LIST is not modified." 492side-effects, and the argument LIST is not modified."
493 (while (and (eq elt (car list)) (setq list (cdr list))))
493 (if (memq elt list) 494 (if (memq elt list)
494 (delq elt (copy-sequence list)) 495 (delq elt (copy-sequence list))
495 list)) 496 list))
@@ -591,31 +592,88 @@ Don't call this function; it is for internal use only."
591 (dolist (p list) 592 (dolist (p list)
592 (funcall function (car p) (cdr p))))) 593 (funcall function (car p) (cdr p)))))
593 594
595(defun keymap--menu-item-binding (val)
596 "Return the binding part of a menu-item."
597 (cond
598 ((not (consp val)) val) ;Not a menu-item.
599 ((eq 'menu-item (car val))
600 (let* ((binding (nth 2 val))
601 (plist (nthcdr 3 val))
602 (filter (plist-get plist :filter)))
603 (if filter (funcall filter binding)
604 binding)))
605 ((and (consp (cdr val)) (stringp (cadr val)))
606 (cddr val))
607 ((stringp (car val))
608 (cdr val))
609 (t val))) ;Not a menu-item either.
610
611(defun keymap--menu-item-with-binding (item binding)
612 "Build a menu-item like ITEM but with its binding changed to BINDING."
613 (cond
614 ((eq 'menu-item (car item))
615 (setq item (copy-sequence item))
616 (let ((tail (nthcdr 2 item)))
617 (setcar tail binding)
618 ;; Remove any potential filter.
619 (if (plist-get (cdr tail) :filter)
620 (setcdr tail (plist-put (cdr tail) :filter nil))))
621 item)
622 ((and (consp (cdr item)) (stringp (cadr item)))
623 (cons (car item) (cons (cadr item) binding)))
624 (t (cons (car item) binding))))
625
626(defun keymap--merge-bindings (val1 val2)
627 "Merge bindings VAL1 and VAL2."
628 (let ((map1 (keymap--menu-item-binding val1))
629 (map2 (keymap--menu-item-binding val2)))
630 (if (not (and (keymapp map1) (keymapp map2)))
631 ;; There's nothing to merge: val1 takes precedence.
632 val1
633 (let ((map (list 'keymap map1 map2))
634 (item (if (keymapp val1) (if (keymapp val2) nil val2) val1)))
635 (keymap--menu-item-with-binding item map)))))
636
594(defun keymap-canonicalize (map) 637(defun keymap-canonicalize (map)
595 "Return an equivalent keymap, without inheritance." 638 "Return a simpler equivalent keymap.
639This resolves inheritance and redefinitions. The returned keymap
640should behave identically to a copy of KEYMAP w.r.t `lookup-key'
641and use in active keymaps and menus.
642Subkeymaps may be modified but are not canonicalized."
643 ;; FIXME: Problem with the difference between a nil binding
644 ;; that hides a binding in an inherited map and a nil binding that's ignored
645 ;; to let some further binding visible. Currently a nil binding hides all.
646 ;; FIXME: we may want to carefully (re)order elements in case they're
647 ;; menu-entries.
596 (let ((bindings ()) 648 (let ((bindings ())
597 (ranges ()) 649 (ranges ())
598 (prompt (keymap-prompt map))) 650 (prompt (keymap-prompt map)))
599 (while (keymapp map) 651 (while (keymapp map)
600 (setq map (map-keymap-internal 652 (setq map (map-keymap ;; -internal
601 (lambda (key item) 653 (lambda (key item)
602 (if (consp key) 654 (if (consp key)
603 ;; Treat char-ranges specially. 655 ;; Treat char-ranges specially.
604 (push (cons key item) ranges) 656 (push (cons key item) ranges)
605 (push (cons key item) bindings))) 657 (push (cons key item) bindings)))
606 map))) 658 map)))
659 ;; Create the new map.
607 (setq map (funcall (if ranges 'make-keymap 'make-sparse-keymap) prompt)) 660 (setq map (funcall (if ranges 'make-keymap 'make-sparse-keymap) prompt))
608 (dolist (binding ranges) 661 (dolist (binding ranges)
609 ;; Treat char-ranges specially. 662 ;; Treat char-ranges specially. FIXME: need to merge as well.
610 (define-key map (vector (car binding)) (cdr binding))) 663 (define-key map (vector (car binding)) (cdr binding)))
664 ;; Process the bindings starting from the end.
611 (dolist (binding (prog1 bindings (setq bindings ()))) 665 (dolist (binding (prog1 bindings (setq bindings ())))
612 (let* ((key (car binding)) 666 (let* ((key (car binding))
613 (item (cdr binding)) 667 (item (cdr binding))
614 (oldbind (assq key bindings))) 668 (oldbind (assq key bindings)))
615 ;; Newer bindings override older. 669 (push (if (not oldbind)
616 (if oldbind (setq bindings (delq oldbind bindings))) 670 ;; The normal case: no duplicate bindings.
617 (when item ;nil bindings just hide older ones. 671 binding
618 (push binding bindings)))) 672 ;; This is the second binding for this key.
673 (setq bindings (delq oldbind bindings))
674 (cons key (keymap--merge-bindings (cdr binding)
675 (cdr oldbind))))
676 bindings)))
619 (nconc map bindings))) 677 (nconc map bindings)))
620 678
621(put 'keyboard-translate-table 'char-table-extra-slots 0) 679(put 'keyboard-translate-table 'char-table-extra-slots 0)
@@ -1204,10 +1262,10 @@ unless the optional argument APPEND is non-nil, in which case
1204FUNCTION is added at the end. 1262FUNCTION is added at the end.
1205 1263
1206The optional fourth argument, LOCAL, if non-nil, says to modify 1264The optional fourth argument, LOCAL, if non-nil, says to modify
1207the hook's buffer-local value rather than its default value. 1265the hook's buffer-local value rather than its global value.
1208This makes the hook buffer-local if needed, and it makes t a member 1266This makes the hook buffer-local, and it makes t a member of the
1209of the buffer-local value. That acts as a flag to run the hook 1267buffer-local value. That acts as a flag to run the hook
1210functions in the default value as well as in the local value. 1268functions of the global value as well as in the local value.
1211 1269
1212HOOK should be a symbol, and FUNCTION may be any valid function. If 1270HOOK should be a symbol, and FUNCTION may be any valid function. If
1213HOOK is void, it is first set to nil. If HOOK's value is a single 1271HOOK is void, it is first set to nil. If HOOK's value is a single
@@ -3014,8 +3072,15 @@ See also `with-temp-file' and `with-output-to-string'."
3014 "Execute BODY, pretending it does not modify the buffer. 3072 "Execute BODY, pretending it does not modify the buffer.
3015If BODY performs real modifications to the buffer's text, other 3073If BODY performs real modifications to the buffer's text, other
3016than cosmetic ones, undo data may become corrupted. 3074than cosmetic ones, undo data may become corrupted.
3017Typically used around modifications of text-properties which do not really 3075
3018affect the buffer's content." 3076This macro will run BODY normally, but doesn't count its buffer
3077modifications as being buffer modifications. This affects things
3078like buffer-modified-p, checking whether the file is locked by
3079someone else, running buffer modification hooks, and other things
3080of that nature.
3081
3082Typically used around modifications of text-properties which do
3083not really affect the buffer's content."
3019 (declare (debug t) (indent 0)) 3084 (declare (debug t) (indent 0))
3020 (let ((modified (make-symbol "modified"))) 3085 (let ((modified (make-symbol "modified")))
3021 `(let* ((,modified (buffer-modified-p)) 3086 `(let* ((,modified (buffer-modified-p))
@@ -4022,7 +4087,8 @@ If all LST elements are zeros or LST is nil, return zero."
4022Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\", 4087Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
4023etc. That is, the trailing \".0\"s are insignificant. Also, version 4088etc. That is, the trailing \".0\"s are insignificant. Also, version
4024string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", 4089string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\",
4025which is higher than \"1alpha\"." 4090which is higher than \"1alpha\". Also, \"-CVS\" and \"-NNN\" are treated
4091as alpha versions."
4026 (version-list-< (version-to-list v1) (version-to-list v2))) 4092 (version-list-< (version-to-list v1) (version-to-list v2)))
4027 4093
4028 4094
@@ -4032,7 +4098,8 @@ which is higher than \"1alpha\"."
4032Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\", 4098Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
4033etc. That is, the trailing \".0\"s are insignificant. Also, version 4099etc. That is, the trailing \".0\"s are insignificant. Also, version
4034string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", 4100string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\",
4035which is higher than \"1alpha\"." 4101which is higher than \"1alpha\". Also, \"-CVS\" and \"-NNN\" are treated
4102as alpha versions."
4036 (version-list-<= (version-to-list v1) (version-to-list v2))) 4103 (version-list-<= (version-to-list v1) (version-to-list v2)))
4037 4104
4038(defun version= (v1 v2) 4105(defun version= (v1 v2)
@@ -4041,7 +4108,8 @@ which is higher than \"1alpha\"."
4041Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\", 4108Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
4042etc. That is, the trailing \".0\"s are insignificant. Also, version 4109etc. That is, the trailing \".0\"s are insignificant. Also, version
4043string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", 4110string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\",
4044which is higher than \"1alpha\"." 4111which is higher than \"1alpha\". Also, \"-CVS\" and \"-NNN\" are treated
4112as alpha versions."
4045 (version-list-= (version-to-list v1) (version-to-list v2))) 4113 (version-list-= (version-to-list v1) (version-to-list v2)))
4046 4114
4047 4115
diff --git a/lisp/tabify.el b/lisp/tabify.el
index da1038a2164..0b2411d0316 100644
--- a/lisp/tabify.el
+++ b/lisp/tabify.el
@@ -34,19 +34,21 @@ Called non-interactively, the region is specified by arguments
34START and END, rather than by the position of point and mark. 34START and END, rather than by the position of point and mark.
35The variable `tab-width' controls the spacing of tab stops." 35The variable `tab-width' controls the spacing of tab stops."
36 (interactive "r") 36 (interactive "r")
37 (save-excursion 37 (let ((c (current-column)))
38 (save-restriction 38 (save-excursion
39 (narrow-to-region (point-min) end) 39 (save-restriction
40 (goto-char start) 40 (narrow-to-region (point-min) end)
41 (while (search-forward "\t" nil t) ; faster than re-search 41 (goto-char start)
42 (forward-char -1) 42 (while (search-forward "\t" nil t) ; faster than re-search
43 (let ((tab-beg (point)) 43 (forward-char -1)
44 (indent-tabs-mode nil) 44 (let ((tab-beg (point))
45 column) 45 (indent-tabs-mode nil)
46 (skip-chars-forward "\t") 46 column)
47 (setq column (current-column)) 47 (skip-chars-forward "\t")
48 (delete-region tab-beg (point)) 48 (setq column (current-column))
49 (indent-to column)))))) 49 (delete-region tab-beg (point))
50 (indent-to column)))))
51 (move-to-column c)))
50 52
51(defvar tabify-regexp " [ \t]+" 53(defvar tabify-regexp " [ \t]+"
52 "Regexp matching whitespace that tabify should consider. 54 "Regexp matching whitespace that tabify should consider.
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index fbf3e91d3d9..447d7fd2533 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -892,6 +892,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
892(declare-function ns-list-services "nsfns.m" ()) 892(declare-function ns-list-services "nsfns.m" ())
893(declare-function x-open-connection "nsfns.m" 893(declare-function x-open-connection "nsfns.m"
894 (display &optional xrm-string must-succeed)) 894 (display &optional xrm-string must-succeed))
895(declare-function ns-set-resource "nsfns.m" (owner name value))
895 896
896;; Do the actual Nextstep Windows setup here; the above code just 897;; Do the actual Nextstep Windows setup here; the above code just
897;; defines functions and variables that we use now. 898;; defines functions and variables that we use now.
@@ -916,7 +917,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
916 ;; FIXME: This will surely lead to "MODIFIED OUTSIDE CUSTOM" warnings. 917 ;; FIXME: This will surely lead to "MODIFIED OUTSIDE CUSTOM" warnings.
917 (menu-bar-mode (if (get-lisp-resource nil "Menus") 1 -1)) 918 (menu-bar-mode (if (get-lisp-resource nil "Menus") 1 -1))
918 919
919 ;; OS X Lion introduces PressAndHold, which is unsupported by this port. 920 ;; OS X Lion introduces PressAndHold, which is unsupported by this port.
920 ;; See this thread for more details: 921 ;; See this thread for more details:
921 ;; http://lists.gnu.org/archive/html/emacs-devel/2011-06/msg00505.html 922 ;; http://lists.gnu.org/archive/html/emacs-devel/2011-06/msg00505.html
922 (ns-set-resource nil "ApplePressAndHoldEnabled" "NO") 923 (ns-set-resource nil "ApplePressAndHoldEnabled" "NO")
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 107a0728bae..a660bdb6488 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -90,8 +90,8 @@ If this is a function, call it to generate the initial field text."
90(defcustom bibtex-user-optional-fields 90(defcustom bibtex-user-optional-fields
91 '(("annote" "Personal annotation (ignored)")) 91 '(("annote" "Personal annotation (ignored)"))
92 "List of optional fields the user wants to have always present. 92 "List of optional fields the user wants to have always present.
93Entries should be of the same form as the OPTIONAL and 93Entries should be of the same form as the OPTIONAL list
94CROSSREF-OPTIONAL lists in `bibtex-entry-field-alist' (which see)." 94in `bibtex-BibTeX-entry-alist' (which see)."
95 :group 'bibtex 95 :group 'bibtex
96 :type '(repeat (group (string :tag "Field") 96 :type '(repeat (group (string :tag "Field")
97 (string :tag "Comment") 97 (string :tag "Comment")
@@ -127,7 +127,7 @@ braces Enclose parts of field entries by braces according to
127strings Replace parts of field entries by string constants 127strings Replace parts of field entries by string constants
128 according to `bibtex-field-strings-alist'. 128 according to `bibtex-field-strings-alist'.
129sort-fields Sort fields to match the field order in 129sort-fields Sort fields to match the field order in
130 `bibtex-entry-field-alist'. 130 `bibtex-BibTeX-entry-alist'.
131 131
132The value t means do all of the above formatting actions. 132The value t means do all of the above formatting actions.
133The value nil means do no formatting at all." 133The value nil means do no formatting at all."
@@ -264,265 +264,584 @@ If parsing fails, try to set this variable to nil."
264 :group 'bibtex 264 :group 'bibtex
265 :type 'boolean) 265 :type 'boolean)
266 266
267(defcustom bibtex-entry-field-alist 267(define-widget 'bibtex-entry-alist 'lazy
268 '(("Article" 268 "Format of `bibtex-BibTeX-entry-alist' and friends."
269 ((("author" "Author1 [and Author2 ...] [and others]") 269 :type '(repeat (group (string :tag "Entry type")
270 ("title" "Title of the article (BibTeX converts it to lowercase)") 270 (string :tag "Documentation")
271 ("journal" "Name of the journal (use string, remove braces)") 271 (repeat :tag "Required fields"
272 ("year" "Year of publication")) 272 (group (string :tag "Field")
273 (("volume" "Volume of the journal") 273 (option (choice :tag "Comment" :value nil
274 ("number" "Number of the journal (only allowed if entry contains volume)") 274 (const nil) string))
275 ("pages" "Pages in the journal") 275 (option (choice :tag "Init" :value nil
276 ("month" "Month of the publication as a string (remove braces)") 276 (const nil) string function))
277 ("note" "Remarks to be put at the end of the \\bibitem"))) 277 (option (choice :tag "Alternative" :value nil
278 ((("author" "Author1 [and Author2 ...] [and others]") 278 (const nil) integer))))
279 ("title" "Title of the article (BibTeX converts it to lowercase)")) 279 (repeat :tag "Crossref fields"
280 (("pages" "Pages in the journal") 280 (group (string :tag "Field")
281 ("journal" "Name of the journal (use string, remove braces)") 281 (option (choice :tag "Comment" :value nil
282 ("year" "Year of publication") 282 (const nil) string))
283 ("volume" "Volume of the journal") 283 (option (choice :tag "Init" :value nil
284 ("number" "Number of the journal") 284 (const nil) string function))
285 ("month" "Month of the publication as a string (remove braces)") 285 (option (choice :tag "Alternative" :value nil
286 ("note" "Remarks to be put at the end of the \\bibitem")))) 286 (const nil) integer))))
287 ("Book" 287 (repeat :tag "Optional fields"
288 ((("author" "Author1 [and Author2 ...] [and others]" nil t) 288 (group (string :tag "Field")
289 ("editor" "Editor1 [and Editor2 ...] [and others]" nil t) 289 (option (choice :tag "Comment" :value nil
290 ("title" "Title of the book") 290 (const nil) string))
291 ("publisher" "Publishing company") 291 (option (choice :tag "Init" :value nil
292 ("year" "Year of publication")) 292 (const nil) string function)))))))
293 (("volume" "Volume of the book in the series") 293
294 ("number" "Number of the book in a small series (overwritten by volume)") 294(define-obsolete-variable-alias 'bibtex-entry-field-alist
295 ("series" "Series in which the book appeared") 295 'bibtex-BibTeX-entry-alist "24.1")
296 ("address" "Address of the publisher") 296(defcustom bibtex-BibTeX-entry-alist
297 ("edition" "Edition of the book as a capitalized English word") 297 '(("Article" "Article in Journal"
298 ("month" "Month of the publication as a string (remove braces)") 298 (("author")
299 ("note" "Remarks to be put at the end of the \\bibitem"))) 299 ("title" "Title of the article (BibTeX converts it to lowercase)"))
300 ((("author" "Author1 [and Author2 ...] [and others]" nil t) 300 (("journal") ("year"))
301 ("editor" "Editor1 [and Editor2 ...] [and others]" nil t) 301 (("volume" "Volume of the journal")
302 ("title" "Title of the book")) 302 ("number" "Number of the journal (only allowed if entry contains volume)")
303 (("publisher" "Publishing company") 303 ("pages" "Pages in the journal")
304 ("year" "Year of publication") 304 ("month") ("note")))
305 ("volume" "Volume of the book in the series") 305 ("InProceedings" "Article in Conference Proceedings"
306 ("number" "Number of the book in a small series (overwritten by volume)") 306 (("author")
307 ("series" "Series in which the book appeared") 307 ("title" "Title of the article in proceedings (BibTeX converts it to lowercase)"))
308 ("address" "Address of the publisher") 308 (("booktitle" "Name of the conference proceedings")
309 ("edition" "Edition of the book as a capitalized English word") 309 ("year"))
310 ("month" "Month of the publication as a string (remove braces)") 310 (("editor")
311 ("note" "Remarks to be put at the end of the \\bibitem")))) 311 ("volume" "Volume of the conference proceedings in the series")
312 ("Booklet" 312 ("number" "Number of the conference proceedings in a small series (overwritten by volume)")
313 ((("title" "Title of the booklet (BibTeX converts it to lowercase)")) 313 ("series" "Series in which the conference proceedings appeared")
314 (("author" "Author1 [and Author2 ...] [and others]") 314 ("pages" "Pages in the conference proceedings")
315 ("howpublished" "The way in which the booklet was published") 315 ("month") ("address")
316 ("address" "Address of the publisher") 316 ("organization" "Sponsoring organization of the conference")
317 ("month" "Month of the publication as a string (remove braces)") 317 ("publisher" "Publishing company, its location")
318 ("year" "Year of publication") 318 ("note")))
319 ("note" "Remarks to be put at the end of the \\bibitem")))) 319 ("InCollection" "Article in a Collection"
320 ("InBook" 320 (("author")
321 ((("author" "Author1 [and Author2 ...] [and others]" nil t) 321 ("title" "Title of the article in book (BibTeX converts it to lowercase)")
322 ("editor" "Editor1 [and Editor2 ...] [and others]" nil t) 322 ("booktitle" "Name of the book"))
323 ("title" "Title of the book") 323 (("publisher") ("year"))
324 ("chapter" "Chapter in the book") 324 (("editor")
325 ("publisher" "Publishing company") 325 ("volume" "Volume of the book in the series")
326 ("year" "Year of publication")) 326 ("number" "Number of the book in a small series (overwritten by volume)")
327 (("volume" "Volume of the book in the series") 327 ("series" "Series in which the book appeared")
328 ("number" "Number of the book in a small series (overwritten by volume)") 328 ("type" "Word to use instead of \"chapter\"")
329 ("series" "Series in which the book appeared") 329 ("chapter" "Chapter in the book")
330 ("type" "Word to use instead of \"chapter\"") 330 ("pages" "Pages in the book")
331 ("address" "Address of the publisher") 331 ("edition" "Edition of the book as a capitalized English word")
332 ("edition" "Edition of the book as a capitalized English word") 332 ("month") ("address") ("note")))
333 ("month" "Month of the publication as a string (remove braces)") 333 ("InBook" "Chapter or Pages in a Book"
334 ("pages" "Pages in the book") 334 (("author" nil nil 0)
335 ("note" "Remarks to be put at the end of the \\bibitem"))) 335 ("editor" nil nil 0)
336 ((("author" "Author1 [and Author2 ...] [and others]" nil t) 336 ("title" "Title of the book")
337 ("editor" "Editor1 [and Editor2 ...] [and others]" nil t) 337 ("chapter" "Chapter in the book"))
338 ("title" "Title of the book") 338 (("publisher") ("year"))
339 ("chapter" "Chapter in the book")) 339 (("volume" "Volume of the book in the series")
340 (("pages" "Pages in the book") 340 ("number" "Number of the book in a small series (overwritten by volume)")
341 ("publisher" "Publishing company") 341 ("series" "Series in which the book appeared")
342 ("year" "Year of publication") 342 ("type" "Word to use instead of \"chapter\"")
343 ("volume" "Volume of the book in the series") 343 ("address")
344 ("number" "Number of the book in a small series (overwritten by volume)") 344 ("edition" "Edition of the book as a capitalized English word")
345 ("series" "Series in which the book appeared") 345 ("month")
346 ("type" "Word to use instead of \"chapter\"") 346 ("pages" "Pages in the book")
347 ("address" "Address of the publisher") 347 ("note")))
348 ("edition" "Edition of the book as a capitalized English word") 348 ("Proceedings" "Conference Proceedings"
349 ("month" "Month of the publication as a string (remove braces)") 349 (("title" "Title of the conference proceedings")
350 ("note" "Remarks to be put at the end of the \\bibitem")))) 350 ("year"))
351 ("InCollection" 351 nil
352 ((("author" "Author1 [and Author2 ...] [and others]") 352 (("booktitle" "Title of the proceedings for cross references")
353 ("title" "Title of the article in book (BibTeX converts it to lowercase)") 353 ("editor")
354 ("booktitle" "Name of the book") 354 ("volume" "Volume of the conference proceedings in the series")
355 ("publisher" "Publishing company") 355 ("number" "Number of the conference proceedings in a small series (overwritten by volume)")
356 ("year" "Year of publication")) 356 ("series" "Series in which the conference proceedings appeared")
357 (("editor" "Editor1 [and Editor2 ...] [and others]") 357 ("address")
358 ("volume" "Volume of the book in the series") 358 ("month")
359 ("number" "Number of the book in a small series (overwritten by volume)") 359 ("organization" "Sponsoring organization of the conference")
360 ("series" "Series in which the book appeared") 360 ("publisher" "Publishing company, its location")
361 ("type" "Word to use instead of \"chapter\"") 361 ("note")))
362 ("chapter" "Chapter in the book") 362 ("Book" "Book"
363 ("pages" "Pages in the book") 363 (("author" nil nil 0)
364 ("address" "Address of the publisher") 364 ("editor" nil nil 0)
365 ("edition" "Edition of the book as a capitalized English word") 365 ("title" "Title of the book"))
366 ("month" "Month of the publication as a string (remove braces)") 366 (("publisher") ("year"))
367 ("note" "Remarks to be put at the end of the \\bibitem"))) 367 (("volume" "Volume of the book in the series")
368 ((("author" "Author1 [and Author2 ...] [and others]") 368 ("number" "Number of the book in a small series (overwritten by volume)")
369 ("title" "Title of the article in book (BibTeX converts it to lowercase)") 369 ("series" "Series in which the book appeared")
370 ("booktitle" "Name of the book")) 370 ("address")
371 (("pages" "Pages in the book") 371 ("edition" "Edition of the book as a capitalized English word")
372 ("publisher" "Publishing company") 372 ("month") ("note")))
373 ("year" "Year of publication") 373 ("Booklet" "Booklet (Bound, but no Publisher)"
374 ("editor" "Editor1 [and Editor2 ...] [and others]") 374 (("title" "Title of the booklet (BibTeX converts it to lowercase)"))
375 ("volume" "Volume of the book in the series") 375 nil
376 ("number" "Number of the book in a small series (overwritten by volume)") 376 (("author")
377 ("series" "Series in which the book appeared") 377 ("howpublished" "The way in which the booklet was published")
378 ("type" "Word to use instead of \"chapter\"") 378 ("address") ("month") ("year") ("note")))
379 ("chapter" "Chapter in the book") 379 ("PhdThesis" "PhD. Thesis"
380 ("address" "Address of the publisher") 380 (("author")
381 ("edition" "Edition of the book as a capitalized English word") 381 ("title" "Title of the PhD. thesis")
382 ("month" "Month of the publication as a string (remove braces)") 382 ("school" "School where the PhD. thesis was written")
383 ("note" "Remarks to be put at the end of the \\bibitem")))) 383 ("year"))
384 ("InProceedings" 384 nil
385 ((("author" "Author1 [and Author2 ...] [and others]") 385 (("type" "Type of the PhD. thesis")
386 ("title" "Title of the article in proceedings (BibTeX converts it to lowercase)") 386 ("address" "Address of the school (if not part of field \"school\") or country")
387 ("booktitle" "Name of the conference proceedings") 387 ("month") ("note")))
388 ("year" "Year of publication")) 388 ("MastersThesis" "Master's Thesis"
389 (("editor" "Editor1 [and Editor2 ...] [and others]") 389 (("author")
390 ("volume" "Volume of the conference proceedings in the series") 390 ("title" "Title of the master's thesis (BibTeX converts it to lowercase)")
391 ("number" "Number of the conference proceedings in a small series (overwritten by volume)") 391 ("school" "School where the master's thesis was written")
392 ("series" "Series in which the conference proceedings appeared") 392 ("year"))
393 ("pages" "Pages in the conference proceedings") 393 nil
394 ("address" "Location of the Proceedings") 394 (("type" "Type of the master's thesis (if other than \"Master's thesis\")")
395 ("month" "Month of the publication as a string (remove braces)") 395 ("address" "Address of the school (if not part of field \"school\") or country")
396 ("organization" "Sponsoring organization of the conference") 396 ("month") ("note")))
397 ("publisher" "Publishing company, its location") 397 ("TechReport" "Technical Report"
398 ("note" "Remarks to be put at the end of the \\bibitem"))) 398 (("author")
399 ((("author" "Author1 [and Author2 ...] [and others]") 399 ("title" "Title of the technical report (BibTeX converts it to lowercase)")
400 ("title" "Title of the article in proceedings (BibTeX converts it to lowercase)")) 400 ("institution" "Sponsoring institution of the report")
401 (("booktitle" "Name of the conference proceedings") 401 ("year"))
402 ("pages" "Pages in the conference proceedings") 402 nil
403 ("year" "Year of publication") 403 (("type" "Type of the report (if other than \"technical report\")")
404 ("editor" "Editor1 [and Editor2 ...] [and others]") 404 ("number" "Number of the technical report")
405 ("volume" "Volume of the conference proceedings in the series") 405 ("address") ("month") ("note")))
406 ("number" "Number of the conference proceedings in a small series (overwritten by volume)") 406 ("Manual" "Technical Manual"
407 ("series" "Series in which the conference proceedings appeared") 407 (("title" "Title of the manual"))
408 ("address" "Location of the Proceedings") 408 nil
409 ("month" "Month of the publication as a string (remove braces)") 409 (("author")
410 ("organization" "Sponsoring organization of the conference") 410 ("organization" "Publishing organization of the manual")
411 ("publisher" "Publishing company, its location") 411 ("address")
412 ("note" "Remarks to be put at the end of the \\bibitem")))) 412 ("edition" "Edition of the manual as a capitalized English word")
413 ("Manual" 413 ("month") ("year") ("note")))
414 ((("title" "Title of the manual")) 414 ("Unpublished" "Unpublished"
415 (("author" "Author1 [and Author2 ...] [and others]") 415 (("author")
416 ("organization" "Publishing organization of the manual") 416 ("title" "Title of the unpublished work (BibTeX converts it to lowercase)")
417 ("address" "Address of the organization") 417 ("note"))
418 ("edition" "Edition of the manual as a capitalized English word") 418 nil
419 ("month" "Month of the publication as a string (remove braces)") 419 (("month") ("year")))
420 ("year" "Year of publication") 420 ("Misc" "Miscellaneous" nil nil
421 ("note" "Remarks to be put at the end of the \\bibitem")))) 421 (("author")
422 ("MastersThesis" 422 ("title" "Title of the work (BibTeX converts it to lowercase)")
423 ((("author" "Author1 [and Author2 ...] [and others]") 423 ("howpublished" "The way in which the work was published")
424 ("title" "Title of the master\'s thesis (BibTeX converts it to lowercase)") 424 ("month") ("year") ("note"))))
425 ("school" "School where the master\'s thesis was written") 425 "Alist of BibTeX entry types and their associated fields.
426 ("year" "Year of publication")) 426Elements are lists (ENTRY-TYPE DOC REQUIRED CROSSREF OPTIONAL).
427 (("type" "Type of the master\'s thesis (if other than \"Master\'s thesis\")") 427ENTRY-TYPE is the type of a BibTeX entry.
428 ("address" "Address of the school (if not part of field \"school\") or country") 428DOC is a brief doc string used for menus. If nil ENTRY-TYPE is used.
429 ("month" "Month of the publication as a string (remove braces)") 429REQUIRED is a list of required fields.
430 ("note" "Remarks to be put at the end of the \\bibitem")))) 430CROSSREF is a list of fields that are optional if a crossref field
431 ("Misc" 431is present; but these fields are required otherwise.
432 (() 432OPTIONAL is a list of optional fields.
433 (("author" "Author1 [and Author2 ...] [and others]") 433
434 ("title" "Title of the work (BibTeX converts it to lowercase)")
435 ("howpublished" "The way in which the work was published")
436 ("month" "Month of the publication as a string (remove braces)")
437 ("year" "Year of publication")
438 ("note" "Remarks to be put at the end of the \\bibitem"))))
439 ("PhdThesis"
440 ((("author" "Author1 [and Author2 ...] [and others]")
441 ("title" "Title of the PhD. thesis")
442 ("school" "School where the PhD. thesis was written")
443 ("year" "Year of publication"))
444 (("type" "Type of the PhD. thesis")
445 ("address" "Address of the school (if not part of field \"school\") or country")
446 ("month" "Month of the publication as a string (remove braces)")
447 ("note" "Remarks to be put at the end of the \\bibitem"))))
448 ("Proceedings"
449 ((("title" "Title of the conference proceedings")
450 ("year" "Year of publication"))
451 (("booktitle" "Title of the proceedings for cross references")
452 ("editor" "Editor1 [and Editor2 ...] [and others]")
453 ("volume" "Volume of the conference proceedings in the series")
454 ("number" "Number of the conference proceedings in a small series (overwritten by volume)")
455 ("series" "Series in which the conference proceedings appeared")
456 ("address" "Location of the Proceedings")
457 ("month" "Month of the publication as a string (remove braces)")
458 ("organization" "Sponsoring organization of the conference")
459 ("publisher" "Publishing company, its location")
460 ("note" "Remarks to be put at the end of the \\bibitem"))))
461 ("TechReport"
462 ((("author" "Author1 [and Author2 ...] [and others]")
463 ("title" "Title of the technical report (BibTeX converts it to lowercase)")
464 ("institution" "Sponsoring institution of the report")
465 ("year" "Year of publication"))
466 (("type" "Type of the report (if other than \"technical report\")")
467 ("number" "Number of the technical report")
468 ("address" "Address of the institution (if not part of field \"institution\") or country")
469 ("month" "Month of the publication as a string (remove braces)")
470 ("note" "Remarks to be put at the end of the \\bibitem"))))
471 ("Unpublished"
472 ((("author" "Author1 [and Author2 ...] [and others]")
473 ("title" "Title of the unpublished work (BibTeX converts it to lowercase)")
474 ("note" "Remarks to be put at the end of the \\bibitem"))
475 (("month" "Month of the publication as a string (remove braces)")
476 ("year" "Year of publication")))))
477
478 "List of BibTeX entry types and their associated fields.
479List elements are triples
480\(ENTRY-TYPE (REQUIRED OPTIONAL) (CROSSREF-REQUIRED CROSSREF-OPTIONAL)).
481ENTRY-TYPE is the type of a BibTeX entry. The remaining pairs contain
482the required and optional fields of the BibTeX entry.
483The second pair is used if a crossref field is present
484and the first pair is used if a crossref field is absent.
485If the second pair is nil, the first pair is always used.
486REQUIRED, OPTIONAL, CROSSREF-REQUIRED and CROSSREF-OPTIONAL are lists.
487Each element of these lists is a list of the form 434Each element of these lists is a list of the form
488\(FIELD-NAME COMMENT-STRING INIT ALTERNATIVE-FLAG). 435 \(FIELD COMMENT INIT ALTERNATIVE).
489COMMENT-STRING, INIT, and ALTERNATIVE-FLAG are optional. 436COMMENT, INIT, and ALTERNATIVE are optional.
490FIELD-NAME is the name of the field, COMMENT-STRING is the comment that 437
491appears in the echo area, INIT is either the initial content of the 438FIELD is the name of the field.
492field or a function, which is called to determine the initial content 439COMMENT is the comment string that appears in the echo area.
493of the field, and ALTERNATIVE-FLAG (either nil or t) marks if the 440If COMMENT is nil use `bibtex-BibTeX-field-alist' if possible.
494field is an alternative. ALTERNATIVE-FLAG may be t only in the 441INIT is either the initial content of the field or a function,
495REQUIRED or CROSSREF-REQUIRED lists." 442which is called to determine the initial content of the field.
443ALTERNATIVE if non-nil is an integer that numbers sets of
444alternatives, starting from zero."
445 :group 'BibTeX
446 :type 'bibtex-entry-alist)
447(put 'bibtex-BibTeX-entry-alist 'risky-local-variable t)
448
449(defcustom bibtex-biblatex-entry-alist
450 ;; Compare in biblatex documentation:
451 ;; Sec. 2.1.1 Regular types (required and optional fields)
452 ;; Appendix A Default Crossref setup
453 '(("Article" "Article in Journal"
454 (("author") ("title") ("journaltitle")
455 ("year" nil nil 0) ("date" nil nil 0))
456 nil
457 (("translator") ("annotator") ("commentator") ("subtitle") ("titleaddon")
458 ("editor") ("editora") ("editorb") ("editorc")
459 ("journalsubtitle") ("issuetitle") ("issuesubtitle")
460 ("language") ("origlanguage") ("series") ("volume") ("number") ("eid")
461 ("issue") ("month") ("pages") ("version") ("note") ("issn")
462 ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass")
463 ("eprinttype") ("url") ("urldate")))
464 ("Book" "Single-Volume Book"
465 (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
466 nil
467 (("editor") ("editora") ("editorb") ("editorc")
468 ("translator") ("annotator") ("commentator")
469 ("introduction") ("foreword") ("afterword") ("titleaddon")
470 ("maintitle") ("mainsubtitle") ("maintitleaddon")
471 ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes")
472 ("series") ("number") ("note") ("publisher") ("location") ("isbn")
473 ("chapter") ("pages") ("pagetotal") ("addendum") ("pubstate") ("doi")
474 ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
475 ("MVBook" "Multi-Volume Book"
476 (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
477 nil
478 (("editor") ("editora") ("editorb") ("editorc")
479 ("translator") ("annotator") ("commentator")
480 ("introduction") ("foreword") ("afterword") ("subtitle")
481 ("titleaddon") ("language") ("origlanguage") ("edition") ("volumes")
482 ("series") ("number") ("note") ("publisher")
483 ("location") ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
484 ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
485 ("InBook" "Chapter or Pages in a Book"
486 (("title") ("year" nil nil 0) ("date" nil nil 0))
487 (("author") ("booktitle"))
488 (("bookauthor") ("editor") ("editora") ("editorb") ("editorc")
489 ("translator") ("annotator") ("commentator") ("introduction") ("foreword")
490 ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
491 ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
492 ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes")
493 ("series") ("number") ("note") ("publisher") ("location") ("isbn")
494 ("chapter") ("pages") ("addendum") ("pubstate")
495 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
496 ("BookInBook" "Book in Collection" ; same as @inbook
497 (("title") ("year" nil nil 0) ("date" nil nil 0))
498 (("author") ("booktitle"))
499 (("bookauthor") ("editor") ("editora") ("editorb") ("editorc")
500 ("translator") ("annotator") ("commentator") ("introduction") ("foreword")
501 ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
502 ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
503 ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes")
504 ("series") ("number") ("note") ("publisher") ("location") ("isbn")
505 ("chapter") ("pages") ("addendum") ("pubstate")
506 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
507 ("SuppBook" "Supplemental Material in a Book" ; same as @inbook
508 (("title") ("year" nil nil 0) ("date" nil nil 0))
509 (("author") ("booktitle"))
510 (("bookauthor") ("editor") ("editora") ("editorb") ("editorc")
511 ("translator") ("annotator") ("commentator") ("introduction") ("foreword")
512 ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
513 ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
514 ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes")
515 ("series") ("number") ("note") ("publisher") ("location") ("isbn")
516 ("chapter") ("pages") ("addendum") ("pubstate")
517 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
518 ("Booklet" "Booklet (Bound, but no Publisher)"
519 (("author" nil nil 0) ("editor" nil nil 0) ("title")
520 ("year" nil nil 1) ("date" nil nil 1))
521 nil
522 (("subtitle") ("titleaddon") ("language") ("howpublished") ("type")
523 ("note") ("location") ("chapter") ("pages") ("pagetotal") ("addendum")
524 ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype")
525 ("url") ("urldate")))
526 ("Collection" "Single-Volume Collection"
527 (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
528 nil
529 (("editora") ("editorb") ("editorc") ("translator") ("annotator")
530 ("commentator") ("introduction") ("foreword") ("afterword")
531 ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
532 ("maintitleaddon") ("language") ("origlanguage") ("volume")
533 ("part") ("edition") ("volumes") ("series") ("number") ("note")
534 ("publisher") ("location") ("isbn") ("chapter") ("pages") ("pagetotal")
535 ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass")
536 ("eprinttype") ("url") ("urldate")))
537 ("MVCollection" "Multi-Volume Collection"
538 (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
539 nil
540 (("editora") ("editorb") ("editorc") ("translator") ("annotator")
541 ("commentator") ("introduction") ("foreword") ("afterword")
542 ("subtitle") ("titleaddon") ("language") ("origlanguage") ("edition")
543 ("volumes") ("series") ("number") ("note") ("publisher")
544 ("location") ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
545 ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
546 ("InCollection" "Article in a Collection"
547 (("author") ("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
548 (("booktitle"))
549 (("editora") ("editorb") ("editorc") ("translator") ("annotator")
550 ("commentator") ("introduction") ("foreword") ("afterword")
551 ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
552 ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
553 ("language") ("origlanguage") ("volume") ("part") ("edition")
554 ("volumes") ("series") ("number") ("note") ("publisher") ("location")
555 ("isbn") ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
556 ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
557 ("SuppCollection" "Supplemental Material in a Collection" ; same as @incollection
558 (("author") ("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
559 (("booktitle"))
560 (("editora") ("editorb") ("editorc") ("translator") ("annotator")
561 ("commentator") ("introduction") ("foreword") ("afterword")
562 ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
563 ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
564 ("language") ("origlanguage") ("volume") ("part") ("edition")
565 ("volumes") ("series") ("number") ("note") ("publisher") ("location")
566 ("isbn") ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
567 ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
568 ("Manual" "Technical Manual"
569 (("author" nil nil 0) ("editor" nil nil 0) ("title")
570 ("year" nil nil 1) ("date" nil nil 1))
571 nil
572 (("subtitle") ("titleaddon") ("language") ("edition")
573 ("type") ("series") ("number") ("version") ("note")
574 ("organization") ("publisher") ("location") ("isbn") ("chapter")
575 ("pages") ("pagetotal") ("addendum") ("pubstate")
576 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
577 ("Misc" "Miscellaneous"
578 (("author" nil nil 0) ("editor" nil nil 0) ("title")
579 ("year" nil nil 1) ("date" nil nil 1))
580 nil
581 (("subtitle") ("titleaddon") ("language") ("howpublished") ("type")
582 ("version") ("note") ("organization") ("location")
583 ("date") ("month") ("year") ("addendum") ("pubstate")
584 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
585 ("Online" "Online Resource"
586 (("author" nil nil 0) ("editor" nil nil 0) ("title")
587 ("year" nil nil 1) ("date" nil nil 1) ("url"))
588 nil
589 (("subtitle") ("titleaddon") ("language") ("version") ("note")
590 ("organization") ("date") ("month") ("year") ("addendum")
591 ("pubstate") ("urldate")))
592 ("Patent" "Patent"
593 (("author") ("title") ("number") ("year" nil nil 0) ("date" nil nil 0))
594 nil
595 (("holder") ("subtitle") ("titleaddon") ("type") ("version") ("location")
596 ("note") ("date") ("month") ("year") ("addendum") ("pubstate")
597 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
598 ("Periodical" "Complete Issue of a Periodical"
599 (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
600 nil
601 (("editora") ("editorb") ("editorc") ("subtitle") ("issuetitle")
602 ("issuesubtitle") ("language") ("series") ("volume") ("number") ("issue")
603 ("date") ("month") ("year") ("note") ("issn") ("addendum") ("pubstate")
604 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
605 ("SuppPeriodical" "Supplemental Material in a Periodical" ; same as @article
606 (("author") ("title") ("journaltitle")
607 ("year" nil nil 0) ("date" nil nil 0))
608 nil
609 (("translator") ("annotator") ("commentator") ("subtitle") ("titleaddon")
610 ("editor") ("editora") ("editorb") ("editorc")
611 ("journalsubtitle") ("issuetitle") ("issuesubtitle")
612 ("language") ("origlanguage") ("series") ("volume") ("number") ("eid")
613 ("issue") ("month") ("pages") ("version") ("note") ("issn")
614 ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass")
615 ("eprinttype") ("url") ("urldate")))
616 ("Proceedings" "Single-Volume Conference Proceedings"
617 (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
618 nil
619 (("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
620 ("maintitleaddon") ("eventtitle") ("eventdate") ("venue") ("language")
621 ("volume") ("part") ("volumes") ("series") ("number") ("note")
622 ("organization") ("publisher") ("location") ("month")
623 ("isbn") ("chapter") ("pages") ("pagetotal") ("addendum") ("pubstate")
624 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
625 ("MVProceedings" "Multi-Volume Conference Proceedings"
626 (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
627 nil
628 (("subtitle") ("titleaddon") ("eventtitle") ("eventdate") ("venue")
629 ("language") ("volumes") ("series") ("number") ("note")
630 ("organization") ("publisher") ("location") ("month")
631 ("isbn") ("pagetotal") ("addendum") ("pubstate")
632 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
633 ("InProceedings" "Article in Conference Proceedings"
634 (("author") ("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
635 (("booktitle"))
636 (("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
637 ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
638 ("eventtitle") ("eventdate") ("venue") ("language")
639 ("volume") ("part") ("volumes") ("series") ("number") ("note")
640 ("organization") ("publisher") ("location") ("month") ("isbn")
641 ("chapter") ("pages") ("addendum") ("pubstate")
642 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
643 ("Reference" "Single-Volume Work of Reference" ; same as @collection
644 (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
645 nil
646 (("editora") ("editorb") ("editorc") ("translator") ("annotator")
647 ("commentator") ("introduction") ("foreword") ("afterword")
648 ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
649 ("maintitleaddon") ("language") ("origlanguage") ("volume")
650 ("part") ("edition") ("volumes") ("series") ("number") ("note")
651 ("publisher") ("location") ("isbn") ("chapter") ("pages") ("pagetotal")
652 ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass")
653 ("eprinttype") ("url") ("urldate")))
654 ("MVReference" "Multi-Volume Work of Reference" ; same as @mvcollection
655 (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
656 nil
657 (("editora") ("editorb") ("editorc") ("translator") ("annotator")
658 ("commentator") ("introduction") ("foreword") ("afterword")
659 ("subtitle") ("titleaddon") ("language") ("origlanguage") ("edition")
660 ("volumes") ("series") ("number") ("note") ("publisher")
661 ("location") ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi")
662 ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
663 ("InReference" "Article in a Work of Reference" ; same as @incollection
664 (("author") ("editor") ("title") ("year" nil nil 0) ("date" nil nil 0))
665 (("booktitle"))
666 (("editora") ("editorb") ("editorc") ("translator") ("annotator")
667 ("commentator") ("introduction") ("foreword") ("afterword")
668 ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle")
669 ("maintitleaddon") ("booksubtitle") ("booktitleaddon")
670 ("language") ("origlanguage") ("volume") ("part") ("edition")
671 ("volumes") ("series") ("number") ("note") ("publisher") ("location")
672 ("isbn") ("chapter") ("pages") ("addendum") ("pubstate") ("doi")
673 ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
674 ("Report" "Technical or Research Report"
675 (("author") ("title") ("type") ("institution")
676 ("year" nil nil 0) ("date" nil nil 0))
677 nil
678 (("subtitle") ("titleaddon") ("language") ("number") ("version") ("note")
679 ("location") ("month") ("isrn") ("chapter") ("pages") ("pagetotal")
680 ("addendum") ("pubstate")
681 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
682 ("Thesis" "PhD. or Master's Thesis"
683 (("author") ("title") ("type") ("institution")
684 ("year" nil nil 0) ("date" nil nil 0))
685 nil
686 (("subtitle") ("titleaddon") ("language") ("note") ("location")
687 ("month") ("isbn") ("chapter") ("pages") ("pagetotal")
688 ("addendum") ("pubstate")
689 ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))
690 ("Unpublished" "Unpublished"
691 (("author") ("title") ("year" nil nil 0) ("date" nil nil 0))
692 nil
693 (("subtitle") ("titleaddon") ("language") ("howpublished")
694 ("note") ("location") ("isbn") ("date") ("month") ("year")
695 ("addendum") ("pubstate") ("url") ("urldate"))))
696 "Alist of biblatex entry types and their associated fields.
697It has the same format as `bibtex-BibTeX-entry-alist'."
496 :group 'bibtex 698 :group 'bibtex
497 :type '(repeat (group (string :tag "Entry type") 699 :type 'bibtex-entry-alist)
498 (group (repeat :tag "Required fields" 700(put 'bibtex-biblatex-entry-alist 'risky-local-variable t)
499 (group (string :tag "Field") 701
500 (string :tag "Comment") 702(define-widget 'bibtex-field-alist 'lazy
501 (option (choice :tag "Init" :value nil 703 "Format of `bibtex-BibTeX-entry-alist' and friends."
502 (const nil) string function)) 704 :type '(repeat (group (string :tag "Field type")
503 (option (choice :tag "Alternative" 705 (string :tag "Comment"))))
504 (const :tag "No" nil) 706
505 (const :tag "Yes" t))))) 707(defcustom bibtex-BibTeX-field-alist
506 (repeat :tag "Optional fields" 708 '(("author" "Author1 [and Author2 ...] [and others]")
507 (group (string :tag "Field") 709 ("editor" "Editor1 [and Editor2 ...] [and others]")
508 (string :tag "Comment") 710 ("journal" "Name of the journal (use string, remove braces)")
509 (option (choice :tag "Init" :value nil 711 ("year" "Year of publication")
510 (const nil) string function))))) 712 ("month" "Month of the publication as a string (remove braces)")
511 (option :extra-offset -4 713 ("note" "Remarks to be put at the end of the \\bibitem")
512 (group (repeat :tag "Crossref: required fields" 714 ("publisher" "Publishing company")
513 (group (string :tag "Field") 715 ("address" "Address of the publisher"))
514 (string :tag "Comment") 716 "Alist of BibTeX fields.
515 (option (choice :tag "Init" :value nil 717Each element is a list (FIELD COMMENT). COMMENT is used as a default
516 (const nil) string function)) 718if `bibtex-BibTeX-entry-alist' does not define a comment for FIELD."
517 (option (choice :tag "Alternative" 719 :group 'bibtex
518 (const :tag "No" nil) 720 :type 'bibtex-field-alist)
519 (const :tag "Yes" t))))) 721
520 (repeat :tag "Crossref: optional fields" 722(defcustom bibtex-biblatex-field-alist
521 (group (string :tag "Field") 723 ;; See 2.2.2 Data Fields
522 (string :tag "Comment") 724 '(("abstract" "Abstract of the work")
523 (option (choice :tag "Init" :value nil 725 ("addendum" "Miscellaneous bibliographic data")
524 (const nil) string function))))))))) 726 ("afterword" "Author(s) of an afterword to the work")
525(put 'bibtex-entry-field-alist 'risky-local-variable t) 727 ("annotation" "Annotation")
728 ("annotator" "Author(s) of annotations to the work")
729 ("author" "Author(s) of the title")
730 ("bookauthor" "Author(s) of the booktitle.")
731 ("bookpagination" "Pagination scheme of the enclosing work")
732 ("booksubtitle" "Subtitle related to the booktitle")
733 ("booktitle" "Title of the book")
734 ("booktitleaddon" "Annex to the booktitle")
735 ("chapter" "Chapter, section, or any other unit of a work")
736 ("commentator" "Author(s) of a commentary to the work")
737 ("date" "Publication date")
738 ("doi" "Digital Object Identifier")
739 ("edition" "Edition of a printed publication")
740 ("editor" "Editor(s) of the title, booktitle, or maintitle")
741 ("editora" "Secondary editor")
742 ("editorb" "Secondary editor")
743 ("editorc" "Secondary editor")
744 ("editortype" "Type of editorial role performed by the editor")
745 ("editoratype" "Type of editorial role performed by editora")
746 ("editorbtype" "Type of editorial role performed by editorb")
747 ("editorctype" "Type of editorial role performed by editorc")
748 ("eid" "Electronic identifier of an article")
749 ("eprint" "Electronic identifier of an online publication")
750 ("eprintclass" "Additional information related to the eprinttype")
751 ("eprinttype" "Type of eprint identifier")
752 ("eventdate" "Date of a conference or some other event")
753 ("eventtitle" "Title of a conference or some other event")
754 ("file" "Local link to an electronic version of the work")
755 ("foreword" "Author(s) of a foreword to the work")
756 ("holder" "Holder(s) of a patent")
757 ("howpublished" "Publication notice for unusual publications")
758 ("indextitle" "Title to use for indexing instead of the regular title")
759 ("institution" "Name of a university or some other institution")
760 ("introduction" "Author(s) of an introduction to the work")
761 ("isan" "International Standard Audiovisual Number of an audiovisual work")
762 ("isbn" "International Standard Book Number of a book.")
763 ("ismn" "International Standard Music Number for printed music")
764 ("isrn" "International Standard Technical Report Number")
765 ("issn" "International Standard Serial Number of a periodical.")
766 ("issue" "Issue of a journal")
767 ("issuesubtitle" "Subtitle of a specific issue of a journal or other periodical.")
768 ("issuetitle" "Title of a specific issue of a journal or other periodical.")
769 ("iswc" "International Standard Work Code of a musical work")
770 ("journalsubtitle" "Subtitle of a journal, a newspaper, or some other periodical.")
771 ("journaltitle" "Name of a journal, a newspaper, or some other periodical.")
772 ("label" "Substitute for the regular label to be used by the citation style")
773 ("language" "Language(s) of the work")
774 ("library" "Library name and a call number")
775 ("location" "Place(s) of publication")
776 ("mainsubtitle" "Subtitle related to the maintitle")
777 ("maintitle" "Main title of a multi-volume book, such as Collected Works")
778 ("maintitleaddon" "Annex to the maintitle")
779 ("month" "Publication month")
780 ("nameaddon" "Addon to be printed immediately after the author name")
781 ("note" "Miscellaneous bibliographic data")
782 ("number" "Number of a journal or the volume/number of a book in a series")
783 ("organization" "Organization(s) that published a work")
784 ("origdate" "Publication date of the original edition")
785 ("origlanguage" "Original publication language of a translated edition")
786 ("origlocation" "Location of the original edition")
787 ("origpublisher" "Publisher of the original edition")
788 ("origtitle" "Title of the original work")
789 ("pages" "Page number(s) or page range(s)")
790 ("pagetotal" "Total number of pages of the work.")
791 ("pagination" "Pagination of the work")
792 ("part" "Number of a partial volume")
793 ("publisher" "Name(s) of the publisher(s)")
794 ("pubstate" "Publication state of the work, e. g.,'in press'")
795 ("reprinttitle" "Title of a reprint of the work")
796 ("series" "Name of a publication series")
797 ("shortauthor" "Author(s) of the work, given in an abbreviated form")
798 ("shorteditor" "Editor(s) of the work, given in an abbreviated form")
799 ("shortjournal" "Short version or an acronym of the journal title")
800 ("shortseries" "Short version or an acronym of the series field")
801 ("shorttitle" "Title in an abridged form")
802 ("subtitle" "Subtitle of the work")
803 ("title" "Title of the work")
804 ("titleaddon" "Annex to the title")
805 ("translator" "Translator(s) of the work")
806 ("type" "Type of a manual, patent, report, or thesis")
807 ("url" " URL of an online publication.")
808 ("urldate" "Access date of the address specified in the url field")
809 ("venue" "Location of a conference, a symposium, or some other event")
810 ("version" "Revision number of a piece of software, a manual, etc.")
811 ("volume" "Volume of a multi-volume book or a periodical")
812 ("volumes" "Total number of volumes of a multi-volume work")
813 ("year" "Year of publication"))
814 "Alist of biblatex fields.
815It has the same format as `bibtex-BibTeX-entry-alist'."
816 :group 'bibtex
817 :type 'bibtex-field-alist)
818
819(defcustom bibtex-dialect-list '(BibTeX biblatex)
820 "List of BibTeX dialects known to BibTeX mode.
821For each DIALECT (a symbol) a variable bibtex-DIALECT-entry-alist defines
822the allowed entries and bibtex-DIALECT-field-alist defines known field types.
823Predefined dialects include BibTeX and biblatex."
824 :group 'bibtex
825 :type '(repeat (symbol :tag "Dialect")))
826
827(defcustom bibtex-dialect 'BibTeX
828 "Current BibTeX dialect. For allowed values see `bibtex-dialect-list'.
829During a session change it via `bibtex-set-dialect'."
830 :group 'bibtex
831 :set '(lambda (symbol value)
832 (set-default symbol value)
833 ;; `bibtex-set-dialect' is undefined during loading (no problem)
834 (if (fboundp 'bibtex-set-dialect)
835 (bibtex-set-dialect value)))
836 :type '(choice (const BibTeX)
837 (const biblatex)
838 (symbol :tag "Custom")))
839
840(defcustom bibtex-no-opt-remove-re "\\`option"
841 "If a field name matches this regexp, the prefix OPT is not removed.
842If nil prefix OPT is always removed"
843 :group 'bibtex
844 :type '(choice (regexp) (const nil)))
526 845
527(defcustom bibtex-comment-start "@Comment" 846(defcustom bibtex-comment-start "@Comment"
528 "String starting a BibTeX comment." 847 "String starting a BibTeX comment."
@@ -1120,29 +1439,15 @@ Set this variable before loading BibTeX mode."
1120 ["(Re)Initialize BibTeX Buffers" bibtex-initialize t] 1439 ["(Re)Initialize BibTeX Buffers" bibtex-initialize t]
1121 ["Validate Entries" bibtex-validate-globally t]))) 1440 ["Validate Entries" bibtex-validate-globally t])))
1122 1441
1123(easy-menu-define
1124 bibtex-entry-menu bibtex-mode-map "Entry-Types Menu in BibTeX mode"
1125 (list "Entry-Types"
1126 ["Article in Journal" bibtex-Article t]
1127 ["Article in Conference Proceedings" bibtex-InProceedings t]
1128 ["Article in a Collection" bibtex-InCollection t]
1129 ["Chapter or Pages in a Book" bibtex-InBook t]
1130 ["Conference Proceedings" bibtex-Proceedings t]
1131 ["Book" bibtex-Book t]
1132 ["Booklet (Bound, but no Publisher/Institution)" bibtex-Booklet t]
1133 ["PhD. Thesis" bibtex-PhdThesis t]
1134 ["Master's Thesis" bibtex-MastersThesis t]
1135 ["Technical Report" bibtex-TechReport t]
1136 ["Technical Manual" bibtex-Manual t]
1137 ["Unpublished" bibtex-Unpublished t]
1138 ["Miscellaneous" bibtex-Misc t]
1139 "--"
1140 ["String" bibtex-String t]
1141 ["Preamble" bibtex-Preamble t]))
1142
1143 1442
1144;; Internal Variables 1443;; Internal Variables
1145 1444
1445(defvar bibtex-entry-alist bibtex-BibTeX-entry-alist
1446 "Alist of currently active entry types.")
1447
1448(defvar bibtex-field-alist bibtex-BibTeX-field-alist
1449 "Alist of currently active field types.")
1450
1146(defvar bibtex-field-braces-opt nil 1451(defvar bibtex-field-braces-opt nil
1147 "Optimized value of `bibtex-field-braces-alist'. 1452 "Optimized value of `bibtex-field-braces-alist'.
1148Created by `bibtex-field-re-init'. 1453Created by `bibtex-field-re-init'.
@@ -1237,33 +1542,26 @@ The CDRs of the elements are t for header keys and nil for crossref keys.")
1237(defconst bibtex-field-const "[][[:alnum:].:;?!`'/*@+=|<>&_^$-]+" 1542(defconst bibtex-field-const "[][[:alnum:].:;?!`'/*@+=|<>&_^$-]+"
1238 "Regexp matching a BibTeX field constant.") 1543 "Regexp matching a BibTeX field constant.")
1239 1544
1240(defvar bibtex-entry-type 1545(defvar bibtex-entry-type nil
1241 (concat "@[ \t]*\\(?:" 1546 "Regexp matching the type of a BibTeX entry.
1242 (regexp-opt (mapcar 'car bibtex-entry-field-alist)) "\\)") 1547Initialized by `bibtex-set-dialect'.")
1243 "Regexp matching the type of a BibTeX entry.")
1244 1548
1245(defvar bibtex-entry-head 1549(defvar bibtex-entry-head nil
1246 (concat "^[ \t]*\\(" 1550 "Regexp matching the header line of a BibTeX entry (including key).
1247 bibtex-entry-type 1551Initialized by `bibtex-set-dialect'.")
1248 "\\)[ \t]*[({][ \t\n]*\\("
1249 bibtex-reference-key
1250 "\\)")
1251 "Regexp matching the header line of a BibTeX entry (including key).")
1252 1552
1253(defvar bibtex-entry-maybe-empty-head 1553(defvar bibtex-entry-maybe-empty-head nil
1254 (concat bibtex-entry-head "?") 1554 "Regexp matching the header line of a BibTeX entry (possibly without key).
1255 "Regexp matching the header line of a BibTeX entry (possibly without key).") 1555Initialized by `bibtex-set-dialect'.")
1256 1556
1257(defconst bibtex-any-entry-maybe-empty-head 1557(defconst bibtex-any-entry-maybe-empty-head
1258 (concat "^[ \t]*\\(@[ \t]*" bibtex-field-name "\\)[ \t]*[({][ \t\n]*\\(" 1558 (concat "^[ \t]*\\(@[ \t]*" bibtex-field-name "\\)[ \t]*[({][ \t\n]*\\("
1259 bibtex-reference-key "\\)?") 1559 bibtex-reference-key "\\)?")
1260 "Regexp matching the header line of any BibTeX entry (possibly without key).") 1560 "Regexp matching the header line of any BibTeX entry (possibly without key).")
1261 1561
1262(defvar bibtex-any-valid-entry-type 1562(defvar bibtex-any-valid-entry-type nil
1263 (concat "^[ \t]*@[ \t]*\\(?:" 1563 "Regexp matching any valid BibTeX entry (including String and Preamble).
1264 (regexp-opt (append '("String" "Preamble") 1564Initialized by `bibtex-set-dialect'.")
1265 (mapcar 'car bibtex-entry-field-alist))) "\\)")
1266 "Regexp matching any valid BibTeX entry (including String and Preamble).")
1267 1565
1268(defconst bibtex-type-in-head 1 1566(defconst bibtex-type-in-head 1
1269 "Regexp subexpression number of the type part in `bibtex-entry-head'.") 1567 "Regexp subexpression number of the type part in `bibtex-entry-head'.")
@@ -1520,7 +1818,9 @@ If optional arg REMOVE-OPT-ALT is non-nil remove \"OPT\" and \"ALT\"."
1520 (bibtex-start-of-name-in-field bounds) 1818 (bibtex-start-of-name-in-field bounds)
1521 (bibtex-end-of-name-in-field bounds)))) 1819 (bibtex-end-of-name-in-field bounds))))
1522 (if (and remove-opt-alt 1820 (if (and remove-opt-alt
1523 (string-match "\\`\\(OPT\\|ALT\\)" name)) 1821 (string-match "\\`\\(OPT\\|ALT\\)" name)
1822 (not (and bibtex-no-opt-remove-re
1823 (string-match bibtex-no-opt-remove-re name))))
1524 (substring name 3) 1824 (substring name 3)
1525 name))) 1825 name)))
1526 1826
@@ -1686,7 +1986,7 @@ Point must be at beginning of preamble. Do not move point."
1686(defun bibtex-valid-entry (&optional empty-key) 1986(defun bibtex-valid-entry (&optional empty-key)
1687 "Parse a valid BibTeX entry (maybe without key if EMPTY-KEY is t). 1987 "Parse a valid BibTeX entry (maybe without key if EMPTY-KEY is t).
1688A valid entry is a syntactical correct one with type contained in 1988A valid entry is a syntactical correct one with type contained in
1689`bibtex-entry-field-alist'. Ignore @String and @Preamble entries. 1989`bibtex-BibTeX-entry-alist'. Ignore @String and @Preamble entries.
1690Return a cons pair with buffer positions of beginning and end of entry 1990Return a cons pair with buffer positions of beginning and end of entry
1691if a valid entry is found, nil otherwise. Do not move point. 1991if a valid entry is found, nil otherwise. Do not move point.
1692After a call to this function `match-data' corresponds to the header 1992After a call to this function `match-data' corresponds to the header
@@ -1717,7 +2017,7 @@ of the entry, see regexp `bibtex-entry-head'."
1717Do not move if we are already at beginning of a valid BibTeX entry. 2017Do not move if we are already at beginning of a valid BibTeX entry.
1718With optional argument BACKWARD non-nil, move backward to 2018With optional argument BACKWARD non-nil, move backward to
1719beginning of previous valid one. A valid entry is a syntactical correct one 2019beginning of previous valid one. A valid entry is a syntactical correct one
1720with type contained in `bibtex-entry-field-alist' or, if 2020with type contained in `bibtex-BibTeX-entry-alist' or, if
1721`bibtex-sort-ignore-string-entries' is nil, a syntactical correct string 2021`bibtex-sort-ignore-string-entries' is nil, a syntactical correct string
1722entry. Return buffer position of beginning and end of entry if a valid 2022entry. Return buffer position of beginning and end of entry if a valid
1723entry is found, nil otherwise." 2023entry is found, nil otherwise."
@@ -1911,6 +2211,14 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
1911 (let ((key (bibtex-key-in-head))) 2211 (let ((key (bibtex-key-in-head)))
1912 (if key (push (cons key t) bibtex-reference-keys)))))))) 2212 (if key (push (cons key t) bibtex-reference-keys))))))))
1913 2213
2214(defsubst bibtex-vec-push (vec idx newelt)
2215 "Add NEWELT to the list stored in VEC at index IDX."
2216 (aset vec idx (cons newelt (aref vec idx))))
2217
2218(defsubst bibtex-vec-incr (vec idx)
2219 "Add NEWELT to the list stored in VEC at index IDX."
2220 (aset vec idx (1+ (aref vec idx))))
2221
1914(defun bibtex-format-entry () 2222(defun bibtex-format-entry ()
1915 "Helper function for `bibtex-clean-entry'. 2223 "Helper function for `bibtex-clean-entry'.
1916Formats current entry according to variable `bibtex-entry-format'." 2224Formats current entry according to variable `bibtex-entry-format'."
@@ -1932,7 +2240,7 @@ Formats current entry according to variable `bibtex-entry-format'."
1932 bibtex-entry-format)) 2240 bibtex-entry-format))
1933 (left-delim-re (regexp-quote (bibtex-field-left-delimiter))) 2241 (left-delim-re (regexp-quote (bibtex-field-left-delimiter)))
1934 bounds crossref-key req-field-list default-field-list field-list 2242 bounds crossref-key req-field-list default-field-list field-list
1935 alt-fields error-field-name) 2243 num-alt alt-fields idx error-field-name)
1936 (unwind-protect 2244 (unwind-protect
1937 ;; formatting (undone if error occurs) 2245 ;; formatting (undone if error occurs)
1938 (atomic-change-group 2246 (atomic-change-group
@@ -1954,7 +2262,7 @@ Formats current entry according to variable `bibtex-entry-format'."
1954 (end-type (match-end 0)) 2262 (end-type (match-end 0))
1955 (entry-list (assoc-string (buffer-substring-no-properties 2263 (entry-list (assoc-string (buffer-substring-no-properties
1956 beg-type end-type) 2264 beg-type end-type)
1957 bibtex-entry-field-alist t))) 2265 bibtex-entry-alist t)))
1958 2266
1959 ;; unify case of entry type 2267 ;; unify case of entry type
1960 (when (memq 'unify-case format) 2268 (when (memq 'unify-case format)
@@ -1978,13 +2286,18 @@ Formats current entry according to variable `bibtex-entry-format'."
1978 2286
1979 ;; list of required fields appropriate for an entry with 2287 ;; list of required fields appropriate for an entry with
1980 ;; or without crossref key. 2288 ;; or without crossref key.
1981 (setq req-field-list (if (and crossref-key (nth 2 entry-list)) 2289 (setq req-field-list (if crossref-key (nth 2 entry-list)
1982 (car (nth 2 entry-list)) 2290 (append (nth 2 entry-list) (nth 3 entry-list)))
1983 (car (nth 1 entry-list)))
1984 ;; default list of fields that may appear in this entry 2291 ;; default list of fields that may appear in this entry
1985 default-field-list (append (nth 0 (nth 1 entry-list)) 2292 default-field-list (append (nth 2 entry-list) (nth 3 entry-list)
1986 (nth 1 (nth 1 entry-list)) 2293 (nth 4 entry-list)
1987 bibtex-user-optional-fields)) 2294 bibtex-user-optional-fields)
2295 ;; number of ALT fields we expect to find
2296 num-alt (length (delq nil (delete-dups
2297 (mapcar (lambda (x) (nth 3 x))
2298 req-field-list))))
2299 ;; ALT fields of respective groups
2300 alt-fields (make-vector num-alt nil))
1988 2301
1989 (when (memq 'sort-fields format) 2302 (when (memq 'sort-fields format)
1990 (goto-char (point-min)) 2303 (goto-char (point-min))
@@ -1995,10 +2308,10 @@ Formats current entry according to variable `bibtex-entry-format'."
1995 (dolist (field default-field-list) 2308 (dolist (field default-field-list)
1996 (when (setq elt (assoc-string (car field) fields-alist t)) 2309 (when (setq elt (assoc-string (car field) fields-alist t))
1997 (setq fields-alist (delete elt fields-alist)) 2310 (setq fields-alist (delete elt fields-alist))
1998 (bibtex-make-field (list (car elt) "" (cdr elt)) nil nil t))) 2311 (bibtex-make-field (list (car elt) nil (cdr elt)) nil nil t)))
1999 (dolist (field fields-alist) 2312 (dolist (field fields-alist)
2000 (unless (member (car field) '("=key=" "=type=")) 2313 (unless (member (car field) '("=key=" "=type="))
2001 (bibtex-make-field (list (car field) "" (cdr field)) nil nil t)))))) 2314 (bibtex-make-field (list (car field) nil (cdr field)) nil nil t))))))
2002 2315
2003 ;; process all fields 2316 ;; process all fields
2004 (bibtex-beginning-first-field (point-min)) 2317 (bibtex-beginning-first-field (point-min))
@@ -2009,17 +2322,18 @@ Formats current entry according to variable `bibtex-entry-format'."
2009 (end-name (copy-marker (bibtex-end-of-name-in-field bounds))) 2322 (end-name (copy-marker (bibtex-end-of-name-in-field bounds)))
2010 (beg-text (copy-marker (bibtex-start-of-text-in-field bounds))) 2323 (beg-text (copy-marker (bibtex-start-of-text-in-field bounds)))
2011 (end-text (copy-marker (bibtex-end-of-text-in-field bounds) t)) 2324 (end-text (copy-marker (bibtex-end-of-text-in-field bounds) t))
2012 (opt-alt (string-match "OPT\\|ALT"
2013 (buffer-substring-no-properties
2014 beg-name (+ beg-name 3))))
2015 (field-name (buffer-substring-no-properties
2016 (if opt-alt (+ beg-name 3) beg-name) end-name))
2017 (empty-field (equal "" (bibtex-text-in-field-bounds bounds t))) 2325 (empty-field (equal "" (bibtex-text-in-field-bounds bounds t)))
2326 (field-name (buffer-substring-no-properties beg-name end-name))
2327 (opt-alt (and (string-match "\\`\\(OPT\\|ALT\\)" field-name)
2328 (not (and bibtex-no-opt-remove-re
2329 (string-match bibtex-no-opt-remove-re
2330 field-name)))))
2018 deleted) 2331 deleted)
2332 (if opt-alt (setq field-name (substring field-name 3)))
2019 2333
2020 ;; keep track of alternatives 2334 ;; keep track of alternatives
2021 (if (nth 3 (assoc-string field-name req-field-list t)) 2335 (if (setq idx (nth 3 (assoc-string field-name req-field-list t)))
2022 (push field-name alt-fields)) 2336 (bibtex-vec-push alt-fields idx field-name))
2023 2337
2024 (if (memq 'opts-or-alts format) 2338 (if (memq 'opts-or-alts format)
2025 ;; delete empty optional and alternative fields 2339 ;; delete empty optional and alternative fields
@@ -2170,12 +2484,14 @@ Formats current entry according to variable `bibtex-entry-format'."
2170 2484
2171 ;; check whether all required fields are present 2485 ;; check whether all required fields are present
2172 (if (memq 'required-fields format) 2486 (if (memq 'required-fields format)
2173 (let ((found 0) alt-list) 2487 (let ((alt-expect (make-vector num-alt nil))
2488 (alt-found (make-vector num-alt 0)))
2174 (dolist (fname req-field-list) 2489 (dolist (fname req-field-list)
2175 (cond ((nth 3 fname) ; t if field has alternative flag 2490 (cond ((setq idx (nth 3 fname))
2176 (push (car fname) alt-list) 2491 ;; t if field has alternative flag
2492 (bibtex-vec-push alt-expect idx (car fname))
2177 (if (member-ignore-case (car fname) field-list) 2493 (if (member-ignore-case (car fname) field-list)
2178 (setq found (1+ found)))) 2494 (bibtex-vec-incr alt-found idx)))
2179 ((not (member-ignore-case (car fname) field-list)) 2495 ((not (member-ignore-case (car fname) field-list))
2180 ;; If we use the crossref field, a required field 2496 ;; If we use the crossref field, a required field
2181 ;; can have the OPT prefix. So if it was empty, 2497 ;; can have the OPT prefix. So if it was empty,
@@ -2183,17 +2499,16 @@ Formats current entry according to variable `bibtex-entry-format'."
2183 ;; move point on this empty field. 2499 ;; move point on this empty field.
2184 (setq error-field-name (car fname)) 2500 (setq error-field-name (car fname))
2185 (error "Mandatory field `%s' is missing" (car fname))))) 2501 (error "Mandatory field `%s' is missing" (car fname)))))
2186 (if alt-list 2502 (dotimes (idx num-alt)
2187 (cond ((= found 0) 2503 (cond ((= 0 (aref alt-found idx))
2188 (if alt-fields 2504 (setq error-field-name (car (last (aref alt-fields idx))))
2189 (setq error-field-name (car (last alt-fields)))) 2505 (error "Alternative mandatory field `%s' is missing"
2190 (error "Alternative mandatory field `%s' is missing" 2506 (aref alt-expect idx)))
2191 alt-list)) 2507 ((< 1 (aref alt-found idx))
2192 ((> found 1) 2508 (setq error-field-name (car (last (aref alt-fields idx))))
2193 (if alt-fields 2509 (error "Alternative fields `%s' are defined %s times"
2194 (setq error-field-name (car (last alt-fields)))) 2510 (aref alt-expect idx)
2195 (error "Alternative fields `%s' are defined %s times" 2511 (length (aref alt-fields idx))))))))
2196 alt-list found))))))
2197 2512
2198 ;; update comma after last field 2513 ;; update comma after last field
2199 (if (memq 'last-comma format) 2514 (if (memq 'last-comma format)
@@ -2547,7 +2862,7 @@ for parsing BibTeX keys. If parsing fails, try to set this variable to nil."
2547 (push (list key) crossref-keys)))) 2862 (push (list key) crossref-keys))))
2548 ;; only keys of known entries 2863 ;; only keys of known entries
2549 ((assoc-string (bibtex-type-in-head) 2864 ((assoc-string (bibtex-type-in-head)
2550 bibtex-entry-field-alist t) 2865 bibtex-entry-alist t)
2551 ;; This is an entry. 2866 ;; This is an entry.
2552 (let ((key (bibtex-key-in-head))) 2867 (let ((key (bibtex-key-in-head)))
2553 (unless (assoc key ref-keys) 2868 (unless (assoc key ref-keys)
@@ -2745,7 +3060,7 @@ When called interactively, FORCE is t, CURRENT is t if current buffer uses
2745 ;; select BibTeX buffer 3060 ;; select BibTeX buffer
2746 (if select 3061 (if select
2747 (if buffer-list 3062 (if buffer-list
2748 (switch-to-buffer 3063 (pop-to-buffer-same-window
2749 (completing-read "Switch to BibTeX buffer: " 3064 (completing-read "Switch to BibTeX buffer: "
2750 (mapcar 'buffer-name buffer-list) 3065 (mapcar 'buffer-name buffer-list)
2751 nil t 3066 nil t
@@ -3056,25 +3371,122 @@ if that value is non-nil.
3056 bibtex-font-lock-syntactic-keywords)) 3371 bibtex-font-lock-syntactic-keywords))
3057 (setq imenu-generic-expression 3372 (setq imenu-generic-expression
3058 (list (list nil bibtex-entry-head bibtex-key-in-head)) 3373 (list (list nil bibtex-entry-head bibtex-key-in-head))
3059 imenu-case-fold-search t)) 3374 imenu-case-fold-search t)
3375 (bibtex-set-dialect bibtex-dialect))
3376
3377(defun bibtex-set-dialect (dialect)
3378 "Select BibTeX mode DIALECT.
3379This sets the variable `bibtex-dialect' which holds the currently active
3380dialect. Dialects are listed in `bibtex-dialect-list'."
3381 (interactive (list (intern (completing-read "Dialect: "
3382 (mapcar 'list bibtex-dialect-list)
3383 nil t))))
3384 (unless (eq dialect (get 'bibtex-dialect 'dialect))
3385 (put 'bibtex-dialect 'dialect dialect)
3386 (setq bibtex-dialect dialect)
3387
3388 ;; Bind variables
3389 (setq bibtex-entry-alist
3390 (let ((var (intern (format "bibtex-%s-entry-alist" dialect)))
3391 entry-alist)
3392 (if (boundp var)
3393 (setq entry-alist (symbol-value var))
3394 (error "BibTeX dialect `%s' undefined" dialect))
3395 (if (not (consp (nth 1 (car entry-alist))))
3396 ;; new format
3397 entry-alist
3398 ;; Convert old format
3399 (unless (get var 'entry-list-format)
3400 (put var 'entry-list-format "pre-24")
3401 (message "Old format of `%s' (pre GNU Emacs 24).
3402Please convert to the new format."
3403 (if (eq (indirect-variable 'bibtex-entry-field-alist) var)
3404 'bibtex-entry-field-alist var))
3405 (sit-for 3))
3406 (let (lst)
3407 (dolist (entry entry-alist)
3408 (let ((fl (nth 1 entry)) req xref opt)
3409 (dolist (field (copy-tree (car fl)))
3410 (if (nth 3 field) (setcar (nthcdr 3 field) 0))
3411 (if (or (not (nth 2 entry))
3412 (assoc-string (car field) (car (nth 2 entry)) t))
3413 (push field req)
3414 (push field xref)))
3415 (dolist (field (nth 1 fl))
3416 (push field opt))
3417 (push (list (car entry) nil (nreverse req)
3418 (nreverse xref) (nreverse opt))
3419 lst)))
3420 (nreverse lst))))
3421 bibtex-field-alist
3422 (let ((var (intern (format "bibtex-%s-field-alist" dialect))))
3423 (if (boundp var)
3424 (symbol-value var)
3425 (error "Field types for BibTeX dialect `%s' undefined" dialect)))
3426 bibtex-entry-type
3427 (concat "@[ \t]*\\(?:"
3428 (regexp-opt (mapcar 'car bibtex-entry-alist)) "\\)")
3429 bibtex-entry-head (concat "^[ \t]*\\("
3430 bibtex-entry-type
3431 "\\)[ \t]*[({][ \t\n]*\\("
3432 bibtex-reference-key
3433 "\\)")
3434 bibtex-entry-maybe-empty-head (concat bibtex-entry-head "?")
3435 bibtex-any-valid-entry-type
3436 (concat "^[ \t]*@[ \t]*\\(?:"
3437 (regexp-opt (append '("String" "Preamble")
3438 (mapcar 'car bibtex-entry-alist))) "\\)"))
3439 ;; Define entry commands
3440 (dolist (elt bibtex-entry-alist)
3441 (let* ((entry (car elt))
3442 (fname (intern (concat "bibtex-" entry))))
3443 (unless (fboundp fname)
3444 (eval (list 'defun fname nil
3445 (format "Insert a new BibTeX @%s entry; see also `bibtex-entry'."
3446 entry)
3447 '(interactive "*")
3448 `(bibtex-entry ,entry))))))
3449 ;; Define menu
3450 ;; We use the same keymap for all BibTeX buffers. So all these buffers
3451 ;; have the same BibTeX dialect. To define entry types buffer-locally,
3452 ;; it would be necessary to give each BibTeX buffer a new keymap that
3453 ;; becomes a child of `bibtex-mode-map'. Useful??
3454 (easy-menu-define
3455 nil bibtex-mode-map "Entry-Types Menu in BibTeX mode"
3456 (apply 'list "Entry-Types"
3457 (append
3458 (mapcar (lambda (entry)
3459 (vector (or (nth 1 entry) (car entry))
3460 (intern (format "bibtex-%s" (car entry))) t))
3461 bibtex-entry-alist)
3462 `("---"
3463 ["String" bibtex-String t]
3464 ["Preamble" bibtex-Preamble t]
3465 "---"
3466 ,(append '("BibTeX dialect")
3467 (mapcar (lambda (dialect)
3468 (vector (symbol-name dialect)
3469 `(lambda () (interactive)
3470 (bibtex-set-dialect ',dialect))
3471 t))
3472 bibtex-dialect-list))))))))
3060 3473
3061(defun bibtex-field-list (entry-type) 3474(defun bibtex-field-list (entry-type)
3062 "Return list of allowed fields for entry ENTRY-TYPE. 3475 "Return list of allowed fields for entry ENTRY-TYPE.
3063More specifically, the return value is a cons pair (REQUIRED . OPTIONAL), 3476More specifically, the return value is a cons pair (REQUIRED . OPTIONAL),
3064where REQUIRED and OPTIONAL are lists of the required and optional field 3477where REQUIRED and OPTIONAL are lists of the required and optional field
3065names for ENTRY-TYPE according to `bibtex-entry-field-alist', 3478names for ENTRY-TYPE according to `bibtex-BibTeX-entry-alist' and friends,
3066`bibtex-include-OPTkey', `bibtex-include-OPTcrossref', 3479`bibtex-include-OPTkey', `bibtex-include-OPTcrossref',
3067and `bibtex-user-optional-fields'." 3480and `bibtex-user-optional-fields'."
3068 (let ((e (assoc-string entry-type bibtex-entry-field-alist t)) 3481 (let ((e-list (assoc-string entry-type bibtex-entry-alist t))
3069 required optional) 3482 required optional)
3070 (unless e 3483 (unless e-list
3071 (error "Fields for BibTeX entry type %s not defined" entry-type)) 3484 (error "Fields for BibTeX entry type %s not defined" entry-type))
3072 (if (and (member-ignore-case entry-type bibtex-include-OPTcrossref) 3485 (if (member-ignore-case entry-type bibtex-include-OPTcrossref)
3073 (nth 2 e)) 3486 (setq required (nth 2 e-list)
3074 (setq required (nth 0 (nth 2 e)) 3487 optional (append (nth 3 e-list) (nth 4 e-list)))
3075 optional (nth 1 (nth 2 e))) 3488 (setq required (append (nth 2 e-list) (nth 3 e-list))
3076 (setq required (nth 0 (nth 1 e)) 3489 optional (nth 4 e-list)))
3077 optional (nth 1 (nth 1 e))))
3078 (if bibtex-include-OPTkey 3490 (if bibtex-include-OPTkey
3079 (push (list "key" 3491 (push (list "key"
3080 "Used for reference key creation if author and editor fields are missing" 3492 "Used for reference key creation if author and editor fields are missing"
@@ -3094,7 +3506,7 @@ After insertion call the value of `bibtex-add-entry-hook' if that value
3094is non-nil." 3506is non-nil."
3095 (interactive 3507 (interactive
3096 (let ((completion-ignore-case t)) 3508 (let ((completion-ignore-case t))
3097 (list (completing-read "Entry Type: " bibtex-entry-field-alist 3509 (list (completing-read "Entry Type: " bibtex-entry-alist
3098 nil t nil 'bibtex-entry-type-history)))) 3510 nil t nil 'bibtex-entry-type-history))))
3099 (let ((key (if bibtex-maintain-sorted-entries 3511 (let ((key (if bibtex-maintain-sorted-entries
3100 (bibtex-read-key (format "%s key: " entry-type)))) 3512 (bibtex-read-key (format "%s key: " entry-type))))
@@ -3127,7 +3539,7 @@ When called interactively with a prefix arg, query for a value of ENTRY-TYPE."
3127 (interactive 3539 (interactive
3128 (list (if current-prefix-arg 3540 (list (if current-prefix-arg
3129 (let ((completion-ignore-case t)) 3541 (let ((completion-ignore-case t))
3130 (completing-read "New entry type: " bibtex-entry-field-alist 3542 (completing-read "New entry type: " bibtex-entry-alist
3131 nil t nil 'bibtex-entry-type-history))))) 3543 nil t nil 'bibtex-entry-type-history)))))
3132 (save-excursion 3544 (save-excursion
3133 (bibtex-beginning-of-entry) 3545 (bibtex-beginning-of-entry)
@@ -3264,14 +3676,16 @@ interactive calls."
3264 (field-list (bibtex-field-list type)) 3676 (field-list (bibtex-field-list type))
3265 (comment (assoc-string field (append (car field-list) 3677 (comment (assoc-string field (append (car field-list)
3266 (cdr field-list)) t))) 3678 (cdr field-list)) t)))
3267 (if comment (message "%s" (nth 1 comment)) 3679 (message "%s" (cond ((nth 1 comment) (nth 1 comment))
3268 (message "No comment available"))))) 3680 ((setq comment (assoc-string field bibtex-field-alist t))
3681 (nth 1 comment))
3682 (t "No comment available"))))))
3269 3683
3270(defun bibtex-make-field (field &optional move interactive nodelim) 3684(defun bibtex-make-field (field &optional move interactive nodelim)
3271 "Make a field named FIELD in current BibTeX entry. 3685 "Make a field named FIELD in current BibTeX entry.
3272FIELD is either a string or a list of the form 3686FIELD is either a string or a list of the form
3273\(FIELD-NAME COMMENT-STRING INIT ALTERNATIVE-FLAG) as in 3687\(FIELD-NAME COMMENT-STRING INIT ALTERNATIVE-FLAG) as in
3274`bibtex-entry-field-alist'. 3688`bibtex-BibTeX-entry-alist' and friends.
3275If MOVE is non-nil, move point past the present field before making 3689If MOVE is non-nil, move point past the present field before making
3276the new field. If INTERACTIVE is non-nil, move point to the end of 3690the new field. If INTERACTIVE is non-nil, move point to the end of
3277the new field. Otherwise move point past the new field. 3691the new field. Otherwise move point past the new field.
@@ -3296,6 +3710,8 @@ INIT is surrounded by field delimiters, unless NODELIM is non-nil."
3296 (forward-char))) 3710 (forward-char)))
3297 (insert ",\n") 3711 (insert ",\n")
3298 (indent-to-column (+ bibtex-entry-offset bibtex-field-indentation)) 3712 (indent-to-column (+ bibtex-entry-offset bibtex-field-indentation))
3713 ;; If there are multiple sets of alternatives, we could use
3714 ;; the numeric value of (nth 3 field) to number these sets. Useful??
3299 (if (nth 3 field) (insert "ALT")) 3715 (if (nth 3 field) (insert "ALT"))
3300 (insert (car field) " ") 3716 (insert (car field) " ")
3301 (if bibtex-align-at-equal-sign 3717 (if bibtex-align-at-equal-sign
@@ -3794,14 +4210,22 @@ Return t if test was successful, nil otherwise."
3794 "Checking required fields and month fields") 4210 "Checking required fields and month fields")
3795 (let ((bibtex-sort-ignore-string-entries t)) 4211 (let ((bibtex-sort-ignore-string-entries t))
3796 (bibtex-map-entries 4212 (bibtex-map-entries
3797 (lambda (_key beg _end) 4213 (lambda (_key beg end)
3798 (bibtex-progress-message) 4214 (bibtex-progress-message)
3799 (let* ((entry-list (assoc-string (bibtex-type-in-head) 4215 (bibtex-beginning-first-field beg)
3800 bibtex-entry-field-alist t)) 4216 (let* ((beg-line (save-excursion (goto-char beg)
3801 (req (copy-sequence (elt (elt entry-list 1) 0))) 4217 (bibtex-current-line)))
3802 (creq (copy-sequence (elt (elt entry-list 2) 0))) 4218 (entry-list (assoc-string (bibtex-type-in-head)
3803 crossref-there bounds alt-there field) 4219 bibtex-entry-alist t))
3804 (bibtex-beginning-first-field beg) 4220 (crossref (bibtex-search-forward-field "crossref" end))
4221 (req (if crossref (copy-sequence (nth 2 entry-list))
4222 (append (nth 2 entry-list)
4223 (copy-sequence (nth 3 entry-list)))))
4224 (num-alt (length (delq nil (delete-dups
4225 (mapcar (lambda (x) (nth 3 x))
4226 req)))))
4227 (alt-fields (make-vector num-alt nil))
4228 bounds field idx)
3805 (while (setq bounds (bibtex-parse-field)) 4229 (while (setq bounds (bibtex-parse-field))
3806 (let ((field-name (bibtex-name-in-field bounds))) 4230 (let ((field-name (bibtex-name-in-field bounds)))
3807 (if (and (bibtex-string= field-name "month") 4231 (if (and (bibtex-string= field-name "month")
@@ -3815,36 +4239,28 @@ Return t if test was successful, nil otherwise."
3815 "Questionable month field") 4239 "Questionable month field")
3816 error-list)) 4240 error-list))
3817 (setq field (assoc-string field-name req t) 4241 (setq field (assoc-string field-name req t)
3818 req (delete field req) 4242 req (delete field req))
3819 creq (delete (assoc-string field-name creq t) creq)) 4243 (if (setq idx (nth 3 field))
3820 (if (nth 3 field) 4244 (if (aref alt-fields idx)
3821 (if alt-there
3822 (push (cons (bibtex-current-line) 4245 (push (cons (bibtex-current-line)
3823 "More than one non-empty alternative") 4246 "More than one non-empty alternative")
3824 error-list) 4247 error-list)
3825 (setq alt-there t))) 4248 (aset alt-fields idx t))))
3826 (if (bibtex-string= field-name "crossref")
3827 (setq crossref-there t)))
3828 (goto-char (bibtex-end-of-field bounds))) 4249 (goto-char (bibtex-end-of-field bounds)))
3829 (if crossref-there (setq req creq)) 4250 (let ((alt-expect (make-vector num-alt nil)))
3830 (let (alt) 4251 (dolist (field req) ; absent required fields
3831 (dolist (field req) 4252 (if (setq idx (nth 3 field))
3832 (if (nth 3 field) 4253 (bibtex-vec-push alt-expect idx (car field))
3833 (push (car field) alt) 4254 (push (cons beg-line
3834 (push (cons (save-excursion (goto-char beg)
3835 (bibtex-current-line))
3836 (format "Required field `%s' missing" 4255 (format "Required field `%s' missing"
3837 (car field))) 4256 (car field)))
3838 error-list))) 4257 error-list)))
3839 ;; The following fails if there are more than two 4258 (dotimes (idx num-alt)
3840 ;; alternatives in a BibTeX entry, which isn't 4259 (unless (aref alt-fields idx)
3841 ;; the case momentarily. 4260 (push (cons beg-line
3842 (if (cdr alt) 4261 (format "Alternative fields `%s' missing"
3843 (push (cons (save-excursion (goto-char beg) 4262 (aref alt-expect idx)))
3844 (bibtex-current-line)) 4263 error-list))))))))
3845 (format "Alternative fields `%s'/`%s' missing"
3846 (car alt) (cadr alt)))
3847 error-list)))))))
3848 (bibtex-progress-message 'done))))) 4264 (bibtex-progress-message 'done)))))
3849 4265
3850 (if error-list 4266 (if error-list
@@ -3890,7 +4306,7 @@ Return t if test was successful, nil otherwise."
3890 (setq entry-type (bibtex-type-in-head) 4306 (setq entry-type (bibtex-type-in-head)
3891 key (bibtex-key-in-head)) 4307 key (bibtex-key-in-head))
3892 (if (or (and strings (bibtex-string= entry-type "string")) 4308 (if (or (and strings (bibtex-string= entry-type "string"))
3893 (assoc-string entry-type bibtex-entry-field-alist t)) 4309 (assoc-string entry-type bibtex-entry-alist t))
3894 (if (member key key-list) 4310 (if (member key key-list)
3895 (push (format "%s:%d: Duplicate key `%s'\n" 4311 (push (format "%s:%d: Duplicate key `%s'\n"
3896 (buffer-file-name) 4312 (buffer-file-name)
@@ -4057,7 +4473,13 @@ is as in `bibtex-enclosing-field'. It is t for interactive calls."
4057 (bounds (bibtex-enclosing-field comma))) 4473 (bounds (bibtex-enclosing-field comma)))
4058 (save-excursion 4474 (save-excursion
4059 (goto-char (bibtex-start-of-name-in-field bounds)) 4475 (goto-char (bibtex-start-of-name-in-field bounds))
4060 (when (looking-at "OPT\\|ALT") 4476 (when (and (looking-at "OPT\\|ALT")
4477 (not (and bibtex-no-opt-remove-re
4478 (string-match
4479 bibtex-no-opt-remove-re
4480 (buffer-substring-no-properties
4481 (bibtex-start-of-name-in-field bounds)
4482 (bibtex-end-of-name-in-field bounds))))))
4061 (delete-region (match-beginning 0) (match-end 0)) 4483 (delete-region (match-beginning 0) (match-end 0))
4062 ;; make field non-OPT 4484 ;; make field non-OPT
4063 (search-forward "=") 4485 (search-forward "=")
@@ -4600,71 +5022,6 @@ entries from minibuffer."
4600 (when (eq status 'finished) 5022 (when (eq status 'finished)
4601 (save-excursion (bibtex-remove-delimiters))))))))) 5023 (save-excursion (bibtex-remove-delimiters)))))))))
4602 5024
4603(defun bibtex-Article ()
4604 "Insert a new BibTeX @Article entry; see also `bibtex-entry'."
4605 (interactive "*")
4606 (bibtex-entry "Article"))
4607
4608(defun bibtex-Book ()
4609 "Insert a new BibTeX @Book entry; see also `bibtex-entry'."
4610 (interactive "*")
4611 (bibtex-entry "Book"))
4612
4613(defun bibtex-Booklet ()
4614 "Insert a new BibTeX @Booklet entry; see also `bibtex-entry'."
4615 (interactive "*")
4616 (bibtex-entry "Booklet"))
4617
4618(defun bibtex-InBook ()
4619 "Insert a new BibTeX @InBook entry; see also `bibtex-entry'."
4620 (interactive "*")
4621 (bibtex-entry "InBook"))
4622
4623(defun bibtex-InCollection ()
4624 "Insert a new BibTeX @InCollection entry; see also `bibtex-entry'."
4625 (interactive "*")
4626 (bibtex-entry "InCollection"))
4627
4628(defun bibtex-InProceedings ()
4629 "Insert a new BibTeX @InProceedings entry; see also `bibtex-entry'."
4630 (interactive "*")
4631 (bibtex-entry "InProceedings"))
4632
4633(defun bibtex-Manual ()
4634 "Insert a new BibTeX @Manual entry; see also `bibtex-entry'."
4635 (interactive "*")
4636 (bibtex-entry "Manual"))
4637
4638(defun bibtex-MastersThesis ()
4639 "Insert a new BibTeX @MastersThesis entry; see also `bibtex-entry'."
4640 (interactive "*")
4641 (bibtex-entry "MastersThesis"))
4642
4643(defun bibtex-Misc ()
4644 "Insert a new BibTeX @Misc entry; see also `bibtex-entry'."
4645 (interactive "*")
4646 (bibtex-entry "Misc"))
4647
4648(defun bibtex-PhdThesis ()
4649 "Insert a new BibTeX @PhdThesis entry; see also `bibtex-entry'."
4650 (interactive "*")
4651 (bibtex-entry "PhdThesis"))
4652
4653(defun bibtex-Proceedings ()
4654 "Insert a new BibTeX @Proceedings entry; see also `bibtex-entry'."
4655 (interactive "*")
4656 (bibtex-entry "Proceedings"))
4657
4658(defun bibtex-TechReport ()
4659 "Insert a new BibTeX @TechReport entry; see also `bibtex-entry'."
4660 (interactive "*")
4661 (bibtex-entry "TechReport"))
4662
4663(defun bibtex-Unpublished ()
4664 "Insert a new BibTeX @Unpublished entry; see also `bibtex-entry'."
4665 (interactive "*")
4666 (bibtex-entry "Unpublished"))
4667
4668(defun bibtex-String (&optional key) 5025(defun bibtex-String (&optional key)
4669 "Insert a new BibTeX @String entry with key KEY." 5026 "Insert a new BibTeX @String entry with key KEY."
4670 (interactive (list (bibtex-read-string-key))) 5027 (interactive (list (bibtex-read-string-key)))
@@ -4822,10 +5179,8 @@ where FILE is the BibTeX file of ENTRY."
4822 (delete-dups 5179 (delete-dups
4823 (apply 'append 5180 (apply 'append
4824 bibtex-user-optional-fields 5181 bibtex-user-optional-fields
4825 (mapcar (lambda (x) 5182 (mapcar (lambda (x) (mapcar 'car (apply 'append (nthcdr 2 x))))
4826 (append (mapcar 'car (nth 0 (nth 1 x))) 5183 bibtex-entry-alist))) nil t)
4827 (mapcar 'car (nth 1 (nth 1 x)))))
4828 bibtex-entry-field-alist))) nil t)
4829 (read-string "Regexp: ") 5184 (read-string "Regexp: ")
4830 (if bibtex-search-entry-globally 5185 (if bibtex-search-entry-globally
4831 (not current-prefix-arg) 5186 (not current-prefix-arg)
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index a85ed982ab0..b264cc30850 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -988,7 +988,7 @@ can take care of filling. JUSTIFY is used as in `fill-paragraph'."
988(defun fill-region (from to &optional justify nosqueeze to-eop) 988(defun fill-region (from to &optional justify nosqueeze to-eop)
989 "Fill each of the paragraphs in the region. 989 "Fill each of the paragraphs in the region.
990A prefix arg means justify as well. 990A prefix arg means justify as well.
991Ordinarily the variable `fill-column' controls the width. 991The `fill-column' variable controls the width.
992 992
993Noninteractively, the third argument JUSTIFY specifies which 993Noninteractively, the third argument JUSTIFY specifies which
994kind of justification to do: `full', `left', `right', `center', 994kind of justification to do: `full', `left', `right', `center',
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index bc8644be786..e6837d0abde 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -993,14 +993,17 @@ Mostly we check word delimiters."
993;;*---------------------------------------------------------------------*/ 993;;*---------------------------------------------------------------------*/
994;;* flyspell-word-search-backward ... */ 994;;* flyspell-word-search-backward ... */
995;;*---------------------------------------------------------------------*/ 995;;*---------------------------------------------------------------------*/
996(defun flyspell-word-search-backward (word bound) 996(defun flyspell-word-search-backward (word bound &optional ignore-case)
997 (save-excursion 997 (save-excursion
998 (let ((r '()) 998 (let ((r '())
999 (inhibit-point-motion-hooks t) 999 (inhibit-point-motion-hooks t)
1000 p) 1000 p)
1001 (while (and (not r) (setq p (search-backward word bound t))) 1001 (while (and (not r) (setq p (search-backward word bound t)))
1002 (let ((lw (flyspell-get-word))) 1002 (let ((lw (flyspell-get-word)))
1003 (if (and (consp lw) (string-equal (car lw) word)) 1003 (if (and (consp lw)
1004 (if ignore-case
1005 (string-equal (downcase (car lw)) (downcase word))
1006 (string-equal (car lw) word)))
1004 (setq r p) 1007 (setq r p)
1005 (goto-char p)))) 1008 (goto-char p))))
1006 r))) 1009 r)))
@@ -1069,7 +1072,7 @@ misspelling and skips redundant spell-checking step."
1069 (- end start) 1072 (- end start)
1070 (- (skip-chars-backward " \t\n\f")))) 1073 (- (skip-chars-backward " \t\n\f"))))
1071 (p (when (>= bound (point-min)) 1074 (p (when (>= bound (point-min))
1072 (flyspell-word-search-backward word bound)))) 1075 (flyspell-word-search-backward word bound t))))
1073 (and p (/= p start))))) 1076 (and p (/= p start)))))
1074 ;; yes, this is a doublon 1077 ;; yes, this is a doublon
1075 (flyspell-highlight-incorrect-region start end 'doublon) 1078 (flyspell-highlight-incorrect-region start end 'doublon)
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 6ffbf7a4621..b0f22085064 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -146,7 +146,7 @@
146 (unless (assq 'xr docstruct) 146 (unless (assq 'xr docstruct)
147 (let* ((allxr (reftex-all-assq 'xr-doc docstruct)) 147 (let* ((allxr (reftex-all-assq 'xr-doc docstruct))
148 (alist (mapcar 148 (alist (mapcar
149 (lambda (x) 149 (lambda (x)
150 (if (setq tmp (reftex-locate-file (nth 2 x) "tex" 150 (if (setq tmp (reftex-locate-file (nth 2 x) "tex"
151 master-dir)) 151 master-dir))
152 (cons (nth 1 x) tmp) 152 (cons (nth 1 x) tmp)
@@ -157,7 +157,7 @@
157 (alist (delq nil alist)) 157 (alist (delq nil alist))
158 (allprefix (delq nil (mapcar 'car alist))) 158 (allprefix (delq nil (mapcar 'car alist)))
159 (regexp (if allprefix 159 (regexp (if allprefix
160 (concat "\\`\\(" 160 (concat "\\`\\("
161 (mapconcat 'identity allprefix "\\|") 161 (mapconcat 'identity allprefix "\\|")
162 "\\)") 162 "\\)")
163 "\\\\\\\\\\\\"))) ; this will never match 163 "\\\\\\\\\\\\"))) ; this will never match
@@ -189,6 +189,9 @@ of master file."
189 (push file file-list)) 189 (push file file-list))
190 (nreverse file-list))) 190 (nreverse file-list)))
191 191
192;; Bound in the caller, reftex-do-parse.
193(defvar index-tags)
194
192(defun reftex-parse-from-file (file docstruct master-dir) 195(defun reftex-parse-from-file (file docstruct master-dir)
193 ;; Scan the buffer for labels and save them in a list. 196 ;; Scan the buffer for labels and save them in a list.
194 (let ((regexp (reftex-everything-regexp)) 197 (let ((regexp (reftex-everything-regexp))
@@ -259,7 +262,7 @@ of master file."
259 ;; It's an include or input 262 ;; It's an include or input
260 (setq include-file (reftex-match-string 7)) 263 (setq include-file (reftex-match-string 7))
261 ;; Test if this file should be ignored 264 ;; Test if this file should be ignored
262 (unless (delq nil (mapcar 265 (unless (delq nil (mapcar
263 (lambda (x) (string-match x include-file)) 266 (lambda (x) (string-match x include-file))
264 reftex-no-include-regexps)) 267 reftex-no-include-regexps))
265 ;; Parse it 268 ;; Parse it
@@ -308,10 +311,10 @@ of master file."
308 (push (cons 'bib tmp) docstruct)) 311 (push (cons 'bib tmp) docstruct))
309 312
310 (goto-char 1) 313 (goto-char 1)
311 (when (re-search-forward 314 (when (re-search-forward
312 "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t) 315 "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t)
313 (push (cons 'thebib file) docstruct)) 316 (push (cons 'thebib file) docstruct))
314 317
315 ;; Find external document specifications 318 ;; Find external document specifications
316 (goto-char 1) 319 (goto-char 1)
317 (while (re-search-forward "[\n\r][ \t]*\\\\externaldocument\\(\\[\\([^]]*\\)\\]\\)?{\\([^}]+\\)}" nil t) 320 (while (re-search-forward "[\n\r][ \t]*\\\\externaldocument\\(\\[\\([^]]*\\)\\]\\)?{\\([^}]+\\)}" nil t)
@@ -330,7 +333,7 @@ of master file."
330 333
331(defun reftex-locate-bibliography-files (master-dir &optional files) 334(defun reftex-locate-bibliography-files (master-dir &optional files)
332 ;; Scan buffer for bibliography macro and return file list. 335 ;; Scan buffer for bibliography macro and return file list.
333 336
334 (unless files 337 (unless files
335 (save-excursion 338 (save-excursion
336 (goto-char (point-min)) 339 (goto-char (point-min))
@@ -340,11 +343,11 @@ of master file."
340 "\\(^\\)[^%\n\r]*\\\\\\(" 343 "\\(^\\)[^%\n\r]*\\\\\\("
341 (mapconcat 'identity reftex-bibliography-commands "\\|") 344 (mapconcat 'identity reftex-bibliography-commands "\\|")
342 "\\){[ \t]*\\([^}]+\\)") nil t) 345 "\\){[ \t]*\\([^}]+\\)") nil t)
343 (setq files 346 (setq files
344 (split-string (reftex-match-string 3) 347 (split-string (reftex-match-string 3)
345 "[ \t\n\r]*,[ \t\n\r]*"))))) 348 "[ \t\n\r]*,[ \t\n\r]*")))))
346 (when files 349 (when files
347 (setq files 350 (setq files
348 (mapcar 351 (mapcar
349 (lambda (x) 352 (lambda (x)
350 (if (or (member x reftex-bibfile-ignore-list) 353 (if (or (member x reftex-bibfile-ignore-list)
@@ -398,13 +401,13 @@ of master file."
398 (unnumbered (or star (< level 0))) 401 (unnumbered (or star (< level 0)))
399 (level (abs level)) 402 (level (abs level))
400 (section-number (reftex-section-number level unnumbered)) 403 (section-number (reftex-section-number level unnumbered))
401 (text1 (save-match-data 404 (text1 (save-match-data
402 (save-excursion 405 (save-excursion
403 (reftex-context-substring prefix)))) 406 (reftex-context-substring prefix))))
404 (literal (buffer-substring-no-properties 407 (literal (buffer-substring-no-properties
405 (1- (match-beginning 3)) 408 (1- (match-beginning 3))
406 (min (point-max) (+ (match-end 0) (length text1) 1)))) 409 (min (point-max) (+ (match-end 0) (length text1) 1))))
407 ;; Literal can be too short since text1 too short. No big problem. 410 ;; Literal can be too short since text1 too short. No big problem.
408 (text (reftex-nicify-text text1))) 411 (text (reftex-nicify-text text1)))
409 412
410 ;; Add section number and indentation 413 ;; Add section number and indentation
@@ -454,7 +457,7 @@ of master file."
454 (throw 'exit nil))) 457 (throw 'exit nil)))
455 (itag (nth 1 entry)) 458 (itag (nth 1 entry))
456 (prefix (nth 2 entry)) 459 (prefix (nth 2 entry))
457 (index-tag 460 (index-tag
458 (cond ((stringp itag) itag) 461 (cond ((stringp itag) itag)
459 ((integerp itag) 462 ((integerp itag)
460 (progn (goto-char boa) 463 (progn (goto-char boa)
@@ -476,16 +479,16 @@ of master file."
476 (key-end (if (string-match reftex-index-key-end-re arg) 479 (key-end (if (string-match reftex-index-key-end-re arg)
477 (1+ (match-beginning 0)))) 480 (1+ (match-beginning 0))))
478 (rawkey (substring arg 0 key-end)) 481 (rawkey (substring arg 0 key-end))
479 482
480 (key (if prefix (concat prefix rawkey) rawkey)) 483 (key (if prefix (concat prefix rawkey) rawkey))
481 (sortkey (downcase key)) 484 (sortkey (downcase key))
482 (showkey (mapconcat 'identity 485 (showkey (mapconcat 'identity
483 (split-string key reftex-index-level-re) 486 (split-string key reftex-index-level-re)
484 " ! "))) 487 " ! ")))
485 (goto-char end-of-args) 488 (goto-char end-of-args)
486 ;; 0 1 2 3 4 5 6 7 8 9 489 ;; 0 1 2 3 4 5 6 7 8 9
487 (list 'index index-tag context file bom arg key showkey sortkey key-end)))) 490 (list 'index index-tag context file bom arg key showkey sortkey key-end))))
488 491
489(defun reftex-short-context (env parse &optional bound derive) 492(defun reftex-short-context (env parse &optional bound derive)
490 ;; Get about one line of useful context for the label definition at point. 493 ;; Get about one line of useful context for the label definition at point.
491 494
@@ -608,7 +611,7 @@ of master file."
608 ((match-end 10) 611 ((match-end 10)
609 ;; Index entry 612 ;; Index entry
610 (when reftex-support-index 613 (when reftex-support-index
611 (let* ((index-info (save-excursion 614 (let* ((index-info (save-excursion
612 (reftex-index-info-safe nil))) 615 (reftex-index-info-safe nil)))
613 (list (member (list 'bof (buffer-file-name)) 616 (list (member (list 'bof (buffer-file-name))
614 docstruct)) 617 docstruct))
@@ -618,7 +621,7 @@ of master file."
618 ;; Check all index entries with equal text 621 ;; Check all index entries with equal text
619 (while (and list (not (eq endelt (car list)))) 622 (while (and list (not (eq endelt (car list))))
620 (when (and (eq (car (car list)) 'index) 623 (when (and (eq (car (car list)) 'index)
621 (string= (nth 2 index-info) 624 (string= (nth 2 index-info)
622 (nth 2 (car list)))) 625 (nth 2 (car list))))
623 (incf n) 626 (incf n)
624 (setq dist (abs (- (point) (nth 4 (car list))))) 627 (setq dist (abs (- (point) (nth 4 (car list)))))
@@ -691,7 +694,7 @@ of master file."
691 level (nth 5 entry)) 694 level (nth 5 entry))
692 ;; Insert the section info 695 ;; Insert the section info
693 (push entry (cdr tail)) 696 (push entry (cdr tail))
694 697
695 ;; We are done unless we use section numbers 698 ;; We are done unless we use section numbers
696 (unless (nth 1 reftex-label-menu-flags) (throw 'exit nil)) 699 (unless (nth 1 reftex-label-menu-flags) (throw 'exit nil))
697 700
@@ -722,7 +725,7 @@ of master file."
722 (setq entry (reftex-index-info-safe buffer-file-name)) 725 (setq entry (reftex-index-info-safe buffer-file-name))
723 ;; FIXME: (add-to-list 'index-tags (nth 1 index-entry)) 726 ;; FIXME: (add-to-list 'index-tags (nth 1 index-entry))
724 (push entry (cdr tail)))))))))) 727 (push entry (cdr tail))))))))))
725 728
726 (error nil)) 729 (error nil))
727 ) 730 )
728 731
@@ -875,7 +878,7 @@ of master file."
875 reftex-special-env-parsers)) 878 reftex-special-env-parsers))
876 specials rtn) 879 specials rtn)
877 ;; Call all functions 880 ;; Call all functions
878 (setq specials (mapcar 881 (setq specials (mapcar
879 (lambda (fun) 882 (lambda (fun)
880 (save-excursion 883 (save-excursion
881 (setq rtn (and fun (funcall fun bound))) 884 (setq rtn (and fun (funcall fun bound)))
@@ -885,7 +888,7 @@ of master file."
885 (setq specials (delq nil specials)) 888 (setq specials (delq nil specials))
886 ;; Sort 889 ;; Sort
887 (setq specials (sort specials (lambda (a b) (> (cdr a) (cdr b))))) 890 (setq specials (sort specials (lambda (a b) (> (cdr a) (cdr b)))))
888 (if (eq which t) 891 (if (eq which t)
889 specials 892 specials
890 (car specials)))))) 893 (car specials))))))
891 894
@@ -923,9 +926,9 @@ of master file."
923 926
924 ;; Do the real thing. 927 ;; Do the real thing.
925 (let ((cnt 1)) 928 (let ((cnt 1))
926 929
927 (when (reftex-move-to-next-arg) 930 (when (reftex-move-to-next-arg)
928 931
929 (while (< cnt n) 932 (while (< cnt n)
930 (while (and (member cnt opt-args) 933 (while (and (member cnt opt-args)
931 (eq (following-char) ?\{)) 934 (eq (following-char) ?\{))
@@ -950,7 +953,7 @@ of master file."
950 (condition-case nil 953 (condition-case nil
951 (while (memq (following-char) '(?\[ ?\{)) 954 (while (memq (following-char) '(?\[ ?\{))
952 (forward-list 1)) 955 (forward-list 1))
953 (error nil))) 956 (error nil)))
954 957
955(defun reftex-context-substring (&optional to-end) 958(defun reftex-context-substring (&optional to-end)
956 ;; Return up to 150 chars from point 959 ;; Return up to 150 chars from point
@@ -979,7 +982,7 @@ of master file."
979 (error (point-max)))))) 982 (error (point-max))))))
980 (t 983 (t
981 ;; no list - just grab 150 characters 984 ;; no list - just grab 150 characters
982 (buffer-substring-no-properties (point) 985 (buffer-substring-no-properties (point)
983 (min (+ (point) 150) (point-max)))))) 986 (min (+ (point) 150) (point-max))))))
984 987
985;; Variable holding the vector with section numbers 988;; Variable holding the vector with section numbers
@@ -1016,7 +1019,7 @@ of master file."
1016 ;; not included in the numbering of other sectioning levels. 1019 ;; not included in the numbering of other sectioning levels.
1017 (when level 1020 (when level
1018 (when (and (> level -1) (not star)) 1021 (when (and (> level -1) (not star))
1019 (aset reftex-section-numbers 1022 (aset reftex-section-numbers
1020 level (1+ (aref reftex-section-numbers level)))) 1023 level (1+ (aref reftex-section-numbers level))))
1021 (setq idx (1+ level)) 1024 (setq idx (1+ level))
1022 (when (not star) 1025 (when (not star)
@@ -1042,7 +1045,7 @@ of master file."
1042 (setq string (replace-match "" nil nil string))) 1045 (setq string (replace-match "" nil nil string)))
1043 (if (and appendix 1046 (if (and appendix
1044 (string-match "\\`[0-9]+" string)) 1047 (string-match "\\`[0-9]+" string))
1045 (setq string 1048 (setq string
1046 (concat 1049 (concat
1047 (char-to-string 1050 (char-to-string
1048 (1- (+ ?A (string-to-number (match-string 0 string))))) 1051 (1- (+ ?A (string-to-number (match-string 0 string)))))
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index 9ed5309bb53..c1ce950522c 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -2800,7 +2800,7 @@ details check the Rst Faces Defaults group."
2800 rst-level-face-base-color 2800 rst-level-face-base-color
2801 (+ (* (1- i) rst-level-face-step-light) 2801 (+ (* (1- i) rst-level-face-step-light)
2802 rst-level-face-base-light)))) 2802 rst-level-face-base-light))))
2803 (unless (boundp sym) 2803 (unless (facep sym)
2804 (make-empty-face sym) 2804 (make-empty-face sym)
2805 (set-face-doc-string sym doc) 2805 (set-face-doc-string sym doc)
2806 (set-face-background sym col) 2806 (set-face-background sym col)
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index 12a3e2a620b..047bba72ccd 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -687,7 +687,7 @@ is the menu entry name, and the cdr of P is the node name."
687 (insert (format "%s: %s." (car node-part) (cdr node-part))))) 687 (insert (format "%s: %s." (car node-part) (cdr node-part)))))
688 688
689 ;; Insert the description, if present. 689 ;; Insert the description, if present.
690 (when (cdr menu) 690 (when (> (length (cdr menu)) 0)
691 ;; Move to right place. 691 ;; Move to right place.
692 (indent-to texinfo-column-for-description 2) 692 (indent-to texinfo-column-for-description 2)
693 ;; Insert description. 693 ;; Insert description.
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 8f797d13103..ff63ca34035 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -55,7 +55,11 @@
55 55
56;;;###autoload 56;;;###autoload
57(defun forward-thing (thing &optional n) 57(defun forward-thing (thing &optional n)
58 "Move forward to the end of the Nth next THING." 58 "Move forward to the end of the Nth next THING.
59THING should be a symbol specifying a type of syntactic entity.
60Possibilities include `symbol', `list', `sexp', `defun',
61`filename', `url', `email', `word', `sentence', `whitespace',
62`line', and `page'."
59 (let ((forward-op (or (get thing 'forward-op) 63 (let ((forward-op (or (get thing 'forward-op)
60 (intern-soft (format "forward-%s" thing))))) 64 (intern-soft (format "forward-%s" thing)))))
61 (if (functionp forward-op) 65 (if (functionp forward-op)
@@ -67,15 +71,16 @@
67;;;###autoload 71;;;###autoload
68(defun bounds-of-thing-at-point (thing) 72(defun bounds-of-thing-at-point (thing)
69 "Determine the start and end buffer locations for the THING at point. 73 "Determine the start and end buffer locations for the THING at point.
70THING is a symbol which specifies the kind of syntactic entity you want. 74THING should be a symbol specifying a type of syntactic entity.
71Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', 75Possibilities include `symbol', `list', `sexp', `defun',
72`email', `word', `sentence', `whitespace', `line', `page' and others. 76`filename', `url', `email', `word', `sentence', `whitespace',
77`line', and `page'.
73 78
74See the file `thingatpt.el' for documentation on how to define 79See the file `thingatpt.el' for documentation on how to define a
75a symbol as a valid THING. 80valid THING.
76 81
77The value is a cons cell (START . END) giving the start and end positions 82Return a cons cell (START . END) giving the start and end
78of the textual entity that was found." 83positions of the thing found."
79 (if (get thing 'bounds-of-thing-at-point) 84 (if (get thing 'bounds-of-thing-at-point)
80 (funcall (get thing 'bounds-of-thing-at-point)) 85 (funcall (get thing 'bounds-of-thing-at-point))
81 (let ((orig (point))) 86 (let ((orig (point)))
@@ -125,9 +130,10 @@ of the textual entity that was found."
125;;;###autoload 130;;;###autoload
126(defun thing-at-point (thing) 131(defun thing-at-point (thing)
127 "Return the THING at point. 132 "Return the THING at point.
128THING is a symbol which specifies the kind of syntactic entity you want. 133THING should be a symbol specifying a type of syntactic entity.
129Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', 134Possibilities include `symbol', `list', `sexp', `defun',
130`email', `word', `sentence', `whitespace', `line', `page' and others. 135`filename', `url', `email', `word', `sentence', `whitespace',
136`line', and `page'.
131 137
132See the file `thingatpt.el' for documentation on how to define 138See the file `thingatpt.el' for documentation on how to define
133a symbol as a valid THING." 139a symbol as a valid THING."
@@ -140,11 +146,15 @@ a symbol as a valid THING."
140;; Go to beginning/end 146;; Go to beginning/end
141 147
142(defun beginning-of-thing (thing) 148(defun beginning-of-thing (thing)
149 "Move point to the beginning of THING.
150The bounds of THING are determined by `bounds-of-thing-at-point'."
143 (let ((bounds (bounds-of-thing-at-point thing))) 151 (let ((bounds (bounds-of-thing-at-point thing)))
144 (or bounds (error "No %s here" thing)) 152 (or bounds (error "No %s here" thing))
145 (goto-char (car bounds)))) 153 (goto-char (car bounds))))
146 154
147(defun end-of-thing (thing) 155(defun end-of-thing (thing)
156 "Move point to the end of THING.
157The bounds of THING are determined by `bounds-of-thing-at-point'."
148 (let ((bounds (bounds-of-thing-at-point thing))) 158 (let ((bounds (bounds-of-thing-at-point thing)))
149 (or bounds (error "No %s here" thing)) 159 (or bounds (error "No %s here" thing))
150 (goto-char (cdr bounds)))) 160 (goto-char (cdr bounds))))
@@ -162,12 +172,16 @@ a symbol as a valid THING."
162;; Sexps 172;; Sexps
163 173
164(defun in-string-p () 174(defun in-string-p ()
175 "Return non-nil if point is in a string.
176\[This is an internal function.]"
165 (let ((orig (point))) 177 (let ((orig (point)))
166 (save-excursion 178 (save-excursion
167 (beginning-of-defun) 179 (beginning-of-defun)
168 (nth 3 (parse-partial-sexp (point) orig))))) 180 (nth 3 (parse-partial-sexp (point) orig)))))
169 181
170(defun end-of-sexp () 182(defun end-of-sexp ()
183 "Move point to the end of the current sexp.
184\[This is an internal function.]"
171 (let ((char-syntax (char-syntax (char-after)))) 185 (let ((char-syntax (char-syntax (char-after))))
172 (if (or (eq char-syntax ?\)) 186 (if (or (eq char-syntax ?\))
173 (and (eq char-syntax ?\") (in-string-p))) 187 (and (eq char-syntax ?\") (in-string-p)))
@@ -177,6 +191,8 @@ a symbol as a valid THING."
177(put 'sexp 'end-op 'end-of-sexp) 191(put 'sexp 'end-op 'end-of-sexp)
178 192
179(defun beginning-of-sexp () 193(defun beginning-of-sexp ()
194 "Move point to the beginning of the current sexp.
195\[This is an internal function.]"
180 (let ((char-syntax (char-syntax (char-before)))) 196 (let ((char-syntax (char-syntax (char-before))))
181 (if (or (eq char-syntax ?\() 197 (if (or (eq char-syntax ?\()
182 (and (eq char-syntax ?\") (in-string-p))) 198 (and (eq char-syntax ?\") (in-string-p)))
@@ -190,6 +206,8 @@ a symbol as a valid THING."
190(put 'list 'bounds-of-thing-at-point 'thing-at-point-bounds-of-list-at-point) 206(put 'list 'bounds-of-thing-at-point 'thing-at-point-bounds-of-list-at-point)
191 207
192(defun thing-at-point-bounds-of-list-at-point () 208(defun thing-at-point-bounds-of-list-at-point ()
209 "Return the bounds of the list at point.
210\[Internal function used by `bounds-of-thing-at-point'.]"
193 (save-excursion 211 (save-excursion
194 (let ((opoint (point)) 212 (let ((opoint (point))
195 (beg (condition-case nil 213 (beg (condition-case nil
@@ -235,7 +253,7 @@ a symbol as a valid THING."
235 "A regular expression probably matching the host and filename or e-mail part of a URL.") 253 "A regular expression probably matching the host and filename or e-mail part of a URL.")
236 254
237(defvar thing-at-point-short-url-regexp 255(defvar thing-at-point-short-url-regexp
238 (concat "[-A-Za-z0-9.]+" thing-at-point-url-path-regexp) 256 (concat "[-A-Za-z0-9]+\\.[-A-Za-z0-9.]+" thing-at-point-url-path-regexp)
239 "A regular expression probably matching a URL without an access scheme. 257 "A regular expression probably matching a URL without an access scheme.
240Hostname matching is stricter in this case than for 258Hostname matching is stricter in this case than for
241``thing-at-point-url-regexp''.") 259``thing-at-point-url-regexp''.")
@@ -397,6 +415,11 @@ with angle brackets.")
397;; Whitespace 415;; Whitespace
398 416
399(defun forward-whitespace (arg) 417(defun forward-whitespace (arg)
418 "Move point to the end of the next sequence of whitespace chars.
419Each such sequence may be a single newline, or a sequence of
420consecutive space and/or tab characters.
421With prefix argument ARG, do it ARG times if positive, or move
422backwards ARG times if negative."
400 (interactive "p") 423 (interactive "p")
401 (if (natnump arg) 424 (if (natnump arg)
402 (re-search-forward "[ \t]+\\|\n" nil 'move arg) 425 (re-search-forward "[ \t]+\\|\n" nil 'move arg)
@@ -414,6 +437,11 @@ with angle brackets.")
414;; Symbols 437;; Symbols
415 438
416(defun forward-symbol (arg) 439(defun forward-symbol (arg)
440 "Move point to the next position that is the end of a symbol.
441A symbol is any sequence of characters that are in either the
442word constituent or symbol constituent syntax class.
443With prefix argument ARG, do it ARG times if positive, or move
444backwards ARG times if negative."
417 (interactive "p") 445 (interactive "p")
418 (if (natnump arg) 446 (if (natnump arg)
419 (re-search-forward "\\(\\sw\\|\\s_\\)+" nil 'move arg) 447 (re-search-forward "\\(\\sw\\|\\s_\\)+" nil 'move arg)
@@ -425,6 +453,9 @@ with angle brackets.")
425;; Syntax blocks 453;; Syntax blocks
426 454
427(defun forward-same-syntax (&optional arg) 455(defun forward-same-syntax (&optional arg)
456 "Move point past all characters with the same syntax class.
457With prefix argument ARG, do it ARG times if positive, or move
458backwards ARG times if negative."
428 (interactive "p") 459 (interactive "p")
429 (while (< arg 0) 460 (while (< arg 0)
430 (skip-syntax-backward 461 (skip-syntax-backward
@@ -436,8 +467,13 @@ with angle brackets.")
436 467
437;; Aliases 468;; Aliases
438 469
439(defun word-at-point () (thing-at-point 'word)) 470(defun word-at-point ()
440(defun sentence-at-point () (thing-at-point 'sentence)) 471 "Return the word at point. See `thing-at-point'."
472 (thing-at-point 'word))
473
474(defun sentence-at-point ()
475 "Return the sentence at point. See `thing-at-point'."
476 (thing-at-point 'sentence))
441 477
442(defun read-from-whole-string (str) 478(defun read-from-whole-string (str)
443 "Read a Lisp expression from STR. 479 "Read a Lisp expression from STR.
diff --git a/lisp/time.el b/lisp/time.el
index 7d752c85d4d..b158ef64691 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -423,30 +423,31 @@ update which can wait for the next redisplay."
423 (getenv "MAIL") 423 (getenv "MAIL")
424 (concat rmail-spool-directory 424 (concat rmail-spool-directory
425 (user-login-name)))) 425 (user-login-name))))
426 (mail (or (and display-time-mail-function 426 (mail (cond
427 (funcall display-time-mail-function)) 427 (display-time-mail-function
428 (and display-time-mail-directory 428 (funcall display-time-mail-function))
429 (display-time-mail-check-directory)) 429 (display-time-mail-directory
430 (and (stringp mail-spool-file) 430 (display-time-mail-check-directory))
431 (or (null display-time-server-down-time) 431 ((and (stringp mail-spool-file)
432 ;; If have been down for 20 min, try again. 432 (or (null display-time-server-down-time)
433 (> (- (nth 1 now) display-time-server-down-time) 433 ;; If have been down for 20 min, try again.
434 1200) 434 (> (- (nth 1 now) display-time-server-down-time)
435 (and (< (nth 1 now) display-time-server-down-time) 435 1200)
436 (> (- (nth 1 now) 436 (and (< (nth 1 now) display-time-server-down-time)
437 display-time-server-down-time) 437 (> (- (nth 1 now)
438 -64336))) 438 display-time-server-down-time)
439 (let ((start-time (current-time))) 439 -64336))))
440 (prog1 440 (let ((start-time (current-time)))
441 (display-time-file-nonempty-p mail-spool-file) 441 (prog1
442 (if (> (- (nth 1 (current-time)) 442 (display-time-file-nonempty-p mail-spool-file)
443 (nth 1 start-time)) 443 (if (> (- (nth 1 (current-time))
444 20) 444 (nth 1 start-time))
445 ;; Record that mail file is not accessible. 445 20)
446 (setq display-time-server-down-time 446 ;; Record that mail file is not accessible.
447 (nth 1 (current-time))) 447 (setq display-time-server-down-time
448 ;; Record that mail file is accessible. 448 (nth 1 (current-time)))
449 (setq display-time-server-down-time nil))))))) 449 ;; Record that mail file is accessible.
450 (setq display-time-server-down-time nil)))))))
450 (24-hours (substring time 11 13)) 451 (24-hours (substring time 11 13))
451 (hour (string-to-number 24-hours)) 452 (hour (string-to-number 24-hours))
452 (12-hours (int-to-string (1+ (% (+ hour 11) 12)))) 453 (12-hours (int-to-string (1+ (% (+ hour 11) 12))))
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 8fdce17df86..05208abb720 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -44,7 +44,8 @@
44;; when you are on a tty. I hope that won't cause too much trouble -- rms. 44;; when you are on a tty. I hope that won't cause too much trouble -- rms.
45(define-minor-mode tool-bar-mode 45(define-minor-mode tool-bar-mode
46 "Toggle use of the tool bar. 46 "Toggle use of the tool bar.
47With numeric ARG, display the tool bar if and only if ARG is positive. 47With a numeric argument, if the argument is positive, turn on the
48tool bar; otherwise, turn off the tool bar.
48 49
49See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for 50See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for
50conveniently adding tool bar items." 51conveniently adding tool bar items."
diff --git a/lisp/type-break.el b/lisp/type-break.el
index 58022ef8813..d276e64f6db 100644
--- a/lisp/type-break.el
+++ b/lisp/type-break.el
@@ -47,7 +47,7 @@
47;; or set the variable of the same name to `t'. 47;; or set the variable of the same name to `t'.
48 48
49;; This program can truly cons up a storm because of all the calls to 49;; This program can truly cons up a storm because of all the calls to
50;; `current-time' (which always returns 3 fresh conses). I'm dismayed by 50;; `current-time' (which always returns fresh conses). I'm dismayed by
51;; this, but I think the health of my hands is far more important than a 51;; this, but I think the health of my hands is far more important than a
52;; few pages of virtual memory. 52;; few pages of virtual memory.
53 53
@@ -501,12 +501,9 @@ variable of the same name."
501(defun timep (time) 501(defun timep (time)
502 "If TIME is in the format returned by `current-time' then 502 "If TIME is in the format returned by `current-time' then
503return TIME, else return nil." 503return TIME, else return nil."
504 (and (listp time) 504 (condition-case nil
505 (eq (length time) 3) 505 (and (float-time time) time)
506 (integerp (car time)) 506 (error nil)))
507 (integerp (nth 1 time))
508 (integerp (nth 2 time))
509 time))
510 507
511(defun type-break-choose-file () 508(defun type-break-choose-file ()
512 "Return file to read from." 509 "Return file to read from."
@@ -993,12 +990,8 @@ FRAC should be the inverse of the fractional value; for example, a value of
993 990
994;; Compute the difference, in seconds, between a and b, two structures 991;; Compute the difference, in seconds, between a and b, two structures
995;; similar to those returned by `current-time'. 992;; similar to those returned by `current-time'.
996;; Use addition rather than logand since that is more robust; the low 16
997;; bits of the seconds might have been incremented, making it more than 16
998;; bits wide.
999(defun type-break-time-difference (a b) 993(defun type-break-time-difference (a b)
1000 (+ (lsh (- (car b) (car a)) 16) 994 (round (float-time (time-subtract b a))))
1001 (- (car (cdr b)) (car (cdr a)))))
1002 995
1003;; Return (in a new list the same in structure to that returned by 996;; Return (in a new list the same in structure to that returned by
1004;; `current-time') the sum of the arguments. Each argument may be a time 997;; `current-time') the sum of the arguments. Each argument may be a time
@@ -1008,34 +1001,11 @@ FRAC should be the inverse of the fractional value; for example, a value of
1008;; the result is passed to `current-time-string' it will toss some of the 1001;; the result is passed to `current-time-string' it will toss some of the
1009;; "low" bits and format the time incorrectly. 1002;; "low" bits and format the time incorrectly.
1010(defun type-break-time-sum (&rest tmlist) 1003(defun type-break-time-sum (&rest tmlist)
1011 (let ((high 0) 1004 (let ((sum '(0 0 0)))
1012 (low 0) 1005 (dolist (tem tmlist sum)
1013 (micro 0) 1006 (setq sum (time-add sum (if (integerp tem)
1014 tem) 1007 (list (floor tem 65536) (mod tem 65536))
1015 (while tmlist 1008 tem))))))
1016 (setq tem (car tmlist))
1017 (setq tmlist (cdr tmlist))
1018 (cond
1019 ((numberp tem)
1020 (setq low (+ low tem)))
1021 (t
1022 (setq high (+ high (or (car tem) 0)))
1023 (setq low (+ low (or (car (cdr tem)) 0)))
1024 (setq micro (+ micro (or (car (cdr (cdr tem))) 0))))))
1025
1026 (and (>= micro 1000000)
1027 (progn
1028 (setq tem (/ micro 1000000))
1029 (setq low (+ low tem))
1030 (setq micro (- micro (* tem 1000000)))))
1031
1032 (setq tem (lsh low -16))
1033 (and (> tem 0)
1034 (progn
1035 (setq low (logand low 65535))
1036 (setq high (+ high tem))))
1037
1038 (list high low micro)))
1039 1009
1040(defun type-break-time-stamp (&optional when) 1010(defun type-break-time-stamp (&optional when)
1041 (if (fboundp 'format-time-string) 1011 (if (fboundp 'format-time-string)
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 9f7ad1c1ca5..6a3638c4232 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,24 @@
12011-07-13 Chris Newton <redshodan@gmail.com> (tiny change)
2
3 * url-http.el (url-http): Copy over `url-show-status' to the async
4 buffer so that `url-display-percentage' does the right thing
5 (bug#4680).
6
72011-07-06 Nick Dokos <nicholas.dokos@hp.com> (tiny change)
8
9 * url-cache.el (url-cache-extract): Set buffer multibyte flag to
10 nil (bug#8827).
11
122011-07-03 Nicolas Avrutin <nicolasavru@gmail.com> (tiny change)
13
14 * url-http.el (url-http-create-request): Remove double carriage
15 return and newline (bug#8931).
16
172011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18
19 * url-http.el (url-http-wait-for-headers-change-function): Remove
20 pointless "HTTP/0.9 How I hate thee!" message (bug#6735).
21
12011-06-04 Andreas Schwab <schwab@linux-m68k.org> 222011-06-04 Andreas Schwab <schwab@linux-m68k.org>
2 23
3 * url-future.el (url-future-test): Fix scope of `saver'. 24 * url-future.el (url-future-test): Fix scope of `saver'.
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index 1615920e64c..80d77020456 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -192,6 +192,7 @@ Very fast if you have an `md5' primitive function, suitably fast otherwise."
192(defun url-cache-extract (fnam) 192(defun url-cache-extract (fnam)
193 "Extract FNAM from the local disk cache." 193 "Extract FNAM from the local disk cache."
194 (erase-buffer) 194 (erase-buffer)
195 (set-buffer-multibyte nil)
195 (insert-file-contents-literally fnam)) 196 (insert-file-contents-literally fnam))
196 197
197(defun url-cache-expired (url &optional expire-time) 198(defun url-cache-expired (url &optional expire-time)
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 28071e7165a..def35449397 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -338,7 +338,7 @@ request.")
338 ;; End request 338 ;; End request
339 "\r\n" 339 "\r\n"
340 ;; Any data 340 ;; Any data
341 url-http-data "\r\n")) 341 url-http-data))
342 "")) 342 ""))
343 (url-http-debug "Request is: \n%s" request) 343 (url-http-debug "Request is: \n%s" request)
344 request)) 344 request))
@@ -1059,19 +1059,16 @@ the end of the document."
1059 ;; Haven't seen the end of the headers yet, need to wait 1059 ;; Haven't seen the end of the headers yet, need to wait
1060 ;; for more data to arrive. 1060 ;; for more data to arrive.
1061 nil 1061 nil
1062 (if old-http 1062 (unless old-http
1063 (message "HTTP/0.9 How I hate thee!") 1063 (url-http-parse-response)
1064 (progn 1064 (mail-narrow-to-head)
1065 (url-http-parse-response) 1065 (setq url-http-transfer-encoding (mail-fetch-field
1066 (mail-narrow-to-head) 1066 "transfer-encoding")
1067 ;;(narrow-to-region (point-min) url-http-end-of-headers) 1067 url-http-content-type (mail-fetch-field "content-type"))
1068 (setq url-http-transfer-encoding (mail-fetch-field 1068 (if (mail-fetch-field "content-length")
1069 "transfer-encoding") 1069 (setq url-http-content-length
1070 url-http-content-type (mail-fetch-field "content-type")) 1070 (string-to-number (mail-fetch-field "content-length"))))
1071 (if (mail-fetch-field "content-length") 1071 (widen))
1072 (setq url-http-content-length
1073 (string-to-number (mail-fetch-field "content-length"))))
1074 (widen)))
1075 (when url-http-transfer-encoding 1072 (when url-http-transfer-encoding
1076 (setq url-http-transfer-encoding 1073 (setq url-http-transfer-encoding
1077 (downcase url-http-transfer-encoding))) 1074 (downcase url-http-transfer-encoding)))
@@ -1175,6 +1172,7 @@ CBARGS as the arguments."
1175 url-http-after-change-function 1172 url-http-after-change-function
1176 url-callback-function 1173 url-callback-function
1177 url-callback-arguments 1174 url-callback-arguments
1175 url-show-status
1178 url-http-method 1176 url-http-method
1179 url-http-extra-headers 1177 url-http-extra-headers
1180 url-http-data 1178 url-http-data
@@ -1209,6 +1207,7 @@ CBARGS as the arguments."
1209 url-http-chunked-start 1207 url-http-chunked-start
1210 url-callback-function 1208 url-callback-function
1211 url-callback-arguments 1209 url-callback-arguments
1210 url-show-status
1212 url-http-process 1211 url-http-process
1213 url-http-method 1212 url-http-method
1214 url-http-extra-headers 1213 url-http-extra-headers
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el
index 9655ce64a99..fd24558da6a 100644
--- a/lisp/vc/diff.el
+++ b/lisp/vc/diff.el
@@ -76,10 +76,10 @@ delete the temporary files so named."
76;;;###autoload 76;;;###autoload
77(defun diff (old new &optional switches no-async) 77(defun diff (old new &optional switches no-async)
78 "Find and display the differences between OLD and NEW files. 78 "Find and display the differences between OLD and NEW files.
79When called interactively, read OLD and NEW using the minibuffer; 79When called interactively, read NEW, then OLD, using the
80the default for NEW is the current buffer's file name, and the 80minibuffer. The default for NEW is the current buffer's file
81default for OLD is a backup file for NEW, if one exists. 81name, and the default for OLD is a backup file for NEW, if one
82If NO-ASYNC is non-nil, call diff synchronously. 82exists. If NO-ASYNC is non-nil, call diff synchronously.
83 83
84When called interactively with a prefix argument, prompt 84When called interactively with a prefix argument, prompt
85interactively for diff switches. Otherwise, the switches 85interactively for diff switches. Otherwise, the switches
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 40ffea624fb..df6a7e938af 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -4144,15 +4144,9 @@ Mail anyway? (y or n) ")
4144 4144
4145;; calculate time used by command 4145;; calculate time used by command
4146(defun ediff-calc-command-time () 4146(defun ediff-calc-command-time ()
4147 (let ((end (current-time)) 4147 (or (equal ediff-command-begin-time '(0 0 0))
4148 micro sec) 4148 (message "Elapsed time: %g second(s)"
4149 (setq micro 4149 (float-time (time-since ediff-command-begin-time)))))
4150 (if (>= (nth 2 end) (nth 2 ediff-command-begin-time))
4151 (- (nth 2 end) (nth 2 ediff-command-begin-time))
4152 (+ (nth 2 end) (- 1000000 (nth 2 ediff-command-begin-time)))))
4153 (setq sec (- (nth 1 end) (nth 1 ediff-command-begin-time)))
4154 (or (equal ediff-command-begin-time '(0 0 0))
4155 (message "Elapsed time: %d second(s) + %d microsecond(s)" sec micro))))
4156 4150
4157(defsubst ediff-save-time () 4151(defsubst ediff-save-time ()
4158 (setq ediff-command-begin-time (current-time))) 4152 (setq ediff-command-begin-time (current-time)))
diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el
index 5e352493dc9..464fdc0a589 100644
--- a/lisp/vc/ediff.el
+++ b/lisp/vc/ediff.el
@@ -1348,7 +1348,7 @@ buffer."
1348 1348
1349;;;###autoload 1349;;;###autoload
1350(defun ediff-patch-file (&optional arg patch-buf) 1350(defun ediff-patch-file (&optional arg patch-buf)
1351 "Run Ediff by patching SOURCE-FILENAME. 1351 "Query for a file name, and then run Ediff by patching that file.
1352If optional PATCH-BUF is given, use the patch in that buffer 1352If optional PATCH-BUF is given, use the patch in that buffer
1353and don't ask the user. 1353and don't ask the user.
1354If prefix argument, then: if even argument, assume that the patch is in a 1354If prefix argument, then: if even argument, assume that the patch is in a
diff --git a/lisp/vc/vc-arch.el b/lisp/vc/vc-arch.el
index 59cefe047b6..eeac55ac0f8 100644
--- a/lisp/vc/vc-arch.el
+++ b/lisp/vc/vc-arch.el
@@ -39,7 +39,7 @@
39 39
40;; Bugs: 40;; Bugs:
41 41
42;; - *VC-log*'s initial content lacks the `Summary:' lines. 42;; - *vc-log*'s initial content lacks the `Summary:' lines.
43;; - All files under the tree are considered as "under Arch's control" 43;; - All files under the tree are considered as "under Arch's control"
44;; without regards to =tagging-method and such. 44;; without regards to =tagging-method and such.
45;; - Files are always considered as `edited'. 45;; - Files are always considered as `edited'.
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index fa59b7ef19c..4eff3244cdc 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -1172,8 +1172,9 @@ stream. Standard error output is discarded."
1172 1172
1173(eval-and-compile 1173(eval-and-compile
1174 (defconst vc-bzr-revision-keywords 1174 (defconst vc-bzr-revision-keywords
1175 '("revno" "revid" "last" "before" 1175 ;; bzr help revisionspec | sed -ne 's/^\([a-z]*\):$/"\1"/p' | sort -u
1176 "tag" "date" "ancestor" "branch" "submit"))) 1176 '("ancestor" "annotate" "before" "branch" "date" "last" "mainline" "revid"
1177 "revno" "submit" "tag")))
1177 1178
1178(defun vc-bzr-revision-completion-table (files) 1179(defun vc-bzr-revision-completion-table (files)
1179 (lexical-let ((files files)) 1180 (lexical-let ((files files))
@@ -1211,6 +1212,19 @@ stream. Standard error output is discarded."
1211 (push (match-string-no-properties 1) table))) 1212 (push (match-string-no-properties 1) table)))
1212 (completion-table-with-context prefix table tag pred action))) 1213 (completion-table-with-context prefix table tag pred action)))
1213 1214
1215 ((string-match "\\`annotate:" string)
1216 (completion-table-with-context
1217 (substring string 0 (match-end 0))
1218 (apply-partially #'completion-table-with-terminator '(":" . "\\`a\\`")
1219 #'completion-file-name-table)
1220 (substring string (match-end 0)) pred action))
1221
1222 ((string-match "\\`date:" string)
1223 (completion-table-with-context
1224 (substring string 0 (match-end 0))
1225 '("yesterday" "today" "tomorrow")
1226 (substring string (match-end 0)) pred action))
1227
1214 ((string-match "\\`\\([a-z]+\\):" string) 1228 ((string-match "\\`\\([a-z]+\\):" string)
1215 ;; no actual completion for the remaining keywords. 1229 ;; no actual completion for the remaining keywords.
1216 (completion-table-with-context (substring string 0 (match-end 0)) 1230 (completion-table-with-context (substring string 0 (match-end 0))
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 5ec4c3998d8..6704a43e59b 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -620,7 +620,7 @@
620;; buffer, if one is present, instead of adding to the ChangeLog. 620;; buffer, if one is present, instead of adding to the ChangeLog.
621;; 621;;
622;; - When vc-next-action calls vc-checkin it could pre-fill the 622;; - When vc-next-action calls vc-checkin it could pre-fill the
623;; *VC-log* buffer with some obvious items: the list of files that 623;; *vc-log* buffer with some obvious items: the list of files that
624;; were added, the list of files that were removed. If the diff is 624;; were added, the list of files that were removed. If the diff is
625;; available, maybe it could even call something like 625;; available, maybe it could even call something like
626;; `diff-add-change-log-entries-other-window' to create a detailed 626;; `diff-add-change-log-entries-other-window' to create a detailed
@@ -1414,7 +1414,7 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
1414 (vc-start-logentry 1414 (vc-start-logentry
1415 files comment initial-contents 1415 files comment initial-contents
1416 "Enter a change comment." 1416 "Enter a change comment."
1417 "*VC-log*" 1417 "*vc-log*"
1418 (lambda () 1418 (lambda ()
1419 (vc-call-backend backend 'log-edit-mode)) 1419 (vc-call-backend backend 'log-edit-mode))
1420 (lexical-let ((rev rev)) 1420 (lexical-let ((rev rev))
@@ -1605,10 +1605,13 @@ Return t if the buffer had changes, nil otherwise."
1605 ;; bindings are nicer for read only buffers. pcl-cvs does the 1605 ;; bindings are nicer for read only buffers. pcl-cvs does the
1606 ;; same thing. 1606 ;; same thing.
1607 (setq buffer-read-only t) 1607 (setq buffer-read-only t)
1608 (vc-exec-after `(vc-diff-finish ,(current-buffer) ',(when verbose
1609 messages)))
1610 ;; Display the buffer, but at the end because it can change point. 1608 ;; Display the buffer, but at the end because it can change point.
1611 (pop-to-buffer (current-buffer)) 1609 (pop-to-buffer (current-buffer))
1610 ;; The diff process may finish early, so call `vc-diff-finish'
1611 ;; after `pop-to-buffer'; the former assumes the diff buffer is
1612 ;; shown in some window.
1613 (vc-exec-after `(vc-diff-finish ,(current-buffer)
1614 ',(when verbose messages)))
1612 ;; In the async case, we return t even if there are no differences 1615 ;; In the async case, we return t even if there are no differences
1613 ;; because we don't know that yet. 1616 ;; because we don't know that yet.
1614 t))) 1617 t)))
@@ -1876,7 +1879,7 @@ The headers are reset to their non-expanded form."
1876 (vc-start-logentry 1879 (vc-start-logentry
1877 files oldcomment t 1880 files oldcomment t
1878 "Enter a replacement change comment." 1881 "Enter a replacement change comment."
1879 "*VC-log*" 1882 "*vc-log*"
1880 (lambda () (vc-call-backend backend 'log-edit-mode)) 1883 (lambda () (vc-call-backend backend 'log-edit-mode))
1881 (lexical-let ((rev rev)) 1884 (lexical-let ((rev rev))
1882 (lambda (files comment) 1885 (lambda (files comment)
@@ -2425,7 +2428,7 @@ its name; otherwise return nil."
2425 (list file) 2428 (list file)
2426 (let ((backup-file (vc-version-backup-file file))) 2429 (let ((backup-file (vc-version-backup-file file)))
2427 (when backup-file 2430 (when backup-file
2428 (copy-file backup-file file 'ok-if-already-exists 'keep-date) 2431 (copy-file backup-file file 'ok-if-already-exists)
2429 (vc-delete-automatic-version-backups file)) 2432 (vc-delete-automatic-version-backups file))
2430 (vc-call revert file backup-file)) 2433 (vc-call revert file backup-file))
2431 `((vc-state . up-to-date) 2434 `((vc-state . up-to-date)
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el
index a002a63e3f8..cb21d4b08c0 100644
--- a/lisp/w32-fns.el
+++ b/lisp/w32-fns.el
@@ -335,6 +335,8 @@ This function is provided for backward compatibility, since
335(global-set-key [lwindow] 'ignore) 335(global-set-key [lwindow] 'ignore)
336(global-set-key [rwindow] 'ignore) 336(global-set-key [rwindow] 'ignore)
337 337
338(defvar w32-charset-info-alist) ; w32font.c
339
338(defun w32-add-charset-info (xlfd-charset windows-charset codepage) 340(defun w32-add-charset-info (xlfd-charset windows-charset codepage)
339 "Function to add character sets to display with Windows fonts. 341 "Function to add character sets to display with Windows fonts.
340Creates entries in `w32-charset-info-alist'. 342Creates entries in `w32-charset-info-alist'.
diff --git a/lisp/window.el b/lisp/window.el
index 161dbb33646..0302a672521 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -106,8 +106,7 @@ be any window."
106 (or (window-buffer object) (window-child object)) 106 (or (window-buffer object) (window-child object))
107 t)) 107 t))
108 108
109;; The following four functions should probably go to subr.el. 109(defsubst window-normalize-buffer (buffer-or-name)
110(defsubst normalize-live-buffer (buffer-or-name)
111 "Return buffer specified by BUFFER-OR-NAME. 110 "Return buffer specified by BUFFER-OR-NAME.
112BUFFER-OR-NAME must be either a buffer or a string naming a live 111BUFFER-OR-NAME must be either a buffer or a string naming a live
113buffer and defaults to the current buffer." 112buffer and defaults to the current buffer."
@@ -122,7 +121,7 @@ buffer and defaults to the current buffer."
122 (t 121 (t
123 (error "No such buffer %s" buffer-or-name)))) 122 (error "No such buffer %s" buffer-or-name))))
124 123
125(defsubst normalize-live-frame (frame) 124(defsubst window-normalize-frame (frame)
126 "Return frame specified by FRAME. 125 "Return frame specified by FRAME.
127FRAME must be a live frame and defaults to the selected frame." 126FRAME must be a live frame and defaults to the selected frame."
128 (if frame 127 (if frame
@@ -131,7 +130,7 @@ FRAME must be a live frame and defaults to the selected frame."
131 (error "%s is not a live frame" frame)) 130 (error "%s is not a live frame" frame))
132 (selected-frame))) 131 (selected-frame)))
133 132
134(defsubst normalize-any-window (window) 133(defsubst window-normalize-any-window (window)
135 "Return window specified by WINDOW. 134 "Return window specified by WINDOW.
136WINDOW must be a window that has not been deleted and defaults to 135WINDOW must be a window that has not been deleted and defaults to
137the selected window." 136the selected window."
@@ -141,7 +140,7 @@ the selected window."
141 (error "%s is not a window" window)) 140 (error "%s is not a window" window))
142 (selected-window))) 141 (selected-window)))
143 142
144(defsubst normalize-live-window (window) 143(defsubst window-normalize-live-window (window)
145 "Return live window specified by WINDOW. 144 "Return live window specified by WINDOW.
146WINDOW must be a live window and defaults to the selected one." 145WINDOW must be a live window and defaults to the selected one."
147 (if window 146 (if window
@@ -164,8 +163,8 @@ Anything less might crash Emacs.")
164 163
165(defcustom window-min-height 4 164(defcustom window-min-height 4
166 "The minimum number of lines of any window. 165 "The minimum number of lines of any window.
167The value has to accomodate a mode- or header-line if present. A 166The value has to accommodate a mode- or header-line if present.
168value less than `window-safe-min-height' is ignored. The value 167A value less than `window-safe-min-height' is ignored. The value
169of this variable is honored when windows are resized or split. 168of this variable is honored when windows are resized or split.
170 169
171Applications should never rebind this variable. To resize a 170Applications should never rebind this variable. To resize a
@@ -202,7 +201,7 @@ narrower, explictly specify the SIZE argument of that function."
202WINDOW can be any window and defaults to the selected one. 201WINDOW can be any window and defaults to the selected one.
203Optional argument HORIZONTAL non-nil means return WINDOW's first 202Optional argument HORIZONTAL non-nil means return WINDOW's first
204child if WINDOW is a horizontal combination." 203child if WINDOW is a horizontal combination."
205 (setq window (normalize-any-window window)) 204 (setq window (window-normalize-any-window window))
206 (if horizontal 205 (if horizontal
207 (window-left-child window) 206 (window-left-child window)
208 (window-top-child window))) 207 (window-top-child window)))
@@ -212,7 +211,7 @@ child if WINDOW is a horizontal combination."
212WINDOW can be any window and defaults to the selected one. 211WINDOW can be any window and defaults to the selected one.
213Optional argument HORIZONTAL non-nil means return non-nil if and 212Optional argument HORIZONTAL non-nil means return non-nil if and
214only if WINDOW is horizontally combined." 213only if WINDOW is horizontally combined."
215 (setq window (normalize-any-window window)) 214 (setq window (window-normalize-any-window window))
216 (let ((parent (window-parent window))) 215 (let ((parent (window-parent window)))
217 (and parent (window-iso-combination-p parent horizontal)))) 216 (and parent (window-iso-combination-p parent horizontal))))
218 217
@@ -221,7 +220,7 @@ only if WINDOW is horizontally combined."
221WINDOW can be any window and defaults to the selected one. 220WINDOW can be any window and defaults to the selected one.
222Optional argument HORIZONTAL non-nil means to return the largest 221Optional argument HORIZONTAL non-nil means to return the largest
223number of horizontally arranged subwindows of WINDOW." 222number of horizontally arranged subwindows of WINDOW."
224 (setq window (normalize-any-window window)) 223 (setq window (window-normalize-any-window window))
225 (cond 224 (cond
226 ((window-live-p window) 225 ((window-live-p window)
227 ;; If WINDOW is live, return 1. 226 ;; If WINDOW is live, return 1.
@@ -277,7 +276,7 @@ FRAME.
277This function performs a pre-order, depth-first traversal of the 276This function performs a pre-order, depth-first traversal of the
278window tree. If PROC changes the window tree, the result is 277window tree. If PROC changes the window tree, the result is
279unpredictable." 278unpredictable."
280 (let ((walk-window-tree-frame (normalize-live-frame frame))) 279 (let ((walk-window-tree-frame (window-normalize-frame frame)))
281 (walk-window-tree-1 280 (walk-window-tree-1
282 proc (frame-root-window walk-window-tree-frame) any))) 281 proc (frame-root-window walk-window-tree-frame) any)))
283 282
@@ -290,7 +289,7 @@ on all live and internal subwindows of WINDOW.
290This function performs a pre-order, depth-first traversal of the 289This function performs a pre-order, depth-first traversal of the
291window tree rooted at WINDOW. If PROC changes that window tree, 290window tree rooted at WINDOW. If PROC changes that window tree,
292the result is unpredictable." 291the result is unpredictable."
293 (setq window (normalize-any-window window)) 292 (setq window (window-normalize-any-window window))
294 (walk-window-tree-1 proc window any t)) 293 (walk-window-tree-1 proc window any t))
295 294
296(defun windows-with-parameter (parameter &optional value frame any values) 295(defun windows-with-parameter (parameter &optional value frame any values)
@@ -336,14 +335,14 @@ too."
336 "Return root of atomic window WINDOW is a part of. 335 "Return root of atomic window WINDOW is a part of.
337WINDOW can be any window and defaults to the selected one. 336WINDOW can be any window and defaults to the selected one.
338Return nil if WINDOW is not part of a atomic window." 337Return nil if WINDOW is not part of a atomic window."
339 (setq window (normalize-any-window window)) 338 (setq window (window-normalize-any-window window))
340 (let (root) 339 (let (root)
341 (while (and window (window-parameter window 'window-atom)) 340 (while (and window (window-parameter window 'window-atom))
342 (setq root window) 341 (setq root window)
343 (setq window (window-parent window))) 342 (setq window (window-parent window)))
344 root)) 343 root))
345 344
346(defun make-window-atom (window) 345(defun window-make-atom (window)
347 "Make WINDOW an atomic window. 346 "Make WINDOW an atomic window.
348WINDOW must be an internal window. Return WINDOW." 347WINDOW must be an internal window. Return WINDOW."
349 (if (not (window-child window)) 348 (if (not (window-child window))
@@ -548,7 +547,7 @@ windows may get as small as `window-safe-min-height' lines and
548`window-safe-min-width' columns. IGNORE a window means ignore 547`window-safe-min-width' columns. IGNORE a window means ignore
549restrictions for that window only." 548restrictions for that window only."
550 (window-min-size-1 549 (window-min-size-1
551 (normalize-any-window window) horizontal ignore)) 550 (window-normalize-any-window window) horizontal ignore))
552 551
553(defun window-min-size-1 (window horizontal ignore) 552(defun window-min-size-1 (window horizontal ignore)
554 "Internal function of `window-min-size'." 553 "Internal function of `window-min-size'."
@@ -641,7 +640,7 @@ imposed by fixed size windows, `window-min-height' or
641windows may get as small as `window-safe-min-height' lines and 640windows may get as small as `window-safe-min-height' lines and
642`window-safe-min-width' columns. IGNORE any window means ignore 641`window-safe-min-width' columns. IGNORE any window means ignore
643restrictions for that window only." 642restrictions for that window only."
644 (setq window (normalize-any-window window)) 643 (setq window (window-normalize-any-window window))
645 (cond 644 (cond
646 ((< delta 0) 645 ((< delta 0)
647 (max (- (window-min-size window horizontal ignore) 646 (max (- (window-min-size window horizontal ignore)
@@ -659,7 +658,7 @@ restrictions for that window only."
659 "Return t if WINDOW can be resized by DELTA lines. 658 "Return t if WINDOW can be resized by DELTA lines.
660For the meaning of the arguments of this function see the 659For the meaning of the arguments of this function see the
661doc-string of `window-sizable'." 660doc-string of `window-sizable'."
662 (setq window (normalize-any-window window)) 661 (setq window (window-normalize-any-window window))
663 (if (> delta 0) 662 (if (> delta 0)
664 (>= (window-sizable window delta horizontal ignore) delta) 663 (>= (window-sizable window delta horizontal ignore) delta)
665 (<= (window-sizable window delta horizontal ignore) delta))) 664 (<= (window-sizable window delta horizontal ignore) delta)))
@@ -707,7 +706,7 @@ If this function returns nil, this does not necessarily mean that
707WINDOW can be resized in the desired direction. The functions 706WINDOW can be resized in the desired direction. The functions
708`window-resizable' and `window-resizable-p' will tell that." 707`window-resizable' and `window-resizable-p' will tell that."
709 (window-size-fixed-1 708 (window-size-fixed-1
710 (normalize-any-window window) horizontal)) 709 (window-normalize-any-window window) horizontal))
711 710
712(defun window-min-delta-1 (window delta &optional horizontal ignore trail noup) 711(defun window-min-delta-1 (window delta &optional horizontal ignore trail noup)
713 "Internal function for `window-min-delta'." 712 "Internal function for `window-min-delta'."
@@ -773,7 +772,7 @@ tree but try to enlarge windows within WINDOW's combination only.
773Optional argument NODOWN non-nil means don't check whether WINDOW 772Optional argument NODOWN non-nil means don't check whether WINDOW
774itself \(and its subwindows) can be shrunk; check only whether at 773itself \(and its subwindows) can be shrunk; check only whether at
775least one other windows can be enlarged appropriately." 774least one other windows can be enlarged appropriately."
776 (setq window (normalize-any-window window)) 775 (setq window (window-normalize-any-window window))
777 (let ((size (window-total-size window horizontal)) 776 (let ((size (window-total-size window horizontal))
778 (minimum (window-min-size window horizontal ignore))) 777 (minimum (window-min-size window horizontal ignore)))
779 (cond 778 (cond
@@ -855,7 +854,7 @@ WINDOW's combination.
855Optional argument NODOWN non-nil means do not check whether 854Optional argument NODOWN non-nil means do not check whether
856WINDOW itself \(and its subwindows) can be enlarged; check only 855WINDOW itself \(and its subwindows) can be enlarged; check only
857whether other windows can be shrunk appropriately." 856whether other windows can be shrunk appropriately."
858 (setq window (normalize-any-window window)) 857 (setq window (window-normalize-any-window window))
859 (if (and (not (window-size-ignore window ignore)) 858 (if (and (not (window-size-ignore window ignore))
860 (not nodown) (window-size-fixed-p window horizontal)) 859 (not nodown) (window-size-fixed-p window horizontal))
861 ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed 860 ;; With IGNORE and NOWDON nil return zero if WINDOW has fixed
@@ -899,7 +898,7 @@ within WINDOW's combination.
899 898
900Optional argument NODOWN non-nil means don't check whether WINDOW 899Optional argument NODOWN non-nil means don't check whether WINDOW
901and its subwindows can be resized." 900and its subwindows can be resized."
902 (setq window (normalize-any-window window)) 901 (setq window (window-normalize-any-window window))
903 (cond 902 (cond
904 ((< delta 0) 903 ((< delta 0)
905 (max (- (window-min-delta window horizontal ignore trail noup nodown)) 904 (max (- (window-min-delta window horizontal ignore trail noup nodown))
@@ -913,7 +912,7 @@ and its subwindows can be resized."
913 "Return t if WINDOW can be resized vertically by DELTA lines. 912 "Return t if WINDOW can be resized vertically by DELTA lines.
914For the meaning of the arguments of this function see the 913For the meaning of the arguments of this function see the
915doc-string of `window-resizable'." 914doc-string of `window-resizable'."
916 (setq window (normalize-any-window window)) 915 (setq window (window-normalize-any-window window))
917 (if (> delta 0) 916 (if (> delta 0)
918 (>= (window-resizable window delta horizontal ignore trail noup nodown) 917 (>= (window-resizable window delta horizontal ignore trail noup nodown)
919 delta) 918 delta)
@@ -942,7 +941,7 @@ More precisely, return t if and only if the total height of
942WINDOW equals the total height of the root window of WINDOW's 941WINDOW equals the total height of the root window of WINDOW's
943frame. WINDOW can be any window and defaults to the selected 942frame. WINDOW can be any window and defaults to the selected
944one." 943one."
945 (setq window (normalize-any-window window)) 944 (setq window (window-normalize-any-window window))
946 (= (window-total-size window) 945 (= (window-total-size window)
947 (window-total-size (frame-root-window window)))) 946 (window-total-size (frame-root-window window))))
948 947
@@ -961,7 +960,7 @@ otherwise."
961More precisely, return t if and only if the total width of WINDOW 960More precisely, return t if and only if the total width of WINDOW
962equals the total width of the root window of WINDOW's frame. 961equals the total width of the root window of WINDOW's frame.
963WINDOW can be any window and defaults to the selected one." 962WINDOW can be any window and defaults to the selected one."
964 (setq window (normalize-any-window window)) 963 (setq window (window-normalize-any-window window))
965 (= (window-total-size window t) 964 (= (window-total-size window t)
966 (window-total-size (frame-root-window window) t))) 965 (window-total-size (frame-root-window window) t)))
967 966
@@ -1002,7 +1001,7 @@ or nil).
1002Unlike `window-scroll-bars', this function reports the scroll bar 1001Unlike `window-scroll-bars', this function reports the scroll bar
1003type actually used, once frame defaults and `scroll-bar-mode' are 1002type actually used, once frame defaults and `scroll-bar-mode' are
1004taken into account." 1003taken into account."
1005 (setq window (normalize-live-window window)) 1004 (setq window (window-normalize-live-window window))
1006 (let ((vert (nth 2 (window-scroll-bars window))) 1005 (let ((vert (nth 2 (window-scroll-bars window)))
1007 (hor nil)) 1006 (hor nil))
1008 (when (or (eq vert t) (eq hor t)) 1007 (when (or (eq vert t) (eq hor t))
@@ -1077,7 +1076,7 @@ DIRECTION must be one of `above', `below', `left' or `right'.
1077WINDOW must be a live window and defaults to the selected one. 1076WINDOW must be a live window and defaults to the selected one.
1078IGNORE, when non-nil means a window can be returned even if its 1077IGNORE, when non-nil means a window can be returned even if its
1079`no-other-window' parameter is non-nil." 1078`no-other-window' parameter is non-nil."
1080 (setq window (normalize-live-window window)) 1079 (setq window (window-normalize-live-window window))
1081 (unless (memq direction '(above below left right)) 1080 (unless (memq direction '(above below left right))
1082 (error "Wrong direction %s" direction)) 1081 (error "Wrong direction %s" direction))
1083 (let* ((frame (window-frame window)) 1082 (let* ((frame (window-frame window))
@@ -1334,7 +1333,7 @@ non-nil values of ALL-FRAMES have special meanings:
1334 1333
1335Anything else means consider all windows on the selected frame 1334Anything else means consider all windows on the selected frame
1336and no others." 1335and no others."
1337 (let ((buffer (normalize-live-buffer buffer-or-name)) 1336 (let ((buffer (window-normalize-buffer buffer-or-name))
1338 windows) 1337 windows)
1339 (dolist (window (window-list-1 (selected-window) minibuf all-frames)) 1338 (dolist (window (window-list-1 (selected-window) minibuf all-frames))
1340 (when (eq (window-buffer window) buffer) 1339 (when (eq (window-buffer window) buffer)
@@ -1353,7 +1352,7 @@ meaning of this argument."
1353 (length (window-list-1 nil minibuf))) 1352 (length (window-list-1 nil minibuf)))
1354 1353
1355;;; Resizing windows. 1354;;; Resizing windows.
1356(defun window-resize-reset (&optional frame horizontal) 1355(defun window--resize-reset (&optional frame horizontal)
1357 "Reset resize values for all windows on FRAME. 1356 "Reset resize values for all windows on FRAME.
1358FRAME defaults to the selected frame. 1357FRAME defaults to the selected frame.
1359 1358
@@ -1361,23 +1360,23 @@ This function stores the current value of `window-total-size' applied
1361with argument HORIZONTAL in the new total size of all windows on 1360with argument HORIZONTAL in the new total size of all windows on
1362FRAME. It also resets the new normal size of each of these 1361FRAME. It also resets the new normal size of each of these
1363windows." 1362windows."
1364 (window-resize-reset-1 1363 (window--resize-reset-1
1365 (frame-root-window (normalize-live-frame frame)) horizontal)) 1364 (frame-root-window (window-normalize-frame frame)) horizontal))
1366 1365
1367(defun window-resize-reset-1 (window horizontal) 1366(defun window--resize-reset-1 (window horizontal)
1368 "Internal function of `window-resize-reset'." 1367 "Internal function of `window--resize-reset'."
1369 ;; Register old size in the new total size. 1368 ;; Register old size in the new total size.
1370 (set-window-new-total window (window-total-size window horizontal)) 1369 (set-window-new-total window (window-total-size window horizontal))
1371 ;; Reset new normal size. 1370 ;; Reset new normal size.
1372 (set-window-new-normal window) 1371 (set-window-new-normal window)
1373 (when (window-child window) 1372 (when (window-child window)
1374 (window-resize-reset-1 (window-child window) horizontal)) 1373 (window--resize-reset-1 (window-child window) horizontal))
1375 (when (window-right window) 1374 (when (window-right window)
1376 (window-resize-reset-1 (window-right window) horizontal))) 1375 (window--resize-reset-1 (window-right window) horizontal)))
1377 1376
1378;; The following routine is used to manually resize the minibuffer 1377;; The following routine is used to manually resize the minibuffer
1379;; window and is currently used, for example, by ispell.el. 1378;; window and is currently used, for example, by ispell.el.
1380(defun resize-mini-window (window delta) 1379(defun window--resize-mini-window (window delta)
1381 "Resize minibuffer window WINDOW by DELTA lines. 1380 "Resize minibuffer window WINDOW by DELTA lines.
1382If WINDOW cannot be resized by DELTA lines make it as large \(or 1381If WINDOW cannot be resized by DELTA lines make it as large \(or
1383as small) as possible but don't signal an error." 1382as small) as possible but don't signal an error."
@@ -1396,11 +1395,11 @@ as small) as possible but don't signal an error."
1396 (setq delta min-delta))) 1395 (setq delta min-delta)))
1397 1396
1398 ;; Resize now. 1397 ;; Resize now.
1399 (window-resize-reset frame) 1398 (window--resize-reset frame)
1400 ;; Ideally we should be able to resize just the last subwindow of 1399 ;; Ideally we should be able to resize just the last subwindow of
1401 ;; root here. See the comment in `resize-root-window-vertically' 1400 ;; root here. See the comment in `resize-root-window-vertically'
1402 ;; for why we do not do that. 1401 ;; for why we do not do that.
1403 (resize-this-window root (- delta) nil nil t) 1402 (window--resize-this-window root (- delta) nil nil t)
1404 (set-window-new-total window (+ height delta)) 1403 (set-window-new-total window (+ height delta))
1405 ;; The following routine catches the case where we want to resize 1404 ;; The following routine catches the case where we want to resize
1406 ;; a minibuffer-only frame. 1405 ;; a minibuffer-only frame.
@@ -1432,17 +1431,17 @@ This function resizes other windows proportionally and never
1432deletes any windows. If you want to move only the low (right) 1431deletes any windows. If you want to move only the low (right)
1433edge of WINDOW consider using `adjust-window-trailing-edge' 1432edge of WINDOW consider using `adjust-window-trailing-edge'
1434instead." 1433instead."
1435 (setq window (normalize-any-window window)) 1434 (setq window (window-normalize-any-window window))
1436 (let* ((frame (window-frame window)) 1435 (let* ((frame (window-frame window))
1437 sibling) 1436 sibling)
1438 (cond 1437 (cond
1439 ((eq window (frame-root-window frame)) 1438 ((eq window (frame-root-window frame))
1440 (error "Cannot resize the root window of a frame")) 1439 (error "Cannot resize the root window of a frame"))
1441 ((window-minibuffer-p window) 1440 ((window-minibuffer-p window)
1442 (resize-mini-window window delta)) 1441 (window--resize-mini-window window delta))
1443 ((window-resizable-p window delta horizontal ignore) 1442 ((window-resizable-p window delta horizontal ignore)
1444 (window-resize-reset frame horizontal) 1443 (window--resize-reset frame horizontal)
1445 (resize-this-window window delta horizontal ignore t) 1444 (window--resize-this-window window delta horizontal ignore t)
1446 (if (and (not (window-splits window)) 1445 (if (and (not (window-splits window))
1447 (window-iso-combined-p window horizontal) 1446 (window-iso-combined-p window horizontal)
1448 (setq sibling (or (window-right window) (window-left window))) 1447 (setq sibling (or (window-right window) (window-left window)))
@@ -1453,7 +1452,7 @@ instead."
1453 (let ((normal-delta 1452 (let ((normal-delta
1454 (/ (float delta) 1453 (/ (float delta)
1455 (window-total-size (window-parent window) horizontal)))) 1454 (window-total-size (window-parent window) horizontal))))
1456 (resize-this-window sibling (- delta) horizontal nil t) 1455 (window--resize-this-window sibling (- delta) horizontal nil t)
1457 (set-window-new-normal 1456 (set-window-new-normal
1458 window (+ (window-normal-size window horizontal) 1457 window (+ (window-normal-size window horizontal)
1459 normal-delta)) 1458 normal-delta))
@@ -1461,16 +1460,16 @@ instead."
1461 sibling (- (window-normal-size sibling horizontal) 1460 sibling (- (window-normal-size sibling horizontal)
1462 normal-delta))) 1461 normal-delta)))
1463 ;; Otherwise, resize all other windows in the same combination. 1462 ;; Otherwise, resize all other windows in the same combination.
1464 (resize-other-windows window delta horizontal ignore)) 1463 (window--resize-siblings window delta horizontal ignore))
1465 (window-resize-apply frame horizontal)) 1464 (window-resize-apply frame horizontal))
1466 (t 1465 (t
1467 (error "Cannot resize window %s" window))))) 1466 (error "Cannot resize window %s" window)))))
1468 1467
1469(defsubst resize-subwindows-skip-p (window) 1468(defsubst window--resize-subwindows-skip-p (window)
1470 "Return non-nil if WINDOW shall be skipped by resizing routines." 1469 "Return non-nil if WINDOW shall be skipped by resizing routines."
1471 (memq (window-new-normal window) '(ignore stuck skip))) 1470 (memq (window-new-normal window) '(ignore stuck skip)))
1472 1471
1473(defun resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta) 1472(defun window--resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta)
1474 "Set the new normal height of subwindows of window PARENT. 1473 "Set the new normal height of subwindows of window PARENT.
1475HORIZONTAL non-nil means set the new normal width of these 1474HORIZONTAL non-nil means set the new normal width of these
1476windows. WINDOW specifies a subwindow of PARENT that has been 1475windows. WINDOW specifies a subwindow of PARENT that has been
@@ -1567,7 +1566,7 @@ PARENT in order to resize WINDOW."
1567 ;; Don't get larger than 1 or smaller than 0. 1566 ;; Don't get larger than 1 or smaller than 0.
1568 (min 1.0 (max (- 1.0 sum) 0.0)))))) 1567 (min 1.0 (max (- 1.0 sum) 0.0))))))
1569 1568
1570(defun resize-subwindows (parent delta &optional horizontal window ignore trail edge) 1569(defun window--resize-subwindows (parent delta &optional horizontal window ignore trail edge)
1571 "Resize subwindows of window PARENT vertically by DELTA lines. 1570 "Resize subwindows of window PARENT vertically by DELTA lines.
1572PARENT must be a vertically combined internal window. 1571PARENT must be a vertically combined internal window.
1573 1572
@@ -1603,10 +1602,10 @@ already set by this routine."
1603 (setq sub first) 1602 (setq sub first)
1604 (while (and (window-right sub) 1603 (while (and (window-right sub)
1605 (or (and (eq trail 'before) 1604 (or (and (eq trail 'before)
1606 (not (resize-subwindows-skip-p 1605 (not (window--resize-subwindows-skip-p
1607 (window-right sub)))) 1606 (window-right sub))))
1608 (and (eq trail 'after) 1607 (and (eq trail 'after)
1609 (resize-subwindows-skip-p sub)))) 1608 (window--resize-subwindows-skip-p sub))))
1610 (setq sub (window-right sub))) 1609 (setq sub (window-right sub)))
1611 sub) 1610 sub)
1612 (if horizontal 1611 (if horizontal
@@ -1623,7 +1622,8 @@ already set by this routine."
1623 (window-sizable-p sub delta horizontal ignore)) 1622 (window-sizable-p sub delta horizontal ignore))
1624 ;; Resize only windows adjacent to EDGE. 1623 ;; Resize only windows adjacent to EDGE.
1625 (progn 1624 (progn
1626 (resize-this-window sub delta horizontal ignore t trail edge) 1625 (window--resize-this-window
1626 sub delta horizontal ignore t trail edge)
1627 (if (and window (eq (window-parent sub) parent)) 1627 (if (and window (eq (window-parent sub) parent))
1628 (progn 1628 (progn
1629 ;; Assign new normal sizes. 1629 ;; Assign new normal sizes.
@@ -1633,15 +1633,16 @@ already set by this routine."
1633 window (- (window-normal-size window horizontal) 1633 window (- (window-normal-size window horizontal)
1634 (- (window-new-normal sub) 1634 (- (window-new-normal sub)
1635 (window-normal-size sub horizontal))))) 1635 (window-normal-size sub horizontal)))))
1636 (resize-subwindows-normal parent horizontal sub 0 trail delta)) 1636 (window--resize-subwindows-normal
1637 ;; Return 'normalized to notify `resize-other-windows' that 1637 parent horizontal sub 0 trail delta))
1638 ;; Return 'normalized to notify `window--resize-siblings' that
1638 ;; normal sizes have been already set. 1639 ;; normal sizes have been already set.
1639 'normalized) 1640 'normalized)
1640 ;; Resize all windows proportionally. 1641 ;; Resize all windows proportionally.
1641 (setq sub first) 1642 (setq sub first)
1642 (while sub 1643 (while sub
1643 (cond 1644 (cond
1644 ((or (resize-subwindows-skip-p sub) 1645 ((or (window--resize-subwindows-skip-p sub)
1645 ;; Ignore windows to skip and fixed-size subwindows - in 1646 ;; Ignore windows to skip and fixed-size subwindows - in
1646 ;; the latter case make it a window to skip. 1647 ;; the latter case make it a window to skip.
1647 (and (not ignore) 1648 (and (not ignore)
@@ -1738,11 +1739,11 @@ already set by this routine."
1738 (unless (and (zerop delta) (not trail)) 1739 (unless (and (zerop delta) (not trail))
1739 ;; For the TRAIL non-nil case we have to resize SUB 1740 ;; For the TRAIL non-nil case we have to resize SUB
1740 ;; recursively even if it's size does not change. 1741 ;; recursively even if it's size does not change.
1741 (resize-this-window 1742 (window--resize-this-window
1742 sub delta horizontal ignore nil trail edge)))) 1743 sub delta horizontal ignore nil trail edge))))
1743 (setq sub (window-right sub))))))) 1744 (setq sub (window-right sub)))))))
1744 1745
1745(defun resize-other-windows (window delta &optional horizontal ignore trail edge) 1746(defun window--resize-siblings (window delta &optional horizontal ignore trail edge)
1746 "Resize other windows when WINDOW is resized vertically by DELTA lines. 1747 "Resize other windows when WINDOW is resized vertically by DELTA lines.
1747Optional argument HORIZONTAL non-nil means resize other windows 1748Optional argument HORIZONTAL non-nil means resize other windows
1748when WINDOW is resized horizontally by DELTA columns. WINDOW 1749when WINDOW is resized horizontally by DELTA columns. WINDOW
@@ -1814,17 +1815,19 @@ preferably only resize windows adjacent to EDGE."
1814 (if (zerop this-delta) 1815 (if (zerop this-delta)
1815 ;; We haven't got anything from WINDOW's siblings but we 1816 ;; We haven't got anything from WINDOW's siblings but we
1816 ;; must update the normal sizes to respect other-delta. 1817 ;; must update the normal sizes to respect other-delta.
1817 (resize-subwindows-normal 1818 (window--resize-subwindows-normal
1818 parent horizontal window this-delta trail other-delta) 1819 parent horizontal window this-delta trail other-delta)
1819 ;; We did get something from WINDOW's siblings which means 1820 ;; We did get something from WINDOW's siblings which means
1820 ;; we have to resize their subwindows. 1821 ;; we have to resize their subwindows.
1821 (unless (eq (resize-subwindows parent (- this-delta) horizontal 1822 (unless (eq (window--resize-subwindows
1822 window ignore trail edge) 1823 parent (- this-delta) horizontal
1823 ;; `resize-subwindows' returning 'normalized, 1824 window ignore trail edge)
1824 ;; means it has set the normal sizes already. 1825 ;; If `window--resize-subwindows' returns
1826 ;; 'normalized, this means it has set the
1827 ;; normal sizes already.
1825 'normalized) 1828 'normalized)
1826 ;; Set the normal sizes. 1829 ;; Set the normal sizes.
1827 (resize-subwindows-normal 1830 (window--resize-subwindows-normal
1828 parent horizontal window this-delta trail other-delta)) 1831 parent horizontal window this-delta trail other-delta))
1829 ;; Set DELTA to what we still have to get from ancestor 1832 ;; Set DELTA to what we still have to get from ancestor
1830 ;; windows. 1833 ;; windows.
@@ -1835,14 +1838,15 @@ preferably only resize windows adjacent to EDGE."
1835 (set-window-new-total parent delta 'add) 1838 (set-window-new-total parent delta 'add)
1836 (while sub 1839 (while sub
1837 (unless (eq sub window) 1840 (unless (eq sub window)
1838 (resize-this-window sub delta horizontal ignore t)) 1841 (window--resize-this-window sub delta horizontal ignore t))
1839 (setq sub (window-right sub)))) 1842 (setq sub (window-right sub))))
1840 1843
1841 (unless (zerop delta) 1844 (unless (zerop delta)
1842 ;; "Go up." 1845 ;; "Go up."
1843 (resize-other-windows parent delta horizontal ignore trail edge))))) 1846 (window--resize-siblings
1847 parent delta horizontal ignore trail edge)))))
1844 1848
1845(defun resize-this-window (window delta &optional horizontal ignore add trail edge) 1849(defun window--resize-this-window (window delta &optional horizontal ignore add trail edge)
1846 "Resize WINDOW vertically by DELTA lines. 1850 "Resize WINDOW vertically by DELTA lines.
1847Optional argument HORIZONTAL non-nil means resize WINDOW 1851Optional argument HORIZONTAL non-nil means resize WINDOW
1848horizontally by DELTA columns. 1852horizontally by DELTA columns.
@@ -1879,14 +1883,16 @@ actually take effect."
1879 ((window-iso-combined-p sub horizontal) 1883 ((window-iso-combined-p sub horizontal)
1880 ;; In an iso-combination resize subwindows according to their 1884 ;; In an iso-combination resize subwindows according to their
1881 ;; normal sizes. 1885 ;; normal sizes.
1882 (resize-subwindows window delta horizontal nil ignore trail edge)) 1886 (window--resize-subwindows
1887 window delta horizontal nil ignore trail edge))
1883 ;; In an ortho-combination resize each subwindow by DELTA. 1888 ;; In an ortho-combination resize each subwindow by DELTA.
1884 (t 1889 (t
1885 (while sub 1890 (while sub
1886 (resize-this-window sub delta horizontal ignore t trail edge) 1891 (window--resize-this-window
1892 sub delta horizontal ignore t trail edge)
1887 (setq sub (window-right sub))))))) 1893 (setq sub (window-right sub)))))))
1888 1894
1889(defun resize-root-window (window delta horizontal ignore) 1895(defun window--resize-root-window (window delta horizontal ignore)
1890 "Resize root window WINDOW vertically by DELTA lines. 1896 "Resize root window WINDOW vertically by DELTA lines.
1891HORIZONTAL non-nil means resize root window WINDOW horizontally 1897HORIZONTAL non-nil means resize root window WINDOW horizontally
1892by DELTA columns. 1898by DELTA columns.
@@ -1898,10 +1904,10 @@ This function is only called by the frame resizing routines. It
1898resizes windows proportionally and never deletes any windows." 1904resizes windows proportionally and never deletes any windows."
1899 (when (and (windowp window) (numberp delta) 1905 (when (and (windowp window) (numberp delta)
1900 (window-sizable-p window delta horizontal ignore)) 1906 (window-sizable-p window delta horizontal ignore))
1901 (window-resize-reset (window-frame window) horizontal) 1907 (window--resize-reset (window-frame window) horizontal)
1902 (resize-this-window window delta horizontal ignore t))) 1908 (window--resize-this-window window delta horizontal ignore t)))
1903 1909
1904(defun resize-root-window-vertically (window delta) 1910(defun window--resize-root-window-vertically (window delta)
1905 "Resize root window WINDOW vertically by DELTA lines. 1911 "Resize root window WINDOW vertically by DELTA lines.
1906If DELTA is less than zero and we can't shrink WINDOW by DELTA 1912If DELTA is less than zero and we can't shrink WINDOW by DELTA
1907lines, shrink it as much as possible. If DELTA is greater than 1913lines, shrink it as much as possible. If DELTA is greater than
@@ -1922,7 +1928,7 @@ any windows."
1922 (unless (window-sizable window delta) 1928 (unless (window-sizable window delta)
1923 (setq ignore t)))) 1929 (setq ignore t))))
1924 1930
1925 (window-resize-reset (window-frame window)) 1931 (window--resize-reset (window-frame window))
1926 ;; Ideally, we would resize just the last window in a combination 1932 ;; Ideally, we would resize just the last window in a combination
1927 ;; but that's not feasible for the following reason: If we grow 1933 ;; but that's not feasible for the following reason: If we grow
1928 ;; the minibuffer window and the last window cannot be shrunk any 1934 ;; the minibuffer window and the last window cannot be shrunk any
@@ -1932,7 +1938,7 @@ any windows."
1932 ;; So, in practice, we'd need a history variable to record how to 1938 ;; So, in practice, we'd need a history variable to record how to
1933 ;; proceed. But I'm not sure how such a variable could work with 1939 ;; proceed. But I'm not sure how such a variable could work with
1934 ;; repeated minibuffer window growing steps. 1940 ;; repeated minibuffer window growing steps.
1935 (resize-this-window window delta nil ignore t) 1941 (window--resize-this-window window delta nil ignore t)
1936 delta))) 1942 delta)))
1937 1943
1938(defun adjust-window-trailing-edge (window delta &optional horizontal) 1944(defun adjust-window-trailing-edge (window delta &optional horizontal)
@@ -1944,7 +1950,7 @@ If DELTA is greater zero, then move the edge downwards or to the
1944right. If DELTA is less than zero, move the edge upwards or to 1950right. If DELTA is less than zero, move the edge upwards or to
1945the left. If the edge can't be moved by DELTA lines or columns, 1951the left. If the edge can't be moved by DELTA lines or columns,
1946move it as far as possible in the desired direction." 1952move it as far as possible in the desired direction."
1947 (setq window (normalize-any-window window)) 1953 (setq window (window-normalize-any-window window))
1948 (let ((frame (window-frame window)) 1954 (let ((frame (window-frame window))
1949 (right window) 1955 (right window)
1950 left this-delta min-delta max-delta failed) 1956 left this-delta min-delta max-delta failed)
@@ -1955,7 +1961,7 @@ move it as far as possible in the desired direction."
1955 (cond 1961 (cond
1956 ((and (not right) (not horizontal) (not resize-mini-windows) 1962 ((and (not right) (not horizontal) (not resize-mini-windows)
1957 (eq (window-frame (minibuffer-window frame)) frame)) 1963 (eq (window-frame (minibuffer-window frame)) frame))
1958 (resize-mini-window (minibuffer-window frame) (- delta))) 1964 (window--resize-mini-window (minibuffer-window frame) (- delta)))
1959 ((or (not (setq left right)) (not (setq right (window-right right)))) 1965 ((or (not (setq left right)) (not (setq right (window-right right))))
1960 (if horizontal 1966 (if horizontal
1961 (error "No window on the right of this one") 1967 (error "No window on the right of this one")
@@ -2000,17 +2006,17 @@ move it as far as possible in the desired direction."
2000 (setq delta (min max-delta (- min-delta)))) 2006 (setq delta (min max-delta (- min-delta))))
2001 (unless (zerop delta) 2007 (unless (zerop delta)
2002 ;; Start resizing. 2008 ;; Start resizing.
2003 (window-resize-reset frame horizontal) 2009 (window--resize-reset frame horizontal)
2004 ;; Try to enlarge LEFT first. 2010 ;; Try to enlarge LEFT first.
2005 (setq this-delta (window-resizable left delta horizontal)) 2011 (setq this-delta (window-resizable left delta horizontal))
2006 (unless (zerop this-delta) 2012 (unless (zerop this-delta)
2007 (resize-this-window 2013 (window--resize-this-window
2008 left this-delta horizontal nil t 'before 2014 left this-delta horizontal nil t 'before
2009 (if horizontal 2015 (if horizontal
2010 (+ (window-left-column left) (window-total-size left t)) 2016 (+ (window-left-column left) (window-total-size left t))
2011 (+ (window-top-line left) (window-total-size left))))) 2017 (+ (window-top-line left) (window-total-size left)))))
2012 ;; Shrink windows on right of LEFT. 2018 ;; Shrink windows on right of LEFT.
2013 (resize-other-windows 2019 (window--resize-siblings
2014 left delta horizontal nil 'after 2020 left delta horizontal nil 'after
2015 (if horizontal 2021 (if horizontal
2016 (window-left-column right) 2022 (window-left-column right)
@@ -2023,17 +2029,17 @@ move it as far as possible in the desired direction."
2023 (setq delta (max (- max-delta) min-delta))) 2029 (setq delta (max (- max-delta) min-delta)))
2024 (unless (zerop delta) 2030 (unless (zerop delta)
2025 ;; Start resizing. 2031 ;; Start resizing.
2026 (window-resize-reset frame horizontal) 2032 (window--resize-reset frame horizontal)
2027 ;; Try to enlarge RIGHT. 2033 ;; Try to enlarge RIGHT.
2028 (setq this-delta (window-resizable right (- delta) horizontal)) 2034 (setq this-delta (window-resizable right (- delta) horizontal))
2029 (unless (zerop this-delta) 2035 (unless (zerop this-delta)
2030 (resize-this-window 2036 (window--resize-this-window
2031 right this-delta horizontal nil t 'after 2037 right this-delta horizontal nil t 'after
2032 (if horizontal 2038 (if horizontal
2033 (window-left-column right) 2039 (window-left-column right)
2034 (window-top-line right)))) 2040 (window-top-line right))))
2035 ;; Shrink windows on left of RIGHT. 2041 ;; Shrink windows on left of RIGHT.
2036 (resize-other-windows 2042 (window--resize-siblings
2037 right (- delta) horizontal nil 'before 2043 right (- delta) horizontal nil 'before
2038 (if horizontal 2044 (if horizontal
2039 (+ (window-left-column left) (window-total-size left t)) 2045 (+ (window-left-column left) (window-total-size left t))
@@ -2091,7 +2097,7 @@ Return nil."
2091Make WINDOW as large as possible without deleting any windows. 2097Make WINDOW as large as possible without deleting any windows.
2092WINDOW can be any window and defaults to the selected window." 2098WINDOW can be any window and defaults to the selected window."
2093 (interactive) 2099 (interactive)
2094 (setq window (normalize-any-window window)) 2100 (setq window (window-normalize-any-window window))
2095 (window-resize window (window-max-delta window)) 2101 (window-resize window (window-max-delta window))
2096 (window-resize window (window-max-delta window t) t)) 2102 (window-resize window (window-max-delta window t) t))
2097 2103
@@ -2100,7 +2106,7 @@ WINDOW can be any window and defaults to the selected window."
2100Make WINDOW as small as possible without deleting any windows. 2106Make WINDOW as small as possible without deleting any windows.
2101WINDOW can be any window and defaults to the selected window." 2107WINDOW can be any window and defaults to the selected window."
2102 (interactive) 2108 (interactive)
2103 (setq window (normalize-any-window window)) 2109 (setq window (window-normalize-any-window window))
2104 (window-resize window (- (window-min-delta window))) 2110 (window-resize window (- (window-min-delta window)))
2105 (window-resize window (- (window-min-delta window t)) t)) 2111 (window-resize window (- (window-min-delta window t)) t))
2106 2112
@@ -2146,7 +2152,7 @@ and the rest of the elements are the subwindows in the split.
2146Each of the subwindows may again be a window or a list 2152Each of the subwindows may again be a window or a list
2147representing a window split, and so on. EDGES is a list \(LEFT 2153representing a window split, and so on. EDGES is a list \(LEFT
2148TOP RIGHT BOTTOM) as returned by `window-edges'." 2154TOP RIGHT BOTTOM) as returned by `window-edges'."
2149 (setq frame (normalize-live-frame frame)) 2155 (setq frame (window-normalize-frame frame))
2150 (window-tree-1 (frame-root-window frame) t)) 2156 (window-tree-1 (frame-root-window frame) t))
2151 2157
2152(defun other-window (count &optional all-frames) 2158(defun other-window (count &optional all-frames)
@@ -2278,7 +2284,7 @@ variable are `switch-to-prev-buffer', `delete-windows-on',
2278 "Return t if WINDOW can be safely deleted from its frame. 2284 "Return t if WINDOW can be safely deleted from its frame.
2279Return `frame' if deleting WINDOW should delete its frame 2285Return `frame' if deleting WINDOW should delete its frame
2280instead." 2286instead."
2281 (setq window (normalize-any-window window)) 2287 (setq window (window-normalize-any-window window))
2282 (unless ignore-window-parameters 2288 (unless ignore-window-parameters
2283 ;; Handle atomicity. 2289 ;; Handle atomicity.
2284 (when (window-parameter window 'window-atom) 2290 (when (window-parameter window 'window-atom)
@@ -2336,7 +2342,7 @@ Otherwise, if WINDOW is part of an atomic window, call
2336argument. If WINDOW is the only window on its frame or the last 2342argument. If WINDOW is the only window on its frame or the last
2337non-side window, signal an error." 2343non-side window, signal an error."
2338 (interactive) 2344 (interactive)
2339 (setq window (normalize-any-window window)) 2345 (setq window (window-normalize-any-window window))
2340 (let* ((frame (window-frame window)) 2346 (let* ((frame (window-frame window))
2341 (function (window-parameter window 'delete-window)) 2347 (function (window-parameter window 'delete-window))
2342 (parent (window-parent window)) 2348 (parent (window-parent window))
@@ -2371,21 +2377,21 @@ non-side window, signal an error."
2371 ;; Emacs 23 preferably gives WINDOW's space to its left 2377 ;; Emacs 23 preferably gives WINDOW's space to its left
2372 ;; sibling. 2378 ;; sibling.
2373 (sibling (or (window-left window) (window-right window)))) 2379 (sibling (or (window-left window) (window-right window))))
2374 (window-resize-reset frame horizontal) 2380 (window--resize-reset frame horizontal)
2375 (cond 2381 (cond
2376 ((and (not (window-splits window)) 2382 ((and (not (window-splits window))
2377 sibling (window-sizable-p sibling size)) 2383 sibling (window-sizable-p sibling size))
2378 ;; Resize WINDOW's sibling. 2384 ;; Resize WINDOW's sibling.
2379 (resize-this-window sibling size horizontal nil t) 2385 (window--resize-this-window sibling size horizontal nil t)
2380 (set-window-new-normal 2386 (set-window-new-normal
2381 sibling (+ (window-normal-size sibling horizontal) 2387 sibling (+ (window-normal-size sibling horizontal)
2382 (window-normal-size window horizontal)))) 2388 (window-normal-size window horizontal))))
2383 ((window-resizable-p window (- size) horizontal nil nil nil t) 2389 ((window-resizable-p window (- size) horizontal nil nil nil t)
2384 ;; Can do without resizing fixed-size windows. 2390 ;; Can do without resizing fixed-size windows.
2385 (resize-other-windows window (- size) horizontal)) 2391 (window--resize-siblings window (- size) horizontal))
2386 (t 2392 (t
2387 ;; Can't do without resizing fixed-size windows. 2393 ;; Can't do without resizing fixed-size windows.
2388 (resize-other-windows window (- size) horizontal t))) 2394 (window--resize-siblings window (- size) horizontal t)))
2389 ;; Actually delete WINDOW. 2395 ;; Actually delete WINDOW.
2390 (delete-window-internal window) 2396 (delete-window-internal window)
2391 (when (and frame-selected 2397 (when (and frame-selected
@@ -2417,7 +2423,7 @@ WINDOW is a non-side window, make WINDOW the only non-side window
2417on the frame. Side windows are not deleted. If WINDOW is a side 2423on the frame. Side windows are not deleted. If WINDOW is a side
2418window signal an error." 2424window signal an error."
2419 (interactive) 2425 (interactive)
2420 (setq window (normalize-any-window window)) 2426 (setq window (window-normalize-any-window window))
2421 (let* ((frame (window-frame window)) 2427 (let* ((frame (window-frame window))
2422 (function (window-parameter window 'delete-other-windows)) 2428 (function (window-parameter window 'delete-other-windows))
2423 (window-side (window-parameter window 'window-side)) 2429 (window-side (window-parameter window 'window-side))
@@ -2499,7 +2505,7 @@ This may be a useful alternative binding for \\[delete-other-windows]
2499(defun record-window-buffer (&optional window) 2505(defun record-window-buffer (&optional window)
2500 "Record WINDOW's buffer. 2506 "Record WINDOW's buffer.
2501WINDOW must be a live window and defaults to the selected one." 2507WINDOW must be a live window and defaults to the selected one."
2502 (let* ((window (normalize-live-window window)) 2508 (let* ((window (window-normalize-live-window window))
2503 (buffer (window-buffer window)) 2509 (buffer (window-buffer window))
2504 (entry (assq buffer (window-prev-buffers window)))) 2510 (entry (assq buffer (window-prev-buffers window))))
2505 ;; Reset WINDOW's next buffers. If needed, they are resurrected by 2511 ;; Reset WINDOW's next buffers. If needed, they are resurrected by
@@ -2535,7 +2541,7 @@ WINDOW must be a live window and defaults to the selected one."
2535WINDOW must be a live window and defaults to the selected one. 2541WINDOW must be a live window and defaults to the selected one.
2536BUFFER must be a live buffer and defaults to the buffer of 2542BUFFER must be a live buffer and defaults to the buffer of
2537WINDOW." 2543WINDOW."
2538 (let* ((window (normalize-live-window window)) 2544 (let* ((window (window-normalize-live-window window))
2539 (buffer (or buffer (window-buffer window)))) 2545 (buffer (or buffer (window-buffer window))))
2540 (set-window-prev-buffers 2546 (set-window-prev-buffers
2541 window (assq-delete-all buffer (window-prev-buffers window))) 2547 window (assq-delete-all buffer (window-prev-buffers window)))
@@ -2570,7 +2576,7 @@ Optional argument BURY-OR-KILL non-nil means the buffer currently
2570shown in WINDOW is about to be buried or killed and consequently 2576shown in WINDOW is about to be buried or killed and consequently
2571shall not be switched to in future invocations of this command." 2577shall not be switched to in future invocations of this command."
2572 (interactive) 2578 (interactive)
2573 (let* ((window (normalize-live-window window)) 2579 (let* ((window (window-normalize-live-window window))
2574 (old-buffer (window-buffer window)) 2580 (old-buffer (window-buffer window))
2575 ;; Save this since it's destroyed by `set-window-buffer'. 2581 ;; Save this since it's destroyed by `set-window-buffer'.
2576 (next-buffers (window-next-buffers window)) 2582 (next-buffers (window-next-buffers window))
@@ -2672,7 +2678,7 @@ shall not be switched to in future invocations of this command."
2672 "In WINDOW switch to next buffer. 2678 "In WINDOW switch to next buffer.
2673WINDOW must be a live window and defaults to the selected one." 2679WINDOW must be a live window and defaults to the selected one."
2674 (interactive) 2680 (interactive)
2675 (let* ((window (normalize-live-window window)) 2681 (let* ((window (window-normalize-live-window window))
2676 (old-buffer (window-buffer window)) 2682 (old-buffer (window-buffer window))
2677 (next-buffers (window-next-buffers window)) 2683 (next-buffers (window-next-buffers window))
2678 new-buffer entry killed-buffers visible) 2684 new-buffer entry killed-buffers visible)
@@ -2786,7 +2792,7 @@ current buffer. Also, if BUFFER-OR-NAME is nil or omitted,
2786remove the current buffer from the selected window if it is 2792remove the current buffer from the selected window if it is
2787displayed there." 2793displayed there."
2788 (interactive) 2794 (interactive)
2789 (let* ((buffer (normalize-live-buffer buffer-or-name))) 2795 (let* ((buffer (window-normalize-buffer buffer-or-name)))
2790 ;; If `buffer-or-name' is not on the selected frame we unrecord it 2796 ;; If `buffer-or-name' is not on the selected frame we unrecord it
2791 ;; although it's not "here" (call it a feature). 2797 ;; although it's not "here" (call it a feature).
2792 (unrecord-buffer buffer) 2798 (unrecord-buffer buffer)
@@ -2796,7 +2802,9 @@ displayed there."
2796 ((or buffer-or-name (not (eq buffer (window-buffer))))) 2802 ((or buffer-or-name (not (eq buffer (window-buffer)))))
2797 ((not (window-dedicated-p)) 2803 ((not (window-dedicated-p))
2798 (switch-to-prev-buffer nil 'bury)) 2804 (switch-to-prev-buffer nil 'bury))
2799 ((frame-root-window-p (selected-window)) 2805 ((and (frame-root-window-p (selected-window))
2806 ;; Don't iconify if it's the only frame.
2807 (not (eq (next-frame nil 0) (selected-frame))))
2800 (iconify-frame (window-frame (selected-window)))) 2808 (iconify-frame (window-frame (selected-window))))
2801 ((window-deletable-p) 2809 ((window-deletable-p)
2802 (delete-window))) 2810 (delete-window)))
@@ -2811,11 +2819,15 @@ displayed there."
2811(defun next-buffer () 2819(defun next-buffer ()
2812 "In selected window switch to next buffer." 2820 "In selected window switch to next buffer."
2813 (interactive) 2821 (interactive)
2822 (if (window-minibuffer-p)
2823 (error "Cannot switch buffers in minibuffer window"))
2814 (switch-to-next-buffer)) 2824 (switch-to-next-buffer))
2815 2825
2816(defun previous-buffer () 2826(defun previous-buffer ()
2817 "In selected window switch to previous buffer." 2827 "In selected window switch to previous buffer."
2818 (interactive) 2828 (interactive)
2829 (if (window-minibuffer-p)
2830 (error "Cannot switch buffers in minibuffer window"))
2819 (switch-to-prev-buffer)) 2831 (switch-to-prev-buffer))
2820 2832
2821(defun delete-windows-on (&optional buffer-or-name frame) 2833(defun delete-windows-on (&optional buffer-or-name frame)
@@ -2843,7 +2855,7 @@ When a window showing BUFFER-OR-NAME is dedicated and the only
2843window of its frame, that frame is deleted when there are other 2855window of its frame, that frame is deleted when there are other
2844frames left." 2856frames left."
2845 (interactive "BDelete windows on (buffer):\nP") 2857 (interactive "BDelete windows on (buffer):\nP")
2846 (let ((buffer (normalize-live-buffer buffer-or-name)) 2858 (let ((buffer (window-normalize-buffer buffer-or-name))
2847 ;; Handle the "inverted" meaning of the FRAME argument wrt other 2859 ;; Handle the "inverted" meaning of the FRAME argument wrt other
2848 ;; `window-list-1' based function. 2860 ;; `window-list-1' based function.
2849 (all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame)))) 2861 (all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame))))
@@ -2877,7 +2889,7 @@ left, some other buffer is displayed in that window.
2877 2889
2878This function removes the buffer denoted by BUFFER-OR-NAME from 2890This function removes the buffer denoted by BUFFER-OR-NAME from
2879all window-local buffer lists." 2891all window-local buffer lists."
2880 (let ((buffer (normalize-live-buffer buffer-or-name))) 2892 (let ((buffer (window-normalize-buffer buffer-or-name)))
2881 (dolist (window (window-list-1 nil nil t)) 2893 (dolist (window (window-list-1 nil nil t))
2882 (if (eq (window-buffer window) buffer) 2894 (if (eq (window-buffer window) buffer)
2883 (let ((deletable (window-deletable-p window))) 2895 (let ((deletable (window-deletable-p window)))
@@ -2910,7 +2922,7 @@ Optional argument KILL non-nil means in addition kill WINDOW's
2910buffer. If KILL is nil, put WINDOW's buffer at the end of the 2922buffer. If KILL is nil, put WINDOW's buffer at the end of the
2911buffer list. Interactively, KILL is the prefix argument." 2923buffer list. Interactively, KILL is the prefix argument."
2912 (interactive "i\nP") 2924 (interactive "i\nP")
2913 (setq window (normalize-live-window window)) 2925 (setq window (window-normalize-live-window window))
2914 (let ((buffer (window-buffer window)) 2926 (let ((buffer (window-buffer window))
2915 (quit-restore (window-parameter window 'quit-restore)) 2927 (quit-restore (window-parameter window 'quit-restore))
2916 deletable resize) 2928 deletable resize)
@@ -3014,7 +3026,7 @@ window, these properties as well as the buffer displayed in the
3014new window are inherited from the window selected on WINDOW's 3026new window are inherited from the window selected on WINDOW's
3015frame. The selected window is not changed by this function." 3027frame. The selected window is not changed by this function."
3016 (interactive "i") 3028 (interactive "i")
3017 (setq window (normalize-any-window window)) 3029 (setq window (window-normalize-any-window window))
3018 (let* ((side (cond 3030 (let* ((side (cond
3019 ((not side) 'below) 3031 ((not side) 'below)
3020 ((memq side '(below above right left)) side) 3032 ((memq side '(below above right left)) side)
@@ -3141,7 +3153,7 @@ frame. The selected window is not changed by this function."
3141 ;; SIZE specification violates minimum size restrictions. 3153 ;; SIZE specification violates minimum size restrictions.
3142 (error "Window %s too small for splitting" window))) 3154 (error "Window %s too small for splitting" window)))
3143 3155
3144 (window-resize-reset frame horizontal) 3156 (window--resize-reset frame horizontal)
3145 3157
3146 (setq new-parent 3158 (setq new-parent
3147 ;; Make new-parent non-nil if we need a new parent window; 3159 ;; Make new-parent non-nil if we need a new parent window;
@@ -3162,7 +3174,7 @@ frame. The selected window is not changed by this function."
3162 ;; we won't be able to return space to those windows when we 3174 ;; we won't be able to return space to those windows when we
3163 ;; delete the one we create here. Hence we do not go up. 3175 ;; delete the one we create here. Hence we do not go up.
3164 (progn 3176 (progn
3165 (resize-subwindows parent (- new-size) horizontal) 3177 (window--resize-subwindows parent (- new-size) horizontal)
3166 (let* ((normal (- 1.0 new-normal)) 3178 (let* ((normal (- 1.0 new-normal))
3167 (sub (window-child parent))) 3179 (sub (window-child parent)))
3168 (while sub 3180 (while sub
@@ -3171,7 +3183,7 @@ frame. The selected window is not changed by this function."
3171 (setq sub (window-right sub))))) 3183 (setq sub (window-right sub)))))
3172 ;; Get entire space from WINDOW. 3184 ;; Get entire space from WINDOW.
3173 (set-window-new-total window (- old-size new-size)) 3185 (set-window-new-total window (- old-size new-size))
3174 (resize-this-window window (- new-size) horizontal) 3186 (window--resize-this-window window (- new-size) horizontal)
3175 (set-window-new-normal 3187 (set-window-new-normal
3176 window (- (if new-parent 1.0 (window-normal-size window horizontal)) 3188 window (- (if new-parent 1.0 (window-normal-size window horizontal))
3177 new-normal))) 3189 new-normal)))
@@ -3287,8 +3299,8 @@ The selected window remains selected. Return the new window."
3287;;; Balancing windows. 3299;;; Balancing windows.
3288 3300
3289;; The following routine uses the recycled code from an old version of 3301;; The following routine uses the recycled code from an old version of
3290;; `resize-subwindows'. It's not very pretty, but coding it the way the 3302;; `window--resize-subwindows'. It's not very pretty, but coding it the way the
3291;; new `resize-subwindows' code does would hardly make it any shorter or 3303;; new `window--resize-subwindows' code does would hardly make it any shorter or
3292;; more readable (FWIW we'd need three loops - one to calculate the 3304;; more readable (FWIW we'd need three loops - one to calculate the
3293;; minimum sizes per window, one to enlarge or shrink windows until the 3305;; minimum sizes per window, one to enlarge or shrink windows until the
3294;; new parent-size matches, and one where we shrink the largest/enlarge 3306;; new parent-size matches, and one where we shrink the largest/enlarge
@@ -3317,7 +3329,7 @@ WINDOW must be an iso-combination."
3317 (setq sub first) 3329 (setq sub first)
3318 (while (and sub (not failed)) 3330 (while (and sub (not failed))
3319 ;; Ignore subwindows that should be ignored or are stuck. 3331 ;; Ignore subwindows that should be ignored or are stuck.
3320 (unless (resize-subwindows-skip-p sub) 3332 (unless (window--resize-subwindows-skip-p sub)
3321 (setq found t) 3333 (setq found t)
3322 (setq sub-total (window-total-size sub horizontal)) 3334 (setq sub-total (window-total-size sub horizontal))
3323 (setq sub-delta (- size sub-total)) 3335 (setq sub-delta (- size sub-total))
@@ -3338,7 +3350,7 @@ WINDOW must be an iso-combination."
3338 ;; (column) until `rest' is zero. 3350 ;; (column) until `rest' is zero.
3339 (setq sub first) 3351 (setq sub first)
3340 (while (and sub (> rest 0)) 3352 (while (and sub (> rest 0))
3341 (unless (resize-subwindows-skip-p window) 3353 (unless (window--resize-subwindows-skip-p window)
3342 (set-window-new-total sub 1 t) 3354 (set-window-new-total sub 1 t)
3343 (setq rest (1- rest))) 3355 (setq rest (1- rest)))
3344 (setq sub (window-right sub))) 3356 (setq sub (window-right sub)))
@@ -3372,7 +3384,7 @@ WINDOW must be an iso-combination."
3372 (balance-windows-2 window horizontal) 3384 (balance-windows-2 window horizontal)
3373 (let ((size (window-new-total window))) 3385 (let ((size (window-new-total window)))
3374 (while sub 3386 (while sub
3375 (set-window-new-total sub size) 3387 (set-window-new-total sub size)
3376 (balance-windows-1 sub horizontal) 3388 (balance-windows-1 sub horizontal)
3377 (setq sub (window-right sub)))))))) 3389 (setq sub (window-right sub))))))))
3378 3390
@@ -3396,11 +3408,11 @@ window."
3396 (error "Not a window or frame %s" window-or-frame)))) 3408 (error "Not a window or frame %s" window-or-frame))))
3397 (frame (window-frame window))) 3409 (frame (window-frame window)))
3398 ;; Balance vertically. 3410 ;; Balance vertically.
3399 (window-resize-reset (window-frame window)) 3411 (window--resize-reset (window-frame window))
3400 (balance-windows-1 window) 3412 (balance-windows-1 window)
3401 (window-resize-apply frame) 3413 (window-resize-apply frame)
3402 ;; Balance horizontally. 3414 ;; Balance horizontally.
3403 (window-resize-reset (window-frame window) t) 3415 (window--resize-reset (window-frame window) t)
3404 (balance-windows-1 window t) 3416 (balance-windows-1 window t)
3405 (window-resize-apply frame t))) 3417 (window-resize-apply frame t)))
3406 3418
@@ -3534,7 +3546,6 @@ specific buffers."
3534 (window-list-no-nils 3546 (window-list-no-nils
3535 type 3547 type
3536 (unless (window-next-sibling window) (cons 'last t)) 3548 (unless (window-next-sibling window) (cons 'last t))
3537 (cons 'clone-number (window-clone-number window))
3538 (cons 'total-height (window-total-size window)) 3549 (cons 'total-height (window-total-size window))
3539 (cons 'total-width (window-total-size window t)) 3550 (cons 'total-width (window-total-size window t))
3540 (cons 'normal-height (window-normal-size window)) 3551 (cons 'normal-height (window-normal-size window))
@@ -3546,6 +3557,9 @@ specific buffers."
3546 (unless (memq (car parameter) 3557 (unless (memq (car parameter)
3547 window-state-ignored-parameters) 3558 window-state-ignored-parameters)
3548 (setq list (cons parameter list)))) 3559 (setq list (cons parameter list))))
3560 (unless (window-parameter window 'clone-of)
3561 ;; Make a clone-of parameter.
3562 (setq list (cons (cons 'clone-of window) list)))
3549 (when list 3563 (when list
3550 (cons 'parameters list))) 3564 (cons 'parameters list)))
3551 (when buffer 3565 (when buffer
@@ -3686,13 +3700,10 @@ value can be also stored on disk and read back in a new session."
3686 "Helper function for `window-state-put'." 3700 "Helper function for `window-state-put'."
3687 (dolist (item window-state-put-list) 3701 (dolist (item window-state-put-list)
3688 (let ((window (car item)) 3702 (let ((window (car item))
3689 (clone-number (cdr (assq 'clone-number item)))
3690 (splits (cdr (assq 'splits item))) 3703 (splits (cdr (assq 'splits item)))
3691 (nest (cdr (assq 'nest item))) 3704 (nest (cdr (assq 'nest item)))
3692 (parameters (cdr (assq 'parameters item))) 3705 (parameters (cdr (assq 'parameters item)))
3693 (state (cdr (assq 'buffer item)))) 3706 (state (cdr (assq 'buffer item))))
3694 ;; Put in clone-number.
3695 (when clone-number (set-window-clone-number window clone-number))
3696 (when splits (set-window-splits window splits)) 3707 (when splits (set-window-splits window splits))
3697 (when nest (set-window-nest window nest)) 3708 (when nest (set-window-nest window nest))
3698 ;; Process parameters. 3709 ;; Process parameters.
@@ -3767,7 +3778,7 @@ Optional argument IGNORE non-nil means ignore minimum window
3767sizes and fixed size restrictions. IGNORE equal `safe' means 3778sizes and fixed size restrictions. IGNORE equal `safe' means
3768subwindows can get as small as `window-safe-min-height' and 3779subwindows can get as small as `window-safe-min-height' and
3769`window-safe-min-width'." 3780`window-safe-min-width'."
3770 (setq window (normalize-live-window window)) 3781 (setq window (window-normalize-live-window window))
3771 (let* ((frame (window-frame window)) 3782 (let* ((frame (window-frame window))
3772 (head (car state)) 3783 (head (car state))
3773 ;; We check here (1) whether the total sizes of root window of 3784 ;; We check here (1) whether the total sizes of root window of
@@ -3818,22 +3829,6 @@ subwindows can get as small as `window-safe-min-height' and
3818 (window-state-put-2 ignore)) 3829 (window-state-put-2 ignore))
3819 (window-check frame)))) 3830 (window-check frame))))
3820 3831
3821;;; Displaying buffers.
3822(defconst display-buffer-default-specifiers
3823 '((reuse-window nil same visible)
3824 (pop-up-window (largest . nil) (lru . nil))
3825 (pop-up-window-min-height . 40)
3826 (pop-up-window-min-width . 80)
3827 (reuse-window other nil nil)
3828 (reuse-window nil other visible)
3829 (reuse-window nil nil t)
3830 (reuse-window-even-sizes . t))
3831 "Buffer display default specifiers.
3832The value specified here is used when no other specifiers have
3833been specified by the user or the application. Consult the
3834documentation of `display-buffer-alist' for a description of
3835buffer display specifiers.")
3836
3837(defconst display-buffer-macro-specifiers 3832(defconst display-buffer-macro-specifiers
3838 '((same-window 3833 '((same-window
3839 ;; Use the same window. 3834 ;; Use the same window.
@@ -3843,11 +3838,6 @@ buffer display specifiers.")
3843 (reuse-window nil same nil) 3838 (reuse-window nil same nil)
3844 (pop-up-window (largest . nil) (lru . nil)) 3839 (pop-up-window (largest . nil) (lru . nil))
3845 (reuse-window nil other nil)) 3840 (reuse-window nil other nil))
3846 ;; (other-window
3847 ;; ;; Avoid selected window.
3848 ;; (reuse-window other same visible)
3849 ;; (pop-up-window (largest . nil) (lru . nil))
3850 ;; (reuse-window other other visible))
3851 (same-frame-other-window 3841 (same-frame-other-window
3852 ;; Avoid other frames and selected window. 3842 ;; Avoid other frames and selected window.
3853 (reuse-window other same nil) 3843 (reuse-window other same nil)
@@ -3857,25 +3847,10 @@ buffer display specifiers.")
3857 ;; Avoid selected frame. 3847 ;; Avoid selected frame.
3858 (reuse-window nil same other) 3848 (reuse-window nil same other)
3859 (pop-up-frame) 3849 (pop-up-frame)
3860 (reuse-window nil other other)) 3850 (reuse-window nil other other)))
3861 (default
3862 ;; The default specifiers.
3863 display-buffer-default-specifiers))
3864 "Buffer display macro specifiers.") 3851 "Buffer display macro specifiers.")
3865 3852
3866(defcustom display-buffer-alist 3853(defcustom display-buffer-alist nil
3867 '((((regexp . ".*"))
3868 ;; Reuse window showing same buffer on same frame.
3869 reuse-window (reuse-window nil same nil)
3870 ;; Pop up window.
3871 pop-up-window
3872 ;; Split largest or lru window.
3873 (pop-up-window (largest . nil) (lru . nil))
3874 (pop-up-window-min-height . 40) ; split-height-threshold / 2
3875 (pop-up-window-min-width . 80) ; split-width-threshold / 2
3876 ;; Reuse any but selected window on same frame.
3877 reuse-window (reuse-window other nil nil)
3878 (reuse-window-even-sizes . t)))
3879 "List associating buffer identifiers with display specifiers. 3854 "List associating buffer identifiers with display specifiers.
3880The car of each element of this list is built from a set of cons 3855The car of each element of this list is built from a set of cons
3881cells called buffer identifiers. `display-buffer' shows a buffer 3856cells called buffer identifiers. `display-buffer' shows a buffer
@@ -3898,7 +3873,7 @@ match occurs in one of the following three cases:
3898Display specifiers are either symbols, cons cells, or lists. 3873Display specifiers are either symbols, cons cells, or lists.
3899Five specifiers have been reserved to indicate the basic method 3874Five specifiers have been reserved to indicate the basic method
3900for displaying the buffer: `reuse-window', `pop-up-window', 3875for displaying the buffer: `reuse-window', `pop-up-window',
3901`pop-up-frame', `use-side-window', and `fun-with-args'. 3876`pop-up-frame', `use-side-window', and `function'.
3902 3877
3903A list whose car is the symbol `reuse-window' indicates that an 3878A list whose car is the symbol `reuse-window' indicates that an
3904existing window shall be reused for displaying the buffer. The 3879existing window shall be reused for displaying the buffer. The
@@ -4088,11 +4063,11 @@ The following specifiers are useful in connection with the
4088`pop-up-window-min-height', `pop-up-window-min-width', 4063`pop-up-window-min-height', `pop-up-window-min-width',
4089`pop-up-window-set-height' and `pop-up-window-set-width'. 4064`pop-up-window-set-height' and `pop-up-window-set-width'.
4090 4065
4091A list whose car is the symbol `fun-with-args' specifies that the 4066A list whose car is the symbol `function' specifies that the
4092function specified in the second element of the list is 4067function specified in the second element of the list is
4093responsible for displaying the buffer. `display-buffer' calls 4068responsible for displaying the buffer. `display-buffer' calls
4094this function with the buffer as first argument and the remaining 4069this function with the buffer as first argument and the remaining
4095elements of the list as the other arguments. 4070elements of the list as the second.
4096 4071
4097The function should choose or create a window, display the buffer 4072The function should choose or create a window, display the buffer
4098in it, and return the window. It is also responsible for giving 4073in it, and return the window. It is also responsible for giving
@@ -4514,18 +4489,18 @@ using the location specifiers `same-window' or `other-frame'."
4514 ;; Function with argument specifiers. 4489 ;; Function with argument specifiers.
4515 (list 4490 (list
4516 :tag "Function with arguments" 4491 :tag "Function with arguments"
4517 :value (fun-with-args (fun-with-args 'ignore)) 4492 :value (function (function 'ignore))
4518 :format "%t\n%v" 4493 :format "%t\n%v"
4519 :inline t 4494 :inline t
4520 ;; For customization purposes only. 4495 ;; For customization purposes only.
4521 (const :format "" fun-with-args) 4496 (const :format "" function)
4522 (set 4497 (set
4523 :format "%v" 4498 :format "%v"
4524 :inline t 4499 :inline t
4525 (list 4500 (list
4526 :format "%v" 4501 :format "%v"
4527 :value (fun-with-args 'ignore) 4502 :value (function 'ignore)
4528 (const :format "" fun-with-args) 4503 (const :format "" function)
4529 (function :tag "Function" :format "%t: %v\n" :size 25) 4504 (function :tag "Function" :format "%t: %v\n" :size 25)
4530 (list 4505 (list
4531 :format "%v" 4506 :format "%v"
@@ -4736,19 +4711,19 @@ Return WINDOW.
4736 4711
4737SPECIFIERS must be a list of buffer display specifiers, see the 4712SPECIFIERS must be a list of buffer display specifiers, see the
4738documentation of `display-buffer-alist' for a description." 4713documentation of `display-buffer-alist' for a description."
4739 (setq buffer (normalize-live-buffer buffer)) 4714 (setq buffer (window-normalize-buffer buffer))
4740 (setq window (normalize-live-window window)) 4715 (setq window (window-normalize-live-window window))
4741 (let* ((old-frame (selected-frame)) 4716 (let* ((old-frame (selected-frame))
4742 (new-frame (window-frame window)) 4717 (new-frame (window-frame window))
4743 (dedicated (cdr (assq 'dedicated specifiers))) 4718 (dedicate (cdr (assq 'dedicate specifiers)))
4744 (no-other-window (cdr (assq 'no-other-window specifiers)))) 4719 (no-other-window (cdr (assq 'no-other-window specifiers))))
4745 ;; Show BUFFER in WINDOW. 4720 ;; Show BUFFER in WINDOW.
4746 (unless (eq buffer (window-buffer window)) 4721 (unless (eq buffer (window-buffer window))
4747 ;; If we show another buffer in WINDOW, undedicate it first. 4722 ;; If we show another buffer in WINDOW, undedicate it first.
4748 (set-window-dedicated-p window nil)) 4723 (set-window-dedicated-p window nil))
4749 (set-window-buffer window buffer) 4724 (set-window-buffer window buffer)
4750 (when dedicated 4725 (when dedicate
4751 (set-window-dedicated-p window dedicated)) 4726 (set-window-dedicated-p window dedicate))
4752 (when no-other-window 4727 (when no-other-window
4753 (set-window-parameter window 'no-other-window t)) 4728 (set-window-parameter window 'no-other-window t))
4754 (unless (or (eq old-frame new-frame) 4729 (unless (or (eq old-frame new-frame)
@@ -4764,7 +4739,7 @@ documentation of `display-buffer-alist' for a description."
4764 ;; Return window. 4739 ;; Return window.
4765 window)) 4740 window))
4766 4741
4767(defun display-buffer-reuse-window (buffer method &optional specifiers) 4742(defun display-buffer-reuse-window (buffer method &optional specifiers other-window)
4768 "Display BUFFER in an existing window. 4743 "Display BUFFER in an existing window.
4769METHOD must be a list in the form of the cdr of a `reuse-window' 4744METHOD must be a list in the form of the cdr of a `reuse-window'
4770buffer display specifier, see `display-buffer-alist' for an 4745buffer display specifier, see `display-buffer-alist' for an
@@ -4776,8 +4751,9 @@ frame to use - either nil, 0, `visible', `other', t, or a live
4776frame. 4751frame.
4777 4752
4778Optional argument SPECIFIERS must be a list of valid display 4753Optional argument SPECIFIERS must be a list of valid display
4779specifiers. Return the window chosen to display BUFFER, nil if 4754specifiers. Optional argument OTHER-WINDOW, if non-nil, means do
4780none was found." 4755not use the selected window. Return the window chosen to display
4756BUFFER, nil if none was found."
4781 (let* ((method-window (nth 0 method)) 4757 (let* ((method-window (nth 0 method))
4782 (method-buffer (nth 1 method)) 4758 (method-buffer (nth 1 method))
4783 (method-frame (nth 2 method)) 4759 (method-frame (nth 2 method))
@@ -4795,6 +4771,7 @@ none was found."
4795 (eq window-buffer buffer)) 4771 (eq window-buffer buffer))
4796 (or (not method-window) 4772 (or (not method-window)
4797 (and (eq method-window 'same) 4773 (and (eq method-window 'same)
4774 (not other-window)
4798 (eq window (selected-window))) 4775 (eq window (selected-window)))
4799 (and (eq method-window 'other) 4776 (and (eq method-window 'other)
4800 (not (eq window (selected-window)))) 4777 (not (eq window (selected-window))))
@@ -5032,7 +5009,7 @@ description."
5032 (setq window 5009 (setq window
5033 (cond 5010 (cond
5034 ((eq cand 'largest) 5011 ((eq cand 'largest)
5035 ;; The largest window. 5012 ;; The largest window.
5036 (get-largest-window frame t)) 5013 (get-largest-window frame t))
5037 ((eq cand 'lru) 5014 ((eq cand 'lru)
5038 ;; The least recently used window. 5015 ;; The least recently used window.
@@ -5053,7 +5030,7 @@ description."
5053 ;; A window, directly specified. 5030 ;; A window, directly specified.
5054 cand))) 5031 cand)))
5055 5032
5056 (when (and (window-live-p window) 5033 (when (and (window-any-p window)
5057 ;; The window must be on the correct frame, 5034 ;; The window must be on the correct frame,
5058 (eq (window-frame window) frame) 5035 (eq (window-frame window) frame)
5059 ;; and must be neither a minibuffer window 5036 ;; and must be neither a minibuffer window
@@ -5073,7 +5050,7 @@ description."
5073 ;; Don't pass any specifiers to this function. 5050 ;; Don't pass any specifiers to this function.
5074 (funcall side window))))) 5051 (funcall side window)))))
5075 5052
5076 (when window 5053 (when (window-live-p window)
5077 ;; Adjust sizes if asked for. 5054 ;; Adjust sizes if asked for.
5078 (display-buffer-set-height window specifiers) 5055 (display-buffer-set-height window specifiers)
5079 (display-buffer-set-width window specifiers) 5056 (display-buffer-set-width window specifiers)
@@ -5287,7 +5264,7 @@ SPECIFIERS must be a list of buffer display specifiers."
5287 (set-window-parameter window 'window-slot slot)) 5264 (set-window-parameter window 'window-slot slot))
5288 (display-buffer-in-window buffer window specifiers))))) 5265 (display-buffer-in-window buffer window specifiers)))))
5289 5266
5290(defun normalize-buffer-to-display (buffer-or-name) 5267(defun window-normalize-buffer-to-display (buffer-or-name)
5291 "Normalize BUFFER-OR-NAME argument for buffer display functions. 5268 "Normalize BUFFER-OR-NAME argument for buffer display functions.
5292If BUFFER-OR-NAME is nil, return the curent buffer. Else, if a 5269If BUFFER-OR-NAME is nil, return the curent buffer. Else, if a
5293buffer specified by BUFFER-OR-NAME exists, return that buffer. 5270buffer specified by BUFFER-OR-NAME exists, return that buffer.
@@ -5313,201 +5290,225 @@ Optional argument LABEL is like the same argument of
5313 5290
5314The calculation of the return value is exclusively based on the 5291The calculation of the return value is exclusively based on the
5315user preferences expressed in `display-buffer-alist'." 5292user preferences expressed in `display-buffer-alist'."
5316 (let* ((buffer (normalize-live-buffer buffer-or-name)) 5293 (let* ((buffer-name
5317 (list (display-buffer-normalize-alist (buffer-name buffer) label)) 5294 (buffer-name (window-normalize-buffer buffer-or-name)))
5318 (value (assq 'other-window-means-other-frame 5295 (default (display-buffer-normalize-default buffer-name))
5319 (or (car list) (cdr list))))) 5296 (alist (display-buffer-normalize-alist buffer-name label)))
5320 (when value (cdr value)))) 5297 (or (cdr (assq 'other-window-means-other-frame default))
5321 5298 (cdr (assq 'other-window-means-other-frame (cdr alist))))))
5322(defun display-buffer-normalize-arguments (buffer-name specifiers label other-frame) 5299
5323 "Normalize second and third argument of `display-buffer'. 5300(defun display-buffer-normalize-special (&optional args)
5324BUFFER-NAME is the name of the buffer that shall be displayed, 5301 "Return buffer display specifiers for `special-display-frame-alist'."
5325SPECIFIERS is the second argument of `display-buffer'. LABEL is 5302 (progn ;; <-- reserved for with-no-warnings
5326the same argument of `display-buffer'. OTHER-FRAME non-nil means 5303 (if (and (listp args) (symbolp (car args)))
5327use other-frame for other-window." 5304 ;; Note: `display-buffer' funcalls this so take "(nth 1 args)"
5328 (let (normalized entry specifier pars) 5305 ;; where `special-display-popup-frame' (which uses apply) takes
5329 (setq specifier 5306 ;; "(cdr args)".
5330 (cond 5307 `((function ,(car args) ,(nth 1 args)))
5331 ((not specifiers) 5308 (append
5332 nil) 5309 '((reuse-window nil same 0))
5333 ((listp specifiers) 5310 (when (and (listp args) (cdr (assq 'same-window args)))
5334 ;; If SPECIFIERS is a list, we assume it is a list of specifiers. 5311 '((reuse-window same nil nil) (reuse-dedicated . weak)))
5335 (dolist (specifier specifiers) 5312 (when (and (listp args)
5336 (cond 5313 (or (cdr (assq 'same-frame args))
5337 ((consp specifier) 5314 (cdr (assq 'same-window args))))
5338 (setq normalized (cons specifier normalized))) 5315 '((pop-up-window (largest . nil) (lru . nil))
5339 ((eq specifier 'other-window) 5316 (reuse-window nil nil nil)))
5340 ;; `other-window' must be treated separately. 5317 (unless display-buffer-mark-dedicated
5341 (let ((entry (assq (if other-frame 5318 ;; Don't make anything created above dedicated unless requested.
5342 'other-frame 5319 ;; Otherwise the dedication request below gets in our way.
5343 'same-frame-other-window) 5320 '((dedicate . nil)))
5344 display-buffer-macro-specifiers))) 5321 `((pop-up-frame t)
5345 (dolist (item (cdr entry)) 5322 ,(append '(pop-up-frame-alist)
5346 (setq normalized (cons item normalized))))) 5323 (when (listp args) args)
5347 ((symbolp specifier) 5324 special-display-frame-alist)
5348 ;; Might be a macro specifier, try to expand it (the cdr is a 5325 (dedicate . t))))))
5349 ;; list and we have to reverse it later, so do it one at a 5326
5350 ;; time). 5327(defun display-buffer-normalize-default (buffer-or-name)
5351 (let ((entry (assq specifier display-buffer-macro-specifiers)))
5352 (dolist (item (cdr entry))
5353 (setq normalized (cons item normalized)))))))
5354 ;; Reverse list.
5355 (nreverse normalized))
5356 ((setq entry (assq specifiers display-buffer-macro-specifiers))
5357 ;; A macro specifier.
5358 (cdr entry))
5359 ((or other-frame (with-no-warnings pop-up-frames))
5360 ;; `special-display-p' group.
5361 (if (and (with-no-warnings special-display-function)
5362 ;; `special-display-p' returns either t or a list
5363 ;; of frame parameters to pass to
5364 ;; `special-display-function'.
5365 (setq pars (with-no-warnings
5366 (special-display-p buffer-name))))
5367 (list (list 'fun-with-args
5368 (with-no-warnings special-display-function)
5369 (when (listp pars) pars)))
5370 ;; Pop up another frame.
5371 (cddr (assq 'other-frame display-buffer-macro-specifiers))))
5372 (t
5373 ;; In any other case pop up a new window.
5374 (cdr (assq 'same-frame-other-window
5375 display-buffer-macro-specifiers)))))
5376
5377 ;; Handle the old meaning of the LABEL argument of `display-buffer'.
5378 (cond
5379 ((or (memq label '(visible 0 t)) (frame-live-p label))
5380 ;; LABEL must be one of visible (and visible frame), 0 (any
5381 ;; visible or iconfied frame), t (any frame), or a live frame.
5382 (cons `(reuse-window nil same ,label) specifier))
5383 ((or other-frame
5384 (with-no-warnings pop-up-frames)
5385 (with-no-warnings display-buffer-reuse-frames))
5386 (cons '(reuse-window nil same 0) specifier))
5387 (t
5388 specifier))))
5389
5390(defun display-buffer-normalize-options (buffer-or-name)
5391 "Subroutine of `display-buffer-normalize-specifiers'. 5328 "Subroutine of `display-buffer-normalize-specifiers'.
5392BUFFER-OR-NAME is the buffer to display. This routine provides a 5329BUFFER-OR-NAME is the buffer to display.
5393compatibility layer for the now obsolete Emacs 23 buffer display 5330
5394options." 5331This routine provides a compatibility layer for the obsolete
5395 (with-no-warnings 5332Emacs 23 buffer display options to set up the corresponding
5396 (let* ((buffer (normalize-live-buffer buffer-or-name)) 5333buffer display specifiers."
5334 (progn ;; <-- reserved for with-no-warnings
5335 (let* ((buffer (window-normalize-buffer buffer-or-name))
5397 (buffer-name (buffer-name buffer)) 5336 (buffer-name (buffer-name buffer))
5398 (use-pop-up-frames 5337 (pop-up-frames
5399 (or (and (eq pop-up-frames 'graphic-only) 5338 (and (boundp 'pop-up-frames)
5400 (display-graphic-p)) 5339 (or (and (eq pop-up-frames 'graphic-only)
5401 pop-up-frames)) 5340 (display-graphic-p))
5402 specifiers) 5341 pop-up-frames)))
5403 ;; `even-window-heights', unless nil or unset. 5342 specifiers args)
5404 (unless (memq even-window-heights '(nil unset)) 5343 ;; `other-window-means-other-frame'
5344 (when pop-up-frames
5345 (setq specifiers
5346 (cons (cons 'other-window-means-other-frame t) specifiers)))
5347
5348 ;; `even-window-heights'
5349 (unless (and (boundp 'even-window-heights)
5350 (not even-window-heights))
5405 (setq specifiers 5351 (setq specifiers
5406 (cons (cons 'reuse-window-even-sizes t) specifiers))) 5352 (cons (cons 'reuse-window-even-sizes t) specifiers)))
5407 5353
5408 ;; `display-buffer-mark-dedicated' 5354 ;; `display-buffer-mark-dedicated'
5409 (when display-buffer-mark-dedicated 5355 (when (and (boundp 'display-buffer-mark-dedicated)
5356 display-buffer-mark-dedicated)
5410 (setq specifiers 5357 (setq specifiers
5411 (cons (cons 'dedicate display-buffer-mark-dedicated) 5358 (cons (cons 'dedicate display-buffer-mark-dedicated)
5412 specifiers))) 5359 specifiers)))
5413 5360
5414 ;; `pop-up-window' group. Anything is added here iff 5361 ;; `pop-up-window-min-height'
5415 ;; `pop-up-windows' is neither nil nor unset. 5362 (let ((min-height
5416 (let ((pop-up-window (not (memq pop-up-windows '(nil unset)))) 5363 (if (boundp 'split-height-threshold)
5417 (fun (unless (eq split-window-preferred-function 5364 (if (numberp split-height-threshold)
5418 'split-window-sensibly) 5365 (/ split-height-threshold 2)
5419 split-window-preferred-function)) 5366 1.0)
5420 (min-height (if (numberp split-height-threshold) 5367 40)))
5421 (/ split-height-threshold 2) 5368 (setq specifiers
5422 1.0)) 5369 (cons (cons 'pop-up-window-min-height min-height)
5423 (min-width (if (numberp split-width-threshold) 5370 specifiers)))
5424 (/ split-width-threshold 2) 5371
5425 1.0))) 5372 ;; `pop-up-window-min-width'
5426 ;; Create an entry only if a default value was changed. 5373 (let ((min-width
5427 (when (or pop-up-window 5374 (if (boundp 'split-width-threshold)
5428 (not (equal split-height-threshold 80)) 5375 (if (numberp split-width-threshold)
5429 (not (equal split-width-threshold 160))) 5376 (/ split-width-threshold 2)
5430 ;; `reuse-window' (needed as fallback when popping up the new 5377 1.0)
5431 ;; window fails). 5378 80)))
5432 (setq specifiers 5379 (setq specifiers
5433 (cons (list 'reuse-window 'other nil nil) 5380 (cons (cons 'pop-up-window-min-width min-width)
5434 specifiers)) 5381 specifiers)))
5435 ;; `split-width-threshold' 5382
5436 (setq specifiers 5383 ;; `pop-up-window'
5437 (cons (cons 'pop-up-window-min-width min-width) 5384 (unless (and (boundp 'pop-up-windows) (not pop-up-windows))
5438 specifiers)) 5385 (let ((fun (when (and (boundp 'split-window-preferred-function)
5439 ;; `split-height-threshold' 5386 (not (eq split-window-preferred-function
5440 (setq specifiers 5387 'split-window-sensibly)))
5441 (cons (cons 'pop-up-window-min-height min-height) 5388 split-window-preferred-function)))
5442 specifiers))
5443 ;; `pop-up-window' 5389 ;; `pop-up-window'
5444 (setq specifiers 5390 (setq specifiers
5445 (cons (list 'pop-up-window 5391 (cons
5446 (cons 'largest fun) (cons 'lru fun)) 5392 (list 'pop-up-window (cons 'largest fun) (cons 'lru fun))
5447 specifiers)))) 5393 specifiers))))
5394
5395 ;; `pop-up-frame-function'
5396 (when (and (boundp 'pop-up-frame-function)
5397 (not (equal pop-up-frame-function
5398 '(lambda nil
5399 (make-frame pop-up-frame-alist)))))
5400 (setq specifiers
5401 (cons (cons 'pop-up-frame-function pop-up-frame-function)
5402 specifiers)))
5403
5404 ;; `pop-up-frame-alist'
5405 (when pop-up-frame-alist
5406 (setq specifiers
5407 (cons (cons 'pop-up-frame-alist pop-up-frame-alist)
5408 specifiers)))
5448 5409
5449 ;; `pop-up-frame' group. 5410 ;; `pop-up-frame'
5450 (when use-pop-up-frames 5411 (when pop-up-frames
5451 ;; `pop-up-frame-function'. If `pop-up-frame-function' uses the 5412 ;; `pop-up-frame-function'. If `pop-up-frame-function' uses the
5452 ;; now obsolete `pop-up-frame-alist' it will continue to do so. 5413 ;; now obsolete `pop-up-frame-alist' it will continue to do so.
5453 (setq specifiers
5454 (cons (cons 'pop-up-frame-function pop-up-frame-function)
5455 specifiers))
5456 ;; `pop-up-frame' 5414 ;; `pop-up-frame'
5457 (setq specifiers 5415 (setq specifiers
5416 ;; Maybe we should merge graphic-only into the following?
5458 (cons (list 'pop-up-frame t) specifiers))) 5417 (cons (list 'pop-up-frame t) specifiers)))
5459 5418
5460 ;; `pop-up-windows' and `use-pop-up-frames' both nil means means 5419 ;; `special-display'
5461 ;; we are supposed to reuse any window on the same frame (unless 5420 (when (and (boundp 'special-display-function)
5462 ;; we find one showing the same buffer already). 5421 special-display-function
5463 (unless (or pop-up-windows use-pop-up-frames) 5422 (fboundp 'special-display-p)
5464 ;; `reuse-window' showing any buffer on same frame. 5423 (setq args (special-display-p buffer-name)))
5465 (setq specifiers 5424 ;; `special-display-p' returns either t or a list of arguments
5466 (cons (list 'reuse-window nil nil nil) 5425 ;; to pass to `special-display-function'.
5467 specifiers))) 5426 (if (eq special-display-function 'special-display-popup-frame)
5468
5469 ;; `special-display-p' group.
5470 (when special-display-function
5471 ;; `special-display-p' returns either t or a list of frame
5472 ;; parameters to pass to `special-display-function'.
5473 (let ((pars (special-display-p buffer-name)))
5474 (when pars
5475 (setq specifiers 5427 (setq specifiers
5476 (cons (list 'fun-with-args special-display-function 5428 (append (display-buffer-normalize-special args)
5477 (when (listp pars) pars)) 5429 specifiers))
5478 specifiers))))) 5430 (setq specifiers
5431 (cons
5432 `(function ,special-display-function ,(when (listp args) args))
5433 specifiers))))
5479 5434
5435 ;; Reuse window showing same buffer on visible or iconified frame.
5480 ;; `pop-up-frames', `display-buffer-reuse-frames' means search for 5436 ;; `pop-up-frames', `display-buffer-reuse-frames' means search for
5481 ;; a window showing the buffer on some visible or iconfied frame. 5437 ;; a window showing the buffer on some visible or iconfied frame.
5482 ;; `last-nonminibuffer-frame' set and not the same frame means 5438 ;; `last-nonminibuffer-frame' non-nil means search that frame.
5483 ;; search that frame. 5439 (let ((frames (or (and (or pop-up-frames
5484 (let ((frames (or (and (or use-pop-up-frames 5440 (and (boundp 'display-buffer-reuse-frames)
5485 display-buffer-reuse-frames 5441 display-buffer-reuse-frames)
5486 (not (last-nonminibuffer-frame))) 5442 (not (last-nonminibuffer-frame)))
5487 ;; All visible or iconfied frames. 5443 ;; All visible or iconfied frames.
5488 0) 5444 0)
5489 ;; Same frame. 5445 ;; The following usually returns the same frame
5446 ;; so we implicitly search for a window showing
5447 ;; the buffer on the same frame already.
5490 (last-nonminibuffer-frame)))) 5448 (last-nonminibuffer-frame))))
5491 (when frames 5449 (when frames
5492 (setq specifiers 5450 (setq specifiers
5493 (cons (list 'reuse-window 'other 'same frames) 5451 (cons (list 'reuse-window 'other 'same frames)
5494 specifiers)))) 5452 specifiers))))
5495 5453
5496 ;; `same-window-p' group. 5454 ;; `same-window'
5497 (when (same-window-p buffer-name) 5455 (when (and (fboundp 'same-window-p) (same-window-p buffer-name))
5498 ;; Try to reuse the same (selected) window. 5456 ;; Try to reuse the same (selected) window.
5499 (setq specifiers 5457 (setq specifiers
5500 (cons (list 'reuse-window 'same nil nil) 5458 (cons (list 'reuse-window 'same nil nil) specifiers)))
5501 specifiers)))
5502 5459
5503 ;; Prepend "reuse window on same frame if showing the buffer 5460 ;; Same window if showing this buffer already. Can be overridden
5504 ;; already" specifier. It will be overriden by the application 5461 ;; by `other-window' argument if the buffer is already shown in
5505 ;; supplied 'other-window specifier. 5462 ;; the same window.
5506 (setq specifiers (cons (list 'reuse-window nil 'same nil) 5463 (setq specifiers
5507 specifiers)) 5464 (cons (list 'reuse-window 'same 'same nil) specifiers))
5508 5465
5509 specifiers))) 5466 specifiers)))
5510 5467
5468(defun display-buffer-normalize-argument (buffer-name specifiers other-window-means-other-frame)
5469 "Normalize second argument of `display-buffer'.
5470BUFFER-NAME is the name of the buffer that shall be displayed,
5471SPECIFIERS is the second argument of `display-buffer'.
5472OTHER-WINDOW-MEANS-OTHER-FRAME non-nil means use other-frame for
5473other-window."
5474 (progn ;; <-- reserved for with-no-warnings
5475 (let (normalized entry specifier pars)
5476 (cond
5477 ((not specifiers)
5478 nil)
5479 ((listp specifiers)
5480 ;; If SPECIFIERS is a list, we assume it is a list of valid
5481 ;; specifiers.
5482 (dolist (specifier specifiers)
5483 (cond
5484 ((consp specifier)
5485 (setq normalized (cons specifier normalized)))
5486 ((eq specifier 'other-window)
5487 ;; `other-window' must be treated separately.
5488 (let ((entry (assq (if other-window-means-other-frame
5489 'other-frame
5490 'same-frame-other-window)
5491 display-buffer-macro-specifiers)))
5492 (dolist (item (cdr entry))
5493 (setq normalized (cons item normalized)))))
5494 ((symbolp specifier)
5495 ;; Might be a macro specifier, try to expand it (the cdr is a
5496 ;; list and we have to reverse it later, so do it one at a
5497 ;; time).
5498 (let ((entry (assq specifier display-buffer-macro-specifiers)))
5499 (dolist (item (cdr entry))
5500 (setq normalized (cons item normalized)))))))
5501 ;; Reverse list.
5502 (nreverse normalized))
5503 ((setq entry (assq specifiers display-buffer-macro-specifiers))
5504 ;; A macro specifier.
5505 (cdr entry))
5506 (t
5507 ;; Anything else means use another window according to the
5508 ;; non-overriding specifiers of `display-buffer-alist' and the
5509 ;; specifiers produced by `display-buffer-normalize-default'.
5510 '((other-window . t)))))))
5511
5511(defun display-buffer-normalize-alist-1 (specifiers label) 5512(defun display-buffer-normalize-alist-1 (specifiers label)
5512 "Subroutine of `display-buffer-normalize-alist'. 5513 "Subroutine of `display-buffer-normalize-alist'.
5513SPECIFIERS is a list of buffer display specfiers. LABEL is the 5514SPECIFIERS is a list of buffer display specfiers. LABEL is the
@@ -5568,9 +5569,6 @@ LABEL the corresponding argument of `display-buffer'."
5568 5569
5569 (cons list-1 list-2))) 5570 (cons list-1 list-2)))
5570 5571
5571(defvar display-buffer-normalize-options-inhibit nil
5572 "If non-nil, `display-buffer' doesn't process obsolete options.")
5573
5574(defun display-buffer-normalize-specifiers (buffer-name specifiers label) 5572(defun display-buffer-normalize-specifiers (buffer-name specifiers label)
5575 "Return normalized specifiers for a buffer matching BUFFER-NAME or LABEL. 5573 "Return normalized specifiers for a buffer matching BUFFER-NAME or LABEL.
5576BUFFER-NAME must be a string specifying a valid buffer name. 5574BUFFER-NAME must be a string specifying a valid buffer name.
@@ -5589,25 +5587,33 @@ specifiers:
5589 5587
5590- The specifiers in `display-buffer-alist' whose buffer 5588- The specifiers in `display-buffer-alist' whose buffer
5591 identifier matches BUFFER-NAME or LABEL and whose 'override 5589 identifier matches BUFFER-NAME or LABEL and whose 'override
5592 component is not set. 5590 component is not set."
5593 5591 (let* ((default (display-buffer-normalize-default buffer-name))
5594- `display-buffer-default-specifiers'." 5592 (alist (display-buffer-normalize-alist buffer-name label))
5595 (let* ((list (display-buffer-normalize-alist buffer-name label)) 5593 (other-window-means-other-frame
5596 (other-frame (cdr (assq 'other-window-means-other-frame 5594 (or (cdr (assq 'other-window-means-other-frame default))
5597 (or (car list) (cdr list)))))) 5595 (cdr (assq 'other-window-means-other-frame (cdr alist)))))
5596 (arg2 (display-buffer-normalize-argument
5597 buffer-name specifiers other-window-means-other-frame))
5598 (arg3
5599 ;; Handle special meaning of the LABEL argument of
5600 ;; `display-buffer'.
5601 (when (or (memq label '(visible 0 t)) (frame-live-p label))
5602 ;; LABEL must be one of visible (any visible frame), 0 (any
5603 ;; visible or iconfied frame), t (any frame), or a live
5604 ;; frame.
5605 `((reuse-window nil same ,label)))))
5598 (append 5606 (append
5599 ;; Overriding user specifiers. 5607 ;; Overriding user specifiers.
5600 (car list) 5608 (car alist)
5601 ;; Application specifiers. 5609 ;; Special value of third argument of display-buffer.
5602 (display-buffer-normalize-arguments 5610 arg3
5603 buffer-name specifiers label other-frame) 5611 ;; Second argument of display-buffer.
5604 ;; Emacs 23 compatibility specifiers. 5612 arg2
5605 (unless display-buffer-normalize-options-inhibit
5606 (display-buffer-normalize-options buffer-name))
5607 ;; Non-overriding user specifiers. 5613 ;; Non-overriding user specifiers.
5608 (cdr list) 5614 (cdr alist)
5609 ;; Default specifiers. 5615 ;; Default specifiers.
5610 display-buffer-default-specifiers))) 5616 default)))
5611 5617
5612;; Minibuffer-only frames should be documented better. They really 5618;; Minibuffer-only frames should be documented better. They really
5613;; deserve a separate section in the manual. Also 5619;; deserve a separate section in the manual. Also
@@ -5615,7 +5621,7 @@ specifiers:
5615(defun display-buffer-frame (&optional frame) 5621(defun display-buffer-frame (&optional frame)
5616 "Return FRAME if it is live and not a minibuffer-only frame. 5622 "Return FRAME if it is live and not a minibuffer-only frame.
5617Return the value of `last-nonminibuffer-frame' otherwise." 5623Return the value of `last-nonminibuffer-frame' otherwise."
5618 (setq frame (normalize-live-frame frame)) 5624 (setq frame (window-normalize-frame frame))
5619 (if (and (frame-live-p frame) 5625 (if (and (frame-live-p frame)
5620 ;; A not very nice way to get that information. 5626 ;; A not very nice way to get that information.
5621 (not (window-minibuffer-p (frame-root-window frame)))) 5627 (not (window-minibuffer-p (frame-root-window frame))))
@@ -5642,9 +5648,8 @@ For convenience, SPECIFIERS may also consist of a single buffer
5642display location specifier or t, where the latter means to 5648display location specifier or t, where the latter means to
5643display the buffer in any but the selected window. If SPECIFIERS 5649display the buffer in any but the selected window. If SPECIFIERS
5644is nil or omitted, this means to exclusively use the specifiers 5650is nil or omitted, this means to exclusively use the specifiers
5645provided by `display-buffer-alist'. If the value of the latter 5651provided by the variable `display-buffer-alist' and the function
5646is nil too, all specifiers are provided by the constant 5652`display-buffer-normalize-default'.
5647`display-buffer-default-specifiers'.
5648 5653
5649As a special case, the `reuse-window' specifier allows to specify 5654As a special case, the `reuse-window' specifier allows to specify
5650as second element an arbitrary window, as third element an 5655as second element an arbitrary window, as third element an
@@ -5688,7 +5693,7 @@ The result must be a list of valid buffer display specifiers. If
5688`display-buffer-function' is non-nil, call it with the buffer and 5693`display-buffer-function' is non-nil, call it with the buffer and
5689this list as arguments." 5694this list as arguments."
5690 (interactive "BDisplay buffer:\nP") 5695 (interactive "BDisplay buffer:\nP")
5691 (let* ((buffer (normalize-buffer-to-display buffer-or-name)) 5696 (let* ((buffer (window-normalize-buffer-to-display buffer-or-name))
5692 (buffer-name (buffer-name buffer)) 5697 (buffer-name (buffer-name buffer))
5693 (normalized 5698 (normalized
5694 ;; Normalize specifiers. 5699 ;; Normalize specifiers.
@@ -5696,7 +5701,7 @@ this list as arguments."
5696 ;; Don't use a minibuffer frame. 5701 ;; Don't use a minibuffer frame.
5697 (frame (display-buffer-frame)) 5702 (frame (display-buffer-frame))
5698 ;; `window' is the window we use for showing `buffer'. 5703 ;; `window' is the window we use for showing `buffer'.
5699 window specifier method) 5704 window specifier method other-window)
5700 ;; Reset this. 5705 ;; Reset this.
5701 (setq display-buffer-window nil) 5706 (setq display-buffer-window nil)
5702 (if display-buffer-function 5707 (if display-buffer-function
@@ -5712,7 +5717,7 @@ this list as arguments."
5712 (cond 5717 (cond
5713 ((eq method 'reuse-window) 5718 ((eq method 'reuse-window)
5714 (display-buffer-reuse-window 5719 (display-buffer-reuse-window
5715 buffer (cdr specifier) normalized)) 5720 buffer (cdr specifier) normalized other-window))
5716 ((eq method 'pop-up-window) 5721 ((eq method 'pop-up-window)
5717 (display-buffer-pop-up-window 5722 (display-buffer-pop-up-window
5718 buffer (cdr specifier) normalized)) 5723 buffer (cdr specifier) normalized))
@@ -5722,28 +5727,34 @@ this list as arguments."
5722 ((eq method 'use-side-window) 5727 ((eq method 'use-side-window)
5723 (display-buffer-in-side-window 5728 (display-buffer-in-side-window
5724 buffer (nth 1 specifier) (nth 2 specifier) normalized)) 5729 buffer (nth 1 specifier) (nth 2 specifier) normalized))
5725 ((eq method 'fun-with-args) 5730 ((eq method 'function)
5726 (apply (nth 1 specifier) buffer (nth 2 specifier)))))) 5731 (funcall (nth 1 specifier) buffer (nth 2 specifier)))
5732 ((eq method 'other-window)
5733 (setq other-window t)))))
5727 5734
5728 ;; If we don't have a window yet, try a fallback method. All 5735 ;; If we don't have a window yet, try a fallback method. All
5729 ;; specifiers have been used up by now. 5736 ;; specifiers have been used up by now. Try reusing a window
5730 (or (and (window-live-p window) window) 5737 (or (and (window-live-p window) window)
5731 ;; Try reusing a window showing BUFFER on any visible or 5738 ;; on the selected frame,
5732 ;; iconfied frame.
5733 (display-buffer-reuse-window buffer `(nil ,buffer 0))
5734 ;; Try reusing a window not showing BUFFER on any visible or
5735 ;; iconified frame.
5736 (display-buffer-reuse-window buffer '(nil other 0))
5737 ;; Eli says it's better to never try making a new frame.
5738 ;; (display-buffer-pop-up-frame buffer)
5739 ;; Try using a weakly dedicated window.
5740 (display-buffer-reuse-window 5739 (display-buffer-reuse-window
5741 buffer '(nil nil t) '((reuse-window-dedicated . weak))) 5740 buffer '(nil nil nil) nil other-window)
5742 ;; Try using a strongly dedicated window. 5741 ;; showing BUFFER on any visible frame,
5743 (display-buffer-reuse-window 5742 (display-buffer-reuse-window
5744 buffer '(nil nil t) '((reuse-window-dedicated . t))))))) 5743 buffer '(nil same visible) nil other-window)
5744 ;; not showing BUFFER on any visible frame,
5745 (display-buffer-reuse-window
5746 buffer '(nil other visible) nil other-window)
5747 ;; showing BUFFER on any visible or iconified frame,
5748 (display-buffer-reuse-window
5749 buffer '(nil same 0) nil other-window)
5750 ;; not showing BUFFER on any visible or iconified frame.
5751 (display-buffer-reuse-window
5752 buffer '(nil other 0) nil other-window)
5753 ;; If everything failed so far, try popping up a new frame
5754 ;; regardless of graphic-only restrictions.
5755 (display-buffer-pop-up-frame buffer)))))
5745 5756
5746(defsubst display-buffer-same-window (&optional buffer-or-name label) 5757(defsubst display-buffer-same-window (&optional buffer-or-name label)
5747 "Display buffer specified by BUFFER-OR-NAME in the selected window. 5758 "Display buffer specified by BUFFER-OR-NAME in the selected window.
5748Another window will be used only if the buffer can't be shown in 5759Another window will be used only if the buffer can't be shown in
5749the selected window, usually because it is dedicated to another 5760the selected window, usually because it is dedicated to another
@@ -5752,7 +5763,7 @@ buffer. Optional argument BUFFER-OR-NAME and LABEL are as for
5752 (interactive "BDisplay buffer in same window:\nP") 5763 (interactive "BDisplay buffer in same window:\nP")
5753 (display-buffer buffer-or-name 'same-window label)) 5764 (display-buffer buffer-or-name 'same-window label))
5754 5765
5755(defsubst display-buffer-same-frame (&optional buffer-or-name label) 5766(defsubst display-buffer-same-frame (&optional buffer-or-name label)
5756 "Display buffer specified by BUFFER-OR-NAME in a window on the same frame. 5767 "Display buffer specified by BUFFER-OR-NAME in a window on the same frame.
5757Another frame will be used only if there is no other choice. 5768Another frame will be used only if there is no other choice.
5758Optional argument BUFFER-OR-NAME and LABEL are as for 5769Optional argument BUFFER-OR-NAME and LABEL are as for
@@ -5760,7 +5771,7 @@ Optional argument BUFFER-OR-NAME and LABEL are as for
5760 (interactive "BDisplay buffer on same frame:\nP") 5771 (interactive "BDisplay buffer on same frame:\nP")
5761 (display-buffer buffer-or-name 'same-frame label)) 5772 (display-buffer buffer-or-name 'same-frame label))
5762 5773
5763(defsubst display-buffer-other-window (&optional buffer-or-name label) 5774(defsubst display-buffer-other-window (&optional buffer-or-name label)
5764 "Display buffer specified by BUFFER-OR-NAME in another window. 5775 "Display buffer specified by BUFFER-OR-NAME in another window.
5765The selected window will be used only if there is no other 5776The selected window will be used only if there is no other
5766choice. Windows on the selected frame are preferred to windows 5777choice. Windows on the selected frame are preferred to windows
@@ -5769,7 +5780,7 @@ for `display-buffer'."
5769 (interactive "BDisplay buffer in another window:\nP") 5780 (interactive "BDisplay buffer in another window:\nP")
5770 (display-buffer buffer-or-name 'other-window label)) 5781 (display-buffer buffer-or-name 'other-window label))
5771 5782
5772(defun display-buffer-same-frame-other-window (&optional buffer-or-name label) 5783(defun display-buffer-same-frame-other-window (&optional buffer-or-name label)
5773 "Display buffer specified by BUFFER-OR-NAME in another window on the same frame. 5784 "Display buffer specified by BUFFER-OR-NAME in another window on the same frame.
5774The selected window or another frame will be used only if there 5785The selected window or another frame will be used only if there
5775is no other choice. Optional argument BUFFER-OR-NAME and LABEL are 5786is no other choice. Optional argument BUFFER-OR-NAME and LABEL are
@@ -5790,37 +5801,36 @@ If this command uses another frame, it will also select that frame."
5790(defun pop-to-buffer (&optional buffer-or-name specifiers norecord label) 5801(defun pop-to-buffer (&optional buffer-or-name specifiers norecord label)
5791 "Display buffer specified by BUFFER-OR-NAME and select the window used. 5802 "Display buffer specified by BUFFER-OR-NAME and select the window used.
5792Optional argument BUFFER-OR-NAME may be a buffer, a string \(a 5803Optional argument BUFFER-OR-NAME may be a buffer, a string \(a
5793buffer name), or nil. If BUFFER-OR-NAME is a string not naming 5804buffer name), or nil. If BUFFER-OR-NAME is a string naming a buffer
5794an existent buffer, create a buffer with that name. If 5805that does not exist, create a buffer with that name. If
5795BUFFER-OR-NAME is nil or omitted, display the current buffer. 5806BUFFER-OR-NAME is nil or omitted, display the current buffer.
5796Interactively, prompt for the buffer name using the minibuffer. 5807Interactively, prompt for the buffer name using the minibuffer.
5797 5808
5798Optional second argument SPECIFIERS must be a list of buffer 5809Optional second argument SPECIFIERS can be: a list of buffer
5799display specifiers, a single location specifier, `t' which means 5810display specifiers (see `display-buffer-alist'); a single
5800the latter means to display the buffer in any but the selected 5811location specifier; t, which means to display the buffer in any
5801window, or nil which means to exclusively apply the specifiers 5812but the selected window; or nil, which means to exclusively apply
5802customized by the user. 5813the specifiers customized by the user. See `display-buffer' for
5814more details.
5803 5815
5804Optional argument NORECORD non-nil means do not put the buffer 5816Optional argument NORECORD non-nil means do not put the displayed
5805specified by BUFFER-OR-NAME at the front of the buffer list and 5817buffer at the front of the buffer list, and do not make the window
5806do not make the window displaying it the most recently selected 5818displaying it the most recently selected one.
5807one.
5808 5819
5809The optional argument LABEL, if non-nil, is a symbol specifying the 5820The optional argument LABEL, if non-nil, is a symbol specifying the
5810display purpose. Applications should set this when the buffer 5821display purpose. Applications should set this when the buffer
5811shall be displayed in a special way but BUFFER-OR-NAME does not 5822should be displayed in a special way but BUFFER-OR-NAME does not
5812identify the buffer as special. Buffers that typically fit into 5823identify the buffer as special. Buffers that typically fit into
5813this category are those whose names have been derived from the 5824this category are those whose names have been derived from the
5814name of the file they are visiting. 5825name of the file they are visiting.
5815 5826
5816Return the buffer specified by BUFFER-OR-NAME or nil if 5827Returns the displayed buffer, or nil if displaying the buffer failed.
5817displaying the buffer failed.
5818 5828
5819This uses the function `display-buffer' as a subroutine; see the 5829This uses the function `display-buffer' as a subroutine; see the
5820documentations of `display-buffer' and `display-buffer-alist' for 5830documentations of `display-buffer' and `display-buffer-alist' for
5821additional information." 5831additional information."
5822 (interactive "BPop to buffer:\nP") 5832 (interactive "BPop to buffer:\nP")
5823 (let ((buffer (normalize-buffer-to-display buffer-or-name)) 5833 (let ((buffer (window-normalize-buffer-to-display buffer-or-name))
5824 (old-window (selected-window)) 5834 (old-window (selected-window))
5825 (old-frame (selected-frame)) 5835 (old-frame (selected-frame))
5826 new-window new-frame) 5836 new-window new-frame)
@@ -5846,7 +5856,7 @@ as for `pop-to-buffer'."
5846 (interactive "BPop to buffer in selected window:\nP") 5856 (interactive "BPop to buffer in selected window:\nP")
5847 (pop-to-buffer buffer-or-name 'same-window norecord label)) 5857 (pop-to-buffer buffer-or-name 'same-window norecord label))
5848 5858
5849(defsubst pop-to-buffer-same-frame (&optional buffer-or-name norecord label) 5859(defsubst pop-to-buffer-same-frame (&optional buffer-or-name norecord label)
5850 "Pop to buffer specified by BUFFER-OR-NAME in a window on the selected frame. 5860 "Pop to buffer specified by BUFFER-OR-NAME in a window on the selected frame.
5851Another frame will be used only if there is no other choice. 5861Another frame will be used only if there is no other choice.
5852Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are as for 5862Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are as for
@@ -5863,7 +5873,7 @@ LABEL are as for `pop-to-buffer'."
5863 (interactive "BPop to buffer in another window:\nP") 5873 (interactive "BPop to buffer in another window:\nP")
5864 (pop-to-buffer buffer-or-name 'other-window norecord)) 5874 (pop-to-buffer buffer-or-name 'other-window norecord))
5865 5875
5866(defsubst pop-to-buffer-same-frame-other-window (&optional buffer-or-name norecord label) 5876(defsubst pop-to-buffer-same-frame-other-window (&optional buffer-or-name norecord label)
5867 "Pop to buffer specified by BUFFER-OR-NAME in another window on the selected frame. 5877 "Pop to buffer specified by BUFFER-OR-NAME in another window on the selected frame.
5868The selected window or another frame will be used only if there 5878The selected window or another frame will be used only if there
5869is no other choice. Optional arguments BUFFER-OR-NAME, NORECORD 5879is no other choice. Optional arguments BUFFER-OR-NAME, NORECORD
@@ -5902,7 +5912,7 @@ from the list of completions and default values."
5902 (read-buffer prompt (other-buffer (current-buffer)) 5912 (read-buffer prompt (other-buffer (current-buffer))
5903 (confirm-nonexistent-file-or-buffer))))) 5913 (confirm-nonexistent-file-or-buffer)))))
5904 5914
5905(defun normalize-buffer-to-switch-to (buffer-or-name) 5915(defun window-normalize-buffer-to-switch-to (buffer-or-name)
5906 "Normalize BUFFER-OR-NAME argument of buffer switching functions. 5916 "Normalize BUFFER-OR-NAME argument of buffer switching functions.
5907If BUFFER-OR-NAME is nil, return the buffer returned by 5917If BUFFER-OR-NAME is nil, return the buffer returned by
5908`other-buffer'. Else, if a buffer specified by BUFFER-OR-NAME 5918`other-buffer'. Else, if a buffer specified by BUFFER-OR-NAME
@@ -5915,7 +5925,7 @@ buffer with the name BUFFER-OR-NAME and return that buffer."
5915 buffer)) 5925 buffer))
5916 (other-buffer))) 5926 (other-buffer)))
5917 5927
5918(defun switch-to-buffer (buffer-or-name &optional norecord) 5928(defun switch-to-buffer (buffer-or-name &optional norecord force-same-window)
5919 "Switch to buffer BUFFER-OR-NAME in the selected window. 5929 "Switch to buffer BUFFER-OR-NAME in the selected window.
5920If called interactively, prompt for the buffer name using the 5930If called interactively, prompt for the buffer name using the
5921minibuffer. The variable `confirm-nonexistent-file-or-buffer' 5931minibuffer. The variable `confirm-nonexistent-file-or-buffer'
@@ -5931,24 +5941,30 @@ BUFFER-OR-NAME is nil, switch to the buffer returned by
5931Optional argument NORECORD non-nil means do not put the buffer 5941Optional argument NORECORD non-nil means do not put the buffer
5932specified by BUFFER-OR-NAME at the front of the buffer list and 5942specified by BUFFER-OR-NAME at the front of the buffer list and
5933do not make the window displaying it the most recently selected 5943do not make the window displaying it the most recently selected
5934one. Return the buffer switched to. 5944one.
5935 5945
5936This function is intended for interactive use only. Lisp 5946If FORCE-SAME-WINDOW is non-nil, BUFFER-OR-NAME must be displayed
5937functions should call `pop-to-buffer-same-window' instead." 5947in the currently selected window; signal an error if that is
5948impossible (e.g. if the selected window is minibuffer-only).
5949If non-nil, BUFFER-OR-NAME may be displayed in another window.
5950
5951Return the buffer switched to."
5938 (interactive 5952 (interactive
5939 (list (read-buffer-to-switch "Switch to buffer: "))) 5953 (list (read-buffer-to-switch "Switch to buffer: ") nil nil))
5940 (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) 5954 (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
5941 (if (and (or (window-minibuffer-p) (eq (window-dedicated-p) t)) 5955 (if (null force-same-window)
5942 (not (eq buffer (window-buffer)))) 5956 (pop-to-buffer buffer-or-name
5943 ;; Cannot switch to another buffer in a minibuffer or strongly 5957 '(same-window (reuse-window-dedicated . weak))
5944 ;; dedicated window that does not show the buffer already. Call 5958 norecord nil)
5945 ;; `pop-to-buffer' instead. 5959 (cond
5946 (pop-to-buffer buffer 'same-window norecord) 5960 ;; Don't call set-window-buffer if it's not needed since it
5947 (unless (eq buffer (window-buffer)) 5961 ;; might signal an error (e.g. if the window is dedicated).
5948 ;; I'm not sure why we should NOT call `set-window-buffer' here, 5962 ((eq buffer (window-buffer)) nil)
5949 ;; but let's keep things as they are (otherwise we could always 5963 ((window-minibuffer-p)
5950 ;; call `pop-to-buffer-same-window' here). 5964 (error "Cannot switch buffers in minibuffer window"))
5951 (set-window-buffer nil buffer)) 5965 ((eq (window-dedicated-p) t)
5966 (error "Cannot switch buffers in a dedicated window"))
5967 (t (set-window-buffer nil buffer)))
5952 (unless norecord 5968 (unless norecord
5953 (select-window (selected-window))) 5969 (select-window (selected-window)))
5954 (set-buffer buffer)))) 5970 (set-buffer buffer))))
@@ -5963,7 +5979,7 @@ This function is intended for interactive use only. Lisp
5963functions should call `pop-to-buffer-same-frame' instead." 5979functions should call `pop-to-buffer-same-frame' instead."
5964 (interactive 5980 (interactive
5965 (list (read-buffer-to-switch "Switch to buffer in other window: "))) 5981 (list (read-buffer-to-switch "Switch to buffer in other window: ")))
5966 (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) 5982 (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
5967 (pop-to-buffer buffer 'same-frame norecord))) 5983 (pop-to-buffer buffer 'same-frame norecord)))
5968 5984
5969(defun switch-to-buffer-other-window (buffer-or-name &optional norecord) 5985(defun switch-to-buffer-other-window (buffer-or-name &optional norecord)
@@ -5977,7 +5993,7 @@ This function is intended for interactive use only. Lisp
5977functions should call `pop-to-buffer-other-window' instead." 5993functions should call `pop-to-buffer-other-window' instead."
5978 (interactive 5994 (interactive
5979 (list (read-buffer-to-switch "Switch to buffer in other window: "))) 5995 (list (read-buffer-to-switch "Switch to buffer in other window: ")))
5980 (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) 5996 (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
5981 (pop-to-buffer buffer 'other-window norecord))) 5997 (pop-to-buffer buffer 'other-window norecord)))
5982 5998
5983(defun switch-to-buffer-other-window-same-frame (buffer-or-name &optional norecord) 5999(defun switch-to-buffer-other-window-same-frame (buffer-or-name &optional norecord)
@@ -5991,7 +6007,7 @@ functions should call `pop-to-buffer-other-window-same-frame'
5991instead." 6007instead."
5992 (interactive 6008 (interactive
5993 (list (read-buffer-to-switch "Switch to buffer in other window: "))) 6009 (list (read-buffer-to-switch "Switch to buffer in other window: ")))
5994 (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) 6010 (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
5995 (pop-to-buffer buffer 'same-frame-other-window norecord))) 6011 (pop-to-buffer buffer 'same-frame-other-window norecord)))
5996 6012
5997(defun switch-to-buffer-other-frame (buffer-or-name &optional norecord) 6013(defun switch-to-buffer-other-frame (buffer-or-name &optional norecord)
@@ -6004,7 +6020,7 @@ This function is intended for interactive use only. Lisp
6004functions should call `pop-to-buffer-other-frame' instead." 6020functions should call `pop-to-buffer-other-frame' instead."
6005 (interactive 6021 (interactive
6006 (list (read-buffer-to-switch "Switch to buffer in other frame: "))) 6022 (list (read-buffer-to-switch "Switch to buffer in other frame: ")))
6007 (let ((buffer (normalize-buffer-to-switch-to buffer-or-name))) 6023 (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
6008 (pop-to-buffer buffer 'other-frame norecord))) 6024 (pop-to-buffer buffer 'other-frame norecord)))
6009 6025
6010;;; Obsolete definitions of `display-buffer' below. 6026;;; Obsolete definitions of `display-buffer' below.
@@ -6022,9 +6038,9 @@ ignored.
6022See also `same-window-regexps'." 6038See also `same-window-regexps'."
6023 :type '(repeat (string :format "%v")) 6039 :type '(repeat (string :format "%v"))
6024 :group 'windows) 6040 :group 'windows)
6025(make-obsolete-variable 6041;; (make-obsolete-variable
6026 'same-window-buffer-names 6042 ;; 'same-window-buffer-names
6027 "use 2nd arg of `display-buffer' instead." "24.1") 6043 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6028 6044
6029(defcustom same-window-regexps nil 6045(defcustom same-window-regexps nil
6030 "List of regexps saying which buffers should appear in the \"same\" window. 6046 "List of regexps saying which buffers should appear in the \"same\" window.
@@ -6040,9 +6056,9 @@ the buffer name. This is for compatibility with
6040See also `same-window-buffer-names'." 6056See also `same-window-buffer-names'."
6041 :type '(repeat (regexp :format "%v")) 6057 :type '(repeat (regexp :format "%v"))
6042 :group 'windows) 6058 :group 'windows)
6043(make-obsolete-variable 6059;; (make-obsolete-variable
6044 'same-window-regexps 6060 ;; 'same-window-regexps
6045 "use 2nd arg of `display-buffer' instead." "24.1") 6061 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6046 6062
6047(defun same-window-p (buffer-name) 6063(defun same-window-p (buffer-name)
6048 "Return non-nil if a buffer named BUFFER-NAME would be shown in the \"same\" window. 6064 "Return non-nil if a buffer named BUFFER-NAME would be shown in the \"same\" window.
@@ -6067,8 +6083,8 @@ selected rather than \(as usual\) some other window. See
6067 (and (consp regexp) (stringp (car regexp)) 6083 (and (consp regexp) (stringp (car regexp))
6068 (string-match-p (car regexp) buffer-name))) 6084 (string-match-p (car regexp) buffer-name)))
6069 (throw 'found t)))))))) 6085 (throw 'found t))))))))
6070(make-obsolete 6086;; (make-obsolete
6071 'same-window-p "pass argument to buffer display function instead." "24.1") 6087 ;; 'same-window-p "pass argument to buffer display function instead." "24.1")
6072 6088
6073(defcustom special-display-frame-alist 6089(defcustom special-display-frame-alist
6074 '((height . 14) (width . 80) (unsplittable . t)) 6090 '((height . 14) (width . 80) (unsplittable . t))
@@ -6086,9 +6102,9 @@ These supersede the values given in `default-frame-alist'."
6086 (symbol :tag "Parameter") 6102 (symbol :tag "Parameter")
6087 (sexp :tag "Value"))) 6103 (sexp :tag "Value")))
6088 :group 'frames) 6104 :group 'frames)
6089(make-obsolete-variable 6105;; (make-obsolete-variable
6090 'special-display-frame-alist 6106 ;; 'special-display-frame-alist
6091 "use 2nd arg of `display-buffer' instead." "24.1") 6107 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6092 6108
6093(defun special-display-popup-frame (buffer &optional args) 6109(defun special-display-popup-frame (buffer &optional args)
6094 "Display BUFFER in a special frame and return the window chosen. 6110 "Display BUFFER in a special frame and return the window chosen.
@@ -6103,7 +6119,7 @@ BUFFER in a window on the selected frame.
6103 6119
6104If ARGS is a list whose car is a symbol, use (car ARGS) as a 6120If ARGS is a list whose car is a symbol, use (car ARGS) as a
6105function to do the work. Pass it BUFFER as first argument, 6121function to do the work. Pass it BUFFER as first argument,
6106and (cdr ARGS) as second." 6122and (cdr ARGS) as the rest of the arguments."
6107 (if (and args (symbolp (car args))) 6123 (if (and args (symbolp (car args)))
6108 (apply (car args) buffer (cdr args)) 6124 (apply (car args) buffer (cdr args))
6109 (let ((window (get-buffer-window buffer 0))) 6125 (let ((window (get-buffer-window buffer 0)))
@@ -6134,9 +6150,9 @@ and (cdr ARGS) as second."
6134 (set-window-buffer (frame-selected-window frame) buffer) 6150 (set-window-buffer (frame-selected-window frame) buffer)
6135 (set-window-dedicated-p (frame-selected-window frame) t) 6151 (set-window-dedicated-p (frame-selected-window frame) t)
6136 (frame-selected-window frame)))))) 6152 (frame-selected-window frame))))))
6137(make-obsolete 6153;; (make-obsolete
6138 'special-display-popup-frame 6154 ;; 'special-display-popup-frame
6139 "use 2nd arg of `display-buffer' instead." "24.1") 6155 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6140 6156
6141(defcustom special-display-function 'special-display-popup-frame 6157(defcustom special-display-function 'special-display-popup-frame
6142 "Function to call for displaying special buffers. 6158 "Function to call for displaying special buffers.
@@ -6153,9 +6169,9 @@ A buffer is special when its name is either listed in
6153 :type 'function 6169 :type 'function
6154 :group 'windows 6170 :group 'windows
6155 :group 'frames) 6171 :group 'frames)
6156(make-obsolete-variable 6172;; (make-obsolete-variable
6157 'special-display-function 6173 ;; 'special-display-function
6158 "use 2nd arg of `display-buffer' instead." "24.1") 6174 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6159 6175
6160(defcustom special-display-buffer-names nil 6176(defcustom special-display-buffer-names nil
6161 "List of names of buffers that should be displayed specially. 6177 "List of names of buffers that should be displayed specially.
@@ -6220,9 +6236,9 @@ See also `special-display-regexps'."
6220 (repeat :tag "Arguments" (sexp))))) 6236 (repeat :tag "Arguments" (sexp)))))
6221 :group 'windows 6237 :group 'windows
6222 :group 'frames) 6238 :group 'frames)
6223(make-obsolete-variable 6239;; (make-obsolete-variable
6224 'special-display-buffer-names 6240 ;; 'special-display-buffer-names
6225 "use 2nd arg of `display-buffer' instead." "24.1") 6241 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6226 6242
6227;;;###autoload 6243;;;###autoload
6228(put 'special-display-buffer-names 'risky-local-variable t) 6244(put 'special-display-buffer-names 'risky-local-variable t)
@@ -6291,9 +6307,9 @@ See also `special-display-buffer-names'."
6291 (repeat :tag "Arguments" (sexp))))) 6307 (repeat :tag "Arguments" (sexp)))))
6292 :group 'windows 6308 :group 'windows
6293 :group 'frames) 6309 :group 'frames)
6294(make-obsolete-variable 6310;; (make-obsolete-variable
6295 'special-display-regexps 6311 ;; 'special-display-regexps
6296 "use 2nd arg of `display-buffer' instead." "24.1") 6312 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6297 6313
6298(defun special-display-p (buffer-name) 6314(defun special-display-p (buffer-name)
6299 "Return non-nil if a buffer named BUFFER-NAME gets a special frame. 6315 "Return non-nil if a buffer named BUFFER-NAME gets a special frame.
@@ -6321,9 +6337,9 @@ entry."
6321 ((and (consp regexp) (stringp (car regexp)) 6337 ((and (consp regexp) (stringp (car regexp))
6322 (string-match-p (car regexp) buffer-name)) 6338 (string-match-p (car regexp) buffer-name))
6323 (throw 'found (cdr regexp)))))))))) 6339 (throw 'found (cdr regexp))))))))))
6324(make-obsolete 6340;; (make-obsolete
6325 'special-display-p 6341 ;; 'special-display-p
6326 "pass argument to buffer display function instead." "24.1") 6342 ;; "pass argument to buffer display function instead." "24.1")
6327 6343
6328(defcustom pop-up-frame-alist nil 6344(defcustom pop-up-frame-alist nil
6329 "Alist of parameters for automatically generated new frames. 6345 "Alist of parameters for automatically generated new frames.
@@ -6343,9 +6359,9 @@ affected by this variable."
6343 (symbol :tag "Parameter") 6359 (symbol :tag "Parameter")
6344 (sexp :tag "Value"))) 6360 (sexp :tag "Value")))
6345 :group 'frames) 6361 :group 'frames)
6346(make-obsolete-variable 6362;; (make-obsolete-variable
6347 'pop-up-frame-alist 6363 ;; 'pop-up-frame-alist
6348 "use 2nd arg of `display-buffer' instead." "24.1") 6364 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6349 6365
6350(defcustom pop-up-frame-function 6366(defcustom pop-up-frame-function
6351 (lambda () (make-frame pop-up-frame-alist)) 6367 (lambda () (make-frame pop-up-frame-alist))
@@ -6355,9 +6371,9 @@ frame. The default value calls `make-frame' with the argument
6355`pop-up-frame-alist'." 6371`pop-up-frame-alist'."
6356 :type 'function 6372 :type 'function
6357 :group 'frames) 6373 :group 'frames)
6358(make-obsolete-variable 6374;; (make-obsolete-variable
6359 'pop-up-frame-function 6375 ;; 'pop-up-frame-function
6360 "use 2nd arg of `display-buffer' instead." "24.1") 6376 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6361 6377
6362(defcustom pop-up-frames nil 6378(defcustom pop-up-frames nil
6363 "Whether `display-buffer' should make a separate frame. 6379 "Whether `display-buffer' should make a separate frame.
@@ -6371,9 +6387,9 @@ Any other non-nil value means always make a separate frame."
6371 (const :tag "Always" t)) 6387 (const :tag "Always" t))
6372 :group 'windows 6388 :group 'windows
6373 :group 'frames) 6389 :group 'frames)
6374(make-obsolete-variable 6390;; (make-obsolete-variable
6375 'pop-up-frames 6391 ;; 'pop-up-frames
6376 "use 2nd arg of `display-buffer' instead." "24.1") 6392 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6377 6393
6378(defcustom display-buffer-reuse-frames nil 6394(defcustom display-buffer-reuse-frames nil
6379 "Set and non-nil means `display-buffer' should reuse frames. 6395 "Set and non-nil means `display-buffer' should reuse frames.
@@ -6383,18 +6399,17 @@ that frame."
6383 :version "21.1" 6399 :version "21.1"
6384 :group 'windows 6400 :group 'windows
6385 :group 'frames) 6401 :group 'frames)
6386(make-obsolete-variable 6402;; (make-obsolete-variable
6387 'display-buffer-reuse-frames 6403 ;; 'display-buffer-reuse-frames
6388 "use 2nd arg of `display-buffer' instead." "24.1") 6404 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6389 6405
6390(defcustom pop-up-windows 'unset ; t 6406(defcustom pop-up-windows t
6391 "Set and non-nil means `display-buffer' should make a new window." 6407 "Non-nil means `display-buffer' should make a new window."
6392 :type 'boolean 6408 :type 'boolean
6393 :version "24.1"
6394 :group 'windows) 6409 :group 'windows)
6395(make-obsolete-variable 6410;; (make-obsolete-variable
6396 'pop-up-windows 6411 ;; 'pop-up-windows
6397 "use 2nd arg of `display-buffer' instead." "24.1") 6412 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6398 6413
6399(defcustom split-window-preferred-function 'split-window-sensibly 6414(defcustom split-window-preferred-function 'split-window-sensibly
6400 "Function called by `display-buffer' to split a window. 6415 "Function called by `display-buffer' to split a window.
@@ -6421,9 +6436,9 @@ not want to split the selected window."
6421 :type 'function 6436 :type 'function
6422 :version "23.1" 6437 :version "23.1"
6423 :group 'windows) 6438 :group 'windows)
6424(make-obsolete-variable 6439;; (make-obsolete-variable
6425 'split-window-preferred-function 6440 ;; 'split-window-preferred-function
6426 "use 2nd arg of `display-buffer' instead." "24.1") 6441 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6427 6442
6428(defcustom split-height-threshold 80 6443(defcustom split-height-threshold 80
6429 "Minimum height for splitting a window to display a buffer. 6444 "Minimum height for splitting a window to display a buffer.
@@ -6435,9 +6450,9 @@ split it vertically disregarding the value of this variable."
6435 :type '(choice (const nil) (integer :tag "lines")) 6450 :type '(choice (const nil) (integer :tag "lines"))
6436 :version "23.1" 6451 :version "23.1"
6437 :group 'windows) 6452 :group 'windows)
6438(make-obsolete-variable 6453;; (make-obsolete-variable
6439 'split-height-threshold 6454 ;; 'split-height-threshold
6440 "use 2nd arg of `display-buffer' instead." "24.1") 6455 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6441 6456
6442(defcustom split-width-threshold 160 6457(defcustom split-width-threshold 160
6443 "Minimum width for splitting a window to display a buffer. 6458 "Minimum width for splitting a window to display a buffer.
@@ -6447,29 +6462,28 @@ is nil, `display-buffer' cannot split windows horizontally."
6447 :type '(choice (const nil) (integer :tag "columns")) 6462 :type '(choice (const nil) (integer :tag "columns"))
6448 :version "23.1" 6463 :version "23.1"
6449 :group 'windows) 6464 :group 'windows)
6450(make-obsolete-variable 6465;; (make-obsolete-variable
6451 'split-width-threshold 6466 ;; 'split-width-threshold
6452 "use 2nd arg of `display-buffer' instead." "24.1") 6467 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6453 6468
6454(defcustom even-window-heights 'unset ; t 6469(defcustom even-window-heights t
6455 "If set and non-nil `display-buffer' will try to even window heights. 6470 "If non-nil `display-buffer' will try to even window heights.
6456Otherwise `display-buffer' will leave the window configuration 6471Otherwise `display-buffer' will leave the window configuration
6457alone. Heights are evened only when `display-buffer' reuses a 6472alone. Heights are evened only when `display-buffer' chooses a
6458window that appears above or below the selected window." 6473window that appears above or below the selected window."
6459 :type 'boolean 6474 :type 'boolean
6460 :version "24.1"
6461 :group 'windows) 6475 :group 'windows)
6462(make-obsolete-variable 6476;; (make-obsolete-variable
6463 'even-window-heights 6477 ;; 'even-window-heights
6464 "use 2nd arg of `display-buffer' instead." "24.1") 6478 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6465 6479
6466(defvar display-buffer-mark-dedicated nil 6480(defvar display-buffer-mark-dedicated nil
6467 "Non-nil means `display-buffer' marks the windows it creates as dedicated. 6481 "Non-nil means `display-buffer' marks the windows it creates as dedicated.
6468The actual non-nil value of this variable will be copied to the 6482The actual non-nil value of this variable will be copied to the
6469`window-dedicated-p' flag.") 6483`window-dedicated-p' flag.")
6470(make-obsolete-variable 6484;; (make-obsolete-variable
6471 'display-buffer-mark-dedicated 6485 ;; 'display-buffer-mark-dedicated
6472 "use 2nd arg of `display-buffer' instead." "24.1") 6486 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6473 6487
6474(defun window-splittable-p (window &optional horizontal) 6488(defun window-splittable-p (window &optional horizontal)
6475 "Return non-nil if `split-window-sensibly' may split WINDOW. 6489 "Return non-nil if `split-window-sensibly' may split WINDOW.
@@ -6520,8 +6534,8 @@ hold:
6520 (max split-height-threshold 6534 (max split-height-threshold
6521 (* 2 (max window-min-height 6535 (* 2 (max window-min-height
6522 (if mode-line-format 2 1)))))))))) 6536 (if mode-line-format 2 1))))))))))
6523(make-obsolete 6537;; (make-obsolete
6524 'window-splittable-p "use 2nd arg of `display-buffer' instead." "24.1") 6538 ;; 'window-splittable-p "use 2nd arg of `display-buffer' instead." "24.1")
6525 6539
6526(defun split-window-sensibly (window) 6540(defun split-window-sensibly (window)
6527 "Split WINDOW in a way suitable for `display-buffer'. 6541 "Split WINDOW in a way suitable for `display-buffer'.
@@ -6571,8 +6585,8 @@ split."
6571 (when (with-no-warnings (window-splittable-p window)) 6585 (when (with-no-warnings (window-splittable-p window))
6572 (with-selected-window window 6586 (with-selected-window window
6573 (split-window-vertically))))))) 6587 (split-window-vertically)))))))
6574(make-obsolete 6588;; (make-obsolete
6575 'split-window-sensibly "use 2nd arg of `display-buffer' instead." "24.1") 6589 ;; 'split-window-sensibly "use 2nd arg of `display-buffer' instead." "24.1")
6576 6590
6577;; Functions for converting Emacs 23 buffer display options to buffer 6591;; Functions for converting Emacs 23 buffer display options to buffer
6578;; display specifiers. 6592;; display specifiers.
@@ -6627,7 +6641,7 @@ value of `display-buffer-alist'."
6627 1.0))) 6641 1.0)))
6628 (list 6642 (list
6629 'pop-up-window 6643 'pop-up-window
6630 (when pop-up-windows ; unset qualifies as t 6644 (when pop-up-windows
6631 (list 6645 (list
6632 'pop-up-window 6646 'pop-up-window
6633 (cons 'largest fun) 6647 (cons 'largest fun)
@@ -6657,8 +6671,8 @@ value of `display-buffer-alist'."
6657 (display-buffer-alist-add 6671 (display-buffer-alist-add
6658 `((regexp . ,entry)) 6672 `((regexp . ,entry))
6659 (list 6673 (list
6660 'fun-with-args 6674 'function
6661 (list 'fun-with-args special-display-function 6675 (list 'function special-display-function
6662 special-display-frame-alist)) 6676 special-display-frame-alist))
6663 no-custom)) 6677 no-custom))
6664 ((consp entry) 6678 ((consp entry)
@@ -6670,9 +6684,9 @@ value of `display-buffer-alist'."
6670 (display-buffer-alist-add 6684 (display-buffer-alist-add
6671 `((name . ,name)) 6685 `((name . ,name))
6672 (list 6686 (list
6673 'fun-with-args 6687 'function
6674 ;; Weary. 6688 ;; Weary.
6675 (list 'fun-with-args (car rest) (cadr rest))) 6689 (list 'function (car rest) (cadr rest)))
6676 no-custom)) 6690 no-custom))
6677 ((listp rest) 6691 ((listp rest)
6678 ;; A list of parameters. 6692 ;; A list of parameters.
@@ -6691,8 +6705,8 @@ value of `display-buffer-alist'."
6691 (display-buffer-alist-add 6705 (display-buffer-alist-add
6692 `((name . ,name)) 6706 `((name . ,name))
6693 (list 6707 (list
6694 'fun-with-args 6708 'function
6695 (list 'fun-with-args special-display-function 6709 (list 'function special-display-function
6696 special-display-frame-alist)) 6710 special-display-frame-alist))
6697 no-custom))))))))) 6711 no-custom)))))))))
6698 6712
@@ -6704,8 +6718,8 @@ value of `display-buffer-alist'."
6704 (display-buffer-alist-add 6718 (display-buffer-alist-add
6705 `((name . ,entry)) 6719 `((name . ,entry))
6706 (list 6720 (list
6707 'fun-with-args 6721 'function
6708 (list 'fun-with-args special-display-function 6722 (list 'function special-display-function
6709 special-display-frame-alist)) 6723 special-display-frame-alist))
6710 no-custom)) 6724 no-custom))
6711 ((consp entry) 6725 ((consp entry)
@@ -6717,9 +6731,9 @@ value of `display-buffer-alist'."
6717 (display-buffer-alist-add 6731 (display-buffer-alist-add
6718 `((name . ,name)) 6732 `((name . ,name))
6719 (list 6733 (list
6720 'fun-with-args 6734 'function
6721 ;; Weary. 6735 ;; Weary.
6722 (list 'fun-with-args (car rest) (cadr rest))) 6736 (list 'function (car rest) (cadr rest)))
6723 no-custom)) 6737 no-custom))
6724 ((listp rest) 6738 ((listp rest)
6725 ;; A list of parameters. 6739 ;; A list of parameters.
@@ -6738,8 +6752,8 @@ value of `display-buffer-alist'."
6738 (display-buffer-alist-add 6752 (display-buffer-alist-add
6739 `((name . ,name)) 6753 `((name . ,name))
6740 (list 6754 (list
6741 'fun-with-args 6755 'function
6742 (list 'fun-with-args special-display-function 6756 (list 'function special-display-function
6743 special-display-frame-alist)) 6757 special-display-frame-alist))
6744 no-custom))))))))) 6758 no-custom)))))))))
6745 6759
@@ -6781,7 +6795,7 @@ value of `display-buffer-alist'."
6781 ;; "0" (all visible and iconified frames) is hardcoded in 6795 ;; "0" (all visible and iconified frames) is hardcoded in
6782 ;; Emacs 23. 6796 ;; Emacs 23.
6783 0)) 6797 0))
6784 (unless (memq even-window-heights '(nil unset)) 6798 (when even-window-heights
6785 (cons 'reuse-window-even-sizes t))) 6799 (cons 'reuse-window-even-sizes t)))
6786 no-custom) 6800 no-custom)
6787 6801
@@ -6790,7 +6804,7 @@ value of `display-buffer-alist'."
6790 (display-buffer-alist-add 6804 (display-buffer-alist-add
6791 nil 6805 nil
6792 (list 6806 (list
6793 (cons 'dedicated display-buffer-mark-dedicated)) 6807 (cons 'dedicate display-buffer-mark-dedicated))
6794 no-custom))) 6808 no-custom)))
6795 6809
6796 display-buffer-alist) 6810 display-buffer-alist)
@@ -6805,7 +6819,7 @@ Note that the current implementation of this function cannot
6805always set the height exactly, but attempts to be conservative, 6819always set the height exactly, but attempts to be conservative,
6806by allocating more lines than are actually needed in the case 6820by allocating more lines than are actually needed in the case
6807where some error may be present." 6821where some error may be present."
6808 (setq window (normalize-live-window window)) 6822 (setq window (window-normalize-live-window window))
6809 (let ((delta (- height (window-text-height window)))) 6823 (let ((delta (- height (window-text-height window))))
6810 (unless (zerop delta) 6824 (unless (zerop delta)
6811 ;; Setting window-min-height to a value like 1 can lead to very 6825 ;; Setting window-min-height to a value like 1 can lead to very
@@ -6901,9 +6915,9 @@ WINDOW was scrolled."
6901 (interactive) 6915 (interactive)
6902 ;; Do all the work in WINDOW and its buffer and restore the selected 6916 ;; Do all the work in WINDOW and its buffer and restore the selected
6903 ;; window and the current buffer when we're done. 6917 ;; window and the current buffer when we're done.
6904 (setq window (normalize-live-window window)) 6918 (setq window (window-normalize-live-window window))
6905 ;; Can't resize a full height or fixed-size window. 6919 ;; Can't resize a full height or fixed-size window.
6906 (unless (or (window-size-fixed-p window) 6920 (unless (or (window-size-fixed-p window)
6907 (window-full-height-p window)) 6921 (window-full-height-p window))
6908 ;; `with-selected-window' should orderly restore the current buffer. 6922 ;; `with-selected-window' should orderly restore the current buffer.
6909 (with-selected-window window 6923 (with-selected-window window
@@ -6996,8 +7010,8 @@ WINDOW defaults to the selected window."
6996 ;; `window-iso-combined-p' instead should handle that. 7010 ;; `window-iso-combined-p' instead should handle that.
6997 (or (= (nth 2 edges) (nth 2 (window-edges (previous-window)))) 7011 (or (= (nth 2 edges) (nth 2 (window-edges (previous-window))))
6998 (= (nth 0 edges) (nth 0 (window-edges (next-window)))))))) 7012 (= (nth 0 edges) (nth 0 (window-edges (next-window))))))))
6999(make-obsolete 7013;; (make-obsolete
7000 'window-safely-shrinkable-p "use `window-iso-combined-p' instead." "24.1") 7014 ;; 'window-safely-shrinkable-p "use `window-iso-combined-p' instead." "24.1")
7001 7015
7002(defun shrink-window-if-larger-than-buffer (&optional window) 7016(defun shrink-window-if-larger-than-buffer (&optional window)
7003 "Shrink height of WINDOW if its buffer doesn't need so many lines. 7017 "Shrink height of WINDOW if its buffer doesn't need so many lines.
@@ -7013,7 +7027,7 @@ window, or if the window is the only window of its frame.
7013 7027
7014Return non-nil if the window was shrunk, nil otherwise." 7028Return non-nil if the window was shrunk, nil otherwise."
7015 (interactive) 7029 (interactive)
7016 (setq window (normalize-live-window window)) 7030 (setq window (window-normalize-live-window window))
7017 ;; Make sure that WINDOW is vertically combined and `point-min' is 7031 ;; Make sure that WINDOW is vertically combined and `point-min' is
7018 ;; visible (for whatever reason that's needed). The remaining issues 7032 ;; visible (for whatever reason that's needed). The remaining issues
7019 ;; should be taken care of by `fit-window-to-buffer'. 7033 ;; should be taken care of by `fit-window-to-buffer'.
diff --git a/lisp/winner.el b/lisp/winner.el
index e5855ad8aac..70038362c2e 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -145,7 +145,7 @@ You may want to include buffer names such as *Help*, *Apropos*,
145 145
146;;; Saved configurations 146;;; Saved configurations
147 147
148;; This variable contains the window cofiguration rings. 148;; This variable contains the window configuration rings.
149;; The key in this alist is the frame. 149;; The key in this alist is the frame.
150(defvar winner-ring-alist nil) 150(defvar winner-ring-alist nil)
151 151
diff --git a/lisp/woman.el b/lisp/woman.el
index eb801b55d4d..c6bd4a4c8d1 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -2157,8 +2157,8 @@ No external programs are used."
2157 (run-hooks 'woman-pre-format-hook) 2157 (run-hooks 'woman-pre-format-hook)
2158 (and (boundp 'font-lock-mode) font-lock-mode (font-lock-mode -1)) 2158 (and (boundp 'font-lock-mode) font-lock-mode (font-lock-mode -1))
2159 ;; (fundamental-mode) 2159 ;; (fundamental-mode)
2160 (let ((start-time (current-time)) ; (HIGH LOW MICROSEC) 2160 (let ((start-time (current-time))
2161 time) ; HIGH * 2**16 + LOW seconds 2161 time)
2162 (message "WoMan formatting buffer...") 2162 (message "WoMan formatting buffer...")
2163; (goto-char (point-min)) 2163; (goto-char (point-min))
2164; (cond 2164; (cond
@@ -2167,10 +2167,8 @@ No external programs are used."
2167; (delete-region (point-min) (point))) ; potentially dangerous! 2167; (delete-region (point-min) (point))) ; potentially dangerous!
2168; (t (message "WARNING: .TH request not found -- not man-page format?"))) 2168; (t (message "WARNING: .TH request not found -- not man-page format?")))
2169 (woman-decode-region (point-min) (point-max)) 2169 (woman-decode-region (point-min) (point-max))
2170 (setq time (current-time) 2170 (setq time (float-time (time-since start-time)))
2171 time (+ (* (- (car time) (car start-time)) 65536) 2171 (message "WoMan formatting buffer...done in %g seconds" time)
2172 (- (cadr time) (cadr start-time))))
2173 (message "WoMan formatting buffer...done in %d seconds" time)
2174 (WoMan-log-end time)) 2172 (WoMan-log-end time))
2175 (run-hooks 'woman-post-format-hook)) 2173 (run-hooks 'woman-post-format-hook))
2176 2174
@@ -4529,7 +4527,7 @@ IGNORED is a string appended to the log message."
4529 "Log the end of formatting in *WoMan-Log*. 4527 "Log the end of formatting in *WoMan-Log*.
4530TIME specifies the time it took to format the man page, to be printed 4528TIME specifies the time it took to format the man page, to be printed
4531with the message." 4529with the message."
4532 (WoMan-log-1 (format "Formatting time %d seconds." time) 'end)) 4530 (WoMan-log-1 (format "Formatting time %g seconds." time) 'end))
4533 4531
4534(defun WoMan-log-1 (string &optional end) 4532(defun WoMan-log-1 (string &optional end)
4535 "Log a message STRING in *WoMan-Log*. 4533 "Log a message STRING in *WoMan-Log*.