Mercurial > hg > xemacs-beta
comparison src/insdel.c @ 40:7e54bd776075 r19-15b103
Import from CVS: tag r19-15b103
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:54:25 +0200 |
parents | 9ee227acff29 |
children | 56c54cf7c5b6 |
comparison
equal
deleted
inserted
replaced
39:06f275776fba | 40:7e54bd776075 |
---|---|
1372 static void | 1372 static void |
1373 prepare_to_modify_buffer (struct buffer *buf, Bufpos start, Bufpos end, | 1373 prepare_to_modify_buffer (struct buffer *buf, Bufpos start, Bufpos end, |
1374 int lockit) | 1374 int lockit) |
1375 { | 1375 { |
1376 /* This function can GC */ | 1376 /* This function can GC */ |
1377 /* dmoore - This function can also kill the buffer buf, the current | |
1378 buffer, and do anything it pleases. So if you call it, be | |
1379 careful. */ | |
1380 Lisp_Object buffer; | |
1381 struct gcpro gcpro1; | |
1382 | |
1377 barf_if_buffer_read_only (buf, start, end); | 1383 barf_if_buffer_read_only (buf, start, end); |
1378 | 1384 |
1379 /* if this is the first modification, see about locking the buffer's | 1385 /* if this is the first modification, see about locking the buffer's |
1380 file */ | 1386 file */ |
1387 XSETBUFFER (buffer, buf); | |
1388 GCPRO1 (buffer); | |
1381 if (!NILP (buf->filename) && lockit && | 1389 if (!NILP (buf->filename) && lockit && |
1382 BUF_SAVE_MODIFF (buf) >= BUF_MODIFF (buf)) | 1390 BUF_SAVE_MODIFF (buf) >= BUF_MODIFF (buf)) |
1383 { | 1391 { |
1384 #ifdef CLASH_DETECTION | 1392 #ifdef CLASH_DETECTION |
1385 if (!NILP (buf->file_truename)) | 1393 if (!NILP (buf->file_truename)) |
1386 /* Make binding buffer-file-name to nil effective. */ | 1394 /* Make binding buffer-file-name to nil effective. */ |
1387 lock_file (buf->file_truename); | 1395 lock_file (buf->file_truename); |
1388 #else | 1396 #else |
1389 Lisp_Object buffer; | |
1390 XSETBUFFER (buffer, buf); | |
1391 /* At least warn if this file has changed on disk since it was visited.*/ | 1397 /* At least warn if this file has changed on disk since it was visited.*/ |
1392 if (NILP (Fverify_visited_file_modtime (buffer)) | 1398 if (NILP (Fverify_visited_file_modtime (buffer)) |
1393 && !NILP (Ffile_exists_p (buf->filename))) | 1399 && !NILP (Ffile_exists_p (buf->filename))) |
1394 call1_in_buffer (buf, intern ("ask-user-about-supersession-threat"), | 1400 call1_in_buffer (buf, intern ("ask-user-about-supersession-threat"), |
1395 buf->filename); | 1401 buf->filename); |
1396 #endif /* not CLASH_DETECTION */ | 1402 #endif /* not CLASH_DETECTION */ |
1397 } | 1403 } |
1404 UNGCPRO; | |
1405 | |
1406 /* #### dmoore - is this reasonable in case of buf being killed above? */ | |
1407 if (!BUFFER_LIVE_P (buf)) | |
1408 return; | |
1398 | 1409 |
1399 signal_before_change (buf, start, end); | 1410 signal_before_change (buf, start, end); |
1400 | 1411 |
1401 #ifdef REGION_CACHE_NEEDS_WORK | 1412 #ifdef REGION_CACHE_NEEDS_WORK |
1402 if (buf->newline_cache) | 1413 if (buf->newline_cache) |