diff options
| author | Richard M. Stallman | 2003-12-28 22:16:57 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-12-28 22:16:57 +0000 |
| commit | d674d13e14107bdc860391e08b724310f752235e (patch) | |
| tree | 09914471a3b7f89ee977e7b0a45779f3eb62e986 /src/buffer.c | |
| parent | de1d1a4051f79922534ae266a5c0a441e86954f7 (diff) | |
| download | emacs-d674d13e14107bdc860391e08b724310f752235e.tar.gz emacs-d674d13e14107bdc860391e08b724310f752235e.zip | |
(Fother_buffer): Don't crash if BUF is nil
or if its name is nil.
(Fkill_buffer): Don't delete auto-save file
if it's the same as the visited file.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c index e41d114eaa3..533e2c9c506 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -89,10 +89,6 @@ static Lisp_Object Vbuffer_defaults; | |||
| 89 | If a slot is -2, then there is no DEFVAR_PER_BUFFER for it, | 89 | If a slot is -2, then there is no DEFVAR_PER_BUFFER for it, |
| 90 | but there is a default value which is copied into each buffer. | 90 | but there is a default value which is copied into each buffer. |
| 91 | 91 | ||
| 92 | If a slot in this structure is negative, then even though there may | ||
| 93 | be a DEFVAR_PER_BUFFER for the slot, there is no default value for it; | ||
| 94 | and the corresponding slot in buffer_defaults is not used. | ||
| 95 | |||
| 96 | If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is | 92 | If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is |
| 97 | zero, that is a bug */ | 93 | zero, that is a bug */ |
| 98 | 94 | ||
| @@ -1202,6 +1198,10 @@ If BUFFER is omitted or nil, some interesting buffer is returned. */) | |||
| 1202 | buf = Fcdr (XCAR (tail)); | 1198 | buf = Fcdr (XCAR (tail)); |
| 1203 | if (EQ (buf, buffer)) | 1199 | if (EQ (buf, buffer)) |
| 1204 | continue; | 1200 | continue; |
| 1201 | if (NILP (buf)) | ||
| 1202 | continue; | ||
| 1203 | if (NILP (XBUFFER (buf)->name)) | ||
| 1204 | continue; | ||
| 1205 | if (SREF (XBUFFER (buf)->name, 0) == ' ') | 1205 | if (SREF (XBUFFER (buf)->name, 0) == ' ') |
| 1206 | continue; | 1206 | continue; |
| 1207 | /* If the selected frame has a buffer_predicate, | 1207 | /* If the selected frame has a buffer_predicate, |
| @@ -1429,7 +1429,8 @@ with SIGHUP. */) | |||
| 1429 | if (STRINGP (b->auto_save_file_name) | 1429 | if (STRINGP (b->auto_save_file_name) |
| 1430 | && b->auto_save_modified != 0 | 1430 | && b->auto_save_modified != 0 |
| 1431 | && BUF_SAVE_MODIFF (b) < b->auto_save_modified | 1431 | && BUF_SAVE_MODIFF (b) < b->auto_save_modified |
| 1432 | && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) | 1432 | && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) |
| 1433 | && NILP (Fsymbol_value (intern ("auto-save-visited-file-name")))) | ||
| 1433 | { | 1434 | { |
| 1434 | Lisp_Object tem; | 1435 | Lisp_Object tem; |
| 1435 | tem = Fsymbol_value (intern ("delete-auto-save-files")); | 1436 | tem = Fsymbol_value (intern ("delete-auto-save-files")); |