comparison src/buffer.c @ 53350:89a24e997838

(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.
author Richard M. Stallman <rms@gnu.org>
date Sun, 28 Dec 2003 22:16:57 +0000
parents efa9d19d170e
children 4c14b3c50a31 b2b37c85b00a
comparison
equal deleted inserted replaced
53349:9e21566a15df 53350:89a24e997838
86 be a DEFVAR_PER_BUFFER for the slot, there is no default value for it; 86 be a DEFVAR_PER_BUFFER for the slot, there is no default value for it;
87 and the corresponding slot in buffer_defaults is not used. 87 and the corresponding slot in buffer_defaults is not used.
88 88
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
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 91
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
99 struct buffer buffer_local_flags; 95 struct buffer buffer_local_flags;
1200 for (; CONSP (tail); tail = XCDR (tail)) 1196 for (; CONSP (tail); tail = XCDR (tail))
1201 { 1197 {
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,
1208 disregard buffers that don't fit the predicate. */ 1208 disregard buffers that don't fit the predicate. */
1209 if (!NILP (pred)) 1209 if (!NILP (pred))
1427 /* Delete any auto-save file, if we saved it in this session. 1427 /* Delete any auto-save file, if we saved it in this session.
1428 But not if the buffer is modified. */ 1428 But not if the buffer is modified. */
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"));
1436 if (! NILP (tem)) 1437 if (! NILP (tem))
1437 internal_delete_file (b->auto_save_file_name); 1438 internal_delete_file (b->auto_save_file_name);