1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-16 10:50:49 -08:00

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
This commit is contained in:
Karoly Lorentey 2004-07-18 21:49:24 +00:00
commit 31d7e9bc5a
40 changed files with 993 additions and 344 deletions

View file

@ -1,3 +1,7 @@
2004-07-14 Luc Teirlinck <teirllm@auburn.edu>
* MORE.STUFF: Tramp is now distributed with Emacs.
2004-07-12 Bill Wohler <wohler@newt.com> 2004-07-12 Bill Wohler <wohler@newt.com>
* NEWS, MH-E-NEWS: Upgraded to MH-E version 7.4.4. * NEWS, MH-E-NEWS: Upgraded to MH-E version 7.4.4.

View file

@ -96,6 +96,9 @@ You might find bug-fixes or enhancements in these places.
* Sregex: <URL:http://www.zanshin.com/%7Ebobg/sregex.html> * Sregex: <URL:http://www.zanshin.com/%7Ebobg/sregex.html>
* Tramp: Remote file access via rsh/ssh
<URL:http://savannah.gnu.org/projects/tramp/>
* Webjump: <URL:http://www.neilvandyke.org/webjump> * Webjump: <URL:http://www.neilvandyke.org/webjump>
* Whitespace: <URL:http://www.dsmit.com/lisp/> * Whitespace: <URL:http://www.dsmit.com/lisp/>
@ -215,9 +218,6 @@ Several are for Debian GNU/Linux in particular.
Wnn6, Wnn6,
SJ3 Ver.2 SJ3 Ver.2
* Tramp: Remote file access via rsh/ssh
<URL:http://savannah.gnu.org/projects/tramp/>
* VM (View Mail): <URL:http://www.wonderworks.com/vm/> Alternative * VM (View Mail): <URL:http://www.wonderworks.com/vm/> Alternative
mail reader. There is a VM newsgroup: <URL:news:gnu.emacs.vm.info> mail reader. There is a VM newsgroup: <URL:news:gnu.emacs.vm.info>

View file

@ -95,6 +95,12 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types.
* Changes in Emacs 21.4 * Changes in Emacs 21.4
+++
** There are now two new regular expression operators, \_< and \_>,
for matching the beginning and end of a symbol. A symbol is a
non-empty sequence of either word or symbol constituent characters, as
specified by the syntax table.
** Passing resources on the command line now works on MS Windows. ** Passing resources on the command line now works on MS Windows.
You can use --xrm to pass resource settings to Emacs, overriding any You can use --xrm to pass resource settings to Emacs, overriding any
existing values. For example: existing values. For example:
@ -144,7 +150,7 @@ The new commands `comint-kill-whole-line' and `comint-kill-region'
support editing comint buffers with read-only prompts. support editing comint buffers with read-only prompts.
`comint-kill-whole-line' is like `kill-whole-line', but ignores both `comint-kill-whole-line' is like `kill-whole-line', but ignores both
read-only and field properties. Hence, it will always kill entire read-only and field properties. Hence, it always kill entire
lines, including any prompts. lines, including any prompts.
`comint-kill-region' is like `kill-region', except that it ignores `comint-kill-region' is like `kill-region', except that it ignores
@ -158,7 +164,7 @@ kill-ring, but does not delete it.
** You can now use next-error (C-x `) and previous-error to advance to ** You can now use next-error (C-x `) and previous-error to advance to
the next/previous matching line found by M-x occur. the next/previous matching line found by M-x occur.
** Telnet will now prompt you for a port number with C-u M-x telnet. ** Telnet now prompts you for a port number with C-u M-x telnet.
+++ +++
** New command line option -Q. ** New command line option -Q.
@ -177,9 +183,9 @@ supplied. This behavior is analogous to `write-file'.
** You can now use Auto Revert mode to `tail' a file. ** You can now use Auto Revert mode to `tail' a file.
If point is at the end of a file buffer before reverting, Auto Revert If point is at the end of a file buffer before reverting, Auto Revert
mode keeps it at the end after reverting. Similarly if point is mode keeps it at the end after reverting. Similarly if point is
displayed at the end of a file buffer in any window, it will stay at displayed at the end of a file buffer in any window, it stays at
the end of the buffer in that window. This allows to tail a file: the end of the buffer in that window. This allows to tail a file:
just put point at the end of the buffer and it will stay there. This just put point at the end of the buffer and it stays there. This
rule applies to file buffers. For non-file buffers, the behavior may rule applies to file buffers. For non-file buffers, the behavior may
be mode dependent. be mode dependent.
@ -187,7 +193,7 @@ be mode dependent.
other potential problems when deciding which non-file buffers to other potential problems when deciding which non-file buffers to
revert. This matters especially if Global Auto Revert mode is enabled revert. This matters especially if Global Auto Revert mode is enabled
and `global-auto-revert-non-file-buffers' is non-nil. Auto Revert and `global-auto-revert-non-file-buffers' is non-nil. Auto Revert
mode will only revert a non-file buffer if the buffer has a non-nil mode only reverts a non-file buffer if the buffer has a non-nil
`revert-buffer-function' and a non-nil `buffer-stale-function', which `revert-buffer-function' and a non-nil `buffer-stale-function', which
decides whether the buffer should be reverted. Currently, this means decides whether the buffer should be reverted. Currently, this means
that auto reverting works for Dired buffers (although this may not that 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.
** M-x grep has been adapted to new compile ** M-x grep has been adapted to new compile
Hits are fontified in green, and hits in binary files in orange. Grep buffers Hits are fontified in green, and hits in binary files in orange. Grep buffers
can be saved and will again be loaded with the new `grep-mode'. can be saved and automatically revisited with the new Grep mode.
** M-x diff uses diff-mode instead of compilation-mode. ** M-x diff uses diff-mode instead of compilation-mode.
@ -427,7 +433,7 @@ with special modes such as Tar mode.
** Enhancements to apropos commands: ** Enhancements to apropos commands:
*** The apropos commands will now accept a list of words to match. *** The apropos commands now accept a list of words to match.
When more than one word is specified, at least two of those words must When more than one word is specified, at least two of those words must
be present for an item to match. Regular expression matching is still be present for an item to match. Regular expression matching is still
available. available.
@ -606,7 +612,7 @@ XIM by default, the X resource useXIM can be used to turn it on.
`file|dir1' and `file|dir2' to `file|dir1/subdir' and `file|dir2/subdir'. `file|dir1' and `file|dir2' to `file|dir1/subdir' and `file|dir2/subdir'.
** If the user visits a file larger than `large-file-warning-threshold', ** If the user visits a file larger than `large-file-warning-threshold',
Emacs will prompt her for confirmation. Emacs prompts her for confirmation.
** A UTF-7 coding system is available in the library `utf-7'. ** A UTF-7 coding system is available in the library `utf-7'.
@ -683,8 +689,8 @@ directory is used for auto-save files of mail buffers. It defaults to
+++ +++
** When you are root, and you visit a file whose modes specify ** When you are root, and you visit a file whose modes specify
read-only, the Emacs buffer is now read-only too. Type C-x C-q if you read-only, the Emacs buffer is now read-only too. Type C-x C-q if you
want to make the buffer writable. (As root, you will in fact be able want to make the buffer writable. (As root, you can in fact alter the
to alter the file.) file.)
** The new command `revert-buffer-with-coding-system' (C-x RET r) ** The new command `revert-buffer-with-coding-system' (C-x RET r)
revisits the current file using a coding system that you specify. revisits 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.
`buffers-menu-show-directories' controls whether the menu displays `buffers-menu-show-directories' controls whether the menu displays
leading directories as part of the file name visited by the buffer. leading directories as part of the file name visited by the buffer.
If its value is `unless-uniquify', the default, directories will be If its value is `unless-uniquify', the default, directories are
shown unless uniquify-buffer-name-style' is non-nil. The value of nil shown unless uniquify-buffer-name-style' is non-nil. The value of nil
and t turn the display of directories off and on, respectively. and t turn the display of directories off and on, respectively.
@ -785,7 +791,7 @@ sets plus some other 8-bit sets, but can be extended. For instance,
translation works amongst the Emacs ...-iso8859-... charsets and the translation works amongst the Emacs ...-iso8859-... charsets and the
mule-unicode-... ones. mule-unicode-... ones.
By default this translation will happen automatically on encoding. By default this translation happens automatically on encoding.
Self-inserting characters are translated to make the input conformant Self-inserting characters are translated to make the input conformant
with the encoding of the buffer in which it's being used, where with the encoding of the buffer in which it's being used, where
possible. possible.
@ -863,7 +869,7 @@ the window edge point is allowed to get before automatic hscrolling
will horizontally scroll the window. The default value is 5. will horizontally scroll the window. The default value is 5.
The variable `hscroll-step' determines how many columns automatic The variable `hscroll-step' determines how many columns automatic
hscrolling will scroll the window when point gets too close to the hscrolling scrolls the window when point gets too close to the
window edge. If its value is zero, the default, Emacs scrolls the window edge. If its value is zero, the default, Emacs scrolls the
window so as to center point. If its value is an integer, it says how window so as to center point. If its value is an integer, it says how
many columns to scroll. If the value is a floating-point number, it many 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'.
+++ +++
** M-x grep now tries to avoid appending `/dev/null' to the command line ** M-x grep now tries to avoid appending `/dev/null' to the command line
by using GNU grep `-H' option instead. M-x grep will automatically by using GNU grep `-H' option instead. M-x grep automatically
detect whether this is possible or not the first time it is invoked. detects whether this is possible or not the first time it is invoked.
When `-H' is used, the grep command line supplied by the user is passed When `-H' is used, the grep command line supplied by the user is passed
unchanged to the system to execute, which allows more complicated unchanged to the system to execute, which allows more complicated
command lines to be used than was possible before. command lines to be used than was possible before.
@ -1176,7 +1182,7 @@ counter to the specified source line (the one where point is).
*** The STARTTLS elisp wrapper (starttls.el) can now use GNUTLS *** The STARTTLS elisp wrapper (starttls.el) can now use GNUTLS
instead of the OpenSSL based "starttls" tool. For backwards instead of the OpenSSL based "starttls" tool. For backwards
compatibility, it will prefer "starttls", but you can toggle compatibility, it prefers "starttls", but you can toggle
`starttls-use-gnutls' to switch to GNUTLS (or simply remove the `starttls-use-gnutls' to switch to GNUTLS (or simply remove the
"starttls" tool). "starttls" tool).
@ -1211,10 +1217,10 @@ refontification takes place.
+++ +++
** Marking commands extend the region when invoked multiple times. If ** Marking commands extend the region when invoked multiple times. If
you hit M-C-SPC (mark-sexp), M-@ (mark-word), M-h (mark-paragraph), or you hit M-C-SPC (mark-sexp), M-@ (mark-word), M-h (mark-paragraph), or
C-M-h (mark-defun) repeatedly, the marked region will now be extended C-M-h (mark-defun) repeatedly, the marked region extends each time, so
each time, so you can mark the next two sexps with M-C-SPC M-C-SPC, you can mark the next two sexps with M-C-SPC M-C-SPC, for example.
for example. This feature also works for mark-end-of-sentence, if you This feature also works for mark-end-of-sentence, if you bind that to
bind that to a key. a key.
+++ +++
** Some commands do something special in Transient Mark mode when the ** Some commands do something special in Transient Mark mode when the
@ -1236,7 +1242,7 @@ C-g.
+++ +++
** A prefix argument is no longer required to repeat a jump to a ** A prefix argument is no longer required to repeat a jump to a
previous mark, i.e. C-u C-SPC C-SPC C-SPC ... will cycle through the previous mark, i.e. C-u C-SPC C-SPC C-SPC ... cycles through the
mark ring. Use C-u C-u C-SPC to set the mark immediately after a jump. mark ring. Use C-u C-u C-SPC to set the mark immediately after a jump.
+++ +++
@ -1443,7 +1449,7 @@ writes tags pointing to the source file.
*** New option --parse-stdin=FILE. *** New option --parse-stdin=FILE.
This option is mostly useful when calling etags from programs. It can This option is mostly useful when calling etags from programs. It can
be used (only once) in place of a file name on the command line. Etags be used (only once) in place of a file name on the command line. Etags
will read from standard input and mark the produced tags as belonging to reads from standard input and mark the produced tags as belonging to
the file FILE. the file FILE.
+++ +++
@ -1751,8 +1757,8 @@ fill-single-word-nobreak-p and fill-french-nobreak-p.
+++ +++
** New user option `add-log-always-start-new-record'. ** New user option `add-log-always-start-new-record'.
When this option is enabled, M-x add-change-log-entry will always When this option is enabled, M-x add-change-log-entry always
start a new record regardless of when the last record is. starts a new record regardless of when the last record is.
+++ +++
** SGML mode has indentation and supports XML syntax. ** SGML mode has indentation and supports XML syntax.
@ -1904,13 +1910,13 @@ pass them to Windows to be handled with system-wide functions.
--- ---
** Emacs takes note of colors defined in Control Panel on MS-Windows. ** Emacs takes note of colors defined in Control Panel on MS-Windows.
The Control Panel defines some default colors for applications in The Control Panel defines some default colors for applications in much
much the same way as wildcard X Resources do on X. Emacs now the same way as wildcard X Resources do on X. Emacs now adds these
adds these colors to the colormap prefixed by System (eg SystemMenu colors to the colormap prefixed by System (eg SystemMenu for the
for the default Menu background, SystemMenuText for the foreground), default Menu background, SystemMenuText for the foreground), and uses
and uses some of them to initialize some of the default faces. some of them to initialize some of the default faces.
`list-colors-display' will show the list of System color names if you `list-colors-display' shows the list of System color names, in case
wish to use them in other faces. you wish to use them in other faces.
+++ +++
** Under X11, it is possible to swap Alt and Meta (and Super and Hyper). ** 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
kmacro-call-repeat-with-arg. kmacro-call-repeat-with-arg.
Keyboard macros can now be debugged and edited interactively. Keyboard macros can now be debugged and edited interactively.
C-x C-k SPC will step through the last keyboard macro one key sequence C-x C-k SPC steps through the last keyboard macro one key sequence
at a time, prompting for the actions to take. at a time, prompting for the actions to take.
--- ---
@ -2178,7 +2184,11 @@ configuration files.
* Lisp Changes in Emacs 21.4 * Lisp Changes in Emacs 21.4
** If a command sets transient-mark-mode to `only', that +++
** `visited-file-modtime' and `calendar-time-from-absolute' now return
a list of two integers, instead of a cons.
** If a command sets transient-mark-mode to `only', that
enables Transient Mark mode for the following command only. enables Transient Mark mode for the following command only.
During that following command, the value of transient-mark-mode During that following command, the value of transient-mark-mode
is `identity'. If it is still `identity' at the end of the command, is `identity'. If it is still `identity' at the end of the command,
@ -3567,9 +3577,9 @@ it in that buffer.
properties from surrounding text. properties from surrounding text.
+++ +++
** `(match-data t)' will append the buffer as a final element of the ** The list returned by `(match-data t)' now has the buffer as a final
match data if the last match was on a buffer. `set-match-data' will element, if the last match was on a buffer. `set-match-data'
accept this for restoring the match state. accepts such a list for restoring the match state.
+++ +++
** New function `buffer-local-value'. ** New function `buffer-local-value'.

View file

@ -87,7 +87,9 @@ to the FSF.
latin-1-prefix and latin-1-postfix. latin-1-prefix and latin-1-postfix.
** Implement a clean way to use different major modes for ** Implement a clean way to use different major modes for
different parts of a buffer. different parts of a buffer. This could be useful in editing
Bison input files, for instance, or other kinds of text
where one language is embedded in another language.
** Give start-process the ability to direct standard-error ** Give start-process the ability to direct standard-error
output to a different filter. output to a different filter.
@ -107,8 +109,8 @@ to the FSF.
See the Gnus development sources for assigned code concerning GPG See the Gnus development sources for assigned code concerning GPG
use with mail, which is probably a good start.] use with mail, which is probably a good start.]
** Save undo information in files, and reload it when needed ** Save undo information in special temporary files, and reload it
for undoing. when needed for undoing. This could extend undo capacity.
** Merge the Emacs regex.c with the Glibc regex.c. ** Merge the Emacs regex.c with the Glibc regex.c.
They split off a few years ago through negligence. They split off a few years ago through negligence.
@ -276,8 +278,14 @@ to the FSF.
the definition of `file-attributes' and `directory-files-and-attributes' the definition of `file-attributes' and `directory-files-and-attributes'
and from the calls. and from the calls.
** Re-design language environment handling so that Emacs can fit ** Make language-info-alist customizable. Currently a user can customize
better to a users locale (e.g. ja_JP.UTF-8). only the variable `current-language-environment'.
** Improve language environment handling so that Emacs can fit
better to a users locale. Currently Emacs uses utf-8 language
environment for all utf-8 locales, thus a user in ja_JP.UTF-8 locale
are also put in utf-8 lang. env. In such a case, it is
better to use Japanese lang. env. but prefer utf-8 coding system.
** Eliminate the current restriction on header printing by ps-print. ** Eliminate the current restriction on header printing by ps-print.
Currently, a header can contain only single 1-byte charset in Currently, a header can contain only single 1-byte charset in
@ -294,9 +302,10 @@ to the FSF.
** Enhance word boundary detection for such a script that doesn't use ** Enhance word boundary detection for such a script that doesn't use
space at word boundary (e.g. Thai). space at word boundary (e.g. Thai).
** Include a better Japanese input method in the distribution. ** Implement interface programs with major Japanese conversion server
Currently, most Japanese users are using external packages in lib-src so that they can be used from the input method
(e.g. tamago, anthy) or an input method via XIM. "japanese". Currently, most Japanese users are using external
packages (e.g. tamago, anthy) or an input method via XIM.
* Internal changes * Internal changes

