Mercurial > hg > xemacs-beta
comparison src/buffer.c @ 116:9f59509498e1 r20-1b10
Import from CVS: tag r20-1b10
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:23:06 +0200 |
parents | 8619ce7e4c50 |
children | cca96a509cfe |
comparison
equal
deleted
inserted
replaced
115:f109f7dabbe2 | 116:9f59509498e1 |
---|---|
1214 Any processes that have this buffer as the `process-buffer' are killed | 1214 Any processes that have this buffer as the `process-buffer' are killed |
1215 with `delete-process'. | 1215 with `delete-process'. |
1216 */ | 1216 */ |
1217 (bufname)) | 1217 (bufname)) |
1218 { | 1218 { |
1219 /* This function can GC */ | 1219 /* This function can call lisp */ |
1220 Lisp_Object buf; | 1220 Lisp_Object buf; |
1221 REGISTER struct buffer *b; | 1221 REGISTER struct buffer *b; |
1222 struct gcpro gcpro1, gcpro2; | 1222 struct gcpro gcpro1, gcpro2; |
1223 | 1223 |
1224 if (NILP (bufname)) | 1224 if (NILP (bufname)) |
1382 if (STRINGP (b->auto_save_file_name) | 1382 if (STRINGP (b->auto_save_file_name) |
1383 && b->auto_save_modified != 0 | 1383 && b->auto_save_modified != 0 |
1384 && BUF_SAVE_MODIFF (b) < b->auto_save_modified) | 1384 && BUF_SAVE_MODIFF (b) < b->auto_save_modified) |
1385 { | 1385 { |
1386 if (!NILP (Vdelete_auto_save_files)) | 1386 if (!NILP (Vdelete_auto_save_files)) |
1387 internal_delete_file (b->auto_save_file_name); | 1387 { |
1388 /* deleting the auto save file might kill b! */ | |
1389 /* #### dmoore - fix this crap, we do this same gcpro and | |
1390 buffer liveness check multiple times. Let's get a | |
1391 macro or something for it. */ | |
1392 GCPRO1 (buf); | |
1393 internal_delete_file (b->auto_save_file_name); | |
1394 UNGCPRO; | |
1395 b = XBUFFER (buf); | |
1396 | |
1397 if (!BUFFER_LIVE_P (b)) | |
1398 return Qnil; | |
1399 | |
1400 if (b == current_buffer) | |
1401 { | |
1402 Fset_buffer (Fother_buffer (buf, Qnil, Qnil)); | |
1403 if (b == current_buffer) | |
1404 return Qnil; | |
1405 } | |
1406 } | |
1388 } | 1407 } |
1389 | 1408 |
1390 uninit_buffer_markers (b); | 1409 uninit_buffer_markers (b); |
1391 | 1410 |
1392 kill_buffer_local_variables (b); | 1411 kill_buffer_local_variables (b); |