aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-07-25 19:57:02 +0000
committerKarl Heuer1995-07-25 19:57:02 +0000
commit8449a569e14065e098af1933832c1570b7d7d244 (patch)
treecfaa6b31493183a61390b843cf2465bd06e08fea /src
parentb0b667cb9012ff1b99b16bf5179278580dfb6835 (diff)
downloademacs-8449a569e14065e098af1933832c1570b7d7d244.tar.gz
emacs-8449a569e14065e098af1933832c1570b7d7d244.zip
(signal_before_change): Use Frun_hook_with_args.
(signal_after_change): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/insdel.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/insdel.c b/src/insdel.c
index c6ff136602c..c486715df96 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -777,6 +777,8 @@ void
777signal_before_change (start, end) 777signal_before_change (start, end)
778 Lisp_Object start, end; 778 Lisp_Object start, end;
779{ 779{
780 Lisp_Object args[2];
781
780 /* If buffer is unmodified, run a special hook for that case. */ 782 /* If buffer is unmodified, run a special hook for that case. */
781 if (SAVE_MODIFF >= MODIFF 783 if (SAVE_MODIFF >= MODIFF
782 && !NILP (Vfirst_change_hook) 784 && !NILP (Vfirst_change_hook)
@@ -829,11 +831,9 @@ signal_before_change (start, end)
829 Vafter_change_functions = Qnil; 831 Vafter_change_functions = Qnil;
830 Vbefore_change_functions = Qnil; 832 Vbefore_change_functions = Qnil;
831 833
832 while (CONSP (functions)) 834 args[0] = start;
833 { 835 args[1] = end;
834 call2 (XCONS (functions)->car, start, end); 836 Frun_hook_with_args (intern ("before-change-functions"), 2, args);
835 functions = XCONS (functions)->cdr;
836 }
837 unbind_to (count, Qnil); 837 unbind_to (count, Qnil);
838 } 838 }
839 839
@@ -854,6 +854,8 @@ void
854signal_after_change (pos, lendel, lenins) 854signal_after_change (pos, lendel, lenins)
855 int pos, lendel, lenins; 855 int pos, lendel, lenins;
856{ 856{
857 Lisp_Object args[3];
858
857 if (!NILP (Vafter_change_function)) 859 if (!NILP (Vafter_change_function))
858 { 860 {
859 int count = specpdl_ptr - specpdl; 861 int count = specpdl_ptr - specpdl;
@@ -896,13 +898,10 @@ signal_after_change (pos, lendel, lenins)
896 Vafter_change_functions = Qnil; 898 Vafter_change_functions = Qnil;
897 Vbefore_change_functions = Qnil; 899 Vbefore_change_functions = Qnil;
898 900
899 while (CONSP (functions)) 901 XSETFASTINT (args[0], pos);
900 { 902 XSETFASTINT (args[1], pos + lenins);
901 call3 (XCONS (functions)->car, 903 XSETFASTINT (args[2], lendel);
902 make_number (pos), make_number (pos + lenins), 904 Frun_hook_with_args (intern ("after-change-functions"), 3, args);
903 make_number (lendel));
904 functions = XCONS (functions)->cdr;
905 }
906 unbind_to (count, Qnil); 905 unbind_to (count, Qnil);
907 } 906 }
908 907