aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2004-07-18 21:49:24 +0000
committerKaroly Lorentey2004-07-18 21:49:24 +0000
commit31d7e9bc5a474c2da8c40f4812ea3e09cd5fb82c (patch)
tree729a3c238e43ed5625290e994d9ef0d09c18241a
parent4cb2afc64f004ba91ff0bd37cf8ca6669b228988 (diff)
parentcdfa3eccb179fe579a5e38949d0a2ad3d2757524 (diff)
downloademacs-31d7e9bc5a474c2da8c40f4812ea3e09cd5fb82c.tar.gz
emacs-31d7e9bc5a474c2da8c40f4812ea3e09cd5fb82c.zip
Merged in changes from CVS trunk.
Patches applied: * lorentey@elte.hu--2004/emacs--hacks--0--patch-2 Prevent special events from appending dashes to the echo string. * lorentey@elte.hu--2004/emacs--hacks--0--patch-4 Added ChangeLog entry. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-454 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-455 Bash the dashes * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-456 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-457 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-458 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-459 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-460 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-219
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/MORE.STUFF6
-rw-r--r--etc/NEWS82
-rw-r--r--etc/TODO25
-rw-r--r--leim/Makefile.in9
-rw-r--r--lib-src/ChangeLog4
-rw-r--r--lisp/ChangeLog131
-rw-r--r--lisp/autorevert.el150
-rw-r--r--lisp/bindings.el15
-rw-r--r--lisp/buff-menu.el14
-rw-r--r--lisp/calendar/cal-dst.el4
-rw-r--r--lisp/dired.el3
-rw-r--r--lisp/emacs-lisp/testcover.el223
-rw-r--r--lisp/emulation/cua-base.el21
-rw-r--r--lisp/font-lock.el12
-rw-r--r--lisp/mail/footnote.el7
-rw-r--r--lisp/mh-e/mh-loaddefs.el2
-rw-r--r--lisp/net/tramp-smb.el2
-rw-r--r--lisp/net/tramp-vc.el18
-rw-r--r--lisp/net/tramp.el219
-rw-r--r--lisp/progmodes/grep.el2
-rw-r--r--lisp/progmodes/which-func.el28
-rw-r--r--lisp/replace.el3
-rw-r--r--lisp/simple.el19
-rw-r--r--lispref/ChangeLog27
-rw-r--r--lispref/abbrevs.texi13
-rw-r--r--lispref/buffers.texi6
-rw-r--r--lispref/display.texi15
-rw-r--r--lispref/searching.texi13
-rw-r--r--lispref/windows.texi104
-rw-r--r--man/trampver.texi2
-rw-r--r--src/ChangeLog42
-rw-r--r--src/buffer.c5
-rw-r--r--src/fileio.c8
-rw-r--r--src/frame.c30
-rw-r--r--src/keyboard.c40
-rw-r--r--src/print.c10
-rw-r--r--src/search.c3
-rw-r--r--src/w32fns.c4
-rw-r--r--src/window.c16
40 files changed, 995 insertions, 346 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 7546d17fd59..aa1550122d5 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12004-07-14 Luc Teirlinck <teirllm@auburn.edu>
2
3 * MORE.STUFF: Tramp is now distributed with Emacs.
4
12004-07-12 Bill Wohler <wohler@newt.com> 52004-07-12 Bill Wohler <wohler@newt.com>
2 6
3 * NEWS, MH-E-NEWS: Upgraded to MH-E version 7.4.4. 7 * NEWS, MH-E-NEWS: Upgraded to MH-E version 7.4.4.
diff --git a/etc/MORE.STUFF b/etc/MORE.STUFF
index ba514f2dbac..8cd1443d8c0 100644
--- a/etc/MORE.STUFF
+++ b/etc/MORE.STUFF
@@ -96,6 +96,9 @@ You might find bug-fixes or enhancements in these places.
96 96
97 * Sregex: <URL:http://www.zanshin.com/%7Ebobg/sregex.html> 97 * Sregex: <URL:http://www.zanshin.com/%7Ebobg/sregex.html>
98 98
99 * Tramp: Remote file access via rsh/ssh
100 <URL:http://savannah.gnu.org/projects/tramp/>
101
99 * Webjump: <URL:http://www.neilvandyke.org/webjump> 102 * Webjump: <URL:http://www.neilvandyke.org/webjump>
100 103
101 * Whitespace: <URL:http://www.dsmit.com/lisp/> 104 * Whitespace: <URL:http://www.dsmit.com/lisp/>
@@ -215,9 +218,6 @@ Several are for Debian GNU/Linux in particular.
215 Wnn6, 218 Wnn6,
216 SJ3 Ver.2 219 SJ3 Ver.2
217 220
218 * Tramp: Remote file access via rsh/ssh
219 <URL:http://savannah.gnu.org/projects/tramp/>
220
221 * VM (View Mail): <URL:http://www.wonderworks.com/vm/> Alternative 221 * VM (View Mail): <URL:http://www.wonderworks.com/vm/> Alternative
222 mail reader. There is a VM newsgroup: <URL:news:gnu.emacs.vm.info> 222 mail reader. There is a VM newsgroup: <URL:news:gnu.emacs.vm.info>
223 223
diff --git a/etc/NEWS b/etc/NEWS
index bc00a408a34..7bb0ac87263 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -95,6 +95,12 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types.
95 95
96* Changes in Emacs 21.4 96* Changes in Emacs 21.4
97 97
98+++
99** There are now two new regular expression operators, \_< and \_>,
100for matching the beginning and end of a symbol. A symbol is a
101non-empty sequence of either word or symbol constituent characters, as
102specified by the syntax table.
103
98** Passing resources on the command line now works on MS Windows. 104** Passing resources on the command line now works on MS Windows.
99You can use --xrm to pass resource settings to Emacs, overriding any 105You can use --xrm to pass resource settings to Emacs, overriding any
100existing values. For example: 106existing values. For example:
@@ -144,7 +150,7 @@ The new commands `comint-kill-whole-line' and `comint-kill-region'
144support editing comint buffers with read-only prompts. 150support editing comint buffers with read-only prompts.
145 151
146`comint-kill-whole-line' is like `kill-whole-line', but ignores both 152`comint-kill-whole-line' is like `kill-whole-line', but ignores both
147read-only and field properties. Hence, it will always kill entire 153read-only and field properties. Hence, it always kill entire
148lines, including any prompts. 154lines, including any prompts.
149 155
150`comint-kill-region' is like `kill-region', except that it ignores 156`comint-kill-region' is like `kill-region', except that it ignores
@@ -158,7 +164,7 @@ kill-ring, but does not delete it.
158** You can now use next-error (C-x `) and previous-error to advance to 164** You can now use next-error (C-x `) and previous-error to advance to
159the next/previous matching line found by M-x occur. 165the next/previous matching line found by M-x occur.
160 166
161** Telnet will now prompt you for a port number with C-u M-x telnet. 167** Telnet now prompts you for a port number with C-u M-x telnet.
162 168
163+++ 169+++
164** New command line option -Q. 170** New command line option -Q.
@@ -177,9 +183,9 @@ supplied. This behavior is analogous to `write-file'.
177** You can now use Auto Revert mode to `tail' a file. 183** You can now use Auto Revert mode to `tail' a file.
178If point is at the end of a file buffer before reverting, Auto Revert 184If point is at the end of a file buffer before reverting, Auto Revert
179mode keeps it at the end after reverting. Similarly if point is 185mode keeps it at the end after reverting. Similarly if point is
180displayed at the end of a file buffer in any window, it will stay at 186displayed at the end of a file buffer in any window, it stays at
181the end of the buffer in that window. This allows to tail a file: 187the end of the buffer in that window. This allows to tail a file:
182just put point at the end of the buffer and it will stay there. This 188just put point at the end of the buffer and it stays there. This
183rule applies to file buffers. For non-file buffers, the behavior may 189rule applies to file buffers. For non-file buffers, the behavior may
184be mode dependent. 190be mode dependent.
185 191
@@ -187,7 +193,7 @@ be mode dependent.
187other potential problems when deciding which non-file buffers to 193other potential problems when deciding which non-file buffers to
188revert. This matters especially if Global Auto Revert mode is enabled 194revert. This matters especially if Global Auto Revert mode is enabled
189and `global-auto-revert-non-file-buffers' is non-nil. Auto Revert 195and `global-auto-revert-non-file-buffers' is non-nil. Auto Revert
190mode will only revert a non-file buffer if the buffer has a non-nil 196mode only reverts a non-file buffer if the buffer has a non-nil
191`revert-buffer-function' and a non-nil `buffer-stale-function', which 197`revert-buffer-function' and a non-nil `buffer-stale-function', which
192decides whether the buffer should be reverted. Currently, this means 198decides whether the buffer should be reverted. Currently, this means
193that auto reverting works for Dired buffers (although this may not 199that auto reverting works for Dired buffers (although this may not
@@ -225,7 +231,7 @@ The new file etc/compilation.txt gives examples of each type of message.
225** M-x grep has been adapted to new compile 231** M-x grep has been adapted to new compile
226 232
227Hits are fontified in green, and hits in binary files in orange. Grep buffers 233Hits are fontified in green, and hits in binary files in orange. Grep buffers
228can be saved and will again be loaded with the new `grep-mode'. 234can be saved and automatically revisited with the new Grep mode.
229 235
230** M-x diff uses diff-mode instead of compilation-mode. 236** M-x diff uses diff-mode instead of compilation-mode.
231 237
@@ -427,7 +433,7 @@ with special modes such as Tar mode.
427 433
428** Enhancements to apropos commands: 434** Enhancements to apropos commands:
429 435
430*** The apropos commands will now accept a list of words to match. 436*** The apropos commands now accept a list of words to match.
431When more than one word is specified, at least two of those words must 437When more than one word is specified, at least two of those words must
432be present for an item to match. Regular expression matching is still 438be present for an item to match. Regular expression matching is still
433available. 439available.
@@ -606,7 +612,7 @@ XIM by default, the X resource useXIM can be used to turn it on.
606`file|dir1' and `file|dir2' to `file|dir1/subdir' and `file|dir2/subdir'. 612`file|dir1' and `file|dir2' to `file|dir1/subdir' and `file|dir2/subdir'.
607 613
608** If the user visits a file larger than `large-file-warning-threshold', 614** If the user visits a file larger than `large-file-warning-threshold',
609Emacs will prompt her for confirmation. 615Emacs prompts her for confirmation.
610 616
611** A UTF-7 coding system is available in the library `utf-7'. 617** A UTF-7 coding system is available in the library `utf-7'.
612 618
@@ -683,8 +689,8 @@ directory is used for auto-save files of mail buffers. It defaults to
683+++ 689+++
684** When you are root, and you visit a file whose modes specify 690** When you are root, and you visit a file whose modes specify
685read-only, the Emacs buffer is now read-only too. Type C-x C-q if you 691read-only, the Emacs buffer is now read-only too. Type C-x C-q if you
686want to make the buffer writable. (As root, you will in fact be able 692want to make the buffer writable. (As root, you can in fact alter the
687to alter the file.) 693file.)
688 694
689** The new command `revert-buffer-with-coding-system' (C-x RET r) 695** The new command `revert-buffer-with-coding-system' (C-x RET r)
690revisits the current file using a coding system that you specify. 696revisits the current file using a coding system that you specify.
@@ -706,7 +712,7 @@ in the menu dropped down when you click "Buffers" from the menu bar.
706 712
707`buffers-menu-show-directories' controls whether the menu displays 713`buffers-menu-show-directories' controls whether the menu displays
708leading directories as part of the file name visited by the buffer. 714leading directories as part of the file name visited by the buffer.
709If its value is `unless-uniquify', the default, directories will be 715If its value is `unless-uniquify', the default, directories are
710shown unless uniquify-buffer-name-style' is non-nil. The value of nil 716shown unless uniquify-buffer-name-style' is non-nil. The value of nil
711and t turn the display of directories off and on, respectively. 717and t turn the display of directories off and on, respectively.
712 718
@@ -785,7 +791,7 @@ sets plus some other 8-bit sets, but can be extended. For instance,
785translation works amongst the Emacs ...-iso8859-... charsets and the 791translation works amongst the Emacs ...-iso8859-... charsets and the
786mule-unicode-... ones. 792mule-unicode-... ones.
787 793
788By default this translation will happen automatically on encoding. 794By default this translation happens automatically on encoding.
789Self-inserting characters are translated to make the input conformant 795Self-inserting characters are translated to make the input conformant
790with the encoding of the buffer in which it's being used, where 796with the encoding of the buffer in which it's being used, where
791possible. 797possible.
@@ -863,7 +869,7 @@ the window edge point is allowed to get before automatic hscrolling
863will horizontally scroll the window. The default value is 5. 869will horizontally scroll the window. The default value is 5.
864 870
865The variable `hscroll-step' determines how many columns automatic 871The variable `hscroll-step' determines how many columns automatic
866hscrolling will scroll the window when point gets too close to the 872hscrolling scrolls the window when point gets too close to the
867window edge. If its value is zero, the default, Emacs scrolls the 873window edge. If its value is zero, the default, Emacs scrolls the
868window so as to center point. If its value is an integer, it says how 874window so as to center point. If its value is an integer, it says how
869many columns to scroll. If the value is a floating-point number, it 875many columns to scroll. If the value is a floating-point number, it
@@ -1111,8 +1117,8 @@ remove `turn-on-font-lock' from `Info-mode-hook'.
1111 1117
1112+++ 1118+++
1113** M-x grep now tries to avoid appending `/dev/null' to the command line 1119** M-x grep now tries to avoid appending `/dev/null' to the command line
1114by using GNU grep `-H' option instead. M-x grep will automatically 1120by using GNU grep `-H' option instead. M-x grep automatically
1115detect whether this is possible or not the first time it is invoked. 1121detects whether this is possible or not the first time it is invoked.
1116When `-H' is used, the grep command line supplied by the user is passed 1122When `-H' is used, the grep command line supplied by the user is passed
1117unchanged to the system to execute, which allows more complicated 1123unchanged to the system to execute, which allows more complicated
1118command lines to be used than was possible before. 1124command lines to be used than was possible before.
@@ -1176,7 +1182,7 @@ counter to the specified source line (the one where point is).
1176 1182
1177*** The STARTTLS elisp wrapper (starttls.el) can now use GNUTLS 1183*** The STARTTLS elisp wrapper (starttls.el) can now use GNUTLS
1178instead of the OpenSSL based "starttls" tool. For backwards 1184instead of the OpenSSL based "starttls" tool. For backwards
1179compatibility, it will prefer "starttls", but you can toggle 1185compatibility, it prefers "starttls", but you can toggle
1180`starttls-use-gnutls' to switch to GNUTLS (or simply remove the 1186`starttls-use-gnutls' to switch to GNUTLS (or simply remove the
1181"starttls" tool). 1187"starttls" tool).
1182 1188
@@ -1211,10 +1217,10 @@ refontification takes place.
1211+++ 1217+++
1212** Marking commands extend the region when invoked multiple times. If 1218** Marking commands extend the region when invoked multiple times. If
1213you hit M-C-SPC (mark-sexp), M-@ (mark-word), M-h (mark-paragraph), or 1219you hit M-C-SPC (mark-sexp), M-@ (mark-word), M-h (mark-paragraph), or
1214C-M-h (mark-defun) repeatedly, the marked region will now be extended 1220C-M-h (mark-defun) repeatedly, the marked region extends each time, so
1215each time, so you can mark the next two sexps with M-C-SPC M-C-SPC, 1221you can mark the next two sexps with M-C-SPC M-C-SPC, for example.
1216for example. This feature also works for mark-end-of-sentence, if you 1222This feature also works for mark-end-of-sentence, if you bind that to
1217bind that to a key. 1223a key.
1218 1224
1219+++ 1225+++
1220** Some commands do something special in Transient Mark mode when the 1226** Some commands do something special in Transient Mark mode when the
@@ -1236,7 +1242,7 @@ C-g.
1236 1242
1237+++ 1243+++
1238** A prefix argument is no longer required to repeat a jump to a 1244** A prefix argument is no longer required to repeat a jump to a
1239previous mark, i.e. C-u C-SPC C-SPC C-SPC ... will cycle through the 1245previous mark, i.e. C-u C-SPC C-SPC C-SPC ... cycles through the
1240mark ring. Use C-u C-u C-SPC to set the mark immediately after a jump. 1246mark ring. Use C-u C-u C-SPC to set the mark immediately after a jump.
1241 1247
1242+++ 1248+++
@@ -1443,7 +1449,7 @@ writes tags pointing to the source file.
1443*** New option --parse-stdin=FILE. 1449*** New option --parse-stdin=FILE.
1444This option is mostly useful when calling etags from programs. It can 1450This option is mostly useful when calling etags from programs. It can
1445be used (only once) in place of a file name on the command line. Etags 1451be used (only once) in place of a file name on the command line. Etags
1446will read from standard input and mark the produced tags as belonging to 1452reads from standard input and mark the produced tags as belonging to
1447the file FILE. 1453the file FILE.
1448 1454
1449+++ 1455+++
@@ -1751,8 +1757,8 @@ fill-single-word-nobreak-p and fill-french-nobreak-p.
1751 1757
1752+++ 1758+++
1753** New user option `add-log-always-start-new-record'. 1759** New user option `add-log-always-start-new-record'.
1754When this option is enabled, M-x add-change-log-entry will always 1760When this option is enabled, M-x add-change-log-entry always
1755start a new record regardless of when the last record is. 1761starts a new record regardless of when the last record is.
1756 1762
1757+++ 1763+++
1758** SGML mode has indentation and supports XML syntax. 1764** SGML mode has indentation and supports XML syntax.
@@ -1904,13 +1910,13 @@ pass them to Windows to be handled with system-wide functions.
1904 1910
1905--- 1911---
1906** Emacs takes note of colors defined in Control Panel on MS-Windows. 1912** Emacs takes note of colors defined in Control Panel on MS-Windows.
1907The Control Panel defines some default colors for applications in 1913The Control Panel defines some default colors for applications in much
1908much the same way as wildcard X Resources do on X. Emacs now 1914the same way as wildcard X Resources do on X. Emacs now adds these
1909adds these colors to the colormap prefixed by System (eg SystemMenu 1915colors to the colormap prefixed by System (eg SystemMenu for the
1910for the default Menu background, SystemMenuText for the foreground), 1916default Menu background, SystemMenuText for the foreground), and uses
1911and uses some of them to initialize some of the default faces. 1917some of them to initialize some of the default faces.
1912`list-colors-display' will show the list of System color names if you 1918`list-colors-display' shows the list of System color names, in case
1913wish to use them in other faces. 1919you wish to use them in other faces.
1914 1920
1915+++ 1921+++
1916** Under X11, it is possible to swap Alt and Meta (and Super and Hyper). 1922** Under X11, it is possible to swap Alt and Meta (and Super and Hyper).
@@ -2078,7 +2084,7 @@ this behaviour via the variable kmacro-call-repeat-key and
2078kmacro-call-repeat-with-arg. 2084kmacro-call-repeat-with-arg.
2079 2085
2080Keyboard macros can now be debugged and edited interactively. 2086Keyboard macros can now be debugged and edited interactively.
2081C-x C-k SPC will step through the last keyboard macro one key sequence 2087C-x C-k SPC steps through the last keyboard macro one key sequence
2082at a time, prompting for the actions to take. 2088at a time, prompting for the actions to take.
2083 2089
2084--- 2090---
@@ -2178,7 +2184,11 @@ configuration files.
2178 2184
2179* Lisp Changes in Emacs 21.4 2185* Lisp Changes in Emacs 21.4
2180 2186
2181** If a command sets transient-mark-mode to `only', that 2187+++
2188** `visited-file-modtime' and `calendar-time-from-absolute' now return
2189a list of two integers, instead of a cons.
2190
2191** If a command sets transient-mark-mode to `only', that
2182enables Transient Mark mode for the following command only. 2192enables Transient Mark mode for the following command only.
2183During that following command, the value of transient-mark-mode 2193During that following command, the value of transient-mark-mode
2184is `identity'. If it is still `identity' at the end of the command, 2194is `identity'. If it is still `identity' at the end of the command,
@@ -3567,9 +3577,9 @@ it in that buffer.
3567properties from surrounding text. 3577properties from surrounding text.
3568 3578
3569+++ 3579+++
3570** `(match-data t)' will append the buffer as a final element of the 3580** The list returned by `(match-data t)' now has the buffer as a final
3571match data if the last match was on a buffer. `set-match-data' will 3581element, if the last match was on a buffer. `set-match-data'
3572accept this for restoring the match state. 3582accepts such a list for restoring the match state.
3573 3583
3574+++ 3584+++
3575** New function `buffer-local-value'. 3585** New function `buffer-local-value'.
diff --git a/etc/TODO b/etc/TODO
index 1b2f20d6b89..6eef625d659 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -87,7 +87,9 @@ to the FSF.
87 latin-1-prefix and latin-1-postfix. 87 latin-1-prefix and latin-1-postfix.
88 88
89** Implement a clean way to use different major modes for 89** Implement a clean way to use different major modes for
90 different parts of a buffer. 90 different parts of a buffer. This could be useful in editing
91 Bison input files, for instance, or other kinds of text
92 where one language is embedded in another language.
91 93
92** Give start-process the ability to direct standard-error 94** Give start-process the ability to direct standard-error
93 output to a different filter. 95 output to a different filter.
@@ -107,8 +109,8 @@ to the FSF.
107 See the Gnus development sources for assigned code concerning GPG 109 See the Gnus development sources for assigned code concerning GPG
108 use with mail, which is probably a good start.] 110 use with mail, which is probably a good start.]
109 111
110** Save undo information in files, and reload it when needed 112** Save undo information in special temporary files, and reload it
111 for undoing. 113 when needed for undoing. This could extend undo capacity.
112 114
113** Merge the Emacs regex.c with the Glibc regex.c. 115** Merge the Emacs regex.c with the Glibc regex.c.
114 They split off a few years ago through negligence. 116 They split off a few years ago through negligence.
@@ -276,8 +278,14 @@ to the FSF.
276 the definition of `file-attributes' and `directory-files-and-attributes' 278 the definition of `file-attributes' and `directory-files-and-attributes'
277 and from the calls. 279 and from the calls.
278 280
279** Re-design language environment handling so that Emacs can fit 281** Make language-info-alist customizable. Currently a user can customize
280 better to a users locale (e.g. ja_JP.UTF-8). 282 only the variable `current-language-environment'.
283
284** Improve language environment handling so that Emacs can fit
285 better to a users locale. Currently Emacs uses utf-8 language
286 environment for all utf-8 locales, thus a user in ja_JP.UTF-8 locale
287 are also put in utf-8 lang. env. In such a case, it is
288 better to use Japanese lang. env. but prefer utf-8 coding system.
281 289
282** Eliminate the current restriction on header printing by ps-print. 290** Eliminate the current restriction on header printing by ps-print.
283 Currently, a header can contain only single 1-byte charset in 291 Currently, a header can contain only single 1-byte charset in
@@ -294,9 +302,10 @@ to the FSF.
294** Enhance word boundary detection for such a script that doesn't use 302** Enhance word boundary detection for such a script that doesn't use
295 space at word boundary (e.g. Thai). 303 space at word boundary (e.g. Thai).
296 304
297** Include a better Japanese input method in the distribution. 305** Implement interface programs with major Japanese conversion server
298 Currently, most Japanese users are using external packages 306 in lib-src so that they can be used from the input method
299 (e.g. tamago, anthy) or an input method via XIM. 307 "japanese". Currently, most Japanese users are using external
308 packages (e.g. tamago, anthy) or an input method via XIM.
300 309
301* Internal changes 310* Internal changes
302 311
diff --git a/leim/Makefile.in b/leim/Makefile.in
index daa5b550cf2..7f3c13dbe36 100644
--- a/leim/Makefile.in
+++ b/leim/Makefile.in
@@ -1,6 +1,11 @@
1# Makefile for leim subdirectory in GNU Emacs. 1# Makefile for leim subdirectory in GNU Emacs.
2# Copyright (C) 1997, 2004 Electrotechnical Laboratory, JAPAN. 2# Copyright (C) 1997,98,1999,2000,2001 Electrotechnical Laboratory, JAPAN.
3# Licensed to the Free Software Foundation. 3# Licensed to the Free Software Foundation.
4# Copyright (C) 1997,98,1999,2000,01,02,03,2004
5# Free Software Foundation, Inc.
6# Copyright (C) 2001,02,03,2004
7# National Institute of Advanced Industrial Science and Technology (AIST)
8# Registration Number H14PRO021
4 9
5# This file is part of GNU Emacs. 10# This file is part of GNU Emacs.
6 11
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 9f3fcc13371..4764871fa54 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,7 @@
12004-07-17 Richard M. Stallman <rms@gnu.org>
2
3 * emacsclient.c (quote_file_name): Pass COPY thru %s to output it.
4
12004-06-01 Juanma Barranquero <lektu@terra.es> 52004-06-01 Juanma Barranquero <lektu@terra.es>
2 6
3 * makefile.w32-in (obj): Add image.c. 7 * makefile.w32-in (obj): Add image.c.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b860134af46..876646163e3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,126 @@
12004-07-17 Kai Grossjohann <kai.grossjohann@gmx.net>
2
3 * net/tramp.el (tramp-handle-verify-visited-file-modtime): New
4 docstring. From Luc Teirlinck.
5
62004-07-17 Luc Teirlinck <teirllm@auburn.edu>
7
8 * autorevert.el: Describe `Auto Revert Tail Mode' in `Commentary'
9 section.
10 (auto-revert-handler): Do not check `auto-revert-tail-mode' for
11 non-file buffers. We know it is nil.
12
132004-07-17 Kai Grossjohann <kai.grossjohann@gmx.net>
14
15 Sync with Tramp 2.0.43.
16
17 * net/tramp.el (tramp-handle-verify-visited-file-modtime): Remove
18 outdated comment.
19 (tramp-locked, tramp-locker): New variables for implementing a
20 global lock.
21 (tramp-sh-file-name-handler): Use them to implement the global
22 lock.
23
242004-07-13 Michael Albinus <michael.albinus@gmx.de>
25
26 * net/tramp.el (all): Code cleanup. Change all `tramp-handle-xxx'
27 calls to respective `xxx` calls.
28 (tramp-process-alive-regexp): Precise doc string.
29 (tramp-multi-action-process-alive): New defun.
30 (tramp-multi-actions): Use it.
31 (tramp-handle-find-backup-file-name): `copy-tree' is available
32 since Emacs 21.4 only (XEmacs has it). Implementation rewritten
33 in order to avoid this function.
34 (tramp-handle-write-region): Set current buffer. If connection
35 wasn't open, `file-modes' has changed it accidently. Reported by
36 David Kastrup <dak@gnu.org>.
37 (tramp-enter-password, tramp-read-passwd): New arguments USER and
38 HOST.
39 (tramp-action-password, tramp-multi-action-password): Apply it.
40 (tramp-open-connection-rsh): If a port is given, the Tramp buffer
41 name must still contain the port number. Otherwise, we have two
42 Tramp buffers, with all the confusion. Reported by Myron Selby
43 <myron@xytech.com> and Rolf Dubitzky
44 <Dubitzky@physi.uni-heidelberg.de>.
45
46 * net/tramp-smb.el (tramp-smb-open-connection): Apply USER and
47 HOST to `tramp-enter-passwd'.
48
49 * net/tramp-vc.el (all): Code cleanup. Change all
50 `tramp-handle-xxx' calls to respective `xxx` calls.
51
522004-07-17 Jonathan Yavner <jyavner@member.fsf.org>
53
54 * emacs-lisp/testcover.el: New category "potentially-1valued" for
55 functions that are not erroneous if either 1-valued or
56 multi-valued. Detect functions in this class.
57 (testcover-1value-functions, testcover-compose-functions,
58 testcover-progn-functions) Added some additional functions to lists.
59 (testcover-mark): Bugfix when marking up the definition for an
60 empty function.
61
622004-07-17 Richard M. Stallman <rms@gnu.org>
63
64 * replace.el (occur-read-primary-args): Pass default to read-from-minibuffer.
65
66 * mail/footnote.el (footnote-section-tag): Use defcustom.
67
68 * font-lock.el (font-lock-add-keywords, font-lock-remove-keywords):
69 Compile font-lock-keywords, not KEYWORDS.
70 (lisp-font-lock-keywords-2): Add multiple-value-prog1, go.
71 Add warn, check-type. Handle cerror like error.
72
732004-07-14 Daniel Pfeiffer <occitan@esperanto.org>
74
75 * progmodes/which-func.el (which-func-keymap): New var.
76 (which-func-face): New face.
77 (which-func-format): Use them.
78
792004-07-16 Stephan Stahl <stahl@eos.franken.de> (tiny change)
80
81 * buff-menu.el (list-buffers-noselect): Append the buffer's
82 process status to its mode name.
83
842004-07-16 Kim F. Storm <storm@cua.dk>
85
86 * simple.el (inhibit-mark-movement): New defvar.
87 (beginning-of-buffer, end-of-buffer): Do not push mark if
88 inhibit-mark-movement is non-nil or C-u prefix is given.
89
90 * emulation/cua-base.el (cua--preserve-mark-commands): New defvar.
91 Init to beginning-of-buffer and end-of-buffer.
92 (cua--undo-push-mark): New defvar.
93 (cua--pre-command-handler): Set inhibit-mark-movement if mark is
94 already active and command is in cua--preserve-mark-commands.
95 Also fix check for shift modifier on non-window systems.
96 (cua--post-command-handler): Clear inhibit-mark-movement if set.
97
982004-07-14 Luc Teirlinck <teirllm@auburn.edu>
99
100 * calendar/cal-dst.el (calendar-time-from-absolute): Return a list
101 of two integers, instead of a cons.
102
103 * net/tramp.el (tramp-handle-verify-visited-file-modtime):
104 `visited-file-modtime' now returns a list of two integers, instead
105 of a cons.
106
107 * dired.el (dired-directory-changed-p): Ditto.
108
109 * progmodes/grep.el (grep): Doc fix.
110
1112004-07-14 Daniel Pfeiffer <occitan@esperanto.org>
112
113 * autorevert.el (auto-revert-tail-mode)
114 (auto-revert-tail-mode-text, auto-revert-tail-pos): New vars.
115 (auto-revert-mode): Turn off auto-revert-tail-mode, so we're not
116 in both at the same time.
117 (auto-revert-tail-mode): New command.
118 (turn-on-auto-revert-tail-mode, auto-revert-tail-handler): New funs.
119 (auto-revert-handler): Revert only either tail or whole file.
120
121 * bindings.el (mode-line-mode-menu): Fix alphabetical ordering and
122 add auto-revert-tail-mode.
123
12004-07-12 Vinicius Jose Latorre <viniciusjl@ig.com.br> 1242004-07-12 Vinicius Jose Latorre <viniciusjl@ig.com.br>
2 125
3 * printing.el: Doc fix. Change name of some funs. 126 * printing.el: Doc fix. Change name of some funs.
@@ -1475,6 +1598,14 @@
1475 (timer-event-handler): Set triggered-p element non-nil while running 1598 (timer-event-handler): Set triggered-p element non-nil while running
1476 the timer function. 1599 the timer function.
1477 1600
16012004-05-14 Stefan Monnier <monnier@iro.umontreal.ca>
1602
1603 * descr-text.el (describe-char-unicode-data)
1604 (describe-char-unicodedata-file): Re-enable the unicode code now that
1605 the licensing issues have been cleared in the unicode-4 license.
1606 (describe-text-properties-1): Remove unused `overlay' var.
1607 (describe-char): Remove unused var `buffer'.
1608
14782004-05-14 David Ponce <david@dponce.com> 16092004-05-14 David Ponce <david@dponce.com>
1479 1610
1480 * tree-widget.el: New file. 1611 * tree-widget.el: New file.
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 7b786882cf6..ef438eb4b97 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -34,7 +34,8 @@
34;; 34;;
35;; This package contains two minor modes: Global Auto-Revert Mode and 35;; This package contains two minor modes: Global Auto-Revert Mode and
36;; Auto-Revert Mode. Both modes automatically revert buffers 36;; Auto-Revert Mode. Both modes automatically revert buffers
37;; whenever the corresponding files have been changed on disk. 37;; whenever the corresponding files have been changed on disk and the
38;; buffer contains no unsaved changes.
38;; 39;;
39;; Auto-Revert Mode can be activated for individual buffers. Global 40;; Auto-Revert Mode can be activated for individual buffers. Global
40;; Auto-Revert Mode applies to all file buffers. (If the user option 41;; Auto-Revert Mode applies to all file buffers. (If the user option
@@ -59,11 +60,19 @@
59;; Just put point at the end of the buffer and it will stay there. 60;; Just put point at the end of the buffer and it will stay there.
60;; These rules apply to file buffers. For non-file buffers, the 61;; These rules apply to file buffers. For non-file buffers, the
61;; behavior may be mode dependent. 62;; behavior may be mode dependent.
63;;
64;; While you can use Auto Revert Mode to tail a file, this package
65;; contains a third minor mode, Auto Revert Tail Mode, which does so
66;; more efficiently, as long as you are sure that the file will only
67;; change by growing at the end. It only appends the new output,
68;; instead of reverting the entire buffer. It does so even if the
69;; buffer contains unsaved changes. (Because they will not be lost.)
62 70
63;; Usage: 71;; Usage:
64;; 72;;
65;; Go to the appropriate buffer and press: 73;; Go to the appropriate buffer and press either of:
66;; M-x auto-revert-mode RET 74;; M-x auto-revert-mode RET
75;; M-x auto-revert-tail-mode RET
67;; 76;;
68;; To activate Global Auto-Revert Mode, press: 77;; To activate Global Auto-Revert Mode, press:
69;; M-x global-auto-revert-mode RET 78;; M-x global-auto-revert-mode RET
@@ -105,13 +114,18 @@ Global Auto-Revert Mode applies to all buffers."
105 114
106;; Variables: 115;; Variables:
107 116
108;; Autoload for the benefit of `make-mode-line-mouse-sensitive'. 117;;; What's this?: ;; Autoload for the benefit of `make-mode-line-mouse-sensitive'.
109;;;###autoload 118;;; What's this?: ;;;###autoload
110(defvar auto-revert-mode nil 119(defvar auto-revert-mode nil
111 "*Non-nil when Auto-Revert Mode is active. 120 "*Non-nil when Auto-Revert Mode is active.
112Never set this variable directly, use the command `auto-revert-mode' instead.") 121Never set this variable directly, use the command `auto-revert-mode' instead.")
113(put 'auto-revert-mode 'permanent-local t) 122(put 'auto-revert-mode 'permanent-local t)
114 123
124(defvar auto-revert-tail-mode nil
125 "*Non-nil when Auto-Revert Tail Mode is active.
126Never set this variable directly, use the command `auto-revert-mode' instead.")
127(put 'auto-revert-tail-mode 'permanent-local t)
128
115(defvar auto-revert-timer nil 129(defvar auto-revert-timer nil
116 "Timer used by Auto-Revert Mode.") 130 "Timer used by Auto-Revert Mode.")
117 131
@@ -153,6 +167,13 @@ When non-nil, a message is generated whenever a file is reverted."
153 :group 'auto-revert 167 :group 'auto-revert
154 :type 'string) 168 :type 'string)
155 169
170(defcustom auto-revert-tail-mode-text " Tail"
171 "String to display in the mode line when Auto-Revert Tail Mode is active.
172
173\(When the string is not empty, make sure that it has a leading space.)"
174 :group 'auto-revert
175 :type 'string)
176
156(defcustom auto-revert-mode-hook nil 177(defcustom auto-revert-mode-hook nil
157 "Functions to run when Auto-Revert Mode is activated." 178 "Functions to run when Auto-Revert Mode is activated."
158 :tag "Auto Revert Mode Hook" ; To separate it from `global-...' 179 :tag "Auto Revert Mode Hook" ; To separate it from `global-...'
@@ -190,7 +211,7 @@ For more information, see Info node `(emacs-xtra)Autorevert'."
190 :type 'boolean 211 :type 'boolean
191 :link '(info-link "(emacs-xtra)Autorevert")) 212 :link '(info-link "(emacs-xtra)Autorevert"))
192 213
193(defcustom global-auto-revert-ignore-modes '() 214(defcustom global-auto-revert-ignore-modes ()
194 "List of major modes Global Auto-Revert Mode should not check." 215 "List of major modes Global Auto-Revert Mode should not check."
195 :group 'auto-revert 216 :group 'auto-revert
196 :type '(repeat sexp)) 217 :type '(repeat sexp))
@@ -230,7 +251,7 @@ This variable becomes buffer local when set in any fashion.")
230 251
231;; Internal variables: 252;; Internal variables:
232 253
233(defvar auto-revert-buffer-list '() 254(defvar auto-revert-buffer-list ()
234 "List of buffers in Auto-Revert Mode. 255 "List of buffers in Auto-Revert Mode.
235 256
236Note that only Auto-Revert Mode, never Global Auto-Revert Mode, adds 257Note that only Auto-Revert Mode, never Global Auto-Revert Mode, adds
@@ -239,9 +260,16 @@ buffers to this list.
239The timer function `auto-revert-buffers' is responsible for purging 260The timer function `auto-revert-buffers' is responsible for purging
240the list of old buffers.") 261the list of old buffers.")
241 262
242(defvar auto-revert-remaining-buffers '() 263(defvar auto-revert-remaining-buffers ()
243 "Buffers not checked when user input stopped execution.") 264 "Buffers not checked when user input stopped execution.")
244 265
266(defvar auto-revert-tail-pos 0
267 "Position of last known end of file.")
268
269(add-hook 'find-file-hook
270 (lambda ()
271 (set (make-local-variable 'auto-revert-tail-pos)
272 (save-restriction (widen) (1- (point-max))))))
245 273
246;; Functions: 274;; Functions:
247 275
@@ -251,7 +279,9 @@ the list of old buffers.")
251 279
252With arg, turn Auto Revert mode on if and only if arg is positive. 280With arg, turn Auto Revert mode on if and only if arg is positive.
253This is a minor mode that affects only the current buffer. 281This is a minor mode that affects only the current buffer.
254Use `global-auto-revert-mode' to automatically revert all buffers." 282Use `global-auto-revert-mode' to automatically revert all buffers.
283Use `auto-revert-tail-mode' if you know that the file will only grow
284without being changed in the part that is already in the buffer."
255 nil auto-revert-mode-text nil 285 nil auto-revert-mode-text nil
256 (if auto-revert-mode 286 (if auto-revert-mode
257 (if (not (memq (current-buffer) auto-revert-buffer-list)) 287 (if (not (memq (current-buffer) auto-revert-buffer-list))
@@ -260,7 +290,8 @@ Use `global-auto-revert-mode' to automatically revert all buffers."
260 (delq (current-buffer) auto-revert-buffer-list))) 290 (delq (current-buffer) auto-revert-buffer-list)))
261 (auto-revert-set-timer) 291 (auto-revert-set-timer)
262 (when auto-revert-mode 292 (when auto-revert-mode
263 (auto-revert-buffers))) 293 (auto-revert-buffers)
294 (setq auto-revert-tail-mode nil)))
264 295
265 296
266;;;###autoload 297;;;###autoload
@@ -273,6 +304,52 @@ This function is designed to be added to hooks, for example:
273 304
274 305
275;;;###autoload 306;;;###autoload
307(define-minor-mode auto-revert-tail-mode
308 "Toggle reverting tail of buffer when file on disk grows.
309With arg, turn Tail mode on iff arg is positive.
310
311When Tail mode is enabled, the tail of the file is constantly
312followed, as with the shell command `tail -f'. This means that
313whenever the file grows on disk (presumably because some
314background process is appending to it from time to time), this is
315reflected in the current buffer.
316
317You can edit the buffer and turn this mode off and on again as
318you please. But make sure the background process has stopped
319writing before you save the file!
320
321Use `auto-revert-mode' for changes other than appends!"
322 :group 'find-file :lighter auto-revert-tail-mode-text
323 (when auto-revert-tail-mode
324 (unless buffer-file-name
325 (auto-revert-tail-mode 0)
326 (error "This buffer is not visiting a file"))
327 (if (and (buffer-modified-p)
328 (not auto-revert-tail-pos) ; library was loaded only after finding file
329 (not (y-or-n-p "Buffer is modified, so tail offset may be wrong. Proceed? ")))
330 (auto-revert-tail-mode 0)
331 ;; else we might reappend our own end when we save
332 (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t)
333 (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position
334 (set (make-variable-buffer-local 'auto-revert-tail-pos)
335 (save-restriction (widen) (1- (point-max)))))
336 ;; let auto-revert-mode set up the mechanism for us if it isn't already
337 (or auto-revert-mode
338 (let ((auto-revert-tail-mode t))
339 (auto-revert-mode 1)))
340 (setq auto-revert-mode nil))))
341
342
343;;;###autoload
344(defun turn-on-auto-revert-tail-mode ()
345 "Turn on Auto-Revert Tail Mode.
346
347This function is designed to be added to hooks, for example:
348 (add-hook 'my-logfile-mode-hook 'turn-on-auto-revert-tail-mode)"
349 (auto-revert-tail-mode 1))
350
351
352;;;###autoload
276(define-minor-mode global-auto-revert-mode 353(define-minor-mode global-auto-revert-mode
277 "Revert any buffer when file on disk changes. 354 "Revert any buffer when file on disk changes.
278 355
@@ -298,12 +375,12 @@ will use an up-to-date value of `auto-revert-interval'"
298 (if (or global-auto-revert-mode auto-revert-buffer-list) 375 (if (or global-auto-revert-mode auto-revert-buffer-list)
299 (run-with-timer auto-revert-interval 376 (run-with-timer auto-revert-interval
300 auto-revert-interval 377 auto-revert-interval
301 'auto-revert-buffers) 378 'auto-revert-buffers))))
302 nil)))
303 379
304(defun auto-revert-active-p () 380(defun auto-revert-active-p ()
305 "Check if auto-revert is active (in current buffer or globally)." 381 "Check if auto-revert is active (in current buffer or globally)."
306 (or auto-revert-mode 382 (or auto-revert-mode
383 auto-revert-tail-mode
307 (and 384 (and
308 global-auto-revert-mode 385 global-auto-revert-mode
309 (not global-auto-revert-ignore-buffer) 386 (not global-auto-revert-ignore-buffer)
@@ -313,18 +390,20 @@ will use an up-to-date value of `auto-revert-interval'"
313(defun auto-revert-handler () 390(defun auto-revert-handler ()
314 "Revert current buffer, if appropriate. 391 "Revert current buffer, if appropriate.
315This is an internal function used by Auto-Revert Mode." 392This is an internal function used by Auto-Revert Mode."
316 (unless (buffer-modified-p) 393 (when (or auto-revert-tail-mode (not (buffer-modified-p)))
317 (let ((buffer (current-buffer)) revert eob eoblist) 394 (let* ((buffer (current-buffer))
318 (or (and buffer-file-name 395 (revert
319 (not (file-remote-p buffer-file-name)) 396 (or (and buffer-file-name
320 (file-readable-p buffer-file-name) 397 (not (file-remote-p buffer-file-name))
321 (not (verify-visited-file-modtime buffer)) 398 (file-readable-p buffer-file-name)
322 (setq revert t)) 399 (not (verify-visited-file-modtime buffer)))
323 (and (or auto-revert-mode global-auto-revert-non-file-buffers) 400 (and (or auto-revert-mode
324 revert-buffer-function 401 global-auto-revert-non-file-buffers)
325 (boundp 'buffer-stale-function) 402 revert-buffer-function
326 (functionp buffer-stale-function) 403 (boundp 'buffer-stale-function)
327 (setq revert (funcall buffer-stale-function t)))) 404 (functionp buffer-stale-function)
405 (funcall buffer-stale-function t))))
406 eob eoblist)
328 (when revert 407 (when revert
329 (when (and auto-revert-verbose 408 (when (and auto-revert-verbose
330 (not (eq revert 'fast))) 409 (not (eq revert 'fast)))
@@ -340,7 +419,9 @@ This is an internal function used by Auto-Revert Mode."
340 (= (window-point window) (point-max)) 419 (= (window-point window) (point-max))
341 (push window eoblist))) 420 (push window eoblist)))
342 'no-mini t)) 421 'no-mini t))
343 (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes) 422 (if auto-revert-tail-mode
423 (auto-revert-tail-handler)
424 (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes))
344 (when buffer-file-name 425 (when buffer-file-name
345 (when eob (goto-char (point-max))) 426 (when eob (goto-char (point-max)))
346 (dolist (window eoblist) 427 (dolist (window eoblist)
@@ -350,6 +431,22 @@ This is an internal function used by Auto-Revert Mode."
350 (when (or revert auto-revert-check-vc-info) 431 (when (or revert auto-revert-check-vc-info)
351 (vc-find-file-hook))))) 432 (vc-find-file-hook)))))
352 433
434(defun auto-revert-tail-handler ()
435 (let ((size (nth 7 (file-attributes buffer-file-name)))
436 (modified (buffer-modified-p))
437 buffer-read-only ; ignore
438 (file buffer-file-name)
439 buffer-file-name) ; ignore that file has changed
440 (when (> size auto-revert-tail-pos)
441 (save-restriction
442 (widen)
443 (save-excursion
444 (goto-char (point-max))
445 (insert-file-contents file nil auto-revert-tail-pos size)))
446 (setq auto-revert-tail-pos size)
447 (set-buffer-modified-p modified)))
448 (set-visited-file-modtime))
449
353(defun auto-revert-buffers () 450(defun auto-revert-buffers ()
354 "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode. 451 "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode.
355 452
@@ -376,8 +473,8 @@ the timer when no buffers need to be checked."
376 (let ((bufs (if global-auto-revert-mode 473 (let ((bufs (if global-auto-revert-mode
377 (buffer-list) 474 (buffer-list)
378 auto-revert-buffer-list)) 475 auto-revert-buffer-list))
379 (remaining '()) 476 (remaining ())
380 (new '())) 477 (new ()))
381 ;; Partition `bufs' into two halves depending on whether or not 478 ;; Partition `bufs' into two halves depending on whether or not
382 ;; the buffers are in `auto-revert-remaining-buffers'. The two 479 ;; the buffers are in `auto-revert-remaining-buffers'. The two
383 ;; halves are then re-joined with the "remaining" buffers at the 480 ;; halves are then re-joined with the "remaining" buffers at the
@@ -398,6 +495,7 @@ the timer when no buffers need to be checked."
398 ;; Test if someone has turned off Auto-Revert Mode in a 495 ;; Test if someone has turned off Auto-Revert Mode in a
399 ;; non-standard way, for example by changing major mode. 496 ;; non-standard way, for example by changing major mode.
400 (if (and (not auto-revert-mode) 497 (if (and (not auto-revert-mode)
498 (not auto-revert-tail-mode)
401 (memq buf auto-revert-buffer-list)) 499 (memq buf auto-revert-buffer-list))
402 (setq auto-revert-buffer-list 500 (setq auto-revert-buffer-list
403 (delq buf auto-revert-buffer-list))) 501 (delq buf auto-revert-buffer-list)))
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 68c4ec433f7..eab0d596764 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -404,12 +404,12 @@ Menu of mode operations in the mode line.")
404(define-key mode-line-mode-menu [highlight-changes-mode] 404(define-key mode-line-mode-menu [highlight-changes-mode]
405 `(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode 405 `(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode
406 :button (:toggle . highlight-changes-mode))) 406 :button (:toggle . highlight-changes-mode)))
407(define-key mode-line-mode-menu [glasses-mode]
408 `(menu-item ,(purecopy "Glasses (o^o)") glasses-mode
409 :button (:toggle . (bound-and-true-p glasses-mode))))
410(define-key mode-line-mode-menu [hide-ifdef-mode] 407(define-key mode-line-mode-menu [hide-ifdef-mode]
411 `(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode 408 `(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode
412 :button (:toggle . (bound-and-true-p hide-ifdef-mode)))) 409 :button (:toggle . (bound-and-true-p hide-ifdef-mode))))
410(define-key mode-line-mode-menu [glasses-mode]
411 `(menu-item ,(purecopy "Glasses (o^o)") glasses-mode
412 :button (:toggle . (bound-and-true-p glasses-mode))))
413(define-key mode-line-mode-menu [font-lock-mode] 413(define-key mode-line-mode-menu [font-lock-mode]
414 `(menu-item ,(purecopy "Font Lock") font-lock-mode 414 `(menu-item ,(purecopy "Font Lock") font-lock-mode
415 :button (:toggle . font-lock-mode))) 415 :button (:toggle . font-lock-mode)))
@@ -419,12 +419,15 @@ Menu of mode operations in the mode line.")
419(define-key mode-line-mode-menu [column-number-mode] 419(define-key mode-line-mode-menu [column-number-mode]
420 `(menu-item ,(purecopy "Column number") column-number-mode 420 `(menu-item ,(purecopy "Column number") column-number-mode
421 :button (:toggle . column-number-mode))) 421 :button (:toggle . column-number-mode)))
422(define-key mode-line-mode-menu [auto-fill-mode] 422(define-key mode-line-mode-menu [auto-revert-tail-mode]
423 `(menu-item ,(purecopy "Auto Fill (Fill)") auto-fill-mode 423 `(menu-item ,(purecopy "Auto revert tail (Tail)") auto-revert-tail-mode
424 :button (:toggle . auto-fill-function))) 424 :button (:toggle . auto-revert-tail-mode)))
425(define-key mode-line-mode-menu [auto-revert-mode] 425(define-key mode-line-mode-menu [auto-revert-mode]
426 `(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode 426 `(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode
427 :button (:toggle . auto-revert-mode))) 427 :button (:toggle . auto-revert-mode)))
428(define-key mode-line-mode-menu [auto-fill-mode]
429 `(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode
430 :button (:toggle . auto-fill-function)))
428(define-key mode-line-mode-menu [abbrev-mode] 431(define-key mode-line-mode-menu [abbrev-mode]
429 `(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode 432 `(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode
430 :button (:toggle . abbrev-mode))) 433 :button (:toggle . abbrev-mode)))
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index da1c8ed586e..1ccaab1c6a3 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -613,7 +613,7 @@ For more information, see the function `buffer-menu'."
613 " " 613 " "
614 (Buffer-menu-make-sort-button "Mode" 4) mode-end 614 (Buffer-menu-make-sort-button "Mode" 4) mode-end
615 (Buffer-menu-make-sort-button "File" 5) "\n")) 615 (Buffer-menu-make-sort-button "File" 5) "\n"))
616 list desired-point name file) 616 list desired-point name mode file)
617 (when Buffer-menu-use-header-line 617 (when Buffer-menu-use-header-line
618 (let ((pos 0)) 618 (let ((pos 0))
619 ;; Turn spaces in the header into stretch specs so they work 619 ;; Turn spaces in the header into stretch specs so they work
@@ -638,8 +638,14 @@ For more information, see the function `buffer-menu'."
638 (mapcar 638 (mapcar
639 (lambda (buffer) 639 (lambda (buffer)
640 (with-current-buffer buffer 640 (with-current-buffer buffer
641 (setq name (buffer-name) 641 (save-window-excursion
642 file (buffer-file-name)) 642 (setq name (buffer-name)
643 mode (progn
644 (set-window-buffer (selected-window) buffer)
645 (concat (format-mode-line mode-name)
646 (if mode-line-process
647 (format-mode-line mode-line-process))))
648 file (buffer-file-name)))
643 (cond 649 (cond
644 ;; Don't mention internal buffers. 650 ;; Don't mention internal buffers.
645 ((and (string= (substring name 0 1) " ") (null file))) 651 ((and (string= (substring name 0 1) " ") (null file)))
@@ -665,7 +671,7 @@ For more information, see the function `buffer-menu'."
665 ?% ? ) 671 ?% ? )
666 ;; Identify modified buffers. 672 ;; Identify modified buffers.
667 (if (buffer-modified-p) ?* ? )) 673 (if (buffer-modified-p) ?* ? ))
668 name (buffer-size) mode-name file))))) 674 name (buffer-size) mode file)))))
669 (buffer-list)))) 675 (buffer-list))))
670 (dolist (buffer 676 (dolist (buffer
671 (if Buffer-menu-sort-column 677 (if Buffer-menu-sort-column
diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el
index 68943b77b28..034e8e28523 100644
--- a/lisp/calendar/cal-dst.el
+++ b/lisp/calendar/cal-dst.el
@@ -70,14 +70,14 @@ absolute date ABS-DATE is the equivalent moment to X."
70(defun calendar-time-from-absolute (abs-date s) 70(defun calendar-time-from-absolute (abs-date s)
71 "Time of absolute date ABS-DATE, S seconds after midnight. 71 "Time of absolute date ABS-DATE, S seconds after midnight.
72 72
73Returns the pair (HIGH . LOW) where HIGH and LOW are the high and low 73Returns the list (HIGH LOW) where HIGH and LOW are the high and low
7416 bits, respectively, of the number of seconds 1970-01-01 00:00:00 UTC, 7416 bits, respectively, of the number of seconds 1970-01-01 00:00:00 UTC,
75ignoring leap seconds, that is the equivalent moment to S seconds after 75ignoring leap seconds, that is the equivalent moment to S seconds after
76midnight UTC on absolute date ABS-DATE." 76midnight UTC on absolute date ABS-DATE."
77 (let* ((a (- abs-date calendar-system-time-basis)) 77 (let* ((a (- abs-date calendar-system-time-basis))
78 (u (+ (* 163 (mod a 512)) (floor s 128)))) 78 (u (+ (* 163 (mod a 512)) (floor s 128))))
79 ;; Overflow is a terrible thing! 79 ;; Overflow is a terrible thing!
80 (cons 80 (list
81 ;; floor((60*60*24*a + s) / 2^16) 81 ;; floor((60*60*24*a + s) / 2^16)
82 (+ a (* 163 (floor a 512)) (floor u 512)) 82 (+ a (* 163 (floor a 512)) (floor u 512))
83 ;; (60*60*24*a + s) mod 2^16 83 ;; (60*60*24*a + s) mod 2^16
diff --git a/lisp/dired.el b/lisp/dired.el
index e5e23dfe2d6..43eec9408d4 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -620,8 +620,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
620 (modtime (visited-file-modtime))) 620 (modtime (visited-file-modtime)))
621 (or (eq modtime 0) 621 (or (eq modtime 0)
622 (not (eq (car attributes) t)) 622 (not (eq (car attributes) t))
623 (and (= (car (nth 5 attributes)) (car modtime)) 623 (equal (nth 5 attributes) modtime)))))
624 (= (nth 1 (nth 5 attributes)) (cdr modtime)))))))
625 624
626(defun dired-buffer-stale-p (&optional noconfirm) 625(defun dired-buffer-stale-p (&optional noconfirm)
627 "Return non-nil if current dired buffer needs updating. 626 "Return non-nil if current dired buffer needs updating.
diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el
index 547e2cbd32d..23e9a54b1bb 100644
--- a/lisp/emacs-lisp/testcover.el
+++ b/lisp/emacs-lisp/testcover.el
@@ -38,9 +38,9 @@
38;; instrumentation callbacks, then replace edebug's callbacks with ours. 38;; instrumentation callbacks, then replace edebug's callbacks with ours.
39;; * To show good coverage, we want to see two values for every form, except 39;; * To show good coverage, we want to see two values for every form, except
40;; functions that always return the same value and `defconst' variables 40;; functions that always return the same value and `defconst' variables
41;; need show only value for good coverage. To avoid the brown splotch, the 41;; need show only one value for good coverage. To avoid the brown
42;; definitions for constants and 1-valued functions must precede the 42;; splotch, the definitions for constants and 1-valued functions must
43;; references. 43;; precede the references.
44;; * Use the macro `1value' in your Lisp code to mark spots where the local 44;; * Use the macro `1value' in your Lisp code to mark spots where the local
45;; code environment causes a function or variable to always have the same 45;; code environment causes a function or variable to always have the same
46;; value, but the function or variable is not intrinsically 1-valued. 46;; value, but the function or variable is not intrinsically 1-valued.
@@ -55,12 +55,14 @@
55;; call has the same value! Also, equal thinks two strings are the same 55;; call has the same value! Also, equal thinks two strings are the same
56;; if they differ only in properties. 56;; if they differ only in properties.
57;; * Because we have only a "1value" class and no "always nil" class, we have 57;; * Because we have only a "1value" class and no "always nil" class, we have
58;; to treat as 1-valued any `and' whose last term is 1-valued, in case the 58;; to treat as potentially 1-valued any `and' whose last term is 1-valued,
59;; last term is always nil. Example: 59;; in case the last term is always nil. Example:
60;; (and (< (point) 1000) (forward-char 10)) 60;; (and (< (point) 1000) (forward-char 10))
61;; This form always returns nil. Similarly, `if' and `cond' are 61;; This form always returns nil. Similarly, `or', `if', and `cond' are
62;; treated as 1-valued if all clauses are, in case those values are 62;; treated as potentially 1-valued if all clauses are, in case those
63;; always nil. 63;; values are always nil. Unlike truly 1-valued functions, it is not an
64;; error if these "potentially" 1-valued forms actually return differing
65;; values.
64 66
65(require 'edebug) 67(require 'edebug)
66(provide 'testcover) 68(provide 'testcover)
@@ -86,12 +88,14 @@ these. This list is quite incomplete!"
86 88
87(defcustom testcover-1value-functions 89(defcustom testcover-1value-functions
88 '(backward-char barf-if-buffer-read-only beginning-of-line 90 '(backward-char barf-if-buffer-read-only beginning-of-line
89 buffer-disable-undo buffer-enable-undo current-global-map deactivate-mark 91 buffer-disable-undo buffer-enable-undo current-global-map
90 delete-char delete-region ding error forward-char function* insert 92 deactivate-mark delete-backward-char delete-char delete-region ding
91 insert-and-inherit kill-all-local-variables lambda mapc narrow-to-region 93 forward-char function* insert insert-and-inherit kill-all-local-variables
92 noreturn push-mark put-text-property run-hooks set-text-properties signal 94 kill-line kill-paragraph kill-region kill-sexp lambda
93 substitute-key-definition suppress-keymap throw undo use-local-map while 95 minibuffer-complete-and-exit narrow-to-region next-line push-mark
94 widen yank) 96 put-text-property run-hooks set-match-data signal
97 substitute-key-definition suppress-keymap undo use-local-map while widen
98 yank)
95 "Functions that always return the same value. No brown splotch is shown 99 "Functions that always return the same value. No brown splotch is shown
96for these. This list is quite incomplete! Notes: Nobody ever changes the 100for these. This list is quite incomplete! Notes: Nobody ever changes the
97current global map. The macro `lambda' is self-evaluating, hence always 101current global map. The macro `lambda' is self-evaluating, hence always
@@ -108,9 +112,9 @@ them as having returned nil just before calling them."
108 :type 'hook) 112 :type 'hook)
109 113
110(defcustom testcover-compose-functions 114(defcustom testcover-compose-functions
111 '(+ - * / length list make-keymap make-sparse-keymap message propertize 115 '(+ - * / = append length list make-keymap make-sparse-keymap
112 replace-regexp-in-string run-with-idle-timer 116 mapcar message propertize replace-regexp-in-string
113 set-buffer-modified-p) 117 run-with-idle-timer set-buffer-modified-p)
114 "Functions that are 1-valued if all their args are either constants or 118 "Functions that are 1-valued if all their args are either constants or
115calls to one of the `testcover-1value-functions', so if that's true then no 119calls to one of the `testcover-1value-functions', so if that's true then no
116brown splotch is shown for these. This list is quite incomplete! Most 120brown splotch is shown for these. This list is quite incomplete! Most
@@ -119,16 +123,16 @@ side-effect-free functions should be here."
119 :type 'hook) 123 :type 'hook)
120 124
121(defcustom testcover-progn-functions 125(defcustom testcover-progn-functions
122 '(define-key fset function goto-char or overlay-put progn save-current-buffer 126 '(define-key fset function goto-char mapc overlay-put progn
123 save-excursion save-match-data save-restriction save-selected-window 127 save-current-buffer save-excursion save-match-data
124 save-window-excursion set set-default setq setq-default 128 save-restriction save-selected-window save-window-excursion
125 with-output-to-temp-buffer with-syntax-table with-temp-buffer 129 set set-default set-marker-insertion-type setq setq-default
126 with-temp-file with-temp-message with-timeout) 130 with-current-buffer with-output-to-temp-buffer with-syntax-table
131 with-temp-buffer with-temp-file with-temp-message with-timeout)
127 "Functions whose return value is the same as their last argument. No 132 "Functions whose return value is the same as their last argument. No
128brown splotch is shown for these if the last argument is a constant or a 133brown splotch is shown for these if the last argument is a constant or a
129call to one of the `testcover-1value-functions'. This list is probably 134call to one of the `testcover-1value-functions'. This list is probably
130incomplete! Note: `or' is here in case the last argument is a function that 135incomplete!"
131always returns nil."
132 :group 'testcover 136 :group 'testcover
133 :type 'hook) 137 :type 'hook)
134 138
@@ -140,6 +144,11 @@ call to one of the `testcover-1value-functions'."
140 :group 'testcover 144 :group 'testcover
141 :type 'hook) 145 :type 'hook)
142 146
147(defcustom testcover-potentially-1value-functions
148 '(add-hook and beep or remove-hook unless when)
149 "Functions that are potentially 1-valued. No brown splotch if actually
1501-valued, no error if actually multi-valued.")
151
143(defface testcover-nohits-face 152(defface testcover-nohits-face
144 '((t (:background "DeepPink2"))) 153 '((t (:background "DeepPink2")))
145 "Face for forms that had no hits during coverage test" 154 "Face for forms that had no hits during coverage test"
@@ -161,7 +170,11 @@ call to one of the `testcover-1value-functions'."
161 170
162(defvar testcover-module-1value-functions nil 171(defvar testcover-module-1value-functions nil
163 "Symbols declared with defun in the last file processed by 172 "Symbols declared with defun in the last file processed by
164`testcover-start', whose functions always return the same value.") 173`testcover-start', whose functions should always return the same value.")
174
175(defvar testcover-module-potentially-1value-functions nil
176 "Symbols declared with defun in the last file processed by
177`testcover-start', whose functions might always return the same value.")
165 178
166(defvar testcover-vector nil 179(defvar testcover-vector nil
167 "Locally bound to coverage vector for function in progress.") 180 "Locally bound to coverage vector for function in progress.")
@@ -206,25 +219,32 @@ non-nil, byte-compiles each function after instrumenting."
206 x)) 219 x))
207 220
208(defun testcover-reinstrument (form) 221(defun testcover-reinstrument (form)
209 "Reinstruments FORM to use testcover instead of edebug. This function 222 "Reinstruments FORM to use testcover instead of edebug. This
210modifies the list that FORM points to. Result is non-nil if FORM will 223function modifies the list that FORM points to. Result is nil if
211always return the same value." 224FORM should return multiple vlues, t if should always return same
225value, 'maybe if either is acceptable."
212 (let ((fun (car-safe form)) 226 (let ((fun (car-safe form))
213 id) 227 id val)
214 (cond 228 (cond
215 ((not fun) ;Atom 229 ((not fun) ;Atom
216 (or (not (symbolp form)) 230 (when (or (not (symbolp form))
217 (memq form testcover-constants) 231 (memq form testcover-constants)
218 (memq form testcover-module-constants))) 232 (memq form testcover-module-constants))
219 ((consp fun) ;Embedded list 233 t))
234 ((consp fun) ;Embedded list
220 (testcover-reinstrument fun) 235 (testcover-reinstrument fun)
221 (testcover-reinstrument-list (cdr form)) 236 (testcover-reinstrument-list (cdr form))
222 nil) 237 nil)
223 ((or (memq fun testcover-1value-functions) 238 ((or (memq fun testcover-1value-functions)
224 (memq fun testcover-module-1value-functions)) 239 (memq fun testcover-module-1value-functions))
225 ;;Always return same value 240 ;;Should always return same value
226 (testcover-reinstrument-list (cdr form)) 241 (testcover-reinstrument-list (cdr form))
227 t) 242 t)
243 ((or (memq fun testcover-potentially-1value-functions)
244 (memq fun testcover-module-potentially-1value-functions))
245 ;;Might always return same value
246 (testcover-reinstrument-list (cdr form))
247 'maybe)
228 ((memq fun testcover-progn-functions) 248 ((memq fun testcover-progn-functions)
229 ;;1-valued if last argument is 249 ;;1-valued if last argument is
230 (testcover-reinstrument-list (cdr form))) 250 (testcover-reinstrument-list (cdr form)))
@@ -233,11 +253,9 @@ always return the same value."
233 (testcover-reinstrument-list (cddr form)) 253 (testcover-reinstrument-list (cddr form))
234 (testcover-reinstrument (cadr form))) 254 (testcover-reinstrument (cadr form)))
235 ((memq fun testcover-compose-functions) 255 ((memq fun testcover-compose-functions)
236 ;;1-valued if all arguments are 256 ;;1-valued if all arguments are. Potentially 1-valued if all
237 (setq id t) 257 ;;arguments are either definitely or potentially.
238 (mapc #'(lambda (x) (setq id (or (testcover-reinstrument x) id))) 258 (testcover-reinstrument-compose (cdr form) 'testcover-reinstrument))
239 (cdr form))
240 id)
241 ((eq fun 'edebug-enter) 259 ((eq fun 'edebug-enter)
242 ;;(edebug-enter 'SYM ARGS #'(lambda nil FORMS)) 260 ;;(edebug-enter 'SYM ARGS #'(lambda nil FORMS))
243 ;; => (testcover-enter 'SYM #'(lambda nil FORMS)) 261 ;; => (testcover-enter 'SYM #'(lambda nil FORMS))
@@ -252,33 +270,44 @@ always return the same value."
252 (aset testcover-vector (cadr (cadr form)) 'ok-coverage)) 270 (aset testcover-vector (cadr (cadr form)) 'ok-coverage))
253 (setq id (nth 2 form)) 271 (setq id (nth 2 form))
254 (setcdr form (nthcdr 2 form)) 272 (setcdr form (nthcdr 2 form))
273 (setq val (testcover-reinstrument (nth 2 form)))
274 (if (eq val t)
275 (setcar form 'testcover-1value)
276 (setcar form 'testcover-after))
277 (when val
278 ;;1-valued or potentially 1-valued
279 (aset testcover-vector id '1value))
255 (cond 280 (cond
256 ((memq (car-safe (nth 2 form)) testcover-noreturn-functions) 281 ((memq (car-safe (nth 2 form)) testcover-noreturn-functions)
257 ;;This function won't return, so set the value in advance 282 ;;This function won't return, so set the value in advance
258 ;;(edebug-after (edebug-before XXX) YYY FORM) 283 ;;(edebug-after (edebug-before XXX) YYY FORM)
259 ;; => (progn (edebug-after YYY nil) FORM) 284 ;; => (progn (edebug-after YYY nil) FORM)
285 (setcar (cdr form) `(,(car form) ,id nil))
260 (setcar form 'progn) 286 (setcar form 'progn)
261 (setcar (cdr form) `(testcover-after ,id nil))) 287 (aset testcover-vector id '1value)
288 (setq val t))
262 ((eq (car-safe (nth 2 form)) '1value) 289 ((eq (car-safe (nth 2 form)) '1value)
263 ;;This function is always supposed to return the same value 290 ;;This function is always supposed to return the same value
264 (setcar form 'testcover-1value)) 291 (setq val t)
265 (t 292 (aset testcover-vector id '1value)
266 (setcar form 'testcover-after))) 293 (setcar form 'testcover-1value)))
267 (when (testcover-reinstrument (nth 2 form)) 294 val)
268 (aset testcover-vector id '1value)))
269 ((eq fun 'defun) 295 ((eq fun 'defun)
270 (if (testcover-reinstrument-list (nthcdr 3 form)) 296 (setq val (testcover-reinstrument-list (nthcdr 3 form)))
271 (push (cadr form) testcover-module-1value-functions))) 297 (when (eq val t)
272 ((eq fun 'defconst) 298 (push (cadr form) testcover-module-1value-functions))
299 (when (eq val 'maybe)
300 (push (cadr form) testcover-module-potentially-1value-functions)))
301 ((memq fun '(defconst defcustom))
273 ;;Define this symbol as 1-valued 302 ;;Define this symbol as 1-valued
274 (push (cadr form) testcover-module-constants) 303 (push (cadr form) testcover-module-constants)
275 (testcover-reinstrument-list (cddr form))) 304 (testcover-reinstrument-list (cddr form)))
276 ((memq fun '(dotimes dolist)) 305 ((memq fun '(dotimes dolist))
277 ;;Always returns third value from SPEC 306 ;;Always returns third value from SPEC
278 (testcover-reinstrument-list (cddr form)) 307 (testcover-reinstrument-list (cddr form))
279 (setq fun (testcover-reinstrument-list (cadr form))) 308 (setq val (testcover-reinstrument-list (cadr form)))
280 (if (nth 2 (cadr form)) 309 (if (nth 2 (cadr form))
281 fun 310 val
282 ;;No third value, always returns nil 311 ;;No third value, always returns nil
283 t)) 312 t))
284 ((memq fun '(let let*)) 313 ((memq fun '(let let*))
@@ -286,23 +315,23 @@ always return the same value."
286 (mapc 'testcover-reinstrument-list (cadr form)) 315 (mapc 'testcover-reinstrument-list (cadr form))
287 (testcover-reinstrument-list (cddr form))) 316 (testcover-reinstrument-list (cddr form)))
288 ((eq fun 'if) 317 ((eq fun 'if)
289 ;;1-valued if both THEN and ELSE clauses are 318 ;;Potentially 1-valued if both THEN and ELSE clauses are
290 (testcover-reinstrument (cadr form)) 319 (testcover-reinstrument (cadr form))
291 (let ((then (testcover-reinstrument (nth 2 form))) 320 (let ((then (testcover-reinstrument (nth 2 form)))
292 (else (testcover-reinstrument-list (nthcdr 3 form)))) 321 (else (testcover-reinstrument-list (nthcdr 3 form))))
293 (and then else))) 322 (and then else 'maybe)))
294 ((memq fun '(when unless and))
295 ;;1-valued if last clause of BODY is
296 (testcover-reinstrument-list (cdr form)))
297 ((eq fun 'cond) 323 ((eq fun 'cond)
298 ;;1-valued if all clauses are 324 ;;Potentially 1-valued if all clauses are
299 (testcover-reinstrument-clauses (cdr form))) 325 (when (testcover-reinstrument-compose (cdr form)
326 'testcover-reinstrument-list)
327 'maybe))
300 ((eq fun 'condition-case) 328 ((eq fun 'condition-case)
301 ;;1-valued if BODYFORM is and all HANDLERS are 329 ;;Potentially 1-valued if BODYFORM is and all HANDLERS are
302 (let ((body (testcover-reinstrument (nth 2 form))) 330 (let ((body (testcover-reinstrument (nth 2 form)))
303 (errs (testcover-reinstrument-clauses (mapcar #'cdr 331 (errs (testcover-reinstrument-compose
304 (nthcdr 3 form))))) 332 (mapcar #'cdr (nthcdr 3 form))
305 (and body errs))) 333 'testcover-reinstrument-list)))
334 (and body errs 'maybe)))
306 ((eq fun 'quote) 335 ((eq fun 'quote)
307 ;;Don't reinstrument what's inside! 336 ;;Don't reinstrument what's inside!
308 ;;This doesn't apply within a backquote 337 ;;This doesn't apply within a backquote
@@ -317,16 +346,55 @@ always return the same value."
317 (let ((testcover-1value-functions 346 (let ((testcover-1value-functions
318 (remq 'quote testcover-1value-functions))) 347 (remq 'quote testcover-1value-functions)))
319 (testcover-reinstrument (cadr form)))) 348 (testcover-reinstrument (cadr form))))
320 ((memq fun '(1value noreturn)) 349 ((eq fun '1value)
321 ;;Hack - pretend the arg is 1-valued here 350 ;;Hack - pretend the arg is 1-valued here
322 (if (symbolp (cadr form)) ;A pseudoconstant variable 351 (cond
323 t 352 ((symbolp (cadr form))
353 ;;A pseudoconstant variable
354 t)
355 ((and (eq (car (cadr form)) 'edebug-after)
356 (symbolp (nth 3 (cadr form))))
357 ;;Reference to pseudoconstant
358 (aset testcover-vector (nth 2 (cadr form)) '1value)
359 (setcar (cdr form) `(testcover-1value ,(nth 2 (cadr form))
360 ,(nth 3 (cadr form))))
361 t)
362 (t
324 (if (eq (car (cadr form)) 'edebug-after) 363 (if (eq (car (cadr form)) 'edebug-after)
325 (setq id (car (nth 3 (cadr form)))) 364 (setq id (car (nth 3 (cadr form))))
326 (setq id (car (cadr form)))) 365 (setq id (car (cadr form))))
327 (let ((testcover-1value-functions 366 (let ((testcover-1value-functions
328 (cons id testcover-1value-functions))) 367 (cons id testcover-1value-functions)))
329 (testcover-reinstrument (cadr form))))) 368 (testcover-reinstrument (cadr form))))))
369 ((eq fun 'noreturn)
370 ;;Hack - pretend the arg has no return
371 (cond
372 ((symbolp (cadr form))
373 ;;A pseudoconstant variable
374 'maybe)
375 ((and (eq (car (cadr form)) 'edebug-after)
376 (symbolp (nth 3 (cadr form))))
377 ;;Reference to pseudoconstant
378 (aset testcover-vector (nth 2 (cadr form)) '1value)
379 (setcar (cdr form) `(progn (testcover-after ,(nth 2 (cadr form)) nil)
380 ,(nth 3 (cadr form))))
381 'maybe)
382 (t
383 (if (eq (car (cadr form)) 'edebug-after)
384 (setq id (car (nth 3 (cadr form))))
385 (setq id (car (cadr form))))
386 (let ((testcover-noreturn-functions
387 (cons id testcover-noreturn-functions)))
388 (testcover-reinstrument (cadr form))))))
389 ((and (eq fun 'apply)
390 (eq (car-safe (cadr form)) 'quote)
391 (symbolp (cadr (cadr form))))
392 ;;Apply of a constant symbol. Process as 1value or noreturn
393 ;;depending on symbol.
394 (setq fun (cons (cadr (cadr form)) (cddr form))
395 val (testcover-reinstrument fun))
396 (setcdr (cdr form) (cdr fun))
397 val)
330 (t ;Some other function or weird thing 398 (t ;Some other function or weird thing
331 (testcover-reinstrument-list (cdr form)) 399 (testcover-reinstrument-list (cdr form))
332 nil)))) 400 nil))))
@@ -341,13 +409,22 @@ always be nil, so we return t for 1-valued."
341 (setq result (testcover-reinstrument (pop list)))) 409 (setq result (testcover-reinstrument (pop list))))
342 result)) 410 result))
343 411
344(defun testcover-reinstrument-clauses (clauselist) 412(defun testcover-reinstrument-compose (list fun)
345 "Reinstrument each list in CLAUSELIST. 413 "For a compositional function, the result is 1-valued if all
346Result is t if every clause is 1-valued." 414arguments are, potentially 1-valued if all arguments are either
415definitely or potentially 1-valued, and multi-valued otherwise.
416FUN should be `testcover-reinstrument' for compositional functions,
417 `testcover-reinstrument-list' for clauses in a `cond'."
347 (let ((result t)) 418 (let ((result t))
348 (mapc #'(lambda (x) 419 (mapc #'(lambda (x)
349 (setq result (and (testcover-reinstrument-list x) result))) 420 (setq x (funcall fun x))
350 clauselist) 421 (cond
422 ((eq result t)
423 (setq result x))
424 ((eq result 'maybe)
425 (when (not x)
426 (setq result nil)))))
427 list)
351 result)) 428 result))
352 429
353(defun testcover-end (buffer) 430(defun testcover-end (buffer)
@@ -387,7 +464,7 @@ same value during coverage testing."
387 (aset testcover-vector idx (cons '1value val))) 464 (aset testcover-vector idx (cons '1value val)))
388 ((not (and (eq (car-safe (aref testcover-vector idx)) '1value) 465 ((not (and (eq (car-safe (aref testcover-vector idx)) '1value)
389 (equal (cdr (aref testcover-vector idx)) val))) 466 (equal (cdr (aref testcover-vector idx)) val)))
390 (error "Value of form marked with `1value' does vary."))) 467 (error "Value of form marked with `1value' does vary: %s" val)))
391 val) 468 val)
392 469
393 470
@@ -415,7 +492,7 @@ eliminated by adding more test cases."
415 ov j item) 492 ov j item)
416 (or (and def-mark points coverage) 493 (or (and def-mark points coverage)
417 (error "Missing edebug data for function %s" def)) 494 (error "Missing edebug data for function %s" def))
418 (when len 495 (when (> len 0)
419 (set-buffer (marker-buffer def-mark)) 496 (set-buffer (marker-buffer def-mark))
420 (mapc 'delete-overlay 497 (mapc 'delete-overlay
421 (overlays-in def-mark (+ def-mark (aref points (1- len)) 1))) 498 (overlays-in def-mark (+ def-mark (aref points (1- len)) 1)))
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 51b47b104d0..b39945c7712 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -974,6 +974,13 @@ Extra commands should be added to `cua-movement-commands'")
974(defvar cua-movement-commands nil 974(defvar cua-movement-commands nil
975 "User may add additional movement commands to this list.") 975 "User may add additional movement commands to this list.")
976 976
977(defvar cua--preserve-mark-commands
978 '(end-of-buffer beginning-of-buffer)
979 "List of movement commands that move the mark.
980CUA will preserve the previous mark position if a mark is already
981active before one of these commands is executed.")
982
983(defvar cua--undo-push-mark nil)
977 984
978;;; Scrolling commands which does not signal errors at top/bottom 985;;; Scrolling commands which does not signal errors at top/bottom
979;;; of buffer at first key-press (instead moves to top/bottom 986;;; of buffer at first key-press (instead moves to top/bottom
@@ -1062,8 +1069,15 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1062 ;; If rectangle is active, expand rectangle in specified direction and ignore the movement. 1069 ;; If rectangle is active, expand rectangle in specified direction and ignore the movement.
1063 (if movement 1070 (if movement
1064 (cond 1071 (cond
1065 ((memq 'shift (event-modifiers (aref (this-single-command-raw-keys) 0))) 1072 ((memq 'shift (event-modifiers
1066 (unless mark-active 1073 (aref (if window-system
1074 (this-single-command-raw-keys)
1075 (this-single-command-keys)) 0)))
1076 (if mark-active
1077 (if (and (memq this-command cua--preserve-mark-commands)
1078 (not inhibit-mark-movement))
1079 (setq cua--undo-push-mark t
1080 inhibit-mark-movement t))
1067 (push-mark-command nil t)) 1081 (push-mark-command nil t))
1068 (setq cua--last-region-shifted t) 1082 (setq cua--last-region-shifted t)
1069 (setq cua--explicit-region-start nil)) 1083 (setq cua--explicit-region-start nil))
@@ -1110,6 +1124,9 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1110(defun cua--post-command-handler () 1124(defun cua--post-command-handler ()
1111 (condition-case nil 1125 (condition-case nil
1112 (progn 1126 (progn
1127 (when cua--undo-push-mark
1128 (setq cua--undo-push-mark nil
1129 inhibit-mark-movement nil))
1113 (when cua--global-mark-active 1130 (when cua--global-mark-active
1114 (cua--global-mark-post-command)) 1131 (cua--global-mark-post-command))
1115 (when (fboundp 'cua--rectangle-post-command) 1132 (when (fboundp 'cua--rectangle-post-command)
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 238d0c4fdf7..3592a6ac779 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -693,7 +693,7 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
693 ;; If the keywords were compiled before, compile them again. 693 ;; If the keywords were compiled before, compile them again.
694 (if was-compiled 694 (if was-compiled
695 (set (make-local-variable 'font-lock-keywords) 695 (set (make-local-variable 'font-lock-keywords)
696 (font-lock-compile-keywords keywords t))))))) 696 (font-lock-compile-keywords font-lock-keywords t)))))))
697 697
698(defun font-lock-update-removed-keyword-alist (mode keywords append) 698(defun font-lock-update-removed-keyword-alist (mode keywords append)
699 ;; Update `font-lock-removed-keywords-alist' when adding new 699 ;; Update `font-lock-removed-keywords-alist' when adding new
@@ -801,7 +801,7 @@ subtle problems due to details of the implementation."
801 ;; If the keywords were compiled before, compile them again. 801 ;; If the keywords were compiled before, compile them again.
802 (if was-compiled 802 (if was-compiled
803 (set (make-local-variable 'font-lock-keywords) 803 (set (make-local-variable 'font-lock-keywords)
804 (font-lock-compile-keywords keywords t))))))) 804 (font-lock-compile-keywords font-lock-keywords t)))))))
805 805
806;;; Font Lock Support mode. 806;;; Font Lock Support mode.
807 807
@@ -1944,12 +1944,12 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
1944 '("when" "unless" "case" "ecase" "typecase" "etypecase" 1944 '("when" "unless" "case" "ecase" "typecase" "etypecase"
1945 "ccase" "ctypecase" "handler-case" "handler-bind" 1945 "ccase" "ctypecase" "handler-case" "handler-bind"
1946 "restart-bind" "restart-case" "in-package" 1946 "restart-bind" "restart-case" "in-package"
1947 "cerror" "break" "ignore-errors" 1947 "break" "ignore-errors"
1948 "loop" "do" "do*" "dotimes" "dolist" "the" "locally" 1948 "loop" "do" "do*" "dotimes" "dolist" "the" "locally"
1949 "proclaim" "declaim" "declare" "symbol-macrolet" 1949 "proclaim" "declaim" "declare" "symbol-macrolet"
1950 "lexical-let" "lexical-let*" "flet" "labels" "compiler-let" 1950 "lexical-let" "lexical-let*" "flet" "labels" "compiler-let"
1951 "destructuring-bind" "macrolet" "tagbody" "block" 1951 "destructuring-bind" "macrolet" "tagbody" "block" "go"
1952 "multiple-value-bind" 1952 "multiple-value-bind" "multiple-value-prog1"
1953 "return" "return-from" 1953 "return" "return-from"
1954 "with-accessors" "with-compilation-unit" 1954 "with-accessors" "with-compilation-unit"
1955 "with-condition-restarts" "with-hash-table-iterator" 1955 "with-condition-restarts" "with-hash-table-iterator"
@@ -1967,7 +1967,7 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
1967 '(2 font-lock-constant-face nil t)) 1967 '(2 font-lock-constant-face nil t))
1968 ;; 1968 ;;
1969 ;; Erroneous structures. 1969 ;; Erroneous structures.
1970 '("(\\(abort\\|assert\\|error\\|signal\\)\\>" 1 font-lock-warning-face) 1970 '("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\>" 1 font-lock-warning-face)
1971 ;; 1971 ;;
1972 ;; Words inside \\[] tend to be for `substitute-command-keys'. 1972 ;; Words inside \\[] tend to be for `substitute-command-keys'.
1973 '("\\\\\\\\\\[\\(\\sw+\\)]" 1 font-lock-constant-face prepend) 1973 '("\\\\\\\\\\[\\(\\sw+\\)]" 1 font-lock-constant-face prepend)
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el
index 4644d36ad25..b5ec6f02260 100644
--- a/lisp/mail/footnote.el
+++ b/lisp/mail/footnote.el
@@ -87,8 +87,11 @@ If nil, no blank line will be inserted."
87 87
88;;; Interface variables that probably shouldn't be changed 88;;; Interface variables that probably shouldn't be changed
89 89
90(defconst footnote-section-tag "Footnotes: " 90(defcustom footnote-section-tag "Footnotes: "
91 "*Tag inserted at beginning of footnote section.") 91 "*Tag inserted at beginning of footnote section."
92 :version "21.4"
93 :type 'string
94 :group 'footnote)
92 95
93(defcustom footnote-section-tag-regexp "Footnotes\\(\\[.\\]\\)?: " 96(defcustom footnote-section-tag-regexp "Footnotes\\(\\[.\\]\\)?: "
94 "*Regexp which indicates the start of a footnote section. 97 "*Regexp which indicates the start of a footnote section.
diff --git a/lisp/mh-e/mh-loaddefs.el b/lisp/mh-e/mh-loaddefs.el
index 9b2423dcda9..a5578760845 100644
--- a/lisp/mh-e/mh-loaddefs.el
+++ b/lisp/mh-e/mh-loaddefs.el
@@ -180,7 +180,7 @@ are removed." t nil)
180;;;*** 180;;;***
181 181
182;;;### (autoloads (mh-goto-cur-msg mh-update-sequences mh-folder-line-matches-show-buffer-p) 182;;;### (autoloads (mh-goto-cur-msg mh-update-sequences mh-folder-line-matches-show-buffer-p)
183;;;;;; "mh-e" "mh-e.el" (16627 18152)) 183;;;;;; "mh-e" "mh-e.el" (16627 22341))
184;;; Generated autoloads from mh-e.el 184;;; Generated autoloads from mh-e.el
185 185
186(autoload (quote mh-folder-line-matches-show-buffer-p) "mh-e" "\ 186(autoload (quote mh-folder-line-matches-show-buffer-p) "mh-e" "\
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index cca01d169b6..6a888d9d75d 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1012,7 +1012,7 @@ Domain names in USER and port numbers in HOST are acknowledged."
1012 (when real-user 1012 (when real-user
1013 (let ((pw-prompt "Password:")) 1013 (let ((pw-prompt "Password:"))
1014 (tramp-message 9 "Sending password") 1014 (tramp-message 9 "Sending password")
1015 (tramp-enter-password p pw-prompt))) 1015 (tramp-enter-password p pw-prompt user host)))
1016 1016
1017 (unless (tramp-smb-wait-for-output user host) 1017 (unless (tramp-smb-wait-for-output user host)
1018 (tramp-clear-passwd user host) 1018 (tramp-clear-passwd user host)
diff --git a/lisp/net/tramp-vc.el b/lisp/net/tramp-vc.el
index 839a8702dd9..e720deb8f07 100644
--- a/lisp/net/tramp-vc.el
+++ b/lisp/net/tramp-vc.el
@@ -77,7 +77,7 @@
77 "Like `vc-do-command' but invoked for tramp files. 77 "Like `vc-do-command' but invoked for tramp files.
78See `vc-do-command' for more information." 78See `vc-do-command' for more information."
79 (save-match-data 79 (save-match-data
80 (and file (setq file (tramp-handle-expand-file-name file))) 80 (and file (setq file (expand-file-name file)))
81 (if (not buffer) (setq buffer "*vc*")) 81 (if (not buffer) (setq buffer "*vc*"))
82 (if vc-command-messages 82 (if vc-command-messages
83 (message "Running `%s' on `%s'..." command file)) 83 (message "Running `%s' on `%s'..." command file))
@@ -85,7 +85,7 @@ See `vc-do-command' for more information."
85 (squeezed nil) 85 (squeezed nil)
86 (olddir default-directory) 86 (olddir default-directory)
87 vc-file status) 87 vc-file status)
88 (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) 88 (let* ((v (tramp-dissect-file-name (expand-file-name file)))
89 (multi-method (tramp-file-name-multi-method v)) 89 (multi-method (tramp-file-name-multi-method v))
90 (method (tramp-file-name-method v)) 90 (method (tramp-file-name-method v))
91 (user (tramp-file-name-user v)) 91 (user (tramp-file-name-user v))
@@ -130,7 +130,7 @@ See `vc-do-command' for more information."
130 (save-excursion 130 (save-excursion
131 (save-window-excursion 131 (save-window-excursion
132 ;; Actually execute remote command 132 ;; Actually execute remote command
133 (tramp-handle-shell-command 133 (shell-command
134 (mapconcat 'tramp-shell-quote-argument 134 (mapconcat 'tramp-shell-quote-argument
135 (cons command squeezed) " ") t) 135 (cons command squeezed) " ") t)
136 ;;(tramp-wait-for-output) 136 ;;(tramp-wait-for-output)
@@ -190,7 +190,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either."
190 (let ((w32-quote-process-args t)) 190 (let ((w32-quote-process-args t))
191 (when (eq okstatus 'async) 191 (when (eq okstatus 'async)
192 (message "Tramp doesn't do async commands, running synchronously.")) 192 (message "Tramp doesn't do async commands, running synchronously."))
193 (setq status (tramp-handle-shell-command 193 (setq status (shell-command
194 (mapconcat 'tramp-shell-quote-argument 194 (mapconcat 'tramp-shell-quote-argument
195 (cons command squeezed) " ") t)) 195 (cons command squeezed) " ") t))
196 (when (or (not (integerp status)) 196 (when (or (not (integerp status))
@@ -257,7 +257,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either."
257 ;; Don't switch to the *vc-info* buffer before running the 257 ;; Don't switch to the *vc-info* buffer before running the
258 ;; command, because that would change its default directory 258 ;; command, because that would change its default directory
259 (save-match-data 259 (save-match-data
260 (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) 260 (let* ((v (tramp-dissect-file-name (expand-file-name file)))
261 (multi-method (tramp-file-name-multi-method v)) 261 (multi-method (tramp-file-name-multi-method v))
262 (method (tramp-file-name-method v)) 262 (method (tramp-file-name-method v))
263 (user (tramp-file-name-user v)) 263 (user (tramp-file-name-user v))
@@ -284,7 +284,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either."
284 (save-excursion 284 (save-excursion
285 (save-window-excursion 285 (save-window-excursion
286 ;; Actually execute remote command 286 ;; Actually execute remote command
287 (tramp-handle-shell-command 287 (shell-command
288 (mapconcat 'tramp-shell-quote-argument 288 (mapconcat 'tramp-shell-quote-argument
289 (append (list command) args (list localname)) " ") 289 (append (list command) args (list localname)) " ")
290 (get-buffer-create"*vc-info*")) 290 (get-buffer-create"*vc-info*"))
@@ -414,7 +414,7 @@ filename we are thinking about..."
414 (nth 2 (file-attributes file))))) 414 (nth 2 (file-attributes file)))))
415 (if (and uid (/= uid remote-uid)) 415 (if (and uid (/= uid remote-uid))
416 (error "tramp-handle-vc-user-login-name cannot map a uid to a name") 416 (error "tramp-handle-vc-user-login-name cannot map a uid to a name")
417 (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) 417 (let* ((v (tramp-dissect-file-name (expand-file-name file)))
418 (u (tramp-file-name-user v))) 418 (u (tramp-file-name-user v)))
419 (cond ((stringp u) u) 419 (cond ((stringp u) u)
420 ((vectorp u) (elt u (1- (length u)))) 420 ((vectorp u) (elt u (1- (length u))))
@@ -445,8 +445,8 @@ filename we are thinking about..."
445(defun tramp-file-owner (filename) 445(defun tramp-file-owner (filename)
446 "Return who owns FILE (user name, as a string)." 446 "Return who owns FILE (user name, as a string)."
447 (let ((v (tramp-dissect-file-name 447 (let ((v (tramp-dissect-file-name
448 (tramp-handle-expand-file-name filename)))) 448 (expand-file-name filename))))
449 (if (not (tramp-handle-file-exists-p filename)) 449 (if (not (file-exists-p filename))
450 nil ; file cannot be opened 450 nil ; file cannot be opened
451 ;; file exists, find out stuff 451 ;; file exists, find out stuff
452 (save-excursion 452 (save-excursion
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 0414859c7eb..02b076483c1 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -916,8 +916,8 @@ The answer will be provided by `tramp-action-terminal', which see."
916 "Regular expression indicating a process has finished. 916 "Regular expression indicating a process has finished.
917In fact this expression is empty by intention, it will be used only to 917In fact this expression is empty by intention, it will be used only to
918check regularly the status of the associated process. 918check regularly the status of the associated process.
919The answer will be provided by `tramp-action-process-alive' and 919The answer will be provided by `tramp-action-process-alive',
920`tramp-action-out-of-band', which see." 920`tramp-multi-action-process-alive' and`tramp-action-out-of-band', which see."
921 :group 'tramp 921 :group 'tramp
922 :type 'regexp) 922 :type 'regexp)
923 923
@@ -1321,7 +1321,7 @@ See `tramp-actions-before-shell' for more info."
1321 (shell-prompt-pattern tramp-multi-action-succeed) 1321 (shell-prompt-pattern tramp-multi-action-succeed)
1322 (tramp-shell-prompt-pattern tramp-multi-action-succeed) 1322 (tramp-shell-prompt-pattern tramp-multi-action-succeed)
1323 (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied) 1323 (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied)
1324 (tramp-process-alive-regexp tramp-action-process-alive)) 1324 (tramp-process-alive-regexp tramp-multi-action-process-alive))
1325 "List of pattern/action pairs. 1325 "List of pattern/action pairs.
1326This list is used for each hop in multi-hop connections. 1326This list is used for each hop in multi-hop connections.
1327See `tramp-actions-before-shell' for more info." 1327See `tramp-actions-before-shell' for more info."
@@ -2165,7 +2165,7 @@ target of the symlink differ."
2165 (let ((nonnumeric (and id-format (equal id-format 'string))) 2165 (let ((nonnumeric (and id-format (equal id-format 'string)))
2166 result) 2166 result)
2167 (with-parsed-tramp-file-name filename nil 2167 (with-parsed-tramp-file-name filename nil
2168 (when (tramp-handle-file-exists-p filename) 2168 (when (file-exists-p filename)
2169 ;; file exists, find out stuff 2169 ;; file exists, find out stuff
2170 (save-excursion 2170 (save-excursion
2171 (if (tramp-get-remote-perl multi-method method user host) 2171 (if (tramp-get-remote-perl multi-method method user host)
@@ -2331,7 +2331,12 @@ If it doesn't exist, generate a new one."
2331;; This function makes the same assumption as 2331;; This function makes the same assumption as
2332;; `tramp-handle-set-visited-file-modtime'. 2332;; `tramp-handle-set-visited-file-modtime'.
2333(defun tramp-handle-verify-visited-file-modtime (buf) 2333(defun tramp-handle-verify-visited-file-modtime (buf)
2334 "Like `verify-visited-file-modtime' for tramp files." 2334 "Like `verify-visited-file-modtime' for tramp files.
2335At the time `verify-visited-file-modtime' calls this function, we
2336already know that the buffer is visiting a file and that
2337`visited-file-modtime' does not return 0. Do not call this
2338function directly, unless those two cases are already taken care
2339of."
2335 (with-current-buffer buf 2340 (with-current-buffer buf
2336 (let ((f (buffer-file-name))) 2341 (let ((f (buffer-file-name)))
2337 (with-parsed-tramp-file-name f nil 2342 (with-parsed-tramp-file-name f nil
@@ -2343,7 +2348,14 @@ If it doesn't exist, generate a new one."
2343 ;; (HIGH . LOW)? 2348 ;; (HIGH . LOW)?
2344 (let ((mt (visited-file-modtime))) 2349 (let ((mt (visited-file-modtime)))
2345 (< (abs (tramp-time-diff 2350 (< (abs (tramp-time-diff
2346 modtime (list (car mt) (cdr mt)))) 2))) 2351 modtime
2352 ;; For compatibility, deal with both the old
2353 ;; (HIGH . LOW) and the new (HIGH LOW)
2354 ;; return values of `visited-file-modtime'.
2355 (if (atom (cdr mt))
2356 (list (car mt) (cdr mt))
2357 mt)))
2358 2)))
2347 (attr 2359 (attr
2348 (save-excursion 2360 (save-excursion
2349 (tramp-send-command 2361 (tramp-send-command
@@ -2502,19 +2514,19 @@ if the remote host can't provide the modtime."
2502(defun tramp-handle-file-writable-p (filename) 2514(defun tramp-handle-file-writable-p (filename)
2503 "Like `file-writable-p' for tramp files." 2515 "Like `file-writable-p' for tramp files."
2504 (with-parsed-tramp-file-name filename nil 2516 (with-parsed-tramp-file-name filename nil
2505 (if (tramp-handle-file-exists-p filename) 2517 (if (file-exists-p filename)
2506 ;; Existing files must be writable. 2518 ;; Existing files must be writable.
2507 (zerop (tramp-run-test "-w" filename)) 2519 (zerop (tramp-run-test "-w" filename))
2508 ;; If file doesn't exist, check if directory is writable. 2520 ;; If file doesn't exist, check if directory is writable.
2509 (and (zerop (tramp-run-test 2521 (and (zerop (tramp-run-test
2510 "-d" (tramp-handle-file-name-directory filename))) 2522 "-d" (file-name-directory filename)))
2511 (zerop (tramp-run-test 2523 (zerop (tramp-run-test
2512 "-w" (tramp-handle-file-name-directory filename))))))) 2524 "-w" (file-name-directory filename)))))))
2513 2525
2514(defun tramp-handle-file-ownership-preserved-p (filename) 2526(defun tramp-handle-file-ownership-preserved-p (filename)
2515 "Like `file-ownership-preserved-p' for tramp files." 2527 "Like `file-ownership-preserved-p' for tramp files."
2516 (with-parsed-tramp-file-name filename nil 2528 (with-parsed-tramp-file-name filename nil
2517 (or (not (tramp-handle-file-exists-p filename)) 2529 (or (not (file-exists-p filename))
2518 ;; Existing files must be writable. 2530 ;; Existing files must be writable.
2519 (zerop (tramp-run-test "-O" filename))))) 2531 (zerop (tramp-run-test "-O" filename)))))
2520 2532
@@ -3057,7 +3069,7 @@ This is like `dired-recursive-delete-directory' for tramp files."
3057 (with-parsed-tramp-file-name filename nil 3069 (with-parsed-tramp-file-name filename nil
3058 ;; run a shell command 'rm -r <localname>' 3070 ;; run a shell command 'rm -r <localname>'
3059 ;; Code shamelessly stolen for the dired implementation and, um, hacked :) 3071 ;; Code shamelessly stolen for the dired implementation and, um, hacked :)
3060 (or (tramp-handle-file-exists-p filename) 3072 (or (file-exists-p filename)
3061 (signal 3073 (signal
3062 'file-error 3074 'file-error
3063 (list "Removing old file name" "no such directory" filename))) 3075 (list "Removing old file name" "no such directory" filename)))
@@ -3068,7 +3080,7 @@ This is like `dired-recursive-delete-directory' for tramp files."
3068 ;; This might take a while, allow it plenty of time. 3080 ;; This might take a while, allow it plenty of time.
3069 (tramp-wait-for-output 120) 3081 (tramp-wait-for-output 120)
3070 ;; Make sure that it worked... 3082 ;; Make sure that it worked...
3071 (and (tramp-handle-file-exists-p filename) 3083 (and (file-exists-p filename)
3072 (error "Failed to recusively delete %s" filename)))) 3084 (error "Failed to recusively delete %s" filename))))
3073 3085
3074(defun tramp-handle-dired-call-process (program discard &rest arguments) 3086(defun tramp-handle-dired-call-process (program discard &rest arguments)
@@ -3600,45 +3612,47 @@ This will break if COMMAND prints a newline, followed by the value of
3600 3612
3601(defun tramp-handle-find-backup-file-name (filename) 3613(defun tramp-handle-find-backup-file-name (filename)
3602 "Like `find-backup-file-name' for tramp files." 3614 "Like `find-backup-file-name' for tramp files."
3615 (with-parsed-tramp-file-name filename nil
3616 ;; We set both variables. It doesn't matter whether it is
3617 ;; Emacs or XEmacs
3618 (let ((backup-directory-alist
3619 ;; Emacs case
3620 (when (boundp 'backup-directory-alist)
3621 (if (boundp 'tramp-backup-directory-alist)
3622 (mapcar
3623 '(lambda (x)
3624 (cons
3625 (car x)
3626 (if (and (stringp (cdr x))
3627 (file-name-absolute-p (cdr x))
3628 (not (tramp-file-name-p (cdr x))))
3629 (tramp-make-tramp-file-name
3630 multi-method method user host (cdr x))
3631 (cdr x))))
3632 (symbol-value 'tramp-backup-directory-alist))
3633 (symbol-value 'backup-directory-alist))))
3634
3635 (bkup-backup-directory-info
3636 ;; XEmacs case
3637 (when (boundp 'bkup-backup-directory-info)
3638 (if (boundp 'tramp-bkup-backup-directory-info)
3639 (mapcar
3640 '(lambda (x)
3641 (nconc
3642 (list (car x))
3643 (list
3644 (if (and (stringp (car (cdr x)))
3645 (file-name-absolute-p (car (cdr x)))
3646 (not (tramp-file-name-p (car (cdr x)))))
3647 (tramp-make-tramp-file-name
3648 multi-method method user host (car (cdr x)))
3649 (car (cdr x))))
3650 (cdr (cdr x))))
3651 (symbol-value 'tramp-bkup-backup-directory-info))
3652 (symbol-value 'bkup-backup-directory-info)))))
3653
3654 (tramp-run-real-handler 'find-backup-file-name (list filename)))))
3603 3655
3604 (if (or (and (not (featurep 'xemacs))
3605 (not (boundp 'tramp-backup-directory-alist)))
3606 (and (featurep 'xemacs)
3607 (not (boundp 'tramp-bkup-backup-directory-info))))
3608
3609 ;; No tramp backup directory alist defined, or nil
3610 (tramp-run-real-handler 'find-backup-file-name (list filename))
3611
3612 (with-parsed-tramp-file-name filename nil
3613 (let* ((backup-var
3614 (copy-tree
3615 (if (featurep 'xemacs)
3616 ;; XEmacs case
3617 (symbol-value 'tramp-bkup-backup-directory-info)
3618 ;; Emacs case
3619 (symbol-value 'tramp-backup-directory-alist))))
3620
3621 ;; We set both variables. It doesn't matter whether it is
3622 ;; Emacs or XEmacs
3623 (backup-directory-alist backup-var)
3624 (bkup-backup-directory-info backup-var))
3625
3626 (mapcar
3627 '(lambda (x)
3628 (let ((dir (if (consp (cdr x)) (car (cdr x)) (cdr x))))
3629 (when (and (stringp dir)
3630 (file-name-absolute-p dir)
3631 (not (tramp-file-name-p dir)))
3632 ;; Prepend absolute directory names with tramp prefix
3633 (if (consp (cdr x))
3634 (setcar (cdr x)
3635 (tramp-make-tramp-file-name
3636 multi-method method user host dir))
3637 (setcdr x (tramp-make-tramp-file-name
3638 multi-method method user host dir))))))
3639 backup-var)
3640
3641 (tramp-run-real-handler 'find-backup-file-name (list filename))))))
3642 3656
3643;; CCC grok APPEND, LOCKNAME, CONFIRM 3657;; CCC grok APPEND, LOCKNAME, CONFIRM
3644(defun tramp-handle-write-region 3658(defun tramp-handle-write-region
@@ -3682,6 +3696,9 @@ This will break if COMMAND prints a newline, followed by the value of
3682 ;; use an encoding function, but currently we use it always 3696 ;; use an encoding function, but currently we use it always
3683 ;; because this makes the logic simpler. 3697 ;; because this makes the logic simpler.
3684 (setq tmpfil (tramp-make-temp-file)) 3698 (setq tmpfil (tramp-make-temp-file))
3699 ;; Set current buffer. If connection wasn't open, `file-modes' has
3700 ;; changed it accidently.
3701 (set-buffer curbuf)
3685 ;; We say `no-message' here because we don't want the visited file 3702 ;; We say `no-message' here because we don't want the visited file
3686 ;; modtime data to be clobbered from the temp file. We call 3703 ;; modtime data to be clobbered from the temp file. We call
3687 ;; `set-visited-file-modtime' ourselves later on. 3704 ;; `set-visited-file-modtime' ourselves later on.
@@ -3965,14 +3982,50 @@ Falls back to normal file name handler if no tramp file name handler exists."
3965 (foreign (apply foreign operation args)) 3982 (foreign (apply foreign operation args))
3966 (t (tramp-run-real-handler operation args)))))) 3983 (t (tramp-run-real-handler operation args))))))
3967 3984
3985
3986;; In Emacs, there is some concurrency due to timers. If a timer
3987;; interrupts Tramp and wishes to use the same connection buffer as
3988;; the "main" Emacs, then garbage might occur in the connection
3989;; buffer. Therefore, we need to make sure that a timer does not use
3990;; the same connection buffer as the "main" Emacs. We implement a
3991;; cheap global lock, instead of locking each connection buffer
3992;; separately. The global lock is based on two variables,
3993;; `tramp-locked' and `tramp-locker'. `tramp-locked' is set to true
3994;; (with setq) to indicate a lock. But Tramp also calls itself during
3995;; processing of a single file operation, so we need to allow
3996;; recursive calls. That's where the `tramp-locker' variable comes in
3997;; -- it is let-bound to t during the execution of the current
3998;; handler. So if `tramp-locked' is t and `tramp-locker' is also t,
3999;; then we should just proceed because we have been called
4000;; recursively. But if `tramp-locker' is nil, then we are a timer
4001;; interrupting the "main" Emacs, and then we signal an error.
4002
4003(defvar tramp-locked nil
4004 "If non-nil, then Tramp is currently busy.
4005Together with `tramp-locker', this implements a locking mechanism
4006preventing reentrant calls of Tramp.")
4007
4008(defvar tramp-locker nil
4009 "If non-nil, then a caller has locked Tramp.
4010Together with `tramp-locked', this implements a locking mechanism
4011preventing reentrant calls of Tramp.")
4012
3968(defun tramp-sh-file-name-handler (operation &rest args) 4013(defun tramp-sh-file-name-handler (operation &rest args)
3969 "Invoke remote-shell Tramp file name handler. 4014 "Invoke remote-shell Tramp file name handler.
3970Fall back to normal file name handler if no Tramp handler exists." 4015Fall back to normal file name handler if no Tramp handler exists."
3971 (save-match-data 4016 (when (and tramp-locked (not tramp-locker))
3972 (let ((fn (assoc operation tramp-file-name-handler-alist))) 4017 (signal 'file-error "Forbidden reentrant call of Tramp"))
3973 (if fn 4018 (let ((tl tramp-locked))
3974 (apply (cdr fn) args) 4019 (unwind-protect
3975 (tramp-run-real-handler operation args))))) 4020 (progn
4021 (setq tramp-locked t)
4022 (let ((tramp-locker t))
4023 (save-match-data
4024 (let ((fn (assoc operation tramp-file-name-handler-alist)))
4025 (if fn
4026 (apply (cdr fn) args)
4027 (tramp-run-real-handler operation args))))))
4028 (setq tramp-locked tl))))
3976 4029
3977;;;###autoload 4030;;;###autoload
3978(defun tramp-completion-file-name-handler (operation &rest args) 4031(defun tramp-completion-file-name-handler (operation &rest args)
@@ -4055,7 +4108,7 @@ necessary anymore."
4055 (tramp-make-tramp-file-name multi-method method 4108 (tramp-make-tramp-file-name multi-method method
4056 user host x))) 4109 user host x)))
4057 (read (current-buffer)))))) 4110 (read (current-buffer))))))
4058 (list (tramp-handle-expand-file-name name)))))) 4111 (list (expand-file-name name))))))
4059 4112
4060;; Check for complete.el and override PC-expand-many-files if appropriate. 4113;; Check for complete.el and override PC-expand-many-files if appropriate.
4061(eval-and-compile 4114(eval-and-compile
@@ -4066,7 +4119,7 @@ necessary anymore."
4066 (symbol-function 'PC-expand-many-files)) 4119 (symbol-function 'PC-expand-many-files))
4067 (defun PC-expand-many-files (name) 4120 (defun PC-expand-many-files (name)
4068 (if (tramp-tramp-file-p name) 4121 (if (tramp-tramp-file-p name)
4069 (tramp-handle-expand-many-files name) 4122 (expand-many-files name)
4070 (tramp-save-PC-expand-many-files name)))) 4123 (tramp-save-PC-expand-many-files name))))
4071 4124
4072;; Why isn't eval-after-load sufficient? 4125;; Why isn't eval-after-load sufficient?
@@ -4817,17 +4870,17 @@ file exists and nonzero exit status otherwise."
4817 ;; `/usr/bin/test -e' In case `/bin/test' does not exist. 4870 ;; `/usr/bin/test -e' In case `/bin/test' does not exist.
4818 (unless (or 4871 (unless (or
4819 (and (setq tramp-file-exists-command "test -e %s") 4872 (and (setq tramp-file-exists-command "test -e %s")
4820 (tramp-handle-file-exists-p existing) 4873 (file-exists-p existing)
4821 (not (tramp-handle-file-exists-p nonexisting))) 4874 (not (file-exists-p nonexisting)))
4822 (and (setq tramp-file-exists-command "/bin/test -e %s") 4875 (and (setq tramp-file-exists-command "/bin/test -e %s")
4823 (tramp-handle-file-exists-p existing) 4876 (file-exists-p existing)
4824 (not (tramp-handle-file-exists-p nonexisting))) 4877 (not (file-exists-p nonexisting)))
4825 (and (setq tramp-file-exists-command "/usr/bin/test -e %s") 4878 (and (setq tramp-file-exists-command "/usr/bin/test -e %s")
4826 (tramp-handle-file-exists-p existing) 4879 (file-exists-p existing)
4827 (not (tramp-handle-file-exists-p nonexisting))) 4880 (not (file-exists-p nonexisting)))
4828 (and (setq tramp-file-exists-command "ls -d %s") 4881 (and (setq tramp-file-exists-command "ls -d %s")
4829 (tramp-handle-file-exists-p existing) 4882 (file-exists-p existing)
4830 (not (tramp-handle-file-exists-p nonexisting)))) 4883 (not (file-exists-p nonexisting))))
4831 (error "Couldn't find command to check if file exists.")))) 4884 (error "Couldn't find command to check if file exists."))))
4832 4885
4833 4886
@@ -4889,9 +4942,8 @@ file exists and nonzero exit status otherwise."
4889METHOD, USER and HOST specify the connection, CMD (the absolute file name of) 4942METHOD, USER and HOST specify the connection, CMD (the absolute file name of)
4890the `ls' executable. Returns t if CMD supports the `-n' option, nil 4943the `ls' executable. Returns t if CMD supports the `-n' option, nil
4891otherwise." 4944otherwise."
4892 (tramp-message 9 "Checking remote `%s' command for `-n' option" 4945 (tramp-message 9 "Checking remote `%s' command for `-n' option" cmd)
4893 cmd) 4946 (when (file-executable-p
4894 (when (tramp-handle-file-executable-p
4895 (tramp-make-tramp-file-name multi-method method user host cmd)) 4947 (tramp-make-tramp-file-name multi-method method user host cmd))
4896 (let ((result nil)) 4948 (let ((result nil))
4897 (tramp-message 7 "Testing remote command `%s' for -n..." cmd) 4949 (tramp-message 7 "Testing remote command `%s' for -n..." cmd)
@@ -4949,7 +5001,7 @@ Returns nil if none was found, else the command is returned."
4949 "Query the user for a password." 5001 "Query the user for a password."
4950 (let ((pw-prompt (match-string 0))) 5002 (let ((pw-prompt (match-string 0)))
4951 (tramp-message 9 "Sending password") 5003 (tramp-message 9 "Sending password")
4952 (tramp-enter-password p pw-prompt))) 5004 (tramp-enter-password p pw-prompt user host)))
4953 5005
4954(defun tramp-action-succeed (p multi-method method user host) 5006(defun tramp-action-succeed (p multi-method method user host)
4955 "Signal success in finding shell prompt." 5007 "Signal success in finding shell prompt."
@@ -5027,7 +5079,7 @@ The terminal type can be configured with `tramp-terminal-type'."
5027(defun tramp-multi-action-password (p method user host) 5079(defun tramp-multi-action-password (p method user host)
5028 "Query the user for a password." 5080 "Query the user for a password."
5029 (tramp-message 9 "Sending password") 5081 (tramp-message 9 "Sending password")
5030 (tramp-enter-password p (match-string 0))) 5082 (tramp-enter-password p (match-string 0) user host))
5031 5083
5032(defun tramp-multi-action-succeed (p method user host) 5084(defun tramp-multi-action-succeed (p method user host)
5033 "Signal success in finding shell prompt." 5085 "Signal success in finding shell prompt."
@@ -5042,6 +5094,11 @@ The terminal type can be configured with `tramp-terminal-type'."
5042 (erase-buffer) 5094 (erase-buffer)
5043 (throw 'tramp-action 'permission-denied)) 5095 (throw 'tramp-action 'permission-denied))
5044 5096
5097(defun tramp-multi-action-process-alive (p method user host)
5098 "Check whether a process has finished."
5099 (unless (memq (process-status p) '(run open))
5100 (throw 'tramp-action 'process-died)))
5101
5045;; Functions for processing the actions. 5102;; Functions for processing the actions.
5046 5103
5047(defun tramp-process-one-action (p multi-method method user host actions) 5104(defun tramp-process-one-action (p multi-method method user host actions)
@@ -5239,12 +5296,13 @@ arguments, and xx will be used as the host name to connect to.
5239 (login-args (tramp-get-method-parameter 5296 (login-args (tramp-get-method-parameter
5240 multi-method 5297 multi-method
5241 (tramp-find-method multi-method method user host) 5298 (tramp-find-method multi-method method user host)
5242 user host 'tramp-login-args))) 5299 user host 'tramp-login-args))
5300 (real-host host))
5243 ;; The following should be changed. We need a more general 5301 ;; The following should be changed. We need a more general
5244 ;; mechanism to parse extra host args. 5302 ;; mechanism to parse extra host args.
5245 (when (string-match "\\([^#]*\\)#\\(.*\\)" host) 5303 (when (string-match "\\([^#]*\\)#\\(.*\\)" host)
5246 (setq login-args (cons "-p" (cons (match-string 2 host) login-args))) 5304 (setq login-args (cons "-p" (cons (match-string 2 host) login-args)))
5247 (setq host (match-string 1 host))) 5305 (setq real-host (match-string 1 host)))
5248 (setenv "TERM" tramp-terminal-type) 5306 (setenv "TERM" tramp-terminal-type)
5249 (let* ((default-directory (tramp-temporary-file-directory)) 5307 (let* ((default-directory (tramp-temporary-file-directory))
5250 ;; If we omit the conditional, we would use 5308 ;; If we omit the conditional, we would use
@@ -5255,9 +5313,9 @@ arguments, and xx will be used as the host name to connect to.
5255 tramp-dos-coding-system)) 5313 tramp-dos-coding-system))
5256 (p (if (and user (not (string= user ""))) 5314 (p (if (and user (not (string= user "")))
5257 (apply #'start-process bufnam buf login-program 5315 (apply #'start-process bufnam buf login-program
5258 host "-l" user login-args) 5316 real-host "-l" user login-args)
5259 (apply #'start-process bufnam buf login-program 5317 (apply #'start-process bufnam buf login-program
5260 host login-args))) 5318 real-host login-args)))
5261 (found nil)) 5319 (found nil))
5262 (tramp-set-process-query-on-exit-flag p nil) 5320 (tramp-set-process-query-on-exit-flag p nil)
5263 5321
@@ -5540,10 +5598,10 @@ seconds. If not, it produces an error message with the given ERROR-ARGS."
5540 (pop-to-buffer (buffer-name)) 5598 (pop-to-buffer (buffer-name))
5541 (apply 'error error-args))) 5599 (apply 'error error-args)))
5542 5600
5543(defun tramp-enter-password (p prompt) 5601(defun tramp-enter-password (p prompt user host)
5544 "Prompt for a password and send it to the remote end. 5602 "Prompt for a password and send it to the remote end.
5545Uses PROMPT as a prompt and sends the password to process P." 5603Uses PROMPT as a prompt and sends the password to process P."
5546 (let ((pw (tramp-read-passwd prompt))) 5604 (let ((pw (tramp-read-passwd user host prompt)))
5547 (erase-buffer) 5605 (erase-buffer)
5548 (process-send-string 5606 (process-send-string
5549 p (concat pw 5607 p (concat pw
@@ -6710,16 +6768,11 @@ this is the function `temp-directory'."
6710 "`temp-directory' is defined -- using /tmp.")) 6768 "`temp-directory' is defined -- using /tmp."))
6711 (file-name-as-directory "/tmp")))) 6769 (file-name-as-directory "/tmp"))))
6712 6770
6713(defun tramp-read-passwd (prompt) 6771(defun tramp-read-passwd (user host prompt)
6714 "Read a password from user (compat function). 6772 "Read a password from user (compat function).
6715Invokes `password-read' if available, `read-passwd' else." 6773Invokes `password-read' if available, `read-passwd' else."
6716 (if (functionp 'password-read) 6774 (if (functionp 'password-read)
6717 (let* ((user (or tramp-current-user (user-login-name))) 6775 (let* ((key (concat (or user (user-login-name)) "@" host))
6718 (host (or tramp-current-host (system-name)))
6719 (key (if (and (stringp user) (stringp host))
6720 (concat user "@" host)
6721 (concat "[" (mapconcat 'identity user "/") "]@["
6722 (mapconcat 'identity host "/") "]")))
6723 (password (apply #'password-read (list prompt key)))) 6776 (password (apply #'password-read (list prompt key))))
6724 (apply #'password-cache-add (list key password)) 6777 (apply #'password-cache-add (list key password))
6725 password) 6778 password)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index a871380d06f..5b678f26171 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -414,7 +414,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
414(defun grep (command-args &optional highlight-regexp) 414(defun grep (command-args &optional highlight-regexp)
415 "Run grep, with user-specified args, and collect output in a buffer. 415 "Run grep, with user-specified args, and collect output in a buffer.
416While grep runs asynchronously, you can use \\[next-error] (M-x next-error), 416While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
417or \\<grep-minor-mode-map>\\[compile-goto-error] in the grep \ 417or \\<grep-mode-map>\\[compile-goto-error] in the grep \
418output buffer, to go to the lines 418output buffer, to go to the lines
419where grep found matches. 419where grep found matches.
420 420
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index fef159d850f..87df0769314 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -99,7 +99,33 @@ Zero means compute the Imenu menu regardless of size."
99 :group 'which-func 99 :group 'which-func
100 :type 'integer) 100 :type 'integer)
101 101
102(defcustom which-func-format '("[" which-func-current "]") 102(defvar which-func-keymap
103 (let ((map (make-sparse-keymap)))
104 (define-key map [mode-line mouse-1] 'beginning-of-defun)
105 (define-key map [mode-line mouse-2]
106 (lambda ()
107 (interactive)
108 (if (eq (point-min) 1)
109 (narrow-to-defun)
110 (widen))))
111 (define-key map [mode-line mouse-3] 'end-of-defun)
112 map)
113 "Keymap to display on mode line which-func.")
114
115(defface which-func-face
116 '((t (:inherit font-lock-function-name-face)))
117 "Face used to highlight mode line function names.
118Defaults to `font-lock-function-name-face' if font-lock is loaded."
119 :group 'which-func)
120
121(defcustom which-func-format
122 `("["
123 (:propertize which-func-current
124 local-map ,which-func-keymap
125 face which-func-face
126 ;;mouse-face highlight ; currently not evaluated :-(
127 help-echo "mouse-1: go to beginning, mouse-2: toggle rest visibility, mouse-3: go to end")
128 "]")
103 "Format for displaying the function in the mode line." 129 "Format for displaying the function in the mode line."
104 :group 'which-func 130 :group 'which-func
105 :type 'sexp) 131 :type 'sexp)
diff --git a/lisp/replace.el b/lisp/replace.el
index 60c28d6c48a..f81c6f53914 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -786,7 +786,8 @@ If the value is nil, don't highlight the buffer names specially."
786 nil 786 nil
787 nil 787 nil
788 nil 788 nil
789 'regexp-history))) 789 'regexp-history
790 default)))
790 (if (equal input "") 791 (if (equal input "")
791 default 792 default
792 input)) 793 input))
diff --git a/lisp/simple.el b/lisp/simple.el
index 74e2d6d82b7..bf57c41b1c1 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -562,9 +562,13 @@ If BACKWARD-ONLY is non-nil, only delete spaces before point."
562 (skip-chars-forward " \t") 562 (skip-chars-forward " \t")
563 (constrain-to-field nil orig-pos t))))) 563 (constrain-to-field nil orig-pos t)))))
564 564
565(defvar inhibit-mark-movement nil
566 "If non-nil, \\[beginning-of-buffer] and \\[end-of-buffer] does not set the mark.")
567
565(defun beginning-of-buffer (&optional arg) 568(defun beginning-of-buffer (&optional arg)
566 "Move point to the beginning of the buffer; leave mark at previous position. 569 "Move point to the beginning of the buffer; leave mark at previous position.
567With arg N, put point N/10 of the way from the beginning. 570With \\[universal-argument] prefix, do not set mark at previous position.
571With numeric arg N, put point N/10 of the way from the beginning.
568 572
569If the buffer is narrowed, this command uses the beginning and size 573If the buffer is narrowed, this command uses the beginning and size
570of the accessible part of the buffer. 574of the accessible part of the buffer.
@@ -572,9 +576,10 @@ of the accessible part of the buffer.
572Don't use this command in Lisp programs! 576Don't use this command in Lisp programs!
573\(goto-char (point-min)) is faster and avoids clobbering the mark." 577\(goto-char (point-min)) is faster and avoids clobbering the mark."
574 (interactive "P") 578 (interactive "P")
575 (push-mark) 579 (unless (or inhibit-mark-movement (consp arg))
580 (push-mark))
576 (let ((size (- (point-max) (point-min)))) 581 (let ((size (- (point-max) (point-min))))
577 (goto-char (if arg 582 (goto-char (if (and arg (not (consp arg)))
578 (+ (point-min) 583 (+ (point-min)
579 (if (> size 10000) 584 (if (> size 10000)
580 ;; Avoid overflow for large buffer sizes! 585 ;; Avoid overflow for large buffer sizes!
@@ -586,7 +591,8 @@ Don't use this command in Lisp programs!
586 591
587(defun end-of-buffer (&optional arg) 592(defun end-of-buffer (&optional arg)
588 "Move point to the end of the buffer; leave mark at previous position. 593 "Move point to the end of the buffer; leave mark at previous position.
589With arg N, put point N/10 of the way from the end. 594With \\[universal-argument] prefix, do not set mark at previous position.
595With numeric arg N, put point N/10 of the way from the end.
590 596
591If the buffer is narrowed, this command uses the beginning and size 597If the buffer is narrowed, this command uses the beginning and size
592of the accessible part of the buffer. 598of the accessible part of the buffer.
@@ -594,9 +600,10 @@ of the accessible part of the buffer.
594Don't use this command in Lisp programs! 600Don't use this command in Lisp programs!
595\(goto-char (point-max)) is faster and avoids clobbering the mark." 601\(goto-char (point-max)) is faster and avoids clobbering the mark."
596 (interactive "P") 602 (interactive "P")
597 (push-mark) 603 (unless (or inhibit-mark-movement (consp arg))
604 (push-mark))
598 (let ((size (- (point-max) (point-min)))) 605 (let ((size (- (point-max) (point-min))))
599 (goto-char (if arg 606 (goto-char (if (and arg (not (consp arg)))
600 (- (point-max) 607 (- (point-max)
601 (if (> size 10000) 608 (if (> size 10000)
602 ;; Avoid overflow for large buffer sizes! 609 ;; Avoid overflow for large buffer sizes!
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index cdf120e7a41..3e8fc5df417 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,30 @@
12004-07-17 Richard M. Stallman <rms@gnu.org>
2
3 * display.texi (Overlay Properties): Adding `evaporate' prop
4 deletes empty overlay immediately.
5
6 * abbrevs.texi (Abbrev Expansion): Clarify pre-abbrev-expand-hook,
7 fix example.
8
92004-07-16 Jim Blandy <jimb@redhat.com>
10
11 * searching.texi (Regexp Backslash): Document new \_< and \_>
12 operators.
13
142004-07-16 Juanma Barranquero <lektu@terra.es>
15
16 * display.texi (Images): Fix Texinfo usage.
17
182004-07-14 Luc Teirlinck <teirllm@auburn.edu>
19
20 * buffers.texi (Modification Time): `visited-file-modtime' now
21 returns a list of two integers, instead of a cons.
22
232004-07-13 Luc Teirlinck <teirllm@auburn.edu>
24
25 * windows.texi: Various changes in addition to:
26 (Splitting Windows): Add `split-window-keep-point'.
27
12004-07-09 Richard M. Stallman <rms@gnu.org> 282004-07-09 Richard M. Stallman <rms@gnu.org>
2 29
3 * frames.texi (Input Focus): Minor fix. 30 * frames.texi (Input Focus): Minor fix.
diff --git a/lispref/abbrevs.texi b/lispref/abbrevs.texi
index ff6cdf77c2e..d586d0bbc13 100644
--- a/lispref/abbrevs.texi
+++ b/lispref/abbrevs.texi
@@ -335,10 +335,9 @@ abbrev lookup happens.
335@end defvar 335@end defvar
336 336
337 The following sample code shows a simple use of 337 The following sample code shows a simple use of
338@code{pre-abbrev-expand-hook}. If the user terminates an abbrev with a 338@code{pre-abbrev-expand-hook}. If the user terminates an abbrev with
339punctuation character, the hook function asks for confirmation. Thus, 339a punctuation character, the hook function asks for confirmation. It
340this hook allows the user to decide whether to expand the abbrev, and 340aborts expansion if the user does not confirm.
341aborts expansion if it is not confirmed.
342 341
343@smallexample 342@smallexample
344(add-hook 'pre-abbrev-expand-hook 'query-if-not-space) 343(add-hook 'pre-abbrev-expand-hook 'query-if-not-space)
@@ -350,12 +349,10 @@ aborts expansion if it is not confirmed.
350;; @r{user entered some other character, this function asks whether} 349;; @r{user entered some other character, this function asks whether}
351;; @r{expansion should continue.} 350;; @r{expansion should continue.}
352 351
353;; @r{If the user answers the prompt with @kbd{y}, the function returns} 352;; @r{The function's return value makes no difference.}
354;; @r{@code{nil} (because of the @code{not} function), but that is}
355;; @r{acceptable; the return value has no effect on expansion.}
356 353
357(defun query-if-not-space () 354(defun query-if-not-space ()
358 (if (/= ?\s (preceding-char)) 355 (if (/= ?\s last-command-char)
359 (if (not (y-or-n-p "Do you want to expand this abbrev? ")) 356 (if (not (y-or-n-p "Do you want to expand this abbrev? "))
360 (error "Not expanding this abbrev")))) 357 (error "Not expanding this abbrev"))))
361@end smallexample 358@end smallexample
diff --git a/lispref/buffers.texi b/lispref/buffers.texi
index 8391159c088..d39a0746fe1 100644
--- a/lispref/buffers.texi
+++ b/lispref/buffers.texi
@@ -625,9 +625,9 @@ file should not be done.
625@c Emacs 19 feature 625@c Emacs 19 feature
626@defun visited-file-modtime 626@defun visited-file-modtime
627This function returns the current buffer's recorded last file 627This function returns the current buffer's recorded last file
628modification time, as a list of the form @code{(@var{high} . 628modification time, as a list of the form @code{(@var{high} @var{low})}.
629@var{low})}. (This is the same format that @code{file-attributes} 629(This is the same format that @code{file-attributes} uses to return
630uses to return time values; see @ref{File Attributes}.) 630time values; see @ref{File Attributes}.)
631 631
632The function returns zero if the buffer has no recorded last 632The function returns zero if the buffer has no recorded last
633modification time, which can happen, for instance, if the record has 633modification time, which can happen, for instance, if the record has
diff --git a/lispref/display.texi b/lispref/display.texi
index b6fd015beba..fb9d7c79e0e 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -1165,9 +1165,9 @@ sense---only on the screen.
1165@item evaporate 1165@item evaporate
1166@kindex evaporate @r{(overlay property)} 1166@kindex evaporate @r{(overlay property)}
1167If this property is non-@code{nil}, the overlay is deleted automatically 1167If this property is non-@code{nil}, the overlay is deleted automatically
1168if it becomes empty (i.e., if its length becomes zero). However, 1168if it becomes empty (i.e., if its length becomes zero). If you give
1169if the overlay is @emph{already} empty, @code{evaporate} does not 1169an empty overlay a non-@code{nil} @code{evaporate} property, that deletes
1170delete it. 1170it immediately.
1171 1171
1172@item local-map 1172@item local-map
1173@cindex keymap of character (and overlays) 1173@cindex keymap of character (and overlays)
@@ -2907,7 +2907,7 @@ To know which image types are really available, use
2907This in an alist of image types vs external libraries needed to 2907This in an alist of image types vs external libraries needed to
2908display them. 2908display them.
2909 2909
2910Each element is a list @code{(@var{IMAGE-TYPE} @var{LIBRARY}...)}, 2910Each element is a list @code{(@var{image-type} @var{library}...)},
2911where the car is a supported image format from @code{image-types}, and 2911where the car is a supported image format from @code{image-types}, and
2912the rest are strings giving alternate filenames for the corresponding 2912the rest are strings giving alternate filenames for the corresponding
2913external libraries to load. 2913external libraries to load.
@@ -2924,9 +2924,10 @@ into Emacs.
2924@defun image-type-available-p type 2924@defun image-type-available-p type
2925@findex image-type-available-p 2925@findex image-type-available-p
2926 2926
2927This function returns non-nil if image type @var{TYPE} is available, 2927This function returns non-@code{nil} if image type @var{type} is
2928i.e., if images of this type can be loaded and displayed in Emacs. 2928available, i.e., if images of this type can be loaded and displayed in
2929@var{TYPE} should be one of the types contained in @code{image-types}. 2929Emacs. @var{type} should be one of the types contained in
2930@code{image-types}.
2930 2931
2931For image types whose support libraries are statically linked, this 2932For image types whose support libraries are statically linked, this
2932function always returns @code{t}; for other image types, it returns 2933function always returns @code{t}; for other image types, it returns
diff --git a/lispref/searching.texi b/lispref/searching.texi
index 4a2703fd640..fd0d0e172a0 100644
--- a/lispref/searching.texi
+++ b/lispref/searching.texi
@@ -666,6 +666,19 @@ word-constituent character follows.
666matches the empty string, but only at the end of a word. @samp{\>} 666matches the empty string, but only at the end of a word. @samp{\>}
667matches at the end of the buffer (or string) only if the contents end 667matches at the end of the buffer (or string) only if the contents end
668with a word-constituent character. 668with a word-constituent character.
669
670@item \_<
671@cindex @samp{\_<} in regexp
672matches the empty string, but only at the beginning of a symbol. A
673symbol is a sequence of one or more word or symbol constituent
674characters. @samp{\_<} matches at the beginning of the buffer (or
675string) only if a symbol-constituent character follows.
676
677@item \_>
678@cindex @samp{\_>} in regexp
679matches the empty string, but only at the end of a symbol. @samp{\_>}
680matches at the end of the buffer (or string) only if the contents end
681with a symbol-constituent character.
669@end table 682@end table
670 683
671@kindex invalid-regexp 684@kindex invalid-regexp
diff --git a/lispref/windows.texi b/lispref/windows.texi
index 01d7d3bfb4b..92eb6cbc85d 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -158,7 +158,6 @@ This function splits @var{window} into two windows. The original
158window @var{window} remains the selected window, but occupies only 158window @var{window} remains the selected window, but occupies only
159part of its former screen area. The rest is occupied by a newly created 159part of its former screen area. The rest is occupied by a newly created
160window which is returned as the value of this function. 160window which is returned as the value of this function.
161This function returns the newly created window.
162 161
163If @var{horizontal} is non-@code{nil}, then @var{window} splits into 162If @var{horizontal} is non-@code{nil}, then @var{window} splits into
164two side by side windows. The original window @var{window} keeps the 163two side by side windows. The original window @var{window} keeps the
@@ -272,12 +271,34 @@ This function splits the selected window into two windows, one above the
272other, leaving the upper of the two windows selected, with @var{size} 271other, leaving the upper of the two windows selected, with @var{size}
273lines. (If @var{size} is negative, then the lower of the two windows 272lines. (If @var{size} is negative, then the lower of the two windows
274gets @minus{} @var{size} lines and the upper window gets the rest, but 273gets @minus{} @var{size} lines and the upper window gets the rest, but
275the upper window is still the one selected.) 274the upper window is still the one selected.) However, if
275@code{split-window-keep-point} (see below) is @code{nil}, then either
276window can be selected.
277
278In other respects, this function is similar to @code{split-window}.
279In particular, the upper window is the original one and the return
280value is the new, lower window.
276@end deffn 281@end deffn
277 282
283@defopt split-window-keep-point
284If this variable is non-@code{nil} (the default), then
285@code{split-window-vertically} behaves as described above.
286
287If it is @code{nil}, then @code{split-window-vertically} adjusts point
288in each of the two windows to avoid scrolling. (This is useful on
289slow terminals.) It selects whichever window contains the screen line
290that point was previously on.
291
292This variable only affects the behavior of @code{split-window-vertically}.
293It has no effect on the other functions described here.
294@end defopt
295
278@deffn Command split-window-horizontally &optional size 296@deffn Command split-window-horizontally &optional size
279This function splits the selected window into two windows 297This function splits the selected window into two windows
280side-by-side, leaving the selected window with @var{size} columns. 298side-by-side, leaving the selected window on the left with @var{size}
299columns. If @var{size} is negative, the rightmost window gets
300@minus{} @var{size} columns, but the leftmost window still remains
301selected.
281 302
282This function is basically an interface to @code{split-window}. 303This function is basically an interface to @code{split-window}.
283You could define a simplified version of the function like this: 304You could define a simplified version of the function like this:
@@ -364,17 +385,19 @@ deleting the other windows in that frame. If @var{window} is omitted or
364The return value is @code{nil}. 385The return value is @code{nil}.
365@end deffn 386@end deffn
366 387
367@deffn Command delete-windows-on buffer &optional frame 388@deffn Command delete-windows-on buffer-or-name &optional frame
368This function deletes all windows showing @var{buffer}. If there are 389This function deletes all windows showing @var{buffer-or-name}. If
369no windows showing @var{buffer}, it does nothing. 390there are no windows showing @var{buffer-or-name}, it does nothing.
391@var{buffer-or-name} must be a buffer or the name of an existing
392buffer.
370 393
371@code{delete-windows-on} operates frame by frame. If a frame has 394@code{delete-windows-on} operates frame by frame. If a frame has
372several windows showing different buffers, then those showing 395several windows showing different buffers, then those showing
373@var{buffer} are removed, and the others expand to fill the space. If 396@var{buffer-or-name} are removed, and the others expand to fill the
374all windows in some frame are showing @var{buffer} (including the case 397space. If all windows in some frame are showing @var{buffer-or-name}
375where there is only one window), then the frame reverts to having a 398(including the case where there is only one window), then the frame
376single window showing another buffer chosen with @code{other-buffer}. 399winds up with a single window showing another buffer chosen with
377@xref{The Buffer List}. 400@code{other-buffer}. @xref{The Buffer List}.
378 401
379The argument @var{frame} controls which frames to operate on. This 402The argument @var{frame} controls which frames to operate on. This
380function does not use it in quite the same way as the other functions 403function does not use it in quite the same way as the other functions
@@ -412,8 +435,9 @@ which the cursor appears and to which many commands apply.
412 435
413@defun select-window window &optional norecord 436@defun select-window window &optional norecord
414This function makes @var{window} the selected window. The cursor then 437This function makes @var{window} the selected window. The cursor then
415appears in @var{window} (on redisplay). The buffer being displayed in 438appears in @var{window} (on redisplay). Unless @var{window} was
416@var{window} is immediately designated the current buffer. 439already selected, @code{select-window} makes @var{window}'s buffer the
440current buffer.
417 441
418Normally @var{window}'s selected buffer is moved to the front of the 442Normally @var{window}'s selected buffer is moved to the front of the
419buffer list, but if @var{norecord} is non-@code{nil}, the buffer list 443buffer list, but if @var{norecord} is non-@code{nil}, the buffer list
@@ -431,14 +455,18 @@ The return value is @var{window}.
431@end defun 455@end defun
432 456
433@defmac save-selected-window forms@dots{} 457@defmac save-selected-window forms@dots{}
434This macro records the selected window of each frame, executes 458This macro records the selected window, as well as the selected window
435@var{forms} in sequence, then restores the earlier selected windows. 459of each frame, executes @var{forms} in sequence, then restores the
460earlier selected windows. It returns the value of the last form in
461@var{forms}.
436 462
437This macro does not save or restore anything about the sizes, 463This macro does not save or restore anything about the sizes,
438arrangement or contents of windows; therefore, if the @var{forms} 464arrangement or contents of windows; therefore, if the @var{forms}
439change them, the change persists. If the previously selected window 465change them, the change persists. If the previously selected window
440of some frame is no longer live at the time of exit from this form, 466of some frame is no longer live at the time of exit from @var{forms},
441that frame's selected window is left alone. 467that frame's selected window is left alone. If the previously
468selected window is no longer live, then whatever window is selected at
469the end of @var{forms} remains selected.
442@end defmac 470@end defmac
443 471
444@defmac with-selected-window window forms@dots{} 472@defmac with-selected-window window forms@dots{}
@@ -446,7 +474,7 @@ This macro selects @var{window} (without changing the buffer list),
446executes @var{forms} in sequence, then restores the previously 474executes @var{forms} in sequence, then restores the previously
447selected window (unless that window is no longer alive). It is similar 475selected window (unless that window is no longer alive). It is similar
448to @code{save-selected-window} except that it explicitly selects 476to @code{save-selected-window} except that it explicitly selects
449@var{window} and that it does not alter the buffer list sequence. 477@var{window}, without altering the buffer list sequence.
450@end defmac 478@end defmac
451 479
452@cindex finding windows 480@cindex finding windows
@@ -556,7 +584,9 @@ are the possible values and their meanings:
556@table @asis 584@table @asis
557@item @code{nil} 585@item @code{nil}
558Consider all the windows in @var{window}'s frame, plus the minibuffer 586Consider all the windows in @var{window}'s frame, plus the minibuffer
559used by that frame even if it lies in some other frame. 587used by that frame even if it lies in some other frame. If the
588minibuffer counts (as determined by @var{minibuf}), then all windows on
589all frames that share that minibuffer count too.
560 590
561@item @code{t} 591@item @code{t}
562Consider all windows in all existing frames. 592Consider all windows in all existing frames.
@@ -658,9 +688,10 @@ when you need complete control.
658 688
659@defun set-window-buffer window buffer-or-name &optional keep-margins 689@defun set-window-buffer window buffer-or-name &optional keep-margins
660This function makes @var{window} display @var{buffer-or-name} as its 690This function makes @var{window} display @var{buffer-or-name} as its
661contents. It returns @code{nil}. This is the fundamental primitive 691contents. It returns @code{nil}. @var{buffer-or-name} must be a
662for changing which buffer is displayed in a window, and all ways 692buffer, or the name of an existing buffer. This is the fundamental
663of doing that call this function. 693primitive for changing which buffer is displayed in a window, and all
694ways of doing that call this function.
664 695
665@example 696@example
666@group 697@group
@@ -770,7 +801,8 @@ the current buffer but does not display it in the selected window.
770If @var{buffer-or-name} does not identify an existing buffer, then a new 801If @var{buffer-or-name} does not identify an existing buffer, then a new
771buffer by that name is created. The major mode for the new buffer is 802buffer by that name is created. The major mode for the new buffer is
772set according to the variable @code{default-major-mode}. @xref{Auto 803set according to the variable @code{default-major-mode}. @xref{Auto
773Major Mode}. 804Major Mode}. If @var{buffer-or-name} is @code{nil},
805@code{switch-to-buffer} chooses a buffer using @code{other-buffer}.
774 806
775Normally the specified buffer is put at the front of the buffer list 807Normally the specified buffer is put at the front of the buffer list
776(both the selected frame's buffer list and the frame-independent buffer 808(both the selected frame's buffer list and the frame-independent buffer
@@ -783,6 +815,9 @@ the binding of @kbd{C-x b}. It is also used frequently in programs. It
783returns the buffer that it switched to. 815returns the buffer that it switched to.
784@end deffn 816@end deffn
785 817
818The next two functions are similar to @code{switch-to-buffer}, except
819for the described features.
820
786@deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord 821@deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord
787This function makes @var{buffer-or-name} the current buffer and 822This function makes @var{buffer-or-name} the current buffer and
788displays it in a window not currently selected. It then selects that 823displays it in a window not currently selected. It then selects that
@@ -842,12 +877,12 @@ This function updates the buffer list just like @code{switch-to-buffer}
842unless @var{norecord} is non-@code{nil}. 877unless @var{norecord} is non-@code{nil}.
843@end defun 878@end defun
844 879
845@deffn Command replace-buffer-in-windows buffer 880@deffn Command replace-buffer-in-windows buffer-or-name
846This function replaces @var{buffer} with some other buffer in all 881This function replaces @var{buffer-or-name} with some other buffer in all
847windows displaying it. The other buffer used is chosen with 882windows displaying it. It chooses the other buffer with
848@code{other-buffer}. In the usual applications of this function, you 883@code{other-buffer}. In the usual applications of this function, you
849don't care which other buffer is used; you just want to make sure that 884don't care which other buffer is used; you just want to make sure that
850@var{buffer} is no longer displayed. 885@var{buffer-or-name} is no longer displayed.
851 886
852This function returns @code{nil}. 887This function returns @code{nil}.
853@end deffn 888@end deffn
@@ -864,7 +899,8 @@ functions and commands use this subroutine. Here we describe how to use
864This command makes @var{buffer-or-name} appear in some window, like 899This command makes @var{buffer-or-name} appear in some window, like
865@code{pop-to-buffer}, but it does not select that window and does not 900@code{pop-to-buffer}, but it does not select that window and does not
866make the buffer current. The identity of the selected window is 901make the buffer current. The identity of the selected window is
867unaltered by this function. 902unaltered by this function. @var{buffer-or-name} must be a buffer, or
903the name of an existing buffer.
868 904
869If @var{not-this-window} is non-@code{nil}, it means to display the 905If @var{not-this-window} is non-@code{nil}, it means to display the
870specified buffer in a window other than the selected one, even if it is 906specified buffer in a window other than the selected one, even if it is
@@ -885,6 +921,7 @@ values of @var{frame}:
885@itemize @bullet 921@itemize @bullet
886@item 922@item
887If it is @code{nil}, consider windows on the selected frame. 923If it is @code{nil}, consider windows on the selected frame.
924(Actually, the last non-minibuffer frame.)
888@item 925@item
889If it is @code{t}, consider windows on all frames. 926If it is @code{t}, consider windows on all frames.
890@item 927@item
@@ -1017,7 +1054,7 @@ create the frame. See above, under @code{special-display-buffer-names}.
1017This function returns non-@code{nil} if displaying a buffer 1054This function returns non-@code{nil} if displaying a buffer
1018named @var{buffer-name} with @code{display-buffer} would 1055named @var{buffer-name} with @code{display-buffer} would
1019create a special frame. The value is @code{t} if it would 1056create a special frame. The value is @code{t} if it would
1020use the default frame paramaters, or else the specified list 1057use the default frame parameters, or else the specified list
1021of frame parameters. 1058of frame parameters.
1022@end defun 1059@end defun
1023 1060
@@ -1030,11 +1067,12 @@ The default value of this variable is
1030@code{special-display-popup-frame}. 1067@code{special-display-popup-frame}.
1031@end defvar 1068@end defvar
1032 1069
1033@defun special-display-popup-frame buffer &rest args 1070@defun special-display-popup-frame buffer &optional args
1034This function makes @var{buffer} visible in a frame of its own. If 1071This function makes @var{buffer} visible in a frame of its own. If
1035@var{buffer} is already displayed in a window in some frame, it makes 1072@var{buffer} is already displayed in a window in some frame, it makes
1036the frame visible and raises it, to use that window. Otherwise, it 1073the frame visible and raises it, to use that window. Otherwise, it
1037creates a frame that will be dedicated to @var{buffer}. 1074creates a frame that will be dedicated to @var{buffer}. This
1075function returns the window it used.
1038 1076
1039If @var{args} is an alist, it specifies frame parameters for the new 1077If @var{args} is an alist, it specifies frame parameters for the new
1040frame. 1078frame.
@@ -1080,9 +1118,9 @@ put it in the selected window.
1080This variable is the most flexible way to customize the behavior of 1118This variable is the most flexible way to customize the behavior of
1081@code{display-buffer}. If it is non-@code{nil}, it should be a function 1119@code{display-buffer}. If it is non-@code{nil}, it should be a function
1082that @code{display-buffer} calls to do the work. The function should 1120that @code{display-buffer} calls to do the work. The function should
1083accept two arguments, the same two arguments that @code{display-buffer} 1121accept two arguments, the first two arguments that @code{display-buffer}
1084received. It should choose or create a window, display the specified 1122received. It should choose or create a window, display the specified
1085buffer, and then return the window. 1123buffer in it, and then return the window.
1086 1124
1087This hook takes precedence over all the other options and hooks 1125This hook takes precedence over all the other options and hooks
1088described above. 1126described above.
diff --git a/man/trampver.texi b/man/trampver.texi
index a62583fd6d4..32ab2349241 100644
--- a/man/trampver.texi
+++ b/man/trampver.texi
@@ -4,7 +4,7 @@
4@c In the Tramp CVS, the version number is auto-frobbed from 4@c In the Tramp CVS, the version number is auto-frobbed from
5@c configure.ac, so you should edit that file and run 5@c configure.ac, so you should edit that file and run
6@c "autoconf && ./configure" to change the version number. 6@c "autoconf && ./configure" to change the version number.
7@set trampver 2.0.42 7@set trampver 2.0.43
8 8
9@c Other flags from configuration 9@c Other flags from configuration
10@set prefix /usr/local 10@set prefix /usr/local
diff --git a/src/ChangeLog b/src/ChangeLog
index b3a9386da86..9765ec9403c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,45 @@
12004-07-17 Juanma Barranquero <lektu@terra.es>
2
3 * keyboard.c (not_single_kboard_state): Do nothing unless
4 MULTI_KBOARD is defined.
5
62004-07-17 Richard M. Stallman <rms@gnu.org>
7
8 * window.c (coordinates_in_window): Inside the window but outside
9 its box to the L or R, return ON_VERTICAL_BORDER.
10 (window_list_1): Rotate the list to start with WINDOW.
11
12 * print.c (print_preprocess): Test for print_depth at limit
13 before entering in being_printed.
14
15 * keyboard.c (not_single_kboard_state): New function.
16 (stuff_buffered_input): Now no-op only if no SIGTSTP.
17
18 * frame.c (Fdelete_frame): If we're in single_bboard_state on
19 this kboard, and we delete its last frame, go to any_kboard_state.
20
21 * buffer.c (syms_of_buffer) <transient-mark-mode>: Doc fix.
22
232004-07-15 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> (tiny change)
24
25 * w32fns.c (Fx_file_dialog): Encode strings in system coding
26 system before passing them to OS functions for display.
27
282004-07-15 David Kastrup <dak@gnu.org>
29
30 * search.c (syms_of_search): Staticpro `saved_last_thing_searched'.
31 Apparently fixes an abort condition.
32
332004-07-14 Luc Teirlinck <teirllm@auburn.edu>
34
35 * fileio.c (Fvisited_file_modtime): Return a list of two integers,
36 instead of a cons.
37
382004-07-14 K,Ba(Broly L,Bu(Brentey <lorentey@elte.hu>
39
40 * keyboard.c (echo_dash): Do nothing if there already is a dash
41 at the end of the echo string.
42
12004-07-12 Kim F. Storm <storm@cua.dk> 432004-07-12 Kim F. Storm <storm@cua.dk>
2 44
3 * alloc.c (mark_object): Only look at Lisp_Misc_Save_Value 45 * alloc.c (mark_object): Only look at Lisp_Misc_Save_Value
diff --git a/src/buffer.c b/src/buffer.c
index c5783ade2a0..f55ae7983f4 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5861,7 +5861,10 @@ all windows or just the selected window.
5861 5861
5862If the value is `lambda', that enables Transient Mark mode temporarily 5862If the value is `lambda', that enables Transient Mark mode temporarily
5863until the next buffer modification. If a command sets the value to `only', 5863until the next buffer modification. If a command sets the value to `only',
5864that enables Transient Mark mode for the following command only. */); 5864that enables Transient Mark mode for the following command only.
5865During that following command, the value of `transient-mark-mode'
5866is `identity'. If it is still `identity' at the end of that command,
5867it changes to nil. */);
5865 Vtransient_mark_mode = Qnil; 5868 Vtransient_mark_mode = Qnil;
5866 5869
5867 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only, 5870 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,
diff --git a/src/fileio.c b/src/fileio.c
index 2a4d5fb230e..f81566a7656 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5630,13 +5630,17 @@ Next attempt to save will certainly not complain of a discrepancy. */)
5630DEFUN ("visited-file-modtime", Fvisited_file_modtime, 5630DEFUN ("visited-file-modtime", Fvisited_file_modtime,
5631 Svisited_file_modtime, 0, 0, 0, 5631 Svisited_file_modtime, 0, 0, 0,
5632 doc: /* Return the current buffer's recorded visited file modification time. 5632 doc: /* Return the current buffer's recorded visited file modification time.
5633The value is a list of the form (HIGH . LOW), like the time values 5633The value is a list of the form (HIGH LOW), like the time values
5634that `file-attributes' returns. If the current buffer has no recorded 5634that `file-attributes' returns. If the current buffer has no recorded
5635file modification time, this function returns 0. 5635file modification time, this function returns 0.
5636See Info node `(elisp)Modification Time' for more details. */) 5636See Info node `(elisp)Modification Time' for more details. */)
5637 () 5637 ()
5638{ 5638{
5639 return long_to_cons ((unsigned long) current_buffer->modtime); 5639 Lisp_Object tcons;
5640 tcons = long_to_cons ((unsigned long) current_buffer->modtime);
5641 if (CONSP (tcons))
5642 return list2 (XCAR (tcons), XCDR (tcons));
5643 return tcons;
5640} 5644}
5641 5645
5642DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime, 5646DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime,
diff --git a/src/frame.c b/src/frame.c
index 41ee5a64bd5..9a0563c6f76 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1553,6 +1553,36 @@ The functions are run with one arg, the frame to be deleted. */)
1553 } 1553 }
1554 } 1554 }
1555 1555
1556 /* If there's no other frame on the same kboard, get out of
1557 single-kboard state if we're in it for this kboard. */
1558 {
1559 Lisp_Object frames;
1560 /* Some frame we found on the same kboard, or nil if there are none. */
1561 Lisp_Object frame_on_same_kboard;
1562
1563 frame_on_same_kboard = Qnil;
1564
1565 for (frames = Vframe_list;
1566 CONSP (frames);
1567 frames = XCDR (frames))
1568 {
1569 Lisp_Object this;
1570 struct frame *f1;
1571
1572 this = XCAR (frames);
1573 if (!FRAMEP (this))
1574 abort ();
1575 f1 = XFRAME (this);
1576
1577 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1))
1578 frame_on_same_kboard = this;
1579 }
1580
1581 if (NILP (frame_on_same_kboard))
1582 not_single_kboard_state (FRAME_KBOARD (f));
1583 }
1584
1585
1556 /* If we've deleted this keyboard's default_minibuffer_frame, try to 1586 /* If we've deleted this keyboard's default_minibuffer_frame, try to
1557 find another one. Prefer minibuffer-only frames, but also notice 1587 find another one. Prefer minibuffer-only frames, but also notice
1558 frames with other windows. */ 1588 frames with other windows. */
diff --git a/src/keyboard.c b/src/keyboard.c
index 3fc685d58c7..40a545180fe 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -791,6 +791,21 @@ echo_dash ()
791 == SCHARS (current_kboard->echo_string)) 791 == SCHARS (current_kboard->echo_string))
792 return; 792 return;
793 793
794 /* Do nothing if we have already put a dash at the end. */
795 if (SCHARS (current_kboard->echo_string) > 1)
796 {
797 Lisp_Object last_char, prev_char, idx;
798
799 idx = make_number (SCHARS (current_kboard->echo_string) - 2);
800 prev_char = Faref (current_kboard->echo_string, idx);
801
802 idx = make_number (SCHARS (current_kboard->echo_string) - 1);
803 last_char = Faref (current_kboard->echo_string, idx);
804
805 if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
806 return;
807 }
808
794 /* Put a dash at the end of the buffer temporarily, 809 /* Put a dash at the end of the buffer temporarily,
795 but make it go away when the next character is added. */ 810 but make it go away when the next character is added. */
796 current_kboard->echo_string = concat2 (current_kboard->echo_string, 811 current_kboard->echo_string = concat2 (current_kboard->echo_string,
@@ -1063,6 +1078,19 @@ single_kboard_state ()
1063#endif 1078#endif
1064} 1079}
1065 1080
1081/* If we're in single_kboard state for kboard KBOARD,
1082 get out of it. */
1083
1084void
1085not_single_kboard_state (kboard)
1086 KBOARD *kboard;
1087{
1088#ifdef MULTI_KBOARD
1089 if (kboard == current_kboard)
1090 single_kboard = 0;
1091#endif
1092}
1093
1066/* Maintain a stack of kboards, so other parts of Emacs 1094/* Maintain a stack of kboards, so other parts of Emacs
1067 can switch temporarily to the kboard of a given frame 1095 can switch temporarily to the kboard of a given frame
1068 and then revert to the previous status. */ 1096 and then revert to the previous status. */
@@ -10238,9 +10266,7 @@ void
10238stuff_buffered_input (stuffstring) 10266stuff_buffered_input (stuffstring)
10239 Lisp_Object stuffstring; 10267 Lisp_Object stuffstring;
10240{ 10268{
10241/* stuff_char works only in BSD, versions 4.2 and up. */ 10269#ifdef SIGTSTP /* stuff_char is defined if SIGTSTP. */
10242#ifdef BSD_SYSTEM
10243#ifndef BSD4_1
10244 register unsigned char *p; 10270 register unsigned char *p;
10245 10271
10246 if (STRINGP (stuffstring)) 10272 if (STRINGP (stuffstring))
@@ -10256,7 +10282,10 @@ stuff_buffered_input (stuffstring)
10256 10282
10257 /* Anything we have read ahead, put back for the shell to read. */ 10283 /* Anything we have read ahead, put back for the shell to read. */
10258 /* ?? What should this do when we have multiple keyboards?? 10284 /* ?? What should this do when we have multiple keyboards??
10259 Should we ignore anything that was typed in at the "wrong" kboard? */ 10285 Should we ignore anything that was typed in at the "wrong" kboard?
10286
10287 rms: we should stuff everything back into the kboard
10288 it came from. */
10260 for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++) 10289 for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++)
10261 { 10290 {
10262 10291
@@ -10269,8 +10298,7 @@ stuff_buffered_input (stuffstring)
10269 } 10298 }
10270 10299
10271 input_pending = 0; 10300 input_pending = 0;
10272#endif 10301#endif /* SIGTSTP */
10273#endif /* BSD_SYSTEM and not BSD4_1 */
10274} 10302}
10275 10303
10276void 10304void
diff --git a/src/print.c b/src/print.c
index 0abd30b5ce0..5a0f7fe6220 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1284,6 +1284,11 @@ print_preprocess (obj)
1284 int loop_count = 0; 1284 int loop_count = 0;
1285 Lisp_Object halftail; 1285 Lisp_Object halftail;
1286 1286
1287 /* Give up if we go so deep that print_object will get an error. */
1288 /* See similar code in print_object. */
1289 if (print_depth >= PRINT_CIRCLE)
1290 return;
1291
1287 /* Avoid infinite recursion for circular nested structure 1292 /* Avoid infinite recursion for circular nested structure
1288 in the case where Vprint_circle is nil. */ 1293 in the case where Vprint_circle is nil. */
1289 if (NILP (Vprint_circle)) 1294 if (NILP (Vprint_circle))
@@ -1294,11 +1299,6 @@ print_preprocess (obj)
1294 being_printed[print_depth] = obj; 1299 being_printed[print_depth] = obj;
1295 } 1300 }
1296 1301
1297 /* Give up if we go so deep that print_object will get an error. */
1298 /* See similar code in print_object. */
1299 if (print_depth >= PRINT_CIRCLE)
1300 return;
1301
1302 print_depth++; 1302 print_depth++;
1303 halftail = obj; 1303 halftail = obj;
1304 1304
diff --git a/src/search.c b/src/search.c
index 169baf05d55..0375f353dd2 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2974,6 +2974,9 @@ syms_of_search ()
2974 last_thing_searched = Qnil; 2974 last_thing_searched = Qnil;
2975 staticpro (&last_thing_searched); 2975 staticpro (&last_thing_searched);
2976 2976
2977 saved_last_thing_searched = Qnil;
2978 staticpro (&saved_last_thing_searched);
2979
2977 defsubr (&Slooking_at); 2980 defsubr (&Slooking_at);
2978 defsubr (&Sposix_looking_at); 2981 defsubr (&Sposix_looking_at);
2979 defsubr (&Sstring_match); 2982 defsubr (&Sstring_match);
diff --git a/src/w32fns.c b/src/w32fns.c
index b12bd7be28b..d5ba6e9b078 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -7735,14 +7735,14 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
7735 /* Create the dialog with PROMPT as title, using DIR as initial 7735 /* Create the dialog with PROMPT as title, using DIR as initial
7736 directory and using "*" as pattern. */ 7736 directory and using "*" as pattern. */
7737 dir = Fexpand_file_name (dir, Qnil); 7737 dir = Fexpand_file_name (dir, Qnil);
7738 strncpy (init_dir, SDATA (dir), MAX_PATH); 7738 strncpy (init_dir, SDATA (ENCODE_SYSTEM (dir)), MAX_PATH);
7739 init_dir[MAX_PATH] = '\0'; 7739 init_dir[MAX_PATH] = '\0';
7740 unixtodos_filename (init_dir); 7740 unixtodos_filename (init_dir);
7741 7741
7742 if (STRINGP (default_filename)) 7742 if (STRINGP (default_filename))
7743 { 7743 {
7744 char *file_name_only; 7744 char *file_name_only;
7745 char *full_path_name = SDATA (default_filename); 7745 char *full_path_name = SDATA (ENCODE_SYSTEM (default_filename));
7746 7746
7747 unixtodos_filename (full_path_name); 7747 unixtodos_filename (full_path_name);
7748 7748
diff --git a/src/window.c b/src/window.c
index b470b705397..0e318b039a4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -672,7 +672,7 @@ coordinates_in_window (w, x, y)
672 672
673 /* Outside any interesting column? */ 673 /* Outside any interesting column? */
674 if (*x < left_x || *x > right_x) 674 if (*x < left_x || *x > right_x)
675 return ON_NOTHING; 675 return ON_VERTICAL_BORDER;
676 676
677 lmargin_width = window_box_width (w, LEFT_MARGIN_AREA); 677 lmargin_width = window_box_width (w, LEFT_MARGIN_AREA);
678 rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA); 678 rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA);
@@ -1801,7 +1801,7 @@ static Lisp_Object
1801window_list_1 (window, minibuf, all_frames) 1801window_list_1 (window, minibuf, all_frames)
1802 Lisp_Object window, minibuf, all_frames; 1802 Lisp_Object window, minibuf, all_frames;
1803{ 1803{
1804 Lisp_Object tail, list; 1804 Lisp_Object tail, list, rest;
1805 1805
1806 decode_next_window_args (&window, &minibuf, &all_frames); 1806 decode_next_window_args (&window, &minibuf, &all_frames);
1807 list = Qnil; 1807 list = Qnil;
@@ -1810,7 +1810,17 @@ window_list_1 (window, minibuf, all_frames)
1810 if (candidate_window_p (XCAR (tail), window, minibuf, all_frames)) 1810 if (candidate_window_p (XCAR (tail), window, minibuf, all_frames))
1811 list = Fcons (XCAR (tail), list); 1811 list = Fcons (XCAR (tail), list);
1812 1812
1813 return Fnreverse (list); 1813 /* Rotate the list to start with WINDOW. */
1814 list = Fnreverse (list);
1815 rest = Fmemq (window, list);
1816 if (!NILP (rest) && !EQ (rest, list))
1817 {
1818 for (tail = list; XCDR (tail) != rest; tail = XCDR (tail))
1819 ;
1820 XSETCDR (tail, Qnil);
1821 list = nconc2 (rest, list);
1822 }
1823 return list;
1814} 1824}
1815 1825
1816 1826