comparison src/insdel.c @ 484:3165b2697c78

entered into RCS
author Jim Blandy <jimb@redhat.com>
date Mon, 13 Jan 1992 21:48:03 +0000
parents 28d91bb8ac74
children 8dce1588f37f
comparison
equal deleted inserted replaced
483:00f564a647fa 484:3165b2697c78
212 register struct Lisp_Marker *m; 212 register struct Lisp_Marker *m;
213 register int mpos; 213 register int mpos;
214 214
215 marker = current_buffer->markers; 215 marker = current_buffer->markers;
216 216
217 while (!NULL (marker)) 217 while (!NILP (marker))
218 { 218 {
219 m = XMARKER (marker); 219 m = XMARKER (marker);
220 mpos = m->bufpos; 220 mpos = m->bufpos;
221 if (amount > 0) 221 if (amount > 0)
222 { 222 {
350 350
351 GAP_SIZE -= length; 351 GAP_SIZE -= length;
352 GPT += length; 352 GPT += length;
353 ZV += length; 353 ZV += length;
354 Z += length; 354 Z += length;
355 point += length; 355 SET_PT (point + length);
356 356
357 signal_after_change (point-length, 0, length); 357 signal_after_change (point-length, 0, length);
358 } 358 }
359 359
360 /* Insert the character C before point */ 360 /* Insert the character C before point */
471 Run the before-change-function, if any. */ 471 Run the before-change-function, if any. */
472 472
473 prepare_to_modify_buffer (start, end) 473 prepare_to_modify_buffer (start, end)
474 Lisp_Object start, end; 474 Lisp_Object start, end;
475 { 475 {
476 if (!NULL (current_buffer->read_only)) 476 if (!NILP (current_buffer->read_only))
477 Fbarf_if_buffer_read_only (); 477 Fbarf_if_buffer_read_only ();
478 478
479 if (check_protected_fields) 479 if (check_protected_fields)
480 Fregion_fields (start, end, Qnil, Qt); 480 Fregion_fields (start, end, Qnil, Qt);
481 481
482 #ifdef CLASH_DETECTION 482 #ifdef CLASH_DETECTION
483 if (!NULL (current_buffer->filename) 483 if (!NILP (current_buffer->filename)
484 && current_buffer->save_modified >= MODIFF) 484 && current_buffer->save_modified >= MODIFF)
485 lock_file (current_buffer->filename); 485 lock_file (current_buffer->filename);
486 #else 486 #else
487 /* At least warn if this file has changed on disk since it was visited. */ 487 /* At least warn if this file has changed on disk since it was visited. */
488 if (!NULL (current_buffer->filename) 488 if (!NILP (current_buffer->filename)
489 && current_buffer->save_modified >= MODIFF 489 && current_buffer->save_modified >= MODIFF
490 && NULL (Fverify_visited_file_modtime (Fcurrent_buffer ())) 490 && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ()))
491 && !NULL (Ffile_exists_p (current_buffer->filename))) 491 && !NILP (Ffile_exists_p (current_buffer->filename)))
492 call1 (intern ("ask-user-about-supersession-threat"), 492 call1 (intern ("ask-user-about-supersession-threat"),
493 current_buffer->filename); 493 current_buffer->filename);
494 #endif /* not CLASH_DETECTION */ 494 #endif /* not CLASH_DETECTION */
495 495
496 signal_before_change (start, end); 496 signal_before_change (start, end);
517 signal_before_change (start, end) 517 signal_before_change (start, end)
518 Lisp_Object start, end; 518 Lisp_Object start, end;
519 { 519 {
520 /* If buffer is unmodified, run a special hook for that case. */ 520 /* If buffer is unmodified, run a special hook for that case. */
521 if (current_buffer->save_modified >= MODIFF 521 if (current_buffer->save_modified >= MODIFF
522 && !NULL (Vfirst_change_function)) 522 && !NILP (Vfirst_change_function))
523 { 523 {
524 call0 (Vfirst_change_function); 524 call0 (Vfirst_change_function);
525 } 525 }
526 /* Now in any case run the before-change-function if any. */ 526 /* Now in any case run the before-change-function if any. */
527 if (!NULL (Vbefore_change_function)) 527 if (!NILP (Vbefore_change_function))
528 { 528 {
529 int count = specpdl_ptr - specpdl; 529 int count = specpdl_ptr - specpdl;
530 Lisp_Object function; 530 Lisp_Object function;
531 531
532 function = Vbefore_change_function; 532 function = Vbefore_change_function;
549 LENINS is the number of characters in the changed text. */ 549 LENINS is the number of characters in the changed text. */
550 550
551 signal_after_change (pos, lendel, lenins) 551 signal_after_change (pos, lendel, lenins)
552 int pos, lendel, lenins; 552 int pos, lendel, lenins;
553 { 553 {
554 if (!NULL (Vafter_change_function)) 554 if (!NILP (Vafter_change_function))
555 { 555 {
556 int count = specpdl_ptr - specpdl; 556 int count = specpdl_ptr - specpdl;
557 Lisp_Object function; 557 Lisp_Object function;
558 function = Vafter_change_function; 558 function = Vafter_change_function;
559 559