aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2004-04-23 14:44:11 +0000
committerKaroly Lorentey2004-04-23 14:44:11 +0000
commitced7ed5611e2a6e60a5ac7a97e165545843d0fa9 (patch)
tree85194b67c680d1a37af652a4b614a7e1fcd336ba /lisp
parent6ad9aaa961f1ac376bdaa1a5516d0481e6c7fafa (diff)
parentf24814e0e9806db8d01c16b8d8592d6e9b9ee481 (diff)
downloademacs-ced7ed5611e2a6e60a5ac7a97e165545843d0fa9.tar.gz
emacs-ced7ed5611e2a6e60a5ac7a97e165545843d0fa9.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-230 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-231 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-232 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-233 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-234 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-235 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-236 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-237 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-238 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-239 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-240 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-152
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog314
-rw-r--r--lisp/ChangeLog.1016
-rw-r--r--lisp/Makefile.in2
-rw-r--r--lisp/add-log.el2
-rw-r--r--lisp/autoinsert.el2
-rw-r--r--lisp/calendar/time-date.el2
-rw-r--r--lisp/cvs-status.el42
-rw-r--r--lisp/dabbrev.el29
-rw-r--r--lisp/descr-text.el17
-rw-r--r--lisp/desktop.el240
-rw-r--r--lisp/diff-mode.el13
-rw-r--r--lisp/dired.el44
-rw-r--r--lisp/emacs-lisp/byte-run.el5
-rw-r--r--lisp/emacs-lisp/bytecomp.el6
-rw-r--r--lisp/emacs-lisp/checkdoc.el49
-rw-r--r--lisp/emacs-lisp/disass.el4
-rw-r--r--lisp/emacs-lisp/easymenu.el4
-rw-r--r--lisp/font-lock.el17
-rw-r--r--lisp/frame.el9
-rw-r--r--lisp/gnus/mailcap.el1
-rw-r--r--lisp/help-fns.el22
-rw-r--r--lisp/help-mode.el11
-rw-r--r--lisp/image.el44
-rw-r--r--lisp/info.el61
-rw-r--r--lisp/international/mule-cmds.el10
-rw-r--r--lisp/international/mule-util.el22
-rw-r--r--lisp/international/mule.el4
-rw-r--r--lisp/international/quail.el32
-rw-r--r--lisp/iswitchb.el8
-rw-r--r--lisp/mail/rmail.el17
-rw-r--r--lisp/makefile.w32-in7
-rw-r--r--lisp/menu-bar.el3
-rw-r--r--lisp/mh-e/mh-e.el11
-rw-r--r--lisp/net/telnet.el20
-rw-r--r--lisp/progmodes/cc-cmds.el2
-rw-r--r--lisp/progmodes/compile.el302
-rw-r--r--lisp/progmodes/cperl-mode.el9
-rw-r--r--lisp/progmodes/gdb-ui.el48
-rw-r--r--lisp/progmodes/python.el2
-rw-r--r--lisp/recentf.el17
-rw-r--r--lisp/replace.el20
-rw-r--r--lisp/simple.el137
-rw-r--r--lisp/subr.el17
-rw-r--r--lisp/textmodes/fill.el10
-rw-r--r--lisp/textmodes/paragraphs.el62
-rw-r--r--lisp/vc-svn.el15
-rw-r--r--lisp/view.el1
-rw-r--r--lisp/window.el5
-rw-r--r--lisp/x-dnd.el18
49 files changed, 1152 insertions, 603 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 513c24e28d9..9d0215df2e4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,252 @@
12004-04-23 Kenichi Handa <handa@m17n.org>
2
3 * international/mule-util.el (char-displayable-p): Simplified by
4 using internal-char-font.
5
62004-04-23 Juanma Barranquero <lektu@terra.es>
7
8 * makefile.w32-in: Add "-*- makefile -*-" mode tag.
9
102004-04-22 Stefan Monnier <monnier@iro.umontreal.ca>
11
12 * diff-mode.el (diff-next-error): New fun.
13 (diff-mode): Use it.
14
15 * simple.el (next-error): Change arg name.
16 Add support for the documented C-u C-x ` usage.
17
18 * frame.el (special-display-popup-frame, next-multiframe-window)
19 (previous-multiframe-window): Only consider frames on same display.
20
212004-04-22 Lars Hansen <larsh@math.ku.dk>
22
23 * info.el (Info-restore-desktop-buffer): Delete with-no-warnings.
24 * mh-e/mh-e.el (mh-restore-desktop-buffer): Delete with-no-warnings.
25
262004-04-22 Kim F. Storm <storm@cua.dk>
27
28 * net/telnet.el (telnet): Add optional port arg.
29
302004-04-21 Stefan Monnier <monnier@iro.umontreal.ca>
31
32 * progmodes/compile.el (compilation-mode-font-lock-keywords):
33 Minor sanity check on the `hyperlink' slot.
34
35 * Makefile.in (recompile): Compile new files.
36
37 * emacs-lisp/bytecomp.el (batch-byte-recompile-directory):
38 Add byte-recompile-directory's optional `arg'.
39
40 * cvs-status.el (cvs-tree-use-charset): New var.
41 (cvs-tree-char-space, cvs-tree-char-hbar, cvs-tree-char-vbar)
42 (cvs-tree-char-branch, cvs-tree-char-eob, cvs-tree-char-bob)
43 (cvs-status-cvstrees): Use it.
44
45 * emacs-lisp/checkdoc.el (checkdoc-output-mode):
46 Make it a normal major mode.
47 (checkdoc-buffer-label): Make sure the file name is meaningful.
48 (checkdoc-output-to-error-buffer): Remove.
49 (checkdoc-error, checkdoc-start-section): Rewrite.
50
51 * info.el (info-node, info-menu-5, info-xref, info-header-node)
52 (Info-title-1-face, Info-title-2-face, Info-title-3-face)
53 (Info-title-4-face): Use new syntax.
54 (info-xref-visited): Inherit from info-xref.
55
56 * progmodes/python.el (python-maybe-jython): Don't assume point-min==1.
57
582004-04-21 Teodor Zlatanov <tzz@lifelogs.com>
59
60 * simple.el (next-error-last-buffer, next-error-function):
61 New variables for the next-error framework.
62 (next-error-buffer-p): New function.
63 (next-error-find-buffer): Generalize compilation-find-buffer.
64 (next-error, previous-error, first-error, next-error-no-select)
65 (previous-error-no-select): Move from compile.el.
66
67 * replace.el (occur-next-error, occur-1): Hook into the next-error
68 framework.
69
70 * progmodes/compile.el (compilation-start):
71 Set next-error-last-buffer so next-error knows where to jump.
72 (compilation-setup): Set the buffer-local variable
73 next-error-function to 'compilation-next-error-function.
74 (compilation-buffer-p, compilation-buffer-internal-p): Use an
75 alternate way to find if a buffer is a compilation buffer, for
76 next-error convenience.
77 (next-error-no-select, previous-error-no-select, next-error)
78 (previous-error, first-error): Move to simple.el.
79 (compilation-find-buffer): Move to next-error-find-buffer in simple.el.
80 (compilation-last-buffer): Remove.
81 (compilation-start, compilation-next-error, compilation-setup)
82 (compilation-next-error-function, compilation-find-buffer):
83 Remove compilation-last-buffer use.
84
852004-04-21 Juanma Barranquero <lektu@terra.es>
86
87 * makefile.w32-in (WINS): Add url/ directory.
88
89 * font-lock.el (font-lock-preprocessor-face): Remove spurious quote.
90 (font-lock-warning-face): Fix spacing.
91
922004-04-21 Lars Hansen <larsh@math.ku.dk>
93
94 * desktop.el (desktop-buffer-mode-handlers): New variable.
95 Alist of major mode specific functions to restore a desktop buffer.
96 (desktop-buffer-handlers): Make variable obsolete.
97 (desktop-create-buffer): Use desktop-buffer-mode-handlers.
98 Catch errors signaled in handlers. Update buffer count.
99 Evaluate desktop-buffer-point.
100 (desktop-buffer-dired): Rename to dired-restore-desktop-buffer and
101 move to dired.el.
102 (desktop-buffer-info): Rename to Info-restore-desktop-buffer and
103 move to info.el.
104 (desktop-buffer-rmail): Rename to rmail-restore-desktop-buffer and
105 move to mail/rmail.el.
106 (desktop-buffer-mh): Rename to mh-restore-desktop-buffer and move
107 to mh-e/mh-e.el.
108 (desktop-buffer-file): Rename to desktop-restore-file-buffer.
109 On fail, print message (to message buffer) even if
110 desktop-missing-file-warning is nil.
111 (desktop-buffer-misc-data-function): New buffer local variable.
112 Function returning major mode specific data.
113 (desktop-buffer-misc-functions): Make variable obsolete.
114 (desktop-save): Use desktop-buffer-misc-data-function.
115 (desktop-buffer-dired-misc-data): Rename to
116 dired-desktop-buffer-misc-data and move to dired.el.
117 (desktop-buffer-info-misc-data): Rename to
118 Info-desktop-buffer-misc-data and move to info.el.
119 (desktop-read): Add message about number of buffers restored/failed.
120 * dired.el (dired-restore-desktop-buffer) Move from desktop.el.
121 Add parameters. Pause to display error only when
122 desktop-missing-file-warning is non-nil.
123 (dired-desktop-buffer-misc-data): Move from desktop.el. Add parameter.
124 * info.el (Info-restore-desktop-buffer): Move from desktop.el.
125 Add Parameters.
126 (Info-desktop-buffer-misc-data): Move from desktop.el. Add parameter.
127 * mail/rmail.el (rmail-restore-desktop-buffer): Move from desktop.el.
128 Add Parameters.
129 * mh-e/mh-e.el (mh-restore-desktop-buffer): Move from desktop.el.
130 Add Parameters.
131
1322003-04-21 Paul Pogonyshev <pogonyshev@gmx.net>
133
134 * dabbrev.el (dabbrev--substitute-expansion): Fix a bug which lost
135 the case of letters in case-insensitive expansions on certain
136 abbreviations.
137
1382004-04-21 Richard M. Stallman <rms@gnu.org>
139
140 * progmodes/cperl-mode.el (cperl-putback-char):
141 Delete Emacs 18 definition.
142
143 * international/mule.el (ctext-post-read-conversion):
144 Use assoc-string, not assoc-ignore-case.
145
146 * international/mule-cmds.el: Use assoc-string, not assoc-ignore-case.
147
148 * emacs-lisp/easymenu.el (easy-menu-add):
149 Do call x-popup-menu, but only if it's defined.
150
151 * emacs-lisp/disass.el (disassemble): Handle lambda-exp as arg.
152
153 * emacs-lisp/bytecomp.el (byte-compile-no-warnings):
154 Handle multiple args: compile like progn.
155
156 * emacs-lisp/byte-run.el (with-no-warnings): Simplify:
157 take all args as &rest arg.
158
159 * autoinsert.el (auto-insert-alist): Insert the user's name in
160 copyright notice, rather than Free Software Foundation.
161
1622004-04-21 Kenichi Handa <handa@m17n.org>
163
164 * descr-text.el (describe-char): Make it work on *Help* buffer.
165
1662004-04-21 Kim F. Storm <storm@cua.dk>
167
168 * image.el (insert-image): Add optional SLICE arg.
169 (insert-sliced-image): New defun.
170
1712004-04-20 Lawrence Mitchell <wence@gmx.li> (tiny change)
172
173 * subr.el (read-number): Check whether `default' is nil.
174
1752004-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
176
177 * progmodes/compile.el (compilation-error-properties):
178 Split into two.
179 (compilation-internal-error-properties): New one.
180 (compilation-compat-error-properties): Use it. Fix the non-marker case.
181
1822004-04-20 Richard M. Stallman <rms@gnu.org>
183
184 * window.el (split-window-save-restore-data):
185 Don't update the data if OLD-INFO is nil.
186
187 * view.el (view-return-to-alist): Mark it permanent local.
188
189 * subr.el (event-modifiers): Fix the criterion for ASCII control chars.
190
191 * recentf.el (recentf-save-list): Catch and warn about errors.
192
193 * menu-bar.el (menu-bar-update-buffers): Call copy-sequence
194 so "Buffers" won't be pure.
195
196 * help-mode.el (help-mode-finish): Set help-return-alist first
197 thing, setting only the entry for the selected window.
198
199 * help-fns.el (describe-function-1): If many non-control non-meta
200 keys run the command, don't list all of them.
201
2022004-04-20 Juanma Barranquero <lektu@terra.es>
203
204 * vc-svn.el (vc-svn-print-log, vc-svn-diff): Add optional BUFFER
205 arg. Copied from Andre Spiegel's patch of 2004-03-21.
206
207 * calendar/time-date.el (time-to-day-in-year): Fix docstring.
208
2092004-04-20 Kenichi Handa <handa@m17n.org>
210
211 * international/quail.el (quail-lookup-key): New optional arg
212 NOT-RESET-INDICES.
213 (quail-get-translations): Call quail-lookup-key with
214 NOT-RESET-INDICES t.
215 (quail-completion): Likewise.
216 (quail-lookup-map-and-concat): Likewise.
217
2182004-04-20 Kenichi Handa <handa@m17n.org>
219
220 * international/quail.el (quail-update-translation): Don't insert
221 such an unsupported multibyte char in a unibyte buffer.
222
2232004-04-20 Nick Roberts <nick@nick.uklinux.net>
224
225 * progmodes/gdb-ui.el (gdb-frame-parameters): New constant.
226 (gdb-frame-breakpoints-buffer, gdb-frame-stack-buffer)
227 (gdb-frame-threads-buffer, gdb-frame-registers-buffer)
228 (gdb-frame-locals-buffer, gdb-frame-gdb-buffer)
229 (gdb-frame-assembler-buffer): Improve behaviour with
230 multiple frames.
231 (gdb-display-buffer): Extend search to all visible frames.
232
2332004-04-19 Eli Zaretskii <eliz@gnu.org>
234
235 * mail/rmail.el (rmail-convert-to-babyl-format): Don't remove ^M
236 characters left after base64 decoding.
237 (rmail-decode-region): Use -dos variety of `coding', to remove any
238 ^M characters left after qp or base64 decoding.
239
2402004-04-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
241
242 * x-dnd.el (x-dnd-open-local-file, x-dnd-open-file): Improve error
243 messages.
244
2452004-04-19 Stephen Eglen <stephen@gnu.org>
246
247 * add-log.el (add-change-log-entry): Update doc string to mention
248 add-log-full-name and add-log-mailing-address.
249
12004-04-18 Juri Linkov <juri@jurta.org> 2502004-04-18 Juri Linkov <juri@jurta.org>
2 251
3 * info.el (Info-find-file, Info-find-node-2): Add history and toc. 252 * info.el (Info-find-file, Info-find-node-2): Add history and toc.
@@ -18,6 +267,22 @@
18 * international/mule-diag.el (list-input-methods): 267 * international/mule-diag.el (list-input-methods):
19 Fix args to help-xref-button. 268 Fix args to help-xref-button.
20 269
270 * help-fns.el (help-with-tutorial): Call `hack-local-variables'
271 to put into effect local variables from TUTORIAL files.
272
273 * textmodes/paragraphs.el (sentence-end) <function>: New fun
274 with default value taken from the variable `sentence-end'.
275 (sentence-end) <defcustom>: Set default to nil. Doc fix.
276 Add nil const to :type.
277 (sentence-end-without-period, sentence-end-double-space)
278 (sentence-end-without-space): Doc fix.
279
280 * textmodes/paragraphs.el (forward-sentence):
281 * textmodes/fill.el (canonically-space-region, fill-nobreak-p)
282 (fill-delete-newlines):
283 * progmodes/cc-cmds.el (c-beginning-of-statement):
284 Use function `sentence-end' instead of variable `sentence-end'.
285
212004-04-18 Andreas Schwab <schwab@suse.de> 2862004-04-18 Andreas Schwab <schwab@suse.de>
22 287
23 * progmodes/compile.el (compilation-start): Set window start to 288 * progmodes/compile.el (compilation-start): Set window start to
@@ -25,7 +290,7 @@
25 290
262004-04-18 John Wiegley <johnw@newartisans.com> 2912004-04-18 John Wiegley <johnw@newartisans.com>
27 292
28 * iswitchb.el (iswitchb-completions): Removed dependency on cl. 293 * iswitchb.el (iswitchb-completions): Remove dependency on cl.
29 294
302004-04-18 Nick Roberts <nick@nick.uklinux.net> 2952004-04-18 Nick Roberts <nick@nick.uklinux.net>
31 296
@@ -38,7 +303,7 @@
38 303
392004-04-17 John Wiegley <johnw@newartisans.com> 3042004-04-17 John Wiegley <johnw@newartisans.com>
40 305
41 * iswitchb.el (iswitchb-max-to-show): Added a new config variable 306 * iswitchb.el (iswitchb-max-to-show): Add a new config variable
42 which limits the number of names shown in the minibuffer. Off by 307 which limits the number of names shown in the minibuffer. Off by
43 default. 308 default.
44 (iswitchb-completions): Use `iswitchb-max-to-show'. This speeds 309 (iswitchb-completions): Use `iswitchb-max-to-show'. This speeds
@@ -124,7 +389,7 @@
1242004-04-16 Masatake YAMATO <jet@gyve.org> 3892004-04-16 Masatake YAMATO <jet@gyve.org>
125 390
126 * simple.el (completion-setup-function): Set an initial value 391 * simple.el (completion-setup-function): Set an initial value
127 to `element-common-end' before entering loop. Set a value 392 to `element-common-end' before entering loop. Set a value
128 to `element-common-end' at the end of loop. 393 to `element-common-end' at the end of loop.
129 The bug is reported by Juri Linkov <juri@jurta.org> in emacs-devel list. 394 The bug is reported by Juri Linkov <juri@jurta.org> in emacs-devel list.
130 (completions-common-part): Rename from completion-de-emphasis. 395 (completions-common-part): Rename from completion-de-emphasis.
@@ -481,7 +746,8 @@
481 Use Info-search-whitespace-regexp. Set Info-search-case-fold. 746 Use Info-search-whitespace-regexp. Set Info-search-case-fold.
482 (Info-search-case-sensitively, Info-search-next): New fun. 747 (Info-search-case-sensitively, Info-search-next): New fun.
483 (Info-up): Move point to the menu item of the current node. 748 (Info-up): Move point to the menu item of the current node.
484 (Info-history): New fun. Add *info-history* to same-window-buffer-names. 749 (Info-history): New fun. Add *info-history* to
750 same-window-buffer-names.
485 (Info-toc): New fun. Add *info-toc* to same-window-buffer-names. 751 (Info-toc): New fun. Add *info-toc* to same-window-buffer-names.
486 (Info-insert-toc): New fun. 752 (Info-insert-toc): New fun.
487 (Info-build-toc): New fun. 753 (Info-build-toc): New fun.
@@ -1731,7 +1997,7 @@
1731 (top-level): Require password.el if visible. Should be mandatory 1997 (top-level): Require password.el if visible. Should be mandatory
1732 once No Gnus has found its way into (X)Emacs. 1998 once No Gnus has found its way into (X)Emacs.
1733 (tramp-read-passwd): Invoke `password-read' if available, 1999 (tramp-read-passwd): Invoke `password-read' if available,
1734 `read-passwd' otherwise. `ange-ftp-read-passwd' isn't used as 2000 `read-passwd' otherwise. `ange-ftp-read-passwd' isn't used as
1735 fallback any longer. 2001 fallback any longer.
1736 (tramp-clear-passwd): New function. 2002 (tramp-clear-passwd): New function.
1737 (tramp-process-actions, tramp-process-multi-actions): 2003 (tramp-process-actions, tramp-process-multi-actions):
@@ -3153,7 +3419,7 @@
3153 3419
3154 * gdb-ui.el (gdb-prompt): Change filter for level 3 annotations, 3420 * gdb-ui.el (gdb-prompt): Change filter for level 3 annotations,
3155 if necessary. 3421 if necessary.
3156 (gdb-ann3): New function. Initialise M-x gdb as for M-x gdba if 3422 (gdb-ann3): New function. Initialise M-x gdb as for M-x gdba if
3157 annotations are detected. 3423 annotations are detected.
3158 (gud-gdba-marker-filter): Use global variable gud-marker-acc 3424 (gud-gdba-marker-filter): Use global variable gud-marker-acc
3159 instead of a local one to allow transition from 3425 instead of a local one to allow transition from
@@ -3247,7 +3513,7 @@
3247 * gdb-ui.el (gdba, gdb-assembler-mode): Call the mode "Machine" as 3513 * gdb-ui.el (gdba, gdb-assembler-mode): Call the mode "Machine" as
3248 a mode called "Assembler" already exists. 3514 a mode called "Assembler" already exists.
3249 (gdb-use-colon-colon-notation, gdb-show-changed-values): New options. 3515 (gdb-use-colon-colon-notation, gdb-show-changed-values): New options.
3250 (gud-watch): Use format option. Remove font properties from string. 3516 (gud-watch): Use format option. Remove font properties from string.
3251 (gdb-var-create-handler, gdb-var-list-children-handler): 3517 (gdb-var-create-handler, gdb-var-list-children-handler):
3252 Don't bother about properties as there are none. 3518 Don't bother about properties as there are none.
3253 (gdb-var-create-handler, gdb-var-list-children-handler) 3519 (gdb-var-create-handler, gdb-var-list-children-handler)
@@ -3340,7 +3606,7 @@
3340 (tramp-handle-file-attributes): Replace proprietary optional 3606 (tramp-handle-file-attributes): Replace proprietary optional
3341 parameter NONNUMERIC by the recently (Emacs 21.4) introduced ID-FORMAT. 3607 parameter NONNUMERIC by the recently (Emacs 21.4) introduced ID-FORMAT.
3342 (tramp-handle-file-attributes-with-perl): Handle parameter 3608 (tramp-handle-file-attributes-with-perl): Handle parameter
3343 NONNUMERIC if set. This wasn't done in the past. 3609 NONNUMERIC if set. This wasn't done in the past.
3344 (tramp-post-connection): Apply second parameter "$2" if 3610 (tramp-post-connection): Apply second parameter "$2" if
3345 `tramp-remote-perl' is called. 3611 `tramp-remote-perl' is called.
3346 3612
@@ -4114,7 +4380,7 @@
4114 * progmodes/gud.el (gud-menu-map, gud-tool-bar-map): 4380 * progmodes/gud.el (gud-menu-map, gud-tool-bar-map):
4115 Replace gud-display with gud-watch. 4381 Replace gud-display with gud-watch.
4116 (gud-speedbar-buttons): Add stuff for watching expressions 4382 (gud-speedbar-buttons): Add stuff for watching expressions
4117 in the speedbar when using M-x gdba. Use dolist on old part 4383 in the speedbar when using M-x gdba. Use dolist on old part
4118 of this function. 4384 of this function.
4119 4385
4120 * gdb-ui.el (gdb-var-list, gdb-var-changed, gdb-update-flag) 4386 * gdb-ui.el (gdb-var-list, gdb-var-changed, gdb-update-flag)
@@ -4349,7 +4615,7 @@
4349 * ffap.el (ffap-shell-prompt-regexp): Add regexp to identify 4615 * ffap.el (ffap-shell-prompt-regexp): Add regexp to identify
4350 common shell prompts that are not common filename or URL characters. 4616 common shell prompts that are not common filename or URL characters.
4351 (ffap-file-at-point): Use the new regexp to strip the prompts from 4617 (ffap-file-at-point): Use the new regexp to strip the prompts from
4352 the file names. This is an issue mostly for user prompts that 4618 the file names. This is an issue mostly for user prompts that
4353 don't have a trailing space and find-file-at-point is invoked from 4619 don't have a trailing space and find-file-at-point is invoked from
4354 within a shell inside emacs. 4620 within a shell inside emacs.
4355 4621
@@ -4566,7 +4832,7 @@
4566 4832
4567 * gdb-ui.el (gud-display1): Use gud-call to prevent extra prompt 4833 * gdb-ui.el (gud-display1): Use gud-call to prevent extra prompt
4568 being displayed in GUD buffer. 4834 being displayed in GUD buffer.
4569 (gdb-idle-input-queue): Remove var. Use just one queue. 4835 (gdb-idle-input-queue): Remove var. Use just one queue.
4570 (gdb-enqueue-idle-input,gdb-dequeue-idle-input): 4836 (gdb-enqueue-idle-input,gdb-dequeue-idle-input):
4571 Remove functions. Use just one queue. 4837 Remove functions. Use just one queue.
4572 (gdb-prompt, gdb-subprompt, def-gdb-auto-update-trigger) 4838 (gdb-prompt, gdb-subprompt, def-gdb-auto-update-trigger)
@@ -4750,7 +5016,7 @@
47502003-08-24 Nick Roberts <nick@nick.uklinux.net> 50162003-08-24 Nick Roberts <nick@nick.uklinux.net>
4751 5017
4752 * progmodes/gud.el (gud-display-line): Don't set window-point if 5018 * progmodes/gud.el (gud-display-line): Don't set window-point if
4753 source buffer is not visible. (Only happens with M-x gdba). 5019 source buffer is not visible. (Only happens with M-x gdba.)
4754 5020
4755 * gdb-ui.el (gdba): Remove gdb-quit (previously removed) from 5021 * gdb-ui.el (gdba): Remove gdb-quit (previously removed) from
4756 documentation. 5022 documentation.
@@ -5789,33 +6055,33 @@
5789 (bibtex-autokey-get-names): Fiddle with regexps. 6055 (bibtex-autokey-get-names): Fiddle with regexps.
5790 (bibtex-generate-autokey): Use identity. 6056 (bibtex-generate-autokey): Use identity.
5791 (bibtex-parse-keys): Use simplified parsing algorithm if 6057 (bibtex-parse-keys): Use simplified parsing algorithm if
5792 bibtex-parse-keys-fast is non-nil. Simplify. Change order of 6058 bibtex-parse-keys-fast is non-nil. Simplify. Change order of
5793 arguments. Return alist of keys. 6059 arguments. Return alist of keys.
5794 (bibtex-parse-strings): Simplify. Return alist of strings. 6060 (bibtex-parse-strings): Simplify. Return alist of strings.
5795 (bibtex-complete-string-cleanup): Fix docstring. 6061 (bibtex-complete-string-cleanup): Fix docstring.
5796 (bibtex-read-key): New function. 6062 (bibtex-read-key): New function.
5797 (bibtex-mode): Fix docstring. Do not parse for keys and 6063 (bibtex-mode): Fix docstring. Do not parse for keys and
5798 strings when the mode is entered. Set fill-paragraph-function to 6064 strings when the mode is entered. Set fill-paragraph-function to
5799 bibtex-fill-field. Setup font-lock-mark-block-function the way 6065 bibtex-fill-field. Setup font-lock-mark-block-function the way
5800 font-lock intended. 6066 font-lock intended.
5801 (bibtex-entry): Use bibtex-read-key. Obey bibtex-autofill-types. 6067 (bibtex-entry): Use bibtex-read-key. Obey bibtex-autofill-types.
5802 (bibtex-parse-entry, bibtex-autofill-entry): New functions. 6068 (bibtex-parse-entry, bibtex-autofill-entry): New functions.
5803 (bibtex-print-help-message, bibtex-remove-OPT-or-ALT) 6069 (bibtex-print-help-message, bibtex-remove-OPT-or-ALT)
5804 (bibtex-Preamble): Avoid hard coded constants. 6070 (bibtex-Preamble): Avoid hard coded constants.
5805 (bibtex-make-field): Fix docstring. Simplify. 6071 (bibtex-make-field): Fix docstring. Simplify.
5806 (bibtex-beginning-of-entry): Always return new position of point. 6072 (bibtex-beginning-of-entry): Always return new position of point.
5807 (bibtex-end-of-entry): Rearrange cond clauses. 6073 (bibtex-end-of-entry): Rearrange cond clauses.
5808 (bibtex-count-entries, bibtex-validate, bibtex-reformat): 6074 (bibtex-count-entries, bibtex-validate, bibtex-reformat):
5809 Update for changes of bibtex-map-entries. 6075 Update for changes of bibtex-map-entries.
5810 (bibtex-ispell-abstract): Do not move point. 6076 (bibtex-ispell-abstract): Do not move point.
5811 (bibtex-entry-index): Use downcase. Simplify. 6077 (bibtex-entry-index): Use downcase. Simplify.
5812 (bibtex-lessp): Handle catch-all. 6078 (bibtex-lessp): Handle catch-all.
5813 (bibtex-find-crossref): Turn into a command. 6079 (bibtex-find-crossref): Turn into a command.
5814 (bibtex-find-entry): Simplify. Use bibtex-read-key. Fix regexp. 6080 (bibtex-find-entry): Simplify. Use bibtex-read-key. Fix regexp.
5815 (bibtex-clean-entry): Use bibtex-read-key. Handle string and 6081 (bibtex-clean-entry): Use bibtex-read-key. Handle string and
5816 preamble entries. 6082 preamble entries.
5817 (bibtex-fill-field-bounds): New function. 6083 (bibtex-fill-field-bounds): New function.
5818 (bibtex-fill-field): New command. Bound to fill-paragraph-function. 6084 (bibtex-fill-field): New command. Bound to fill-paragraph-function.
5819 (bibtex-fill-entry): Use bibtex-fill-field-bounds 6085 (bibtex-fill-entry): Use bibtex-fill-field-bounds
5820 (bibtex-String): Use bibtex-strings. Always obey 6086 (bibtex-String): Use bibtex-strings. Always obey
5821 bibtex-sort-ignore-string-entries. 6087 bibtex-sort-ignore-string-entries.
diff --git a/lisp/ChangeLog.10 b/lisp/ChangeLog.10
index 6aae7e44cdf..cf1743c3490 100644
--- a/lisp/ChangeLog.10
+++ b/lisp/ChangeLog.10
@@ -8320,17 +8320,27 @@
8320 indicating source of entry to add-to-diary-list. 8320 indicating source of entry to add-to-diary-list.
8321 (diary-button-face, diary-entry, diary-goto-entry): New, to 8321 (diary-button-face, diary-entry, diary-goto-entry): New, to
8322 support click to diary file. 8322 support click to diary file.
8323 (fancy-diary-display): Buttonize diary entries. 8323 (fancy-diary-display): Buttonize diary entries. Use new mode
8324 fancy-diary-display-mode.
8324 (list-sexp-diary-entries): Pass a marker indicating source of 8325 (list-sexp-diary-entries): Pass a marker indicating source of
8325 entry to add-to-diary-list. 8326 entry to add-to-diary-list.
8326 (diary-date): Return mark as well as entry. 8327 (diary-date): Return mark as well as entry.
8328 (add-to-diary-list): Add new marker argument, appended to
8329 diary-entries-list.
8330 (diary-mode, fancy-diary-display-mode): New derived modes, for
8331 diary file and fancy diary buffer respectively.
8332 (fancy-diary-font-lock-keywords, diary-font-lock-keywords): New
8333 variables.
8334 (font-lock-diary-sexps, font-lock-diary-date-forms): New
8335 functions, used in diary-font-lock-keywords.
8327 8336
8328 * calendar/calendar.el (diary-face): New. 8337 * calendar/calendar.el (diary-face): New.
8329 (european-calendar-display-form, describe-calendar-mode) 8338 (european-calendar-display-form, describe-calendar-mode)
8330 (mark-visible-calendar-date, calendar-mark-today): Tidy doc string. 8339 (mark-visible-calendar-date, calendar-mark-today): Tidy doc string.
8331 (calendar-make-alist): New. 8340 (calendar-mode): Set up font-lock mode, using new variable
8332 (calendar-mode): Set up font-lock mode. 8341 calendar-font-lock-keywords.
8333 (generate-calendar-window): Fontify if font-lock-mode is on. 8342 (generate-calendar-window): Fontify if font-lock-mode is on.
8343 (calendar-font-lock-keywords): New variable.
8334 8344
83352002-11-16 Ivan Zakharyaschev <imz@altlinux.org> (tiny change) 83452002-11-16 Ivan Zakharyaschev <imz@altlinux.org> (tiny change)
8336 8346
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 137a00d802d..8ccb03f69e3 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -282,7 +282,7 @@ compile-after-backup: backup-compiled-files compile-always
282# .elc is present. 282# .elc is present.
283 283
284recompile: doit $(lisp)/progmodes/cc-mode.elc 284recompile: doit $(lisp)/progmodes/cc-mode.elc
285 $(EMACS) $(EMACSOPT) -f batch-byte-recompile-directory $(lisp) 285 $(EMACS) $(EMACSOPT) --eval "(batch-byte-recompile-directory 0)" $(lisp)
286 286
287# CC Mode uses a compile time macro system which causes a compile time 287# CC Mode uses a compile time macro system which causes a compile time
288# dependency in cc-mode.elc on the macros in cc-langs.el and the 288# dependency in cc-mode.elc on the macros in cc-langs.el and the
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 609dfde5f65..ead1fe679d6 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -445,7 +445,7 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'."
445(defun add-change-log-entry (&optional whoami file-name other-window new-entry) 445(defun add-change-log-entry (&optional whoami file-name other-window new-entry)
446 "Find change log file, and add an entry for today and an item for this file. 446 "Find change log file, and add an entry for today and an item for this file.
447Optional arg WHOAMI (interactive prefix) non-nil means prompt for user 447Optional arg WHOAMI (interactive prefix) non-nil means prompt for user
448name and site. 448name and email (stored in `add-log-full-name' and `add-log-mailing-address').
449 449
450Second arg FILE-NAME is file name of the change log. 450Second arg FILE-NAME is file name of the change log.
451If nil, use the value of `change-log-default-name'. 451If nil, use the value of `change-log-default-name'.
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index 489593aa925..88acbd04792 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -136,7 +136,7 @@ If this contains a %s, that will be replaced by the matching rule."
136 (("\\.[1-9]\\'" . "Man page skeleton") 136 (("\\.[1-9]\\'" . "Man page skeleton")
137 "Short description: " 137 "Short description: "
138 ".\\\" Copyright (C), " (substring (current-time-string) -4) " " 138 ".\\\" Copyright (C), " (substring (current-time-string) -4) " "
139 (getenv "ORGANIZATION") | "Free Software Foundation, Inc." 139 (getenv "ORGANIZATION") | (progn user-full-name)
140 " 140 "
141.\\\" You may distribute this file under the terms of the GNU Free 141.\\\" You may distribute this file under the terms of the GNU Free
142.\\\" Documentation Licence. 142.\\\" Documentation Licence.
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index b36d5ab2f31..846231befe6 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -149,7 +149,7 @@ DATE1 and DATE2 should be date-time strings."
149 149
150;;;###autoload 150;;;###autoload
151(defun time-to-day-in-year (time) 151(defun time-to-day-in-year (time)
152 "Return the day number within the year of the date month/day/year." 152 "Return the day number within the year corresponding to TIME."
153 (let* ((tim (decode-time time)) 153 (let* ((tim (decode-time time))
154 (month (nth 4 tim)) 154 (month (nth 4 tim))
155 (day (nth 3 tim)) 155 (day (nth 3 tim))
diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el
index 528ab74e509..96b1f1eb066 100644
--- a/lisp/cvs-status.el
+++ b/lisp/cvs-status.el
@@ -1,4 +1,4 @@
1;;; cvs-status.el --- major mode for browsing `cvs status' output 1;;; cvs-status.el --- major mode for browsing `cvs status' output -*- coding: utf-8 -*-
2 2
3;; Copyright (C) 1999, 2000, 03, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 03, 2004 Free Software Foundation, Inc.
4 4
@@ -384,23 +384,45 @@ the list is a three-string list TAG, KIND, REV."
384;;;; CVSTree-style trees 384;;;; CVSTree-style trees
385;;;; 385;;;;
386 386
387(defvar cvs-tree-use-jisx0208 387(defvar cvs-tree-use-jisx0208 nil) ;Old compat var.
388 (and (char-displayable-p (make-char 'japanese-jisx0208 40 44)) t) 388(defvar cvs-tree-use-charset
389 (cond
390 (cvs-tree-use-jisx0208 'jisx0208)
391 ((char-displayable-p ?━) 'unicode)
392 ((char-displayable-p (make-char 'japanese-jisx0208 40 44)) 'jisx0208))
389 "*Non-nil if we should use the graphical glyphs from `japanese-jisx0208'. 393 "*Non-nil if we should use the graphical glyphs from `japanese-jisx0208'.
390Otherwise, default to ASCII chars like +, - and |.") 394Otherwise, default to ASCII chars like +, - and |.")
391 395
392(defconst cvs-tree-char-space 396(defconst cvs-tree-char-space
393 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 33 33) " ")) 397 (case cvs-tree-use-charset
398 (jisx0208 (make-char 'japanese-jisx0208 33 33))
399 (unicode " ")
400 (t " ")))
394(defconst cvs-tree-char-hbar 401(defconst cvs-tree-char-hbar
395 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 44) "--")) 402 (case cvs-tree-use-charset
403 (jisx0208 (make-char 'japanese-jisx0208 40 44))
404 (unicode "━")
405 (t "--")))
396(defconst cvs-tree-char-vbar 406(defconst cvs-tree-char-vbar
397 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 45) "| ")) 407 (case cvs-tree-use-charset
408 (jisx0208 (make-char 'japanese-jisx0208 40 45))
409 (unicode "┃")
410 (t "| ")))
398(defconst cvs-tree-char-branch 411(defconst cvs-tree-char-branch
399 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 50) "+-")) 412 (case cvs-tree-use-charset
413 (jisx0208 (make-char 'japanese-jisx0208 40 50))
414 (unicode "┣")
415 (t "+-")))
400(defconst cvs-tree-char-eob ;end of branch 416(defconst cvs-tree-char-eob ;end of branch
401 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 49) "`-")) 417 (case cvs-tree-use-charset
418 (jisx0208 (make-char 'japanese-jisx0208 40 49))
419 (unicode "┗")
420 (t "`-")))
402(defconst cvs-tree-char-bob ;beginning of branch 421(defconst cvs-tree-char-bob ;beginning of branch
403 (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 51) "+-")) 422 (case cvs-tree-use-charset
423 (jisx0208 (make-char 'japanese-jisx0208 40 51))
424 (unicode "┳")
425 (t "+-")))
404 426
405(defun cvs-tag-lessp (tag1 tag2) 427(defun cvs-tag-lessp (tag1 tag2)
406 (eq (cvs-tag-compare tag1 tag2) 'more2)) 428 (eq (cvs-tag-compare tag1 tag2) 'more2))
@@ -411,7 +433,7 @@ Otherwise, default to ASCII chars like +, - and |.")
411 "Look for a list of tags, and replace it with a tree. 433 "Look for a list of tags, and replace it with a tree.
412Optional prefix ARG chooses between two representations." 434Optional prefix ARG chooses between two representations."
413 (interactive "P") 435 (interactive "P")
414 (when (and cvs-tree-use-jisx0208 436 (when (and cvs-tree-use-charset
415 (not enable-multibyte-characters)) 437 (not enable-multibyte-characters))
416 ;; We need to convert the buffer from unibyte to multibyte 438 ;; We need to convert the buffer from unibyte to multibyte
417 ;; since we'll use multibyte chars for the tree. 439 ;; since we'll use multibyte chars for the tree.
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 3763f2ccab8..47ffba9873d 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -888,23 +888,28 @@ to record whether we upcased the expansion, downcased it, or did neither."
888 ;; matches the start of the expansion, 888 ;; matches the start of the expansion,
889 ;; copy the expansion's case 889 ;; copy the expansion's case
890 ;; instead of downcasing all the rest. 890 ;; instead of downcasing all the rest.
891 ;; Treat a one-capital-letter abbrev as "not all upper case", 891 ;;
892 ;; so as to force preservation of the expansion's pattern 892 ;; Treat a one-capital-letter (possibly with preceding non-letter
893 ;; if the expansion starts with a capital letter. 893 ;; characters) abbrev as "not all upper case", so as to force
894 (let ((expansion-rest (substring expansion 1))) 894 ;; preservation of the expansion's pattern if the expansion starts
895 (if (and (not (and (or (string= expansion-rest (downcase expansion-rest)) 895 ;; with a capital letter.
896 (string= expansion-rest (upcase expansion-rest))) 896 (let ((expansion-rest (substring expansion 1))
897 (or (string= abbrev (downcase abbrev)) 897 (first-letter-position (string-match "[[:alpha:]]" abbrev)))
898 (and (string= abbrev (upcase abbrev)) 898 (if (or (null first-letter-position)
899 (> (length abbrev) 1))))) 899 (and (not (and (or (string= expansion-rest (downcase expansion-rest))
900 (string= abbrev 900 (string= expansion-rest (upcase expansion-rest)))
901 (substring expansion 0 (length abbrev)))) 901 (or (string= abbrev (downcase abbrev))
902 (and (string= abbrev (upcase abbrev))
903 (> (- (length abbrev) first-letter-position)
904 1)))))
905 (string= abbrev
906 (substring expansion 0 (length abbrev)))))
902 (setq use-case-replace nil))) 907 (setq use-case-replace nil)))
903 908
904 ;; If the abbrev and the expansion are both all-lower-case 909 ;; If the abbrev and the expansion are both all-lower-case
905 ;; then don't do any conversion. The conversion would be a no-op 910 ;; then don't do any conversion. The conversion would be a no-op
906 ;; for this replacement, but it would carry forward to subsequent words. 911 ;; for this replacement, but it would carry forward to subsequent words.
907 ;; The goal of this is to preven that carrying forward. 912 ;; The goal of this is to prevent that carrying forward.
908 (if (and (string= expansion (downcase expansion)) 913 (if (and (string= expansion (downcase expansion))
909 (string= abbrev (downcase abbrev))) 914 (string= abbrev (downcase abbrev)))
910 (setq use-case-replace nil)) 915 (setq use-case-replace nil))
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 30ef3dcf05e..c73cfeb02c3 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -474,6 +474,7 @@ as well as widgets, buttons, overlays, and text properties."
474 standard-display-table)) 474 standard-display-table))
475 (disp-vector (and display-table (aref display-table char))) 475 (disp-vector (and display-table (aref display-table char)))
476 (multibyte-p enable-multibyte-characters) 476 (multibyte-p enable-multibyte-characters)
477 text-prop-description
477 item-list max-width unicode) 478 item-list max-width unicode)
478 (if (eq charset 'unknown) 479 (if (eq charset 'unknown)
479 (setq item-list 480 (setq item-list
@@ -582,8 +583,14 @@ as well as widgets, buttons, overlays, and text properties."
582 (cons (list "Unicode data" " ") unicodedata)))))) 583 (cons (list "Unicode data" " ") unicodedata))))))
583 (setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x))) 584 (setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x)))
584 item-list))) 585 item-list)))
585 (when (eq (current-buffer) (get-buffer "*Help*")) 586 (setq text-prop-description
586 (error "Can't describe char in Help buffer")) 587 (with-temp-buffer
588 (let ((buf (current-buffer)))
589 (save-excursion
590 (set-buffer buffer)
591 (describe-text-properties pos buf)))
592 (buffer-string)))
593
587 (with-output-to-temp-buffer "*Help*" 594 (with-output-to-temp-buffer "*Help*"
588 (with-current-buffer standard-output 595 (with-current-buffer standard-output
589 (set-buffer-multibyte multibyte-p) 596 (set-buffer-multibyte multibyte-p)
@@ -658,10 +665,8 @@ as well as widgets, buttons, overlays, and text properties."
658 (insert "\nSee the variable `reference-point-alist' for " 665 (insert "\nSee the variable `reference-point-alist' for "
659 "the meaning of the rule.\n")) 666 "the meaning of the rule.\n"))
660 667
661 (let ((output (current-buffer))) 668 (insert text-prop-description)
662 (with-current-buffer buffer 669 (describe-text-mode)))))
663 (describe-text-properties pos output))
664 (describe-text-mode))))))
665 670
666(defalias 'describe-char-after 'describe-char) 671(defalias 'describe-char-after 'describe-char)
667(make-obsolete 'describe-char-after 'describe-char "21.5") 672(make-obsolete 'describe-char-after 'describe-char "21.5")
diff --git a/lisp/desktop.el b/lisp/desktop.el
index beac1f39005..5589097dfde 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -83,12 +83,6 @@
83 83
84;;; Code: 84;;; Code:
85 85
86;; Make the compilation more silent
87(eval-when-compile
88 ;; We use functions from these modules
89 ;; We can't (require 'mh-e) since that wants to load something.
90 (mapcar 'require '(info dired reporter)))
91
92(defvar desktop-file-version "206" 86(defvar desktop-file-version "206"
93 "Version number of desktop file format. 87 "Version number of desktop file format.
94Written into the desktop file and used at desktop read to provide 88Written into the desktop file and used at desktop read to provide
@@ -253,8 +247,9 @@ The variables are saved only when they really are local."
253(defcustom desktop-buffer-modes-to-save 247(defcustom desktop-buffer-modes-to-save
254 '(Info-mode rmail-mode) 248 '(Info-mode rmail-mode)
255 "If a buffer is of one of these major modes, save the buffer state. 249 "If a buffer is of one of these major modes, save the buffer state.
256It is up to the functions in `desktop-buffer-handlers' to decide 250This applies to buffers not visiting a file and not beeing a dired buffer.
257whether the buffer should be recreated or not, and how." 251Modes specified here must have a handler in `desktop-buffer-mode-handlers'
252to be restored."
258 :type '(repeat symbol) 253 :type '(repeat symbol)
259 :group 'desktop) 254 :group 'desktop)
260 255
@@ -272,53 +267,59 @@ Possible values are:
272 :type '(choice (const absolute) (const tilde) (const local)) 267 :type '(choice (const absolute) (const tilde) (const local))
273 :group 'desktop) 268 :group 'desktop)
274 269
275(defcustom desktop-buffer-misc-functions 270;;;###autoload
276 '(desktop-buffer-info-misc-data 271(defvar desktop-buffer-misc-data-function nil
277 desktop-buffer-dired-misc-data) 272 "Function returning major mode specific data for desktop file.
278 "*Functions used to determine auxiliary information for a buffer. 273This variable becomes buffer local when set.
279These functions are called by `desktop-save' in order, with no 274The function specified is called by `desktop-save', with argument
280arguments. If a function returns non-nil, its value is saved along 275DESKTOP-DIRNAME. If it returns non-nil, its value is saved along
281with the state of the buffer for which it was called; no further 276with the state of the buffer for which it was called.
282functions will be called.
283 277
284When file names are returned, they should be formatted using the call 278When file names are returned, they should be formatted using the call
285\"(desktop-file-name FILE-NAME dirname)\". 279\"(desktop-file-name FILE-NAME DESKTOP-DIRNAME)\".
286 280
287Later, when `desktop-read' restores buffers, each of the functions in 281Later, when `desktop-read' calls a function in `desktop-buffer-mode-handlers'
288`desktop-buffer-handlers' will have access to a buffer local variable, 282to restore the buffer, the auxiliary information is passed as argument.")
289named `desktop-buffer-misc', whose value is what the function in 283(make-variable-buffer-local 'desktop-buffer-misc-data-function)
290`desktop-buffer-misc-functions' returned." 284(make-obsolete-variable 'desktop-buffer-misc-functions
291 :type '(repeat function) 285 'desktop-buffer-misc-data-function)
292 :group 'desktop)
293 286
294(defcustom desktop-buffer-handlers 287(defcustom desktop-buffer-mode-handlers '(
295 '(desktop-buffer-dired 288 (dired-mode . dired-restore-desktop-buffer)
296 desktop-buffer-rmail 289 (rmail-mode . rmail-restore-desktop-buffer)
297 desktop-buffer-mh 290 (mh-folder-mode . mh-restore-desktop-buffer)
298 desktop-buffer-info 291 (Info-mode . Info-restore-desktop-buffer))
299 desktop-buffer-file) 292 "Alist of major mode specific functions to restore a desktop buffer.
300 "*Functions called by `desktop-read' in order to create a buffer. 293Functions are called by `desktop-read'. List elements must have the form
301The functions are called without explicit parameters but can use the 294\(MAJOR-MODE . FUNCTION).
302following variables: 295
296Buffers with a major mode not specified here, are restored by the default
297handler `desktop-restore-file-buffer'.
298
299Handlers are called with parameters
303 300
304 desktop-file-version
305 desktop-buffer-file-name 301 desktop-buffer-file-name
306 desktop-buffer-name 302 desktop-buffer-name
303 desktop-buffer-misc
304
305Furthermore, they may use the following variables:
306
307 desktop-file-version
307 desktop-buffer-major-mode 308 desktop-buffer-major-mode
308 desktop-buffer-minor-modes 309 desktop-buffer-minor-modes
309 desktop-buffer-point 310 desktop-buffer-point
310 desktop-buffer-mark 311 desktop-buffer-mark
311 desktop-buffer-read-only 312 desktop-buffer-read-only
312 desktop-buffer-misc
313 desktop-buffer-locals 313 desktop-buffer-locals
314 314
315If one function returns non-nil, no further functions are called. 315If a handler returns a buffer, then the saved mode settings
316If the function returns a buffer, then the saved mode settings
317and variable values for that buffer are copied into it." 316and variable values for that buffer are copied into it."
318 :type '(repeat function) 317 :type 'alist
319 :group 'desktop) 318 :group 'desktop)
320 319
321(put 'desktop-buffer-handlers 'risky-local-variable t) 320(put 'desktop-buffer-mode-handlers 'risky-local-variable t)
321(make-obsolete-variable 'desktop-buffer-handlers
322 'desktop-buffer-mode-handlers)
322 323
323(defcustom desktop-minor-mode-table 324(defcustom desktop-minor-mode-table
324 '((auto-fill-function auto-fill-mode) 325 '((auto-fill-function auto-fill-mode)
@@ -608,7 +609,9 @@ See also `desktop-base-file-name'."
608 (point) 609 (point)
609 (list (mark t) mark-active) 610 (list (mark t) mark-active)
610 buffer-read-only 611 buffer-read-only
611 (run-hook-with-args-until-success 'desktop-buffer-misc-functions) 612 ;; Auxiliary information
613 (when desktop-buffer-misc-data-function
614 (funcall desktop-buffer-misc-data-function dirname))
612 (let ((locals desktop-locals-to-save) 615 (let ((locals desktop-locals-to-save)
613 (loclist (buffer-local-variables)) 616 (loclist (buffer-local-variables))
614 (ll)) 617 (ll))
@@ -703,7 +706,9 @@ It returns t if a desktop file was loaded, nil otherwise."
703 "~")))) 706 "~"))))
704 (if (file-exists-p (expand-file-name desktop-base-file-name desktop-dirname)) 707 (if (file-exists-p (expand-file-name desktop-base-file-name desktop-dirname))
705 ;; Desktop file found, process it. 708 ;; Desktop file found, process it.
706 (let ((desktop-first-buffer nil)) 709 (let ((desktop-first-buffer nil)
710 (desktop-buffer-ok-count 0)
711 (desktop-buffer-fail-count 0))
707 ;; Evaluate desktop buffer. 712 ;; Evaluate desktop buffer.
708 (load (expand-file-name desktop-base-file-name desktop-dirname) t t t) 713 (load (expand-file-name desktop-base-file-name desktop-dirname) t t t)
709 ;; `desktop-create-buffer' puts buffers at end of the buffer list. 714 ;; `desktop-create-buffer' puts buffers at end of the buffer list.
@@ -715,7 +720,12 @@ It returns t if a desktop file was loaded, nil otherwise."
715 (run-hooks 'desktop-delay-hook) 720 (run-hooks 'desktop-delay-hook)
716 (setq desktop-delay-hook nil) 721 (setq desktop-delay-hook nil)
717 (run-hooks 'desktop-after-read-hook) 722 (run-hooks 'desktop-after-read-hook)
718 (message "Desktop loaded.") 723 (message "Desktop: %d buffer%s restored%s."
724 desktop-buffer-ok-count
725 (if (= 1 desktop-buffer-ok-count) "" "s")
726 (if (< 0 desktop-buffer-fail-count)
727 (format ", %d failed to restore" desktop-buffer-fail-count)
728 ""))
719 t) 729 t)
720 ;; No desktop file found. 730 ;; No desktop file found.
721 (desktop-clear) 731 (desktop-clear)
@@ -772,106 +782,21 @@ directory DIRNAME."
772 (desktop-read desktop-dirname)) 782 (desktop-read desktop-dirname))
773 783
774;; ---------------------------------------------------------------------------- 784;; ----------------------------------------------------------------------------
775;; Note: the following functions use the dynamic variable binding in Lisp. 785(defun desktop-restore-file-buffer (desktop-buffer-file-name
776;; 786 desktop-buffer-name
777 787 desktop-buffer-misc)
778(eval-when-compile ; Just to silence the byte compiler 788 "Restore a file buffer."
779 (defvar desktop-file-version) 789 (eval-when-compile ; Just to silence the byte compiler
780 (defvar desktop-buffer-file-name) 790 (defvar desktop-buffer-major-mode)
781 (defvar desktop-buffer-name) 791 (defvar desktop-buffer-locals))
782 (defvar desktop-buffer-major-mode)
783 (defvar desktop-buffer-minor-modes)
784 (defvar desktop-buffer-point)
785 (defvar desktop-buffer-mark)
786 (defvar desktop-buffer-read-only)
787 (defvar desktop-buffer-misc)
788 (defvar desktop-buffer-locals)
789)
790
791(defun desktop-buffer-info-misc-data ()
792 (if (eq major-mode 'Info-mode)
793 (list Info-current-file
794 Info-current-node)))
795
796;; ----------------------------------------------------------------------------
797(defun desktop-buffer-dired-misc-data ()
798 (when (eq major-mode 'dired-mode)
799 (eval-when-compile (defvar dirname))
800 (cons
801 ;; Value of `dired-directory'.
802 (if (consp dired-directory)
803 ;; Directory name followed by list of files.
804 (cons (desktop-file-name (car dired-directory) dirname) (cdr dired-directory))
805 ;; Directory name, optionally with with shell wildcard.
806 (desktop-file-name dired-directory dirname))
807 ;; Subdirectories in `dired-subdir-alist'.
808 (cdr
809 (nreverse
810 (mapcar
811 (function (lambda (f) (desktop-file-name (car f) dirname)))
812 dired-subdir-alist))))))
813
814;; ----------------------------------------------------------------------------
815(defun desktop-buffer-info () "Load an info file."
816 (if (eq 'Info-mode desktop-buffer-major-mode)
817 (progn
818 (let ((first (nth 0 desktop-buffer-misc))
819 (second (nth 1 desktop-buffer-misc)))
820 (when (and first second)
821 (require 'info)
822 (with-no-warnings
823 (Info-find-node first second))
824 (current-buffer))))))
825
826;; ----------------------------------------------------------------------------
827(eval-when-compile (defvar rmail-buffer)) ; Just to silence the byte compiler.
828(defun desktop-buffer-rmail () "Load an RMAIL file."
829 (if (eq 'rmail-mode desktop-buffer-major-mode)
830 (condition-case error
831 (progn (rmail-input desktop-buffer-file-name)
832 (if (eq major-mode 'rmail-mode)
833 (current-buffer)
834 rmail-buffer))
835 (file-locked
836 (kill-buffer (current-buffer))
837 'ignored))))
838
839;; ----------------------------------------------------------------------------
840(defun desktop-buffer-mh () "Load a folder in the mh system."
841 (if (eq 'mh-folder-mode desktop-buffer-major-mode)
842 (with-no-warnings
843 (mh-find-path)
844 (mh-visit-folder desktop-buffer-name)
845 (current-buffer))))
846
847;; ----------------------------------------------------------------------------
848(defun desktop-buffer-dired () "Load a directory using dired."
849 (if (eq 'dired-mode desktop-buffer-major-mode)
850 ;; First element of `desktop-buffer-misc' is the value of `dired-directory'.
851 ;; This value is a directory name, optionally with with shell wildcard or
852 ;; a directory name followed by list of files.
853 (let* ((dired-dir (car desktop-buffer-misc))
854 (dir (if (consp dired-dir) (car dired-dir) dired-dir)))
855 (if (file-directory-p (file-name-directory dir))
856 (progn
857 (dired dired-dir)
858 ;; The following elements of `desktop-buffer-misc' are the keys
859 ;; from `dired-subdir-alist'.
860 (mapcar 'dired-maybe-insert-subdir (cdr desktop-buffer-misc))
861 (current-buffer))
862 (message "Directory %s no longer exists." dir)
863 (sit-for 1)
864 'ignored))))
865
866;; ----------------------------------------------------------------------------
867(defun desktop-buffer-file ()
868 "Load a file."
869 (if desktop-buffer-file-name 792 (if desktop-buffer-file-name
870 (if (or (file-exists-p desktop-buffer-file-name) 793 (if (or (file-exists-p desktop-buffer-file-name)
871 (and desktop-missing-file-warning 794 (let ((msg (format "Desktop: File \"%s\" no longer exists."
872 (y-or-n-p (format 795 desktop-buffer-file-name)))
873 "File \"%s\" no longer exists. Re-create? " 796 (if desktop-missing-file-warning
874 desktop-buffer-file-name)))) 797 (y-or-n-p (concat msg " Re-create? "))
798 (message msg)
799 nil)))
875 (let* ((auto-insert nil) ; Disable auto insertion 800 (let* ((auto-insert nil) ; Disable auto insertion
876 (coding-system-for-read 801 (coding-system-for-read
877 (or coding-system-for-read 802 (or coding-system-for-read
@@ -885,7 +810,7 @@ directory DIRNAME."
885 (functionp desktop-buffer-major-mode) 810 (functionp desktop-buffer-major-mode)
886 (funcall desktop-buffer-major-mode)) 811 (funcall desktop-buffer-major-mode))
887 buf) 812 buf)
888 'ignored))) 813 nil)))
889 814
890;; ---------------------------------------------------------------------------- 815;; ----------------------------------------------------------------------------
891;; Create a buffer, load its file, set is mode, ...; called from Desktop file 816;; Create a buffer, load its file, set is mode, ...; called from Desktop file
@@ -907,20 +832,32 @@ directory DIRNAME."
907 desktop-buffer-misc 832 desktop-buffer-misc
908 &optional 833 &optional
909 desktop-buffer-locals) 834 desktop-buffer-locals)
835 ;; Just to silence the byte compiler. Bound locally in `desktop-read'.
836 (eval-when-compile
837 (defvar desktop-buffer-ok-count)
838 (defvar desktop-buffer-fail-count))
910 ;; To make desktop files with relative file names possible, we cannot 839 ;; To make desktop files with relative file names possible, we cannot
911 ;; allow `default-directory' to change. Therefore we save current buffer. 840 ;; allow `default-directory' to change. Therefore we save current buffer.
912 (save-current-buffer 841 (save-current-buffer
913 (let ( 842 (let (
914 (buffer-list (buffer-list)) 843 (buffer-list (buffer-list))
915 (hlist desktop-buffer-handlers) 844 (result
916 (result) 845 (condition-case err
917 (handler) 846 (funcall (or (cdr (assq desktop-buffer-major-mode desktop-buffer-mode-handlers))
847 'desktop-restore-file-buffer)
848 desktop-buffer-file-name
849 desktop-buffer-name
850 desktop-buffer-misc)
851 (error
852 (message "Desktop: Can't load buffer %s: %s"
853 desktop-buffer-name (error-message-string err))
854 (when desktop-missing-file-warning (sit-for 1))
855 nil)))
918 ) 856 )
919 ;; Call desktop-buffer-handlers to create buffer. 857 (if (bufferp result)
920 (while (and (not result) hlist) 858 (setq desktop-buffer-ok-count (1+ desktop-buffer-ok-count))
921 (setq handler (car hlist)) 859 (setq desktop-buffer-fail-count (1+ desktop-buffer-fail-count))
922 (setq result (funcall handler)) 860 (setq result nil))
923 (setq hlist (cdr hlist)))
924 (unless (bufferp result) (setq result nil)) 861 (unless (bufferp result) (setq result nil))
925 ;; Restore buffer list order with new buffer at end. Don't change 862 ;; Restore buffer list order with new buffer at end. Don't change
926 ;; the order for old desktop files (old desktop module behaviour). 863 ;; the order for old desktop files (old desktop module behaviour).
@@ -947,7 +884,12 @@ directory DIRNAME."
947 desktop-buffer-minor-modes))) 884 desktop-buffer-minor-modes)))
948 ;; Even though point and mark are non-nil when written by `desktop-save' 885 ;; Even though point and mark are non-nil when written by `desktop-save'
949 ;; they may be modified by handlers wanting to set point or mark themselves. 886 ;; they may be modified by handlers wanting to set point or mark themselves.
950 (when desktop-buffer-point (goto-char desktop-buffer-point)) 887 (when desktop-buffer-point
888 (goto-char
889 (condition-case err
890 ;; Evaluate point. Thus point can be something like '(search-forward ...
891 (eval desktop-buffer-point)
892 (error (message "%s" (error-message-string err)) 1))))
951 (when desktop-buffer-mark 893 (when desktop-buffer-mark
952 (if (consp desktop-buffer-mark) 894 (if (consp desktop-buffer-mark)
953 (progn 895 (progn
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index d41bfcad58a..17602317958 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -48,7 +48,6 @@
48;; 48;;
49;; - Refine hunk on a word-by-word basis. 49;; - Refine hunk on a word-by-word basis.
50;; 50;;
51;; - Use the new next-error-function to allow C-x `.
52;; - Handle `diff -b' output in context->unified. 51;; - Handle `diff -b' output in context->unified.
53 52
54;;; Code: 53;;; Code:
@@ -886,9 +885,14 @@ See `after-change-functions' for the meaning of BEG, END and LEN."
886 (diff-fixup-modifs (point) (cdr diff-unhandled-changes))))) 885 (diff-fixup-modifs (point) (cdr diff-unhandled-changes)))))
887 (setq diff-unhandled-changes nil))) 886 (setq diff-unhandled-changes nil)))
888 887
889;;;; 888(defun diff-next-error (arg reset)
890;;;; The main function 889 ;; Select a window that displays the current buffer so that point
891;;;; 890 ;; movements are reflected in that window. Otherwise, the user might
891 ;; never see the hunk corresponding to the source she's jumping to.
892 (pop-to-buffer (current-buffer))
893 (if reset (goto-char (point-min)))
894 (diff-hunk-next arg)
895 (diff-goto-source))
892 896
893;;;###autoload 897;;;###autoload
894(define-derived-mode diff-mode fundamental-mode "Diff" 898(define-derived-mode diff-mode fundamental-mode "Diff"
@@ -916,6 +920,7 @@ a diff with \\[diff-reverse-direction]."
916 ;; (set (make-local-variable 'paragraph-separate) paragraph-start) 920 ;; (set (make-local-variable 'paragraph-separate) paragraph-start)
917 ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t") 921 ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t")
918 ;; compile support 922 ;; compile support
923 (set (make-local-variable 'next-error-function) 'diff-next-error)
919 924
920 (when (and (> (point-max) (point-min)) diff-default-read-only) 925 (when (and (> (point-max) (point-min)) diff-default-read-only)
921 (toggle-read-only t)) 926 (toggle-read-only t))
diff --git a/lisp/dired.el b/lisp/dired.el
index f562a0492eb..7440e3c3bfc 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1402,6 +1402,8 @@ Keybindings:
1402 (or switches dired-listing-switches)) 1402 (or switches dired-listing-switches))
1403 (set (make-local-variable 'font-lock-defaults) 1403 (set (make-local-variable 'font-lock-defaults)
1404 '(dired-font-lock-keywords t nil nil beginning-of-line)) 1404 '(dired-font-lock-keywords t nil nil beginning-of-line))
1405 (set (make-local-variable 'desktop-buffer-misc-data-function)
1406 'dired-desktop-buffer-misc-data)
1405 (dired-sort-other dired-actual-switches t) 1407 (dired-sort-other dired-actual-switches t)
1406 (run-mode-hooks 'dired-mode-hook) 1408 (run-mode-hooks 'dired-mode-hook)
1407 (when (featurep 'x-dnd) 1409 (when (featurep 'x-dnd)
@@ -3340,7 +3342,49 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3340 (let ((local-file (x-dnd-get-local-file-uri uri))) 3342 (let ((local-file (x-dnd-get-local-file-uri uri)))
3341 (if local-file (dired-dnd-handle-local-file local-file action) 3343 (if local-file (dired-dnd-handle-local-file local-file action)
3342 nil))) 3344 nil)))
3345
3346
3347;;;; Desktop support
3348
3349(eval-when-compile (require 'desktop))
3350
3351(defun dired-desktop-buffer-misc-data (desktop-dirname)
3352 "Auxiliary information to be saved in desktop file."
3353 (cons
3354 ;; Value of `dired-directory'.
3355 (if (consp dired-directory)
3356 ;; Directory name followed by list of files.
3357 (cons (desktop-file-name (car dired-directory) desktop-dirname)
3358 (cdr dired-directory))
3359 ;; Directory name, optionally with with shell wildcard.
3360 (desktop-file-name dired-directory desktop-dirname))
3361 ;; Subdirectories in `dired-subdir-alist'.
3362 (cdr
3363 (nreverse
3364 (mapcar
3365 (function (lambda (f) (desktop-file-name (car f) desktop-dirname)))
3366 dired-subdir-alist)))))
3343 3367
3368;;;###autoload
3369(defun dired-restore-desktop-buffer (desktop-buffer-file-name
3370 desktop-buffer-name
3371 desktop-buffer-misc)
3372 "Restore a dired buffer specified in a desktop file."
3373 ;; First element of `desktop-buffer-misc' is the value of `dired-directory'.
3374 ;; This value is a directory name, optionally with with shell wildcard or
3375 ;; a directory name followed by list of files.
3376 (let* ((dired-dir (car desktop-buffer-misc))
3377 (dir (if (consp dired-dir) (car dired-dir) dired-dir)))
3378 (if (file-directory-p (file-name-directory dir))
3379 (progn
3380 (dired dired-dir)
3381 ;; The following elements of `desktop-buffer-misc' are the keys
3382 ;; from `dired-subdir-alist'.
3383 (mapcar 'dired-maybe-insert-subdir (cdr desktop-buffer-misc))
3384 (current-buffer))
3385 (message "Desktop: Directory %s no longer exists." dir)
3386 (when desktop-missing-file-warning (sit-for 1))
3387 nil)))
3344 3388
3345 3389
3346(if (eq system-type 'vax-vms) 3390(if (eq system-type 'vax-vms)
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 9956d5003cc..4ed47129fc9 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -134,11 +134,10 @@ The result of the body appears to the compiler as a quoted constant."
134 ;; Remember, it's magic. 134 ;; Remember, it's magic.
135 (cons 'progn body)) 135 (cons 'progn body))
136 136
137(defun with-no-warnings (&optional first &rest body) 137(defun with-no-warnings (&rest body)
138 "Like `progn', but prevents compiler warnings in the body." 138 "Like `progn', but prevents compiler warnings in the body."
139 ;; The implementation for the interpreter is basically trivial. 139 ;; The implementation for the interpreter is basically trivial.
140 (if body (car (last body)) 140 (car (last body)))
141 first))
142 141
143 142
144;;; I nuked this because it's not a good idea for users to think of using it. 143;;; I nuked this because it's not a good idea for users to think of using it.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 43e0732104f..f6e2946aa8b 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3716,7 +3716,7 @@ being undefined will be suppressed."
3716(byte-defop-compiler-1 with-no-warnings byte-compile-no-warnings) 3716(byte-defop-compiler-1 with-no-warnings byte-compile-no-warnings)
3717(defun byte-compile-no-warnings (form) 3717(defun byte-compile-no-warnings (form)
3718 (let (byte-compile-warnings) 3718 (let (byte-compile-warnings)
3719 (byte-compile-form (cadr form)))) 3719 (byte-compile-form (cons 'progn (cdr form)))))
3720 3720
3721;;; tags 3721;;; tags
3722 3722
@@ -3991,7 +3991,7 @@ already up-to-date."
3991 nil)))) 3991 nil))))
3992 3992
3993;;;###autoload 3993;;;###autoload
3994(defun batch-byte-recompile-directory () 3994(defun batch-byte-recompile-directory (&optional arg)
3995 "Run `byte-recompile-directory' on the dirs remaining on the command line. 3995 "Run `byte-recompile-directory' on the dirs remaining on the command line.
3996Must be used only with `-batch', and kills Emacs on completion. 3996Must be used only with `-batch', and kills Emacs on completion.
3997For example, invoke `emacs -batch -f batch-byte-recompile-directory .'." 3997For example, invoke `emacs -batch -f batch-byte-recompile-directory .'."
@@ -4002,7 +4002,7 @@ For example, invoke `emacs -batch -f batch-byte-recompile-directory .'."
4002 (or command-line-args-left 4002 (or command-line-args-left
4003 (setq command-line-args-left '("."))) 4003 (setq command-line-args-left '(".")))
4004 (while command-line-args-left 4004 (while command-line-args-left
4005 (byte-recompile-directory (car command-line-args-left)) 4005 (byte-recompile-directory (car command-line-args-left) arg)
4006 (setq command-line-args-left (cdr command-line-args-left))) 4006 (setq command-line-args-left (cdr command-line-args-left)))
4007 (kill-emacs 0)) 4007 (kill-emacs 0))
4008 4008
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index fddab94dfd4..a4e08ef7970 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -2604,18 +2604,13 @@ This function will not modify `match-data'."
2604(defun checkdoc-output-mode () 2604(defun checkdoc-output-mode ()
2605 "Create and setup the buffer used to maintain checkdoc warnings. 2605 "Create and setup the buffer used to maintain checkdoc warnings.
2606\\<checkdoc-output-mode-map>\\[checkdoc-find-error] - Go to this error location." 2606\\<checkdoc-output-mode-map>\\[checkdoc-find-error] - Go to this error location."
2607 (if (get-buffer checkdoc-diagnostic-buffer) 2607 (kill-all-local-variables)
2608 (get-buffer checkdoc-diagnostic-buffer) 2608 (setq mode-name "Checkdoc"
2609 (save-excursion 2609 major-mode 'checkdoc-output-mode)
2610 (set-buffer (get-buffer-create checkdoc-diagnostic-buffer)) 2610 (set (make-local-variable 'font-lock-defaults)
2611 (kill-all-local-variables) 2611 '((checkdoc-output-font-lock-keywords) t t ((?- . "w") (?_ . "w"))))
2612 (setq mode-name "Checkdoc" 2612 (use-local-map checkdoc-output-mode-map)
2613 major-mode 'checkdoc-output-mode) 2613 (run-mode-hooks 'checkdoc-output-mode-hook))
2614 (set (make-local-variable 'font-lock-defaults)
2615 '((checkdoc-output-font-lock-keywords) t t ((?- . "w") (?_ . "w"))))
2616 (use-local-map checkdoc-output-mode-map)
2617 (run-hooks 'checkdoc-output-mode-hook)
2618 (current-buffer))))
2619 2614
2620(defalias 'checkdoc-find-error-mouse 'checkdoc-find-error) 2615(defalias 'checkdoc-find-error-mouse 'checkdoc-find-error)
2621(defun checkdoc-find-error (&optional event) 2616(defun checkdoc-find-error (&optional event)
@@ -2634,31 +2629,31 @@ This function will not modify `match-data'."
2634(defun checkdoc-buffer-label () 2629(defun checkdoc-buffer-label ()
2635 "The name to use for a checkdoc buffer in the error list." 2630 "The name to use for a checkdoc buffer in the error list."
2636 (if (buffer-file-name) 2631 (if (buffer-file-name)
2637 (file-name-nondirectory (buffer-file-name)) 2632 (file-relative-name (buffer-file-name))
2638 (concat "#<buffer "(buffer-name) ">"))) 2633 (concat "#<buffer "(buffer-name) ">")))
2639 2634
2640(defun checkdoc-start-section (check-type) 2635(defun checkdoc-start-section (check-type)
2641 "Initialize the checkdoc diagnostic buffer for a pass. 2636 "Initialize the checkdoc diagnostic buffer for a pass.
2642Create the header so that the string CHECK-TYPE is displayed as the 2637Create the header so that the string CHECK-TYPE is displayed as the
2643function called to create the messages." 2638function called to create the messages."
2644 (checkdoc-output-to-error-buffer 2639 (let ((dir default-directory)
2645 "\n\n\C-l\n*** " 2640 (label (checkdoc-buffer-label)))
2646 (checkdoc-buffer-label) ": " check-type " V " checkdoc-version)) 2641 (with-current-buffer (get-buffer-create checkdoc-diagnostic-buffer)
2642 (checkdoc-output-mode)
2643 (setq default-directory dir)
2644 (goto-char (point-max))
2645 (insert "\n\n\C-l\n*** " label ": " check-type " V " checkdoc-version))))
2647 2646
2648(defun checkdoc-error (point msg) 2647(defun checkdoc-error (point msg)
2649 "Store POINT and MSG as errors in the checkdoc diagnostic buffer." 2648 "Store POINT and MSG as errors in the checkdoc diagnostic buffer."
2650 (setq checkdoc-pending-errors t) 2649 (setq checkdoc-pending-errors t)
2651 (checkdoc-output-to-error-buffer 2650 (let ((text (list "\n" (checkdoc-buffer-label) ":"
2652 "\n" (checkdoc-buffer-label) ":" 2651 (int-to-string
2653 (int-to-string (count-lines (point-min) (or point (point-min)))) ": " 2652 (count-lines (point-min) (or point (point-min))))
2654 msg)) 2653 ": " msg)))
2655 2654 (with-current-buffer (get-buffer checkdoc-diagnostic-buffer)
2656(defun checkdoc-output-to-error-buffer (&rest text) 2655 (goto-char (point-max))
2657 "Place TEXT into the checkdoc diagnostic buffer." 2656 (apply 'insert text))))
2658 (save-excursion
2659 (set-buffer (checkdoc-output-mode))
2660 (goto-char (point-max))
2661 (apply 'insert text)))
2662 2657
2663(defun checkdoc-show-diagnostics () 2658(defun checkdoc-show-diagnostics ()
2664 "Display the checkdoc diagnostic buffer in a temporary window." 2659 "Display the checkdoc diagnostic buffer in a temporary window."
diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el
index d8890bd0239..ed632b14cd4 100644
--- a/lisp/emacs-lisp/disass.el
+++ b/lisp/emacs-lisp/disass.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Doug Cutting <doug@csli.stanford.edu> 5;; Author: Doug Cutting <doug@csli.stanford.edu>
6;; Jamie Zawinski <jwz@lucid.com> 6;; Jamie Zawinski <jwz@lucid.com>
7;; Maintainer: Jamie Zawinski <jwz@lucid.com> 7;; Maintainer: FSF
8;; Keywords: internal 8;; Keywords: internal
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -57,7 +57,7 @@ redefine OBJECT if it is a symbol."
57 (interactive (list (intern (completing-read "Disassemble function: " 57 (interactive (list (intern (completing-read "Disassemble function: "
58 obarray 'fboundp t)) 58 obarray 'fboundp t))
59 nil 0 t)) 59 nil 0 t))
60 (if (consp object) 60 (if (and (consp object) (not (eq (car object) 'lambda)))
61 (setq object (list 'lambda () object))) 61 (setq object (list 'lambda () object)))
62 (or indent (setq indent 0)) ;Default indent to zero 62 (or indent (setq indent 0)) ;Default indent to zero
63 (save-excursion 63 (save-excursion
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 88f7657b6bf..dbd7194f50a 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -478,8 +478,8 @@ Do it only if `easy-menu-precalculate-equivalent-keybindings' is on."
478 (when easy-menu-precalculate-equivalent-keybindings 478 (when easy-menu-precalculate-equivalent-keybindings
479 (if (and (symbolp menu) (not (keymapp menu)) (boundp menu)) 479 (if (and (symbolp menu) (not (keymapp menu)) (boundp menu))
480 (setq menu (symbol-value menu))) 480 (setq menu (symbol-value menu)))
481 ;; x-popup-menu does not exist on tty-only Emacs. 481 (and (keymapp menu) (fboundp 'x-popup-menu)
482 ;; (if (keymapp menu) (x-popup-menu nil menu)) 482 (x-popup-menu nil menu))
483 )) 483 ))
484 484
485(defun add-submenu (menu-path submenu &optional before in-menu) 485(defun add-submenu (menu-path submenu &optional before in-menu)
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 11d9ba756f1..044c414d84e 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1562,17 +1562,17 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
1562 (:foreground "DimGray" :weight bold :slant italic)) 1562 (:foreground "DimGray" :weight bold :slant italic))
1563 (((class grayscale) (background dark)) 1563 (((class grayscale) (background dark))
1564 (:foreground "LightGray" :weight bold :slant italic)) 1564 (:foreground "LightGray" :weight bold :slant italic))
1565 (((class color) (min-colors 88) (background light)) 1565 (((class color) (min-colors 88) (background light))
1566 (:foreground "Firebrick")) 1566 (:foreground "Firebrick"))
1567 (((class color) (min-colors 88) (background dark)) 1567 (((class color) (min-colors 88) (background dark))
1568 (:foreground "chocolate1")) 1568 (:foreground "chocolate1"))
1569 (((class color) (min-colors 16) (background light)) 1569 (((class color) (min-colors 16) (background light))
1570 (:foreground "red")) 1570 (:foreground "red"))
1571 (((class color) (min-colors 16) (background dark)) 1571 (((class color) (min-colors 16) (background dark))
1572 (:foreground "red1")) 1572 (:foreground "red1"))
1573 (((class color) (min-colors 8) (background light)) 1573 (((class color) (min-colors 8) (background light))
1574 (:foreground "red")) 1574 (:foreground "red"))
1575 (((class color) (min-colors 8) (background dark)) 1575 (((class color) (min-colors 8) (background dark))
1576 (:foreground "red1")) 1576 (:foreground "red1"))
1577 (t (:weight bold :slant italic))) 1577 (t (:weight bold :slant italic)))
1578 "Font Lock mode face used to highlight comments." 1578 "Font Lock mode face used to highlight comments."
@@ -1673,13 +1673,14 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
1673 '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold)) 1673 '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold))
1674 (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold)) 1674 (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold))
1675 (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold)) 1675 (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold))
1676 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold)) (((class color) (min-colors 8)) (:foreground "red")) 1676 (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold))
1677 (((class color) (min-colors 8)) (:foreground "red"))
1677 (t (:inverse-video t :weight bold))) 1678 (t (:inverse-video t :weight bold)))
1678 "Font Lock mode face used to highlight warnings." 1679 "Font Lock mode face used to highlight warnings."
1679 :group 'font-lock-highlighting-faces) 1680 :group 'font-lock-highlighting-faces)
1680 1681
1681(defface font-lock-preprocessor-face 1682(defface font-lock-preprocessor-face
1682 '((t :inherit 'font-lock-builtin-face)) 1683 '((t :inherit font-lock-builtin-face))
1683 "Font Lock mode face used to highlight preprocessor directives." 1684 "Font Lock mode face used to highlight preprocessor directives."
1684 :group 'font-lock-highlighting-faces) 1685 :group 'font-lock-highlighting-faces)
1685 1686
diff --git a/lisp/frame.el b/lisp/frame.el
index 2be0f6417ff..d8ddfa67862 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1,6 +1,6 @@
1;;; frame.el --- multi-frame management independent of window systems 1;;; frame.el --- multi-frame management independent of window systems
2 2
3;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003 3;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003, 2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -131,7 +131,7 @@ use (car ARGS) as a function to do the work.
131Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args." 131Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
132 (if (and args (symbolp (car args))) 132 (if (and args (symbolp (car args)))
133 (apply (car args) buffer (cdr args)) 133 (apply (car args) buffer (cdr args))
134 (let ((window (get-buffer-window buffer t))) 134 (let ((window (get-buffer-window buffer 0)))
135 (or 135 (or
136 ;; If we have a window already, make it visible. 136 ;; If we have a window already, make it visible.
137 (when window 137 (when window
@@ -149,6 +149,7 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
149 (let* ((pop-up-frames nil) (pop-up-windows t) 149 (let* ((pop-up-frames nil) (pop-up-windows t)
150 special-display-regexps special-display-buffer-names 150 special-display-regexps special-display-buffer-names
151 (window (display-buffer buffer))) 151 (window (display-buffer buffer)))
152 ;; Only do it if this is a new window:
152 ;; (set-window-dedicated-p window t) 153 ;; (set-window-dedicated-p window t)
153 window)) 154 window))
154 ;; If no window yet, make one in a new frame. 155 ;; If no window yet, make one in a new frame.
@@ -564,7 +565,7 @@ is not considered (see `next-frame')."
564 (interactive) 565 (interactive)
565 (select-window (next-window (selected-window) 566 (select-window (next-window (selected-window)
566 (> (minibuffer-depth) 0) 567 (> (minibuffer-depth) 0)
567 t)) 568 0))
568 (select-frame-set-input-focus (selected-frame))) 569 (select-frame-set-input-focus (selected-frame)))
569 570
570(defun previous-multiframe-window () 571(defun previous-multiframe-window ()
@@ -572,7 +573,7 @@ is not considered (see `next-frame')."
572 (interactive) 573 (interactive)
573 (select-window (previous-window (selected-window) 574 (select-window (previous-window (selected-window)
574 (> (minibuffer-depth) 0) 575 (> (minibuffer-depth) 0)
575 t)) 576 0))
576 (select-frame-set-input-focus (selected-frame))) 577 (select-frame-set-input-focus (selected-frame)))
577 578
578(defun make-frame-on-display (display &optional parameters) 579(defun make-frame-on-display (display &optional parameters)
diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el
index 1663bd3f5f8..6d35e2196ae 100644
--- a/lisp/gnus/mailcap.el
+++ b/lisp/gnus/mailcap.el
@@ -271,6 +271,7 @@ validity. Otherwise, if it is a non-function Lisp symbol or list
271whose car is a symbol, it is `eval'led to yield the validity. If it 271whose car is a symbol, it is `eval'led to yield the validity. If it
272is a string or list of strings, it represents a shell command to run 272is a string or list of strings, it represents a shell command to run
273to return a true or false shell value for the validity.") 273to return a true or false shell value for the validity.")
274(put 'mailcap-mime-data 'risky-local-variable t)
274 275
275(defcustom mailcap-download-directory nil 276(defcustom mailcap-download-directory nil
276 "*Directory to which `mailcap-save-binary-file' downloads files by default. 277 "*Directory to which `mailcap-save-binary-file' downloads files by default.
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index ab76b5eb232..6a71a544638 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -63,6 +63,7 @@ With ARG, you are asked to choose which language."
63 (setq default-directory (expand-file-name "~/")) 63 (setq default-directory (expand-file-name "~/"))
64 (setq buffer-auto-save-file-name nil) 64 (setq buffer-auto-save-file-name nil)
65 (insert-file-contents (expand-file-name filename data-directory)) 65 (insert-file-contents (expand-file-name filename data-directory))
66 (hack-local-variables)
66 (goto-char (point-min)) 67 (goto-char (point-min))
67 (search-forward "\n<<") 68 (search-forward "\n<<")
68 (beginning-of-line) 69 (beginning-of-line)
@@ -354,16 +355,31 @@ KIND should be `var' for a variable or `subr' for a subroutine."
354 (when (commandp function) 355 (when (commandp function)
355 (let* ((remapped (command-remapping function)) 356 (let* ((remapped (command-remapping function))
356 (keys (where-is-internal 357 (keys (where-is-internal
357 (or remapped function) overriding-local-map nil nil))) 358 (or remapped function) overriding-local-map nil nil))
359 non-modified-keys)
360 ;; Which non-control non-meta keys run this command?
361 (dolist (key keys)
362 (if (member (event-modifiers (aref key 0)) '(nil (shift)))
363 (push key non-modified-keys)))
358 (when remapped 364 (when remapped
359 (princ "It is remapped to `") 365 (princ "It is remapped to `")
360 (princ (symbol-name remapped)) 366 (princ (symbol-name remapped))
361 (princ "'")) 367 (princ "'"))
368
362 (when keys 369 (when keys
363 (princ (if remapped " which is bound to " "It is bound to ")) 370 (princ (if remapped " which is bound to " "It is bound to "))
364 ;; FIXME: This list can be very long (f.ex. for self-insert-command). 371 ;; FIXME: This list can be very long (f.ex. for self-insert-command).
365 (princ (mapconcat 'key-description keys ", "))) 372 ;; If there are many, remove them from KEYS.
366 (when (or remapped keys) 373 (if (< (length non-modified-keys) 10)
374 (princ (mapconcat 'key-description keys ", "))
375 (dolist (key non-modified-keys)
376 (setq keys (delq key keys)))
377 (if keys
378 (progn
379 (princ (mapconcat 'key-description keys ", "))
380 (princ ", and many ordinary text characters"))
381 (princ "many ordinary text characters"))))
382 (when (or remapped keys non-modified-keys)
367 (princ ".") 383 (princ ".")
368 (terpri)))) 384 (terpri))))
369 (let* ((arglist (help-function-arglist def)) 385 (let* ((arglist (help-function-arglist def))
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 149eebb3d36..4499f5c48cb 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -195,14 +195,17 @@ Commands:
195 195
196;;;###autoload 196;;;###autoload
197(defun help-mode-finish () 197(defun help-mode-finish ()
198 (let ((entry (assq (selected-window) view-return-to-alist)))
199 (if entry (setcdr entry (cons (selected-window)
200 help-return-method))
201 (setq view-return-to-alist
202 (cons (cons (selected-window) help-return-method)
203 view-return-to-alist))))
198 (when (eq major-mode 'help-mode) 204 (when (eq major-mode 'help-mode)
199 ;; View mode's read-only status of existing *Help* buffer is lost 205 ;; View mode's read-only status of existing *Help* buffer is lost
200 ;; by with-output-to-temp-buffer. 206 ;; by with-output-to-temp-buffer.
201 (toggle-read-only 1) 207 (toggle-read-only 1)
202 (help-make-xrefs (current-buffer))) 208 (help-make-xrefs (current-buffer))))
203 (setq view-return-to-alist
204 (list (cons (selected-window) help-return-method))))
205
206 209
207;; Grokking cross-reference information in doc strings and 210;; Grokking cross-reference information in doc strings and
208;; hyperlinking it. 211;; hyperlinking it.
diff --git a/lisp/image.el b/lisp/image.el
index 0e71bd4a349..9d656794aa9 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -176,7 +176,7 @@ means display it in the right marginal area."
176 176
177 177
178;;;###autoload 178;;;###autoload
179(defun insert-image (image &optional string area) 179(defun insert-image (image &optional string area slice)
180 "Insert IMAGE into current buffer at point. 180 "Insert IMAGE into current buffer at point.
181IMAGE is displayed by inserting STRING into the current buffer 181IMAGE is displayed by inserting STRING into the current buffer
182with a `display' property whose value is the image. STRING is 182with a `display' property whose value is the image. STRING is
@@ -184,7 +184,12 @@ defaulted if you omit it.
184AREA is where to display the image. AREA nil or omitted means 184AREA is where to display the image. AREA nil or omitted means
185display it in the text area, a value of `left-margin' means 185display it in the text area, a value of `left-margin' means
186display it in the left marginal area, a value of `right-margin' 186display it in the left marginal area, a value of `right-margin'
187means display it in the right marginal area." 187means display it in the right marginal area.
188SLICE specifies slice of IMAGE to insert. SLICE nil or omitted
189means insert whole image. SLICE is a list (X Y WIDTH HEIGHT)
190specifying the X and Y positions and WIDTH and HEIGHT of image area
191to insert. A float value 0.0 - 1.0 means relative to the width or
192height of the image; integer values are taken as pixel values."
188 ;; Use a space as least likely to cause trouble when it's a hidden 193 ;; Use a space as least likely to cause trouble when it's a hidden
189 ;; character in the buffer. 194 ;; character in the buffer.
190 (unless string (setq string " ")) 195 (unless string (setq string " "))
@@ -204,7 +209,40 @@ means display it in the right marginal area."
204 (let ((start (point))) 209 (let ((start (point)))
205 (insert string) 210 (insert string)
206 (add-text-properties start (point) 211 (add-text-properties start (point)
207 `(display ,image rear-nonsticky (display))))) 212 `(display ,(if slice
213 (list (cons 'slice slice) image)
214 image) rear-nonsticky (display)))))
215
216
217(defun insert-sliced-image (image &optional string area rows cols)
218 (unless string (setq string " "))
219 (unless (eq (car-safe image) 'image)
220 (error "Not an image: %s" image))
221 (unless (or (null area) (memq area '(left-margin right-margin)))
222 (error "Invalid area %s" area))
223 (if area
224 (setq image (list (list 'margin area) image))
225 ;; Cons up a new spec equal but not eq to `image' so that
226 ;; inserting it twice in a row (adjacently) displays two copies of
227 ;; the image. Don't try to avoid this by looking at the display
228 ;; properties on either side so that we DTRT more often with
229 ;; cut-and-paste. (Yanking killed image text next to another copy
230 ;; of it loses anyway.)
231 (setq image (cons 'image (cdr image))))
232 (let ((x 0.0) (dx (/ 1.0001 (or cols 1)))
233 (y 0.0) (dy (/ 1.0001 (or rows 1))))
234 (while (< y 1.0)
235 (while (< x 1.0)
236 (let ((start (point)))
237 (insert string)
238 (add-text-properties start (point)
239 `(display ,(list (list 'slice x y dx dy) image)
240 rear-nonsticky (display)))
241 (setq x (+ x dx))))
242 (setq x 0.0
243 y (+ y dy))
244 (insert "\n"))))
245
208 246
209 247
210;;;###autoload 248;;;###autoload
diff --git a/lisp/info.el b/lisp/info.el
index 5fd9af31202..a284ca7fa2e 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -66,29 +66,29 @@ The Lisp code is executed when the node is selected.")
66(put 'Info-enable-active-nodes 'risky-local-variable t) 66(put 'Info-enable-active-nodes 'risky-local-variable t)
67 67
68(defface info-node 68(defface info-node
69 '((((class color) (background light)) (:foreground "brown" :weight bold :slant italic)) 69 '((((class color) (background light)) :foreground "brown" :weight bold :slant italic)
70 (((class color) (background dark)) (:foreground "white" :weight bold :slant italic)) 70 (((class color) (background dark)) :foreground "white" :weight bold :slant italic)
71 (t (:weight bold :slant italic))) 71 (t :weight bold :slant italic))
72 "Face for Info node names." 72 "Face for Info node names."
73 :group 'info) 73 :group 'info)
74 74
75(defface info-menu-5 75(defface info-menu-5
76 '((((class color)) (:foreground "red1")) 76 '((((class color)) :foreground "red1")
77 (t (:underline t))) 77 (t :underline t))
78 "Face for every third `*' in an Info menu." 78 "Face for every third `*' in an Info menu."
79 :group 'info) 79 :group 'info)
80 80
81(defface info-xref 81(defface info-xref
82 '((((class color) (background light)) (:foreground "blue")) 82 '((((class color) (background light)) :foreground "blue")
83 (((class color) (background dark)) (:foreground "cyan")) 83 (((class color) (background dark)) :foreground "cyan")
84 (t (:underline t))) 84 (t :underline t))
85 "Face for Info cross-references." 85 "Face for Info cross-references."
86 :group 'info) 86 :group 'info)
87 87
88(defface info-xref-visited 88(defface info-xref-visited
89 '((((class color) (background light)) (:foreground "magenta4")) 89 '((t :inherit info-xref)
90 (((class color) (background dark)) (:foreground "magenta4")) 90 (((class color) (background light)) :foreground "magenta4")
91 (t (:underline t))) 91 (((class color) (background dark)) :foreground "magenta4"))
92 "Face for visited Info cross-references." 92 "Face for visited Info cross-references."
93 :group 'info) 93 :group 'info)
94 94
@@ -110,12 +110,12 @@ A header-line does not scroll with the rest of the buffer."
110 :group 'info) 110 :group 'info)
111 111
112(defface info-header-xref 112(defface info-header-xref
113 '((t (:inherit info-xref))) 113 '((t :inherit info-xref))
114 "Face for Info cross-references in a node header." 114 "Face for Info cross-references in a node header."
115 :group 'info) 115 :group 'info)
116 116
117(defface info-header-node 117(defface info-header-node
118 '((t (:inherit info-node))) 118 '((t :inherit info-node))
119 "Face for Info nodes in a node header." 119 "Face for Info nodes in a node header."
120 :group 'info) 120 :group 'info)
121 121
@@ -2907,6 +2907,8 @@ Advanced commands:
2907 ;; This is for the sake of the invisible text we use handling titles. 2907 ;; This is for the sake of the invisible text we use handling titles.
2908 (make-local-variable 'line-move-ignore-invisible) 2908 (make-local-variable 'line-move-ignore-invisible)
2909 (setq line-move-ignore-invisible t) 2909 (setq line-move-ignore-invisible t)
2910 (make-local-variable 'desktop-buffer-misc-data-function)
2911 (setq desktop-buffer-misc-data-function 'Info-desktop-buffer-misc-data)
2910 (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t) 2912 (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t)
2911 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) 2913 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
2912 (Info-set-mode-line) 2914 (Info-set-mode-line)
@@ -3111,26 +3113,26 @@ the variable `Info-file-list-for-emacs'."
3111 (Info-goto-emacs-command-node command))))) 3113 (Info-goto-emacs-command-node command)))))
3112 3114
3113(defface Info-title-1-face 3115(defface Info-title-1-face
3114 '((((type tty pc) (class color)) (:foreground "yellow" :weight bold)) 3116 '((((type tty pc) (class color)) :foreground "yellow" :weight bold)
3115 (t (:height 1.2 :inherit Info-title-2-face))) 3117 (t :height 1.2 :inherit Info-title-2-face))
3116 "Face for Info titles at level 1." 3118 "Face for Info titles at level 1."
3117 :group 'info) 3119 :group 'info)
3118 3120
3119(defface Info-title-2-face 3121(defface Info-title-2-face
3120 '((((type tty pc) (class color)) (:foreground "lightblue" :weight bold)) 3122 '((((type tty pc) (class color)) :foreground "lightblue" :weight bold)
3121 (t (:height 1.2 :inherit Info-title-3-face))) 3123 (t :height 1.2 :inherit Info-title-3-face))
3122 "Face for Info titles at level 2." 3124 "Face for Info titles at level 2."
3123 :group 'info) 3125 :group 'info)
3124 3126
3125(defface Info-title-3-face 3127(defface Info-title-3-face
3126 '((((type tty pc) (class color)) (:weight bold)) 3128 '((((type tty pc) (class color)) :weight bold)
3127 (t (:height 1.2 :inherit Info-title-4-face))) 3129 (t :height 1.2 :inherit Info-title-4-face))
3128 "Face for Info titles at level 3." 3130 "Face for Info titles at level 3."
3129 :group 'info) 3131 :group 'info)
3130 3132
3131(defface Info-title-4-face 3133(defface Info-title-4-face
3132 '((((type tty pc) (class color)) (:weight bold)) 3134 '((((type tty pc) (class color)) :weight bold)
3133 (t (:weight bold :inherit variable-pitch))) 3135 (t :weight bold :inherit variable-pitch))
3134 "Face for Info titles at level 4." 3136 "Face for Info titles at level 4."
3135 :group 'info) 3137 :group 'info)
3136 3138
@@ -3708,6 +3710,23 @@ BUFFER is the buffer speedbar is requesting buttons for."
3708 "^No \".*\" in index$")) 3710 "^No \".*\" in index$"))
3709 (add-to-list 'debug-ignored-errors mess)) 3711 (add-to-list 'debug-ignored-errors mess))
3710 3712
3713;;;; Desktop support
3714
3715(defun Info-desktop-buffer-misc-data (desktop-dirname)
3716 "Auxiliary information to be saved in desktop file."
3717 (list Info-current-file Info-current-node))
3718
3719;;;###autoload
3720(defun Info-restore-desktop-buffer (desktop-buffer-file-name
3721 desktop-buffer-name
3722 desktop-buffer-misc)
3723 "Restore an info buffer specified in a desktop file."
3724 (let ((first (nth 0 desktop-buffer-misc))
3725 (second (nth 1 desktop-buffer-misc)))
3726 (when (and first second)
3727 (Info-find-node first second)
3728 (current-buffer))))
3729
3711(provide 'info) 3730(provide 'info)
3712 3731
3713;;; arch-tag: f2480fe2-2139-40c1-a49b-6314991164ac 3732;;; arch-tag: f2480fe2-2139-40c1-a49b-6314991164ac
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 65e9fcab362..0b7aa54a288 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1054,7 +1054,7 @@ For a list of useful values for KEY and their meanings,
1054see `language-info-alist'." 1054see `language-info-alist'."
1055 (if (symbolp lang-env) 1055 (if (symbolp lang-env)
1056 (setq lang-env (symbol-name lang-env))) 1056 (setq lang-env (symbol-name lang-env)))
1057 (let ((lang-slot (assoc-ignore-case lang-env language-info-alist))) 1057 (let ((lang-slot (assoc-string lang-env language-info-alist t)))
1058 (if lang-slot 1058 (if lang-slot
1059 (cdr (assq key (cdr lang-slot)))))) 1059 (cdr (assq key (cdr lang-slot))))))
1060 1060
@@ -1597,11 +1597,11 @@ to using the function `set-language-environment'."
1597 :link '(custom-manual "(emacs)Language Environments") 1597 :link '(custom-manual "(emacs)Language Environments")
1598 :set (lambda (symbol value) (set-language-environment value)) 1598 :set (lambda (symbol value) (set-language-environment value))
1599 :get (lambda (x) 1599 :get (lambda (x)
1600 (or (car-safe (assoc-ignore-case 1600 (or (car-safe (assoc-string
1601 (if (symbolp current-language-environment) 1601 (if (symbolp current-language-environment)
1602 (symbol-name current-language-environment) 1602 (symbol-name current-language-environment)
1603 current-language-environment) 1603 current-language-environment)
1604 language-info-alist)) 1604 language-info-alist t))
1605 "English")) 1605 "English"))
1606 ;; custom type will be updated with `set-language-info'. 1606 ;; custom type will be updated with `set-language-info'.
1607 :type (if language-info-alist 1607 :type (if language-info-alist
@@ -1749,7 +1749,7 @@ specifies the character set for the major languages of Western Europe."
1749 (if (symbolp language-name) 1749 (if (symbolp language-name)
1750 (setq language-name (symbol-name language-name))) 1750 (setq language-name (symbol-name language-name)))
1751 (setq language-name "English")) 1751 (setq language-name "English"))
1752 (let ((slot (assoc-ignore-case language-name language-info-alist))) 1752 (let ((slot (assoc-string language-name language-info-alist t)))
1753 (unless slot 1753 (unless slot
1754 (error "Language environment not defined: %S" language-name)) 1754 (error "Language environment not defined: %S" language-name))
1755 (setq language-name (car slot))) 1755 (setq language-name (car slot)))
@@ -2282,7 +2282,7 @@ matches are looked for in the coding system list, treating case and
2282the characters `-' and `_' as insignificant. The coding system base 2282the characters `-' and `_' as insignificant. The coding system base
2283is returned. Thus, for instance, if charset \"ISO8859-2\", 2283is returned. Thus, for instance, if charset \"ISO8859-2\",
2284`iso-latin-2' is returned." 2284`iso-latin-2' is returned."
2285 (or (car (assoc-ignore-case charset locale-charset-alist)) 2285 (or (car (assoc-string charset locale-charset-alist t))
2286 (let ((cs coding-system-alist) 2286 (let ((cs coding-system-alist)
2287 c) 2287 c)
2288 (while (and (not c) cs) 2288 (while (and (not c) cs)
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index 3a3539359ec..1d1fe539116 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -373,27 +373,7 @@ basis, this may not be accurate."
373 ;; On a window system, a character is displayable if we have 373 ;; On a window system, a character is displayable if we have
374 ;; a font for that character in the default face of the 374 ;; a font for that character in the default face of the
375 ;; currently selected frame. 375 ;; currently selected frame.
376 (let ((fontset (frame-parameter (selected-frame) 'font)) 376 (car (internal-char-font nil char)))
377 font-pattern)
378 (if (query-fontset fontset)
379 (setq font-pattern (fontset-font fontset char)))
380 (or font-pattern
381 (setq font-pattern (fontset-font "fontset-default" char)))
382 (if font-pattern
383 (progn
384 ;; Now FONT-PATTERN is a string or a cons of family
385 ;; field pattern and registry field pattern.
386 (or (stringp font-pattern)
387 (let ((family (or (car font-pattern) "*"))
388 (registry (or (cdr font-pattern) "*")))
389 (or (string-match "-" family)
390 (setq family (concat "*-" family)))
391 (or (string-match "-" registry)
392 (setq registry (concat registry "-*")))
393 (setq font-pattern
394 (format "-%s-*-*-*-*-*-*-*-*-*-*-%s"
395 family registry))))
396 (x-list-fonts font-pattern 'default (selected-frame) 1)))))
397 (t 377 (t
398 (let ((coding (terminal-coding-system))) 378 (let ((coding (terminal-coding-system)))
399 (if coding 379 (if coding
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 8c95becaf21..de9d3ef8e2c 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1401,9 +1401,9 @@ Each element must be one of the names listed in the variable
1401 (let* ((M (char-after (+ pos 4))) 1401 (let* ((M (char-after (+ pos 4)))
1402 (L (char-after (+ pos 5))) 1402 (L (char-after (+ pos 5)))
1403 (encoding (match-string 2)) 1403 (encoding (match-string 2))
1404 (encoding-info (assoc-ignore-case 1404 (encoding-info (assoc-string
1405 encoding 1405 encoding
1406 ctext-non-standard-encodings-alist)) 1406 ctext-non-standard-encodings-alist t))
1407 (coding (if encoding-info 1407 (coding (if encoding-info
1408 (nth 1 encoding-info) 1408 (nth 1 encoding-info)
1409 (setq encoding (intern (downcase encoding))) 1409 (setq encoding (intern (downcase encoding)))
diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index 2f275a59dca..9e289c300d9 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -1218,7 +1218,7 @@ selected translation."
1218 (t 1218 (t
1219 (error "Invalid object in Quail map: %s" def)))) 1219 (error "Invalid object in Quail map: %s" def))))
1220 1220
1221(defun quail-lookup-key (key &optional len) 1221(defun quail-lookup-key (key &optional len not-reset-indices)
1222 "Lookup KEY of length LEN in the current Quail map and return the definition. 1222 "Lookup KEY of length LEN in the current Quail map and return the definition.
1223The returned value is a Quail map specific to KEY." 1223The returned value is a Quail map specific to KEY."
1224 (or len 1224 (or len
@@ -1256,7 +1256,7 @@ The returned value is a Quail map specific to KEY."
1256 (if (and (consp translation) (vectorp (cdr translation))) 1256 (if (and (consp translation) (vectorp (cdr translation)))
1257 (progn 1257 (progn
1258 (setq quail-current-translations translation) 1258 (setq quail-current-translations translation)
1259 (if (quail-forget-last-selection) 1259 (if (and (not not-reset-indices) (quail-forget-last-selection))
1260 (setcar (car quail-current-translations) 0)))))) 1260 (setcar (car quail-current-translations) 0))))))
1261 ;; We may have to reform cdr part of MAP. 1261 ;; We may have to reform cdr part of MAP.
1262 (if (and (cdr map) (functionp (cdr map))) 1262 (if (and (cdr map) (functionp (cdr map)))
@@ -1524,6 +1524,28 @@ with more keys."
1524 (let (pos) 1524 (let (pos)
1525 (quail-delete-region) 1525 (quail-delete-region)
1526 (setq pos (point)) 1526 (setq pos (point))
1527 (or enable-multibyte-characters
1528 (let (char)
1529 (if (stringp quail-current-str)
1530 (catch 'tag
1531 (mapc #'(lambda (ch)
1532 (when (/= (unibyte-char-to-multibyte
1533 (multibyte-char-to-unibyte ch))
1534 ch)
1535 (setq char ch)
1536 (throw 'tag nil)))
1537 quail-current-str))
1538 (if (/= (unibyte-char-to-multibyte
1539 (multibyte-char-to-unibyte quail-current-str))
1540 quail-current-str)
1541 (setq char quail-current-str)))
1542 (when char
1543 (message "Can't input %c in the current unibyte buffer" char)
1544 (ding)
1545 (sit-for 2)
1546 (message nil)
1547 (setq quail-current-str nil)
1548 (throw 'quail-tag nil))))
1527 (insert quail-current-str) 1549 (insert quail-current-str)
1528 (move-overlay quail-overlay pos (point)) 1550 (move-overlay quail-overlay pos (point))
1529 (if (overlayp quail-conv-overlay) 1551 (if (overlayp quail-conv-overlay)
@@ -2021,7 +2043,7 @@ minibuffer and the selected frame has no other windows)."
2021 2043
2022(defun quail-get-translations () 2044(defun quail-get-translations ()
2023 "Return a string containing the current possible translations." 2045 "Return a string containing the current possible translations."
2024 (let ((map (quail-lookup-key quail-current-key)) 2046 (let ((map (quail-lookup-key quail-current-key nil t))
2025 (str (copy-sequence quail-current-key))) 2047 (str (copy-sequence quail-current-key)))
2026 (if quail-current-translations 2048 (if quail-current-translations
2027 (quail-update-current-translations)) 2049 (quail-update-current-translations))
@@ -2092,7 +2114,7 @@ are shown (at most to the depth specified `quail-completion-max-depth')."
2092 (quail-setup-completion-buf) 2114 (quail-setup-completion-buf)
2093 (let ((win (get-buffer-window quail-completion-buf 'visible)) 2115 (let ((win (get-buffer-window quail-completion-buf 'visible))
2094 (key quail-current-key) 2116 (key quail-current-key)
2095 (map (quail-lookup-key quail-current-key)) 2117 (map (quail-lookup-key quail-current-key nil t))
2096 (require-update nil)) 2118 (require-update nil))
2097 (with-current-buffer quail-completion-buf 2119 (with-current-buffer quail-completion-buf
2098 (if (and win 2120 (if (and win
@@ -2673,7 +2695,7 @@ function `quail-install-map' (which see)."
2673 (translation-list nil) 2695 (translation-list nil)
2674 map) 2696 map)
2675 (while (> len 0) 2697 (while (> len 0)
2676 (setq map (quail-lookup-key key len) 2698 (setq map (quail-lookup-key key len t)
2677 len (1- len)) 2699 len (1- len))
2678 (if map 2700 (if map
2679 (let* ((def (quail-map-definition map)) 2701 (let* ((def (quail-map-definition map))
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index 4f560820b09..f3744a38337 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -300,9 +300,11 @@ example functions that filter buffernames."
300 300
301(defcustom iswitchb-max-to-show nil 301(defcustom iswitchb-max-to-show nil
302 "*If non-nil, limit the number of names shown in the minibuffer. 302 "*If non-nil, limit the number of names shown in the minibuffer.
303This can greatly speed up iswitchb if you have a multitude of 303If this value is N, and N is greater than the number of matching
304buffers open." 304buffers, the first N/2 and the last N/2 matching buffers are
305 :type 'integer 305shown. This can greatly speed up iswitchb if you have a
306multitude of buffers open."
307 :type '(choice (const :tag "Show all" nil) integer)
306 :group 'iswitchb) 308 :group 'iswitchb)
307 309
308(defcustom iswitchb-cannot-complete-hook 'iswitchb-completion-help 310(defcustom iswitchb-cannot-complete-hook 'iswitchb-completion-help
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index f5f6262435a..a8a78abf01b 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3867,6 +3867,23 @@ encoded string (and the same mask) will decode the string."
3867 (setq i (1+ i))) 3867 (setq i (1+ i)))
3868 (concat string-vector))) 3868 (concat string-vector)))
3869 3869
3870;;;; Desktop support
3871
3872;;;###autoload
3873(defun rmail-restore-desktop-buffer (desktop-buffer-file-name
3874 desktop-buffer-name
3875 desktop-buffer-misc)
3876 "Restore an rmail buffer specified in a desktop file."
3877 (condition-case error
3878 (progn
3879 (rmail-input desktop-buffer-file-name)
3880 (if (eq major-mode 'rmail-mode)
3881 (current-buffer)
3882 rmail-buffer))
3883 (file-locked
3884 (kill-buffer (current-buffer))
3885 nil)))
3886
3870(provide 'rmail) 3887(provide 'rmail)
3871 3888
3872;;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c 3889;;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c
diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in
index b050d78f76c..fe82e45c04f 100644
--- a/lisp/makefile.w32-in
+++ b/lisp/makefile.w32-in
@@ -1,5 +1,5 @@
1# Makefile for GNU Emacs on the Microsoft W32 API. 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2# Copyright (c) 2000-2001 Free Software Foundation, Inc. 2# Copyright (c) 2000,2001,2004 Free Software Foundation, Inc.
3# 3#
4# This file is part of GNU Emacs. 4# This file is part of GNU Emacs.
5# 5#
@@ -161,7 +161,8 @@ WINS=\
161 progmodes \ 161 progmodes \
162 term \ 162 term \
163 textmodes \ 163 textmodes \
164 toolbar 164 toolbar \
165 url
165 166
166doit: 167doit:
167 168
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 7db5f96e6d7..e45d6926d70 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1557,7 +1557,8 @@ Buffers menu is regenerated."
1557 1557
1558 (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu))) 1558 (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu)))
1559 (define-key (current-global-map) [menu-bar buffer] 1559 (define-key (current-global-map) [menu-bar buffer]
1560 (cons "Buffers" buffers-menu))))) 1560 ;; Call copy-sequence so the string is not pure.
1561 (cons (copy-sequence "Buffers") buffers-menu)))))
1561 1562
1562(add-hook 'menu-bar-update-hook 'menu-bar-update-buffers) 1563(add-hook 'menu-bar-update-hook 'menu-bar-update-buffers)
1563 1564
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index c4b027f382f..ca81350ba57 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -2441,6 +2441,17 @@ well.")
2441 "^There is no other window$")) 2441 "^There is no other window$"))
2442 (add-to-list 'debug-ignored-errors mess)) 2442 (add-to-list 'debug-ignored-errors mess))
2443 2443
2444;;;; Desktop support
2445
2446;;;###autoload
2447(defun mh-restore-desktop-buffer (desktop-buffer-file-name
2448 desktop-buffer-name
2449 desktop-buffer-misc)
2450 "Restore an mh folder buffer specified in a desktop file."
2451 (mh-find-path)
2452 (mh-visit-folder desktop-buffer-name)
2453 (current-buffer))
2454
2444(provide 'mh-e) 2455(provide 'mh-e)
2445 2456
2446;;; Local Variables: 2457;;; Local Variables:
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index dac6f228cd6..d42c4335daa 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -197,18 +197,28 @@ rejecting one login and prompting again for a username and password.")
197;;;###autoload (add-hook 'same-window-regexps "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)") 197;;;###autoload (add-hook 'same-window-regexps "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)")
198 198
199;;;###autoload 199;;;###autoload
200(defun telnet (host) 200(defun telnet (host &optional port)
201 "Open a network login connection to host named HOST (a string). 201 "Open a network login connection to host named HOST (a string).
202Optional arg PORT specifies alternative port to connect to.
203Interactively, use \\[universal-argument] prefix to be prompted for port number.
204
202Communication with HOST is recorded in a buffer `*PROGRAM-HOST*' 205Communication with HOST is recorded in a buffer `*PROGRAM-HOST*'
203where PROGRAM is the telnet program being used. This program 206where PROGRAM is the telnet program being used. This program
204is controlled by the contents of the global variable `telnet-host-properties', 207is controlled by the contents of the global variable `telnet-host-properties',
205falling back on the value of the global variable `telnet-program'. 208falling back on the value of the global variable `telnet-program'.
206Normally input is edited in Emacs and sent a line at a time." 209Normally input is edited in Emacs and sent a line at a time."
207 (interactive "sOpen connection to host: ") 210 (interactive (list (read-string "Open connection to host: ")
211 (cond
212 ((null current-prefix-arg) nil)
213 ((consp current-prefix-arg) (read-string "Port: "))
214 (t (prefix-numeric-value current-prefix-arg)))))
215 (if (and port (numberp port))
216 (setq port (int-to-string port)))
208 (let* ((comint-delimiter-argument-list '(?\ ?\t)) 217 (let* ((comint-delimiter-argument-list '(?\ ?\t))
209 (properties (cdr (assoc host telnet-host-properties))) 218 (properties (cdr (assoc host telnet-host-properties)))
210 (telnet-program (if properties (car properties) telnet-program)) 219 (telnet-program (if properties (car properties) telnet-program))
211 (name (concat telnet-program "-" (comint-arguments host 0 nil) )) 220 (hname (if port (concat host ":" port) host))
221 (name (concat telnet-program "-" (comint-arguments hname 0 nil) ))
212 (buffer (get-buffer (concat "*" name "*"))) 222 (buffer (get-buffer (concat "*" name "*")))
213 (telnet-options (if (cdr properties) (cons "-l" (cdr properties)))) 223 (telnet-options (if (cdr properties) (cons "-l" (cdr properties))))
214 process) 224 process)
@@ -221,7 +231,9 @@ Normally input is edited in Emacs and sent a line at a time."
221 ;; Don't send the `open' cmd till telnet is ready for it. 231 ;; Don't send the `open' cmd till telnet is ready for it.
222 (accept-process-output process) 232 (accept-process-output process)
223 (erase-buffer) 233 (erase-buffer)
224 (send-string process (concat "open " host "\n")) 234 (send-string process (concat "open " host
235 (if port " " "") (or port "")
236 "\n"))
225 (telnet-mode) 237 (telnet-mode)
226 (setq comint-input-sender 'telnet-simple-send) 238 (setq comint-input-sender 'telnet-simple-send)
227 (setq telnet-count telnet-initial-count)))) 239 (setq telnet-count telnet-initial-count))))
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index c6f60d3dcc0..a61369004e8 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1488,7 +1488,7 @@ more \"DWIM:ey\"."
1488 (save-excursion 1488 (save-excursion
1489 (beginning-of-line) 1489 (beginning-of-line)
1490 (or (not (re-search-backward 1490 (or (not (re-search-backward
1491 sentence-end 1491 (sentence-end)
1492 (c-point 'bopl) 1492 (c-point 'bopl)
1493 t)) 1493 t))
1494 (< (match-end 0) 1494 (< (match-end 0)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f75f2763e11..9aaa992ca76 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -125,11 +125,6 @@ describing how the process finished.")
125Each function is called with two arguments: the compilation buffer, 125Each function is called with two arguments: the compilation buffer,
126and a string describing how the process finished.") 126and a string describing how the process finished.")
127 127
128(defvar compilation-last-buffer nil
129 "The most recent compilation buffer.
130A buffer becomes most recent when its compilation is started
131or when it is used with \\[next-error] or \\[compile-goto-error].")
132
133(defvar compilation-in-progress nil 128(defvar compilation-in-progress nil
134 "List of compilation processes now running.") 129 "List of compilation processes now running.")
135(or (assq 'compilation-in-progress minor-mode-alist) 130(or (assq 'compilation-in-progress minor-mode-alist)
@@ -561,17 +556,13 @@ Faces `compilation-error-face', `compilation-warning-face',
561 (setq dir (previous-single-property-change (point) 'directory) 556 (setq dir (previous-single-property-change (point) 'directory)
562 dir (if dir (or (get-text-property (1- dir) 'directory) 557 dir (if dir (or (get-text-property (1- dir) 'directory)
563 (get-text-property dir 'directory))))) 558 (get-text-property dir 'directory)))))
564 (setq file (cons file (car dir)) ; top of dir stack is current 559 (setq file (cons file (car dir)))))
565 file (or (gethash file compilation-locs)
566 (puthash file (list file fmt) compilation-locs)))))
567 ;; This message didn't mention one, get it from previous 560 ;; This message didn't mention one, get it from previous
568 (setq file (previous-single-property-change (point) 'message) 561 (setq file (previous-single-property-change (point) 'message)
569 file (or (if file 562 file (or (if file
570 (nth 2 (car (or (get-text-property (1- file) 'message) 563 (car (nth 2 (car (or (get-text-property (1- file) 'message)
571 (get-text-property file 'message))))) 564 (get-text-property file 'message))))))
572 ;; no previous either -- but don't let font-lock fail 565 '("*unknown*"))))
573 (gethash (setq file '("*unknown*")) compilation-locs)
574 (puthash file (list file fmt) compilation-locs))))
575 ;; All of these fields are optional, get them only if we have an index, and 566 ;; All of these fields are optional, get them only if we have an index, and
576 ;; it matched some part of the message. 567 ;; it matched some part of the message.
577 (and line 568 (and line
@@ -590,74 +581,84 @@ Faces `compilation-error-face', `compilation-warning-face',
590 (setq type (or (and (car type) (match-end (car type)) 1) 581 (setq type (or (and (car type) (match-end (car type)) 1)
591 (and (cdr type) (match-end (cdr type)) 0) 582 (and (cdr type) (match-end (cdr type)) 0)
592 2))) 583 2)))
593 ;; Get first already existing marker (if any has one, all have one). 584 (compilation-internal-error-properties file line end-line col end-col type fmt)))
594 ;; Do this first, as the compilation-assq`s may create new nodes. 585
595 (let* ((marker-line (car (cddr file))) ; a line structure 586(defun compilation-internal-error-properties (file line end-line col end-col type fmt)
596 (marker (nth 3 (cadr marker-line))) ; its marker 587 "Get the meta-info that will be added as text-properties.
597 (compilation-error-screen-columns compilation-error-screen-columns) 588LINE, END-LINE, COL, END-COL are integers or nil.
598 end-marker loc end-loc) 589TYPE can be 0, 1, or 2.
599 (if (not (and marker (marker-buffer marker))) 590FILE should be (FILENAME . DIRNAME) or nil."
600 (setq marker) ; no valid marker for this file 591 (unless file (setq file '("*unknown*")))
601 (setq loc (or line 1) ; normalize no linenumber to line 1 592 (setq file (or (gethash file compilation-locs)
602 marker-line) 593 (puthash file (list file fmt) compilation-locs)))
603 (catch 'marker ; find nearest loc, at least one exists 594 ;; Get first already existing marker (if any has one, all have one).
604 (dolist (x (cddr file)) ; loop over lines 595 ;; Do this first, as the compilation-assq`s may create new nodes.
605 (if (> (or (car x) 1) loc) ; still bigger 596 (let* ((marker-line (car (cddr file))) ; a line structure
606 (setq marker-line x) 597 (marker (nth 3 (cadr marker-line))) ; its marker
607 (if (or (not marker-line) ; first in list 598 (compilation-error-screen-columns compilation-error-screen-columns)
608 (> (- (or (car marker-line) 1) loc) 599 end-marker loc end-loc)
609 (- loc (or (car x) 1)))) ; current line is nearer 600 (if (not (and marker (marker-buffer marker)))
610 (setq marker-line x)) 601 (setq marker) ; no valid marker for this file
611 (throw 'marker t)))) 602 (setq loc (or line 1) ; normalize no linenumber to line 1
612 (setq marker (nth 3 (cadr marker-line)) 603 marker-line)
613 marker-line (car marker-line)) 604 (catch 'marker ; find nearest loc, at least one exists
614 (with-current-buffer (marker-buffer marker) 605 (dolist (x (cddr file)) ; loop over lines
615 (save-restriction 606 (if (> (or (car x) 1) loc) ; still bigger
616 (widen) 607 (setq marker-line x)
617 (goto-char (marker-position marker)) 608 (if (or (not marker-line) ; first in list
618 (when (or end-col end-line) 609 (> (- (or (car marker-line) 1) loc)
619 (beginning-of-line (- (or end-line line) marker-line -1)) 610 (- loc (or (car x) 1)))) ; current line is nearer
620 (if (< end-col 0) 611 (setq marker-line x))
621 (end-of-line) 612 (throw 'marker t))))
622 (if compilation-error-screen-columns 613 (setq marker (nth 3 (cadr marker-line))
623 (move-to-column end-col) 614 marker-line (car marker-line))
624 (forward-char end-col))) 615 (with-current-buffer (marker-buffer marker)
625 (setq end-marker (list (point-marker)))) 616 (save-restriction
626 (beginning-of-line (if end-line 617 (widen)
627 (- end-line line -1) 618 (goto-char (marker-position marker))
628 (- loc marker-line -1))) 619 (when (or end-col end-line)
629 (if col 620 (beginning-of-line (- (or end-line line) marker-line -1))
630 (if compilation-error-screen-columns 621 (if (< end-col 0)
631 (move-to-column col) 622 (end-of-line)
632 (forward-char col)) 623 (if compilation-error-screen-columns
633 (forward-to-indentation 0)) 624 (move-to-column end-col)
634 (setq marker (list (point-marker)))))) 625 (forward-char end-col)))
635 626 (setq end-marker (list (point-marker))))
636 (setq loc (compilation-assq line (cdr file))) 627 (beginning-of-line (if end-line
637 (if end-line 628 (- end-line line -1)
638 (setq end-loc (compilation-assq end-line (cdr file)) 629 (- loc marker-line -1)))
639 end-loc (compilation-assq end-col end-loc)) 630 (if col
640 (if end-col ; use same line element 631 (if compilation-error-screen-columns
641 (setq end-loc (compilation-assq end-col loc)))) 632 (move-to-column col)
642 (setq loc (compilation-assq col loc)) 633 (forward-char col))
643 ;; If they are new, make the loc(s) reference the file they point to. 634 (forward-to-indentation 0))
644 (or (cdr loc) (setcdr loc `(,line ,file ,@marker))) 635 (setq marker (list (point-marker))))))
645 (if end-loc 636
646 (or (cdr end-loc) (setcdr end-loc `(,(or end-line line) ,file ,@end-marker)))) 637 (setq loc (compilation-assq line (cdr file)))
647 638 (if end-line
648 ;; Must start with face 639 (setq end-loc (compilation-assq end-line (cdr file))
649 `(face ,compilation-message-face 640 end-loc (compilation-assq end-col end-loc))
650 message (,loc ,type ,end-loc) 641 (if end-col ; use same line element
651 ,@(if compilation-debug 642 (setq end-loc (compilation-assq end-col loc))))
652 `(debug (,(assoc (with-no-warnings matcher) font-lock-keywords) 643 (setq loc (compilation-assq col loc))
653 ,@(match-data)))) 644 ;; If they are new, make the loc(s) reference the file they point to.
654 help-echo ,(if col 645 (or (cdr loc) (setcdr loc `(,line ,file ,@marker)))
655 "mouse-2: visit this file, line and column" 646 (if end-loc
656 (if line 647 (or (cdr end-loc) (setcdr end-loc `(,(or end-line line) ,file ,@end-marker))))
657 "mouse-2: visit this file and line" 648
658 "mouse-2: visit this file")) 649 ;; Must start with face
659 keymap compilation-button-map 650 `(face ,compilation-message-face
660 mouse-face highlight)))) 651 message (,loc ,type ,end-loc)
652 ,@(if compilation-debug
653 `(debug (,(assoc (with-no-warnings matcher) font-lock-keywords)
654 ,@(match-data))))
655 help-echo ,(if col
656 "mouse-2: visit this file, line and column"
657 (if line
658 "mouse-2: visit this file and line"
659 "mouse-2: visit this file"))
660 keymap compilation-button-map
661 mouse-face highlight)))
661 662
662(defun compilation-mode-font-lock-keywords () 663(defun compilation-mode-font-lock-keywords ()
663 "Return expressions to highlight in Compilation mode." 664 "Return expressions to highlight in Compilation mode."
@@ -702,6 +703,9 @@ Faces `compilation-error-face', `compilation-warning-face',
702 ,(if col `(match-string ,col))))) 703 ,(if col `(match-string ,col)))))
703 (,file compilation-error-face t)) 704 (,file compilation-error-face t))
704 705
706 (unless (or (null (nth 5 item)) (integerp (nth 5 item)))
707 (error "HYPERLINK should be an integer: %s" (nth 5 item)))
708
705 `(,(nth 0 item) 709 `(,(nth 0 item)
706 710
707 ,@(when (integerp file) 711 ,@(when (integerp file)
@@ -962,7 +966,7 @@ exited abnormally with code %d\n"
962 (select-window outwin) 966 (select-window outwin)
963 (goto-char (point-max)))) 967 (goto-char (point-max))))
964 ;; Make it so the next C-x ` will use this buffer. 968 ;; Make it so the next C-x ` will use this buffer.
965 (setq compilation-last-buffer outbuf))) 969 (setq next-error-last-buffer outbuf)))
966 970
967(defun compilation-set-window-height (window) 971(defun compilation-set-window-height (window)
968 "Set the height of WINDOW according to `compilation-window-height'." 972 "Set the height of WINDOW according to `compilation-window-height'."
@@ -1093,6 +1097,10 @@ Runs `compilation-mode-hook' with `run-hooks' (which see)."
1093 (set (make-local-variable 'page-delimiter) 1097 (set (make-local-variable 'page-delimiter)
1094 compilation-page-delimiter) 1098 compilation-page-delimiter)
1095 (compilation-setup) 1099 (compilation-setup)
1100 ;; note that compilation-next-error-function is for interfacing
1101 ;; with the next-error function in simple.el, and it's only
1102 ;; coincidentally named similarly to compilation-next-error
1103 (setq next-error-function 'compilation-next-error-function)
1096 (run-mode-hooks 'compilation-mode-hook)) 1104 (run-mode-hooks 'compilation-mode-hook))
1097 1105
1098(defmacro define-compilation-mode (mode name doc &rest body) 1106(defmacro define-compilation-mode (mode name doc &rest body)
@@ -1154,7 +1162,6 @@ Optional argument MINOR indicates this is called from
1154 (make-local-variable 'compilation-current-error) 1162 (make-local-variable 'compilation-current-error)
1155 (make-local-variable 'compilation-error-screen-columns) 1163 (make-local-variable 'compilation-error-screen-columns)
1156 (make-local-variable 'overlay-arrow-position) 1164 (make-local-variable 'overlay-arrow-position)
1157 (setq compilation-last-buffer (current-buffer))
1158 (set (make-local-variable 'font-lock-extra-managed-props) 1165 (set (make-local-variable 'font-lock-extra-managed-props)
1159 '(directory message help-echo mouse-face debug)) 1166 '(directory message help-echo mouse-face debug))
1160 (set (make-local-variable 'compilation-locs) 1167 (set (make-local-variable 'compilation-locs)
@@ -1271,8 +1278,16 @@ Just inserts the text, but uses `insert-before-markers'."
1271 (insert-before-markers string) 1278 (insert-before-markers string)
1272 (run-hooks 'compilation-filter-hook)))))) 1279 (run-hooks 'compilation-filter-hook))))))
1273 1280
1281;;; test if a buffer is a compilation buffer, assuming we're in the buffer
1282(defsubst compilation-buffer-internal-p ()
1283 "Test if inside a compilation buffer."
1284 (local-variable-p 'compilation-locs))
1285
1286;;; test if a buffer is a compilation buffer, using compilation-buffer-internal-p
1274(defsubst compilation-buffer-p (buffer) 1287(defsubst compilation-buffer-p (buffer)
1275 (local-variable-p 'compilation-locs buffer)) 1288 "Test if BUFFER is a compilation buffer."
1289 (with-current-buffer buffer
1290 (compilation-buffer-internal-p)))
1276 1291
1277(defmacro compilation-loop (< property-change 1+ error) 1292(defmacro compilation-loop (< property-change 1+ error)
1278 `(while (,< n 0) 1293 `(while (,< n 0)
@@ -1303,7 +1318,6 @@ Does NOT find the source line like \\[next-error]."
1303 (or (compilation-buffer-p (current-buffer)) 1318 (or (compilation-buffer-p (current-buffer))
1304 (error "Not in a compilation buffer")) 1319 (error "Not in a compilation buffer"))
1305 (or pt (setq pt (point))) 1320 (or pt (setq pt (point)))
1306 (setq compilation-last-buffer (current-buffer))
1307 (let* ((msg (get-text-property pt 'message)) 1321 (let* ((msg (get-text-property pt 'message))
1308 (loc (car msg)) 1322 (loc (car msg))
1309 last) 1323 last)
@@ -1341,25 +1355,6 @@ Does NOT find the source line like \\[previous-error]."
1341 (interactive "p") 1355 (interactive "p")
1342 (compilation-next-error (- n))) 1356 (compilation-next-error (- n)))
1343 1357
1344(defun next-error-no-select (n)
1345 "Move point to the next error in the compilation buffer and highlight match.
1346Prefix arg N says how many error messages to move forwards (or
1347backwards, if negative).
1348Finds and highlights the source line like \\[next-error], but does not
1349select the source buffer."
1350 (interactive "p")
1351 (next-error n)
1352 (pop-to-buffer compilation-last-buffer))
1353
1354(defun previous-error-no-select (n)
1355 "Move point to previous error in compilation buffer and highlight match.
1356Prefix arg N says how many error messages to move backwards (or
1357forwards, if negative).
1358Finds and highlights the source line like \\[previous-error], but does not
1359select the source buffer."
1360 (interactive "p")
1361 (next-error-no-select (- n)))
1362
1363(defun compilation-next-file (n) 1358(defun compilation-next-file (n)
1364 "Move point to the next error for a different file than the current one. 1359 "Move point to the next error for a different file than the current one.
1365Prefix arg N says how many files to move forwards (or backwards, if negative)." 1360Prefix arg N says how many files to move forwards (or backwards, if negative)."
@@ -1397,55 +1392,17 @@ Use this command in a compilation log buffer. Sets the mark at point there."
1397 1392
1398;; Return a compilation buffer. 1393;; Return a compilation buffer.
1399;; If the current buffer is a compilation buffer, return it. 1394;; If the current buffer is a compilation buffer, return it.
1400;; If compilation-last-buffer is set to a live buffer, use that.
1401;; Otherwise, look for a compilation buffer and signal an error 1395;; Otherwise, look for a compilation buffer and signal an error
1402;; if there are none. 1396;; if there are none.
1403(defun compilation-find-buffer (&optional other-buffer) 1397(defun compilation-find-buffer (&optional other-buffer)
1404 (if (and (not other-buffer) 1398 (next-error-find-buffer other-buffer 'compilation-buffer-internal-p))
1405 (compilation-buffer-p (current-buffer)))
1406 ;; The current buffer is a compilation buffer.
1407 (current-buffer)
1408 (if (and compilation-last-buffer (buffer-name compilation-last-buffer)
1409 (compilation-buffer-p compilation-last-buffer)
1410 (or (not other-buffer) (not (eq compilation-last-buffer
1411 (current-buffer)))))
1412 compilation-last-buffer
1413 (let ((buffers (buffer-list)))
1414 (while (and buffers (or (not (compilation-buffer-p (car buffers)))
1415 (and other-buffer
1416 (eq (car buffers) (current-buffer)))))
1417 (setq buffers (cdr buffers)))
1418 (if buffers
1419 (car buffers)
1420 (or (and other-buffer
1421 (compilation-buffer-p (current-buffer))
1422 ;; The current buffer is a compilation buffer.
1423 (progn
1424 (if other-buffer
1425 (message "This is the only compilation buffer."))
1426 (current-buffer)))
1427 (error "No compilation started!")))))))
1428 1399
1429;;;###autoload 1400;;;###autoload
1430(defun next-error (&optional n) 1401(defun compilation-next-error-function (n &optional reset)
1431 "Visit next compilation error message and corresponding source code.
1432Prefix arg N says how many error messages to move forwards (or
1433backwards, if negative).
1434
1435\\[next-error] normally uses the most recently started compilation or
1436grep buffer. However, it can operate on any buffer with output from
1437the \\[compile] and \\[grep] commands, or, more generally, on any
1438buffer in Compilation mode or with Compilation Minor mode enabled. To
1439specify use of a particular buffer for error messages, type
1440\\[next-error] in that buffer.
1441
1442Once \\[next-error] has chosen the buffer for error messages,
1443it stays with that buffer until you use it in some other buffer which
1444uses Compilation mode or Compilation Minor mode.
1445
1446See variable `compilation-error-regexp-alist' for customization ideas."
1447 (interactive "p") 1402 (interactive "p")
1448 (set-buffer (setq compilation-last-buffer (compilation-find-buffer))) 1403 (set-buffer (compilation-find-buffer))
1404 (when reset
1405 (setq compilation-current-error nil))
1449 (let* ((columns compilation-error-screen-columns) ; buffer's local value 1406 (let* ((columns compilation-error-screen-columns) ; buffer's local value
1450 (last 1) 1407 (last 1)
1451 (loc (compilation-next-error (or n 1) nil 1408 (loc (compilation-next-error (or n 1) nil
@@ -1492,27 +1449,6 @@ See variable `compilation-error-regexp-alist' for customization ideas."
1492 (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc)) 1449 (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc))
1493 (setcdr (nthcdr 3 loc) t))) ; Set this one as visited. 1450 (setcdr (nthcdr 3 loc) t))) ; Set this one as visited.
1494 1451
1495;;;###autoload (define-key ctl-x-map "`" 'next-error)
1496
1497(defun previous-error (n)
1498 "Visit previous compilation error message and corresponding source code.
1499Prefix arg N says how many error messages to move backwards (or
1500forwards, if negative).
1501
1502This operates on the output from the \\[compile] and \\[grep] commands."
1503 (interactive "p")
1504 (next-error (- n)))
1505
1506(defun first-error (n)
1507 "Restart at the first error.
1508Visit corresponding source code.
1509With prefix arg N, visit the source code of the Nth error.
1510This operates on the output from the \\[compile] command."
1511 (interactive "p")
1512 (set-buffer (setq compilation-last-buffer (compilation-find-buffer)))
1513 (setq compilation-current-error nil)
1514 (next-error n))
1515
1516(defun compilation-fake-loc (marker file &optional line col) 1452(defun compilation-fake-loc (marker file &optional line col)
1517 "Preassociate MARKER with FILE. 1453 "Preassociate MARKER with FILE.
1518This is useful when you compile temporary files, but want 1454This is useful when you compile temporary files, but want
@@ -1732,17 +1668,25 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1732 1668
1733(defun compilation-compat-error-properties (err) 1669(defun compilation-compat-error-properties (err)
1734 "Map old-style error ERR to new-style message." 1670 "Map old-style error ERR to new-style message."
1735 (let* ((dst (cdr err)) 1671 ;; Old-style structure is (MARKER (FILE DIR) LINE COL) or
1736 (loc (cond ((markerp dst) (list nil nil nil dst)) 1672 ;; (MARKER . MARKER).
1737 ((consp dst) 1673 (let ((dst (cdr err)))
1738 (list (nth 2 dst) (nth 1 dst) 1674 (if (markerp dst)
1739 (cons (cdar dst) (caar dst))))))) 1675 ;; Must start with a face, for font-lock.
1740 ;; Must start with a face, for font-lock. 1676 `(face nil
1741 `(face nil 1677 message ,(list (list nil nil nil dst) 2)
1742 message ,(list loc 2) 1678 help-echo "mouse-2: visit the source location"
1743 help-echo "mouse-2: visit the source location" 1679 keymap compilation-button-map
1744 keymap compilation-button-map 1680 mouse-face highlight)
1745 mouse-face highlight))) 1681 ;; Too difficult to do it by hand: dispatch to the normal code.
1682 (let* ((file (pop dst))
1683 (line (pop dst))
1684 (col (pop dst))
1685 (filename (pop file))
1686 (dirname (pop file))
1687 (fmt (pop file)))
1688 (compilation-internal-error-properties
1689 (cons filename dirname) line nil col nil 2 fmt)))))
1746 1690
1747(defun compilation-compat-parse-errors (limit) 1691(defun compilation-compat-parse-errors (limit)
1748 (when compilation-parse-errors-function 1692 (when compilation-parse-errors-function
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index e13198fb240..c651e06b899 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -926,12 +926,9 @@ the faces: please specify bold, italic, underline, shadow and box.)
926(defun cperl-putback-char (c) ; Emacs 19 926(defun cperl-putback-char (c) ; Emacs 19
927 (set 'unread-command-events (list c))) ; Avoid undefined warning 927 (set 'unread-command-events (list c))) ; Avoid undefined warning
928 928
929(if (boundp 'unread-command-events) 929(if cperl-xemacs-p
930 (if cperl-xemacs-p 930 (defun cperl-putback-char (c) ; XEmacs >= 19.12
931 (defun cperl-putback-char (c) ; XEmacs >= 19.12 931 (setq unread-command-events (list (eval '(character-to-event c))))))
932 (setq unread-command-events (list (eval '(character-to-event c))))))
933 (defun cperl-putback-char (c) ; XEmacs <= 19.11
934 (set 'unread-command-event (eval '(character-to-event c))))) ; Avoid warnings
935 932
936(or (fboundp 'uncomment-region) 933(or (fboundp 'uncomment-region)
937 (defun uncomment-region (beg end) 934 (defun uncomment-region (beg end)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index b33f8f3f239..fb5a6757a49 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -1,6 +1,6 @@
1;;; gdb-ui.el --- User Interface for running GDB 1;;; gdb-ui.el --- User Interface for running GDB
2 2
3;; Author: Nick Roberts <nick@nick.uklinux.net> 3;; Author: Nick Roberts <nickrob@gnu.org>
4;; Maintainer: FSF 4;; Maintainer: FSF
5;; Keywords: unix, tools 5;; Keywords: unix, tools
6 6
@@ -1141,10 +1141,18 @@ static char *magick[] = {
1141 (gdb-display-buffer 1141 (gdb-display-buffer
1142 (gdb-get-create-buffer 'gdb-breakpoints-buffer))) 1142 (gdb-get-create-buffer 'gdb-breakpoints-buffer)))
1143 1143
1144(defconst gdb-frame-parameters
1145 '((height . 12) (width . 60)
1146 (unsplittable . t)
1147 (tool-bar-lines . nil)
1148 (menu-bar-lines . nil)
1149 (minibuffer . nil)))
1150
1144(defun gdb-frame-breakpoints-buffer () 1151(defun gdb-frame-breakpoints-buffer ()
1145 (interactive) 1152 (interactive)
1146 (switch-to-buffer-other-frame 1153 (select-frame (make-frame gdb-frame-parameters))
1147 (gdb-get-create-buffer 'gdb-breakpoints-buffer))) 1154 (switch-to-buffer (gdb-get-create-buffer 'gdb-breakpoints-buffer))
1155 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1148 1156
1149(defvar gdb-breakpoints-mode-map 1157(defvar gdb-breakpoints-mode-map
1150 (let ((map (make-sparse-keymap)) 1158 (let ((map (make-sparse-keymap))
@@ -1264,8 +1272,9 @@ current line."
1264 1272
1265(defun gdb-frame-stack-buffer () 1273(defun gdb-frame-stack-buffer ()
1266 (interactive) 1274 (interactive)
1267 (switch-to-buffer-other-frame 1275 (select-frame (make-frame gdb-frame-parameters))
1268 (gdb-get-create-buffer 'gdb-stack-buffer))) 1276 (switch-to-buffer (gdb-get-create-buffer 'gdb-stack-buffer))
1277 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1269 1278
1270(defvar gdb-frames-mode-map 1279(defvar gdb-frames-mode-map
1271 (let ((map (make-sparse-keymap))) 1280 (let ((map (make-sparse-keymap)))
@@ -1340,8 +1349,9 @@ the source buffer."
1340 1349
1341(defun gdb-frame-threads-buffer () 1350(defun gdb-frame-threads-buffer ()
1342 (interactive) 1351 (interactive)
1343 (switch-to-buffer-other-frame 1352 (select-frame (make-frame gdb-frame-parameters))
1344 (gdb-get-create-buffer 'gdb-threads-buffer))) 1353 (switch-to-buffer (gdb-get-create-buffer 'gdb-threads-buffer))
1354 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1345 1355
1346(defvar gdb-threads-mode-map 1356(defvar gdb-threads-mode-map
1347 (let ((map (make-sparse-keymap))) 1357 (let ((map (make-sparse-keymap)))
@@ -1421,8 +1431,9 @@ the source buffer."
1421 1431
1422(defun gdb-frame-registers-buffer () 1432(defun gdb-frame-registers-buffer ()
1423 (interactive) 1433 (interactive)
1424 (switch-to-buffer-other-frame 1434 (select-frame (make-frame gdb-frame-parameters))
1425 (gdb-get-create-buffer 'gdb-registers-buffer))) 1435 (switch-to-buffer (gdb-get-create-buffer 'gdb-registers-buffer))
1436 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1426 1437
1427;; 1438;;
1428;; Locals buffer. 1439;; Locals buffer.
@@ -1492,8 +1503,9 @@ the source buffer."
1492 1503
1493(defun gdb-frame-locals-buffer () 1504(defun gdb-frame-locals-buffer ()
1494 (interactive) 1505 (interactive)
1495 (switch-to-buffer-other-frame 1506 (select-frame (make-frame gdb-frame-parameters))
1496 (gdb-get-create-buffer 'gdb-locals-buffer))) 1507 (switch-to-buffer (gdb-get-create-buffer 'gdb-locals-buffer))
1508 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1497 1509
1498 1510
1499;;;; Window management 1511;;;; Window management
@@ -1514,7 +1526,7 @@ the source buffer."
1514 (set-window-dedicated-p win t)))) 1526 (set-window-dedicated-p win t))))
1515 (setq answer (get-buffer-window buf)) 1527 (setq answer (get-buffer-window buf))
1516 (if (not answer) 1528 (if (not answer)
1517 (let ((window (get-lru-window))) 1529 (let ((window (get-lru-window 'visible)))
1518 (if window 1530 (if window
1519 (progn 1531 (progn
1520 (set-window-buffer window buf) 1532 (set-window-buffer window buf)
@@ -1525,7 +1537,7 @@ the source buffer."
1525 (if (eq gud-comint-buffer (window-buffer win)) 1537 (if (eq gud-comint-buffer (window-buffer win))
1526 (set-window-dedicated-p win nil))))) 1538 (set-window-dedicated-p win nil)))))
1527 (if must-split 1539 (if must-split
1528 (let* ((largest (get-largest-window)) 1540 (let* ((largest (get-largest-window 'visible))
1529 (cur-size (window-height largest)) 1541 (cur-size (window-height largest))
1530 (new-size (and size (< size cur-size) (- cur-size size)))) 1542 (new-size (and size (< size cur-size) (- cur-size size))))
1531 (setq answer (split-window largest new-size)) 1543 (setq answer (split-window largest new-size))
@@ -1590,8 +1602,9 @@ the source buffer."
1590 1602
1591(defun gdb-frame-gdb-buffer () 1603(defun gdb-frame-gdb-buffer ()
1592 (interactive) 1604 (interactive)
1593 (switch-to-buffer-other-frame 1605 (select-frame (make-frame gdb-frame-parameters))
1594 (gdb-get-create-buffer 'gdba))) 1606 (switch-to-buffer (gdb-get-create-buffer 'gdba))
1607 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1595 1608
1596(defun gdb-display-gdb-buffer () 1609(defun gdb-display-gdb-buffer ()
1597 (interactive) 1610 (interactive)
@@ -1920,8 +1933,9 @@ BUFFER nil or omitted means use the current buffer."
1920 1933
1921(defun gdb-frame-assembler-buffer () 1934(defun gdb-frame-assembler-buffer ()
1922 (interactive) 1935 (interactive)
1923 (switch-to-buffer-other-frame 1936 (select-frame (make-frame gdb-frame-parameters))
1924 (gdb-get-create-buffer 'gdb-assembler-buffer))) 1937 (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))
1938 (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
1925 1939
1926;; modified because if gdb-current-address has changed value a new command 1940;; modified because if gdb-current-address has changed value a new command
1927;; must be enqueued to update the buffer with the new output 1941;; must be enqueued to update the buffer with the new output
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 7a7e62d06ee..a85cd2296ae 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1415,7 +1415,7 @@ The criterion is either a match for `jython-mode' via
1415 (while (re-search-forward 1415 (while (re-search-forward
1416 (rx (and line-start (or "import" "from") (1+ space) 1416 (rx (and line-start (or "import" "from") (1+ space)
1417 (group (1+ (not (any " \t\n.")))))) 1417 (group (1+ (not (any " \t\n."))))))
1418 10000 ; Probably not worth customizing. 1418 (+ (point-min) 10000) ; Probably not worth customizing.
1419 t) 1419 t)
1420 (if (member (match-string 1) python-jython-packages) 1420 (if (member (match-string 1) python-jython-packages)
1421 (throw 'done t)))) 1421 (throw 'done t))))
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 7e379822457..efe4ebc63a4 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1137,13 +1137,16 @@ default."
1137 "Save the recent list. 1137 "Save the recent list.
1138Write data into the file specified by `recentf-save-file'." 1138Write data into the file specified by `recentf-save-file'."
1139 (interactive) 1139 (interactive)
1140 (with-temp-buffer 1140 (condition-case error
1141 (erase-buffer) 1141 (with-temp-buffer
1142 (insert (format recentf-save-file-header (current-time-string))) 1142 (erase-buffer)
1143 (recentf-dump-variable 'recentf-list recentf-max-saved-items) 1143 (insert (format recentf-save-file-header (current-time-string)))
1144 (recentf-dump-variable 'recentf-filter-changer-state) 1144 (recentf-dump-variable 'recentf-list recentf-max-saved-items)
1145 (write-file (expand-file-name recentf-save-file)) 1145 (recentf-dump-variable 'recentf-filter-changer-state)
1146 nil)) 1146 (write-file (expand-file-name recentf-save-file))
1147 nil)
1148 (error
1149 (warn "recentf mode: %s" (error-message-string error)))))
1147 1150
1148(defun recentf-load-list () 1151(defun recentf-load-list ()
1149 "Load a previously saved recent list. 1152 "Load a previously saved recent list.
diff --git a/lisp/replace.el b/lisp/replace.el
index 2d26cb5cc66..e14e1314352 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -538,6 +538,7 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it.
538 (set (make-local-variable 'revert-buffer-function) 'occur-revert-function) 538 (set (make-local-variable 'revert-buffer-function) 'occur-revert-function)
539 (make-local-variable 'occur-revert-arguments) 539 (make-local-variable 'occur-revert-arguments)
540 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) 540 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
541 (setq next-error-function 'occur-next-error)
541 (run-hooks 'occur-mode-hook)) 542 (run-hooks 'occur-mode-hook))
542 543
543(defun occur-revert-function (ignore1 ignore2) 544(defun occur-revert-function (ignore1 ignore2)
@@ -614,6 +615,21 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it.
614 "Move to the Nth (default 1) previous match in an Occur mode buffer." 615 "Move to the Nth (default 1) previous match in an Occur mode buffer."
615 (interactive "p") 616 (interactive "p")
616 (occur-find-match n #'previous-single-property-change "No earlier matches")) 617 (occur-find-match n #'previous-single-property-change "No earlier matches"))
618
619(defun occur-next-error (&optional argp reset)
620 "Move to the Nth (default 1) next match in an Occur mode buffer.
621Compatibility function for \\[next-error] invocations."
622 (interactive "p")
623 (when reset
624 (occur-find-match 0 #'next-single-property-change "No first match"))
625 (occur-find-match
626 (prefix-numeric-value argp)
627 (if (> 0 (prefix-numeric-value argp))
628 #'previous-single-property-change
629 #'next-single-property-change)
630 "No more matches")
631 (occur-mode-goto-occurrence))
632
617 633
618(defcustom list-matching-lines-default-context-lines 0 634(defcustom list-matching-lines-default-context-lines 0
619 "*Default number of context lines included around `list-matching-lines' matches. 635 "*Default number of context lines included around `list-matching-lines' matches.
@@ -800,7 +816,9 @@ See also `multi-occur'."
800 (setq occur-revert-arguments (list regexp nlines bufs) 816 (setq occur-revert-arguments (list regexp nlines bufs)
801 buffer-read-only t) 817 buffer-read-only t)
802 (if (> count 0) 818 (if (> count 0)
803 (display-buffer occur-buf) 819 (progn
820 (display-buffer occur-buf)
821 (setq next-error-last-buffer occur-buf))
804 (kill-buffer occur-buf))) 822 (kill-buffer occur-buf)))
805 (run-hooks 'occur-hook)))) 823 (run-hooks 'occur-hook))))
806 824
diff --git a/lisp/simple.el b/lisp/simple.el
index 92cdb33fca1..269b78e497a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1,7 +1,7 @@
1;;; simple.el --- basic editing commands for Emacs 1;;; simple.el --- basic editing commands for Emacs
2 2
3;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99, 3;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99,
4;; 2000, 2001, 2002, 2003 4;; 2000, 01, 02, 03, 04
5;; Free Software Foundation, Inc. 5;; Free Software Foundation, Inc.
6 6
7;; Maintainer: FSF 7;; Maintainer: FSF
@@ -66,6 +66,141 @@
66 (setq list (cdr list))) 66 (setq list (cdr list)))
67 (switch-to-buffer found))) 67 (switch-to-buffer found)))
68 68
69;;; next-error support framework
70(defvar next-error-last-buffer nil
71 "The most recent next-error buffer.
72A buffer becomes most recent when its compilation, grep, or
73similar mode is started, or when it is used with \\[next-error]
74or \\[compile-goto-error].")
75
76(defvar next-error-function nil
77 "Function to use to find the next error in the current buffer.
78The function is called with 2 parameters:
79ARG is an integer specifying by how many errors to move.
80RESET is a boolean which, if non-nil, says to go back to the beginning
81of the errors before moving.
82Major modes providing compile-like functionality should set this variable
83to indicate to `next-error' that this is a candidate buffer and how
84to navigate in it.")
85
86(make-variable-buffer-local 'next-error-function)
87
88(defsubst next-error-buffer-p (buffer &optional extra-test)
89 "Test if BUFFER is a next-error capable buffer."
90 (with-current-buffer buffer
91 (or (and extra-test (funcall extra-test))
92 next-error-function)))
93
94;; Return a next-error capable buffer.
95;; If the current buffer is such, return it.
96;; If next-error-last-buffer is set to a live buffer, use that.
97;; Otherwise, look for a next-error capable buffer and signal an error
98;; if there are none.
99(defun next-error-find-buffer (&optional other-buffer extra-test)
100 (if (and (not other-buffer)
101 (next-error-buffer-p (current-buffer) extra-test))
102 ;; The current buffer is a next-error capable buffer.
103 (current-buffer)
104 (if (and next-error-last-buffer (buffer-name next-error-last-buffer)
105 (next-error-buffer-p next-error-last-buffer extra-test)
106 (or (not other-buffer) (not (eq next-error-last-buffer
107 (current-buffer)))))
108 next-error-last-buffer
109 (let ((buffers (buffer-list)))
110 (while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test))
111 (and other-buffer
112 (eq (car buffers) (current-buffer)))))
113 (setq buffers (cdr buffers)))
114 (if buffers
115 (car buffers)
116 (or (and other-buffer
117 (next-error-buffer-p (current-buffer) extra-test)
118 ;; The current buffer is a next-error capable buffer.
119 (progn
120 (if other-buffer
121 (message "This is the only next-error capable buffer."))
122 (current-buffer)))
123 (error "No next-error capable buffer found!")))))))
124
125(defun next-error (arg &optional reset)
126 "Visit next next-error message and corresponding source code.
127
128If all the error messages parsed so far have been processed already,
129the message buffer is checked for new ones.
130
131A prefix ARG specifies how many error messages to move;
132negative means move back to previous error messages.
133Just \\[universal-argument] as a prefix means reparse the error message buffer
134and start at the first error.
135
136The RESET argument specifies that we should restart from the beginning
137
138\\[next-error] normally uses the most recently started
139compilation, grep, or occur buffer. It can also operate on any
140buffer with output from the \\[compile], \\[grep] commands, or,
141more generally, on any buffer in Compilation mode or with
142Compilation Minor mode enabled, or any buffer in which
143`next-error-function' is bound to an appropriate
144function. To specify use of a particular buffer for error
145messages, type \\[next-error] in that buffer.
146
147Once \\[next-error] has chosen the buffer for error messages,
148it stays with that buffer until you use it in some other buffer which
149uses Compilation mode or Compilation Minor mode.
150
151See variables `compilation-parse-errors-function' and
152\`compilation-error-regexp-alist' for customization ideas."
153 (interactive "P")
154 (if (consp arg) (setq reset t arg nil))
155 (when (setq next-error-last-buffer (next-error-find-buffer))
156 ;; we know here that next-error-function is a valid symbol we can funcall
157 (with-current-buffer next-error-last-buffer
158 (funcall next-error-function (prefix-numeric-value arg) reset))))
159
160(defalias 'goto-next-locus 'next-error)
161(defalias 'next-match 'next-error)
162
163(define-key ctl-x-map "`" 'next-error)
164
165(defun previous-error (n)
166 "Visit previous next-error message and corresponding source code.
167
168Prefix arg N says how many error messages to move backwards (or
169forwards, if negative).
170
171This operates on the output from the \\[compile] and \\[grep] commands."
172 (interactive "p")
173 (next-error (- n)))
174
175(defun first-error (n)
176 "Restart at the first error.
177Visit corresponding source code.
178With prefix arg N, visit the source code of the Nth error.
179This operates on the output from the \\[compile] command, for instance."
180 (interactive "p")
181 (next-error n t))
182
183(defun next-error-no-select (n)
184 "Move point to the next error in the next-error buffer and highlight match.
185Prefix arg N says how many error messages to move forwards (or
186backwards, if negative).
187Finds and highlights the source line like \\[next-error], but does not
188select the source buffer."
189 (interactive "p")
190 (next-error n)
191 (pop-to-buffer next-error-last-buffer))
192
193(defun previous-error-no-select (n)
194 "Move point to the previous error in the next-error buffer and highlight match.
195Prefix arg N says how many error messages to move backwards (or
196forwards, if negative).
197Finds and highlights the source line like \\[previous-error], but does not
198select the source buffer."
199 (interactive "p")
200 (next-error-no-select (- n)))
201
202;;;
203
69(defun fundamental-mode () 204(defun fundamental-mode ()
70 "Major mode not specialized for anything in particular. 205 "Major mode not specialized for anything in particular.
71Other major modes are defined by comparison with this one." 206Other major modes are defined by comparison with this one."
diff --git a/lisp/subr.el b/lisp/subr.el
index 39a9caa3106..57f725fb44c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -644,14 +644,16 @@ and `down'."
644 (setq type (car type))) 644 (setq type (car type)))
645 (if (symbolp type) 645 (if (symbolp type)
646 (cdr (get type 'event-symbol-elements)) 646 (cdr (get type 'event-symbol-elements))
647 (let ((list nil)) 647 (let ((list nil)
648 (or (zerop (logand type ?\M-\^@)) 648 (char (logand type (lognot (logior ?\M-\^@ ?\C-\^@ ?\S-\^@
649 ?\H-\^@ ?\s-\^@ ?\A-\^@)))))
650 (if (not (zerop (logand type ?\M-\^@)))
649 (setq list (cons 'meta list))) 651 (setq list (cons 'meta list)))
650 (or (and (zerop (logand type ?\C-\^@)) 652 (if (or (not (zerop (logand type ?\C-\^@)))
651 (>= (logand type 127) 32)) 653 (< char 32))
652 (setq list (cons 'control list))) 654 (setq list (cons 'control list)))
653 (or (and (zerop (logand type ?\S-\^@)) 655 (if (or (not (zerop (logand type ?\S-\^@)))
654 (= (logand type 255) (downcase (logand type 255)))) 656 (/= char (downcase char)))
655 (setq list (cons 'shift list))) 657 (setq list (cons 'shift list)))
656 (or (zerop (logand type ?\H-\^@)) 658 (or (zerop (logand type ?\H-\^@))
657 (setq list (cons 'hyper list))) 659 (setq list (cons 'hyper list)))
@@ -1329,7 +1331,8 @@ Optional DEFAULT is a default password to use instead of empty input."
1329 (while 1331 (while
1330 (progn 1332 (progn
1331 (let ((str (read-from-minibuffer prompt nil nil nil nil 1333 (let ((str (read-from-minibuffer prompt nil nil nil nil
1332 (number-to-string default)))) 1334 (and default
1335 (number-to-string default)))))
1333 (setq n (cond 1336 (setq n (cond
1334 ((zerop (length str)) default) 1337 ((zerop (length str)) default)
1335 ((stringp str) (read str))))) 1338 ((stringp str) (read str)))))
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index aaa10fbce5f..a888003402d 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -155,7 +155,7 @@ Leave one space between words, two at end of sentences or after colons
155and `sentence-end-without-period'). 155and `sentence-end-without-period').
156Remove indentation from each line." 156Remove indentation from each line."
157 (interactive "*r") 157 (interactive "*r")
158 (let ((end-spc-re (concat "\\(" sentence-end "\\) *\\| +"))) 158 (let ((end-spc-re (concat "\\(" (sentence-end) "\\) *\\| +")))
159 (save-excursion 159 (save-excursion
160 (goto-char beg) 160 (goto-char beg)
161 ;; Nuke tabs; they get screwed up in a fill. 161 ;; Nuke tabs; they get screwed up in a fill.
@@ -349,7 +349,7 @@ and `fill-nobreak-invisible'."
349 (save-excursion 349 (save-excursion
350 (skip-chars-backward ". ") 350 (skip-chars-backward ". ")
351 (and (looking-at "\\.") 351 (and (looking-at "\\.")
352 (not (looking-at sentence-end)))) 352 (not (looking-at (sentence-end)))))
353 ;; Don't split a line if the rest would look like a new paragraph. 353 ;; Don't split a line if the rest would look like a new paragraph.
354 (unless use-hard-newlines 354 (unless use-hard-newlines
355 (save-excursion 355 (save-excursion
@@ -424,10 +424,10 @@ Point is moved to just past the fill prefix on the first line."
424 ;; loses on split abbrevs ("Mr.\nSmith") 424 ;; loses on split abbrevs ("Mr.\nSmith")
425 (let ((eol-double-space-re 425 (let ((eol-double-space-re
426 (cond 426 (cond
427 ((not colon-double-space) (concat sentence-end "$")) 427 ((not colon-double-space) (concat (sentence-end) "$"))
428 ;; Try to add the : inside the `sentence-end' regexp. 428 ;; Try to add the : inside the `sentence-end' regexp.
429 ((string-match "\\[[^][]*\\(\\.\\)[^][]*\\]" sentence-end) 429 ((string-match "\\[[^][]*\\(\\.\\)[^][]*\\]" (sentence-end))
430 (concat (replace-match ".:" nil nil sentence-end 1) "$")) 430 (concat (replace-match ".:" nil nil (sentence-end) 1) "$"))
431 ;; Can't find the right spot to insert the colon. 431 ;; Can't find the right spot to insert the colon.
432 (t "[.?!:][])}\"']*$"))) 432 (t "[.?!:][])}\"']*$")))
433 (sentence-end-without-space-list 433 (sentence-end-without-space-list
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index f7595e24cb5..a86be8646c9 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -120,49 +120,62 @@ text indented by a margin setting."
120This is relevant for filling. See also `sentence-end-without-period' 120This is relevant for filling. See also `sentence-end-without-period'
121and `colon-double-space'. 121and `colon-double-space'.
122 122
123If you change this, you should also change `sentence-end'. See Info 123This value is used by the function `sentence-end' to construct the
124node `Sentences'." 124regexp describing the end of a sentence, in case when the value of
125the variable `sentence-end' is nil. See Info node `Sentences'."
125 :type 'boolean 126 :type 'boolean
126 :group 'fill) 127 :group 'fill)
127 128
128(defcustom sentence-end-without-period nil 129(defcustom sentence-end-without-period nil
129 "*Non-nil means a sentence will end without a period. 130 "*Non-nil means a sentence will end without a period.
130For example, a sentence in Thai text ends with double space but 131For example, a sentence in Thai text ends with double space but
131without a period." 132without a period.
133
134This value is used by the function `sentence-end' to construct the
135regexp describing the end of a sentence, in case when the value of
136the variable `sentence-end' is nil. See Info node `Sentences'."
132 :type 'boolean 137 :type 'boolean
133 :group 'fill) 138 :group 'fill)
134 139
135(defcustom sentence-end-without-space 140(defcustom sentence-end-without-space
136 "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B" 141 "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B"
137 "*String containing characters that end sentence without following spaces. 142 "*String containing characters that end sentence without following spaces.
138If you change this, you should also change `sentence-end'. See Info 143
139node `Sentences'." 144This value is used by the function `sentence-end' to construct the
145regexp describing the end of a sentence, in case when the value of
146the variable `sentence-end' is nil. See Info node `Sentences'."
140 :group 'paragraphs 147 :group 'paragraphs
141 :type 'string) 148 :type 'string)
142 149
143(defcustom sentence-end 150(defcustom sentence-end nil
144 (purecopy
145 ;; This is a bit stupid since it's not auto-updated when the
146 ;; other variables are changes, but it's still useful info.
147 (concat (if sentence-end-without-period "\\w \\|")
148 "\\([.?!][]\"')}]*"
149 (if sentence-end-double-space
150 "\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)")
151 "\\|[" sentence-end-without-space "]+\\)"
152 "[ \t\n]*"))
153 "*Regexp describing the end of a sentence. 151 "*Regexp describing the end of a sentence.
154The value includes the whitespace following the sentence. 152The value includes the whitespace following the sentence.
155All paragraph boundaries also end sentences, regardless. 153All paragraph boundaries also end sentences, regardless.
156 154
157The default value specifies that in order to be recognized as the end 155The value nil means to use the default value defined by the
158of a sentence, the ending period, question mark, or exclamation point 156function `sentence-end'. You should always use this function
159must be followed by two spaces, unless it's inside some sort of quotes 157to obtain the value of this variable."
160or parenthesis.
161
162See also the variable `sentence-end-double-space', the variable
163`sentence-end-without-period' and Info node `Sentences'."
164 :group 'paragraphs 158 :group 'paragraphs
165 :type 'regexp) 159 :type '(choice regexp (const :tag "Use default value" nil)))
160
161(defun sentence-end ()
162 "Return the regexp describing the end of a sentence.
163
164This function returns either the value of the variable `sentence-end'
165if it is non-nil, or the default value constructed from the
166variables `sentence-end-double-space', `sentence-end-without-period'
167and `sentence-end-without-space'. The default value specifies
168that in order to be recognized as the end of a sentence, the
169ending period, question mark, or exclamation point must be
170followed by two spaces, unless it's inside some sort of quotes or
171parenthesis. See Info node `Sentences'."
172 (or sentence-end
173 (concat (if sentence-end-without-period "\\w \\|")
174 "\\([.?!][]\"')}]*"
175 (if sentence-end-double-space
176 "\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)")
177 "\\|[" sentence-end-without-space "]+\\)"
178 "[ \t\n]*")))
166 179
167(defcustom page-delimiter "^\014" 180(defcustom page-delimiter "^\014"
168 "*Regexp describing line-beginnings that separate pages." 181 "*Regexp describing line-beginnings that separate pages."
@@ -411,7 +424,8 @@ The variable `sentence-end' is a regular expression that matches ends of
411sentences. Also, every paragraph boundary terminates sentences as well." 424sentences. Also, every paragraph boundary terminates sentences as well."
412 (interactive "p") 425 (interactive "p")
413 (or arg (setq arg 1)) 426 (or arg (setq arg 1))
414 (let ((opoint (point))) 427 (let ((opoint (point))
428 (sentence-end (sentence-end)))
415 (while (< arg 0) 429 (while (< arg 0)
416 (let ((pos (point)) 430 (let ((pos (point))
417 (par-beg (save-excursion (start-of-paragraph-text) (point)))) 431 (par-beg (save-excursion (start-of-paragraph-text) (point))))
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index 08af8f01977..4db9788cc3b 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -334,21 +334,22 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
334;;; History functions 334;;; History functions
335;;; 335;;;
336 336
337(defun vc-svn-print-log (file) 337(defun vc-svn-print-log (file &optional buffer)
338 "Get change log associated with FILE." 338 "Get change log associated with FILE."
339 (save-current-buffer 339 (save-current-buffer
340 (vc-setup-buffer nil) 340 (vc-setup-buffer buffer)
341 (let ((inhibit-read-only t)) 341 (let ((inhibit-read-only t))
342 (goto-char (point-min)) 342 (goto-char (point-min))
343 ;; Add a line to tell log-view-mode what file this is. 343 ;; Add a line to tell log-view-mode what file this is.
344 (insert "Working file: " (file-relative-name file) "\n")) 344 (insert "Working file: " (file-relative-name file) "\n"))
345 (vc-svn-command 345 (vc-svn-command
346 t 346 buffer
347 (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) 347 (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
348 file "log"))) 348 file "log")))
349 349
350(defun vc-svn-diff (file &optional oldvers newvers) 350(defun vc-svn-diff (file &optional oldvers newvers buffer)
351 "Get a difference report using SVN between two versions of FILE." 351 "Get a difference report using SVN between two versions of FILE."
352 (unless buffer (setq buffer "*vc-diff*"))
352 (if (string= (vc-workfile-version file) "0") 353 (if (string= (vc-workfile-version file) "0")
353 ;; This file is added but not yet committed; there is no master file. 354 ;; This file is added but not yet committed; there is no master file.
354 (if (or oldvers newvers) 355 (if (or oldvers newvers)
@@ -356,7 +357,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
356 ;; We regard this as "changed". 357 ;; We regard this as "changed".
357 ;; Diff it against /dev/null. 358 ;; Diff it against /dev/null.
358 ;; Note: this is NOT a "svn diff". 359 ;; Note: this is NOT a "svn diff".
359 (apply 'vc-do-command "*vc-diff*" 360 (apply 'vc-do-command buffer
360 1 "diff" file 361 1 "diff" file
361 (append (vc-switches nil 'diff) '("/dev/null"))) 362 (append (vc-switches nil 'diff) '("/dev/null")))
362 ;; Even if it's empty, it's locally modified. 363 ;; Even if it's empty, it's locally modified.
@@ -365,7 +366,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
365 (async (and (vc-stay-local-p file) 366 (async (and (vc-stay-local-p file)
366 (or oldvers newvers) ; Svn diffs those locally. 367 (or oldvers newvers) ; Svn diffs those locally.
367 (fboundp 'start-process)))) 368 (fboundp 'start-process))))
368 (apply 'vc-svn-command "*vc-diff*" 369 (apply 'vc-svn-command buffer
369 (if async 'async 0) 370 (if async 'async 0)
370 file "diff" 371 file "diff"
371 (append 372 (append
@@ -377,7 +378,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
377 (if async 1 ; async diff => pessimistic assumption 378 (if async 1 ; async diff => pessimistic assumption
378 ;; For some reason `svn diff' does not return a useful 379 ;; For some reason `svn diff' does not return a useful
379 ;; status w.r.t whether the diff was empty or not. 380 ;; status w.r.t whether the diff was empty or not.
380 (buffer-size (get-buffer "*vc-diff*")))))) 381 (buffer-size (get-buffer buffer))))))
381 382
382(defun vc-svn-diff-tree (dir &optional rev1 rev2) 383(defun vc-svn-diff-tree (dir &optional rev1 rev2)
383 "Diff all files at and below DIR." 384 "Diff all files at and below DIR."
diff --git a/lisp/view.el b/lisp/view.el
index 1ee6014c73a..b17cd52ae35 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -137,6 +137,7 @@ subtracted from by `view-mode-exit' when finished viewing the buffer.
137See RETURN-TO-ALIST argument of function `view-mode-exit' for the format of 137See RETURN-TO-ALIST argument of function `view-mode-exit' for the format of
138`view-return-to-alist'.") 138`view-return-to-alist'.")
139(make-variable-buffer-local 'view-return-to-alist) 139(make-variable-buffer-local 'view-return-to-alist)
140(put 'view-return-to-alist 'permanent-local t)
140 141
141(defvar view-exit-action nil 142(defvar view-exit-action nil
142 "nil or a function with one argument (a buffer) called when finished viewing. 143 "nil or a function with one argument (a buffer) called when finished viewing.
diff --git a/lisp/window.el b/lisp/window.el
index 91b91cfb158..2b5a4ab161d 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -327,8 +327,9 @@ new mode line."
327 (with-current-buffer (window-buffer) 327 (with-current-buffer (window-buffer)
328 (if view-mode 328 (if view-mode
329 (let ((old-info (assq old-w view-return-to-alist))) 329 (let ((old-info (assq old-w view-return-to-alist)))
330 (push (cons new-w (cons (and old-info (car (cdr old-info))) t)) 330 (if old-info
331 view-return-to-alist))) 331 (push (cons new-w (cons (car (cdr old-info)) t))
332 view-return-to-alist))))
332 new-w)) 333 new-w))
333 334
334(defun split-window-horizontally (&optional arg) 335(defun split-window-horizontally (&optional arg)
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 41e9e3e78b2..2ed5d807c36 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -309,14 +309,13 @@ and must have the format file:file-name or file:///file-name.
309The last / in file:/// is part of the file name. ACTION is ignored." 309The last / in file:/// is part of the file name. ACTION is ignored."
310 310
311 (let* ((f (x-dnd-get-local-file-name uri t))) 311 (let* ((f (x-dnd-get-local-file-name uri t)))
312 (when f 312 (if (and f (file-readable-p f))
313 (if (file-readable-p f) 313 (progn
314 (progn 314 (if x-dnd-open-file-other-window
315 (if x-dnd-open-file-other-window 315 (find-file-other-window f)
316 (find-file-other-window f) 316 (find-file f))
317 (find-file f)) 317 'private)
318 'private) 318 (error "Can not read %s" uri))))
319 (error "Can not read %s (%s)" f uri)))))
320 319
321(defun x-dnd-open-file (uri action) 320(defun x-dnd-open-file (uri action)
322 "Open a local or remote file. 321 "Open a local or remote file.
@@ -328,7 +327,8 @@ The last / in file://hostname/ is part of the file name."
328 ;; The hostname may be our hostname, in that case, convert to a local 327 ;; The hostname may be our hostname, in that case, convert to a local
329 ;; file. Otherwise return nil. 328 ;; file. Otherwise return nil.
330 (let ((local-file (x-dnd-get-local-file-uri uri))) 329 (let ((local-file (x-dnd-get-local-file-uri uri)))
331 (when local-file (x-dnd-open-local-file local-file action)))) 330 (if local-file (x-dnd-open-local-file local-file action)
331 (error "Remote files not supported"))))
332 332
333 333
334(defun x-dnd-handle-moz-url (window action data) 334(defun x-dnd-handle-moz-url (window action data)