diff options
author | Karl Heuer <kwzh@gnu.org> | 1995-07-25 19:57:02 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1995-07-25 19:57:02 +0000 |
commit | 8449a569e14065e098af1933832c1570b7d7d244 (patch) | |
tree | cfaa6b31493183a61390b843cf2465bd06e08fea /src/insdel.c | |
parent | b0b667cb9012ff1b99b16bf5179278580dfb6835 (diff) | |
download | emacs-8449a569e14065e098af1933832c1570b7d7d244.tar.gz |
(signal_before_change): Use Frun_hook_with_args.
(signal_after_change): Likewise.
Diffstat (limited to 'src/insdel.c')
-rw-r--r-- | src/insdel.c | 23 |
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 signal_before_change (start, end) Lisp_Object start, end; { + Lisp_Object args[2]; + /* If buffer is unmodified, run a special hook for that case. */ if (SAVE_MODIFF >= MODIFF && !NILP (Vfirst_change_hook) @@ -829,11 +831,9 @@ signal_before_change (start, end) Vafter_change_functions = Qnil; Vbefore_change_functions = Qnil; - while (CONSP (functions)) - { - call2 (XCONS (functions)->car, start, end); - functions = XCONS (functions)->cdr; - } + args[0] = start; + args[1] = end; + Frun_hook_with_args (intern ("before-change-functions"), 2, args); unbind_to (count, Qnil); } @@ -854,6 +854,8 @@ void signal_after_change (pos, lendel, lenins) int pos, lendel, lenins; { + Lisp_Object args[3]; + if (!NILP (Vafter_change_function)) { int count = specpdl_ptr - specpdl; @@ -896,13 +898,10 @@ signal_after_change (pos, lendel, lenins) Vafter_change_functions = Qnil; Vbefore_change_functions = Qnil; - while (CONSP (functions)) - { - call3 (XCONS (functions)->car, - make_number (pos), make_number (pos + lenins), - make_number (lendel)); - functions = XCONS (functions)->cdr; - } + XSETFASTINT (args[0], pos); + XSETFASTINT (args[1], pos + lenins); + XSETFASTINT (args[2], lendel); + Frun_hook_with_args (intern ("after-change-functions"), 3, args); unbind_to (count, Qnil); } |