diff options
| author | Francesco Potortì | 2003-01-13 22:17:01 +0000 |
|---|---|---|
| committer | Francesco Potortì | 2003-01-13 22:17:01 +0000 |
| commit | efdc16c957f23854a9aba554261c79677cf43154 (patch) | |
| tree | b7fb386f1630d604d6225d674abc0688ab0846b0 /src | |
| parent | 64f511342eb6c10086a9b9a5c82c5fa12cef73ea (diff) | |
| download | emacs-efdc16c957f23854a9aba554261c79677cf43154.tar.gz emacs-efdc16c957f23854a9aba554261c79677cf43154.zip | |
(Fdelete_directory, Fdelete_file): Document the
behaviour in front of symlinks.
(Fdelete_file): Raise an error on directories.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 95 |
1 files changed, 50 insertions, 45 deletions
diff --git a/src/fileio.c b/src/fileio.c index 9d14a851bd4..56086b6dfb1 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -188,7 +188,7 @@ Lisp_Object Vwrite_region_annotations_so_far; | |||
| 188 | Lisp_Object Vauto_save_list_file_name; | 188 | Lisp_Object Vauto_save_list_file_name; |
| 189 | 189 | ||
| 190 | /* Function to call to read a file name. */ | 190 | /* Function to call to read a file name. */ |
| 191 | Lisp_Object Vread_file_name_function; | 191 | Lisp_Object Vread_file_name_function; |
| 192 | 192 | ||
| 193 | /* Current predicate used by read_file_name_internal. */ | 193 | /* Current predicate used by read_file_name_internal. */ |
| 194 | Lisp_Object Vread_file_name_predicate; | 194 | Lisp_Object Vread_file_name_predicate; |
| @@ -849,13 +849,13 @@ static char make_temp_name_tbl[64] = | |||
| 849 | static unsigned make_temp_name_count, make_temp_name_count_initialized_p; | 849 | static unsigned make_temp_name_count, make_temp_name_count_initialized_p; |
| 850 | 850 | ||
| 851 | /* Value is a temporary file name starting with PREFIX, a string. | 851 | /* Value is a temporary file name starting with PREFIX, a string. |
| 852 | 852 | ||
| 853 | The Emacs process number forms part of the result, so there is | 853 | The Emacs process number forms part of the result, so there is |
| 854 | no danger of generating a name being used by another process. | 854 | no danger of generating a name being used by another process. |
| 855 | In addition, this function makes an attempt to choose a name | 855 | In addition, this function makes an attempt to choose a name |
| 856 | which has no existing file. To make this work, PREFIX should be | 856 | which has no existing file. To make this work, PREFIX should be |
| 857 | an absolute file name. | 857 | an absolute file name. |
| 858 | 858 | ||
| 859 | BASE64_P non-zero means add the pid as 3 characters in base64 | 859 | BASE64_P non-zero means add the pid as 3 characters in base64 |
| 860 | encoding. In this case, 6 characters will be added to PREFIX to | 860 | encoding. In this case, 6 characters will be added to PREFIX to |
| 861 | form the file name. Otherwise, if Emacs is running on a system | 861 | form the file name. Otherwise, if Emacs is running on a system |
| @@ -875,7 +875,7 @@ make_temp_name (prefix, base64_p) | |||
| 875 | unsigned char *p, *data; | 875 | unsigned char *p, *data; |
| 876 | char pidbuf[20]; | 876 | char pidbuf[20]; |
| 877 | int pidlen; | 877 | int pidlen; |
| 878 | 878 | ||
| 879 | CHECK_STRING (prefix); | 879 | CHECK_STRING (prefix); |
| 880 | 880 | ||
| 881 | /* VAL is created by adding 6 characters to PREFIX. The first | 881 | /* VAL is created by adding 6 characters to PREFIX. The first |
| @@ -904,7 +904,7 @@ make_temp_name (prefix, base64_p) | |||
| 904 | pidlen = 3; | 904 | pidlen = 3; |
| 905 | #endif | 905 | #endif |
| 906 | } | 906 | } |
| 907 | 907 | ||
| 908 | len = SCHARS (prefix); | 908 | len = SCHARS (prefix); |
| 909 | val = make_uninit_string (len + 3 + pidlen); | 909 | val = make_uninit_string (len + 3 + pidlen); |
| 910 | data = SDATA (val); | 910 | data = SDATA (val); |
| @@ -1195,7 +1195,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1195 | && IS_DIRECTORY_SEP (p[0]) | 1195 | && IS_DIRECTORY_SEP (p[0]) |
| 1196 | && IS_DIRECTORY_SEP (p[1])) | 1196 | && IS_DIRECTORY_SEP (p[1])) |
| 1197 | lose = 1; | 1197 | lose = 1; |
| 1198 | 1198 | ||
| 1199 | #ifdef VMS | 1199 | #ifdef VMS |
| 1200 | if (p[0] == '\\') | 1200 | if (p[0] == '\\') |
| 1201 | lose = 1; | 1201 | lose = 1; |
| @@ -1538,7 +1538,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1538 | absolute directory in nm produces "//", which will then be | 1538 | absolute directory in nm produces "//", which will then be |
| 1539 | incorrectly treated as a network share. Ignore newdir in | 1539 | incorrectly treated as a network share. Ignore newdir in |
| 1540 | this case (keeping the drive letter). */ | 1540 | this case (keeping the drive letter). */ |
| 1541 | if (!(drive && nm[0] && IS_DIRECTORY_SEP (newdir[0]) | 1541 | if (!(drive && nm[0] && IS_DIRECTORY_SEP (newdir[0]) |
| 1542 | && newdir[1] == '\0')) | 1542 | && newdir[1] == '\0')) |
| 1543 | #endif | 1543 | #endif |
| 1544 | strcpy (target, newdir); | 1544 | strcpy (target, newdir); |
| @@ -2402,7 +2402,7 @@ A prefix arg makes KEEP-TIME non-nil. */) | |||
| 2402 | 2402 | ||
| 2403 | #ifdef WINDOWSNT | 2403 | #ifdef WINDOWSNT |
| 2404 | if (!CopyFile (SDATA (encoded_file), | 2404 | if (!CopyFile (SDATA (encoded_file), |
| 2405 | SDATA (encoded_newname), | 2405 | SDATA (encoded_newname), |
| 2406 | FALSE)) | 2406 | FALSE)) |
| 2407 | report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil))); | 2407 | report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil))); |
| 2408 | else if (!NILP (keep_time)) | 2408 | else if (!NILP (keep_time)) |
| @@ -2562,7 +2562,7 @@ DEFUN ("make-directory-internal", Fmake_directory_internal, | |||
| 2562 | } | 2562 | } |
| 2563 | 2563 | ||
| 2564 | DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete directory: ", | 2564 | DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete directory: ", |
| 2565 | doc: /* Delete the directory named DIRECTORY. */) | 2565 | doc: /* Delete the directory named DIRECTORY. Does not follow symlinks. */) |
| 2566 | (directory) | 2566 | (directory) |
| 2567 | Lisp_Object directory; | 2567 | Lisp_Object directory; |
| 2568 | { | 2568 | { |
| @@ -2588,15 +2588,21 @@ DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete | |||
| 2588 | } | 2588 | } |
| 2589 | 2589 | ||
| 2590 | DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 1, "fDelete file: ", | 2590 | DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 1, "fDelete file: ", |
| 2591 | doc: /* Delete file named FILENAME. | 2591 | doc: /* Delete file named FILENAME. If it is a symlink, remove the symlink. |
| 2592 | If file has multiple names, it continues to exist with the other names. */) | 2592 | If file has multiple names, it continues to exist with the other names. */) |
| 2593 | (filename) | 2593 | (filename) |
| 2594 | Lisp_Object filename; | 2594 | Lisp_Object filename; |
| 2595 | { | 2595 | { |
| 2596 | Lisp_Object handler; | 2596 | Lisp_Object handler; |
| 2597 | Lisp_Object encoded_file; | 2597 | Lisp_Object encoded_file; |
| 2598 | struct gcpro gcpro1; | ||
| 2598 | 2599 | ||
| 2599 | CHECK_STRING (filename); | 2600 | GCPRO1 (filename); |
| 2601 | if (!NILP (Ffile_directory_p (filename))) | ||
| 2602 | Fsignal (Qfile_error, | ||
| 2603 | Fcons (build_string ("Removing old name: is a directory"), | ||
| 2604 | Fcons (filename, Qnil))); | ||
| 2605 | UNGCPRO; | ||
| 2600 | filename = Fexpand_file_name (filename, Qnil); | 2606 | filename = Fexpand_file_name (filename, Qnil); |
| 2601 | 2607 | ||
| 2602 | handler = Ffind_file_name_handler (filename, Qdelete_file); | 2608 | handler = Ffind_file_name_handler (filename, Qdelete_file); |
| @@ -3186,7 +3192,7 @@ Otherwise returns nil. */) | |||
| 3186 | bufsize *= 2; | 3192 | bufsize *= 2; |
| 3187 | buf = (char *) xrealloc (buf, bufsize); | 3193 | buf = (char *) xrealloc (buf, bufsize); |
| 3188 | bzero (buf, bufsize); | 3194 | bzero (buf, bufsize); |
| 3189 | 3195 | ||
| 3190 | errno = 0; | 3196 | errno = 0; |
| 3191 | valsize = readlink (SDATA (filename), buf, bufsize); | 3197 | valsize = readlink (SDATA (filename), buf, bufsize); |
| 3192 | if (valsize == -1) | 3198 | if (valsize == -1) |
| @@ -3204,7 +3210,7 @@ Otherwise returns nil. */) | |||
| 3204 | } | 3210 | } |
| 3205 | } | 3211 | } |
| 3206 | while (valsize >= bufsize); | 3212 | while (valsize >= bufsize); |
| 3207 | 3213 | ||
| 3208 | val = make_string (buf, valsize); | 3214 | val = make_string (buf, valsize); |
| 3209 | if (buf[0] == '/' && index (buf, ':')) | 3215 | if (buf[0] == '/' && index (buf, ':')) |
| 3210 | val = concat2 (build_string ("/:"), val); | 3216 | val = concat2 (build_string ("/:"), val); |
| @@ -3524,7 +3530,7 @@ static Lisp_Object | |||
| 3524 | read_non_regular () | 3530 | read_non_regular () |
| 3525 | { | 3531 | { |
| 3526 | int nbytes; | 3532 | int nbytes; |
| 3527 | 3533 | ||
| 3528 | immediate_quit = 1; | 3534 | immediate_quit = 1; |
| 3529 | QUIT; | 3535 | QUIT; |
| 3530 | nbytes = emacs_read (non_regular_fd, | 3536 | nbytes = emacs_read (non_regular_fd, |
| @@ -3790,7 +3796,7 @@ actually used. */) | |||
| 3790 | buf->undo_list = Qt; | 3796 | buf->undo_list = Qt; |
| 3791 | buf->overlays_before = Qnil; | 3797 | buf->overlays_before = Qnil; |
| 3792 | buf->overlays_after = Qnil; | 3798 | buf->overlays_after = Qnil; |
| 3793 | 3799 | ||
| 3794 | set_buffer_internal (buf); | 3800 | set_buffer_internal (buf); |
| 3795 | Ferase_buffer (); | 3801 | Ferase_buffer (); |
| 3796 | buf->enable_multibyte_characters = Qnil; | 3802 | buf->enable_multibyte_characters = Qnil; |
| @@ -3800,7 +3806,7 @@ actually used. */) | |||
| 3800 | val = call2 (Vset_auto_coding_function, | 3806 | val = call2 (Vset_auto_coding_function, |
| 3801 | filename, make_number (nread)); | 3807 | filename, make_number (nread)); |
| 3802 | set_buffer_internal (prev); | 3808 | set_buffer_internal (prev); |
| 3803 | 3809 | ||
| 3804 | /* Discard the unwind protect for recovering the | 3810 | /* Discard the unwind protect for recovering the |
| 3805 | current buffer. */ | 3811 | current buffer. */ |
| 3806 | specpdl_ptr--; | 3812 | specpdl_ptr--; |
| @@ -3965,11 +3971,11 @@ actually used. */) | |||
| 3965 | break; | 3971 | break; |
| 3966 | total_read += nread; | 3972 | total_read += nread; |
| 3967 | } | 3973 | } |
| 3968 | 3974 | ||
| 3969 | /* Scan this bufferful from the end, comparing with | 3975 | /* Scan this bufferful from the end, comparing with |
| 3970 | the Emacs buffer. */ | 3976 | the Emacs buffer. */ |
| 3971 | bufpos = total_read; | 3977 | bufpos = total_read; |
| 3972 | 3978 | ||
| 3973 | /* Compare with same_at_start to avoid counting some buffer text | 3979 | /* Compare with same_at_start to avoid counting some buffer text |
| 3974 | as matching both at the file's beginning and at the end. */ | 3980 | as matching both at the file's beginning and at the end. */ |
| 3975 | while (bufpos > 0 && same_at_end > same_at_start | 3981 | while (bufpos > 0 && same_at_end > same_at_start |
| @@ -4226,7 +4232,7 @@ actually used. */) | |||
| 4226 | if (coding.cmp_data && coding.cmp_data->used) | 4232 | if (coding.cmp_data && coding.cmp_data->used) |
| 4227 | coding_restore_composition (&coding, Fcurrent_buffer ()); | 4233 | coding_restore_composition (&coding, Fcurrent_buffer ()); |
| 4228 | coding_free_composition_data (&coding); | 4234 | coding_free_composition_data (&coding); |
| 4229 | 4235 | ||
| 4230 | /* Set `inserted' to the number of inserted characters. */ | 4236 | /* Set `inserted' to the number of inserted characters. */ |
| 4231 | inserted = PT - temp; | 4237 | inserted = PT - temp; |
| 4232 | 4238 | ||
| @@ -4271,15 +4277,15 @@ actually used. */) | |||
| 4271 | before exiting the loop, it is set to a negative value if I/O | 4277 | before exiting the loop, it is set to a negative value if I/O |
| 4272 | error occurs. */ | 4278 | error occurs. */ |
| 4273 | how_much = 0; | 4279 | how_much = 0; |
| 4274 | 4280 | ||
| 4275 | /* Total bytes inserted. */ | 4281 | /* Total bytes inserted. */ |
| 4276 | inserted = 0; | 4282 | inserted = 0; |
| 4277 | 4283 | ||
| 4278 | /* Here, we don't do code conversion in the loop. It is done by | 4284 | /* Here, we don't do code conversion in the loop. It is done by |
| 4279 | code_convert_region after all data are read into the buffer. */ | 4285 | code_convert_region after all data are read into the buffer. */ |
| 4280 | { | 4286 | { |
| 4281 | int gap_size = GAP_SIZE; | 4287 | int gap_size = GAP_SIZE; |
| 4282 | 4288 | ||
| 4283 | while (how_much < total) | 4289 | while (how_much < total) |
| 4284 | { | 4290 | { |
| 4285 | /* try is reserved in some compilers (Microsoft C) */ | 4291 | /* try is reserved in some compilers (Microsoft C) */ |
| @@ -4323,7 +4329,7 @@ actually used. */) | |||
| 4323 | this = emacs_read (fd, BEG_ADDR + PT_BYTE - BEG_BYTE + inserted, trytry); | 4329 | this = emacs_read (fd, BEG_ADDR + PT_BYTE - BEG_BYTE + inserted, trytry); |
| 4324 | immediate_quit = 0; | 4330 | immediate_quit = 0; |
| 4325 | } | 4331 | } |
| 4326 | 4332 | ||
| 4327 | if (this <= 0) | 4333 | if (this <= 0) |
| 4328 | { | 4334 | { |
| 4329 | how_much = this; | 4335 | how_much = this; |
| @@ -4471,7 +4477,7 @@ actually used. */) | |||
| 4471 | /* Use the conversion type to determine buffer-file-type | 4477 | /* Use the conversion type to determine buffer-file-type |
| 4472 | (find-buffer-file-type is now used to help determine the | 4478 | (find-buffer-file-type is now used to help determine the |
| 4473 | conversion). */ | 4479 | conversion). */ |
| 4474 | if ((coding.eol_type == CODING_EOL_UNDECIDED | 4480 | if ((coding.eol_type == CODING_EOL_UNDECIDED |
| 4475 | || coding.eol_type == CODING_EOL_LF) | 4481 | || coding.eol_type == CODING_EOL_LF) |
| 4476 | && ! CODING_REQUIRE_DECODING (&coding)) | 4482 | && ! CODING_REQUIRE_DECODING (&coding)) |
| 4477 | current_buffer->buffer_file_type = Qt; | 4483 | current_buffer->buffer_file_type = Qt; |
| @@ -4516,7 +4522,7 @@ actually used. */) | |||
| 4516 | if (inserted > 0) | 4522 | if (inserted > 0) |
| 4517 | { | 4523 | { |
| 4518 | int empty_undo_list_p = 0; | 4524 | int empty_undo_list_p = 0; |
| 4519 | 4525 | ||
| 4520 | /* If we're anyway going to discard undo information, don't | 4526 | /* If we're anyway going to discard undo information, don't |
| 4521 | record it in the first place. The buffer's undo list at this | 4527 | record it in the first place. The buffer's undo list at this |
| 4522 | point is either nil or t when visiting a file. */ | 4528 | point is either nil or t when visiting a file. */ |
| @@ -4525,12 +4531,12 @@ actually used. */) | |||
| 4525 | empty_undo_list_p = NILP (current_buffer->undo_list); | 4531 | empty_undo_list_p = NILP (current_buffer->undo_list); |
| 4526 | current_buffer->undo_list = Qt; | 4532 | current_buffer->undo_list = Qt; |
| 4527 | } | 4533 | } |
| 4528 | 4534 | ||
| 4529 | insval = call3 (Qformat_decode, | 4535 | insval = call3 (Qformat_decode, |
| 4530 | Qnil, make_number (inserted), visit); | 4536 | Qnil, make_number (inserted), visit); |
| 4531 | CHECK_NUMBER (insval); | 4537 | CHECK_NUMBER (insval); |
| 4532 | inserted = XFASTINT (insval); | 4538 | inserted = XFASTINT (insval); |
| 4533 | 4539 | ||
| 4534 | if (!NILP (visit)) | 4540 | if (!NILP (visit)) |
| 4535 | current_buffer->undo_list = empty_undo_list_p ? Qnil : Qt; | 4541 | current_buffer->undo_list = empty_undo_list_p ? Qnil : Qt; |
| 4536 | } | 4542 | } |
| @@ -4649,7 +4655,7 @@ choose_write_coding_system (start, end, filename, | |||
| 4649 | if (NILP (current_buffer->enable_multibyte_characters)) | 4655 | if (NILP (current_buffer->enable_multibyte_characters)) |
| 4650 | force_raw_text = 1; | 4656 | force_raw_text = 1; |
| 4651 | } | 4657 | } |
| 4652 | 4658 | ||
| 4653 | if (NILP (val)) | 4659 | if (NILP (val)) |
| 4654 | { | 4660 | { |
| 4655 | /* Check file-coding-system-alist. */ | 4661 | /* Check file-coding-system-alist. */ |
| @@ -4671,7 +4677,7 @@ choose_write_coding_system (start, end, filename, | |||
| 4671 | val = current_buffer->buffer_file_coding_system; | 4677 | val = current_buffer->buffer_file_coding_system; |
| 4672 | using_default_coding = 1; | 4678 | using_default_coding = 1; |
| 4673 | } | 4679 | } |
| 4674 | 4680 | ||
| 4675 | if (!force_raw_text | 4681 | if (!force_raw_text |
| 4676 | && !NILP (Ffboundp (Vselect_safe_coding_system_function))) | 4682 | && !NILP (Ffboundp (Vselect_safe_coding_system_function))) |
| 4677 | /* Confirm that VAL can surely encode the current region. */ | 4683 | /* Confirm that VAL can surely encode the current region. */ |
| @@ -4965,7 +4971,7 @@ This does code conversion according to the value of | |||
| 4965 | if (!NILP (append) && !NILP (Ffile_regular_p (filename))) | 4971 | if (!NILP (append) && !NILP (Ffile_regular_p (filename))) |
| 4966 | { | 4972 | { |
| 4967 | long ret; | 4973 | long ret; |
| 4968 | 4974 | ||
| 4969 | if (NUMBERP (append)) | 4975 | if (NUMBERP (append)) |
| 4970 | ret = lseek (desc, XINT (append), 1); | 4976 | ret = lseek (desc, XINT (append), 1); |
| 4971 | else | 4977 | else |
| @@ -4979,7 +4985,7 @@ This does code conversion according to the value of | |||
| 4979 | report_file_error ("Lseek error", Fcons (filename, Qnil)); | 4985 | report_file_error ("Lseek error", Fcons (filename, Qnil)); |
| 4980 | } | 4986 | } |
| 4981 | } | 4987 | } |
| 4982 | 4988 | ||
| 4983 | UNGCPRO; | 4989 | UNGCPRO; |
| 4984 | 4990 | ||
| 4985 | #ifdef VMS | 4991 | #ifdef VMS |
| @@ -5211,7 +5217,7 @@ build_annotations (start, end) | |||
| 5211 | for (i = 0; CONSP (p); p = XCDR (p), ++i) | 5217 | for (i = 0; CONSP (p); p = XCDR (p), ++i) |
| 5212 | { | 5218 | { |
| 5213 | struct buffer *given_buffer = current_buffer; | 5219 | struct buffer *given_buffer = current_buffer; |
| 5214 | 5220 | ||
| 5215 | Vwrite_region_annotations_so_far = annotations; | 5221 | Vwrite_region_annotations_so_far = annotations; |
| 5216 | 5222 | ||
| 5217 | /* Value is either a list of annotations or nil if the function | 5223 | /* Value is either a list of annotations or nil if the function |
| @@ -5225,7 +5231,7 @@ build_annotations (start, end) | |||
| 5225 | XSETFASTINT (end, ZV); | 5231 | XSETFASTINT (end, ZV); |
| 5226 | annotations = Qnil; | 5232 | annotations = Qnil; |
| 5227 | } | 5233 | } |
| 5228 | 5234 | ||
| 5229 | if (CONSP (res)) | 5235 | if (CONSP (res)) |
| 5230 | annotations = merge (annotations, res, Qcar_less_than_car); | 5236 | annotations = merge (annotations, res, Qcar_less_than_car); |
| 5231 | } | 5237 | } |
| @@ -5512,9 +5518,9 @@ auto_save_error (error) | |||
| 5512 | Lisp_Object args[3], msg; | 5518 | Lisp_Object args[3], msg; |
| 5513 | int i, nbytes; | 5519 | int i, nbytes; |
| 5514 | struct gcpro gcpro1; | 5520 | struct gcpro gcpro1; |
| 5515 | 5521 | ||
| 5516 | ring_bell (); | 5522 | ring_bell (); |
| 5517 | 5523 | ||
| 5518 | args[0] = build_string ("Auto-saving %s: %s"); | 5524 | args[0] = build_string ("Auto-saving %s: %s"); |
| 5519 | args[1] = current_buffer->name; | 5525 | args[1] = current_buffer->name; |
| 5520 | args[2] = Ferror_message_string (error); | 5526 | args[2] = Ferror_message_string (error); |
| @@ -5624,7 +5630,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5624 | old_message_p = push_message (); | 5630 | old_message_p = push_message (); |
| 5625 | record_unwind_protect (pop_message_unwind, Qnil); | 5631 | record_unwind_protect (pop_message_unwind, Qnil); |
| 5626 | } | 5632 | } |
| 5627 | 5633 | ||
| 5628 | /* Ordinarily don't quit within this function, | 5634 | /* Ordinarily don't quit within this function, |
| 5629 | but don't make it impossible to quit (in case we get hung in I/O). */ | 5635 | but don't make it impossible to quit (in case we get hung in I/O). */ |
| 5630 | oquit = Vquit_flag; | 5636 | oquit = Vquit_flag; |
| @@ -5639,7 +5645,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5639 | if (STRINGP (Vauto_save_list_file_name)) | 5645 | if (STRINGP (Vauto_save_list_file_name)) |
| 5640 | { | 5646 | { |
| 5641 | Lisp_Object listfile; | 5647 | Lisp_Object listfile; |
| 5642 | 5648 | ||
| 5643 | listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil); | 5649 | listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil); |
| 5644 | 5650 | ||
| 5645 | /* Don't try to create the directory when shutting down Emacs, | 5651 | /* Don't try to create the directory when shutting down Emacs, |
| @@ -5657,7 +5663,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5657 | do_auto_save_eh); | 5663 | do_auto_save_eh); |
| 5658 | UNGCPRO; | 5664 | UNGCPRO; |
| 5659 | } | 5665 | } |
| 5660 | 5666 | ||
| 5661 | stream = fopen (SDATA (listfile), "w"); | 5667 | stream = fopen (SDATA (listfile), "w"); |
| 5662 | if (stream != NULL) | 5668 | if (stream != NULL) |
| 5663 | { | 5669 | { |
| @@ -5953,7 +5959,7 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte | |||
| 5953 | #ifndef VMS | 5959 | #ifndef VMS |
| 5954 | if (EQ (Vread_file_name_predicate, Qfile_directory_p)) | 5960 | if (EQ (Vread_file_name_predicate, Qfile_directory_p)) |
| 5955 | { | 5961 | { |
| 5956 | /* Brute-force speed up for directory checking: | 5962 | /* Brute-force speed up for directory checking: |
| 5957 | Discard strings which don't end in a slash. */ | 5963 | Discard strings which don't end in a slash. */ |
| 5958 | for (comp = Qnil; CONSP (all); all = XCDR (all)) | 5964 | for (comp = Qnil; CONSP (all); all = XCDR (all)) |
| 5959 | { | 5965 | { |
| @@ -6003,7 +6009,7 @@ Default name to DEFAULT-FILENAME if user enters a null string. | |||
| 6003 | Fourth arg MUSTMATCH non-nil means require existing file's name. | 6009 | Fourth arg MUSTMATCH non-nil means require existing file's name. |
| 6004 | Non-nil and non-t means also require confirmation after completion. | 6010 | Non-nil and non-t means also require confirmation after completion. |
| 6005 | Fifth arg INITIAL specifies text to start with. | 6011 | Fifth arg INITIAL specifies text to start with. |
| 6006 | If optional sixth arg PREDICATE is non-nil, possible completions and the | 6012 | If optional sixth arg PREDICATE is non-nil, possible completions and the |
| 6007 | resulting file name must satisfy (funcall PREDICATE NAME). | 6013 | resulting file name must satisfy (funcall PREDICATE NAME). |
| 6008 | DIR defaults to current buffer's directory default. | 6014 | DIR defaults to current buffer's directory default. |
| 6009 | 6015 | ||
| @@ -6106,11 +6112,11 @@ provides a file dialog box. */) | |||
| 6106 | #endif | 6112 | #endif |
| 6107 | 6113 | ||
| 6108 | specbind (intern ("minibuffer-completing-file-name"), Qt); | 6114 | specbind (intern ("minibuffer-completing-file-name"), Qt); |
| 6109 | specbind (intern ("read-file-name-predicate"), | 6115 | specbind (intern ("read-file-name-predicate"), |
| 6110 | (NILP (predicate) ? Qfile_exists_p : predicate)); | 6116 | (NILP (predicate) ? Qfile_exists_p : predicate)); |
| 6111 | 6117 | ||
| 6112 | GCPRO2 (insdef, default_filename); | 6118 | GCPRO2 (insdef, default_filename); |
| 6113 | 6119 | ||
| 6114 | #if defined (USE_MOTIF) || defined (HAVE_NTGUI) | 6120 | #if defined (USE_MOTIF) || defined (HAVE_NTGUI) |
| 6115 | if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) | 6121 | if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) |
| 6116 | && use_dialog_box | 6122 | && use_dialog_box |
| @@ -6186,7 +6192,7 @@ provides a file dialog box. */) | |||
| 6186 | Fset (Qfile_name_history, | 6192 | Fset (Qfile_name_history, |
| 6187 | Fcons (val1, tem)); | 6193 | Fcons (val1, tem)); |
| 6188 | } | 6194 | } |
| 6189 | 6195 | ||
| 6190 | return val; | 6196 | return val; |
| 6191 | } | 6197 | } |
| 6192 | 6198 | ||
| @@ -6311,7 +6317,7 @@ same format as a regular save would use. */); | |||
| 6311 | staticpro (&Qformat_decode); | 6317 | staticpro (&Qformat_decode); |
| 6312 | Qformat_annotate_function = intern ("format-annotate-function"); | 6318 | Qformat_annotate_function = intern ("format-annotate-function"); |
| 6313 | staticpro (&Qformat_annotate_function); | 6319 | staticpro (&Qformat_annotate_function); |
| 6314 | 6320 | ||
| 6315 | Qcar_less_than_car = intern ("car-less-than-car"); | 6321 | Qcar_less_than_car = intern ("car-less-than-car"); |
| 6316 | staticpro (&Qcar_less_than_car); | 6322 | staticpro (&Qcar_less_than_car); |
| 6317 | 6323 | ||
| @@ -6483,4 +6489,3 @@ a non-nil value. */); | |||
| 6483 | defsubr (&Sunix_sync); | 6489 | defsubr (&Sunix_sync); |
| 6484 | #endif | 6490 | #endif |
| 6485 | } | 6491 | } |
| 6486 | |||