diff options
| author | Karoly Lorentey | 2005-05-16 15:49:27 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-05-16 15:49:27 +0000 |
| commit | 35bc5d82600f330082298823f09f53259a90ea81 (patch) | |
| tree | 328e8f1df7bcd3cb68f4dfa7de371543da885c89 /src/fileio.c | |
| parent | 133fe4c8a2d944324dc2c9a42b01ab1d258ad49d (diff) | |
| parent | cc211a0ff8145e0814413e237bb5674d615968b7 (diff) | |
| download | emacs-35bc5d82600f330082298823f09f53259a90ea81.tar.gz emacs-35bc5d82600f330082298823f09f53259a90ea81.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 307-312)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-307
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-308
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-309
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-310
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-311
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-312
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-346
Diffstat (limited to 'src/fileio.c')
| -rw-r--r-- | src/fileio.c | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/src/fileio.c b/src/fileio.c index b62dac5b3d7..eaa2d184f1d 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -375,7 +375,10 @@ use the standard functions without calling themselves recursively. */) | |||
| 375 | Lisp_Object string = XCAR (elt); | 375 | Lisp_Object string = XCAR (elt); |
| 376 | int match_pos; | 376 | int match_pos; |
| 377 | Lisp_Object handler = XCDR (elt); | 377 | Lisp_Object handler = XCDR (elt); |
| 378 | Lisp_Object operations = Fget (handler, Qoperations); | 378 | Lisp_Object operations = Qnil; |
| 379 | |||
| 380 | if (SYMBOLP (handler)) | ||
| 381 | operations = Fget (handler, Qoperations); | ||
| 379 | 382 | ||
| 380 | if (STRINGP (string) | 383 | if (STRINGP (string) |
| 381 | && (match_pos = fast_string_match (string, filename)) > pos | 384 | && (match_pos = fast_string_match (string, filename)) > pos |
| @@ -2864,7 +2867,8 @@ This is what happens in interactive use with M-x. */) | |||
| 2864 | #ifdef S_IFLNK | 2867 | #ifdef S_IFLNK |
| 2865 | DEFUN ("make-symbolic-link", Fmake_symbolic_link, Smake_symbolic_link, 2, 3, | 2868 | DEFUN ("make-symbolic-link", Fmake_symbolic_link, Smake_symbolic_link, 2, 3, |
| 2866 | "FMake symbolic link to file: \nGMake symbolic link to file %s: \np", | 2869 | "FMake symbolic link to file: \nGMake symbolic link to file %s: \np", |
| 2867 | doc: /* Make a symbolic link to FILENAME, named LINKNAME. Both args must be strings. | 2870 | doc: /* Make a symbolic link to FILENAME, named LINKNAME. |
| 2871 | Both args must be strings. | ||
| 2868 | Signals a `file-already-exists' error if a file LINKNAME already exists | 2872 | Signals a `file-already-exists' error if a file LINKNAME already exists |
| 2869 | unless optional third argument OK-IF-ALREADY-EXISTS is non-nil. | 2873 | unless optional third argument OK-IF-ALREADY-EXISTS is non-nil. |
| 2870 | A number as third arg means request confirmation if LINKNAME already exists. | 2874 | A number as third arg means request confirmation if LINKNAME already exists. |
| @@ -3062,8 +3066,10 @@ check_writable (filename) | |||
| 3062 | } | 3066 | } |
| 3063 | 3067 | ||
| 3064 | DEFUN ("file-exists-p", Ffile_exists_p, Sfile_exists_p, 1, 1, 0, | 3068 | DEFUN ("file-exists-p", Ffile_exists_p, Sfile_exists_p, 1, 1, 0, |
| 3065 | doc: /* Return t if file FILENAME exists. (This does not mean you can read it.) | 3069 | doc: /* Return t if file FILENAME exists (whether or not you can read it.) |
| 3066 | See also `file-readable-p' and `file-attributes'. */) | 3070 | See also `file-readable-p' and `file-attributes'. |
| 3071 | This returns nil for a symlink to a nonexistent file. | ||
| 3072 | Use `file-symlink-p' to test for such links. */) | ||
| 3067 | (filename) | 3073 | (filename) |
| 3068 | Lisp_Object filename; | 3074 | Lisp_Object filename; |
| 3069 | { | 3075 | { |
| @@ -3240,7 +3246,10 @@ If there is no error, returns nil. */) | |||
| 3240 | DEFUN ("file-symlink-p", Ffile_symlink_p, Sfile_symlink_p, 1, 1, 0, | 3246 | DEFUN ("file-symlink-p", Ffile_symlink_p, Sfile_symlink_p, 1, 1, 0, |
| 3241 | doc: /* Return non-nil if file FILENAME is the name of a symbolic link. | 3247 | doc: /* Return non-nil if file FILENAME is the name of a symbolic link. |
| 3242 | The value is the link target, as a string. | 3248 | The value is the link target, as a string. |
| 3243 | Otherwise returns nil. */) | 3249 | Otherwise it returns nil. |
| 3250 | |||
| 3251 | This function returns t when given the name of a symlink that | ||
| 3252 | points to a nonexistent file. */) | ||
| 3244 | (filename) | 3253 | (filename) |
| 3245 | Lisp_Object filename; | 3254 | Lisp_Object filename; |
| 3246 | { | 3255 | { |
| @@ -3730,6 +3739,8 @@ actually used. */) | |||
| 3730 | int set_coding_system = 0; | 3739 | int set_coding_system = 0; |
| 3731 | int coding_system_decided = 0; | 3740 | int coding_system_decided = 0; |
| 3732 | int read_quit = 0; | 3741 | int read_quit = 0; |
| 3742 | int old_Vdeactivate_mark = Vdeactivate_mark; | ||
| 3743 | int we_locked_file = 0; | ||
| 3733 | 3744 | ||
| 3734 | if (current_buffer->base_buffer && ! NILP (visit)) | 3745 | if (current_buffer->base_buffer && ! NILP (visit)) |
| 3735 | error ("Cannot do file visiting in an indirect buffer"); | 3746 | error ("Cannot do file visiting in an indirect buffer"); |
| @@ -4402,8 +4413,17 @@ actually used. */) | |||
| 4402 | /* For a special file, all we can do is guess. */ | 4413 | /* For a special file, all we can do is guess. */ |
| 4403 | total = READ_BUF_SIZE; | 4414 | total = READ_BUF_SIZE; |
| 4404 | 4415 | ||
| 4405 | if (NILP (visit) && total > 0) | 4416 | if (NILP (visit) && inserted > 0) |
| 4406 | prepare_to_modify_buffer (PT, PT, NULL); | 4417 | { |
| 4418 | #ifdef CLASH_DETECTION | ||
| 4419 | if (!NILP (current_buffer->file_truename) | ||
| 4420 | /* Make binding buffer-file-name to nil effective. */ | ||
| 4421 | && !NILP (current_buffer->filename) | ||
| 4422 | && SAVE_MODIFF >= MODIFF) | ||
| 4423 | we_locked_file = 1; | ||
| 4424 | #endif /* CLASH_DETECTION */ | ||
| 4425 | prepare_to_modify_buffer (GPT, GPT, NULL); | ||
| 4426 | } | ||
| 4407 | 4427 | ||
| 4408 | move_gap (PT); | 4428 | move_gap (PT); |
| 4409 | if (GAP_SIZE < total) | 4429 | if (GAP_SIZE < total) |
| @@ -4493,6 +4513,18 @@ actually used. */) | |||
| 4493 | } | 4513 | } |
| 4494 | } | 4514 | } |
| 4495 | 4515 | ||
| 4516 | /* Now we have read all the file data into the gap. | ||
| 4517 | If it was empty, undo marking the buffer modified. */ | ||
| 4518 | |||
| 4519 | if (inserted == 0) | ||
| 4520 | { | ||
| 4521 | #ifdef CLASH_DETECTION | ||
| 4522 | if (we_locked_file) | ||
| 4523 | unlock_file (current_buffer->file_truename); | ||
| 4524 | #endif | ||
| 4525 | Vdeactivate_mark = old_Vdeactivate_mark; | ||
| 4526 | } | ||
| 4527 | |||
| 4496 | /* Make the text read part of the buffer. */ | 4528 | /* Make the text read part of the buffer. */ |
| 4497 | GAP_SIZE -= inserted; | 4529 | GAP_SIZE -= inserted; |
| 4498 | GPT += inserted; | 4530 | GPT += inserted; |
| @@ -6038,7 +6070,10 @@ DEFUN ("clear-buffer-auto-save-failure", Fclear_buffer_auto_save_failure, | |||
| 6038 | 6070 | ||
| 6039 | DEFUN ("recent-auto-save-p", Frecent_auto_save_p, Srecent_auto_save_p, | 6071 | DEFUN ("recent-auto-save-p", Frecent_auto_save_p, Srecent_auto_save_p, |
| 6040 | 0, 0, 0, | 6072 | 0, 0, 0, |
| 6041 | doc: /* Return t if current buffer has been auto-saved since last read in or saved. */) | 6073 | doc: /* Return t if current buffer has been auto-saved recently. |
| 6074 | More precisely, if it has been auto-saved since last read from or saved | ||
| 6075 | in the visited file. If the buffer has no visited file, | ||
| 6076 | then any auto-save counts as "recent". */) | ||
| 6042 | () | 6077 | () |
| 6043 | { | 6078 | { |
| 6044 | return (SAVE_MODIFF < current_buffer->auto_save_modified) ? Qt : Qnil; | 6079 | return (SAVE_MODIFF < current_buffer->auto_save_modified) ? Qt : Qnil; |