aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-01-02 09:21:30 +0000
committerRichard M. Stallman1995-01-02 09:21:30 +0000
commit9fbf87cd52ef07535816bc7e0170f71c782da2d7 (patch)
tree0f8f1d657b66dede24c97ef3309b960bd92ba102 /src
parentc1ea566e860d52b74c56c2979282f90694818d69 (diff)
downloademacs-9fbf87cd52ef07535816bc7e0170f71c782da2d7.tar.gz
emacs-9fbf87cd52ef07535816bc7e0170f71c782da2d7.zip
Use SAVE_MODIFF and BUF_SAVE_MODIFF
instead of direct access to the save_modiff field. (insert_1, prepare_to_modify_buffer, insert_from_buffer_1): Use BUF_INTERVALS. (adjust_markers): Use BUF_MARKERS. (adjust_point): Use BUF_PT.
Diffstat (limited to 'src')
-rw-r--r--src/insdel.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 1113e9bfb24..7a64ec54a15 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -221,7 +221,7 @@ adjust_markers (from, to, amount)
221 register struct Lisp_Marker *m; 221 register struct Lisp_Marker *m;
222 register int mpos; 222 register int mpos;
223 223
224 marker = current_buffer->markers; 224 marker = BUF_MARKERS (current_buffer);
225 225
226 while (!NILP (marker)) 226 while (!NILP (marker))
227 { 227 {
@@ -254,7 +254,7 @@ adjust_markers (from, to, amount)
254static void 254static void
255adjust_point (amount) 255adjust_point (amount)
256{ 256{
257 current_buffer->text.pt += amount; 257 BUF_PT (current_buffer) += amount;
258} 258}
259 259
260/* Make the gap INCREMENT characters longer. */ 260/* Make the gap INCREMENT characters longer. */
@@ -357,7 +357,7 @@ insert_1 (string, length, inherit)
357 bcopy (string, GPT_ADDR, length); 357 bcopy (string, GPT_ADDR, length);
358 358
359#ifdef USE_TEXT_PROPERTIES 359#ifdef USE_TEXT_PROPERTIES
360 if (current_buffer->intervals != 0) 360 if (BUF_INTERVALS (current_buffer) != 0)
361 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES. */ 361 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES. */
362 offset_intervals (current_buffer, PT, length); 362 offset_intervals (current_buffer, PT, length);
363#endif 363#endif
@@ -369,7 +369,7 @@ insert_1 (string, length, inherit)
369 adjust_point (length); 369 adjust_point (length);
370 370
371#ifdef USE_TEXT_PROPERTIES 371#ifdef USE_TEXT_PROPERTIES
372 if (!inherit && current_buffer->intervals != 0) 372 if (!inherit && BUF_INTERVALS (current_buffer) != 0)
373 Fset_text_properties (make_number (PT - length), make_number (PT), 373 Fset_text_properties (make_number (PT - length), make_number (PT),
374 Qnil, Qnil); 374 Qnil, Qnil);
375#endif 375#endif
@@ -497,7 +497,7 @@ insert_from_buffer_1 (buf, pos, length, inherit)
497 GPT_ADDR + chunk, length - chunk); 497 GPT_ADDR + chunk, length - chunk);
498 498
499#ifdef USE_TEXT_PROPERTIES 499#ifdef USE_TEXT_PROPERTIES
500 if (current_buffer->intervals != 0) 500 if (BUF_INTERVALS (current_buffer) != 0)
501 offset_intervals (current_buffer, PT, length); 501 offset_intervals (current_buffer, PT, length);
502#endif 502#endif
503 503
@@ -508,7 +508,8 @@ insert_from_buffer_1 (buf, pos, length, inherit)
508 adjust_point (length); 508 adjust_point (length);
509 509
510 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */ 510 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
511 graft_intervals_into_buffer (copy_intervals (buf->intervals, pos, length), 511 graft_intervals_into_buffer (copy_intervals (BUF_INTERVALS (buf),
512 pos, length),
512 PT - length, length, current_buffer, inherit); 513 PT - length, length, current_buffer, inherit);
513} 514}
514 515
@@ -660,7 +661,7 @@ modify_region (buffer, start, end)
660 || unchanged_modified == MODIFF) 661 || unchanged_modified == MODIFF)
661 end_unchanged = Z - end; 662 end_unchanged = Z - end;
662 663
663 if (MODIFF <= current_buffer->save_modified) 664 if (MODIFF <= SAVE_MODIFF)
664 record_first_change (); 665 record_first_change ();
665 MODIFF++; 666 MODIFF++;
666 667
@@ -680,17 +681,17 @@ prepare_to_modify_buffer (start, end)
680 Fbarf_if_buffer_read_only (); 681 Fbarf_if_buffer_read_only ();
681 682
682 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */ 683 /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
683 if (current_buffer->intervals != 0) 684 if (BUF_INTERVALS (current_buffer) != 0)
684 verify_interval_modification (current_buffer, start, end); 685 verify_interval_modification (current_buffer, start, end);
685 686
686#ifdef CLASH_DETECTION 687#ifdef CLASH_DETECTION
687 if (!NILP (current_buffer->filename) 688 if (!NILP (current_buffer->filename)
688 && current_buffer->save_modified >= MODIFF) 689 && SAVE_MODIFF >= MODIFF)
689 lock_file (current_buffer->filename); 690 lock_file (current_buffer->filename);
690#else 691#else
691 /* At least warn if this file has changed on disk since it was visited. */ 692 /* At least warn if this file has changed on disk since it was visited. */
692 if (!NILP (current_buffer->filename) 693 if (!NILP (current_buffer->filename)
693 && current_buffer->save_modified >= MODIFF 694 && SAVE_MODIFF >= MODIFF
694 && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ())) 695 && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ()))
695 && !NILP (Ffile_exists_p (current_buffer->filename))) 696 && !NILP (Ffile_exists_p (current_buffer->filename)))
696 call1 (intern ("ask-user-about-supersession-threat"), 697 call1 (intern ("ask-user-about-supersession-threat"),
@@ -747,7 +748,7 @@ signal_before_change (start, end)
747 Lisp_Object start, end; 748 Lisp_Object start, end;
748{ 749{
749 /* If buffer is unmodified, run a special hook for that case. */ 750 /* If buffer is unmodified, run a special hook for that case. */
750 if (current_buffer->save_modified >= MODIFF 751 if (SAVE_MODIFF >= MODIFF
751 && !NILP (Vfirst_change_hook) 752 && !NILP (Vfirst_change_hook)
752 && !NILP (Vrun_hooks)) 753 && !NILP (Vrun_hooks))
753 call1 (Vrun_hooks, Qfirst_change_hook); 754 call1 (Vrun_hooks, Qfirst_change_hook);