aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-10-21 22:45:34 +0800
committerChong Yidong2011-10-21 22:45:34 +0800
commitbfd779dd73eb7bc3258c98e12aa7fbcbc98f6bbd (patch)
tree672d198fddf1c5aacfff00694c8dbcc64dd4e40a
parentf9888580794b9addf34bd138075a4503c24793c0 (diff)
downloademacs-bfd779dd73eb7bc3258c98e12aa7fbcbc98f6bbd.tar.gz
emacs-bfd779dd73eb7bc3258c98e12aa7fbcbc98f6bbd.zip
Update Files chapter of Emacs manual.
Plus miscellaneous minor speling fixes in other manual files. * doc/emacs/files.texi (File Names, Visiting, Interlocking): Copyedits. (Backup Copying): backup-by-copying-when-mismatch is now t. (Customize Save): Fix description of require-final-newline. (Reverting): Note that revert-buffer can't be undone. Mention VC. (Auto Save Control): Clarify. (File Archives): Add 7z. (Remote Files): ange-ftp-make-backup-files defaults to nil. * doc/emacs/arevert-xtra.texi (Autorevert): Copyedits.
-rw-r--r--admin/FOR-RELEASE6
-rw-r--r--doc/emacs/ChangeLog12
-rw-r--r--doc/emacs/arevert-xtra.texi10
-rw-r--r--doc/emacs/basic.texi2
-rw-r--r--doc/emacs/buffers.texi2
-rw-r--r--doc/emacs/commands.texi2
-rw-r--r--doc/emacs/display.texi2
-rw-r--r--doc/emacs/files.texi633
-rw-r--r--doc/emacs/help.texi2
-rw-r--r--doc/emacs/killing.texi2
-rw-r--r--doc/emacs/screen.texi2
-rw-r--r--doc/emacs/search.texi2
-rw-r--r--etc/NEWS10
13 files changed, 332 insertions, 355 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 7b1b7df7704..80a66be3fa4 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -151,7 +151,7 @@ TUTORIAL.zh
151abbrevs.texi 151abbrevs.texi
152ack.texi 152ack.texi
153anti.texi 153anti.texi
154arevert-xtra.texi 154arevert-xtra.texi cyd
155basic.texi cyd 155basic.texi cyd
156buffers.texi 156buffers.texi
157building.texi 157building.texi
@@ -167,7 +167,7 @@ emacs.texi
167emacs-xtra.texi 167emacs-xtra.texi
168emerge-xtra.texi 168emerge-xtra.texi
169entering.texi cyd 169entering.texi cyd
170files.texi 170files.texi cyd
171fixit.texi 171fixit.texi
172fortran-xtra.texi 172fortran-xtra.texi
173frames.texi 173frames.texi
@@ -175,7 +175,7 @@ glossary.texi
175help.texi cyd 175help.texi cyd
176indent.texi 176indent.texi
177killing.texi cyd 177killing.texi cyd
178kmacro.texi 178kmacro.texi cyd
179macos.texi 179macos.texi
180maintaining.texi 180maintaining.texi
181major.texi 181major.texi
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 5b07d4d692a..94b7bbe2432 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,15 @@
12011-10-21 Chong Yidong <cyd@gnu.org>
2
3 * files.texi (File Names, Visiting, Interlocking): Copyedits.
4 (Backup Copying): backup-by-copying-when-mismatch is now t.
5 (Customize Save): Fix description of require-final-newline.
6 (Reverting): Note that revert-buffer can't be undone. Mention VC.
7 (Auto Save Control): Clarify.
8 (File Archives): Add 7z.
9 (Remote Files): ange-ftp-make-backup-files defaults to nil.
10
11 * arevert-xtra.texi (Autorevert): Copyedits.
12
12011-10-20 Chong Yidong <cyd@gnu.org> 132011-10-20 Chong Yidong <cyd@gnu.org>
2 14
3 * custom.texi (Hooks, Init Examples): 15 * custom.texi (Hooks, Init Examples):
diff --git a/doc/emacs/arevert-xtra.texi b/doc/emacs/arevert-xtra.texi
index 374886cd956..6a24646b5f7 100644
--- a/doc/emacs/arevert-xtra.texi
+++ b/doc/emacs/arevert-xtra.texi
@@ -8,11 +8,11 @@
8@section Auto Reverting Non-File Buffers 8@section Auto Reverting Non-File Buffers
9 9
10Global Auto Revert Mode normally only reverts file buffers. There are 10Global Auto Revert Mode normally only reverts file buffers. There are
11two ways to auto-revert certain non-file buffers: enabling Auto Revert 11two ways to auto-revert certain non-file buffers: by enabling Auto
12Mode in those buffers (using @kbd{M-x auto-revert-mode}); and setting 12Revert Mode in those buffers (using @kbd{M-x auto-revert-mode}); and
13@code{global-auto-revert-non-file-buffers} non-@code{nil}. The latter 13by setting @code{global-auto-revert-non-file-buffers} to a
14enables Auto Reverting for all types of buffers for which it is 14non-@code{nil} value. The latter enables Auto Reverting for all types
15implemented (listed in the menu below). 15of buffers for which it is implemented (listed in the menu below).
16 16
17Like file buffers, non-file buffers should normally not revert while 17Like file buffers, non-file buffers should normally not revert while
18you are working on them, or while they contain information that might 18you are working on them, or while they contain information that might
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
index 714e03720bc..abb65982873 100644
--- a/doc/emacs/basic.texi
+++ b/doc/emacs/basic.texi
@@ -367,7 +367,7 @@ the preceding newline, joining this line to the previous one.
367 If, however, the region is active, @kbd{@key{DEL}} instead deletes 367 If, however, the region is active, @kbd{@key{DEL}} instead deletes
368the text in the region. @xref{Mark}, for a description of the region. 368the text in the region. @xref{Mark}, for a description of the region.
369 369
370 On most keyboards, @key{DEL} is labelled @key{Backspace}, but we 370 On most keyboards, @key{DEL} is labeled @key{Backspace}, but we
371refer to it as @key{DEL} in this manual. (Do not confuse @key{DEL} 371refer to it as @key{DEL} in this manual. (Do not confuse @key{DEL}
372with the @key{Delete} key; we will discuss @key{Delete} momentarily.) 372with the @key{Delete} key; we will discuss @key{Delete} momentarily.)
373On some text-only terminals, Emacs may not recognize the @key{DEL} key 373On some text-only terminals, Emacs may not recognize the @key{DEL} key
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index b82f3fac7d4..1108b501ee9 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -245,7 +245,7 @@ value in each buffer and makes the buffer read-only if its value is
245non-@code{nil}. If you have files under version control, you may find 245non-@code{nil}. If you have files under version control, you may find
246it convenient to bind @kbd{C-x C-q} to @code{vc-toggle-read-only} 246it convenient to bind @kbd{C-x C-q} to @code{vc-toggle-read-only}
247instead. This will guard you against an operation that will confuse 247instead. This will guard you against an operation that will confuse
248most modern version-conmtrol systems. @xref{Version Control}. 248most modern version-control systems. @xref{Version Control}.
249 249
250@findex rename-buffer 250@findex rename-buffer
251 @kbd{M-x rename-buffer} changes the name of the current buffer. You 251 @kbd{M-x rename-buffer} changes the name of the current buffer. You
diff --git a/doc/emacs/commands.texi b/doc/emacs/commands.texi
index de6e7539c27..817cfc369d1 100644
--- a/doc/emacs/commands.texi
+++ b/doc/emacs/commands.texi
@@ -46,7 +46,7 @@ are certain characters found on non-English keyboards
46@cindex M- 46@cindex M-
47 Emacs also recognizes control characters that are entered using 47 Emacs also recognizes control characters that are entered using
48@dfn{modifier keys}. Two commonly-used modifier keys are 48@dfn{modifier keys}. Two commonly-used modifier keys are
49@key{Control} (usually labelled @key{Ctrl}), and @key{Meta} (usually 49@key{Control} (usually labeled @key{Ctrl}), and @key{Meta} (usually
50labeled @key{Alt})@footnote{We refer to @key{Alt} as @key{Meta} for 50labeled @key{Alt})@footnote{We refer to @key{Alt} as @key{Meta} for
51historical reasons.}. For example, @kbd{Control-a} is entered by 51historical reasons.}. For example, @kbd{Control-a} is entered by
52holding down the @key{Ctrl} key while pressing @kbd{a}; we will refer 52holding down the @key{Ctrl} key while pressing @kbd{a}; we will refer
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 254f9465690..b72e24bf243 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1415,7 +1415,7 @@ to make the screen blink.
1415 The variable @code{echo-keystrokes} controls the echoing of multi-character 1415 The variable @code{echo-keystrokes} controls the echoing of multi-character
1416keys; its value is the number of seconds of pause required to cause echoing 1416keys; its value is the number of seconds of pause required to cause echoing
1417to start, or zero, meaning don't echo at all. The value takes effect when 1417to start, or zero, meaning don't echo at all. The value takes effect when
1418there is someting to echo. @xref{Echo Area}. 1418there is something to echo. @xref{Echo Area}.
1419 1419
1420@cindex mouse pointer 1420@cindex mouse pointer
1421@cindex hourglass pointer display 1421@cindex hourglass pointer display
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 433bf617598..fdd977cf5ff 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -47,58 +47,51 @@ on file directories.
47@section File Names 47@section File Names
48@cindex file names 48@cindex file names
49 49
50 Many Emacs commands that operate on a file require you to specify
51the file name, using the minibuffer (@pxref{Minibuffer}). You can use
52@dfn{completion} to specify long file names (@pxref{Completion}).
53Note that file name completion ignores file names whose extensions
54appear in the variable @code{completion-ignored-extensions}
55(@pxref{Completion Options}).
56
57@cindex default file name 50@cindex default file name
58 For most operations, there is a @dfn{default file name} which is 51 Many Emacs commands that operate on a file require you to specify
59used if you type just @key{RET} to enter an empty argument. Normally, 52the file name, using the minibuffer (@pxref{Minibuffer File}). You
60the default file name is the name of the file visited in the current 53can use @dfn{completion} to specify long file names
61buffer. 54(@pxref{Completion}); note that file name completion ignores file
55names whose extensions appear in the variable
56@code{completion-ignored-extensions} (@pxref{Completion Options}).
62 57
63@cindex default directory 58@cindex default directory
64@vindex default-directory 59@vindex default-directory
65@vindex insert-default-directory 60@vindex insert-default-directory
66 Each buffer has a @dfn{default directory} which is normally the same 61 Each buffer has a @dfn{default directory}, stored in the
67as the directory of the file visited in that buffer. For example, if 62buffer-local variable @code{default-directory}. Whenever Emacs reads
68the default file name is @file{/u/rms/gnu/gnu.tasks}, the default 63a file name using the minibuffer, it usually inserts the default
69directory is normally @file{/u/rms/gnu/}. The default directory is 64directory into the minibuffer as the initial contents. You can
70kept in the variable @code{default-directory}, which has a separate 65inhibit this insertion by changing the variable
71value in every buffer. When a command reads a file name using the 66@code{insert-default-directory} to @code{nil} (@pxref{Minibuffer
72minibuffer, the default directory usually serves as the initial 67File}). Regardless, Emacs always assumes that any relative file name
73contents of the minibuffer. To inhibit the insertion of the default 68is relative to the default directory, e.g. entering a file name
74directory, set the variable @code{insert-default-directory} to 69without a directory specifies a file in the default directory.
75@code{nil}.
76 70
77 If you enter a file name without a directory, that specifies a file 71@findex cd
78in the default directory. If you specify a directory in a relative 72@findex pwd
79fashion, with a name that does not start with a slash, it is 73 When you visit a file, Emacs sets @code{default-directory} in the
80interpreted with respect to the default directory. For example, 74visiting buffer to the directory of its file. When you create a new
81suppose the default directory is @file{/u/rms/gnu/}. Entering just 75buffer that is not visiting a file, via a command like @kbd{C-x b},
82@samp{foo} in the minibuffer, with a directory omitted, specifies the 76its default directory is usually copied from the buffer that was
83file @file{/u/rms/gnu/foo}; entering @samp{../.login} specifies 77current at the time (@pxref{Select Buffer}). You can use the command
78@kbd{M-x pwd} to see the value of @code{default-directory} in the
79current buffer. The command @kbd{M-x cd} prompts for a directory
80name, and sets the buffer's @code{default-directory} to that directory
81(doing this does not change the buffer's file name, if any).
82
83 As an example, when you visit the file @file{/u/rms/gnu/gnu.tasks},
84the default directory is set to @file{/u/rms/gnu/}. If you invoke a
85command that reads a file name, entering just @samp{foo} in the
86minibuffer, with a directory omitted, specifies the file
87@file{/u/rms/gnu/foo}; entering @samp{../.login} specifies
84@file{/u/rms/.login}; and entering @samp{new/foo} specifies 88@file{/u/rms/.login}; and entering @samp{new/foo} specifies
85@file{/u/rms/gnu/new/foo}. 89@file{/u/rms/gnu/new/foo}.
86 90
87 When typing a file name into the minibuffer, you can make use of a 91 When typing a file name into the minibuffer, you can make use of a
88couple of shortcuts: a double slash is interpreted as ``ignore 92couple of shortcuts: a double slash is interpreted as ``ignore
89everything before the second slash in the pair,'' and @samp{~/} is 93everything before the second slash in the pair,'' and @samp{~/} is
90interpreted as your home directory. @xref{Minibuffer File}, for more 94interpreted as your home directory. @xref{Minibuffer File}.
91information about these shortcuts.
92
93@findex cd
94@findex pwd
95 The command @kbd{M-x pwd} displays the default directory, and the
96command @kbd{M-x cd} sets it to a value read using the minibuffer. A
97buffer's default directory changes only when the @code{cd} command is
98used. A file-visiting buffer's default directory is initialized to
99the directory of the file it visits. If you create a buffer with
100@kbd{C-x b}, its default directory is copied from that of the buffer
101that was current at the time (@pxref{Select Buffer}).
102 95
103@cindex environment variables in file names 96@cindex environment variables in file names
104@cindex expansion of environment variables 97@cindex expansion of environment variables
@@ -113,10 +106,8 @@ the @samp{$}; alternatively, it can be enclosed in braces after the
113@file{/u/$@{FOO@}/test.c} are abbreviations for 106@file{/u/$@{FOO@}/test.c} are abbreviations for
114@file{/u/rms/hacks/test.c}. If the environment variable is not 107@file{/u/rms/hacks/test.c}. If the environment variable is not
115defined, no substitution occurs, so that the character @samp{$} stands 108defined, no substitution occurs, so that the character @samp{$} stands
116for itself. 109for itself. Note that environment variables affect Emacs only if they
117 110are applied before Emacs is started.
118 Note that environment variables affect Emacs only if they are
119applied before Emacs is started.
120 111
121 To access a file with @samp{$} in its name, if the @samp{$} causes 112 To access a file with @samp{$} in its name, if the @samp{$} causes
122expansion, type @samp{$$}. This pair is converted to a single 113expansion, type @samp{$$}. This pair is converted to a single
@@ -125,8 +116,7 @@ a single @samp{$}. Alternatively, quote the whole file name with
125@samp{/:} (@pxref{Quoted File Names}). File names which begin with a 116@samp{/:} (@pxref{Quoted File Names}). File names which begin with a
126literal @samp{~} should also be quoted with @samp{/:}. 117literal @samp{~} should also be quoted with @samp{/:}.
127 118
128 You can include non-@acronym{ASCII} characters in file names if you set the 119 You can include non-@acronym{ASCII} characters in file names.
129variable @code{file-name-coding-system} to a non-@code{nil} value.
130@xref{File Name Coding}. 120@xref{File Name Coding}.
131 121
132@node Visiting 122@node Visiting
@@ -159,48 +149,43 @@ Visit a file with no conversion of the contents.
159buffer so you can edit them. Emacs makes a new buffer for each file 149buffer so you can edit them. Emacs makes a new buffer for each file
160that you visit. 150that you visit.
161 151
162 Emacs normally constructs the buffer name from the file name, 152@kindex C-x C-f
163omitting the directory name. For example, a file named 153@findex find-file
164@file{/usr/rms/emacs.tex} is visited in a buffer named 154 To visit a file, type @kbd{C-x C-f} (@code{find-file}) and use the
165@samp{emacs.tex}. If there is already a buffer with that name, Emacs 155minibuffer to enter the name of the desired file (@pxref{File Names}).
166constructs a unique name; the normal method is to append @samp{<2>}, 156While in the minibuffer, you can abort the command by typing
167@samp{<3>}, and so on, but you can select other methods. 157@kbd{C-g}.
158
159 If the specified file exists but the system does not allow you to
160read it, an error message is displayed in the echo area. Otherwise,
161you can tell that @kbd{C-x C-f} has completed successfully by the
162appearance of new text on the screen, and by the buffer name shown in
163the mode line (@pxref{Mode Line}). Emacs normally constructs the
164buffer name from the file name, omitting the directory name. For
165example, a file named @file{/usr/rms/emacs.tex} is visited in a buffer
166named @samp{emacs.tex}. If there is already a buffer with that name,
167Emacs constructs a unique name; the normal method is to append
168@samp{<2>}, @samp{<3>}, and so on, but you can select other methods.
168@xref{Uniquify}. 169@xref{Uniquify}.
169 170
170 Each window's mode line shows the name of the buffer that is being 171@cindex creating files
171displayed in that window, so you can always tell what buffer you are 172 To create a new file, just visit it using the same command, @kbd{C-x
172editing. @pxref{Mode Line}. 173C-f}. Emacs displays @samp{(New file)} in the echo area, but in other
173 174respects behaves as if you had visited an existing empty file.
174 The changes you make with editing commands are made in the Emacs
175buffer. They do not take effect in the file that you visited, or any
176permanent place, until you @dfn{save} the buffer (@pxref{Saving}).
177 175
178@cindex modified (buffer) 176@cindex modified (buffer)
179 If a buffer contains changes that have not been saved, we say the 177 After visiting a file, the changes you make with editing commands are
180buffer is @dfn{modified}. This implies that some changes will be lost 178made in the Emacs buffer. They do not take effect in the visited
181if the buffer is not saved. The mode line displays two stars near the 179file, until you @dfn{save} the buffer (@pxref{Saving}). If a buffer
182left margin to indicate that the buffer is modified. 180contains changes that have not been saved, we say the buffer is
183 181@dfn{modified}. This implies that some changes will be lost if the
184@kindex C-x C-f 182buffer is not saved. The mode line displays two stars near the left
185@findex find-file 183margin to indicate that the buffer is modified.
186 To visit a file, type @kbd{C-x C-f} (@code{find-file}) and use the 184
187minibuffer to enter the name of the desired file. The usual 185 If you visit a file that is already in Emacs, @kbd{C-x C-f} switches
188defaulting and completion behavior is available in this minibuffer 186to the existing buffer instead of making another copy. Before doing
189(@pxref{Minibuffer File}). Note, also, that completion ignores 187so, it checks whether the file has changed since you last visited or
190certain file names (@pxref{Completion Options}). While in the 188saved it. If the file has changed, Emacs offers to reread it.
191minibuffer, you can abort @kbd{C-x C-f} by typing @kbd{C-g}.
192
193 Your can tell that @kbd{C-x C-f} has completed successfully by the
194appearance of new text on the screen and a new buffer name in the mode
195line. If the specified file does not exist and you could not create
196it, or exists but you can't read it, an error message is displayed in
197the echo area.
198
199 If you visit a file that is already in Emacs, @kbd{C-x C-f} does not make
200another copy. It selects the existing buffer containing that file.
201However, before doing so, it checks whether the file itself has changed
202since you visited or saved it last. If the file has changed, Emacs offers
203to reread it.
204 189
205@vindex large-file-warning-threshold 190@vindex large-file-warning-threshold
206@cindex file, warning when size is large 191@cindex file, warning when size is large
@@ -211,10 +196,10 @@ to reread it.
211about 10 megabytes), Emacs asks you for confirmation first. You can 196about 10 megabytes), Emacs asks you for confirmation first. You can
212answer @kbd{y} to proceed with visiting the file. Note, however, that 197answer @kbd{y} to proceed with visiting the file. Note, however, that
213Emacs cannot visit files that are larger than the maximum Emacs buffer 198Emacs cannot visit files that are larger than the maximum Emacs buffer
214size, which is limited by the amount of memory Emacs can allocate 199size, which is limited by the amount of memory Emacs can allocate and
215and by the integers that Emacs can represent 200by the integers that Emacs can represent (@pxref{Buffers}). If you
216(@pxref{Buffers}). If you try, Emacs will display an error message 201try, Emacs displays an error message saying that the maximum buffer
217saying that the maximum buffer size has been exceeded. 202size has been exceeded.
218 203
219@cindex wildcard characters in file names 204@cindex wildcard characters in file names
220@vindex find-file-wildcards 205@vindex find-file-wildcards
@@ -228,28 +213,6 @@ File Names}, for information on how to visit a file whose name
228actually contains wildcard characters. You can disable the wildcard 213actually contains wildcard characters. You can disable the wildcard
229feature by customizing @code{find-file-wildcards}. 214feature by customizing @code{find-file-wildcards}.
230 215
231@cindex file selection dialog
232 On graphical displays, there are two additional methods for visiting
233files. Firstly, when Emacs is built with a suitable GUI toolkit,
234commands invoked with the mouse (by clicking on the menu bar or tool
235bar) use the toolkit's standard ``File Selection'' dialog instead of
236prompting for the file name in the minibuffer. On GNU/Linux and Unix
237platforms, Emacs does this when built with GTK, LessTif, and Motif
238toolkits; on MS-Windows and Mac, the GUI version does that by default.
239For information on how to customize this, see @ref{Dialog Boxes}.
240
241 Secondly, Emacs supports ``drag and drop'': dropping a file into an
242ordinary Emacs window visits the file using that window. As an
243exception, dropping a file into a window displaying a Dired buffer
244moves or copies the file into the displayed directory. For details,
245see @ref{Drag and Drop}, and @ref{Misc Dired Features}.
246
247@cindex creating files
248 What if you want to create a new file? Just visit it. Emacs
249displays @samp{(New file)} in the echo area, but in other respects
250behaves as if you had visited an existing empty file. If you make
251changes and save them, the file is created.
252
253@cindex minibuffer confirmation 216@cindex minibuffer confirmation
254@cindex confirming in the minibuffer 217@cindex confirming in the minibuffer
255@vindex confirm-nonexistent-file-or-buffer 218@vindex confirm-nonexistent-file-or-buffer
@@ -271,20 +234,19 @@ about completion.
271 234
272@kindex C-x C-v 235@kindex C-x C-v
273@findex find-alternate-file 236@findex find-alternate-file
274 If you visit a nonexistent file unintentionally (because you typed 237 If you visit the wrong file unintentionally by typing its name
275the wrong file name), type @kbd{C-x C-v} (@code{find-alternate-file}) 238incorrectly, type @kbd{C-x C-v} (@code{find-alternate-file}) to visit
276to visit the file you really wanted. @kbd{C-x C-v} is similar to 239the file you really wanted. @kbd{C-x C-v} is similar to @kbd{C-x
277@kbd{C-x C-f}, but it kills the current buffer (after first offering 240C-f}, but it kills the current buffer (after first offering to save it
278to save it if it is modified). When @kbd{C-x C-v} reads the file name 241if it is modified). When @kbd{C-x C-v} reads the file name to visit,
279to visit, it inserts the entire default file name in the buffer, with 242it inserts the entire default file name in the buffer, with point just
280point just after the directory part; this is convenient if you made a 243after the directory part; this is convenient if you made a slight
281slight error in typing the name. 244error in typing the name.
282 245
283@vindex find-file-run-dired 246@vindex find-file-run-dired
284 If you ``visit'' a file that is actually a directory, Emacs invokes 247 If you ``visit'' a file that is actually a directory, Emacs invokes
285Dired, the Emacs directory browser; this lets you ``edit'' the 248Dired, the Emacs directory browser. @xref{Dired}. You can disable
286contents of the directory. @xref{Dired}. You can disable this 249this behavior by setting the variable @code{find-file-run-dired} to
287behavior by setting the variable @code{find-file-run-dired} to
288@code{nil}; in that case, it is an error to try to visit a directory. 250@code{nil}; in that case, it is an error to try to visit a directory.
289 251
290 Files which are actually collections of other files, or @dfn{file 252 Files which are actually collections of other files, or @dfn{file
@@ -321,17 +283,28 @@ new frame, or makes visible any existing frame showing the file you
321seek. This feature is available only when you are using a window 283seek. This feature is available only when you are using a window
322system. @xref{Frames}. 284system. @xref{Frames}.
323 285
324 Emacs recognizes from the contents of a file which end-of-line 286@cindex file selection dialog
325convention it uses to separate lines---newline (used on GNU/Linux and 287 On graphical displays, there are two additional methods for visiting
326on Unix), carriage-return linefeed (used on Microsoft systems), or 288files. Firstly, when Emacs is built with a suitable GUI toolkit,
327just carriage-return (used on the Macintosh)---and automatically 289commands invoked with the mouse (by clicking on the menu bar or tool
328converts the contents to the normal Emacs convention, which is that 290bar) use the toolkit's standard ``File Selection'' dialog instead of
329the newline character separates lines. This is a part of the general 291prompting for the file name in the minibuffer. On GNU/Linux and Unix
330feature of coding system conversion (@pxref{Coding Systems}), and 292platforms, Emacs does this when built with GTK, LessTif, and Motif
331makes it possible to edit files imported from different operating 293toolkits; on MS-Windows and Mac, the GUI version does that by default.
332systems with equal convenience. If you change the text and save the 294For information on how to customize this, see @ref{Dialog Boxes}.
333file, Emacs performs the inverse conversion, changing newlines back 295
334into carriage-return linefeed or just carriage-return if appropriate. 296 Secondly, Emacs supports ``drag and drop'': dropping a file into an
297ordinary Emacs window visits the file using that window. As an
298exception, dropping a file into a window displaying a Dired buffer
299moves or copies the file into the displayed directory. For details,
300see @ref{Drag and Drop}, and @ref{Misc Dired Features}.
301
302 Each time you visit a file, Emacs automatically scans its contents
303to detect what character encoding and end-of-line convention it uses,
304and converts these to Emacs' internal encoding and end-of-line
305convention within the buffer. When you save the buffer, Emacs
306performs the inverse conversion, writing the file to disk with its
307original encoding and end-of-line convention. @xref{Coding Systems}.
335 308
336@findex find-file-literally 309@findex find-file-literally
337 If you wish to edit a file as a sequence of @acronym{ASCII} 310 If you wish to edit a file as a sequence of @acronym{ASCII}
@@ -346,17 +319,17 @@ command asks you whether to visit it literally instead.
346 319
347@vindex find-file-hook 320@vindex find-file-hook
348@vindex find-file-not-found-functions 321@vindex find-file-not-found-functions
349 Two special hook variables allow extensions to modify the operation of 322 Two special hook variables allow extensions to modify the operation
350visiting files. Visiting a file that does not exist runs the functions 323of visiting files. Visiting a file that does not exist runs the
351in the list @code{find-file-not-found-functions}; this variable holds a list 324functions in @code{find-file-not-found-functions}; this variable holds
352of functions, and the functions are called one by one (with no 325a list of functions, which are called one by one (with no arguments)
353arguments) until one of them returns non-@code{nil}. This is not a 326until one of them returns non-@code{nil}. This is not a normal hook,
354normal hook, and the name ends in @samp{-functions} rather than @samp{-hook} 327and the name ends in @samp{-functions} rather than @samp{-hook} to
355to indicate that fact. 328indicate that fact.
356 329
357 Successful visiting of any file, whether existing or not, calls the 330 Successful visiting of any file, whether existing or not, calls the
358functions in the list @code{find-file-hook}, with no arguments. 331functions in @code{find-file-hook}, with no arguments. This variable
359This variable is a normal hook. In the case of a nonexistent file, the 332is a normal hook. In the case of a nonexistent file, the
360@code{find-file-not-found-functions} are run first. @xref{Hooks}. 333@code{find-file-not-found-functions} are run first. @xref{Hooks}.
361 334
362 There are several ways to specify automatically the major mode for 335 There are several ways to specify automatically the major mode for
@@ -386,9 +359,9 @@ that was visited in the buffer.
386 359
387@table @kbd 360@table @kbd
388@item C-x C-s 361@item C-x C-s
389Save the current buffer in its visited file on disk (@code{save-buffer}). 362Save the current buffer to its file (@code{save-buffer}).
390@item C-x s 363@item C-x s
391Save any or all buffers in their visited files (@code{save-some-buffers}). 364Save any or all buffers to their files (@code{save-some-buffers}).
392@item M-~ 365@item M-~
393Forget that the current buffer has been changed (@code{not-modified}). 366Forget that the current buffer has been changed (@code{not-modified}).
394With prefix argument (@kbd{C-u}), mark the current buffer as changed. 367With prefix argument (@kbd{C-u}), mark the current buffer as changed.
@@ -597,8 +570,8 @@ Never make numbered backups; always make single backups.
597@end table 570@end table
598 571
599@noindent 572@noindent
600The usual way to set this variable is globally, through your 573The usual way to set this variable is globally, through your init file
601@file{.emacs} file or the customization buffer. However, you can set 574or the customization buffer. However, you can set
602@code{version-control} locally in an individual buffer to control the 575@code{version-control} locally in an individual buffer to control the
603making of backups for that buffer's file (@pxref{Locals}). You can 576making of backups for that buffer's file (@pxref{Locals}). You can
604have Emacs set @code{version-control} locally whenever you visit a 577have Emacs set @code{version-control} locally whenever you visit a
@@ -679,34 +652,38 @@ and group. If copying is used, these do not change. If renaming is used,
679you become the file's owner, and the file's group becomes the default 652you become the file's owner, and the file's group becomes the default
680(different operating systems have different defaults for the group). 653(different operating systems have different defaults for the group).
681 654
682 Having the owner change is usually a good idea, because then the owner
683always shows who last edited the file. Also, the owners of the backups
684show who produced those versions. Occasionally there is a file whose
685owner should not change; it is a good idea for such files to contain
686local variable lists to set @code{backup-by-copying-when-mismatch}
687locally (@pxref{File Variables}).
688
689@vindex backup-by-copying 655@vindex backup-by-copying
690@vindex backup-by-copying-when-linked 656@vindex backup-by-copying-when-linked
691@vindex backup-by-copying-when-mismatch 657@vindex backup-by-copying-when-mismatch
692@vindex backup-by-copying-when-privileged-mismatch 658@vindex backup-by-copying-when-privileged-mismatch
693@cindex file ownership, and backup 659@cindex file ownership, and backup
694@cindex backup, and user-id 660@cindex backup, and user-id
695 The choice of renaming or copying is controlled by four variables. 661 The choice of renaming or copying is made as follows:
696Renaming is the default choice. If the variable 662
697@code{backup-by-copying} is non-@code{nil}, copying is used. Otherwise, 663@itemize
698if the variable @code{backup-by-copying-when-linked} is non-@code{nil}, 664@item
699then copying is used for files that have multiple names, but renaming 665If the variable @code{backup-by-copying} is non-@code{nil} (the
700may still be used when the file being edited has only one name. If the 666default is @code{nil}), use copying.
701variable @code{backup-by-copying-when-mismatch} is non-@code{nil}, then 667
702copying is used if renaming would cause the file's owner or group to 668@item
703change. @code{backup-by-copying-when-mismatch} is @code{t} by default 669Otherwise, if the variable @code{backup-by-copying-when-linked} is
704if you start Emacs as the superuser. The fourth variable, 670non-@code{nil} (the default is @code{nil}), and the file has multiple
705@code{backup-by-copying-when-privileged-mismatch}, gives the highest 671names, use copying.
706numeric user-id for which @code{backup-by-copying-when-mismatch} will be 672
707forced on. This is useful when low-numbered user-ids are assigned to 673@item
708special system users, such as @code{root}, @code{bin}, @code{daemon}, 674Otherwise, if the variable @code{backup-by-copying-when-mismatch} is
709etc., which must maintain ownership of files. 675non-@code{nil} (the default is @code{t}), and renaming would change
676the file's owner or group, use copying.
677
678If you change @code{backup-by-copying-when-mismatch} to @code{nil},
679Emacs checks the numeric user-id of the file's owner. If this is
680higher than @code{backup-by-copying-when-privileged-mismatch}, then it
681behaves as though @code{backup-by-copying-when-mismatch} is
682non-@code{nil} anyway.
683
684@item
685Otherwise, renaming is the default choice.
686@end itemize
710 687
711 When a file is managed with a version control system (@pxref{Version 688 When a file is managed with a version control system (@pxref{Version
712Control}), Emacs does not normally make backups in the usual way for 689Control}), Emacs does not normally make backups in the usual way for
@@ -725,28 +702,28 @@ Emacs---the version control system does it.
725if there isn't already one there. If the value is @code{visit}, Emacs 702if there isn't already one there. If the value is @code{visit}, Emacs
726adds a newline at the end of any file that doesn't have one, just 703adds a newline at the end of any file that doesn't have one, just
727after it visits the file. (This marks the buffer as modified, and you 704after it visits the file. (This marks the buffer as modified, and you
728can undo it.) If the value is @code{visit-save}, that means to add 705can undo it.) If the value is @code{visit-save}, Emacs adds such
729newlines both on visiting and on saving. If the value is @code{nil}, 706newlines both on visiting and on saving. If the value is @code{nil},
730Emacs leaves the end of the file unchanged; if it's neither @code{nil} 707Emacs leaves the end of the file unchanged; any other non-@code{nil}
731nor @code{t}, Emacs asks you whether to add a newline. The default is 708value means to asks you whether to add a newline. The default is
732@code{nil}. 709@code{nil}.
733 710
734@vindex mode-require-final-newline 711@vindex mode-require-final-newline
735 Many major modes are designed for specific kinds of files that are 712 Some major modes are designed for specific kinds of files that are
736always supposed to end in newlines. These major modes set the 713always supposed to end in newlines. Such major modes set the variable
737variable @code{require-final-newline} according to 714@code{require-final-newline} to the value of
738@code{mode-require-final-newline}. By setting the latter variable, 715@code{mode-require-final-newline}, which defaults to @code{t}. By
739you can control how these modes handle final newlines. 716setting the latter variable, you can control how these modes handle
717final newlines.
740 718
741@vindex write-region-inhibit-fsync 719@vindex write-region-inhibit-fsync
742 When Emacs saves a file, it invokes the @code{fsync} system call to 720 When Emacs saves a file, it invokes the @code{fsync} system call to
743force the data immediately out to disk. This is important for safety 721force the data immediately out to disk. This is important for safety
744if the system crashes or in case of power outage. However, it can be 722if the system crashes or in case of power outage. However, it can be
745disruptive on laptops using power saving, because it requires the disk 723disruptive on laptops using power saving, as it may force a disk
746to spin up each time you save a file. Setting 724spin-up each time you save a file. If you accept an increased risk of
747@code{write-region-inhibit-fsync} to a non-@code{nil} value disables 725data loss, you can set @code{write-region-inhibit-fsync} to a
748this synchronization. Be careful---this means increased risk of data 726non-@code{nil} value to disable the synchronization.
749loss.
750 727
751@node Interlocking 728@node Interlocking
752@subsection Protection against Simultaneous Editing 729@subsection Protection against Simultaneous Editing
@@ -754,9 +731,9 @@ loss.
754@cindex file dates 731@cindex file dates
755@cindex simultaneous editing 732@cindex simultaneous editing
756 Simultaneous editing occurs when two users visit the same file, both 733 Simultaneous editing occurs when two users visit the same file, both
757make changes, and then both save them. If nobody were informed that 734make changes, and then both save them. If nobody is informed that
758this was happening, whichever user saved first would later find that his 735this is happening, whichever user saves first would later find that
759changes were lost. 736his changes were lost.
760 737
761 On some systems, Emacs notices immediately when the second user starts 738 On some systems, Emacs notices immediately when the second user starts
762to change the file, and issues an immediate warning. On all systems, 739to change the file, and issues an immediate warning. On all systems,
@@ -794,38 +771,28 @@ contents remain unchanged---the modification you were trying to make
794does not actually take place. 771does not actually take place.
795@end table 772@end table
796 773
797 Note that locking works on the basis of a file name; if a file has
798multiple names, Emacs does not realize that the two names are the same file
799and cannot prevent two users from editing it simultaneously under different
800names. However, basing locking on names means that Emacs can interlock the
801editing of new files that will not really exist until they are saved.
802
803 Some systems are not configured to allow Emacs to make locks, and
804there are cases where lock files cannot be written. In these cases,
805Emacs cannot detect trouble in advance, but it still can detect the
806collision when you try to save a file and overwrite someone else's
807changes. Every time Emacs saves a buffer, it first checks the
808last-modification date of the existing file on disk to verify that it
809has not changed since the file was last visited or saved. If the date
810does not match, it implies that changes were made in the file in some
811other way, and these changes are about to be lost if Emacs actually
812does save. To prevent this, Emacs displays a warning message and asks
813for confirmation before saving. Occasionally you will know why the
814file was changed and know that it does not matter; then you can answer
815@kbd{yes} and proceed. Otherwise, you should cancel the save with
816@kbd{C-g} and investigate the situation.
817
818 If Emacs or the operating system crashes, this may leave behind lock 774 If Emacs or the operating system crashes, this may leave behind lock
819files which are stale, so you may occasionally get warnings about 775files which are stale, so you may occasionally get warnings about
820spurious collisions. When you determine that the collision is spurious, 776spurious collisions. When you determine that the collision is
821just use @kbd{p} to tell Emacs to go ahead anyway. 777spurious, just use @kbd{p} to tell Emacs to go ahead anyway.
822 778
823 The first thing you should do when notified that simultaneous editing 779 Note that locking works on the basis of a file name; if a file has
824has already taken place is to list the directory with @kbd{C-u C-x C-d} 780multiple names, Emacs does not prevent two users from editing it
825(@pxref{Directories}). This shows the file's current author. You 781simultaneously under different names.
826should attempt to contact him to warn him not to continue editing. 782
827Often the next step is to save the contents of your Emacs buffer under a 783 A lock file cannot be written in some circumstances, e.g. if Emacs
828different name, and use @code{diff} to compare the two files.@refill 784lacks the system permissions or the system does not support symbolic
785links. In these cases, Emacs can still detect the collision when you
786try to save a file, by checking the file's last-modification date. If
787the file has changed since the last time Emacs visited or saved it,
788that implies that changes have been made in some other way, and will
789be lost if Emacs proceeds with saving. Emacs then displays a warning
790message and asks for confirmation before saving; answer @kbd{yes} to
791save, and @kbd{no} or @kbd{C-g} cancel the save.
792
793 If you are notified that simultaneous editing has already taken
794place, one way to compare the buffer to its file is the @kbd{M-x
795diff-buffer-with-file} command. @xref{Comparing Files}.
829 796
830@node File Shadowing 797@node File Shadowing
831@subsection Shadowing Files 798@subsection Shadowing Files
@@ -881,10 +848,10 @@ shadow-define-cluster}.
881@cindex modification dates 848@cindex modification dates
882@cindex locale, date format 849@cindex locale, date format
883 850
884You can arrange to put a time stamp in a file, so that it will be updated 851You can arrange to put a time stamp in a file, so that it is updated
885automatically each time you edit and save the file. The time stamp 852automatically each time you edit and save the file. The time stamp
886has to be in the first eight lines of the file, and you should 853must be in the first eight lines of the file, and you should insert it
887insert it like this: 854like this:
888 855
889@example 856@example
890Time-stamp: <> 857Time-stamp: <>
@@ -898,13 +865,13 @@ Time-stamp: " "
898@end example 865@end example
899 866
900@findex time-stamp 867@findex time-stamp
901 Then add the hook function @code{time-stamp} to the hook 868 Then add the function @code{time-stamp} to the hook
902@code{before-save-hook}; that hook function will automatically update 869@code{before-save-hook} (@pxref{Hooks}). When you save the file, this
903the time stamp, inserting the current date and time when you save the 870function then automatically updates the time stamp with the current
904file. You can also use the command @kbd{M-x time-stamp} to update the 871date and time. You can also use the command @kbd{M-x time-stamp} to
905time stamp manually. For other customizations, see the Custom group 872update the time stamp manually. For other customizations, see the
906@code{time-stamp}. Note that non-numeric fields in the time stamp are 873Custom group @code{time-stamp}. Note that the time stamp is formatted
907formatted according to your locale setting (@pxref{Environment}). 874according to your locale setting (@pxref{Environment}).
908 875
909@node Reverting 876@node Reverting
910@section Reverting a Buffer 877@section Reverting a Buffer
@@ -912,18 +879,21 @@ formatted according to your locale setting (@pxref{Environment}).
912@cindex drastic changes 879@cindex drastic changes
913@cindex reread a file 880@cindex reread a file
914 881
915 If you have made extensive changes to a file and then change your mind 882 If you have made extensive changes to a file-visiting buffer and
916about them, you can get rid of them by reading in the previous version 883then change your mind, you can @dfn{revert} the changes and go back to
917of the file. To do this, use @kbd{M-x revert-buffer}, which operates on 884the saved version of the file. To do this, type @kbd{M-x
918the current buffer. Since reverting a buffer unintentionally could lose 885revert-buffer}. Since reverting unintentionally could lose a lot of
919a lot of work, you must confirm this command with @kbd{yes}. 886work, Emacs asks for confirmation first.
920 887
921 @code{revert-buffer} tries to position point in such a way that, if 888 The @code{revert-buffer} command tries to position point in such a
922the file was edited only slightly, you will be at approximately the 889way that, if the file was edited only slightly, you will be at
923same piece of text after reverting as before. However, if you have made 890approximately the same part of the text as before. But if you have
924drastic changes, point may wind up in a totally different piece of text. 891made major changes, point may end up in a totally different location.
925 892
926 Reverting marks the buffer as ``not modified''. 893 Reverting marks the buffer as ``not modified''. It also clears the
894buffer's undo history (@pxref{Undo}). Thus, the reversion cannot be
895undone---if you change your mind yet again, you can't use the undo
896commands to bring the reverted changes back.
927 897
928 Some kinds of buffers that are not associated with files, such as 898 Some kinds of buffers that are not associated with files, such as
929Dired buffers, can also be reverted. For them, reverting means 899Dired buffers, can also be reverted. For them, reverting means
@@ -950,15 +920,14 @@ discard your changes.)
950@findex auto-revert-mode 920@findex auto-revert-mode
951@findex auto-revert-tail-mode 921@findex auto-revert-tail-mode
952@vindex auto-revert-interval 922@vindex auto-revert-interval
953 923 You can also tell Emacs to revert buffers periodically. To do this
954 In addition, you can tell Emacs to periodically revert a buffer by 924for a specific buffer, enable the minor mode Auto-Revert mode by
955typing @kbd{M-x auto-revert-mode}. This turns on Auto-Revert mode, a 925typing @kbd{M-x auto-revert-mode}. This automatically reverts the
956minor mode that makes Emacs automatically revert the current buffer 926current buffer every five seconds; you can change the interval through
957every five seconds. You can change this interval through the variable 927the variable @code{auto-revert-interval}. To do the same for all file
958@code{auto-revert-interval}. Typing @kbd{M-x global-auto-revert-mode} 928buffers, type @kbd{M-x global-auto-revert-mode} to enable Global
959enables Global Auto-Revert mode, which does the same for all file 929Auto-Revert mode. These minor modes do not check or revert remote
960buffers. Auto-Revert mode and Global Auto-Revert modes do not check 930files, because that is usually too slow.
961or revert remote files, because that is usually too slow.
962 931
963 One use of Auto-Revert mode is to ``tail'' a file such as a system 932 One use of Auto-Revert mode is to ``tail'' a file such as a system
964log, so that changes made to that file by other programs are 933log, so that changes made to that file by other programs are
@@ -969,8 +938,9 @@ the end, use Auto-Revert Tail mode instead
969(@code{auto-revert-tail-mode}). It is more efficient for this. 938(@code{auto-revert-tail-mode}). It is more efficient for this.
970Auto-Revert Tail mode works also for remote files. 939Auto-Revert Tail mode works also for remote files.
971 940
972 @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that 941 @xref{VC Undo}, for commands to revert to earlier versions of files
973visit files under version control. 942under version control. @xref{VC Mode Line}, for Auto Revert
943peculiarities when visiting files under version control.
974 944
975@ifnottex 945@ifnottex
976@include arevert-xtra.texi 946@include arevert-xtra.texi
@@ -1061,40 +1031,41 @@ any auto-save file to go with the new visited name.
1061@vindex auto-save-default 1031@vindex auto-save-default
1062@findex auto-save-mode 1032@findex auto-save-mode
1063 Each time you visit a file, auto-saving is turned on for that file's 1033 Each time you visit a file, auto-saving is turned on for that file's
1064buffer if the variable @code{auto-save-default} is non-@code{nil} (but not 1034buffer if the variable @code{auto-save-default} is non-@code{nil} (but
1065in batch mode; @pxref{Entering Emacs}). The default for this variable is 1035not in batch mode; @pxref{Initial Options}). The default for this
1066@code{t}, so auto-saving is the usual practice for file-visiting buffers. 1036variable is @code{t}, so auto-saving is the usual practice for
1067Auto-saving can be turned on or off for any existing buffer with the 1037file-visiting buffers. To toggle auto-saving in the current buffer,
1068command @kbd{M-x auto-save-mode}. Like other minor mode commands, @kbd{M-x 1038type @kbd{M-x auto-save-mode}. Auto Save mode acts as a buffer-local
1069auto-save-mode} turns auto-saving on with a positive argument, off with a 1039minor mode (@pxref{Minor Modes}).
1070zero or negative argument; with no argument, it toggles.
1071 1040
1072@vindex auto-save-interval 1041@vindex auto-save-interval
1073 Emacs does auto-saving periodically based on counting how many characters 1042 Emacs auto-saves periodically based on how many characters you have
1074you have typed since the last time auto-saving was done. The variable 1043typed since the last auto-save. The variable
1075@code{auto-save-interval} specifies how many characters there are between 1044@code{auto-save-interval} specifies how many characters there are
1076auto-saves. By default, it is 300. Emacs doesn't accept values that are 1045between auto-saves. By default, it is 300. Emacs doesn't accept
1077too small: if you customize @code{auto-save-interval} to a value less 1046values that are too small: if you customize @code{auto-save-interval}
1078than 20, Emacs will behave as if the value is 20. 1047to a value less than 20, Emacs will behave as if the value is 20.
1079 1048
1080@vindex auto-save-timeout 1049@vindex auto-save-timeout
1081 Auto-saving also takes place when you stop typing for a while. The 1050 Auto-saving also takes place when you stop typing for a while. By
1082variable @code{auto-save-timeout} says how many seconds Emacs should 1051default, it does this after 30 seconds of idleness (at this time,
1083wait before it does an auto save (and perhaps also a garbage 1052Emacs may also perform garbage collection; @pxref{Garbage
1084collection). (The actual time period is longer if the current buffer is 1053Collection,,, elisp, The Emacs Lisp Reference Manual}). To change
1085long; this is a heuristic which aims to keep out of your way when you 1054this interval, customize the variable @code{auto-save-timeout}. The
1086are editing long buffers, in which auto-save takes an appreciable amount 1055actual time period is longer if the current buffer is long; this is a
1087of time.) Auto-saving during idle periods accomplishes two things: 1056heuristic which aims to keep out of your way when you are editing long
1088first, it makes sure all your work is saved if you go away from the 1057buffers, in which auto-save takes an appreciable amount of time.
1089terminal for a while; second, it may avoid some auto-saving while you 1058Auto-saving during idle periods accomplishes two things: first, it
1090are actually typing. 1059makes sure all your work is saved if you go away from the terminal for
1060a while; second, it may avoid some auto-saving while you are actually
1061typing.
1091 1062
1092 Emacs also does auto-saving whenever it gets a fatal error. This 1063 Emacs also does auto-saving whenever it gets a fatal error. This
1093includes killing the Emacs job with a shell command such as @samp{kill 1064includes killing the Emacs job with a shell command such as @samp{kill
1094%emacs}, or disconnecting a phone line or network connection. 1065%emacs}, or disconnecting a phone line or network connection.
1095 1066
1096@findex do-auto-save 1067@findex do-auto-save
1097 You can request an auto-save explicitly with the command @kbd{M-x 1068 You can perform an auto-save explicitly with the command @kbd{M-x
1098do-auto-save}. 1069do-auto-save}.
1099 1070
1100@node Recover 1071@node Recover
@@ -1138,13 +1109,11 @@ this---saving them---updates the files themselves.
1138 1109
1139@vindex auto-save-list-file-prefix 1110@vindex auto-save-list-file-prefix
1140 Emacs records information about interrupted sessions for later 1111 Emacs records information about interrupted sessions for later
1141recovery in files named 1112recovery in files named @file{.saves-@var{pid}-@var{hostname}} in the
1142@file{~/.emacs.d/auto-save-list/.saves-@var{pid}-@var{hostname}}. The 1113directory @file{~/.emacs.d/auto-save-list/}. This directory is
1143directory used, @file{~/.emacs.d/auto-save-list/}, is determined by 1114determined by the variable @code{auto-save-list-file-prefix}. If you
1144the variable @code{auto-save-list-file-prefix}. You can record 1115set @code{auto-save-list-file-prefix} to @code{nil}, sessions are not
1145sessions in a different place by customizing that variable. If you 1116recorded for recovery.
1146set @code{auto-save-list-file-prefix} to @code{nil} in your
1147@file{.emacs} file, sessions are not recorded for recovery.
1148 1117
1149@node File Aliases 1118@node File Aliases
1150@section File Name Aliases 1119@section File Name Aliases
@@ -1292,8 +1261,8 @@ buffer named @samp{*diff*}. This works by running the @command{diff}
1292program, using options taken from the variable @code{diff-switches}. 1261program, using options taken from the variable @code{diff-switches}.
1293The value of @code{diff-switches} should be a string; the default is 1262The value of @code{diff-switches} should be a string; the default is
1294@code{"-c"} to specify a context diff. @xref{Top,, Diff, diff, 1263@code{"-c"} to specify a context diff. @xref{Top,, Diff, diff,
1295Comparing and Merging Files}, for more information about 1264Comparing and Merging Files}, for more information about the
1296@command{diff} output formats. 1265@command{diff} program.
1297 1266
1298 The output of the @code{diff} command is shown using a major mode 1267 The output of the @code{diff} command is shown using a major mode
1299called Diff mode. @xref{Diff Mode}. 1268called Diff mode. @xref{Diff Mode}.
@@ -1361,11 +1330,10 @@ merging files.
1361@cindex patches, editing 1330@cindex patches, editing
1362 1331
1363 Diff mode is a major mode used for the output of @kbd{M-x diff} and 1332 Diff mode is a major mode used for the output of @kbd{M-x diff} and
1364other similar commands, as well as the output of the @command{diff} 1333other similar commands. This kind of output is called a @dfn{patch},
1365program. This kind of output is called a @dfn{patch}, because it can 1334because it can be passed to the @command{patch} command to
1366be passed to the @command{patch} command to automatically apply the 1335automatically apply the specified changes. To select Diff mode
1367specified changes. To select Diff mode manually, type @kbd{M-x 1336manually, type @kbd{M-x diff-mode}.
1368diff-mode}.
1369 1337
1370@cindex hunk, diff 1338@cindex hunk, diff
1371 The changes specified in a patch are grouped into @dfn{hunks}, which 1339 The changes specified in a patch are grouped into @dfn{hunks}, which
@@ -1659,21 +1627,18 @@ Tar mode is used also for compressed archives---files with extensions
1659 The keys @kbd{e}, @kbd{f} and @key{RET} all extract a component file 1627 The keys @kbd{e}, @kbd{f} and @key{RET} all extract a component file
1660into its own buffer. You can edit it there, and if you save the 1628into its own buffer. You can edit it there, and if you save the
1661buffer, the edited version will replace the version in the Tar buffer. 1629buffer, the edited version will replace the version in the Tar buffer.
1662@kbd{v} extracts a file into a buffer in View mode (@pxref{View 1630Clicking with the mouse on the file name in the Tar buffer does
1663Mode}). @kbd{o} extracts the file and displays it in another window, 1631likewise. @kbd{v} extracts a file into a buffer in View mode
1664so you could edit the file and operate on the archive simultaneously. 1632(@pxref{View Mode}). @kbd{o} extracts the file and displays it in
1665@kbd{d} marks a file for deletion when you later use @kbd{x}, and 1633another window, so you could edit the file and operate on the archive
1634simultaneously.
1635
1636 @kbd{d} marks a file for deletion when you later use @kbd{x}, and
1666@kbd{u} unmarks a file, as in Dired. @kbd{C} copies a file from the 1637@kbd{u} unmarks a file, as in Dired. @kbd{C} copies a file from the
1667archive to disk and @kbd{R} renames a file within the archive. 1638archive to disk and @kbd{R} renames a file within the archive.
1668@kbd{g} reverts the buffer from the archive on disk. 1639@kbd{g} reverts the buffer from the archive on disk. The keys
1669 1640@kbd{M}, @kbd{G}, and @kbd{O} change the file's permission bits,
1670 The keys @kbd{M}, @kbd{G}, and @kbd{O} change the file's permission 1641group, and owner, respectively.
1671bits, group, and owner, respectively.
1672
1673 If your display supports colors and the mouse, moving the mouse
1674pointer across a file name highlights that file name, indicating that
1675you can click on it. Clicking @kbd{Mouse-2} on the highlighted file
1676name extracts the file into a buffer and displays that buffer.
1677 1642
1678 Saving the Tar buffer writes a new version of the archive to disk with 1643 Saving the Tar buffer writes a new version of the archive to disk with
1679the changes you made to the components. 1644the changes you made to the components.
@@ -1690,19 +1655,20 @@ requires the appropriate uncompression program.
1690@cindex @code{zip} 1655@cindex @code{zip}
1691@cindex @code{lzh} 1656@cindex @code{lzh}
1692@cindex @code{zoo} 1657@cindex @code{zoo}
1658@cindex @code{7z}
1693@pindex arc 1659@pindex arc
1694@pindex jar 1660@pindex jar
1695@pindex zip 1661@pindex zip
1696@pindex rar 1662@pindex rar
1697@pindex lzh 1663@pindex lzh
1698@pindex zoo 1664@pindex zoo
1665@pindex 7z
1699@cindex Java class archives 1666@cindex Java class archives
1700@cindex unzip archives 1667@cindex unzip archives
1701 A separate but similar Archive mode is used for archives produced by 1668 A separate but similar Archive mode is used for @code{arc},
1702the programs @code{arc}, @code{jar}, @code{lzh}, @code{zip}, 1669@code{jar}, @code{lzh}, @code{zip}, @code{rar}, @code{7z}, and
1703@code{rar}, and @code{zoo}, which have extensions corresponding to the 1670@code{zoo} archives, as well as @code{exe} files that are
1704program names. Archive mode also works for those @code{exe} files 1671self-extracting executables.
1705that are self-extracting executables.
1706 1672
1707 The key bindings of Archive mode are similar to those in Tar mode, 1673 The key bindings of Archive mode are similar to those in Tar mode,
1708with the addition of the @kbd{m} key which marks a file for subsequent 1674with the addition of the @kbd{m} key which marks a file for subsequent
@@ -1712,11 +1678,11 @@ information, for those archive types where it won't fit in a single
1712line. Operations such as renaming a subfile, or changing its mode or 1678line. Operations such as renaming a subfile, or changing its mode or
1713owner, are supported only for some of the archive formats. 1679owner, are supported only for some of the archive formats.
1714 1680
1715 Unlike Tar mode, Archive mode runs the archiving program to unpack 1681 Unlike Tar mode, Archive mode runs the archiving programs to unpack
1716and repack archives. Details of the program names and their options 1682and repack archives. However, you don't need these programs to look
1717can be set in the @samp{Archive} Customize group. However, you don't 1683at the archive table of contents, only to extract or manipulate the
1718need these programs to look at the archive table of contents, only to 1684subfiles in the archive. Details of the program names and their
1719extract or manipulate the subfiles in the archive. 1685options can be set in the @samp{Archive} Customize group.
1720 1686
1721@node Remote Files 1687@node Remote Files
1722@section Remote Files 1688@section Remote Files
@@ -1748,16 +1714,14 @@ Emacs chooses the method as follows:
1748 1714
1749@enumerate 1715@enumerate
1750@item 1716@item
1751If the host name starts with @samp{ftp.} (with dot), then Emacs uses 1717If the host name starts with @samp{ftp.} (with dot), Emacs uses FTP.
1752FTP.
1753@item 1718@item
1754If the user name is @samp{ftp} or @samp{anonymous}, then Emacs uses 1719If the user name is @samp{ftp} or @samp{anonymous}, Emacs uses FTP.
1755FTP.
1756@item 1720@item
1757If the variable @code{tramp-default-method} is set to @samp{ftp}, 1721If the variable @code{tramp-default-method} is set to @samp{ftp},
1758then Emacs uses FTP. 1722Emacs uses FTP.
1759@item 1723@item
1760If @command{ssh-agent} is running, then Emacs uses @command{scp}. 1724If @command{ssh-agent} is running, Emacs uses @command{scp}.
1761@item 1725@item
1762Otherwise, Emacs uses @command{ssh}. 1726Otherwise, Emacs uses @command{ssh}.
1763@end enumerate 1727@end enumerate
@@ -1769,32 +1733,31 @@ variable @code{tramp-mode} to @code{nil}. You can turn off the
1769feature in individual cases by quoting the file name with @samp{/:} 1733feature in individual cases by quoting the file name with @samp{/:}
1770(@pxref{Quoted File Names}). 1734(@pxref{Quoted File Names}).
1771 1735
1736@cindex ange-ftp
1772 Remote file access through FTP is handled by the Ange-FTP package, which 1737 Remote file access through FTP is handled by the Ange-FTP package, which
1773is documented in the following. Remote file access through the other 1738is documented in the following. Remote file access through the other
1774methods is handled by the Tramp package, which has its own manual. 1739methods is handled by the Tramp package, which has its own manual.
1775@xref{Top, The Tramp Manual,, tramp, The Tramp Manual}. 1740@xref{Top, The Tramp Manual,, tramp, The Tramp Manual}.
1776 1741
1777When the Ange-FTP package is used, Emacs logs in through FTP using 1742@vindex ange-ftp-default-user
1778your user name or the name @var{user}. It may ask you for a password 1743@cindex user name for remote file access
1779from time to time (@pxref{Passwords}); this is used for logging in on 1744 When the Ange-FTP package is used, Emacs logs in through FTP using
1780@var{host}. The form using @var{port} allows you to access servers 1745the name @var{user}, if that is specified in the remote file name. If
1781running on a non-default TCP port. 1746@var{user} is unspecified, Emacs logs in using your user name on the
1747local system; but if you set the variable @code{ange-ftp-default-user}
1748to a string, that string is used instead. When logging in, Emacs may
1749also ask for a password.
1782 1750
1783@cindex backups for remote files 1751@cindex backups for remote files
1784@vindex ange-ftp-make-backup-files 1752@vindex ange-ftp-make-backup-files
1785 If you want to disable backups for remote files, set the variable 1753 For performance reasons, Emacs does not make backup files for files
1786@code{ange-ftp-make-backup-files} to @code{nil}. 1754accessed via FTP by default. To make it do so, change the variable
1755@code{ange-ftp-make-backup-files} to a non-@code{nil} value.
1787 1756
1788 By default, the auto-save files (@pxref{Auto Save Files}) for remote 1757 By default, auto-save files for remote files are made in the
1789files are made in the temporary file directory on the local machine. 1758temporary file directory on the local machine, as specified by the
1790This is achieved using the variable @code{auto-save-file-name-transforms}. 1759variable @code{auto-save-file-name-transforms}. @xref{Auto Save
1791 1760Files}.
1792@cindex ange-ftp
1793@vindex ange-ftp-default-user
1794@cindex user name for remote file access
1795 Normally, if you do not specify a user name in a remote file name,
1796that means to use your own user name. But if you set the variable
1797@code{ange-ftp-default-user} to a string, that string is used instead.
1798 1761
1799@cindex anonymous FTP 1762@cindex anonymous FTP
1800@vindex ange-ftp-generate-anonymous-password 1763@vindex ange-ftp-generate-anonymous-password
@@ -1950,10 +1913,10 @@ images as thumbnails.
1950@findex filesets-init 1913@findex filesets-init
1951 If you regularly edit a certain group of files, you can define them 1914 If you regularly edit a certain group of files, you can define them
1952as a @dfn{fileset}. This lets you perform certain operations, such as 1915as a @dfn{fileset}. This lets you perform certain operations, such as
1953visiting, @code{query-replace}, and shell commands on all the files 1916visiting, @code{query-replace}, and shell commands on all the files at
1954at once. To make use of filesets, you must first add the expression 1917once. To make use of filesets, you must first add the expression
1955@code{(filesets-init)} to your @file{.emacs} file (@pxref{Init File}). 1918@code{(filesets-init)} to your init file (@pxref{Init File}). This
1956This adds a @samp{Filesets} menu to the menu bar. 1919adds a @samp{Filesets} menu to the menu bar.
1957 1920
1958@findex filesets-add-buffer 1921@findex filesets-add-buffer
1959@findex filesets-remove-buffer 1922@findex filesets-remove-buffer
@@ -1980,7 +1943,7 @@ files in a fileset, and @kbd{M-x filesets-close} to close them. Use
1980a fileset. These commands are also available from the @samp{Filesets} 1943a fileset. These commands are also available from the @samp{Filesets}
1981menu, where each existing fileset is represented by a submenu. 1944menu, where each existing fileset is represented by a submenu.
1982 1945
1983 Emacs uses the concept of a fileset elsewhere @pxref{Version 1946 @xref{Version Control}, for a different concept of ``filesets'':
1984Control} to describe sets of files to be treated as a group for 1947groups of files bundled together for version control operations.
1985purposes of version control operations. Those filesets are unnamed 1948Filesets of that type are unnamed, and do not persist across Emacs
1986and do not persist across Emacs sessions. 1949sessions.
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index a85edf101e5..c024d428511 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -70,7 +70,7 @@ meanings for it, but they all support @key{F1} for help.)
70* Package Keywords:: Finding Lisp libraries by keywords (topics). 70* Package Keywords:: Finding Lisp libraries by keywords (topics).
71* Language Help:: Help relating to international language support. 71* Language Help:: Help relating to international language support.
72* Misc Help:: Other help commands. 72* Misc Help:: Other help commands.
73* Help Files:: Commands to display auxilliary help files. 73* Help Files:: Commands to display auxiliary help files.
74* Help Echo:: Help on active text and tooltips (`balloon help'). 74* Help Echo:: Help on active text and tooltips (`balloon help').
75@end menu 75@end menu
76 76
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 8689e9c8324..6237b00c2ee 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -736,7 +736,7 @@ insert rectangles, and commands to make blank rectangles.
736k} (@code{kill-rectangle}) to remove the text and and save it as the 736k} (@code{kill-rectangle}) to remove the text and and save it as the
737@dfn{last killed rectangle}. In both cases, erasing the 737@dfn{last killed rectangle}. In both cases, erasing the
738region-rectangle is like erasing the specified text on each line of 738region-rectangle is like erasing the specified text on each line of
739the rectange; if there is any following text on the line, it moves 739the rectangle; if there is any following text on the line, it moves
740backwards to fill the gap. 740backwards to fill the gap.
741 741
742 ``Killing'' a rectangle is not killing in the usual sense; the 742 ``Killing'' a rectangle is not killing in the usual sense; the
diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi
index 14d4c678085..fcc31e30988 100644
--- a/doc/emacs/screen.texi
+++ b/doc/emacs/screen.texi
@@ -189,7 +189,7 @@ is sometimes useful to have this information.
189 189
190 @var{cs} describes the character set of the text in the buffer 190 @var{cs} describes the character set of the text in the buffer
191(@pxref{Coding Systems}). If it is a dash (@samp{-}), that indicates 191(@pxref{Coding Systems}). If it is a dash (@samp{-}), that indicates
192no special character set handling (with the possible expection of 192no special character set handling (with the possible exception of
193end-of-line conventions, described in the next paragraph). @samp{=} 193end-of-line conventions, described in the next paragraph). @samp{=}
194means no conversion whatsoever, and is usually used for files 194means no conversion whatsoever, and is usually used for files
195containing non-textual data. Other characters represent various 195containing non-textual data. Other characters represent various
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 8e77de0bbb4..31b5aa37f83 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -371,7 +371,7 @@ wrap around, going from the last page to the first page or vice versa.
371When the current match is on a history element, that history element 371When the current match is on a history element, that history element
372is pulled into the minibuffer. If you exit the incremental search 372is pulled into the minibuffer. If you exit the incremental search
373normally (e.g. by typing @key{RET}), it remains in the minibuffer 373normally (e.g. by typing @key{RET}), it remains in the minibuffer
374afterwards. Cancelling the search, with @kbd{C-g}, restores the 374afterwards. Canceling the search, with @kbd{C-g}, restores the
375contents of the minibuffer when you began the search. 375contents of the minibuffer when you began the search.
376 376
377@node Nonincremental Search 377@node Nonincremental Search
diff --git a/etc/NEWS b/etc/NEWS
index b987e8548cf..7b970807fe2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -272,7 +272,7 @@ context in their return values.
272 272
273*** The new functions file-selinux-context and set-file-selinux-context 273*** The new functions file-selinux-context and set-file-selinux-context
274get and set the SELinux context of a file. 274get and set the SELinux context of a file.
275 275---
276*** Tramp offers handlers for file-selinux-context and set-file-selinux-context 276*** Tramp offers handlers for file-selinux-context and set-file-selinux-context
277for remote machines which support SELinux. 277for remote machines which support SELinux.
278 278
@@ -460,6 +460,7 @@ isearch-yank-kill.
460*** `count-lines-region' is now an alias for `count-words-region', 460*** `count-lines-region' is now an alias for `count-words-region',
461bound to M-=, which shows the number of lines, words, and characters. 461bound to M-=, which shows the number of lines, words, and characters.
462 462
463+++
463** The default value of `backup-by-copying-when-mismatch' is now t. 464** The default value of `backup-by-copying-when-mismatch' is now t.
464 465
465+++ 466+++
@@ -560,6 +561,7 @@ updates later on, and Emacs appears to be unable to keep up.
560 561
561* Changes in Specialized Modes and Packages in Emacs 24.1 562* Changes in Specialized Modes and Packages in Emacs 24.1
562 563
564+++
563** Archive Mode has basic support for browsing and updating 7z archives. 565** Archive Mode has basic support for browsing and updating 7z archives.
564 566
565** browse-url has a new variable `browse-url-mailto-function' 567** browse-url has a new variable `browse-url-mailto-function'
@@ -804,12 +806,12 @@ additional details about each column.
804*** latex-electric-env-pair-mode keeps \begin..\end matched on the fly. 806*** latex-electric-env-pair-mode keeps \begin..\end matched on the fly.
805 807
806** Tramp 808** Tramp
807 809---
808*** There exists a new inline access method "ksu" (kerberized su). 810*** There exists a new inline access method "ksu" (kerberized su).
809 811---
810*** The following access methods are discontinued: "ssh1_old", 812*** The following access methods are discontinued: "ssh1_old",
811"ssh2_old", "scp1_old", "scp2_old", "imap", "imaps" and "fish". 813"ssh2_old", "scp1_old", "scp2_old", "imap", "imaps" and "fish".
812 814---
813*** The option `ange-ftp-binary-file-name-regexp' has changed its 815*** The option `ange-ftp-binary-file-name-regexp' has changed its
814default value to "". 816default value to "".
815 817