]> code.delx.au - gnu-emacs/blobdiff - doc/emacs/files.texi
Remove some unimportant tabs from examples in some *.texi files.
[gnu-emacs] / doc / emacs / files.texi
index 4e49ecf17f3bea7668ef9faff0c74863ef70a89a..4701c1a7a898bd891da4de19dc48c8cd456aeaba 100644 (file)
@@ -1,6 +1,7 @@
 @c This is part of the Emacs manual.
 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
-@c   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+@c   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+@c   Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Files, Buffers, Keyboard Macros, Top
 @chapter File Handling
@@ -207,7 +208,7 @@ to reread it.
 about 10 megabytes), Emacs asks you for confirmation first.  You can
 answer @kbd{y} to proceed with visiting the file.  Note, however, that
 Emacs cannot visit files that are larger than the maximum Emacs buffer
-size, which is around 256 megabytes on 32-bit machines
+size, which is around 512 megabytes on 32-bit machines
 (@pxref{Buffers}).  If you try, Emacs will display an error message
 saying that the maximum buffer size has been exceeded.
 
@@ -240,14 +241,29 @@ moves or copies the file into the displayed directory.  For details,
 see @ref{Drag and Drop}, and @ref{Misc Dired Features}.
 
 @cindex creating files
-@vindex find-file-confirm-nonexistent-file
   What if you want to create a new file?  Just visit it.  Emacs
 displays @samp{(New file)} in the echo area, but in other respects
 behaves as if you had visited an existing empty file.  If you make
-changes and save them, the file is created.  If you change the
-variable @code{find-file-confirm-nonexistent-file} to @code{t}, then
-Emacs prompts you for confirmation before visiting a non-existent
-file.
+changes and save them, the file is created.
+
+@cindex minibuffer confirmation
+@cindex confirming in the minibuffer
+@vindex confirm-nonexistent-file-or-buffer
+  When @key{TAB} completion results in a nonexistent file name and you
+type @key{RET} immediately to visit it, Emacs asks for confirmation;
+this is because it's possible that you expected completion to go
+further and give you an existing file's name.  The string
+@samp{[Confirm]} appears for a short time after the file name to
+indicate the need to confirm in this way.  Type @key{RET} to confirm
+and visit the nonexistent file.  The variable
+@code{confirm-nonexistent-file-or-buffer} controls whether Emacs asks
+for confirmation before visiting a new file.  The default value,
+@code{after-completion}, gives the behavior we have just described.
+If the value is @code{nil}, Emacs never asks for confirmation; for any
+other non-@code{nil} value, Emacs always asks for confirmation.  This
+variable also affects the @code{switch-to-buffer} command
+(@pxref{Select Buffer}).  @xref{Completion}, for more information
+about completion.
 
 @kindex C-x C-v
 @findex find-alternate-file
@@ -262,7 +278,7 @@ slight error in typing the name.
 
 @vindex find-file-run-dired
   If you ``visit'' a file that is actually a directory, Emacs invokes
-Dired, the Emacs directory browser; this lets you you ``edit'' the
+Dired, the Emacs directory browser; this lets you ``edit'' the
 contents of the directory.  @xref{Dired}.  You can disable this
 behavior by setting the variable @code{find-file-run-dired} to
 @code{nil}; in that case, it is an error to try to visit a directory.
@@ -425,8 +441,9 @@ View the buffer that you are currently being asked about.  When you exit
 View mode, you get back to @code{save-some-buffers}, which asks the
 question again.
 @item d
-Diff the buffer against its corresponding file, so you can see
-what changes you would be saving.
+Diff the buffer against its corresponding file, so you can see what
+changes you would be saving.  This calls the command
+@code{diff-buffer-with-file} (@pxref{Comparing Files}).
 @item C-h
 Display a help message about these options.
 @end table
@@ -537,9 +554,9 @@ makes a backup from the previous contents, and arranges to make
 another from the newly saved contents if you save again.
 
 @menu
-* Names: Backup Names.         How backup files are named.
-* Deletion: Backup Deletion.   Emacs deletes excess numbered backups.
-* Copying: Backup Copying.     Backups can be made by copying or renaming.
+* Names: Backup Names.          How backup files are named.
+* Deletion: Backup Deletion.    Emacs deletes excess numbered backups.
+* Copying: Backup Copying.      Backups can be made by copying or renaming.
 @end menu
 
 @node Backup Names
@@ -946,6 +963,7 @@ the buffer, and it will stay there as the file contents change.
 However, if you are sure that the file will only change by growing at
 the end, use Auto-Revert Tail mode instead
 (@code{auto-revert-tail-mode}).  It is more efficient for this.
+Auto-Revert Tail mode works also for remote files.
 
   @xref{VC Mode Line}, for Auto Revert peculiarities in buffers that
 visit files under version control.
@@ -977,7 +995,7 @@ execution of commands you have been typing.
 * Files: Auto Save Files.       The file where auto-saved changes are
                                   actually made until you save the file.
 * Control: Auto Save Control.   Controlling when and how often to auto-save.
