Mercurial > emacs
comparison src/insdel.c @ 12655:3469b3194164
(signal_before_change): Use Frun_hook_with_args.
(signal_after_change): Likewise.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 25 Jul 1995 19:57:02 +0000 |
parents | e71c530e5ae5 |
children | 0dea0aa2f32d |
comparison
equal
deleted
inserted
replaced
12654:14721fd8dcc1 | 12655:3469b3194164 |
---|---|
775 | 775 |
776 void | 776 void |
777 signal_before_change (start, end) | 777 signal_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) |
783 && !NILP (Vrun_hooks)) | 785 && !NILP (Vrun_hooks)) |
784 call1 (Vrun_hooks, Qfirst_change_hook); | 786 call1 (Vrun_hooks, Qfirst_change_hook); |
827 Vafter_change_function = Qnil; | 829 Vafter_change_function = Qnil; |
828 Vbefore_change_function = Qnil; | 830 Vbefore_change_function = Qnil; |
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 |
840 if (!NILP (current_buffer->overlays_before) | 840 if (!NILP (current_buffer->overlays_before) |
841 || !NILP (current_buffer->overlays_after)) | 841 || !NILP (current_buffer->overlays_after)) |
852 | 852 |
853 void | 853 void |
854 signal_after_change (pos, lendel, lenins) | 854 signal_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; |
860 Lisp_Object function; | 862 Lisp_Object function; |
861 function = Vafter_change_function; | 863 function = Vafter_change_function; |
894 Vafter_change_function = Qnil; | 896 Vafter_change_function = Qnil; |
895 Vbefore_change_function = Qnil; | 897 Vbefore_change_function = Qnil; |
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 |
909 if (!NILP (current_buffer->overlays_before) | 908 if (!NILP (current_buffer->overlays_before) |
910 || !NILP (current_buffer->overlays_after)) | 909 || !NILP (current_buffer->overlays_after)) |