From: Dmitry Antipov Date: Tue, 5 Aug 2014 05:43:35 +0000 (+0400) Subject: * keyboard.c (safe_run_hooks): Follow the convenient style to bind X-Git-Tag: emacs-25.0.90~2635^2~679^2~526 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=697c09e934c85b26ae9b0a50067b02ffff9be650;p=emacs.git * keyboard.c (safe_run_hooks): Follow the convenient style to bind inhibit-quit to t and pass 2 args to safe_run_hook_funcall. See . (safe_run_hook_funcall): Adjust accordingly. --- diff --git a/src/ChangeLog b/src/ChangeLog index e936863ce1d..d08cf69af8e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2014-08-05 Dmitry Antipov + + * keyboard.c (safe_run_hooks): Follow the convenient style to bind + inhibit-quit to t and pass 2 args to safe_run_hook_funcall. See + . + (safe_run_hook_funcall): Adjust accordingly. + 2014-08-04 Martin Rudalics * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS): Condition diff --git a/src/keyboard.c b/src/keyboard.c index dd7e084783d..8a6385301c4 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1910,18 +1910,14 @@ static Lisp_Object safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args) { Lisp_Object iargs[2]; - struct gcpro gcpro1; - eassert (nargs == 1); - iargs[0] = Vinhibit_quit; + eassert (nargs == 2); + /* Yes, run_hook_with_args works this way. */ + iargs[0] = args[1]; iargs[1] = args[0]; - - GCPRO1 (*iargs); - gcpro1.nvars = 2; - internal_condition_case_n (safe_run_hooks_1, 2, iargs, Qt, safe_run_hooks_error); - RETURN_UNGCPRO (Qnil); + return Qnil; } /* If we get an error while running the hook, cause the hook variable @@ -1931,11 +1927,18 @@ safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args) void safe_run_hooks (Lisp_Object hook) { + Lisp_Object args[2]; + struct gcpro gcpro1; ptrdiff_t count = SPECPDL_INDEX (); - specbind (Qinhibit_quit, hook); - run_hook_with_args (1, &hook, safe_run_hook_funcall); + args[0] = hook; + args[1] = hook; + + GCPRO1 (hook); + specbind (Qinhibit_quit, Qt); + run_hook_with_args (2, args, safe_run_hook_funcall); unbind_to (count, Qnil); + UNGCPRO; }