Commit 8449a569 authored by Karl Heuer's avatar Karl Heuer
Browse files

(signal_before_change): Use Frun_hook_with_args.

(signal_after_change): Likewise.
parent b0b667cb
...@@ -777,6 +777,8 @@ void ...@@ -777,6 +777,8 @@ void
signal_before_change (start, end) signal_before_change (start, end)
Lisp_Object start, end; Lisp_Object start, end;
{ {
Lisp_Object args[2];
/* If buffer is unmodified, run a special hook for that case. */ /* If buffer is unmodified, run a special hook for that case. */
if (SAVE_MODIFF >= MODIFF if (SAVE_MODIFF >= MODIFF
&& !NILP (Vfirst_change_hook) && !NILP (Vfirst_change_hook)
...@@ -829,11 +831,9 @@ signal_before_change (start, end) ...@@ -829,11 +831,9 @@ signal_before_change (start, end)
Vafter_change_functions = Qnil; Vafter_change_functions = Qnil;
Vbefore_change_functions = Qnil; Vbefore_change_functions = Qnil;
while (CONSP (functions)) args[0] = start;
{ args[1] = end;
call2 (XCONS (functions)->car, start, end); Frun_hook_with_args (intern ("before-change-functions"), 2, args);
functions = XCONS (functions)->cdr;
}
unbind_to (count, Qnil); unbind_to (count, Qnil);
} }
...@@ -854,6 +854,8 @@ void ...@@ -854,6 +854,8 @@ void
signal_after_change (pos, lendel, lenins) signal_after_change (pos, lendel, lenins)
int pos, lendel, lenins; int pos, lendel, lenins;
{ {
Lisp_Object args[3];
if (!NILP (Vafter_change_function)) if (!NILP (Vafter_change_function))
{ {
int count = specpdl_ptr - specpdl; int count = specpdl_ptr - specpdl;
...@@ -896,13 +898,10 @@ signal_after_change (pos, lendel, lenins) ...@@ -896,13 +898,10 @@ signal_after_change (pos, lendel, lenins)
Vafter_change_functions = Qnil; Vafter_change_functions = Qnil;
Vbefore_change_functions = Qnil; Vbefore_change_functions = Qnil;
while (CONSP (functions)) XSETFASTINT (args[0], pos);
{ XSETFASTINT (args[1], pos + lenins);
call3 (XCONS (functions)->car, XSETFASTINT (args[2], lendel);
make_number (pos), make_number (pos + lenins), Frun_hook_with_args (intern ("after-change-functions"), 3, args);
make_number (lendel));
functions = XCONS (functions)->cdr;
}
unbind_to (count, Qnil); unbind_to (count, Qnil);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment