emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117645: * keyboard.c (safe_run_hooks): Follow the c


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r117645: * keyboard.c (safe_run_hooks): Follow the convenient style to bind
Date: Tue, 05 Aug 2014 05:43:54 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117645
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2014-08-05 09:43:35 +0400
message:
  * 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
  <http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00077.html>.
  (safe_run_hook_funcall): Adjust accordingly.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-08-04 16:47:27 +0000
+++ b/src/ChangeLog     2014-08-05 05:43:35 +0000
@@ -1,3 +1,10 @@
+2014-08-05 Dmitry Antipov  <address@hidden>
+
+       * 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
+       <http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00077.html>.
+       (safe_run_hook_funcall): Adjust accordingly.
+
 2014-08-04  Martin Rudalics  <address@hidden>
 
        * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS): Condition

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2014-08-04 04:03:31 +0000
+++ b/src/keyboard.c    2014-08-05 05:43:35 +0000
@@ -1910,18 +1910,14 @@
 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 @@
 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;
 }
 
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]