aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2012-02-21 21:24:48 +0800
committerChong Yidong2012-02-21 21:24:48 +0800
commita59225b146620b11455b614244ceb6d02339a032 (patch)
treec6e730a974c8c968f827f589a6162b340e4c4b69 /src
parentf9a998c365893585a8b33fba9a00320348c0b34b (diff)
downloademacs-a59225b146620b11455b614244ceb6d02339a032.tar.gz
emacs-a59225b146620b11455b614244ceb6d02339a032.zip
Update Files chapter in Lisp manual.
* doc/lispref/files.texi (Files): Mention magic file names as arguments. (Reading from Files): Copyedits. (File Attributes): Mention how to change file modes. (Changing Files): Use standard "file permissions" terminology. Add xref to File Attributes node. (Locating Files): Document locate-user-emacs-file. (Unique File Names): Recommend against using make-temp-name. * src/buffer.c (Fget_file_buffer): Protect against invalid file handler return value. * src/fileio.c (Vfile_name_handler_alist): Doc fix.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/buffer.c6
-rw-r--r--src/fileio.c31
3 files changed, 31 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bd376e9b855..c5e898684a8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12012-02-21 Chong Yidong <cyd@gnu.org>
2
3 * fileio.c (Vfile_name_handler_alist): Doc fix.
4
5 * buffer.c (Fget_file_buffer): Protect against invalid file
6 handler return value.
7
12012-02-20 Paul Eggert <eggert@cs.ucla.edu> 82012-02-20 Paul Eggert <eggert@cs.ucla.edu>
2 9
3 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long' 10 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
diff --git a/src/buffer.c b/src/buffer.c
index a6f61a1936a..71a5e199c6f 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -272,7 +272,11 @@ See also `find-buffer-visiting'. */)
272 call the corresponding file handler. */ 272 call the corresponding file handler. */
273 handler = Ffind_file_name_handler (filename, Qget_file_buffer); 273 handler = Ffind_file_name_handler (filename, Qget_file_buffer);
274 if (!NILP (handler)) 274 if (!NILP (handler))
275 return call2 (handler, Qget_file_buffer, filename); 275 {
276 Lisp_Object handled_buf = call2 (handler, Qget_file_buffer,
277 filename);
278 return BUFFERP (handled_buf) ? handled_buf : Qnil;
279 }
276 280
277 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) 281 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
278 { 282 {
diff --git a/src/fileio.c b/src/fileio.c
index 1fd5ebed651..839dc07b6ce 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5640,18 +5640,25 @@ of file names regardless of the current language environment. */);
5640 make_pure_c_string ("Cannot set file date")); 5640 make_pure_c_string ("Cannot set file date"));
5641 5641
5642 DEFVAR_LISP ("file-name-handler-alist", Vfile_name_handler_alist, 5642 DEFVAR_LISP ("file-name-handler-alist", Vfile_name_handler_alist,
5643 doc: /* *Alist of elements (REGEXP . HANDLER) for file names handled specially. 5643 doc: /* Alist of elements (REGEXP . HANDLER) for file names handled specially.
5644If a file name matches REGEXP, then all I/O on that file is done by calling 5644If a file name matches REGEXP, all I/O on that file is done by calling
5645HANDLER. 5645HANDLER. If a file name matches more than one handler, the handler
5646 5646whose match starts last in the file name gets precedence. The
5647The first argument given to HANDLER is the name of the I/O primitive 5647function `find-file-name-handler' checks this list for a handler for
5648to be handled; the remaining arguments are the arguments that were 5648its argument.
5649passed to that primitive. For example, if you do 5649
5650 (file-exists-p FILENAME) 5650HANDLER should be a function. The first argument given to it is the
5651and FILENAME is handled by HANDLER, then HANDLER is called like this: 5651name of the I/O primitive to be handled; the remaining arguments are
5652 (funcall HANDLER 'file-exists-p FILENAME) 5652the arguments that were passed to that primitive. For example, if you
5653The function `find-file-name-handler' checks this list for a handler 5653do (file-exists-p FILENAME) and FILENAME is handled by HANDLER, then
5654for its argument. */); 5654HANDLER is called like this:
5655
5656 (funcall HANDLER 'file-exists-p FILENAME)
5657
5658Note that HANDLER must be able to handle all I/O primitives; if it has
5659nothing special to do for a primitive, it should reinvoke the
5660primitive to handle the operation \"the usual way\".
5661See Info node `(elisp)Magic File Names' for more details. */);
5655 Vfile_name_handler_alist = Qnil; 5662 Vfile_name_handler_alist = Qnil;
5656 5663
5657 DEFVAR_LISP ("set-auto-coding-function", 5664 DEFVAR_LISP ("set-auto-coding-function",