@item
The @option{--fg-daemon} is gone, leaving only @option{--daemon}. No
-need to procrastinate on the dilemma whether you do or don't want the
+need to procrastinate on the dilemma whether you do or do not want the
new shiny ``headless Emacs'' thingy. Hail, simplicity!
@item
We decided that its complexity and a few random surprising
side-effects aren't justified by the gains, even though those gains
were hailed in some quarters. Yes, Emacs 25.2 will flicker in some
-use cases, but we are sure Emacs users will be able to suck it, a they
-have been doing for years. Since this feature is gone, we've also
-removed the @code{inhibit-double-buffering} frame parameter, which is
-now unnecessary.
+use cases, but we are sure Emacs users will be able to suck it, as
+they have been doing for years. Since this feature is gone, we've
+also removed the @code{inhibit-double-buffering} frame parameter,
+which is now unnecessary.
@item
Non-breaking hyphens and ASCII characters displayed instead of
@menu
* Auto Reverting the Buffer Menu:: Auto Revert of the Buffer Menu.
* Auto Reverting Dired:: Auto Revert of Dired buffers.
-* Supporting additional buffers:: How to add more Auto Revert support.
@end menu
@node Auto Reverting the Buffer Menu
@node Auto Reverting Dired
@subsection Auto Reverting Dired buffers
-Auto-reverting Dired buffers currently works on GNU or Unix style
-operating systems. It may not work satisfactorily on some other
-systems.
-
Dired buffers only auto-revert when the file list of the buffer's main
-directory changes (e.g., when a new file is added). They do not
-auto-revert when information about a particular file changes
+directory changes (e.g., when a new file is added or deleted). They
+do not auto-revert when information about a particular file changes
(e.g., when the size changes) or when inserted subdirectories change.
To be sure that @emph{all} listed information is up to date, you have
to manually revert using @kbd{g}, @emph{even} if auto-reverting is
flags, mark the buffer non-modified using @kbd{M-~}. However, adding,
deleting or changing marks or flags will mark it modified again.
-Remote Dired buffers are not auto-reverted (because it may be slow).
-Neither are Dired buffers for which you used shell wildcards or file
-arguments to list only some of the files. @file{*Find*} and
-@file{*Locate*} buffers do not auto-revert either.
-
-@c FIXME? This should be in the elisp manual?
-@node Supporting additional buffers
-@subsection Adding Support for Auto-Reverting additional Buffers.
-
-This section is intended for Elisp programmers who would like to add
-support for auto-reverting new types of buffers.
-
-To support auto-reverting the buffer must first of all have a suitable
-@code{revert-buffer-function}. @xref{Definition of
-revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
-
-In addition, it must have a suitable @code{buffer-stale-function}.
-
-@c FIXME only defvar in all of doc/emacs!
-@defvar buffer-stale-function
-The value of this variable is a function to check whether a
-buffer needs reverting. This should be a function with one optional
-argument @var{noconfirm}. The function should return non-@code{nil}
-if the buffer should be reverted. The buffer is current when this
-function is called.
-
-While this function is mainly intended for use in auto-reverting, it
-could be used for other purposes as well. For instance, if
-auto-reverting is not enabled, it could be used to warn the user that
-the buffer needs reverting. The idea behind the @var{noconfirm}
-argument is that it should be @code{t} if the buffer is going to be
-reverted without asking the user and @code{nil} if the function is
-just going to be used to warn the user that the buffer is out of date.
-In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
-If the function is only going to be used for auto-reverting, you can
-ignore the @var{noconfirm} argument.
-
-If you just want to automatically auto-revert every
-@code{auto-revert-interval} seconds (like the Buffer Menu), use:
-
-@example
-(setq-local buffer-stale-function
- #'(lambda (&optional noconfirm) 'fast))
-@end example
-
-@noindent
-in the buffer's mode function.
-
-The special return value @samp{fast} tells the caller that the need
-for reverting was not checked, but that reverting the buffer is fast.
-It also tells Auto Revert not to print any revert messages, even if
-@code{auto-revert-verbose} is non-@code{nil}. This is important, as
-getting revert messages every @code{auto-revert-interval} seconds can
-be very annoying. The information provided by this return value could
-also be useful if the function is consulted for purposes other than
-auto-reverting.
-@end defvar
-
-Once the buffer has a suitable @code{revert-buffer-function} and
-@code{buffer-stale-function}, several problems usually remain.
-
-The buffer will only auto-revert if it is marked unmodified. Hence,
-you will have to make sure that various functions mark the buffer
-modified if and only if either the buffer contains information that
-might be lost by reverting, or there is reason to believe that the user
-might be inconvenienced by auto-reverting, because he is actively
-working on the buffer. The user can always override this by manually
-adjusting the modified status of the buffer. To support this, calling
-the @code{revert-buffer-function} on a buffer that is marked
-unmodified should always keep the buffer marked unmodified.
-
-It is important to assure that point does not continuously jump around
-as a consequence of auto-reverting. Of course, moving point might be
-inevitable if the buffer radically changes.
-
-You should make sure that the @code{revert-buffer-function} does not
-print messages that unnecessarily duplicate Auto Revert's own messages,
-displayed if @code{auto-revert-verbose} is @code{t}, and effectively
-override a @code{nil} value for @code{auto-revert-verbose}. Hence,
-adapting a mode for auto-reverting often involves getting rid of such
-messages. This is especially important for buffers that automatically
-revert every @code{auto-revert-interval} seconds.
-
-If the new auto-reverting is part of Emacs, you should mention it
-in the documentation string of @code{global-auto-revert-non-file-buffers}.
+Remote Dired buffers are currently not auto-reverted. Neither are
+Dired buffers for which you used shell wildcards or file arguments to
+list only some of the files. @file{*Find*} and @file{*Locate*}
+buffers do not auto-revert either.
-@ifinfo
-Similarly, you should add a node to this chapter's menu. This node
-@end ifinfo
-@ifnotinfo
-Similarly, you should add a section to this chapter. This section
-@end ifnotinfo
-should at the very least make clear whether enabling auto-reverting
-for the buffer reliably assures that all information in the buffer is
-completely up to date (or will be after @code{auto-revert-interval}
-seconds).
+Note that auto-reverting Dired buffers may not work satisfactorily on
+some systems.
@vindex gud-tooltip-echo-area
GUD Tooltip mode is a global minor mode that adds tooltip support to
GUD@. To toggle this mode, type @kbd{M-x gud-tooltip-mode}. It is
-disabled by default. If enabled, you can move the mouse cursor over a
+disabled by default. If enabled, you can move the mouse pointer over a
variable, a function, or a macro (collectively called
@dfn{identifiers}) to show their values in tooltips
-(@pxref{Tooltips}). Alternatively, mark an identifier or an
-expression by dragging the mouse over it, then leave the mouse in the
-marked area to have the value of the expression displayed in a
-tooltip. The GUD Tooltip mode takes effect in the GUD interaction
-buffer, and in all source buffers with major modes listed in the
-variable @code{gud-tooltip-modes}. If the variable
+(@pxref{Tooltips}). If just placing the mouse pointer over an
+expression doesn't show the value of the expression you had in mind,
+you can tell Emacs more explicitly what expression to evaluate by
+dragging the mouse over the expression, then leaving the mouse inside
+the marked area. The GUD Tooltip mode takes effect in the GUD
+interaction buffer, and in all source buffers with major modes listed
+in the variable @code{gud-tooltip-modes}. If the variable
@code{gud-tooltip-echo-area} is non-@code{nil}, or if you turned off
the tooltip mode, values are shown in the echo area instead of a
tooltip.
appointments, and keeping track of how much time you spend working on
certain projects.
- To enter the calendar, type @kbd{M-x calendar}; this displays a
+ To enter the calendar, type @kbd{M-x calendar}. This displays a
three-month calendar centered on the current month, with point on the
current date. With a numeric argument, as in @kbd{C-u M-x calendar}, it
prompts you for the month and year to be the center of the three-month
The easiest way to remember these commands is to consider months and
years analogous to paragraphs and pages of text, respectively. But
-the commands themselves are not quite analogous. The ordinary Emacs
-paragraph commands move to the beginning or end of a paragraph,
-whereas these month and year commands move by an entire month or an
-entire year, keeping the same date within the month or year.
+the calendar movement commands themselves do not quite parallel those
+for movement through text: the ordinary Emacs paragraph commands move
+to the beginning or end of a paragraph, whereas these month and year
+commands move by an entire month or an entire year, keeping the same
+date within the month or year.
All these commands accept a numeric argument as a repeat count.
For convenience, the digit keys and the minus sign specify numeric
type. However, you don't have to spell out the whole option name; any
unambiguous abbreviation is enough. When a long option takes an
argument, you can use either a space or an equal sign to separate the
-option name and the argument. Thus, you can write either
-@samp{--display sugar-bombs:0.0} or @samp{--display=sugar-bombs:0.0}.
-We recommend an equal sign because it makes the relationship clearer,
-and the tables below always show an equal sign.
+option name and the argument. Thus, for the option @samp{--display},
+you can write either @samp{--display sugar-bombs:0.0} or
+@samp{--display=sugar-bombs:0.0}. We recommend an equal sign because
+it makes the relationship clearer, and the tables below always show an
+equal sign.
@cindex initial options (command line)
@cindex action options (command line)
starting Emacs with one file argument displays the buffer visiting
@var{file} in a single window. With two file arguments, Emacs
displays the files in two different windows. With more than two file
-argument, Emacs displays the last file specified in one window, plus
+arguments, Emacs displays the last file specified in one window, plus
another window with a Buffer Menu showing all the other files
(@pxref{Several Buffers}). To inhibit using the Buffer Menu for this,
change the variable @code{inhibit-startup-buffer-menu} to @code{t}.
@opindex -Q
@itemx --quick
@opindex --quick
-Start emacs with minimum customizations. This is similar to using @samp{-q},
+Start Emacs with minimum customizations. This is similar to using @samp{-q},
@samp{--no-site-file}, @samp{--no-site-lisp}, and @samp{--no-splash}
together. This also stops Emacs from processing X resources by
setting @code{inhibit-x-resources} to @code{t} (@pxref{Resources}).
@opindex --daemon
@itemx --bg-daemon[=@var{name}]
@itemx --fg-daemon[=@var{name}]
-Start Emacs as a daemon---after Emacs starts up, it starts the Emacs
+Start Emacs as a daemon: after Emacs starts up, it starts the Emacs
server without opening any frames.
(Optionally, you can specify an explicit @var{name} for the server.)
You can then use the @command{emacsclient} command to connect to Emacs
there, in the @file{HKEY_LOCAL_MACHINE} section. Finally, if Emacs
still cannot determine the values, compiled-in defaults are used.
-In addition to the environment variables above, you can also add many
-of the settings which on X belong in the @file{.Xdefaults} file
-(@pxref{X Resources}) to the @file{/Software/GNU/Emacs} registry key.
+In addition to the environment variables above, you can also add
+settings to the @file{/Software/GNU/Emacs} registry key to specify X
+resources (@pxref{X Resources}). Most of the settings you can specify
+in your @file{.Xdefaults} file can be set from that registry key.
@node Display X
@appendixsec Specifying the Display Name
@itemx --reverse-video
@opindex --reverse-video
@cindex reverse video, command-line argument
-Reverse video---swap the foreground and background colors.
+Reverse video: swap the foreground and background colors.
@item --color=@var{mode}
@opindex --color
@cindex standard colors on a character terminal
interprets it as the height. Thus, @samp{81} specifies just the
width; @samp{x45} specifies just the height.
- If you start with @samp{+} or @samp{-}, that introduces an offset,
-which means both sizes are omitted. Thus, @samp{-3} specifies the
-@var{xoffset} only. (If you give just one offset, it is always
-@var{xoffset}.) @samp{+3-3} specifies both the @var{xoffset} and the
-@var{yoffset}, placing the frame near the bottom left of the screen.
+ If you start the geometry with @samp{+} or @samp{-}, that introduces
+an offset, which means both sizes are omitted. Thus, @samp{-3}
+specifies the @var{xoffset} only. (If you give just one offset, it is
+always @var{xoffset}.) @samp{+3-3} specifies both the @var{xoffset}
+and the @var{yoffset}, placing the frame near the bottom left of the
+screen.
You can specify a default for any or all of the fields in your X
resource file (@pxref{Resources}), and then override selected fields
@kindex M-s h u
@kindex C-x w r
@findex unhighlight-regexp
-Unhighlight @var{regexp} (@code{unhighlight-regexp}).
-
-If you invoke this from the menu, you select the expression to
-unhighlight from a list. If you invoke this from the keyboard, you
-use the minibuffer. It will show the most recently added regular
-expression; use @kbd{M-n} to show the next older expression and
-@kbd{M-p} to select the next newer expression. (You can also type the
-expression by hand, with completion.) When the expression you want to
-unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit
-the minibuffer and unhighlight it.
+Unhighlight @var{regexp} (@code{unhighlight-regexp}). If you invoke
+this from the menu, you select the expression to unhighlight from a
+list. If you invoke this from the keyboard, you use the minibuffer.
+It will show the most recently added regular expression; use @kbd{M-n}
+to show the next older expression and @kbd{M-p} to select the next
+newer expression. (You can also type the expression by hand, with
+completion.) When the expression you want to unhighlight appears in
+the minibuffer, press @kbd{@key{RET}} to exit the minibuffer and
+unhighlight it.
@item M-s h l @var{regexp} @key{RET} @var{face} @key{RET}
@itemx C-x w l @var{regexp} @key{RET} @var{face} @key{RET}
line looks like this:
@example
-@var{hh}:@var{mm}pm @var{l.ll}
+@var{hh}:@var{mm}PM @var{l.ll}
@end example
@noindent
@vindex display-time-24hr-format
Here @var{hh} and @var{mm} are the hour and minute, followed always by
-@samp{am} or @samp{pm}. @var{l.ll} is the average number, collected
+@samp{AM} or @samp{PM}. @var{l.ll} is the average number, collected
for the last few minutes, of processes in the whole system that were
either running or ready to run (i.e., were waiting for an available
processor). (Some fields may be missing if your operating system
* Auto Reverting the Buffer Menu:: Auto Revert of the Buffer Menu.
* Auto Reverting Dired:: Auto Revert of Dired buffers.
-* Supporting additional buffers:: How to add more Auto Revert support.
@end ifnottex
Auto-Saving: Protection Against Disasters
@file{/u/$@{FOO@}/test.c} are abbreviations for
@file{/u/rms/hacks/test.c}. If the environment variable is not
defined, no substitution occurs, so that the character @samp{$} stands
-for itself. Note that environment variables affect Emacs only if they
-are applied before Emacs is started.
+for itself. Note that environment variables set outside Emacs affect
+Emacs only if they are applied before Emacs is started.
To access a file with @samp{$} in its name, if the @samp{$} causes
expansion, type @samp{$$}. This pair is converted to a single
Names}, for details about entering file names into minibuffers.
If the specified file exists but the system does not allow you to
-read it, an error message is displayed in the echo area. Otherwise,
+read it, an error message is displayed in the echo area (on GNU and
+Unix systems you might be able to visit such a file using the
+@samp{su} or @samp{sudo} methods; @pxref{Remote Files}). Otherwise,
you can tell that @kbd{C-x C-f} has completed successfully by the
appearance of new text on the screen, and by the buffer name shown in
the mode line (@pxref{Mode Line}). Emacs normally constructs the
On text-mode terminals and on graphical displays when Emacs was
built without a GUI toolkit, you can visit files via the menu-bar
-@samp{File} menu, which has a @samp{Visit New File} item.
+@samp{File} menu, which has a @samp{Visit New File} and @samp{Open
+File} items.
Each time you visit a file, Emacs automatically scans its contents
to detect what character encoding and end-of-line convention it uses,
any other value, then Emacs never automatically deletes backups.
Dired's @kbd{.} (Period) command can also be used to delete old versions.
-@xref{Dired Deletion}.
+@xref{Flagging Many Files}.
@node Backup Copying
@subsubsection Copying vs.@: Renaming
The @code{write-region-inhibit-fsync} variable controls whether
Emacs invokes @code{fsync} after saving a file. The variable's
default value is @code{nil} when Emacs is interactive, and @code{t}
-when Emacs runs in batch mode (@pxref{Initial Options, batch mode}).
+when Emacs runs in batch mode (@pxref{Initial Options, Batch Mode}).
Emacs never uses @code{fsync} when writing auto-save files, as these
files might lose data anyway.
Simultaneous editing occurs when two users visit the same file, both
make changes, and then both save them. If nobody is informed that
this is happening, whichever user saves first would later find that
-his changes were lost.
+their changes were lost.
On some systems, Emacs notices immediately when the second user starts
to change the file, and issues an immediate warning. On all systems,
You can also tell Emacs to revert buffers periodically. To do this
for a specific buffer, enable the minor mode Auto-Revert mode by
typing @kbd{M-x auto-revert-mode}. This automatically reverts the
-current buffer every five seconds; you can change the interval through
-the variable @code{auto-revert-interval}. To do the same for all file
-buffers, type @kbd{M-x global-auto-revert-mode} to enable Global
-Auto-Revert mode. These minor modes do not check or revert remote
-files, because that is usually too slow. This behavior can be changed
-by setting the variable @code{auto-revert-remote-files} to non-@code{nil}.
+current buffer when its visited file changes on disk. To do the same
+for all file buffers, type @kbd{M-x global-auto-revert-mode} to enable
+Global Auto-Revert mode. These minor modes do not check or revert
+remote files, because that is usually too slow. This behavior can be
+changed by setting the variable @code{auto-revert-remote-files} to
+non-@code{nil}.
+
+@cindex file notifications
+@vindex auto-revert-use-notify
+ By default, Auto-Revert mode works using @dfn{file notifications},
+whereby changes in the filesystem are reported to Emacs by the OS.
+You can disable use of file notifications by customizing the variable
+@code{auto-revert-use-notify} to a @code{nil} value, then Emacs will
+check for file changes by polling every five seconds. You can change
+the polling interval through the variable @code{auto-revert-interval}.
+
+ Not all systems support file notifications; where they are not
+supported, @code{auto-revert-use-notify} will be @code{nil} by
+default.
One use of Auto-Revert mode is to ``tail'' a file such as a system
log, so that changes made to that file by other programs are
@vindex auto-save-list-file-prefix
Emacs records information about interrupted sessions in files named
-@file{.saves-@var{pid}-@var{hostname}} in the directory
+@file{.saves-@var{pid}-@var{hostname}~} in the directory
@file{~/.emacs.d/auto-save-list/}. This directory is determined by
the variable @code{auto-save-list-file-prefix}. If you set
@code{auto-save-list-file-prefix} to @code{nil}, sessions are not
listing} is a list of all the files in a directory. Emacs provides
commands to create and delete directories, and to make directory
listings in brief format (file names only) and verbose format (sizes,
-dates, and authors included). Emacs also includes a directory browser
-feature called Dired; see @ref{Dired}.
+dates, and other attributes included). Emacs also includes a
+directory browser feature called Dired, which you can invoke with
+@kbd{C-x d}; see @ref{Dired}.
@table @kbd
@item C-x C-d @var{dir-or-pattern} @key{RET}
The output of the @code{diff} command is shown using a major mode
called Diff mode. @xref{Diff Mode}.
+ A (much more sophisticated) alternative is @kbd{M-x ediff}
+(@pxref{Top, Ediff, Ediff, ediff, The Ediff Manual}).
+
@findex diff-backup
The command @kbd{M-x diff-backup} compares a specified file with its
most recent backup. If you specify the name of a backup file,
current window with that in the window that was the selected window
before you selected the current one. (For more information about
windows in Emacs, @ref{Windows}.) Comparison starts at point in each
-window, after pushing each initial point value on the mark ring in its
-respective buffer. Then it moves point forward in each window, one
-character at a time, until it reaches characters that don't match.
-Then the command exits.
+window, after pushing each initial point value on the mark ring
+(@pxref{Mark Ring}) in its respective buffer. Then it moves point
+forward in each window, one character at a time, until it reaches
+characters that don't match. Then the command exits.
If point in the two windows is followed by non-matching text when
the command starts, @kbd{M-x compare-windows} tries heuristically to
whitespace. If the variable @code{compare-ignore-case} is
non-@code{nil}, the comparison ignores differences in case as well.
If the variable @code{compare-ignore-whitespace} is non-@code{nil},
-@code{compare-windows} normally ignores changes in whitespace, and a
-prefix argument turns that off.
+@code{compare-windows} by default ignores changes in whitespace, but a
+prefix argument turns that off for that single invocation of the
+command.
@cindex Smerge mode
@findex smerge-mode
This command has a side effect: it @dfn{refines} the hunk you move to,
highlighting its changes with better granularity. To disable this
feature, type @kbd{M-x diff-auto-refine-mode} to toggle off the minor
-mode Diff Auto-Refine mode. To disable Diff Auto Refine mode by
+mode Diff Auto-Refine mode. To disable Diff Auto-Refine mode by
default, add this to your init file (@pxref{Hooks}):
@example
@section Copying, Naming and Renaming Files
Emacs has several commands for copying, naming, and renaming files.
-All of them read two file names @var{old} and @var{new} using the
-minibuffer, and then copy or adjust a file's name accordingly; they do
-not accept wildcard file names.
+All of them read two file names, @var{old} (or @var{target}) and
+@var{new}, using the minibuffer, and then copy or adjust a file's name
+accordingly; they do not accept wildcard file names.
In all these commands, if the argument @var{new} is just a directory
-name, the real new name is in that directory, with the same
+name (@pxref{Directory Names,,, elisp, the Emacs Lisp Reference
+Manual}), the real new name is in that directory, with the same
non-directory component as @var{old}. For example, the command
@w{@kbd{M-x rename-file @key{RET} ~/foo @key{RET} /tmp/ @key{RET}}}
renames @file{~/foo} to @file{/tmp/foo}. On GNU and other POSIX-like
-systems, directory names end in @samp{/}. @xref{Directory Names,,,
-elisp, the Emacs Lisp Reference Manual}.
+systems, directory names end in @samp{/}.
All these commands ask for confirmation when the new file name already
exists.
@command{ssh}.
You must always specify in the file name which method to use---for
example, @file{/ssh:@var{user}@@@var{host}:@var{filename}} uses
-@command{ssh}. When you specify the pseudo method @var{-} in the file
-name, Emacs chooses the method as follows:
+@command{ssh}. When you specify the pseudo method @samp{-} in the
+file name, Emacs chooses the method as follows:
@enumerate
@item
@node Just Spaces
@section Tabs vs.@: Spaces
- Normally, indentation commands insert (or remove) an optimal mix of
-space characters and tab characters to align to the desired column.
+ Normally, indentation commands insert (or remove) a mix of space
+characters and tab characters so as to align to the desired column.
Tab characters are displayed as a stretch of empty space extending to
the next @dfn{display tab stop}. By default, there is one display tab
stop every @code{tab-width} columns (the default is 8). @xref{Text
To pass a numeric argument to the command you are invoking with
@kbd{M-x}, specify the numeric argument before @kbd{M-x}. The
argument value appears in the prompt while the command name is being
-read, and finally @kbd{M-x} passes the argument to that command.
+read, and finally @kbd{M-x} passes the argument to that command. For
+example, to pass the numeric argument of 42 to the command
+@code{forward-char} you can type @kbd{C-u 42 M-x forward-char
+@key{RET}}.
@vindex suggest-key-bindings
When the command you run with @kbd{M-x} has a key binding, Emacs
@samp{Nextstep} internally, instead of ``Cocoa'' or ``macOS''; for
instance, most of the commands and variables described in this section
begin with @samp{ns-}, which is short for @samp{Nextstep}. NeXTstep
-was an application interface released by NeXT Inc during the 1980s, of
-which Cocoa is a direct descendant. Apart from Cocoa, there is
+was an application interface released by NeXT Inc.@: during the 1980s,
+of which Cocoa is a direct descendant. Apart from Cocoa, there is
another NeXTstep-style system: GNUstep, which is free software. As of
this writing, Emacs GNUstep support is alpha status (@pxref{GNUstep
Support}), but we hope to improve it in the future.
These rules also apply when you use RCS in its non-locking mode,
except that changes are not automatically merged from the repository.
Nothing informs you if another user has committed changes in the same
-file since you began editing it; when you commit your revision, his
-changes are removed (however, they remain in the repository and are
-thus not irrevocably lost). Therefore, you must verify that the
-current revision is unchanged before committing your changes. In
-addition, locking is possible with RCS even in this mode: @kbd{C-x v
-v} with an unmodified file locks the file, just as it does with RCS in
-its normal locking mode (@pxref{VC With A Locking VCS}).
+file since you began editing it; when you commit your revision, that
+other user's changes are removed (however, they remain in the
+repository and are thus not irrevocably lost). Therefore, you must
+verify that the current revision is unchanged before committing your
+changes. In addition, locking is possible with RCS even in this mode:
+@kbd{C-x v v} with an unmodified file locks the file, just as it does
+with RCS in its normal locking mode (@pxref{VC With A Locking VCS}).
@node VC With A Locking VCS
@subsubsection Basic Version Control with Locking
other uses of the echo area. If an error message or an informative
message is emitted while the minibuffer is active, the message hides
the minibuffer for a few seconds, or until you type something; then
-the minibuffer comes back. While the minibuffer is in use, keystrokes
-do not echo.
+the minibuffer comes back. While the minibuffer is in use, Emacs does
+not echo keystrokes.
@node Minibuffer File
@section Minibuffers for File Names
When you visit a document file that can be displayed with DocView
mode, Emacs automatically uses DocView mode @footnote{The needed
external tools for the document type must be available, and Emacs must
-be running in a graphical frame and have PNG image support. If any of
-these requirements is not fulfilled, Emacs falls back to another major
+be running in a graphical frame and have PNG image support. If these
+requirements is not fulfilled, Emacs falls back to another major
mode.}. As an exception, when you visit a PostScript file, Emacs
switches to PS mode, a major mode for editing PostScript files as
text; however, it also enables DocView minor mode, so you can type
@item - M-s @var{regexp} @key{RET}
Move to the previous message containing a match for @var{regexp}.
+(This is @kbd{M-s} with a negative argument.)
@end table
@kindex n @r{(Rmail)}
meaning; but, as stated above, we refer to those graphical windows
as ``frames''.
- An Emacs window is where the @dfn{buffer}---the text you are
-editing---is displayed. On a graphical display, the window possesses
-a @dfn{scroll bar} on one side, which can be used to scroll through
-the buffer. The last line of the window is a @dfn{mode line}. This
-displays various information about what is going on in the buffer,
-such as whether there are unsaved changes, the editing modes that are
-in use, the current line number, and so forth.
+ An Emacs window is where the @dfn{buffer}---the text or other
+graphics you are editing or viewing---is displayed. On a graphical
+display, the window possesses a @dfn{scroll bar} on one side, which
+can be used to scroll through the buffer. The last line of the window
+is a @dfn{mode line}. This displays various information about what is
+going on in the buffer, such as whether there are unsaved changes, the
+editing modes that are in use, the current line number, and so forth.
When you start Emacs, there is normally only one window in the
frame. However, you can subdivide this window horizontally or
@findex doctex-mode
@findex bibtex-mode
- Emacs provides special major modes for editing files written in
-@TeX{} and its related formats. @TeX{} is a powerful text formatter
-written by Donald Knuth; like GNU Emacs, it is free software.
-@LaTeX{} is a simplified input format for @TeX{}, implemented using
-@TeX{} macros. Doc@TeX{} is a special file format in which the
-@LaTeX{} sources are written, combining sources with documentation.
-Sli@TeX{} is an obsolete special form of @LaTeX{}.@footnote{It has
-been replaced by the @samp{slides} document class, which comes with
-@LaTeX{}.}
+ @TeX{} is a powerful text formatter written by Donald Knuth; like
+GNU Emacs, it is free software. The @TeX{} format has several
+variants, including @LaTeX{}, a simplified input format for @TeX{};
+Doc@TeX{}, a special file format in which the @LaTeX{} sources are
+written, combining sources with documentation; and Sli@TeX{}, an
+obsolete special form of @LaTeX{}@footnote{
+It has been replaced by the @samp{slides} document class, which comes
+with @LaTeX{}.}.
@vindex tex-default-mode
- @TeX{} mode has four variants: Plain @TeX{} mode, @LaTeX{} mode,
-Doc@TeX{} mode, and Sli@TeX{} mode. These distinct major modes differ
-only slightly, and are designed for editing the four different
-formats. Emacs selects the appropriate mode by looking at the
-contents of the buffer. (This is done by the @code{tex-mode} command,
-which is normally called automatically when you visit a @TeX{}-like
-file. @xref{Choosing Modes}.) If the contents are insufficient to
-determine this, Emacs chooses the mode specified by the variable
-@code{tex-default-mode}; its default value is @code{latex-mode}. If
-Emacs does not guess right, you can select the correct variant of
-@TeX{} mode using the command @kbd{M-x plain-tex-mode}, @kbd{M-x
-latex-mode}, @kbd{M-x slitex-mode}, or @kbd{doctex-mode}.
+ Emacs provides a @TeX{} major mode for each of these variants: Plain
+@TeX{} mode, @LaTeX{} mode, Doc@TeX{} mode, and Sli@TeX{} mode. Emacs
+selects the appropriate mode by looking at the contents of the buffer.
+(This is done by the @code{tex-mode} command, which is normally called
+automatically when you visit a @TeX{}-like file. @xref{Choosing
+Modes}.) If the contents are insufficient to determine this, Emacs
+chooses the mode specified by the variable @code{tex-default-mode};
+its default value is @code{latex-mode}. If Emacs does not guess
+right, you can select the correct variant of @TeX{} mode using the
+command @kbd{M-x plain-tex-mode}, @kbd{M-x latex-mode}, @kbd{M-x
+slitex-mode}, or @kbd{doctex-mode}.
The following sections document the features of @TeX{} mode and its
variants. There are several other @TeX{}-related Emacs packages,
singly. Use @kbd{C-c @{} (@code{tex-insert-braces}) to insert a pair of
braces. It leaves point between the two braces so you can insert the
text that belongs inside. Afterward, use the command @kbd{C-c @}}
-(@code{up-list}) to move forward past the close brace.
+(@code{up-list}) to move forward past the close brace. You can also
+invoke @kbd{C-c @{} after marking some text: then the command encloses
+the marked text in braces.
@findex tex-validate-region
@findex tex-terminate-paragraph
may or may not run this hook.
@end defvar
-@c FIXME? Move this section from arevert-xtra to here?
+Emacs can revert buffers automatically. It does that by default for
+buffers visiting files. The following describes how to add support
+for auto-reverting new types of buffers.
+
+First, such buffers must have a suitable @code{revert-buffer-function}
+and @code{buffer-stale-function} defined.
+
@defvar buffer-stale-function
The value of this variable specifies a function to call to check
whether a buffer needs reverting. The default value only handles
buffers that are visiting files, by checking their modification time.
-Buffers that are not visiting files require a custom function
-@iftex
-(@pxref{Supporting additional buffers,,, emacs-xtra, Specialized Emacs Features}).
-@end iftex
-@ifnottex
-(@pxref{Supporting additional buffers,,, emacs}).
-@end ifnottex
+Buffers that are not visiting files require a custom function of one
+optional argument @var{noconfirm}. The function should return
+non-@code{nil} if the buffer should be reverted. The buffer is
+current when this function is called.
+
+While this function is mainly intended for use in auto-reverting, it
+could be used for other purposes as well. For instance, if
+auto-reverting is not enabled, it could be used to warn the user that
+the buffer needs reverting. The idea behind the @var{noconfirm}
+argument is that it should be @code{t} if the buffer is going to be
+reverted without asking the user and @code{nil} if the function is
+just going to be used to warn the user that the buffer is out of date.
+In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
+If the function is only going to be used for auto-reverting, you can
+ignore the @var{noconfirm} argument.
+
+If you just want to automatically auto-revert every
+@code{auto-revert-interval} seconds (like the Buffer Menu), use:
+
+@example
+(setq-local buffer-stale-function
+ #'(lambda (&optional noconfirm) 'fast))
+@end example
+
+@noindent
+in the buffer's mode function.
+
+The special return value @samp{fast} tells the caller that the need
+for reverting was not checked, but that reverting the buffer is fast.
+It also tells Auto Revert not to print any revert messages, even if
+@code{auto-revert-verbose} is non-@code{nil}. This is important, as
+getting revert messages every @code{auto-revert-interval} seconds can
+be very annoying. The information provided by this return value could
+also be useful if the function is consulted for purposes other than
+auto-reverting.
@end defvar
+
+Once the buffer has a suitable @code{revert-buffer-function} and
+@code{buffer-stale-function}, several problems usually remain.
+
+The buffer will only auto-revert if it is marked unmodified. Hence,
+you will have to make sure that various functions mark the buffer
+modified if and only if either the buffer contains information that
+might be lost by reverting, or there is reason to believe that the user
+might be inconvenienced by auto-reverting, because he is actively
+working on the buffer. The user can always override this by manually
+adjusting the modified status of the buffer. To support this, calling
+the @code{revert-buffer-function} on a buffer that is marked
+unmodified should always keep the buffer marked unmodified.
+
+It is important to assure that point does not continuously jump around
+as a consequence of auto-reverting. Of course, moving point might be
+inevitable if the buffer radically changes.
+
+You should make sure that the @code{revert-buffer-function} does not
+print messages that unnecessarily duplicate Auto Revert's own messages,
+displayed if @code{auto-revert-verbose} is @code{t}, and effectively
+override a @code{nil} value for @code{auto-revert-verbose}. Hence,
+adapting a mode for auto-reverting often involves getting rid of such
+messages. This is especially important for buffers that automatically
+revert every @code{auto-revert-interval} seconds.
+
+If the new auto-reverting is part of Emacs, you should mention it
+in the documentation string of @code{global-auto-revert-non-file-buffers}.
+
+Similarly, you should document the additions in the Emacs manual.