View file

@ -1,6 +1,11 @@
# Makefile for leim subdirectory in GNU Emacs. # Makefile for leim subdirectory in GNU Emacs.
# Copyright (C) 1997, 2004 Electrotechnical Laboratory, JAPAN. # Copyright (C) 1997,98,1999,2000,2001 Electrotechnical Laboratory, JAPAN.
# Licensed to the Free Software Foundation. # Licensed to the Free Software Foundation.
# Copyright (C) 1997,98,1999,2000,01,02,03,2004
# Free Software Foundation, Inc.
# Copyright (C) 2001,02,03,2004
# National Institute of Advanced Industrial Science and Technology (AIST)
# Registration Number H14PRO021
# This file is part of GNU Emacs. # This file is part of GNU Emacs.

View file

@ -1,3 +1,7 @@
2004-07-17 Richard M. Stallman <rms@gnu.org>
* emacsclient.c (quote_file_name): Pass COPY thru %s to output it.
2004-06-01 Juanma Barranquero <lektu@terra.es> 2004-06-01 Juanma Barranquero <lektu@terra.es>
* makefile.w32-in (obj): Add image.c. * makefile.w32-in (obj): Add image.c.

View file

@ -1,3 +1,126 @@
2004-07-17 Kai Grossjohann <kai.grossjohann@gmx.net>
* net/tramp.el (tramp-handle-verify-visited-file-modtime): New
docstring. From Luc Teirlinck.
2004-07-17 Luc Teirlinck <teirllm@auburn.edu>
* autorevert.el: Describe `Auto Revert Tail Mode' in `Commentary'
section.
(auto-revert-handler): Do not check `auto-revert-tail-mode' for
non-file buffers. We know it is nil.
2004-07-17 Kai Grossjohann <kai.grossjohann@gmx.net>
Sync with Tramp 2.0.43.
* net/tramp.el (tramp-handle-verify-visited-file-modtime): Remove
outdated comment.
(tramp-locked, tramp-locker): New variables for implementing a
global lock.
(tramp-sh-file-name-handler): Use them to implement the global
lock.
2004-07-13 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (all): Code cleanup. Change all `tramp-handle-xxx'
calls to respective `xxx` calls.
(tramp-process-alive-regexp): Precise doc string.
(tramp-multi-action-process-alive): New defun.
(tramp-multi-actions): Use it.
(tramp-handle-find-backup-file-name): `copy-tree' is available
since Emacs 21.4 only (XEmacs has it). Implementation rewritten
in order to avoid this function.
(tramp-handle-write-region): Set current buffer. If connection
wasn't open, `file-modes' has changed it accidently. Reported by
David Kastrup <dak@gnu.org>.
(tramp-enter-password, tramp-read-passwd): New arguments USER and
HOST.
(tramp-action-password, tramp-multi-action-password): Apply it.
(tramp-open-connection-rsh): If a port is given, the Tramp buffer
name must still contain the port number. Otherwise, we have two
Tramp buffers, with all the confusion. Reported by Myron Selby
<myron@xytech.com> and Rolf Dubitzky
<Dubitzky@physi.uni-heidelberg.de>.
* net/tramp-smb.el (tramp-smb-open-connection): Apply USER and
HOST to `tramp-enter-passwd'.
* net/tramp-vc.el (all): Code cleanup. Change all
`tramp-handle-xxx' calls to respective `xxx` calls.
2004-07-17 Jonathan Yavner <jyavner@member.fsf.org>
* emacs-lisp/testcover.el: New category "potentially-1valued" for
functions that are not erroneous if either 1-valued or
multi-valued. Detect functions in this class.
(testcover-1value-functions, testcover-compose-functions,
testcover-progn-functions) Added some additional functions to lists.
(testcover-mark): Bugfix when marking up the definition for an
empty function.
2004-07-17 Richard M. Stallman <rms@gnu.org>
* replace.el (occur-read-primary-args): Pass default to read-from-minibuffer.
* mail/footnote.el (footnote-section-tag): Use defcustom.
* font-lock.el (font-lock-add-keywords, font-lock-remove-keywords):
Compile font-lock-keywords, not KEYWORDS.
(lisp-font-lock-keywords-2): Add multiple-value-prog1, go.
Add warn, check-type. Handle cerror like error.
2004-07-14 Daniel Pfeiffer <occitan@esperanto.org>
* progmodes/which-func.el (which-func-keymap): New var.
(which-func-face): New face.
(which-func-format): Use them.
2004-07-16 Stephan Stahl <stahl@eos.franken.de> (tiny change)
* buff-menu.el (list-buffers-noselect): Append the buffer's
process status to its mode name.
2004-07-16 Kim F. Storm <storm@cua.dk>
* simple.el (inhibit-mark-movement): New defvar.
(beginning-of-buffer, end-of-buffer): Do not push mark if
inhibit-mark-movement is non-nil or C-u prefix is given.
* emulation/cua-base.el (cua--preserve-mark-commands): New defvar.
Init to beginning-of-buffer and end-of-buffer.
(cua--undo-push-mark): New defvar.
(cua--pre-command-handler): Set inhibit-mark-movement if mark is
already active and command is in cua--preserve-mark-commands.
Also fix check for shift modifier on non-window systems.
(cua--post-command-handler): Clear inhibit-mark-movement if set.
2004-07-14 Luc Teirlinck <teirllm@auburn.edu>
* calendar/cal-dst.el (calendar-time-from-absolute): Return a list
of two integers, instead of a cons.
* net/tramp.el (tramp-handle-verify-visited-file-modtime):
`visited-file-modtime' now returns a list of two integers, instead
of a cons.
* dired.el (dired-directory-changed-p): Ditto.
* progmodes/grep.el (grep): Doc fix.
2004-07-14 Daniel Pfeiffer <occitan@esperanto.org>
* autorevert.el (auto-revert-tail-mode)
(auto-revert-tail-mode-text, auto-revert-tail-pos): New vars.
(auto-revert-mode): Turn off auto-revert-tail-mode, so we're not
in both at the same time.
(auto-revert-tail-mode): New command.
(turn-on-auto-revert-tail-mode, auto-revert-tail-handler): New funs.
(auto-revert-handler): Revert only either tail or whole file.
* bindings.el (mode-line-mode-menu): Fix alphabetical ordering and
add auto-revert-tail-mode.
2004-07-12 Vinicius Jose Latorre <viniciusjl@ig.com.br> 2004-07-12 Vinicius Jose Latorre <viniciusjl@ig.com.br>
* printing.el: Doc fix. Change name of some funs. * printing.el: Doc fix. Change name of some funs.
@ -1475,6 +1598,14 @@
(timer-event-handler): Set triggered-p element non-nil while running (timer-event-handler): Set triggered-p element non-nil while running
the timer function. the timer function.
2004-05-14 Stefan Monnier <monnier@iro.umontreal.ca>
* descr-text.el (describe-char-unicode-data)
(describe-char-unicodedata-file): Re-enable the unicode code now that
the licensing issues have been cleared in the unicode-4 license.
(describe-text-properties-1): Remove unused `overlay' var.
(describe-char): Remove unused var `buffer'.
2004-05-14 David Ponce <david@dponce.com> 2004-05-14 David Ponce <david@dponce.com>
* tree-widget.el: New file. * tree-widget.el: New file.

View file

@ -34,7 +34,8 @@
;; ;;
;; This package contains two minor modes: Global Auto-Revert Mode and ;; This package contains two minor modes: Global Auto-Revert Mode and
;; Auto-Revert Mode. Both modes automatically revert buffers ;; Auto-Revert Mode. Both modes automatically revert buffers
;; whenever the corresponding files have been changed on disk. ;; whenever the corresponding files have been changed on disk and the
;; buffer contains no unsaved changes.
;; ;;
;; Auto-Revert Mode can be activated for individual buffers. Global ;; Auto-Revert Mode can be activated for individual buffers. Global
;; Auto-Revert Mode applies to all file buffers. (If the user option ;; Auto-Revert Mode applies to all file buffers. (If the user option
@ -59,11 +60,19 @@
;; Just put point at the end of the buffer and it will stay there. ;; Just put point at the end of the buffer and it will stay there.
;; These rules apply to file buffers. For non-file buffers, the ;; These rules apply to file buffers. For non-file buffers, the
;; behavior may be mode dependent. ;; behavior may be mode dependent.
;;
;; While you can use Auto Revert Mode to tail a file, this package
;; contains a third minor mode, Auto Revert Tail Mode, which does so
;; more efficiently, as long as you are sure that the file will only
;; change by growing at the end. It only appends the new output,
;; instead of reverting the entire buffer. It does so even if the
;; buffer contains unsaved changes. (Because they will not be lost.)
;; Usage: ;; Usage:
;; ;;
;; Go to the appropriate buffer and press: ;; Go to the appropriate buffer and press either of:
;; M-x auto-revert-mode RET ;; M-x auto-revert-mode RET
;; M-x auto-revert-tail-mode RET
;; ;;
;; To activate Global Auto-Revert Mode, press: ;; To activate Global Auto-Revert Mode, press:
;; M-x global-auto-revert-mode RET ;; M-x global-auto-revert-mode RET
@ -105,13 +114,18 @@ Global Auto-Revert Mode applies to all buffers."
;; Variables: ;; Variables:
;; Autoload for the benefit of `make-mode-line-mouse-sensitive'. ;;; What's this?: ;; Autoload for the benefit of `make-mode-line-mouse-sensitive'.
;;;###autoload ;;; What's this?: ;;;###autoload
(defvar auto-revert-mode nil (defvar auto-revert-mode nil
"*Non-nil when Auto-Revert Mode is active. "*Non-nil when Auto-Revert Mode is active.
Never set this variable directly, use the command `auto-revert-mode' instead.") Never set this variable directly, use the command `auto-revert-mode' instead.")
(put 'auto-revert-mode 'permanent-local t) (put 'auto-revert-mode 'permanent-local t)
(defvar auto-revert-tail-mode nil
"*Non-nil when Auto-Revert Tail Mode is active.
Never set this variable directly, use the command `auto-revert-mode' instead.")
(put 'auto-revert-tail-mode 'permanent-local t)
(defvar auto-revert-timer nil (defvar auto-revert-timer nil
"Timer used by Auto-Revert Mode.") "Timer used by Auto-Revert Mode.")
@ -153,6 +167,13 @@ When non-nil, a message is generated whenever a file is reverted."
:group 'auto-revert :group 'auto-revert
:type 'string) :type 'string)
(defcustom auto-revert-tail-mode-text " Tail"
"String to display in the mode line when Auto-Revert Tail Mode is active.
\(When the string is not empty, make sure that it has a leading space.)"
:group 'auto-revert
:type 'string)
(defcustom auto-revert-mode-hook nil (defcustom auto-revert-mode-hook nil
"Functions to run when Auto-Revert Mode is activated." "Functions to run when Auto-Revert Mode is activated."
:tag "Auto Revert Mode Hook" ; To separate it from `global-...' :tag "Auto Revert Mode Hook" ; To separate it from `global-...'
@ -190,7 +211,7 @@ For more information, see Info node `(emacs-xtra)Autorevert'."
:type 'boolean :type 'boolean
:link '(info-link "(emacs-xtra)Autorevert")) :link '(info-link "(emacs-xtra)Autorevert"))
(defcustom global-auto-revert-ignore-modes '() (defcustom global-auto-revert-ignore-modes ()
"List of major modes Global Auto-Revert Mode should not check." "List of major modes Global Auto-Revert Mode should not check."
:group 'auto-revert :group 'auto-revert
:type '(repeat sexp)) :type '(repeat sexp))
@ -230,7 +251,7 @@ This variable becomes buffer local when set in any fashion.")
;; Internal variables: ;; Internal variables:
(defvar auto-revert-buffer-list '() (defvar auto-revert-buffer-list ()
"List of buffers in Auto-Revert Mode. "List of buffers in Auto-Revert Mode.
Note that only Auto-Revert Mode, never Global Auto-Revert Mode, adds Note that only Auto-Revert Mode, never Global Auto-Revert Mode, adds
@ -239,9 +260,16 @@ buffers to this list.
The timer function `auto-revert-buffers' is responsible for purging The timer function `auto-revert-buffers' is responsible for purging
the list of old buffers.") the list of old buffers.")
(defvar auto-revert-remaining-buffers '() (defvar auto-revert-remaining-buffers ()
"Buffers not checked when user input stopped execution.") "Buffers not checked when user input stopped execution.")
(defvar auto-revert-tail-pos 0
"Position of last known end of file.")
(add-hook 'find-file-hook
(lambda ()
(set (make-local-variable 'auto-revert-tail-pos)
(save-restriction (widen) (1- (point-max))))))
;; Functions: ;; Functions:
@ -251,7 +279,9 @@ the list of old buffers.")
With arg, turn Auto Revert mode on if and only if arg is positive. With arg, turn Auto Revert mode on if and only if arg is positive.
This is a minor mode that affects only the current buffer. This is a minor mode that affects only the current buffer.
Use `global-auto-revert-mode' to automatically revert all buffers." Use `global-auto-revert-mode' to automatically revert all buffers.
Use `auto-revert-tail-mode' if you know that the file will only grow
without being changed in the part that is already in the buffer."
nil auto-revert-mode-text nil nil auto-revert-mode-text nil
(if auto-revert-mode (if auto-revert-mode
(if (not (memq (current-buffer) auto-revert-buffer-list)) (if (not (memq (current-buffer) auto-revert-buffer-list))
@ -260,7 +290,8 @@ Use `global-auto-revert-mode' to automatically revert all buffers."
(delq (current-buffer) auto-revert-buffer-list))) (delq (current-buffer) auto-revert-buffer-list)))
(auto-revert-set-timer) (auto-revert-set-timer)
(when auto-revert-mode (when auto-revert-mode
(auto-revert-buffers))) (auto-revert-buffers)
(setq auto-revert-tail-mode nil)))
;;;###autoload ;;;###autoload
@ -272,6 +303,52 @@ This function is designed to be added to hooks, for example:
(auto-revert-mode 1)) (auto-revert-mode 1))
;;;###autoload
(define-minor-mode auto-revert-tail-mode
"Toggle reverting tail of buffer when file on disk grows.
With arg, turn Tail mode on iff arg is positive.
When Tail mode is enabled, the tail of the file is constantly
followed, as with the shell command `tail -f'. This means that
whenever the file grows on disk (presumably because some
background process is appending to it from time to time), this is
reflected in the current buffer.
You can edit the buffer and turn this mode off and on again as
you please. But make sure the background process has stopped
writing before you save the file!
Use `auto-revert-mode' for changes other than appends!"
:group 'find-file :lighter auto-revert-tail-mode-text
(when auto-revert-tail-mode
(unless buffer-file-name
(auto-revert-tail-mode 0)
(error "This buffer is not visiting a file"))
(if (and (buffer-modified-p)
(not auto-revert-tail-pos) ; library was loaded only after finding file
(not (y-or-n-p "Buffer is modified, so tail offset may be wrong. Proceed? ")))
(auto-revert-tail-mode 0)
;; else we might reappend our own end when we save
(add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t)
(or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position
(set (make-variable-buffer-local 'auto-revert-tail-pos)
(save-restriction (widen) (1- (point-max)))))
;; let auto-revert-mode set up the mechanism for us if it isn't already
(or auto-revert-mode
(let ((auto-revert-tail-mode t))
(auto-revert-mode 1)))
(setq auto-revert-mode nil))))
;;;###autoload
(defun turn-on-auto-revert-tail-mode ()
"Turn on Auto-Revert Tail Mode.
This function is designed to be added to hooks, for example:
(add-hook 'my-logfile-mode-hook 'turn-on-auto-revert-tail-mode)"
(auto-revert-tail-mode 1))
;;;###autoload ;;;###autoload
(define-minor-mode global-auto-revert-mode (define-minor-mode global-auto-revert-mode
"Revert any buffer when file on disk changes. "Revert any buffer when file on disk changes.
@ -298,12 +375,12 @@ will use an up-to-date value of `auto-revert-interval'"
(if (or global-auto-revert-mode auto-revert-buffer-list) (if (or global-auto-revert-mode auto-revert-buffer-list)
(run-with-timer auto-revert-interval (run-with-timer auto-revert-interval
auto-revert-interval auto-revert-interval
'auto-revert-buffers) 'auto-revert-buffers))))
nil)))
(defun auto-revert-active-p () (defun auto-revert-active-p ()
"Check if auto-revert is active (in current buffer or globally)." "Check if auto-revert is active (in current buffer or globally)."
(or auto-revert-mode (or auto-revert-mode
auto-revert-tail-mode
(and (and
global-auto-revert-mode global-auto-revert-mode
(not global-auto-revert-ignore-buffer) (not global-auto-revert-ignore-buffer)
@ -313,18 +390,20 @@ will use an up-to-date value of `auto-revert-interval'"
(defun auto-revert-handler () (defun auto-revert-handler ()
"Revert current buffer, if appropriate. "Revert current buffer, if appropriate.
This is an internal function used by Auto-Revert Mode." This is an internal function used by Auto-Revert Mode."
(unless (buffer-modified-p) (when (or auto-revert-tail-mode (not (buffer-modified-p)))
(let ((buffer (current-buffer)) revert eob eoblist) (let* ((buffer (current-buffer))
(or (and buffer-file-name (revert
(not (file-remote-p buffer-file-name)) (or (and buffer-file-name
(file-readable-p buffer-file-name) (not (file-remote-p buffer-file-name))
(not (verify-visited-file-modtime buffer)) (file-readable-p buffer-file-name)
(setq revert t)) (not (verify-visited-file-modtime buffer)))
(and (or auto-revert-mode global-auto-revert-non-file-buffers) (and (or auto-revert-mode
revert-buffer-function global-auto-revert-non-file-buffers)
(boundp 'buffer-stale-function) revert-buffer-function
(functionp buffer-stale-function) (boundp 'buffer-stale-function)
(setq revert (funcall buffer-stale-function t)))) (functionp buffer-stale-function)
(funcall buffer-stale-function t))))
eob eoblist)
(when revert (when revert
(when (and auto-revert-verbose (when (and auto-revert-verbose
(not (eq revert 'fast))) (not (eq revert 'fast)))
@ -340,7 +419,9 @@ This is an internal function used by Auto-Revert Mode."
(= (window-point window) (point-max)) (= (window-point window) (point-max))
(push window eoblist))) (push window eoblist)))
'no-mini t)) 'no-mini t))
(revert-buffer 'ignore-auto 'dont-ask 'preserve-modes) (if auto-revert-tail-mode
(auto-revert-tail-handler)
(revert-buffer 'ignore-auto 'dont-ask 'preserve-modes))
(when buffer-file-name (when buffer-file-name
(when eob (goto-char (point-max))) (when eob (goto-char (point-max)))
(dolist (window eoblist) (dolist (window eoblist)
@ -350,6 +431,22 @@ This is an internal function used by Auto-Revert Mode."
(when (or revert auto-revert-check-vc-info) (when (or revert auto-revert-check-vc-info)
(vc-find-file-hook))))) (vc-find-file-hook)))))
(defun auto-revert-tail-handler ()
(let ((size (nth 7 (file-attributes buffer-file-name)))
(modified (buffer-modified-p))
buffer-read-only ; ignore
(file buffer-file-name)
buffer-file-name) ; ignore that file has changed
(when (> size auto-revert-tail-pos)
(save-restriction
(widen)
(save-excursion
(goto-char (point-max))
(insert-file-contents file nil auto-revert-tail-pos size)))
(setq auto-revert-tail-pos size)
(set-buffer-modified-p modified)))
(set-visited-file-modtime))
(defun auto-revert-buffers () (defun auto-revert-buffers ()
"Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode. "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode.
@ -376,8 +473,8 @@ the timer when no buffers need to be checked."
(let ((bufs (if global-auto-revert-mode (let ((bufs (if global-auto-revert-mode
(buffer-list) (buffer-list)
auto-revert-buffer-list)) auto-revert-buffer-list))
(remaining '()) (remaining ())
(new '())) (new ()))
;; Partition `bufs' into two halves depending on whether or not ;; Partition `bufs' into two halves depending on whether or not
;; the buffers are in `auto-revert-remaining-buffers'. The two ;; the buffers are in `auto-revert-remaining-buffers'. The two
;; halves are then re-joined with the "remaining" buffers at the ;; halves are then re-joined with the "remaining" buffers at the
@ -398,6 +495,7 @@ the timer when no buffers need to be checked."
;; Test if someone has turned off Auto-Revert Mode in a ;; Test if someone has turned off Auto-Revert Mode in a
;; non-standard way, for example by changing major mode. ;; non-standard way, for example by changing major mode.
(if (and (not auto-revert-mode) (if (and (not auto-revert-mode)
(not auto-revert-tail-mode)
(memq buf auto-revert-buffer-list)) (memq buf auto-revert-buffer-list))
(setq auto-revert-buffer-list (setq auto-revert-buffer-list
(delq buf auto-revert-buffer-list))) (delq buf auto-revert-buffer-list)))

View file

@ -404,12 +404,12 @@ Menu of mode operations in the mode line.")
(define-key mode-line-mode-menu [highlight-changes-mode] (define-key mode-line-mode-menu [highlight-changes-mode]
`(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode `(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode
:button (:toggle . highlight-changes-mode))) :button (:toggle . highlight-changes-mode)))
(define-key mode-line-mode-menu [glasses-mode]
`(menu-item ,(purecopy "Glasses (o^o)") glasses-mode
:button (:toggle . (bound-and-true-p glasses-mode))))
(define-key mode-line-mode-menu [hide-ifdef-mode] (define-key mode-line-mode-menu [hide-ifdef-mode]
`(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode `(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode
:button (:toggle . (bound-and-true-p hide-ifdef-mode)))) :button (:toggle . (bound-and-true-p hide-ifdef-mode))))
(define-key mode-line-mode-menu [glasses-mode]
`(menu-item ,(purecopy "Glasses (o^o)") glasses-mode
:button (:toggle . (bound-and-true-p glasses-mode))))
(define-key mode-line-mode-menu [font-lock-mode] (define-key mode-line-mode-menu [font-lock-mode]
`(menu-item ,(purecopy "Font Lock") font-lock-mode `(menu-item ,(purecopy "Font Lock") font-lock-mode
:button (:toggle . font-lock-mode))) :button (:toggle . font-lock-mode)))
@ -419,12 +419,15 @@ Menu of mode operations in the mode line.")
(define-key mode-line-mode-menu [column-number-mode] (define-key mode-line-mode-menu [column-number-mode]
`(menu-item ,(purecopy "Column number") column-number-mode `(menu-item ,(purecopy "Column number") column-number-mode
:button (:toggle . column-number-mode))) :button (:toggle . column-number-mode)))
(define-key mode-line-mode-menu [auto-fill-mode] (define-key mode-line-mode-menu [auto-revert-tail-mode]
`(menu-item ,(purecopy "Auto Fill (Fill)") auto-fill-mode `(menu-item ,(purecopy "Auto revert tail (Tail)") auto-revert-tail-mode
:button (:toggle . auto-fill-function))) :button (:toggle . auto-revert-tail-mode)))
(define-key mode-line-mode-menu [auto-revert-mode] (define-key mode-line-mode-menu [auto-revert-mode]
`(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode `(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode
:button (:toggle . auto-revert-mode))) :button (:toggle . auto-revert-mode)))
(define-key mode-line-mode-menu [auto-fill-mode]
`(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode
:button (:toggle . auto-fill-function)))
(define-key mode-line-mode-menu [abbrev-mode] (define-key mode-line-mode-menu [abbrev-mode]
`(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode `(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode
:button (:toggle . abbrev-mode))) :button (:toggle . abbrev-mode)))

View file

@ -613,7 +613,7 @@ For more information, see the function `buffer-menu'."
" " " "
(Buffer-menu-make-sort-button "Mode" 4) mode-end (Buffer-menu-make-sort-button "Mode" 4) mode-end
(Buffer-menu-make-sort-button "File" 5) "\n")) (Buffer-menu-make-sort-button "File" 5) "\n"))
list desired-point name file) list desired-point name mode file)
(when Buffer-menu-use-header-line (when Buffer-menu-use-header-line
(let ((pos 0)) (let ((pos 0))
;; Turn spaces in the header into stretch specs so they work ;; Turn spaces in the header into stretch specs so they work
@ -638,8 +638,14 @@ For more information, see the function `buffer-menu'."
(mapcar (mapcar
(lambda (buffer) (lambda (buffer)
(with-current-buffer buffer (with-current-buffer buffer
(setq name (buffer-name) (save-window-excursion
file (buffer-file-name)) (setq name (buffer-name)
mode (progn
(set-window-buffer (selected-window) buffer)
(concat (format-mode-line mode-name)
(if mode-line-process
(format-mode-line mode-line-process))))
file (buffer-file-name)))
(cond (cond
;; Don't mention internal buffers. ;; Don't mention internal buffers.
((and (string= (substring name 0 1) " ") (null file))) ((and (string= (substring name 0 1) " ") (null file)))
@ -665,7 +671,7 @@ For more information, see the function `buffer-menu'."
?% ? ) ?% ? )
;; Identify modified buffers. ;; Identify modified buffers.
(if (buffer-modified-p) ?* ? )) (if (buffer-modified-p) ?* ? ))
name (buffer-size) mode-name file))))) name (buffer-size) mode file)))))
(buffer-list)))) (buffer-list))))
(dolist (buffer (dolist (buffer
(if Buffer-menu-sort-column (if Buffer-menu-sort-column

View file

@ -70,14 +70,14 @@ absolute date ABS-DATE is the equivalent moment to X."
(defun calendar-time-from-absolute (abs-date s) (defun calendar-time-from-absolute (abs-date s)
"Time of absolute date ABS-DATE, S seconds after midnight. "Time of absolute date ABS-DATE, S seconds after midnight.
Returns the pair (HIGH . LOW) where HIGH and LOW are the high and low Returns the list (HIGH LOW) where HIGH and LOW are the high and low
16 bits, respectively, of the number of seconds 1970-01-01 00:00:00 UTC, 16 bits, respectively, of the number of seconds 1970-01-01 00:00:00 UTC,
ignoring leap seconds, that is the equivalent moment to S seconds after ignoring leap seconds, that is the equivalent moment to S seconds after
midnight UTC on absolute date ABS-DATE." midnight UTC on absolute date ABS-DATE."
(let* ((a (- abs-date calendar-system-time-basis)) (let* ((a (- abs-date calendar-system-time-basis))
(u (+ (* 163 (mod a 512)) (floor s 128)))) (u (+ (* 163 (mod a 512)) (floor s 128))))
;; Overflow is a terrible thing! ;; Overflow is a terrible thing!
(cons (list
;; floor((60*60*24*a + s) / 2^16) ;; floor((60*60*24*a + s) / 2^16)
(+ a (* 163 (floor a 512)) (floor u 512)) (+ a (* 163 (floor a 512)) (floor u 512))
;; (60*60*24*a + s) mod 2^16 ;; (60*60*24*a + s) mod 2^16

View file

@ -620,8 +620,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
(modtime (visited-file-modtime))) (modtime (visited-file-modtime)))
(or (eq modtime 0) (or (eq modtime 0)
(not (eq (car attributes) t)) (not (eq (car attributes) t))
(and (= (car (nth 5 attributes)) (car modtime)) (equal (nth 5 attributes) modtime)))))
(= (nth 1 (nth 5 attributes)) (cdr modtime)))))))
(defun dired-buffer-stale-p (&optional noconfirm) (defun dired-buffer-stale-p (&optional noconfirm)
"Return non-nil if current dired buffer needs updating. "Return non-nil if current dired buffer needs updating.

View file

@ -38,9 +38,9 @@
;; instrumentation callbacks, then replace edebug's callbacks with ours. ;; instrumentation callbacks, then replace edebug's callbacks with ours.
;; * To show good coverage, we want to see two values for every form, except ;; * To show good coverage, we want to see two values for every form, except
;; functions that always return the same value and `defconst' variables ;; functions that always return the same value and `defconst' variables
;; need show only value for good coverage. To avoid the brown splotch, the ;; need show only one value for good coverage. To avoid the brown
;; definitions for constants and 1-valued functions must precede the ;; splotch, the definitions for constants and 1-valued functions must
;; references. ;; precede the references.
;; * Use the macro `1value' in your Lisp code to mark spots where the local ;; * Use the macro `1value' in your Lisp code to mark spots where the local
;; code environment causes a function or variable to always have the same ;; code environment causes a function or variable to always have the same
;; value, but the function or variable is not intrinsically 1-valued. ;; value, but the function or variable is not intrinsically 1-valued.
@ -55,12 +55,14 @@
;; call has the same value! Also, equal thinks two strings are the same ;; call has the same value! Also, equal thinks two strings are the same
;; if they differ only in properties. ;; if they differ only in properties.
;; * Because we have only a "1value" class and no "always nil" class, we have ;; * Because we have only a "1value" class and no "always nil" class, we have
;; to treat as 1-valued any `and' whose last term is 1-valued, in case the ;; to treat as potentially 1-valued any `and' whose last term is 1-valued,
;; last term is always nil. Example: ;; in case the last term is always nil. Example:
;; (and (< (point) 1000) (forward-char 10)) ;; (and (< (point) 1000) (forward-char 10))
;; This form always returns nil. Similarly, `if' and `cond' are ;; This form always returns nil. Similarly, `or', `if', and `cond' are
;; treated as 1-valued if all clauses are, in case those values are ;; treated as potentially 1-valued if all clauses are, in case those
;; always nil. ;; values are always nil. Unlike truly 1-valued functions, it is not an
;; error if these "potentially" 1-valued forms actually return differing
;; values.
(require 'edebug) (require 'edebug)
(provide 'testcover) (provide 'testcover)
@ -86,12 +88,14 @@ these. This list is quite incomplete!"
(defcustom testcover-1value-functions (defcustom testcover-1value-functions
'(backward-char barf-if-buffer-read-only beginning-of-line '(backward-char barf-if-buffer-read-only beginning-of-line
buffer-disable-undo buffer-enable-undo current-global-map deactivate-mark buffer-disable-undo buffer-enable-undo current-global-map
delete-char delete-region ding error forward-char function* insert deactivate-mark delete-backward-char delete-char delete-region ding
insert-and-inherit kill-all-local-variables lambda mapc narrow-to-region forward-char function* insert insert-and-inherit kill-all-local-variables
noreturn push-mark put-text-property run-hooks set-text-properties signal kill-line kill-paragraph kill-region kill-sexp lambda
substitute-key-definition suppress-keymap throw undo use-local-map while minibuffer-complete-and-exit narrow-to-region next-line push-mark
widen yank) put-text-property run-hooks set-match-data signal
substitute-key-definition suppress-keymap undo use-local-map while widen
yank)
"Functions that always return the same value. No brown splotch is shown "Functions that always return the same value. No brown splotch is shown
for these. This list is quite incomplete! Notes: Nobody ever changes the for these. This list is quite incomplete! Notes: Nobody ever changes the
current global map. The macro `lambda' is self-evaluating, hence always current global map. The macro `lambda' is self-evaluating, hence always
@ -108,9 +112,9 @@ them as having returned nil just before calling them."
:type 'hook) :type 'hook)
(defcustom testcover-compose-functions (defcustom testcover-compose-functions
'(+ - * / length list make-keymap make-sparse-keymap message propertize '(+ - * / = append length list make-keymap make-sparse-keymap
replace-regexp-in-string run-with-idle-timer mapcar message propertize replace-regexp-in-string
set-buffer-modified-p) run-with-idle-timer set-buffer-modified-p)
"Functions that are 1-valued if all their args are either constants or "Functions that are 1-valued if all their args are either constants or
calls to one of the `testcover-1value-functions', so if that's true then no calls to one of the `testcover-1value-functions', so if that's true then no
brown splotch is shown for these. This list is quite incomplete! Most brown splotch is shown for these. This list is quite incomplete! Most
@ -119,16 +123,16 @@ side-effect-free functions should be here."
:type 'hook) :type 'hook)
(defcustom testcover-progn-functions (defcustom testcover-progn-functions
'(define-key fset function goto-char or overlay-put progn save-current-buffer '(define-key fset function goto-char mapc overlay-put progn
save-excursion save-match-data save-restriction save-selected-window save-current-buffer save-excursion save-match-data
save-window-excursion set set-default setq setq-default save-restriction save-selected-window save-window-excursion
with-output-to-temp-buffer with-syntax-table with-temp-buffer set set-default set-marker-insertion-type setq setq-default
with-temp-file with-temp-message with-timeout) with-current-buffer with-output-to-temp-buffer with-syntax-table
with-temp-buffer with-temp-file with-temp-message with-timeout)
"Functions whose return value is the same as their last argument. No "Functions whose return value is the same as their last argument. No
brown splotch is shown for these if the last argument is a constant or a brown splotch is shown for these if the last argument is a constant or a
call to one of the `testcover-1value-functions'. This list is probably call to one of the `testcover-1value-functions'. This list is probably
incomplete! Note: `or' is here in case the last argument is a function that incomplete!"
always returns nil."
:group 'testcover :group 'testcover
:type 'hook) :type 'hook)
@ -140,6 +144,11 @@ call to one of the `testcover-1value-functions'."
:group 'testcover :group 'testcover
:type 'hook) :type 'hook)
(defcustom testcover-potentially-1value-functions
'(add-hook and beep or remove-hook unless when)
"Functions that are potentially 1-valued. No brown splotch if actually
1-valued, no error if actually multi-valued.")
(defface testcover-nohits-face (defface testcover-nohits-face
'((t (:background "DeepPink2"))) '((t (:background "DeepPink2")))
"Face for forms that had no hits during coverage test" "Face for forms that had no hits during coverage test"
@ -161,7 +170,11 @@ call to one of the `testcover-1value-functions'."
(defvar testcover-module-1value-functions nil (defvar testcover-module-1value-functions nil
"Symbols declared with defun in the last file processed by "Symbols declared with defun in the last file processed by
`testcover-start', whose functions always return the same value.") `testcover-start', whose functions should always return the same value.")
(defvar testcover-module-potentially-1value-functions nil
"Symbols declared with defun in the last file processed by
`testcover-start', whose functions might always return the same value.")
(defvar testcover-vector nil (defvar testcover-vector nil
"Locally bound to coverage vector for function in progress.") "Locally bound to coverage vector for function in progress.")
@ -206,25 +219,32 @@ non-nil, byte-compiles each function after instrumenting."
x)) x))
(defun testcover-reinstrument (form) (defun testcover-reinstrument (form)
"Reinstruments FORM to use testcover instead of edebug. This function "Reinstruments FORM to use testcover instead of edebug. This
modifies the list that FORM points to. Result is non-nil if FORM will function modifies the list that FORM points to. Result is nil if
always return the same value." FORM should return multiple vlues, t if should always return same
value, 'maybe if either is acceptable."
(let ((fun (car-safe form)) (let ((fun (car-safe form))
id) id val)
(cond (cond
((not fun) ;Atom ((not fun) ;Atom
(or (not (symbolp form)) (when (or (not (symbolp form))
(memq form testcover-constants) (memq form testcover-constants)
(memq form testcover-module-constants))) (memq form testcover-module-constants))
((consp fun) ;Embedded list t))
((consp fun) ;Embedded list
(testcover-reinstrument fun) (testcover-reinstrument fun)
(testcover-reinstrument-list (cdr form)) (testcover-reinstrument-list (cdr form))
nil) nil)
((or (memq fun testcover-1value-functions) ((or (memq fun testcover-1value-functions)
(memq fun testcover-module-1value-functions)) (memq fun testcover-module-1value-functions))
;;Always return same value ;;Should always return same value
(testcover-reinstrument-list (cdr form)) (testcover-reinstrument-list (cdr form))
t) t)
((or (memq fun testcover-potentially-1value-functions)
(memq fun testcover-module-potentially-1value-functions))
;;Might always return same value
(testcover-reinstrument-list (cdr form))
'maybe)
((memq fun testcover-progn-functions) ((memq fun testcover-progn-functions)
;;1-valued if last argument is ;;1-valued if last argument is
(testcover-reinstrument-list (cdr form))) (testcover-reinstrument-list (cdr form)))
@ -233,11 +253,9 @@ always return the same value."
(testcover-reinstrument-list (cddr form)) (testcover-reinstrument-list (cddr form))
(testcover-reinstrument (cadr form))) (testcover-reinstrument (cadr form)))
((memq fun testcover-compose-functions) ((memq fun testcover-compose-functions)
;;1-valued if all arguments are ;;1-valued if all arguments are. Potentially 1-valued if all
(setq id t) ;;arguments are either definitely or potentially.
(mapc #'(lambda (x) (setq id (or (testcover-reinstrument x) id))) (testcover-reinstrument-compose (cdr form) 'testcover-reinstrument))
(cdr form))
id)
((eq fun 'edebug-enter) ((eq fun 'edebug-enter)
;;(edebug-enter 'SYM ARGS #'(lambda nil FORMS)) ;;(edebug-enter 'SYM ARGS #'(lambda nil FORMS))
;; => (testcover-enter 'SYM #'(lambda nil FORMS)) ;; => (testcover-enter 'SYM #'(lambda nil FORMS))
@ -252,33 +270,44 @@ always return the same value."
(aset testcover-vector (cadr (cadr form)) 'ok-coverage)) (aset testcover-vector (cadr (cadr form)) 'ok-coverage))
(setq id (nth 2 form)) (setq id (nth 2 form))
(setcdr form (nthcdr 2 form)) (setcdr form (nthcdr 2 form))
(setq val (testcover-reinstrument (nth 2 form)))
(if (eq val t)
(setcar form 'testcover-1value)
(setcar form 'testcover-after))
(when val
;;1-valued or potentially 1-valued
(aset testcover-vector id '1value))
(cond (cond
((memq (car-safe (nth 2 form)) testcover-noreturn-functions) ((memq (car-safe (nth 2 form)) testcover-noreturn-functions)
;;This function won't return, so set the value in advance ;;This function won't return, so set the value in advance
;;(edebug-after (edebug-before XXX) YYY FORM) ;;(edebug-after (edebug-before XXX) YYY FORM)
;; => (progn (edebug-after YYY nil) FORM) ;; => (progn (edebug-after YYY nil) FORM)
(setcar (cdr form) `(,(car form) ,id nil))
(setcar form 'progn) (setcar form 'progn)
(setcar (cdr form) `(testcover-after ,id nil))) (aset testcover-vector id '1value)
(setq val t))
((eq (car-safe (nth 2 form)) '1value) ((eq (car-safe (nth 2 form)) '1value)
;;This function is always supposed to return the same value ;;This function is always supposed to return the same value
(setcar form 'testcover-1value)) (setq val t)
(t (aset testcover-vector id '1value)
(setcar form 'testcover-after))) (setcar form 'testcover-1value)))
(when (testcover-reinstrument (nth 2 form)) val)
(aset testcover-vector id '1value)))
((eq fun 'defun) ((eq fun 'defun)
(if (testcover-reinstrument-list (nthcdr 3 form)) (setq val (testcover-reinstrument-list (nthcdr 3 form)))
(push (cadr form) testcover-module-1value-functions))) (when (eq val t)
((eq fun 'defconst) (push (cadr form) testcover-module-1value-functions))
(when (eq val 'maybe)
(push (cadr form) testcover-module-potentially-1value-functions)))
((memq fun '(defconst defcustom))
;;Define this symbol as 1-valued ;;Define this symbol as 1-valued
(push (cadr form) testcover-module-constants) (push (cadr form) testcover-module-constants)
(testcover-reinstrument-list (cddr form))) (testcover-reinstrument-list (cddr form)))
((memq fun '(dotimes dolist)) ((memq fun '(dotimes dolist))
;;Always returns third value from SPEC ;;Always returns third value from SPEC
(testcover-reinstrument-list (cddr form)) (testcover-reinstrument-list (cddr form))
(setq fun (testcover-reinstrument-list (cadr form))) (setq val (testcover-reinstrument-list (cadr form)))
(if (nth 2 (cadr form)) (if (nth 2 (cadr form))
fun val
;;No third value, always returns nil ;;No third value, always returns nil
t)) t))
((memq fun '(let let*)) ((memq fun '(let let*))
@ -286,23 +315,23 @@ always return the same value."
(mapc 'testcover-reinstrument-list (cadr form)) (mapc 'testcover-reinstrument-list (cadr form))
(testcover-reinstrument-list (cddr form))) (testcover-reinstrument-list (cddr form)))
((eq fun 'if) ((eq fun 'if)
;;1-valued if both THEN and ELSE clauses are ;;Potentially 1-valued if both THEN and ELSE clauses are
(testcover-reinstrument (cadr form)) (testcover-reinstrument (cadr form))
(let ((then (testcover-reinstrument (nth 2 form))) (let ((then (testcover-reinstrument (nth 2 form)))
(else (testcover-reinstrument-list (nthcdr 3 form)))) (else (testcover-reinstrument-list (nthcdr 3 form))))
(and then else))) (and then else 'maybe)))
((memq fun '(when unless and))
;;1-valued if last clause of BODY is
(testcover-reinstrument-list (cdr form)))
((eq fun 'cond) ((eq fun 'cond)
;;1-valued if all clauses are ;;Potentially 1-valued if all clauses are
(testcover-reinstrument-clauses (cdr form))) (when (testcover-reinstrument-compose (cdr form)
'testcover-reinstrument-list)
'maybe))
((eq fun 'condition-case) ((eq fun 'condition-case)
;;1-valued if BODYFORM is and all HANDLERS are ;;Potentially 1-valued if BODYFORM is and all HANDLERS are
(let ((body (testcover-reinstrument (nth 2 form))) (let ((body (testcover-reinstrument (nth 2 form)))
(errs (testcover-reinstrument-clauses (mapcar #'cdr (errs (testcover-reinstrument-compose
(nthcdr 3 form))))) (mapcar #'cdr (nthcdr 3 form))
(and body errs))) 'testcover-reinstrument-list)))
(and body errs 'maybe)))
((eq fun 'quote) ((eq fun 'quote)
;;Don't reinstrument what's inside! ;;Don't reinstrument what's inside!
;;This doesn't apply within a backquote ;;This doesn't apply within a backquote
@ -317,16 +346,55 @@ always return the same value."
(let ((testcover-1value-functions (let ((testcover-1value-functions
(remq 'quote testcover-1value-functions))) (remq 'quote testcover-1value-functions)))
(testcover-reinstrument (cadr form)))) (testcover-reinstrument (cadr form))))
((memq fun '(1value noreturn)) ((eq fun '1value)
;;Hack - pretend the arg is 1-valued here ;;Hack - pretend the arg is 1-valued here
(if (symbolp (cadr form)) ;A pseudoconstant variable (cond
t ((symbolp (cadr form))
;;A pseudoconstant variable
t)
((and (eq (car (cadr form)) 'edebug-after)
(symbolp (nth 3 (cadr form))))
;;Reference to pseudoconstant
(aset testcover-vector (nth 2 (cadr form)) '1value)
(setcar (cdr form) `(testcover-1value ,(nth 2 (cadr form))
,(nth 3 (cadr form))))
t)
(t
(if (eq (car (cadr form)) 'edebug-after) (if (eq (car (cadr form)) 'edebug-after)
(setq id (car (nth 3 (cadr form)))) (setq id (car (nth 3 (cadr form))))
(setq id (car (cadr form)))) (setq id (car (cadr form))))
(let ((testcover-1value-functions (let ((testcover-1value-functions
(cons id testcover-1value-functions))) (cons id testcover-1value-functions)))
(testcover-reinstrument (cadr form))))) (testcover-reinstrument (cadr form))))))
((eq fun 'noreturn)
;;Hack - pretend the arg has no return
(cond
((symbolp (cadr form))
;;A pseudoconstant variable
'maybe)
((and (eq (car (cadr form)) 'edebug-after)
(symbolp (nth 3 (cadr form))))
;;Reference to pseudoconstant
(aset testcover-vector (nth 2 (cadr form)) '1value)
(setcar (cdr form) `(progn (testcover-after ,(nth 2 (cadr form)) nil)
,(nth 3 (cadr form))))
'maybe)
(t
(if (eq (car (cadr form)) 'edebug-after)
(setq id (car (nth 3 (cadr form))))
(setq id (car (cadr form))))
(let ((testcover-noreturn-functions
(cons id testcover-noreturn-functions)))
(testcover-reinstrument (cadr form))))))
((and (eq fun 'apply)
(eq (car-safe (cadr form)) 'quote)
(symbolp (cadr (cadr form))))
;;Apply of a constant symbol. Process as 1value or noreturn
;;depending on symbol.
(setq fun (cons (cadr (cadr form)) (cddr form))
val (testcover-reinstrument fun))
(setcdr (cdr form) (cdr fun))
val)
(t ;Some other function or weird thing (t ;Some other function or weird thing
(testcover-reinstrument-list (cdr form)) (testcover-reinstrument-list (cdr form))
nil)))) nil))))
@ -341,13 +409,22 @@ always be nil, so we return t for 1-valued."
(setq result (testcover-reinstrument (pop list)))) (setq result (testcover-reinstrument (pop list))))
result)) result))
(defun testcover-reinstrument-clauses (clauselist) (defun testcover-reinstrument-compose (list fun)
"Reinstrument each list in CLAUSELIST. "For a compositional function, the result is 1-valued if all
Result is t if every clause is 1-valued." arguments are, potentially 1-valued if all arguments are either
definitely or potentially 1-valued, and multi-valued otherwise.
FUN should be `testcover-reinstrument' for compositional functions,
`testcover-reinstrument-list' for clauses in a `cond'."
(let ((result t)) (let ((result t))
(mapc #'(lambda (x) (mapc #'(lambda (x)
(setq result (and (testcover-reinstrument-list x) result))) (setq x (funcall fun x))
clauselist) (cond
((eq result t)
(setq result x))
((eq result 'maybe)
(when (not x)
(setq result nil)))))
list)
result)) result))
(defun testcover-end (buffer) (defun testcover-end (buffer)
@ -387,7 +464,7 @@ same value during coverage testing."
(aset testcover-vector idx (cons '1value val))) (aset testcover-vector idx (cons '1value val)))
((not (and (eq (car-safe (aref testcover-vector idx)) '1value) ((not (and (eq (car-safe (aref testcover-vector idx)) '1value)
(equal (cdr (aref testcover-vector idx)) val))) (equal (cdr (aref testcover-vector idx)) val)))
(error "Value of form marked with `1value' does vary."))) (error "Value of form marked with `1value' does vary: %s" val)))
val) val)
@ -415,7 +492,7 @@ eliminated by adding more test cases."
ov j item) ov j item)
(or (and def-mark points coverage) (or (and def-mark points coverage)
(error "Missing edebug data for function %s" def)) (error "Missing edebug data for function %s" def))
(when len (when (> len 0)
(set-buffer (marker-buffer def-mark)) (set-buffer (marker-buffer def-mark))
(mapc 'delete-overlay (mapc 'delete-overlay
(overlays-in def-mark (+ def-mark (aref points (1- len)) 1))) (overlays-in def-mark (+ def-mark (aref points (1- len)) 1)))

View file

@ -974,6 +974,13 @@ Extra commands should be added to `cua-movement-commands'")
(defvar cua-movement-commands nil (defvar cua-movement-commands nil
"User may add additional movement commands to this list.") "User may add additional movement commands to this list.")
(defvar cua--preserve-mark-commands
'(end-of-buffer beginning-of-buffer)
"List of movement commands that move the mark.
CUA will preserve the previous mark position if a mark is already
active before one of these commands is executed.")
(defvar cua--undo-push-mark nil)
;;; Scrolling commands which does not signal errors at top/bottom ;;; Scrolling commands which does not signal errors at top/bottom
;;; of buffer at first key-press (instead moves to top/bottom ;;; 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."
;; If rectangle is active, expand rectangle in specified direction and ignore the movement. ;; If rectangle is active, expand rectangle in specified direction and ignore the movement.
(if movement (if movement
(cond (cond
((memq 'shift (event-modifiers (aref (this-single-command-raw-keys) 0))) ((memq 'shift (event-modifiers
(unless mark-active (aref (if window-system
(this-single-command-raw-keys)
(this-single-command-keys)) 0)))
(if mark-active
(if (and (memq this-command cua--preserve-mark-commands)
(not inhibit-mark-movement))
(setq cua--undo-push-mark t
inhibit-mark-movement t))
(push-mark-command nil t)) (push-mark-command nil t))
(setq cua--last-region-shifted t) (setq cua--last-region-shifted t)
(setq cua--explicit-region-start nil)) (setq cua--explicit-region-start nil))
@ -1110,6 +1124,9 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(defun cua--post-command-handler () (defun cua--post-command-handler ()
(condition-case nil (condition-case nil
(progn (progn
(when cua--undo-push-mark
(setq cua--undo-push-mark nil
inhibit-mark-movement nil))
(when cua--global-mark-active (when cua--global-mark-active
(cua--global-mark-post-command)) (cua--global-mark-post-command))
(when (fboundp 'cua--rectangle-post-command) (when (fboundp 'cua--rectangle-post-command)

View file

@ -693,7 +693,7 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
;; If the keywords were compiled before, compile them again. ;; If the keywords were compiled before, compile them again.
(if was-compiled (if was-compiled
(set (make-local-variable 'font-lock-keywords) (set (make-local-variable 'font-lock-keywords)
(font-lock-compile-keywords keywords t))))))) (font-lock-compile-keywords font-lock-keywords t)))))))
(defun font-lock-update-removed-keyword-alist (mode keywords append) (defun font-lock-update-removed-keyword-alist (mode keywords append)
;; Update `font-lock-removed-keywords-alist' when adding new ;; Update `font-lock-removed-keywords-alist' when adding new
@ -801,7 +801,7 @@ subtle problems due to details of the implementation."
;; If the keywords were compiled before, compile them again. ;; If the keywords were compiled before, compile them again.
(if was-compiled (if was-compiled
(set (make-local-variable 'font-lock-keywords) (set (make-local-variable 'font-lock-keywords)
(font-lock-compile-keywords keywords t))))))) (font-lock-compile-keywords font-lock-keywords t)))))))
;;; Font Lock Support mode. ;;; Font Lock Support mode.
@ -1944,12 +1944,12 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
'("when" "unless" "case" "ecase" "typecase" "etypecase" '("when" "unless" "case" "ecase" "typecase" "etypecase"
"ccase" "ctypecase" "handler-case" "handler-bind" "ccase" "ctypecase" "handler-case" "handler-bind"
"restart-bind" "restart-case" "in-package" "restart-bind" "restart-case" "in-package"
"cerror" "break" "ignore-errors" "break" "ignore-errors"
"loop" "do" "do*" "dotimes" "dolist" "the" "locally" "loop" "do" "do*" "dotimes" "dolist" "the" "locally"
"proclaim" "declaim" "declare" "symbol-macrolet" "proclaim" "declaim" "declare" "symbol-macrolet"
"lexical-let" "lexical-let*" "flet" "labels" "compiler-let" "lexical-let" "lexical-let*" "flet" "labels" "compiler-let"
"destructuring-bind" "macrolet" "tagbody" "block" "destructuring-bind" "macrolet" "tagbody" "block" "go"
"multiple-value-bind" "multiple-value-bind" "multiple-value-prog1"
"return" "return-from" "return" "return-from"
"with-accessors" "with-compilation-unit" "with-accessors" "with-compilation-unit"
"with-condition-restarts" "with-hash-table-iterator" "with-condition-restarts" "with-hash-table-iterator"
@ -1967,7 +1967,7 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
'(2 font-lock-constant-face nil t)) '(2 font-lock-constant-face nil t))
;; ;;
;; Erroneous structures. ;; Erroneous structures.
'("(\\(abort\\|assert\\|error\\|signal\\)\\>" 1 font-lock-warning-face) '("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\>" 1 font-lock-warning-face)
;; ;;
;; Words inside \\[] tend to be for `substitute-command-keys'. ;; Words inside \\[] tend to be for `substitute-command-keys'.
'("\\\\\\\\\\[\\(\\sw+\\)]" 1 font-lock-constant-face prepend) '("\\\\\\\\\\[\\(\\sw+\\)]" 1 font-lock-constant-face prepend)

