summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-05-13 13:34:23 +0000
committerRichard M. Stallman <rms@gnu.org>2005-05-13 13:34:23 +0000
commit68780e2abdc5e7f5d5aa63d9cf37eef97419b429 (patch)
tree50b0fedae48689348a1bba01ec44bae9646ef867 /src
parent5063dbbf5a6145d5feb0c951d153d376bebb668f (diff)
downloademacs-68780e2abdc5e7f5d5aa63d9cf37eef97419b429.tar.gz
(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.
Diffstat (limited to 'src')
-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 @@
+2005-05-13 Richard M. Stallman <rms@gnu.org>
+
+ * fileio.c (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.
+
2005-05-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init.
@@ -43,6 +51,7 @@
(unexec_malloc, unexec_realloc, unexec_free): Store and use
allocated size information in unexec_malloc_header.
+>>>>>>> 1.4385
2005-05-10 Richard M. Stallman <rms@gnu.org>
* 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. */)
Lisp_Object string = XCAR (elt);
int match_pos;
Lisp_Object handler = XCDR (elt);
- Lisp_Object operations = Fget (handler, Qoperations);
+ Lisp_Object operations = Qnil;
+
+ if (SYMBOLP (handler))
+ operations = Fget (handler, Qoperations);
if (STRINGP (string)
&& (match_pos = fast_string_match (string, filename)) > pos
@@ -2862,7 +2865,8 @@ This is what happens in interactive use with M-x. */)
#ifdef S_IFLNK
DEFUN ("make-symbolic-link", Fmake_symbolic_link, Smake_symbolic_link, 2, 3,
"FMake symbolic link to file: \nGMake symbolic link to file %s: \np",
- doc: /* Make a symbolic link to FILENAME, named LINKNAME. Both args must be strings.
+ doc: /* Make a symbolic link to FILENAME, named LINKNAME.
+Both args must be strings.
Signals a `file-already-exists' error if a file LINKNAME already exists
unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
A number as third arg means request confirmation if LINKNAME already exists.
@@ -3060,8 +3064,10 @@ check_writable (filename)
}
DEFUN ("file-exists-p", Ffile_exists_p, Sfile_exists_p, 1, 1, 0,
- doc: /* Return t if file FILENAME exists. (This does not mean you can read it.)
-See also `file-readable-p' and `file-attributes'. */)
+ doc: /* Return t if file FILENAME exists (whether or not you can read it.)
+See also `file-readable-p' and `file-attributes'.
+This returns nil for a symlink to a nonexistent file.
+Use `file-symlink-p' to test for such links. */)
(filename)
Lisp_Object filename;
{
@@ -3238,7 +3244,10 @@ If there is no error, returns nil. */)
DEFUN ("file-symlink-p", Ffile_symlink_p, Sfile_symlink_p, 1, 1, 0,
doc: /* Return non-nil if file FILENAME is the name of a symbolic link.
The value is the link target, as a string.
-Otherwise returns nil. */)
+Otherwise it returns nil.
+
+This function returns t when given the name of a symlink that
+points to a nonexistent file. */)
(filename)
Lisp_Object filename;
{
@@ -3728,6 +3737,8 @@ actually used. */)
int set_coding_system = 0;
int coding_system_decided = 0;
int read_quit = 0;
+ int old_Vdeactivate_mark = Vdeactivate_mark;
+ int we_locked_file = 0;
if (current_buffer->base_buffer && ! NILP (visit))
error ("Cannot do file visiting in an indirect buffer");
@@ -4400,8 +4411,17 @@ actually used. */)
/* For a special file, all we can do is guess. */
total = READ_BUF_SIZE;
- if (NILP (visit) && total > 0)
- prepare_to_modify_buffer (PT, PT, NULL);
+ if (NILP (visit) && inserted > 0)
+ {
+#ifdef CLASH_DETECTION
+ if (!NILP (current_buffer->file_truename)
+ /* Make binding buffer-file-name to nil effective. */
+ && !NILP (current_buffer->filename)
+ && SAVE_MODIFF >= MODIFF)
+ we_locked_file = 1;
+#endif /* CLASH_DETECTION */
+ prepare_to_modify_buffer (GPT, GPT, NULL);
+ }
move_gap (PT);
if (GAP_SIZE < total)
@@ -4491,6 +4511,16 @@ actually used. */)
}
}
+ /* Now we have read all the file data into the gap.
+ If it was empty, undo marking the buffer modified. */
+
+ if (inserted == 0)
+ {
+ if (we_locked_file)
+ unlock_file (current_buffer->file_truename);
+ Vdeactivate_mark = old_Vdeactivate_mark;
+ }
+
/* Make the text read part of the buffer. */
GAP_SIZE -= inserted;
GPT += inserted;
@@ -6036,7 +6066,10 @@ DEFUN ("clear-buffer-auto-save-failure", Fclear_buffer_auto_save_failure,
DEFUN ("recent-auto-save-p", Frecent_auto_save_p, Srecent_auto_save_p,
0, 0, 0,
- doc: /* Return t if current buffer has been auto-saved since last read in or saved. */)
+ doc: /* Return t if current buffer has been auto-saved recently.
+More precisely, if it has been auto-saved since last read from or saved
+in the visited file. If the buffer has no visited file,
+then any auto-save counts as "recent". */)
()
{
return (SAVE_MODIFF < current_buffer->auto_save_modified) ? Qt : Qnil;