aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-05-13 13:34:23 +0000
committerRichard M. Stallman2005-05-13 13:34:23 +0000
commit68780e2abdc5e7f5d5aa63d9cf37eef97419b429 (patch)
tree50b0fedae48689348a1bba01ec44bae9646ef867
parent5063dbbf5a6145d5feb0c951d153d376bebb668f (diff)
downloademacs-68780e2abdc5e7f5d5aa63d9cf37eef97419b429.tar.gz
emacs-68780e2abdc5e7f5d5aa63d9cf37eef97419b429.zip
(Ffind_file_name_handler): Handle lambda-exp as handler.
(Finsert_file_contents): If we read 0 bytes from a special file, unlock the visited file if we locked it. (Fmake_symbolic_link, Frecent_auto_save_p): Doc fixes. (Ffile_exists_p, Ffile_symlink_p): Doc fixes.
-rw-r--r--src/ChangeLog9
-rw-r--r--src/fileio.c49
2 files changed, 50 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a86f78e5b96..b89d61d2d52 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12005-05-13 Richard M. Stallman <rms@gnu.org>
2
3 * fileio.c (Ffind_file_name_handler): Handle lambda-exp as handler.
4 (Finsert_file_contents): If we read 0 bytes from a special file,
5 unlock the visited file if we locked it.
6 (Fmake_symbolic_link, Frecent_auto_save_p): Doc fixes.
7 (Ffile_exists_p, Ffile_symlink_p): Doc fixes.
8
12005-05-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 92005-05-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 10
3 * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init. 11 * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init.
@@ -43,6 +51,7 @@
43 (unexec_malloc, unexec_realloc, unexec_free): Store and use 51 (unexec_malloc, unexec_realloc, unexec_free): Store and use
44 allocated size information in unexec_malloc_header. 52 allocated size information in unexec_malloc_header.
45 53
54>>>>>>> 1.4385
462005-05-10 Richard M. Stallman <rms@gnu.org> 552005-05-10 Richard M. Stallman <rms@gnu.org>
47 56
48 * xterm.c (noinclude): Add #undef. 57 * xterm.c (noinclude): Add #undef.
diff --git a/src/fileio.c b/src/fileio.c
index 735b329968b..6edcf45da50 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -373,7 +373,10 @@ use the standard functions without calling themselves recursively. */)
373 Lisp_Object string = XCAR (elt); 373 Lisp_Object string = XCAR (elt);
374 int match_pos; 374 int match_pos;
375 Lisp_Object handler = XCDR (elt); 375 Lisp_Object handler = XCDR (elt);
376 Lisp_Object operations = Fget (handler, Qoperations); 376 Lisp_Object operations = Qnil;
377
378 if (SYMBOLP (handler))
379 operations = Fget (handler, Qoperations);
377 380
378 if (STRINGP (string) 381 if (STRINGP (string)
379 && (match_pos = fast_string_match (string, filename)) > pos 382 && (match_pos = fast_string_match (string, filename)) > pos
@@ -2862,7 +2865,8 @@ This is what happens in interactive use with M-x. */)
2862#ifdef S_IFLNK 2865#ifdef S_IFLNK
2863DEFUN ("make-symbolic-link", Fmake_symbolic_link, Smake_symbolic_link, 2, 3, 2866DEFUN ("make-symbolic-link", Fmake_symbolic_link, Smake_symbolic_link, 2, 3,
2864 "FMake symbolic link to file: \nGMake symbolic link to file %s: \np", 2867 "FMake symbolic link to file: \nGMake symbolic link to file %s: \np",
2865 doc: /* Make a symbolic link to FILENAME, named LINKNAME. Both args must be strings. 2868 doc: /* Make a symbolic link to FILENAME, named LINKNAME.
2869Both args must be strings.
2866Signals a `file-already-exists' error if a file LINKNAME already exists 2870Signals a `file-already-exists' error if a file LINKNAME already exists
2867unless optional third argument OK-IF-ALREADY-EXISTS is non-nil. 2871unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
2868A number as third arg means request confirmation if LINKNAME already exists. 2872A number as third arg means request confirmation if LINKNAME already exists.
@@ -3060,8 +3064,10 @@ check_writable (filename)
3060} 3064}
3061 3065
3062DEFUN ("file-exists-p", Ffile_exists_p, Sfile_exists_p, 1, 1, 0, 3066DEFUN ("file-exists-p", Ffile_exists_p, Sfile_exists_p, 1, 1, 0,
3063 doc: /* Return t if file FILENAME exists. (This does not mean you can read it.) 3067 doc: /* Return t if file FILENAME exists (whether or not you can read it.)
3064See also `file-readable-p' and `file-attributes'. */) 3068See also `file-readable-p' and `file-attributes'.
3069This returns nil for a symlink to a nonexistent file.
3070Use `file-symlink-p' to test for such links. */)
3065 (filename) 3071 (filename)
3066 Lisp_Object filename; 3072 Lisp_Object filename;
3067{ 3073{
@@ -3238,7 +3244,10 @@ If there is no error, returns nil. */)
3238DEFUN ("file-symlink-p", Ffile_symlink_p, Sfile_symlink_p, 1, 1, 0, 3244DEFUN ("file-symlink-p", Ffile_symlink_p, Sfile_symlink_p, 1, 1, 0,
3239 doc: /* Return non-nil if file FILENAME is the name of a symbolic link. 3245 doc: /* Return non-nil if file FILENAME is the name of a symbolic link.
3240The value is the link target, as a string. 3246The value is the link target, as a string.
3241Otherwise returns nil. */) 3247Otherwise it returns nil.
3248
3249This function returns t when given the name of a symlink that
3250points to a nonexistent file. */)
3242 (filename) 3251 (filename)
3243 Lisp_Object filename; 3252 Lisp_Object filename;
3244{ 3253{
@@ -3728,6 +3737,8 @@ actually used. */)
3728 int set_coding_system = 0; 3737 int set_coding_system = 0;
3729 int coding_system_decided = 0; 3738 int coding_system_decided = 0;
3730 int read_quit = 0; 3739 int read_quit = 0;
3740 int old_Vdeactivate_mark = Vdeactivate_mark;
3741 int we_locked_file = 0;
3731 3742
3732 if (current_buffer->base_buffer && ! NILP (visit)) 3743 if (current_buffer->base_buffer && ! NILP (visit))
3733 error ("Cannot do file visiting in an indirect buffer"); 3744 error ("Cannot do file visiting in an indirect buffer");
@@ -4400,8 +4411,17 @@ actually used. */)
4400 /* For a special file, all we can do is guess. */ 4411 /* For a special file, all we can do is guess. */
4401 total = READ_BUF_SIZE; 4412 total = READ_BUF_SIZE;
4402 4413
4403 if (NILP (visit) && total > 0) 4414 if (NILP (visit) && inserted > 0)
4404 prepare_to_modify_buffer (PT, PT, NULL); 4415 {
4416#ifdef CLASH_DETECTION
4417 if (!NILP (current_buffer->file_truename)
4418 /* Make binding buffer-file-name to nil effective. */
4419 && !NILP (current_buffer->filename)
4420 && SAVE_MODIFF >= MODIFF)
4421 we_locked_file = 1;
4422#endif /* CLASH_DETECTION */
4423 prepare_to_modify_buffer (GPT, GPT, NULL);
4424 }
4405 4425
4406 move_gap (PT); 4426 move_gap (PT);
4407 if (GAP_SIZE < total) 4427 if (GAP_SIZE < total)
@@ -4491,6 +4511,16 @@ actually used. */)
4491 } 4511 }
4492 } 4512 }
4493 4513
4514 /* Now we have read all the file data into the gap.
4515 If it was empty, undo marking the buffer modified. */
4516
4517 if (inserted == 0)
4518 {
4519 if (we_locked_file)
4520 unlock_file (current_buffer->file_truename);
4521 Vdeactivate_mark = old_Vdeactivate_mark;
4522 }
4523
4494 /* Make the text read part of the buffer. */ 4524 /* Make the text read part of the buffer. */
4495 GAP_SIZE -= inserted; 4525 GAP_SIZE -= inserted;
4496 GPT += inserted; 4526 GPT += inserted;
@@ -6036,7 +6066,10 @@ DEFUN ("clear-buffer-auto-save-failure", Fclear_buffer_auto_save_failure,
6036 6066
6037DEFUN ("recent-auto-save-p", Frecent_auto_save_p, Srecent_auto_save_p, 6067DEFUN ("recent-auto-save-p", Frecent_auto_save_p, Srecent_auto_save_p,
6038 0, 0, 0, 6068 0, 0, 0,
6039 doc: /* Return t if current buffer has been auto-saved since last read in or saved. */) 6069 doc: /* Return t if current buffer has been auto-saved recently.
6070More precisely, if it has been auto-saved since last read from or saved
6071in the visited file. If the buffer has no visited file,
6072then any auto-save counts as "recent". */)
6040 () 6073 ()
6041{ 6074{
6042 return (SAVE_MODIFF < current_buffer->auto_save_modified) ? Qt : Qnil; 6075 return (SAVE_MODIFF < current_buffer->auto_save_modified) ? Qt : Qnil;