diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/fileio.c | 27 |
2 files changed, 21 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ce45e97514f..a38c3f7baeb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2004-11-05 Kim F. Storm <storm@cua.dk> | 1 | 2004-11-05 Kim F. Storm <storm@cua.dk> |
| 2 | 2 | ||
| 3 | * fileio.c (Ffile_modes): Doc fix. | ||
| 4 | (auto_save_1): Check for Ffile_modes nil value. | ||
| 5 | |||
| 6 | 2004-11-05 Kim F. Storm <storm@cua.dk> | ||
| 7 | |||
| 3 | * xselect.c (struct selection_event_queue, selection_queue) | 8 | * xselect.c (struct selection_event_queue, selection_queue) |
| 4 | (x_queue_selection_requests, x_queue_event) | 9 | (x_queue_selection_requests, x_queue_event) |
| 5 | (x_start_queuing_selection_requests) | 10 | (x_start_queuing_selection_requests) |
diff --git a/src/fileio.c b/src/fileio.c index 4b5f4942566..aa37c296eb3 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3366,7 +3366,8 @@ This is the sort of file that holds an ordinary stream of data bytes. */) | |||
| 3366 | } | 3366 | } |
| 3367 | 3367 | ||
| 3368 | DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0, | 3368 | DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0, |
| 3369 | doc: /* Return mode bits of file named FILENAME, as an integer. */) | 3369 | doc: /* Return mode bits of file named FILENAME, as an integer. |
| 3370 | Return nil, if file does not exist or is not accessible. */) | ||
| 3370 | (filename) | 3371 | (filename) |
| 3371 | Lisp_Object filename; | 3372 | Lisp_Object filename; |
| 3372 | { | 3373 | { |
| @@ -5712,17 +5713,21 @@ Lisp_Object | |||
| 5712 | auto_save_1 () | 5713 | auto_save_1 () |
| 5713 | { | 5714 | { |
| 5714 | struct stat st; | 5715 | struct stat st; |
| 5716 | Lisp_Object modes; | ||
| 5717 | |||
| 5718 | auto_save_mode_bits = 0666; | ||
| 5715 | 5719 | ||
| 5716 | /* Get visited file's mode to become the auto save file's mode. */ | 5720 | /* Get visited file's mode to become the auto save file's mode. */ |
| 5717 | if (! NILP (current_buffer->filename) | 5721 | if (! NILP (current_buffer->filename)) |
| 5718 | && stat (SDATA (current_buffer->filename), &st) >= 0) | 5722 | { |
| 5719 | /* But make sure we can overwrite it later! */ | 5723 | if (stat (SDATA (current_buffer->filename), &st) >= 0) |
| 5720 | auto_save_mode_bits = st.st_mode | 0600; | 5724 | /* But make sure we can overwrite it later! */ |
| 5721 | else if (! NILP (current_buffer->filename)) | 5725 | auto_save_mode_bits = st.st_mode | 0600; |
| 5722 | /* Remote files don't cooperate with stat. */ | 5726 | else if ((modes = Ffile_modes (current_buffer->filename), |
| 5723 | auto_save_mode_bits = XINT (Ffile_modes (current_buffer->filename)) | 0600; | 5727 | INTEGERP (modes))) |
| 5724 | else | 5728 | /* Remote files don't cooperate with stat. */ |
| 5725 | auto_save_mode_bits = 0666; | 5729 | auto_save_mode_bits = XINT (modes) | 0600; |
| 5730 | } | ||
| 5726 | 5731 | ||
| 5727 | return | 5732 | return |
| 5728 | Fwrite_region (Qnil, Qnil, | 5733 | Fwrite_region (Qnil, Qnil, |
| @@ -6190,7 +6195,7 @@ before any other event (mouse or keypress) is handeled. */) | |||
| 6190 | #endif | 6195 | #endif |
| 6191 | return Qnil; | 6196 | return Qnil; |
| 6192 | } | 6197 | } |
| 6193 | 6198 | ||
| 6194 | DEFUN ("read-file-name", Fread_file_name, Sread_file_name, 1, 6, 0, | 6199 | DEFUN ("read-file-name", Fread_file_name, Sread_file_name, 1, 6, 0, |
| 6195 | doc: /* Read file name, prompting with PROMPT and completing in directory DIR. | 6200 | doc: /* Read file name, prompting with PROMPT and completing in directory DIR. |
| 6196 | Value is not expanded---you must call `expand-file-name' yourself. | 6201 | Value is not expanded---you must call `expand-file-name' yourself. |