comparison src/buffer.c @ 44:8d2a9b52c682 r19-15prefinal

Import from CVS: tag r19-15prefinal
author cvs
date Mon, 13 Aug 2007 08:55:10 +0200
parents 7e54bd776075
children 56c54cf7c5b6
comparison
equal deleted inserted replaced
43:23cafc5d2038 44:8d2a9b52c682
1208 Any processes that have this buffer as the `process-buffer' are killed 1208 Any processes that have this buffer as the `process-buffer' are killed
1209 with `delete-process'. 1209 with `delete-process'.
1210 */ 1210 */
1211 (bufname)) 1211 (bufname))
1212 { 1212 {
1213 /* This function can GC */ 1213 /* This function can call lisp */
1214 Lisp_Object buf; 1214 Lisp_Object buf;
1215 REGISTER struct buffer *b; 1215 REGISTER struct buffer *b;
1216 struct gcpro gcpro1, gcpro2; 1216 struct gcpro gcpro1, gcpro2;
1217 1217
1218 if (NILP (bufname)) 1218 if (NILP (bufname))
1376 if (STRINGP (b->auto_save_file_name) 1376 if (STRINGP (b->auto_save_file_name)
1377 && b->auto_save_modified != 0 1377 && b->auto_save_modified != 0
1378 && BUF_SAVE_MODIFF (b) < b->auto_save_modified) 1378 && BUF_SAVE_MODIFF (b) < b->auto_save_modified)
1379 { 1379 {
1380 if (!NILP (Vdelete_auto_save_files)) 1380 if (!NILP (Vdelete_auto_save_files))
1381 internal_delete_file (b->auto_save_file_name); 1381 {
1382 /* deleting the auto save file might kill b! */
1383 /* #### dmoore - fix this crap, we do this same gcpro and
1384 buffer liveness check multiple times. Let's get a
1385 macro or something for it. */
1386 GCPRO1 (buf);
1387 internal_delete_file (b->auto_save_file_name);
1388 UNGCPRO;
1389 b = XBUFFER (buf);
1390
1391 if (!BUFFER_LIVE_P (b))
1392 return Qnil;
1393
1394 if (b == current_buffer)
1395 {
1396 Fset_buffer (Fother_buffer (buf, Qnil, Qnil));
1397 if (b == current_buffer)
1398 return Qnil;
1399 }
1400 }
1382 } 1401 }
1383 1402
1384 uninit_buffer_markers (b); 1403 uninit_buffer_markers (b);
1385 1404
1386 kill_buffer_local_variables (b); 1405 kill_buffer_local_variables (b);