View file

@ -87,8 +87,11 @@ If nil, no blank line will be inserted."
;;; Interface variables that probably shouldn't be changed ;;; Interface variables that probably shouldn't be changed
(defconst footnote-section-tag "Footnotes: " (defcustom footnote-section-tag "Footnotes: "
"*Tag inserted at beginning of footnote section.") "*Tag inserted at beginning of footnote section."
:version "21.4"
:type 'string
:group 'footnote)
(defcustom footnote-section-tag-regexp "Footnotes\\(\\[.\\]\\)?: " (defcustom footnote-section-tag-regexp "Footnotes\\(\\[.\\]\\)?: "
"*Regexp which indicates the start of a footnote section. "*Regexp which indicates the start of a footnote section.

View file

@ -180,7 +180,7 @@ are removed." t nil)
;;;*** ;;;***
;;;### (autoloads (mh-goto-cur-msg mh-update-sequences mh-folder-line-matches-show-buffer-p) ;;;### (autoloads (mh-goto-cur-msg mh-update-sequences mh-folder-line-matches-show-buffer-p)
;;;;;; "mh-e" "mh-e.el" (16627 18152)) ;;;;;; "mh-e" "mh-e.el" (16627 22341))
;;; Generated autoloads from mh-e.el ;;; Generated autoloads from mh-e.el
(autoload (quote mh-folder-line-matches-show-buffer-p) "mh-e" "\ (autoload (quote mh-folder-line-matches-show-buffer-p) "mh-e" "\

View file

@ -1012,7 +1012,7 @@ Domain names in USER and port numbers in HOST are acknowledged."
(when real-user (when real-user
(let ((pw-prompt "Password:")) (let ((pw-prompt "Password:"))
(tramp-message 9 "Sending password") (tramp-message 9 "Sending password")
(tramp-enter-password p pw-prompt))) (tramp-enter-password p pw-prompt user host)))
(unless (tramp-smb-wait-for-output user host) (unless (tramp-smb-wait-for-output user host)
(tramp-clear-passwd user host) (tramp-clear-passwd user host)

View file

@ -77,7 +77,7 @@
"Like `vc-do-command' but invoked for tramp files. "Like `vc-do-command' but invoked for tramp files.
See `vc-do-command' for more information." See `vc-do-command' for more information."
(save-match-data (save-match-data
(and file (setq file (tramp-handle-expand-file-name file))) (and file (setq file (expand-file-name file)))
(if (not buffer) (setq buffer "*vc*")) (if (not buffer) (setq buffer "*vc*"))
(if vc-command-messages (if vc-command-messages
(message "Running `%s' on `%s'..." command file)) (message "Running `%s' on `%s'..." command file))
@ -85,7 +85,7 @@ See `vc-do-command' for more information."
(squeezed nil) (squeezed nil)
(olddir default-directory) (olddir default-directory)
vc-file status) vc-file status)
(let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) (let* ((v (tramp-dissect-file-name (expand-file-name file)))
(multi-method (tramp-file-name-multi-method v)) (multi-method (tramp-file-name-multi-method v))
(method (tramp-file-name-method v)) (method (tramp-file-name-method v))
(user (tramp-file-name-user v)) (user (tramp-file-name-user v))
@ -130,7 +130,7 @@ See `vc-do-command' for more information."
(save-excursion (save-excursion
(save-window-excursion (save-window-excursion
;; Actually execute remote command ;; Actually execute remote command
(tramp-handle-shell-command (shell-command
(mapconcat 'tramp-shell-quote-argument (mapconcat 'tramp-shell-quote-argument
(cons command squeezed) " ") t) (cons command squeezed) " ") t)
;;(tramp-wait-for-output) ;;(tramp-wait-for-output)
@ -190,7 +190,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either."
(let ((w32-quote-process-args t)) (let ((w32-quote-process-args t))
(when (eq okstatus 'async) (when (eq okstatus 'async)
(message "Tramp doesn't do async commands, running synchronously.")) (message "Tramp doesn't do async commands, running synchronously."))
(setq status (tramp-handle-shell-command (setq status (shell-command
(mapconcat 'tramp-shell-quote-argument (mapconcat 'tramp-shell-quote-argument
(cons command squeezed) " ") t)) (cons command squeezed) " ") t))
(when (or (not (integerp status)) (when (or (not (integerp status))
@ -257,7 +257,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either."
;; Don't switch to the *vc-info* buffer before running the ;; Don't switch to the *vc-info* buffer before running the
;; command, because that would change its default directory ;; command, because that would change its default directory
(save-match-data (save-match-data
(let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) (let* ((v (tramp-dissect-file-name (expand-file-name file)))
(multi-method (tramp-file-name-multi-method v)) (multi-method (tramp-file-name-multi-method v))
(method (tramp-file-name-method v)) (method (tramp-file-name-method v))
(user (tramp-file-name-user v)) (user (tramp-file-name-user v))
@ -284,7 +284,7 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either."
(save-excursion (save-excursion
(save-window-excursion (save-window-excursion
;; Actually execute remote command ;; Actually execute remote command
(tramp-handle-shell-command (shell-command
(mapconcat 'tramp-shell-quote-argument (mapconcat 'tramp-shell-quote-argument
(append (list command) args (list localname)) " ") (append (list command) args (list localname)) " ")
(get-buffer-create"*vc-info*")) (get-buffer-create"*vc-info*"))
@ -414,7 +414,7 @@ filename we are thinking about..."
(nth 2 (file-attributes file))))) (nth 2 (file-attributes file)))))
(if (and uid (/= uid remote-uid)) (if (and uid (/= uid remote-uid))
(error "tramp-handle-vc-user-login-name cannot map a uid to a name") (error "tramp-handle-vc-user-login-name cannot map a uid to a name")
(let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) (let* ((v (tramp-dissect-file-name (expand-file-name file)))
(u (tramp-file-name-user v))) (u (tramp-file-name-user v)))
(cond ((stringp u) u) (cond ((stringp u) u)
((vectorp u) (elt u (1- (length u)))) ((vectorp u) (elt u (1- (length u))))
@ -445,8 +445,8 @@ filename we are thinking about..."
(defun tramp-file-owner (filename) (defun tramp-file-owner (filename)
"Return who owns FILE (user name, as a string)." "Return who owns FILE (user name, as a string)."
(let ((v (tramp-dissect-file-name (let ((v (tramp-dissect-file-name
(tramp-handle-expand-file-name filename)))) (expand-file-name filename))))
(if (not (tramp-handle-file-exists-p filename)) (if (not (file-exists-p filename))
nil ; file cannot be opened nil ; file cannot be opened
;; file exists, find out stuff ;; file exists, find out stuff
(save-excursion (save-excursion

View file

@ -916,8 +916,8 @@ The answer will be provided by `tramp-action-terminal', which see."
"Regular expression indicating a process has finished. "Regular expression indicating a process has finished.
In fact this expression is empty by intention, it will be used only to In fact this expression is empty by intention, it will be used only to
check regularly the status of the associated process. check regularly the status of the associated process.
The answer will be provided by `tramp-action-process-alive' and The answer will be provided by `tramp-action-process-alive',
`tramp-action-out-of-band', which see." `tramp-multi-action-process-alive' and`tramp-action-out-of-band', which see."
:group 'tramp :group 'tramp
:type 'regexp) :type 'regexp)
@ -1321,7 +1321,7 @@ See `tramp-actions-before-shell' for more info."
(shell-prompt-pattern tramp-multi-action-succeed) (shell-prompt-pattern tramp-multi-action-succeed)
(tramp-shell-prompt-pattern tramp-multi-action-succeed) (tramp-shell-prompt-pattern tramp-multi-action-succeed)
(tramp-wrong-passwd-regexp tramp-multi-action-permission-denied) (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied)
(tramp-process-alive-regexp tramp-action-process-alive)) (tramp-process-alive-regexp tramp-multi-action-process-alive))
"List of pattern/action pairs. "List of pattern/action pairs.
This list is used for each hop in multi-hop connections. This list is used for each hop in multi-hop connections.
See `tramp-actions-before-shell' for more info." See `tramp-actions-before-shell' for more info."
@ -2165,7 +2165,7 @@ target of the symlink differ."
(let ((nonnumeric (and id-format (equal id-format 'string))) (let ((nonnumeric (and id-format (equal id-format 'string)))
result) result)
(with-parsed-tramp-file-name filename nil (with-parsed-tramp-file-name filename nil
(when (tramp-handle-file-exists-p filename) (when (file-exists-p filename)
;; file exists, find out stuff ;; file exists, find out stuff
(save-excursion (save-excursion
(if (tramp-get-remote-perl multi-method method user host) (if (tramp-get-remote-perl multi-method method user host)
@ -2331,7 +2331,12 @@ If it doesn't exist, generate a new one."
;; This function makes the same assumption as ;; This function makes the same assumption as
;; `tramp-handle-set-visited-file-modtime'. ;; `tramp-handle-set-visited-file-modtime'.
(defun tramp-handle-verify-visited-file-modtime (buf) (defun tramp-handle-verify-visited-file-modtime (buf)
"Like `verify-visited-file-modtime' for tramp files." "Like `verify-visited-file-modtime' for tramp files.
At the time `verify-visited-file-modtime' calls this function, we
already know that the buffer is visiting a file and that
`visited-file-modtime' does not return 0. Do not call this
function directly, unless those two cases are already taken care
of."
(with-current-buffer buf (with-current-buffer buf
(let ((f (buffer-file-name))) (let ((f (buffer-file-name)))
(with-parsed-tramp-file-name f nil (with-parsed-tramp-file-name f nil
@ -2343,7 +2348,14 @@ If it doesn't exist, generate a new one."
;; (HIGH . LOW)? ;; (HIGH . LOW)?
(let ((mt (visited-file-modtime))) (let ((mt (visited-file-modtime)))
(< (abs (tramp-time-diff (< (abs (tramp-time-diff
modtime (list (car mt) (cdr mt)))) 2))) modtime
;; For compatibility, deal with both the old
;; (HIGH . LOW) and the new (HIGH LOW)
;; return values of `visited-file-modtime'.
(if (atom (cdr mt))
(list (car mt) (cdr mt))
mt)))
2)))
(attr (attr
(save-excursion (save-excursion
(tramp-send-command (tramp-send-command
@ -2502,19 +2514,19 @@ if the remote host can't provide the modtime."
(defun tramp-handle-file-writable-p (filename) (defun tramp-handle-file-writable-p (filename)
"Like `file-writable-p' for tramp files." "Like `file-writable-p' for tramp files."
(with-parsed-tramp-file-name filename nil (with-parsed-tramp-file-name filename nil
(if (tramp-handle-file-exists-p filename) (if (file-exists-p filename)
;; Existing files must be writable. ;; Existing files must be writable.
(zerop (tramp-run-test "-w" filename)) (zerop (tramp-run-test "-w" filename))
;; If file doesn't exist, check if directory is writable. ;; If file doesn't exist, check if directory is writable.
(and (zerop (tramp-run-test (and (zerop (tramp-run-test
"-d" (tramp-handle-file-name-directory filename))) "-d" (file-name-directory filename)))
(zerop (tramp-run-test (zerop (tramp-run-test
"-w" (tramp-handle-file-name-directory filename))))))) "-w" (file-name-directory filename)))))))
(defun tramp-handle-file-ownership-preserved-p (filename) (defun tramp-handle-file-ownership-preserved-p (filename)
"Like `file-ownership-preserved-p' for tramp files." "Like `file-ownership-preserved-p' for tramp files."
(with-parsed-tramp-file-name filename nil (with-parsed-tramp-file-name filename nil
(or (not (tramp-handle-file-exists-p filename)) (or (not (file-exists-p filename))
;; Existing files must be writable. ;; Existing files must be writable.
(zerop (tramp-run-test "-O" filename))))) (zerop (tramp-run-test "-O" filename)))))
@ -3057,7 +3069,7 @@ This is like `dired-recursive-delete-directory' for tramp files."
(with-parsed-tramp-file-name filename nil (with-parsed-tramp-file-name filename nil
;; run a shell command 'rm -r <localname>' ;; run a shell command 'rm -r <localname>'
;; Code shamelessly stolen for the dired implementation and, um, hacked :) ;; Code shamelessly stolen for the dired implementation and, um, hacked :)
(or (tramp-handle-file-exists-p filename) (or (file-exists-p filename)
(signal (signal
'file-error 'file-error
(list "Removing old file name" "no such directory" filename))) (list "Removing old file name" "no such directory" filename)))
@ -3068,7 +3080,7 @@ This is like `dired-recursive-delete-directory' for tramp files."
;; This might take a while, allow it plenty of time. ;; This might take a while, allow it plenty of time.
(tramp-wait-for-output 120) (tramp-wait-for-output 120)
;; Make sure that it worked... ;; Make sure that it worked...
(and (tramp-handle-file-exists-p filename) (and (file-exists-p filename)
(error "Failed to recusively delete %s" filename)))) (error "Failed to recusively delete %s" filename))))
(defun tramp-handle-dired-call-process (program discard &rest arguments) (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
(defun tramp-handle-find-backup-file-name (filename) (defun tramp-handle-find-backup-file-name (filename)
"Like `find-backup-file-name' for tramp files." "Like `find-backup-file-name' for tramp files."
(with-parsed-tramp-file-name filename nil
;; We set both variables. It doesn't matter whether it is
;; Emacs or XEmacs
(let ((backup-directory-alist
;; Emacs case
(when (boundp 'backup-directory-alist)
(if (boundp 'tramp-backup-directory-alist)
(mapcar
'(lambda (x)
(cons
(car x)
(if (and (stringp (cdr x))
(file-name-absolute-p (cdr x))
(not (tramp-file-name-p (cdr x))))
(tramp-make-tramp-file-name
multi-method method user host (cdr x))
(cdr x))))
(symbol-value 'tramp-backup-directory-alist))
(symbol-value 'backup-directory-alist))))
(if (or (and (not (featurep 'xemacs)) (bkup-backup-directory-info
(not (boundp 'tramp-backup-directory-alist))) ;; XEmacs case
(and (featurep 'xemacs) (when (boundp 'bkup-backup-directory-info)
(not (boundp 'tramp-bkup-backup-directory-info)))) (if (boundp 'tramp-bkup-backup-directory-info)
(mapcar
'(lambda (x)
(nconc
(list (car x))
(list
(if (and (stringp (car (cdr x)))
(file-name-absolute-p (car (cdr x)))
(not (tramp-file-name-p (car (cdr x)))))
(tramp-make-tramp-file-name
multi-method method user host (car (cdr x)))
(car (cdr x))))
(cdr (cdr x))))
(symbol-value 'tramp-bkup-backup-directory-info))
(symbol-value 'bkup-backup-directory-info)))))
;; No tramp backup directory alist defined, or nil (tramp-run-real-handler 'find-backup-file-name (list filename)))))
(tramp-run-real-handler 'find-backup-file-name (list filename))
(with-parsed-tramp-file-name filename nil
(let* ((backup-var
(copy-tree
(if (featurep 'xemacs)
;; XEmacs case
(symbol-value 'tramp-bkup-backup-directory-info)
;; Emacs case
(symbol-value 'tramp-backup-directory-alist))))
;; We set both variables. It doesn't matter whether it is
;; Emacs or XEmacs
(backup-directory-alist backup-var)
(bkup-backup-directory-info backup-var))
(mapcar
'(lambda (x)
(let ((dir (if (consp (cdr x)) (car (cdr x)) (cdr x))))
(when (and (stringp dir)
(file-name-absolute-p dir)
(not (tramp-file-name-p dir)))
;; Prepend absolute directory names with tramp prefix
(if (consp (cdr x))
(setcar (cdr x)
(tramp-make-tramp-file-name
multi-method method user host dir))
(setcdr x (tramp-make-tramp-file-name
multi-method method user host dir))))))
backup-var)
(tramp-run-real-handler 'find-backup-file-name (list filename))))))
;; CCC grok APPEND, LOCKNAME, CONFIRM ;; CCC grok APPEND, LOCKNAME, CONFIRM
(defun tramp-handle-write-region (defun tramp-handle-write-region
@ -3682,6 +3696,9 @@ This will break if COMMAND prints a newline, followed by the value of
;; use an encoding function, but currently we use it always ;; use an encoding function, but currently we use it always
;; because this makes the logic simpler. ;; because this makes the logic simpler.
(setq tmpfil (tramp-make-temp-file)) (setq tmpfil (tramp-make-temp-file))
;; Set current buffer. If connection wasn't open, `file-modes' has
;; changed it accidently.
(set-buffer curbuf)
;; We say `no-message' here because we don't want the visited file ;; We say `no-message' here because we don't want the visited file
;; modtime data to be clobbered from the temp file. We call ;; modtime data to be clobbered from the temp file. We call
;; `set-visited-file-modtime' ourselves later on. ;; `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."
(foreign (apply foreign operation args)) (foreign (apply foreign operation args))
(t (tramp-run-real-handler operation args)))))) (t (tramp-run-real-handler operation args))))))
;; In Emacs, there is some concurrency due to timers. If a timer
;; interrupts Tramp and wishes to use the same connection buffer as
;; the "main" Emacs, then garbage might occur in the connection
;; buffer. Therefore, we need to make sure that a timer does not use
;; the same connection buffer as the "main" Emacs. We implement a
;; cheap global lock, instead of locking each connection buffer
;; separately. The global lock is based on two variables,
;; `tramp-locked' and `tramp-locker'. `tramp-locked' is set to true
;; (with setq) to indicate a lock. But Tramp also calls itself during
;; processing of a single file operation, so we need to allow
;; recursive calls. That's where the `tramp-locker' variable comes in
;; -- it is let-bound to t during the execution of the current
;; handler. So if `tramp-locked' is t and `tramp-locker' is also t,
;; then we should just proceed because we have been called
;; recursively. But if `tramp-locker' is nil, then we are a timer
;; interrupting the "main" Emacs, and then we signal an error.
(defvar tramp-locked nil
"If non-nil, then Tramp is currently busy.
Together with `tramp-locker', this implements a locking mechanism
preventing reentrant calls of Tramp.")
(defvar tramp-locker nil
"If non-nil, then a caller has locked Tramp.
Together with `tramp-locked', this implements a locking mechanism
preventing reentrant calls of Tramp.")
(defun tramp-sh-file-name-handler (operation &rest args) (defun tramp-sh-file-name-handler (operation &rest args)
"Invoke remote-shell Tramp file name handler. "Invoke remote-shell Tramp file name handler.
Fall back to normal file name handler if no Tramp handler exists." Fall back to normal file name handler if no Tramp handler exists."
(save-match-data (when (and tramp-locked (not tramp-locker))
(let ((fn (assoc operation tramp-file-name-handler-alist))) (signal 'file-error "Forbidden reentrant call of Tramp"))
(if fn (let ((tl tramp-locked))
(apply (cdr fn) args) (unwind-protect
(tramp-run-real-handler operation args))))) (progn
(setq tramp-locked t)
(let ((tramp-locker t))
(save-match-data
(let ((fn (assoc operation tramp-file-name-handler-alist)))
(if fn
(apply (cdr fn) args)
(tramp-run-real-handler operation args))))))
(setq tramp-locked tl))))
;;;###autoload ;;;###autoload
(defun tramp-completion-file-name-handler (operation &rest args) (defun tramp-completion-file-name-handler (operation &rest args)
@ -4055,7 +4108,7 @@ necessary anymore."
(tramp-make-tramp-file-name multi-method method (tramp-make-tramp-file-name multi-method method
user host x))) user host x)))
(read (current-buffer)))))) (read (current-buffer))))))
(list (tramp-handle-expand-file-name name)))))) (list (expand-file-name name))))))
;; Check for complete.el and override PC-expand-many-files if appropriate. ;; Check for complete.el and override PC-expand-many-files if appropriate.
(eval-and-compile (eval-and-compile
@ -4066,7 +4119,7 @@ necessary anymore."
(symbol-function 'PC-expand-many-files)) (symbol-function 'PC-expand-many-files))
(defun PC-expand-many-files (name) (defun PC-expand-many-files (name)
(if (tramp-tramp-file-p name) (if (tramp-tramp-file-p name)
(tramp-handle-expand-many-files name) (expand-many-files name)
(tramp-save-PC-expand-many-files name)))) (tramp-save-PC-expand-many-files name))))
;; Why isn't eval-after-load sufficient? ;; Why isn't eval-after-load sufficient?
@ -4817,17 +4870,17 @@ file exists and nonzero exit status otherwise."
;; `/usr/bin/test -e' In case `/bin/test' does not exist. ;; `/usr/bin/test -e' In case `/bin/test' does not exist.
(unless (or (unless (or
(and (setq tramp-file-exists-command "test -e %s") (and (setq tramp-file-exists-command "test -e %s")
(tramp-handle-file-exists-p existing) (file-exists-p existing)
(not (tramp-handle-file-exists-p nonexisting))) (not (file-exists-p nonexisting)))
(and (setq tramp-file-exists-command "/bin/test -e %s") (and (setq tramp-file-exists-command "/bin/test -e %s")
(tramp-handle-file-exists-p existing) (file-exists-p existing)
(not (tramp-handle-file-exists-p nonexisting))) (not (file-exists-p nonexisting)))
(and (setq tramp-file-exists-command "/usr/bin/test -e %s") (and (setq tramp-file-exists-command "/usr/bin/test -e %s")
(tramp-handle-file-exists-p existing) (file-exists-p existing)
(not (tramp-handle-file-exists-p nonexisting))) (not (file-exists-p nonexisting)))
(and (setq tramp-file-exists-command "ls -d %s") (and (setq tramp-file-exists-command "ls -d %s")
(tramp-handle-file-exists-p existing) (file-exists-p existing)
(not (tramp-handle-file-exists-p nonexisting)))) (not (file-exists-p nonexisting))))
(error "Couldn't find command to check if file exists.")))) (error "Couldn't find command to check if file exists."))))
@ -4889,9 +4942,8 @@ file exists and nonzero exit status otherwise."
METHOD, USER and HOST specify the connection, CMD (the absolute file name of) METHOD, USER and HOST specify the connection, CMD (the absolute file name of)
the `ls' executable. Returns t if CMD supports the `-n' option, nil the `ls' executable. Returns t if CMD supports the `-n' option, nil
otherwise." otherwise."
(tramp-message 9 "Checking remote `%s' command for `-n' option" (tramp-message 9 "Checking remote `%s' command for `-n' option" cmd)
cmd) (when (file-executable-p
(when (tramp-handle-file-executable-p
(tramp-make-tramp-file-name multi-method method user host cmd)) (tramp-make-tramp-file-name multi-method method user host cmd))
(let ((result nil)) (let ((result nil))
(tramp-message 7 "Testing remote command `%s' for -n..." cmd) (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."
"Query the user for a password." "Query the user for a password."
(let ((pw-prompt (match-string 0))) (let ((pw-prompt (match-string 0)))
(tramp-message 9 "Sending password") (tramp-message 9 "Sending password")
(tramp-enter-password p pw-prompt))) (tramp-enter-password p pw-prompt user host)))
(defun tramp-action-succeed (p multi-method method user host) (defun tramp-action-succeed (p multi-method method user host)
"Signal success in finding shell prompt." "Signal success in finding shell prompt."
@ -5027,7 +5079,7 @@ The terminal type can be configured with `tramp-terminal-type'."
(defun tramp-multi-action-password (p method user host) (defun tramp-multi-action-password (p method user host)
"Query the user for a password." "Query the user for a password."
(tramp-message 9 "Sending password") (tramp-message 9 "Sending password")
(tramp-enter-password p (match-string 0))) (tramp-enter-password p (match-string 0) user host))
(defun tramp-multi-action-succeed (p method user host) (defun tramp-multi-action-succeed (p method user host)
"Signal success in finding shell prompt." "Signal success in finding shell prompt."
@ -5042,6 +5094,11 @@ The terminal type can be configured with `tramp-terminal-type'."
(erase-buffer) (erase-buffer)
(throw 'tramp-action 'permission-denied)) (throw 'tramp-action 'permission-denied))
(defun tramp-multi-action-process-alive (p method user host)
"Check whether a process has finished."
(unless (memq (process-status p) '(run open))
(throw 'tramp-action 'process-died)))
;; Functions for processing the actions. ;; Functions for processing the actions.
(defun tramp-process-one-action (p multi-method method user host actions) (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.
(login-args (tramp-get-method-parameter (login-args (tramp-get-method-parameter
multi-method multi-method
(tramp-find-method multi-method method user host) (tramp-find-method multi-method method user host)
user host 'tramp-login-args))) user host 'tramp-login-args))
(real-host host))
;; The following should be changed. We need a more general ;; The following should be changed. We need a more general
;; mechanism to parse extra host args. ;; mechanism to parse extra host args.
(when (string-match "\\([^#]*\\)#\\(.*\\)" host) (when (string-match "\\([^#]*\\)#\\(.*\\)" host)
(setq login-args (cons "-p" (cons (match-string 2 host) login-args))) (setq login-args (cons "-p" (cons (match-string 2 host) login-args)))
(setq host (match-string 1 host))) (setq real-host (match-string 1 host)))
(setenv "TERM" tramp-terminal-type) (setenv "TERM" tramp-terminal-type)
(let* ((default-directory (tramp-temporary-file-directory)) (let* ((default-directory (tramp-temporary-file-directory))
;; If we omit the conditional, we would use ;; 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.
tramp-dos-coding-system)) tramp-dos-coding-system))
(p (if (and user (not (string= user ""))) (p (if (and user (not (string= user "")))
(apply #'start-process bufnam buf login-program (apply #'start-process bufnam buf login-program
host "-l" user login-args) real-host "-l" user login-args)
(apply #'start-process bufnam buf login-program (apply #'start-process bufnam buf login-program
host login-args))) real-host login-args)))
(found nil)) (found nil))
(tramp-set-process-query-on-exit-flag p nil) (tramp-set-process-query-on-exit-flag p nil)
@ -5540,10 +5598,10 @@ seconds. If not, it produces an error message with the given ERROR-ARGS."
(pop-to-buffer (buffer-name)) (pop-to-buffer (buffer-name))
(apply 'error error-args))) (apply 'error error-args)))
(defun tramp-enter-password (p prompt) (defun tramp-enter-password (p prompt user host)
"Prompt for a password and send it to the remote end. "Prompt for a password and send it to the remote end.
Uses PROMPT as a prompt and sends the password to process P." Uses PROMPT as a prompt and sends the password to process P."
(let ((pw (tramp-read-passwd prompt))) (let ((pw (tramp-read-passwd user host prompt)))
(erase-buffer) (erase-buffer)
(process-send-string (process-send-string
p (concat pw p (concat pw
@ -6710,16 +6768,11 @@ this is the function `temp-directory'."
"`temp-directory' is defined -- using /tmp.")) "`temp-directory' is defined -- using /tmp."))
(file-name-as-directory "/tmp")))) (file-name-as-directory "/tmp"))))
(defun tramp-read-passwd (prompt) (defun tramp-read-passwd (user host prompt)
"Read a password from user (compat function). "Read a password from user (compat function).
Invokes `password-read' if available, `read-passwd' else." Invokes `password-read' if available, `read-passwd' else."
(if (functionp 'password-read) (if (functionp 'password-read)
(let* ((user (or tramp-current-user (user-login-name))) (let* ((key (concat (or user (user-login-name)) "@" host))
(host (or tramp-current-host (system-name)))
(key (if (and (stringp user) (stringp host))
(concat user "@" host)
(concat "[" (mapconcat 'identity user "/") "]@["
(mapconcat 'identity host "/") "]")))
(password (apply #'password-read (list prompt key)))) (password (apply #'password-read (list prompt key))))
(apply #'password-cache-add (list key password)) (apply #'password-cache-add (list key password))
password) password)

View file

@ -414,7 +414,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(defun grep (command-args &optional highlight-regexp) (defun grep (command-args &optional highlight-regexp)
"Run grep, with user-specified args, and collect output in a buffer. "Run grep, with user-specified args, and collect output in a buffer.
While grep runs asynchronously, you can use \\[next-error] (M-x next-error), While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
or \\<grep-minor-mode-map>\\[compile-goto-error] in the grep \ or \\<grep-mode-map>\\[compile-goto-error] in the grep \
output buffer, to go to the lines output buffer, to go to the lines
where grep found matches. where grep found matches.

View file

@ -99,7 +99,33 @@ Zero means compute the Imenu menu regardless of size."
:group 'which-func :group 'which-func
:type 'integer) :type 'integer)
(defcustom which-func-format '("[" which-func-current "]") (defvar which-func-keymap
(let ((map (make-sparse-keymap)))
(define-key map [mode-line mouse-1] 'beginning-of-defun)
(define-key map [mode-line mouse-2]
(lambda ()
(interactive)
(if (eq (point-min) 1)
(narrow-to-defun)
(widen))))
(define-key map [mode-line mouse-3] 'end-of-defun)
map)
"Keymap to display on mode line which-func.")
(defface which-func-face
'((t (:inherit font-lock-function-name-face)))
"Face used to highlight mode line function names.
Defaults to `font-lock-function-name-face' if font-lock is loaded."
:group 'which-func)
(defcustom which-func-format
`("["
(:propertize which-func-current
local-map ,which-func-keymap
face which-func-face
;;mouse-face highlight ; currently not evaluated :-(
help-echo "mouse-1: go to beginning, mouse-2: toggle rest visibility, mouse-3: go to end")
"]")
"Format for displaying the function in the mode line." "Format for displaying the function in the mode line."
:group 'which-func :group 'which-func
:type 'sexp) :type 'sexp)

View file

@ -786,7 +786,8 @@ If the value is nil, don't highlight the buffer names specially."
nil nil
nil nil
nil nil
'regexp-history))) 'regexp-history
default)))
(if (equal input "") (if (equal input "")
default default
input)) input))

View file

@ -562,9 +562,13 @@ If BACKWARD-ONLY is non-nil, only delete spaces before point."
(skip-chars-forward " \t") (skip-chars-forward " \t")
(constrain-to-field nil orig-pos t))))) (constrain-to-field nil orig-pos t)))))
(defvar inhibit-mark-movement nil
"If non-nil, \\[beginning-of-buffer] and \\[end-of-buffer] does not set the mark.")
(defun beginning-of-buffer (&optional arg) (defun beginning-of-buffer (&optional arg)
"Move point to the beginning of the buffer; leave mark at previous position. "Move point to the beginning of the buffer; leave mark at previous position.
With arg N, put point N/10 of the way from the beginning. With \\[universal-argument] prefix, do not set mark at previous position.
With numeric arg N, put point N/10 of the way from the beginning.
If the buffer is narrowed, this command uses the beginning and size If the buffer is narrowed, this command uses the beginning and size
of the accessible part of the buffer. of the accessible part of the buffer.
@ -572,9 +576,10 @@ of the accessible part of the buffer.
Don't use this command in Lisp programs! Don't use this command in Lisp programs!
\(goto-char (point-min)) is faster and avoids clobbering the mark." \(goto-char (point-min)) is faster and avoids clobbering the mark."
(interactive "P") (interactive "P")
(push-mark) (unless (or inhibit-mark-movement (consp arg))
(push-mark))
(let ((size (- (point-max) (point-min)))) (let ((size (- (point-max) (point-min))))
(goto-char (if arg (goto-char (if (and arg (not (consp arg)))
(+ (point-min) (+ (point-min)
(if (> size 10000) (if (> size 10000)
;; Avoid overflow for large buffer sizes! ;; Avoid overflow for large buffer sizes!
@ -586,7 +591,8 @@ Don't use this command in Lisp programs!
(defun end-of-buffer (&optional arg) (defun end-of-buffer (&optional arg)
"Move point to the end of the buffer; leave mark at previous position. "Move point to the end of the buffer; leave mark at previous position.
With arg N, put point N/10 of the way from the end. With \\[universal-argument] prefix, do not set mark at previous position.
With numeric arg N, put point N/10 of the way from the end.
If the buffer is narrowed, this command uses the beginning and size If the buffer is narrowed, this command uses the beginning and size
of the accessible part of the buffer. of the accessible part of the buffer.
@ -594,9 +600,10 @@ of the accessible part of the buffer.
Don't use this command in Lisp programs! Don't use this command in Lisp programs!
\(goto-char (point-max)) is faster and avoids clobbering the mark." \(goto-char (point-max)) is faster and avoids clobbering the mark."
(interactive "P") (interactive "P")
(push-mark) (unless (or inhibit-mark-movement (consp arg))
(push-mark))
(let ((size (- (point-max) (point-min)))) (let ((size (- (point-max) (point-min))))
(goto-char (if arg (goto-char (if (and arg (not (consp arg)))
(- (point-max) (- (point-max)
(if (> size 10000) (if (> size 10000)
;; Avoid overflow for large buffer sizes! ;; Avoid overflow for large buffer sizes!

View file

@ -1,3 +1,30 @@
2004-07-17 Richard M. Stallman <rms@gnu.org>
* display.texi (Overlay Properties): Adding `evaporate' prop
deletes empty overlay immediately.
* abbrevs.texi (Abbrev Expansion): Clarify pre-abbrev-expand-hook,
fix example.
2004-07-16 Jim Blandy <jimb@redhat.com>
* searching.texi (Regexp Backslash): Document new \_< and \_>
operators.
2004-07-16 Juanma Barranquero <lektu@terra.es>
* display.texi (Images): Fix Texinfo usage.
2004-07-14 Luc Teirlinck <teirllm@auburn.edu>
* buffers.texi (Modification Time): `visited-file-modtime' now
returns a list of two integers, instead of a cons.
2004-07-13 Luc Teirlinck <teirllm@auburn.edu>
* windows.texi: Various changes in addition to:
(Splitting Windows): Add `split-window-keep-point'.
2004-07-09 Richard M. Stallman <rms@gnu.org> 2004-07-09 Richard M. Stallman <rms@gnu.org>
* frames.texi (Input Focus): Minor fix. * frames.texi (Input Focus): Minor fix.

View file

@ -335,10 +335,9 @@ abbrev lookup happens.
@end defvar @end defvar
The following sample code shows a simple use of The following sample code shows a simple use of
@code{pre-abbrev-expand-hook}. If the user terminates an abbrev with a @code{pre-abbrev-expand-hook}. If the user terminates an abbrev with
punctuation character, the hook function asks for confirmation. Thus, a punctuation character, the hook function asks for confirmation. It
this hook allows the user to decide whether to expand the abbrev, and aborts expansion if the user does not confirm.
aborts expansion if it is not confirmed.
@smallexample @smallexample
(add-hook 'pre-abbrev-expand-hook 'query-if-not-space) (add-hook 'pre-abbrev-expand-hook 'query-if-not-space)
@ -350,12 +349,10 @@ aborts expansion if it is not confirmed.
;; @r{user entered some other character, this function asks whether} ;; @r{user entered some other character, this function asks whether}
;; @r{expansion should continue.} ;; @r{expansion should continue.}
;; @r{If the user answers the prompt with @kbd{y}, the function returns} ;; @r{The function's return value makes no difference.}
;; @r{@code{nil} (because of the @code{not} function), but that is}
;; @r{acceptable; the return value has no effect on expansion.}
(defun query-if-not-space () (defun query-if-not-space ()
(if (/= ?\s (preceding-char)) (if (/= ?\s last-command-char)
(if (not (y-or-n-p "Do you want to expand this abbrev? ")) (if (not (y-or-n-p "Do you want to expand this abbrev? "))
(error "Not expanding this abbrev")))) (error "Not expanding this abbrev"))))
@end smallexample @end smallexample

View file

@ -625,9 +625,9 @@ file should not be done.
@c Emacs 19 feature @c Emacs 19 feature
@defun visited-file-modtime @defun visited-file-modtime
This function returns the current buffer's recorded last file This function returns the current buffer's recorded last file
modification time, as a list of the form @code{(@var{high} . modification time, as a list of the form @code{(@var{high} @var{low})}.
@var{low})}. (This is the same format that @code{file-attributes} (This is the same format that @code{file-attributes} uses to return
uses to return time values; see @ref{File Attributes}.) time values; see @ref{File Attributes}.)
The function returns zero if the buffer has no recorded last The function returns zero if the buffer has no recorded last
modification time, which can happen, for instance, if the record has modification time, which can happen, for instance, if the record has

View file

@ -1165,9 +1165,9 @@ sense---only on the screen.
@item evaporate @item evaporate
@kindex evaporate @r{(overlay property)} @kindex evaporate @r{(overlay property)}
If this property is non-@code{nil}, the overlay is deleted automatically If this property is non-@code{nil}, the overlay is deleted automatically
if it becomes empty (i.e., if its length becomes zero). However, if it becomes empty (i.e., if its length becomes zero). If you give
if the overlay is @emph{already} empty, @code{evaporate} does not an empty overlay a non-@code{nil} @code{evaporate} property, that deletes
delete it. it immediately.
@item local-map @item local-map
@cindex keymap of character (and overlays) @cindex keymap of character (and overlays)
@ -2907,7 +2907,7 @@ To know which image types are really available, use
This in an alist of image types vs external libraries needed to This in an alist of image types vs external libraries needed to
display them. display them.
Each element is a list @code{(@var{IMAGE-TYPE} @var{LIBRARY}...)}, Each element is a list @code{(@var{image-type} @var{library}...)},
where the car is a supported image format from @code{image-types}, and where the car is a supported image format from @code{image-types}, and
the rest are strings giving alternate filenames for the corresponding the rest are strings giving alternate filenames for the corresponding
external libraries to load. external libraries to load.
@ -2924,9 +2924,10 @@ into Emacs.
@defun image-type-available-p type @defun image-type-available-p type
@findex image-type-available-p @findex image-type-available-p
This function returns non-nil if image type @var{TYPE} is available, This function returns non-@code{nil} if image type @var{type} is
i.e., if images of this type can be loaded and displayed in Emacs. available, i.e., if images of this type can be loaded and displayed in
@var{TYPE} should be one of the types contained in @code{image-types}. Emacs. @var{type} should be one of the types contained in
@code{image-types}.
For image types whose support libraries are statically linked, this For image types whose support libraries are statically linked, this
function always returns @code{t}; for other image types, it returns function always returns @code{t}; for other image types, it returns

View file

@ -666,6 +666,19 @@ word-constituent character follows.
matches the empty string, but only at the end of a word. @samp{\>} matches the empty string, but only at the end of a word. @samp{\>}
matches at the end of the buffer (or string) only if the contents end matches at the end of the buffer (or string) only if the contents end
with a word-constituent character. with a word-constituent character.
@item \_<
@cindex @samp{\_<} in regexp
matches the empty string, but only at the beginning of a symbol. A
symbol is a sequence of one or more word or symbol constituent
characters. @samp{\_<} matches at the beginning of the buffer (or
string) only if a symbol-constituent character follows.
@item \_>
@cindex @samp{\_>} in regexp
matches the empty string, but only at the end of a symbol. @samp{\_>}
matches at the end of the buffer (or string) only if the contents end
with a symbol-constituent character.
@end table @end table
@kindex invalid-regexp @kindex invalid-regexp

View file

@ -158,7 +158,6 @@ This function splits @var{window} into two windows. The original
window @var{window} remains the selected window, but occupies only window @var{window} remains the selected window, but occupies only
part of its former screen area. The rest is occupied by a newly created part of its former screen area. The rest is occupied by a newly created
window which is returned as the value of this function. window which is returned as the value of this function.
This function returns the newly created window.
If @var{horizontal} is non-@code{nil}, then @var{window} splits into If @var{horizontal} is non-@code{nil}, then @var{window} splits into
two side by side windows. The original window @var{window} keeps the two 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
other, leaving the upper of the two windows selected, with @var{size} other, leaving the upper of the two windows selected, with @var{size}
lines. (If @var{size} is negative, then the lower of the two windows lines. (If @var{size} is negative, then the lower of the two windows
gets @minus{} @var{size} lines and the upper window gets the rest, but gets @minus{} @var{size} lines and the upper window gets the rest, but
the upper window is still the one selected.) the upper window is still the one selected.) However, if
@code{split-window-keep-point} (see below) is @code{nil}, then either
window can be selected.
In other respects, this function is similar to @code{split-window}.
In particular, the upper window is the original one and the return
value is the new, lower window.
@end deffn @end deffn
@defopt split-window-keep-point
If this variable is non-@code{nil} (the default), then
@code{split-window-vertically} behaves as described above.
If it is @code{nil}, then @code{split-window-vertically} adjusts point
in each of the two windows to avoid scrolling. (This is useful on
slow terminals.) It selects whichever window contains the screen line
that point was previously on.
This variable only affects the behavior of @code{split-window-vertically}.
It has no effect on the other functions described here.
@end defopt
@deffn Command split-window-horizontally &optional size @deffn Command split-window-horizontally &optional size
This function splits the selected window into two windows This function splits the selected window into two windows
side-by-side, leaving the selected window with @var{size} columns. side-by-side, leaving the selected window on the left with @var{size}
columns. If @var{size} is negative, the rightmost window gets
@minus{} @var{size} columns, but the leftmost window still remains
selected.
This function is basically an interface to @code{split-window}. This function is basically an interface to @code{split-window}.
You could define a simplified version of the function like this: You 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
The return value is @code{nil}. The return value is @code{nil}.
@end deffn @end deffn
@deffn Command delete-windows-on buffer &optional frame @deffn Command delete-windows-on buffer-or-name &optional frame
This function deletes all windows showing @var{buffer}. If there are This function deletes all windows showing @var{buffer-or-name}. If
no windows showing @var{buffer}, it does nothing. there are no windows showing @var{buffer-or-name}, it does nothing.
@var{buffer-or-name} must be a buffer or the name of an existing
buffer.
@code{delete-windows-on} operates frame by frame. If a frame has @code{delete-windows-on} operates frame by frame. If a frame has
several windows showing different buffers, then those showing several windows showing different buffers, then those showing
@var{buffer} are removed, and the others expand to fill the space. If @var{buffer-or-name} are removed, and the others expand to fill the
all windows in some frame are showing @var{buffer} (including the case space. If all windows in some frame are showing @var{buffer-or-name}
where there is only one window), then the frame reverts to having a (including the case where there is only one window), then the frame
single window showing another buffer chosen with @code{other-buffer}. winds up with a single window showing another buffer chosen with
@xref{The Buffer List}. @code{other-buffer}. @xref{The Buffer List}.
The argument @var{frame} controls which frames to operate on. This The argument @var{frame} controls which frames to operate on. This
function does not use it in quite the same way as the other functions function 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.
@defun select-window window &optional norecord @defun select-window window &optional norecord
This function makes @var{window} the selected window. The cursor then This function makes @var{window} the selected window. The cursor then
appears in @var{window} (on redisplay). The buffer being displayed in appears in @var{window} (on redisplay). Unless @var{window} was
@var{window} is immediately designated the current buffer. already selected, @code{select-window} makes @var{window}'s buffer the
current buffer.
Normally @var{window}'s selected buffer is moved to the front of the Normally @var{window}'s selected buffer is moved to the front of the
buffer list, but if @var{norecord} is non-@code{nil}, the buffer list buffer list, but if @var{norecord} is non-@code{nil}, the buffer list
@ -431,14 +455,18 @@ The return value is @var{window}.
@end defun @end defun
@defmac save-selected-window forms@dots{} @defmac save-selected-window forms@dots{}
This macro records the selected window of each frame, executes This macro records the selected window, as well as the selected window
@var{forms} in sequence, then restores the earlier selected windows. of each frame, executes @var{forms} in sequence, then restores the
earlier selected windows. It returns the value of the last form in
@var{forms}.
This macro does not save or restore anything about the sizes, This macro does not save or restore anything about the sizes,
arrangement or contents of windows; therefore, if the @var{forms} arrangement or contents of windows; therefore, if the @var{forms}
change them, the change persists. If the previously selected window change them, the change persists. If the previously selected window
of some frame is no longer live at the time of exit from this form, of some frame is no longer live at the time of exit from @var{forms},
that frame's selected window is left alone. that frame's selected window is left alone. If the previously
selected window is no longer live, then whatever window is selected at
the end of @var{forms} remains selected.
@end defmac @end defmac
@defmac with-selected-window window forms@dots{} @defmac with-selected-window window forms@dots{}
@ -446,7 +474,7 @@ This macro selects @var{window} (without changing the buffer list),
executes @var{forms} in sequence, then restores the previously executes @var{forms} in sequence, then restores the previously
selected window (unless that window is no longer alive). It is similar selected window (unless that window is no longer alive). It is similar
to @code{save-selected-window} except that it explicitly selects to @code{save-selected-window} except that it explicitly selects
@var{window} and that it does not alter the buffer list sequence. @var{window}, without altering the buffer list sequence.
@end defmac @end defmac
@cindex finding windows @cindex finding windows
@ -556,7 +584,9 @@ are the possible values and their meanings:
@table @asis @table @asis
@item @code{nil} @item @code{nil}
Consider all the windows in @var{window}'s frame, plus the minibuffer Consider all the windows in @var{window}'s frame, plus the minibuffer
used by that frame even if it lies in some other frame. used by that frame even if it lies in some other frame. If the
minibuffer counts (as determined by @var{minibuf}), then all windows on
all frames that share that minibuffer count too.
@item @code{t} @item @code{t}
Consider all windows in all existing frames. Consider all windows in all existing frames.
@ -658,9 +688,10 @@ when you need complete control.
@defun set-window-buffer window buffer-or-name &optional keep-margins @defun set-window-buffer window buffer-or-name &optional keep-margins
This function makes @var{window} display @var{buffer-or-name} as its This function makes @var{window} display @var{buffer-or-name} as its
contents. It returns @code{nil}. This is the fundamental primitive contents. It returns @code{nil}. @var{buffer-or-name} must be a
for changing which buffer is displayed in a window, and all ways buffer, or the name of an existing buffer. This is the fundamental
of doing that call this function. primitive for changing which buffer is displayed in a window, and all
ways of doing that call this function.
@example @example
@group @group
@ -770,7 +801,8 @@ the current buffer but does not display it in the selected window.
If @var{buffer-or-name} does not identify an existing buffer, then a new If @var{buffer-or-name} does not identify an existing buffer, then a new
buffer by that name is created. The major mode for the new buffer is buffer by that name is created. The major mode for the new buffer is
set according to the variable @code{default-major-mode}. @xref{Auto set according to the variable @code{default-major-mode}. @xref{Auto
Major Mode}. Major Mode}. If @var{buffer-or-name} is @code{nil},
@code{switch-to-buffer} chooses a buffer using @code{other-buffer}.
Normally the specified buffer is put at the front of the buffer list Normally the specified buffer is put at the front of the buffer list
(both the selected frame's buffer list and the frame-independent buffer (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
returns the buffer that it switched to. returns the buffer that it switched to.
@end deffn @end deffn
The next two functions are similar to @code{switch-to-buffer}, except
for the described features.
@deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord @deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord
This function makes @var{buffer-or-name} the current buffer and This function makes @var{buffer-or-name} the current buffer and
displays it in a window not currently selected. It then selects that displays 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}
unless @var{norecord} is non-@code{nil}. unless @var{norecord} is non-@code{nil}.
@end defun @end defun
@deffn Command replace-buffer-in-windows buffer @deffn Command replace-buffer-in-windows buffer-or-name
This function replaces @var{buffer} with some other buffer in all This function replaces @var{buffer-or-name} with some other buffer in all
windows displaying it. The other buffer used is chosen with windows displaying it. It chooses the other buffer with
@code{other-buffer}. In the usual applications of this function, you @code{other-buffer}. In the usual applications of this function, you
don't care which other buffer is used; you just want to make sure that don't care which other buffer is used; you just want to make sure that
@var{buffer} is no longer displayed. @var{buffer-or-name} is no longer displayed.
This function returns @code{nil}. This function returns @code{nil}.
@end deffn @end deffn
@ -864,7 +899,8 @@ functions and commands use this subroutine. Here we describe how to use
This command makes @var{buffer-or-name} appear in some window, like This command makes @var{buffer-or-name} appear in some window, like
@code{pop-to-buffer}, but it does not select that window and does not @code{pop-to-buffer}, but it does not select that window and does not
make the buffer current. The identity of the selected window is make the buffer current. The identity of the selected window is
unaltered by this function. unaltered by this function. @var{buffer-or-name} must be a buffer, or
the name of an existing buffer.
If @var{not-this-window} is non-@code{nil}, it means to display the If @var{not-this-window} is non-@code{nil}, it means to display the
specified buffer in a window other than the selected one, even if it is specified buffer in a window other than the selected one, even if it is
@ -885,6 +921,7 @@ values of @var{frame}:
@itemize @bullet @itemize @bullet
@item @item
If it is @code{nil}, consider windows on the selected frame. If it is @code{nil}, consider windows on the selected frame.
(Actually, the last non-minibuffer frame.)
@item @item
If it is @code{t}, consider windows on all frames. If it is @code{t}, consider windows on all frames.
@item @item
@ -1017,7 +1054,7 @@ create the frame. See above, under @code{special-display-buffer-names}.
This function returns non-@code{nil} if displaying a buffer This function returns non-@code{nil} if displaying a buffer
named @var{buffer-name} with @code{display-buffer} would named @var{buffer-name} with @code{display-buffer} would
create a special frame. The value is @code{t} if it would create a special frame. The value is @code{t} if it would
use the default frame paramaters, or else the specified list use the default frame parameters, or else the specified list
of frame parameters. of frame parameters.
@end defun @end defun
@ -1030,11 +1067,12 @@ The default value of this variable is
@code{special-display-popup-frame}. @code{special-display-popup-frame}.
@end defvar @end defvar
@defun special-display-popup-frame buffer &rest args @defun special-display-popup-frame buffer &optional args
This function makes @var{buffer} visible in a frame of its own. If This function makes @var{buffer} visible in a frame of its own. If
@var{buffer} is already displayed in a window in some frame, it makes @var{buffer} is already displayed in a window in some frame, it makes
the frame visible and raises it, to use that window. Otherwise, it the frame visible and raises it, to use that window. Otherwise, it
creates a frame that will be dedicated to @var{buffer}. creates a frame that will be dedicated to @var{buffer}. This
function returns the window it used.
If @var{args} is an alist, it specifies frame parameters for the new If @var{args} is an alist, it specifies frame parameters for the new
frame. frame.
@ -1080,9 +1118,9 @@ put it in the selected window.
This variable is the most flexible way to customize the behavior of This variable is the most flexible way to customize the behavior of
@code{display-buffer}. If it is non-@code{nil}, it should be a function @code{display-buffer}. If it is non-@code{nil}, it should be a function
that @code{display-buffer} calls to do the work. The function should that @code{display-buffer} calls to do the work. The function should
accept two arguments, the same two arguments that @code{display-buffer} accept two arguments, the first two arguments that @code{display-buffer}
received. It should choose or create a window, display the specified received. It should choose or create a window, display the specified
buffer, and then return the window. buffer in it, and then return the window.
This hook takes precedence over all the other options and hooks This hook takes precedence over all the other options and hooks
described above. described above.

View file

@ -4,7 +4,7 @@
@c In the Tramp CVS, the version number is auto-frobbed from @c In the Tramp CVS, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run @c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number. @c "autoconf && ./configure" to change the version number.
@set trampver 2.0.42 @set trampver 2.0.43
@c Other flags from configuration @c Other flags from configuration
@set prefix /usr/local @set prefix /usr/local

View file

@ -1,3 +1,45 @@
2004-07-17 Juanma Barranquero <lektu@terra.es>
* keyboard.c (not_single_kboard_state): Do nothing unless
MULTI_KBOARD is defined.
2004-07-17 Richard M. Stallman <rms@gnu.org>
* window.c (coordinates_in_window): Inside the window but outside
its box to the L or R, return ON_VERTICAL_BORDER.
(window_list_1): Rotate the list to start with WINDOW.
* print.c (print_preprocess): Test for print_depth at limit
before entering in being_printed.
* keyboard.c (not_single_kboard_state): New function.
(stuff_buffered_input): Now no-op only if no SIGTSTP.
* frame.c (Fdelete_frame): If we're in single_bboard_state on
this kboard, and we delete its last frame, go to any_kboard_state.
* buffer.c (syms_of_buffer) <transient-mark-mode>: Doc fix.
2004-07-15 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> (tiny change)
* w32fns.c (Fx_file_dialog): Encode strings in system coding
system before passing them to OS functions for display.
2004-07-15 David Kastrup <dak@gnu.org>
* search.c (syms_of_search): Staticpro `saved_last_thing_searched'.
Apparently fixes an abort condition.
2004-07-14 Luc Teirlinck <teirllm@auburn.edu>
* fileio.c (Fvisited_file_modtime): Return a list of two integers,
instead of a cons.
2004-07-14 K,Ba(Broly L,Bu(Brentey <lorentey@elte.hu>
* keyboard.c (echo_dash): Do nothing if there already is a dash
at the end of the echo string.
2004-07-12 Kim F. Storm <storm@cua.dk> 2004-07-12 Kim F. Storm <storm@cua.dk>
* alloc.c (mark_object): Only look at Lisp_Misc_Save_Value * alloc.c (mark_object): Only look at Lisp_Misc_Save_Value

View file

@ -5861,7 +5861,10 @@ all windows or just the selected window.
If the value is `lambda', that enables Transient Mark mode temporarily If the value is `lambda', that enables Transient Mark mode temporarily
until the next buffer modification. If a command sets the value to `only', until the next buffer modification. If a command sets the value to `only',
that enables Transient Mark mode for the following command only. */); that enables Transient Mark mode for the following command only.
During that following command, the value of `transient-mark-mode'
is `identity'. If it is still `identity' at the end of that command,
it changes to nil. */);
Vtransient_mark_mode = Qnil; Vtransient_mark_mode = Qnil;
DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only, DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,

View file

@ -5630,13 +5630,17 @@ Next attempt to save will certainly not complain of a discrepancy. */)
DEFUN ("visited-file-modtime", Fvisited_file_modtime, DEFUN ("visited-file-modtime", Fvisited_file_modtime,
Svisited_file_modtime, 0, 0, 0, Svisited_file_modtime, 0, 0, 0,
doc: /* Return the current buffer's recorded visited file modification time. doc: /* Return the current buffer's recorded visited file modification time.
The value is a list of the form (HIGH . LOW), like the time values The value is a list of the form (HIGH LOW), like the time values
that `file-attributes' returns. If the current buffer has no recorded that `file-attributes' returns. If the current buffer has no recorded
file modification time, this function returns 0. file modification time, this function returns 0.
See Info node `(elisp)Modification Time' for more details. */) See Info node `(elisp)Modification Time' for more details. */)
() ()
{ {
return long_to_cons ((unsigned long) current_buffer->modtime); Lisp_Object tcons;
tcons = long_to_cons ((unsigned long) current_buffer->modtime);
if (CONSP (tcons))
return list2 (XCAR (tcons), XCDR (tcons));
return tcons;
} }
DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime, DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime,

View file

@ -1553,6 +1553,36 @@ The functions are run with one arg, the frame to be deleted. */)
} }
} }
/* If there's no other frame on the same kboard, get out of
single-kboard state if we're in it for this kboard. */
{
Lisp_Object frames;
/* Some frame we found on the same kboard, or nil if there are none. */
Lisp_Object frame_on_same_kboard;
frame_on_same_kboard = Qnil;
for (frames = Vframe_list;
CONSP (frames);
frames = XCDR (frames))
{
Lisp_Object this;
struct frame *f1;
this = XCAR (frames);
if (!FRAMEP (this))
abort ();
f1 = XFRAME (this);
if (FRAME_KBOARD (f) == FRAME_KBOARD (f1))
frame_on_same_kboard = this;
}
if (NILP (frame_on_same_kboard))
not_single_kboard_state (FRAME_KBOARD (f));
}
/* If we've deleted this keyboard's default_minibuffer_frame, try to /* If we've deleted this keyboard's default_minibuffer_frame, try to
find another one. Prefer minibuffer-only frames, but also notice find another one. Prefer minibuffer-only frames, but also notice
frames with other windows. */ frames with other windows. */

View file

@ -791,6 +791,21 @@ echo_dash ()
== SCHARS (current_kboard->echo_string)) == SCHARS (current_kboard->echo_string))
return; return;
/* Do nothing if we have already put a dash at the end. */
if (SCHARS (current_kboard->echo_string) > 1)
{
Lisp_Object last_char, prev_char, idx;
idx = make_number (SCHARS (current_kboard->echo_string) - 2);
prev_char = Faref (current_kboard->echo_string, idx);
idx = make_number (SCHARS (current_kboard->echo_string) - 1);
last_char = Faref (current_kboard->echo_string, idx);
if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
return;
}
/* Put a dash at the end of the buffer temporarily, /* Put a dash at the end of the buffer temporarily,
but make it go away when the next character is added. */ but make it go away when the next character is added. */
current_kboard->echo_string = concat2 (current_kboard->echo_string, current_kboard->echo_string = concat2 (current_kboard->echo_string,
@ -1063,6 +1078,19 @@ single_kboard_state ()
#endif #endif
} }
/* If we're in single_kboard state for kboard KBOARD,
get out of it. */
void
not_single_kboard_state (kboard)
KBOARD *kboard;
{
#ifdef MULTI_KBOARD
if (kboard == current_kboard)
single_kboard = 0;
#endif
}
/* Maintain a stack of kboards, so other parts of Emacs /* Maintain a stack of kboards, so other parts of Emacs
can switch temporarily to the kboard of a given frame can switch temporarily to the kboard of a given frame
and then revert to the previous status. */ and then revert to the previous status. */
@ -10238,9 +10266,7 @@ void
stuff_buffered_input (stuffstring) stuff_buffered_input (stuffstring)
Lisp_Object stuffstring; Lisp_Object stuffstring;
{ {
/* stuff_char works only in BSD, versions 4.2 and up. */ #ifdef SIGTSTP /* stuff_char is defined if SIGTSTP. */
#ifdef BSD_SYSTEM
#ifndef BSD4_1
register unsigned char *p; register unsigned char *p;
if (STRINGP (stuffstring)) if (STRINGP (stuffstring))
@ -10256,7 +10282,10 @@ stuff_buffered_input (stuffstring)
/* Anything we have read ahead, put back for the shell to read. */ /* Anything we have read ahead, put back for the shell to read. */
/* ?? What should this do when we have multiple keyboards?? /* ?? What should this do when we have multiple keyboards??
Should we ignore anything that was typed in at the "wrong" kboard? */ Should we ignore anything that was typed in at the "wrong" kboard?
rms: we should stuff everything back into the kboard
it came from. */
for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++) for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++)
{ {
@ -10269,8 +10298,7 @@ stuff_buffered_input (stuffstring)
} }
input_pending = 0; input_pending = 0;
#endif #endif /* SIGTSTP */
#endif /* BSD_SYSTEM and not BSD4_1 */
} }
void void

View file

@ -1284,6 +1284,11 @@ print_preprocess (obj)
int loop_count = 0; int loop_count = 0;
Lisp_Object halftail; Lisp_Object halftail;
/* Give up if we go so deep that print_object will get an error. */
/* See similar code in print_object. */
if (print_depth >= PRINT_CIRCLE)
return;
/* Avoid infinite recursion for circular nested structure /* Avoid infinite recursion for circular nested structure
in the case where Vprint_circle is nil. */ in the case where Vprint_circle is nil. */
if (NILP (Vprint_circle)) if (NILP (Vprint_circle))
@ -1294,11 +1299,6 @@ print_preprocess (obj)
being_printed[print_depth] = obj; being_printed[print_depth] = obj;
} }
/* Give up if we go so deep that print_object will get an error. */
/* See similar code in print_object. */
if (print_depth >= PRINT_CIRCLE)
return;
print_depth++; print_depth++;
halftail = obj; halftail = obj;

View file

@ -2974,6 +2974,9 @@ syms_of_search ()
last_thing_searched = Qnil; last_thing_searched = Qnil;
staticpro (&last_thing_searched); staticpro (&last_thing_searched);
saved_last_thing_searched = Qnil;
staticpro (&saved_last_thing_searched);
defsubr (&Slooking_at); defsubr (&Slooking_at);
defsubr (&Sposix_looking_at); defsubr (&Sposix_looking_at);
defsubr (&Sstring_match); defsubr (&Sstring_match);

View file

@ -7735,14 +7735,14 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
/* Create the dialog with PROMPT as title, using DIR as initial /* Create the dialog with PROMPT as title, using DIR as initial
directory and using "*" as pattern. */ directory and using "*" as pattern. */
dir = Fexpand_file_name (dir, Qnil); dir = Fexpand_file_name (dir, Qnil);
strncpy (init_dir, SDATA (dir), MAX_PATH); strncpy (init_dir, SDATA (ENCODE_SYSTEM (dir)), MAX_PATH);
init_dir[MAX_PATH] = '\0'; init_dir[MAX_PATH] = '\0';
unixtodos_filename (init_dir); unixtodos_filename (init_dir);
if (STRINGP (default_filename)) if (STRINGP (default_filename))
{ {
char *file_name_only; char *file_name_only;
char *full_path_name = SDATA (default_filename); char *full_path_name = SDATA (ENCODE_SYSTEM (default_filename));
unixtodos_filename (full_path_name); unixtodos_filename (full_path_name);

View file

@ -672,7 +672,7 @@ coordinates_in_window (w, x, y)
/* Outside any interesting column? */ /* Outside any interesting column? */
if (*x < left_x || *x > right_x) if (*x < left_x || *x > right_x)
return ON_NOTHING; return ON_VERTICAL_BORDER;
lmargin_width = window_box_width (w, LEFT_MARGIN_AREA); lmargin_width = window_box_width (w, LEFT_MARGIN_AREA);
rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA); rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA);
@ -1801,7 +1801,7 @@ static Lisp_Object
window_list_1 (window, minibuf, all_frames) window_list_1 (window, minibuf, all_frames)
Lisp_Object window, minibuf, all_frames; Lisp_Object window, minibuf, all_frames;
{ {
Lisp_Object tail, list; Lisp_Object tail, list, rest;
decode_next_window_args (&window, &minibuf, &all_frames); decode_next_window_args (&window, &minibuf, &all_frames);
list = Qnil; list = Qnil;
@ -1810,7 +1810,17 @@ window_list_1 (window, minibuf, all_frames)
if (candidate_window_p (XCAR (tail), window, minibuf, all_frames)) if (candidate_window_p (XCAR (tail), window, minibuf, all_frames))
list = Fcons (XCAR (tail), list); list = Fcons (XCAR (tail), list);
return Fnreverse (list); /* Rotate the list to start with WINDOW. */
list = Fnreverse (list);
rest = Fmemq (window, list);
if (!NILP (rest) && !EQ (rest, list))
{
for (tail = list; XCDR (tail) != rest; tail = XCDR (tail))
;
XSETCDR (tail, Qnil);
list = nconc2 (rest, list);
}
return list;
} }