From 5fe81923e5b6dbbfb623befa12a3317a7e934a63 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 7 Feb 2018 22:24:13 +0200 Subject: [PATCH] Yet another round of improvements in the manual MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * doc/emacs/misc.texi (Document View): Improve wording. Reported by lyr3 in emacs-manual-bugs@gnu.org. * doc/emacs/files.texi (Recover): Fix a typo. Reported by Jorge in emacs-manual-bugs@gnu.org. * doc/emacs/anti.texi (Antinews): Fix typos. Reported by Justin Heyes-Jones in emacs-manual-bugs@gnu.org. * doc/emacs/mini.texi (Basic Minibuffer): Clarify wording. Reported by Vivishek Sudhir in emacs-manual-bugs@gnu.org. * doc/emacs/cmdargs.texi (MS-Windows Registry): Improve wording regarding registry keys. * doc/emacs/macos.texi (Mac OS / GNUstep): Sayu "NeXT Inc." Reported by Cena Mayo in emacs-manual-bugs@gnu.org. * doc/emacs/screen.texi (Screen): More accurate wording. Suggested by Miloš Polakovič in emacs-manual-bugs@gnu.org. * doc/emacs/indent.texi (Just Spaces): Minor wording change. Suggested by David Bonnafous in emacs-manual-bugs@gnu.org. * doc/emacs/text.texi (TeX Mode, TeX Editing): Improve and simplify wording. Suggested by root@vxid.pw in emacs-manual-bugs@gnu.org. * doc/emacs/cmdargs.texi (Window Size X): Minor wording change. * doc/emacs/display.texi (Highlight Interactively): Fill text. (Optional Mode Line): Fix typos. Suggested by Alberto Sartori in emacs-manual-bugs@gnu.org. * doc/emacs/building.texi (Debugger Operation): Clarify wording. * doc/emacs/files.texi (Directories, Comparing Files, Diff Mode) (Remote Files, File Names, Visiting, Backup Deletion) (Customize Save, Interlocking): Improve wording and accuracy of the text. * doc/emacs/maintaining.texi (VC With A Merging VCS): Don't say "his". * doc/emacs/arevert-xtra.texi (Auto Reverting Dired): Minor wording changes. (Supporting additional buffers): Moved to ... * doc/lispref/backups.texi (Reverting): ... here. * doc/emacs/emacs.texi (Top): Remove "Supporting additional buffers" from master menu. * doc/emacs/files.texi (Reverting): Mention use of file notifications. Suggested by Michael Albinus in emacs-manual-bugs@gnu.org. * doc/emacs/rmail.texi (Rmail Motion): Clarify what '-' does to 'M-s'. Suggested by Arthur Milchior in emacs-manual-bugs@gnu.org. * doc/emacs/cmdargs.texi (Initial Options): Capitalize "Emacs". (Action Arguments): Fix a typo. (Emacs Invocation): Replace em-dash with a comma. Suggested by Justin Heyes-Jones in emacs-manual-bugs@gnu.org. * doc/emacs/m-x.texi (M-x): Add an example. Suggested by Alberto Sartori in emacs-manual-bugs@gnu.org. * doc/emacs/calendar.texi (Calendar/Diary, Calendar Unit Motion): Minor wording changes. --- doc/emacs/anti.texi | 10 ++-- doc/emacs/arevert-xtra.texi | 110 +++--------------------------------- doc/emacs/building.texi | 15 ++--- doc/emacs/calendar.texi | 11 ++-- doc/emacs/cmdargs.texi | 35 ++++++------ doc/emacs/display.texi | 23 ++++---- doc/emacs/emacs.texi | 1 - doc/emacs/files.texi | 83 +++++++++++++++++---------- doc/emacs/indent.texi | 4 +- doc/emacs/m-x.texi | 5 +- doc/emacs/macos.texi | 4 +- doc/emacs/maintaining.texi | 14 ++--- doc/emacs/mini.texi | 4 +- doc/emacs/misc.texi | 4 +- doc/emacs/rmail.texi | 1 + doc/emacs/screen.texi | 14 ++--- doc/emacs/text.texi | 44 +++++++-------- doc/lispref/backups.texi | 80 +++++++++++++++++++++++--- 18 files changed, 230 insertions(+), 232 deletions(-) diff --git a/doc/emacs/anti.texi b/doc/emacs/anti.texi index d4b68a2fac4..0ae81595746 100644 --- a/doc/emacs/anti.texi +++ b/doc/emacs/anti.texi @@ -47,7 +47,7 @@ development will make that unnecessary. @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 @@ -71,10 +71,10 @@ The double-buffering feature of Emacs display on X has been removed. 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 diff --git a/doc/emacs/arevert-xtra.texi b/doc/emacs/arevert-xtra.texi index a619fed4b8f..45fca1f508d 100644 --- a/doc/emacs/arevert-xtra.texi +++ b/doc/emacs/arevert-xtra.texi @@ -40,7 +40,6 @@ explained in the corresponding sections. @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 @@ -68,13 +67,9 @@ automatically erasing the marks. @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 @@ -98,99 +93,10 @@ If you want auto-reverting to resume in the presence of marks and 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. diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 3b645d5e65c..7e4b68e6f71 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -607,15 +607,16 @@ to recompile and restart the program. @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. diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index ed1f53fa70b..be5af998e7e 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi @@ -12,7 +12,7 @@ planned or past events. It also has facilities for managing your 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 @@ -126,10 +126,11 @@ whole year. 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 diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 63db2ac765b..e463e7c8194 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -41,10 +41,11 @@ corresponding long form. 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) @@ -104,7 +105,7 @@ If the startup buffer is disabled (@pxref{Entering Emacs}), then 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}. @@ -326,7 +327,7 @@ in your initialization file (@pxref{Entering Emacs}). @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}). @@ -337,7 +338,7 @@ 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 @@ -753,9 +754,10 @@ name under @file{/Software/GNU/Emacs}; first in the 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 @@ -886,7 +888,7 @@ Specify the color for the mouse cursor when the mouse is in the Emacs window. @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 @@ -1023,11 +1025,12 @@ width. If you start with an @samp{x} followed by an integer, Emacs 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 diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index e22d7f30afb..205ca54728f 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -991,16 +991,15 @@ expressions to highlight in different ways. @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} @@ -1393,13 +1392,13 @@ the option @code{display-time-mode}. The information added to the mode 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 diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 474c4e96e22..163b6f23d84 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -482,7 +482,6 @@ Auto Reverting Non-File Buffers * 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 diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 1418a639fbb..44d19d5bd78 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -116,8 +116,8 @@ the @samp{$}; alternatively, it can be enclosed in braces after the @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 @@ -167,7 +167,9 @@ minibuffer, you can abort the command by typing @kbd{C-g}. @xref{File 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 @@ -291,7 +293,8 @@ see @ref{Drag and Drop}, and @ref{Misc Dired Features}. 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, @@ -638,7 +641,7 @@ you whether it should delete the excess backup versions. If it has 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 @@ -738,7 +741,7 @@ survive a crash even if @code{fsync} works properly. 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. @@ -751,7 +754,7 @@ 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, @@ -952,12 +955,25 @@ discard your changes.) 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 @@ -1159,7 +1175,7 @@ this---saving them---updates the files themselves. @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 @@ -1233,8 +1249,9 @@ named @file{/fsf}: 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} @@ -1320,6 +1337,9 @@ information about the @command{diff} program. 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, @@ -1336,10 +1356,10 @@ would make to the file if you save the buffer. 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 @@ -1353,8 +1373,9 @@ skips one matching range or finds the start of another. 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 @@ -1424,7 +1445,7 @@ Move to the next hunk-start (@code{diff-hunk-next}). 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 @@ -1553,17 +1574,17 @@ modify the original source files rather than the patched source files. @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. @@ -1816,8 +1837,8 @@ To carry out this request, Emacs uses a remote-login program such as @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 diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi index 19e1be729ff..73f0f375155 100644 --- a/doc/emacs/indent.texi +++ b/doc/emacs/indent.texi @@ -201,8 +201,8 @@ are always displayed as empty spaces extending to the next @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 diff --git a/doc/emacs/m-x.texi b/doc/emacs/m-x.texi index a283ca8fd03..a9b80d1addb 100644 --- a/doc/emacs/m-x.texi +++ b/doc/emacs/m-x.texi @@ -56,7 +56,10 @@ of entering the command name. This takes you back to command level. 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 diff --git a/doc/emacs/macos.texi b/doc/emacs/macos.texi index dbde2c8f824..28a5f9041ab 100644 --- a/doc/emacs/macos.texi +++ b/doc/emacs/macos.texi @@ -18,8 +18,8 @@ does not support versions before macOS 10.6. @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. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 8acbb5317ed..127c27c0378 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -542,13 +542,13 @@ been changed in the repository, offer to update it. 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 diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index de16c44720e..332602dcf2a 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -66,8 +66,8 @@ minibuffer-electric-default-mode}. 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 diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 1fb47c3c68e..ccb213f81ba 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -413,8 +413,8 @@ is needed. For OpenDocument and Microsoft Office documents, the 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 diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi index ebfa57c09a7..09cb034e372 100644 --- a/doc/emacs/rmail.texi +++ b/doc/emacs/rmail.texi @@ -175,6 +175,7 @@ Move to the next message containing a match for @var{regexp} @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)} diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi index 37c082e7caf..19a4a9e4b6c 100644 --- a/doc/emacs/screen.texi +++ b/doc/emacs/screen.texi @@ -30,13 +30,13 @@ display systems commonly use the word ``window'' with a different 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 diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index dd08cd15138..45407b21098 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -1498,29 +1498,27 @@ This is an example. @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, @@ -1618,7 +1616,9 @@ to keep braces balanced at all times, rather than inserting them 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 diff --git a/doc/lispref/backups.texi b/doc/lispref/backups.texi index 8ca10d7905c..8ce8f6180d1 100644 --- a/doc/lispref/backups.texi +++ b/doc/lispref/backups.texi @@ -775,16 +775,80 @@ after inserting the modified contents. A custom @code{revert-buffer-function} 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. -- 2.39.2