-* Recover::                    Recovering text from auto-save files.
+* Recover::                     Recovering text from auto-save files.
 @end menu
 
 @node Auto Save Files
@@ -1182,8 +1200,8 @@ Display a verbose directory listing.
 @item M-x make-directory @key{RET} @var{dirname} @key{RET}
 Create a new directory named @var{dirname}.
 @item M-x delete-directory @key{RET} @var{dirname} @key{RET}
-Delete the directory named @var{dirname}.  It must be empty,
-or you get an error.
+Delete the directory named @var{dirname}.  If it isn't empty,
+you will be asked whether you want to delete it recursively.
 @end table
 
 @findex list-directory
@@ -1230,12 +1248,12 @@ this, it runs the program specified by
 
   The command @kbd{M-x delete-directory} prompts for a directory name
 using the minibuffer, and deletes the directory if it is empty.  If
-the directory is not empty, this signals an error.  On systems that
-have a ``Trash'' or ``Recycle Bin'' feature, you can make this command
-move the specified directory to the Trash or Recycle Bin, instead of
-deleting it outright, by changing the variable
-@code{delete-by-moving-to-trash} to @code{t}.  @xref{Misc File Ops},
-for more information about using the Trash.
+the directory is not empty, you will be asked whether you want to
+delete it recursively.  On systems that have a ``Trash'' or ``Recycle
+Bin'' feature, you can make this command move the specified directory
+to the Trash or Recycle Bin, instead of deleting it outright, by
+changing the variable @code{delete-by-moving-to-trash} to @code{t}.
+@xref{Misc File Ops}, for more information about using the Trash.
 
 @node Comparing Files
 @section Comparing Files
@@ -1261,6 +1279,11 @@ most recent backup.  If you specify the name of a backup file,
 @code{diff-backup} compares it with the source file that it is a
 backup of.  In all other respects, this behaves like @kbd{M-x diff}.
 
+@findex diff-buffer-with-file
+  The command @kbd{M-x diff-buffer-with-file} compares a specified
+buffer with its corresponding file.  This shows you what changes you
+would make to the file if you save the buffer.
+
 @findex compare-windows
   The command @kbd{M-x compare-windows} compares the text in the
 current window with that in the next window.  (For more information
@@ -1545,9 +1568,12 @@ On MS-Windows, this command works only if the file resides in an NTFS
 file system.  On MS-DOS, it works by copying the file.
 
 @findex copy-file
+@findex copy-directory
 @cindex copying files
   @kbd{M-x copy-file} reads the file @var{old} and writes a new file
-named @var{new} with the same contents.
+named @var{new} with the same contents.  @kbd{M-x copy-directory} does
+the same for directories, by recursive copying all files and
+subdirectories.
 
 @findex make-symbolic-link
 @cindex symbolic links (creation)
@@ -1563,6 +1589,19 @@ a relative name as the target of the link.
   Not all systems support symbolic links; on systems that don't
 support them, this command is not defined.
 
+@findex set-file-modes
+@cindex file modes
+@cindex file permissions
+  @kbd{M-x set-file-modes} reads a file name followed by a @dfn{file
+mode}, and applies that file mode to the specified file.  File modes,
+also called @dfn{file permissions}, determine whether a file can be
+read, written to, or executed, and by whom.  This command reads file
+modes using the same symbolic or octal format accepted by the
+@command{chmod} command; for instance, @samp{u+x} means to add
+execution permission for the user who owns the file.  It has no effect
+on operating systems that do not support file modes.  @code{chmod} is a
+convenience alias for this function.
+
 @node Compressed Files
 @section Accessing Compressed Files
 @cindex compression
@@ -1723,11 +1762,11 @@ is documented in the following.  Remote file access through the other
 methods is handled by the Tramp package, which has its own manual.
 @xref{Top, The Tramp Manual,, tramp, The Tramp Manual}.
 
-When the Ange-FTP package is used, Emacs logs in through FTP using your
-user name or the name @var{user}.  It may ask you for a password from
-time to time; this is used for logging in on @var{host}.  The form using
-@var{port} allows you to access servers running on a non-default TCP
-port.
+When the Ange-FTP package is used, Emacs logs in through FTP using
+your user name or the name @var{user}.  It may ask you for a password
+from time to time (@pxref{Passwords}); this is used for logging in on
+@var{host}.  The form using @var{port} allows you to access servers
+running on a non-default TCP port.
 
 @cindex backups for remote files
 @vindex ange-ftp-make-backup-files
@@ -1754,7 +1793,7 @@ are handled specially.  The variable
 the value of this variable is a string, then that string is used as
 the password; if non-@code{nil} (the default), then the value of
 @code{user-mail-address} is used; if @code{nil}, then Emacs prompts
-you for a password as usual.
+you for a password as usual (@pxref{Passwords}).
 
 @cindex firewall, and accessing remote files
 @cindex gateway, and remote file access with @code{ange-ftp}