diff options
| author | Dmitry Antipov | 2014-08-05 09:43:35 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-08-05 09:43:35 +0400 |
| commit | 697c09e934c85b26ae9b0a50067b02ffff9be650 (patch) | |
| tree | 4c1c0587823c7ef19527fd1bfb1bb3be3cfcf72f | |
| parent | 5ea39c0613cb7100189a1bb5e79de26d4fe7e8d0 (diff) | |
| download | emacs-697c09e934c85b26ae9b0a50067b02ffff9be650.tar.gz emacs-697c09e934c85b26ae9b0a50067b02ffff9be650.zip | |
* 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.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/keyboard.c | 23 |
2 files changed, 20 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e936863ce1d..d08cf69af8e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-08-05 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * keyboard.c (safe_run_hooks): Follow the convenient style to bind | ||
| 4 | inhibit-quit to t and pass 2 args to safe_run_hook_funcall. See | ||
| 5 | <http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00077.html>. | ||
| 6 | (safe_run_hook_funcall): Adjust accordingly. | ||
| 7 | |||
| 1 | 2014-08-04 Martin Rudalics <rudalics@gmx.at> | 8 | 2014-08-04 Martin Rudalics <rudalics@gmx.at> |
| 2 | 9 | ||
| 3 | * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS): Condition | 10 | * 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 | |||
| 1910 | safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args) | 1910 | safe_run_hook_funcall (ptrdiff_t nargs, Lisp_Object *args) |
| 1911 | { | 1911 | { |
| 1912 | Lisp_Object iargs[2]; | 1912 | Lisp_Object iargs[2]; |
| 1913 | struct gcpro gcpro1; | ||
| 1914 | 1913 | ||
| 1915 | eassert (nargs == 1); | 1914 | eassert (nargs == 2); |
| 1916 | iargs[0] = Vinhibit_quit; | 1915 | /* Yes, run_hook_with_args works this way. */ |
| 1916 | iargs[0] = args[1]; | ||
| 1917 | iargs[1] = args[0]; | 1917 | iargs[1] = args[0]; |
| 1918 | |||
| 1919 | GCPRO1 (*iargs); | ||
| 1920 | gcpro1.nvars = 2; | ||
| 1921 | |||
| 1922 | internal_condition_case_n (safe_run_hooks_1, 2, iargs, | 1918 | internal_condition_case_n (safe_run_hooks_1, 2, iargs, |
| 1923 | Qt, safe_run_hooks_error); | 1919 | Qt, safe_run_hooks_error); |
| 1924 | RETURN_UNGCPRO (Qnil); | 1920 | return Qnil; |
| 1925 | } | 1921 | } |
| 1926 | 1922 | ||
| 1927 | /* If we get an error while running the hook, cause the hook variable | 1923 | /* 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) | |||
| 1931 | void | 1927 | void |
| 1932 | safe_run_hooks (Lisp_Object hook) | 1928 | safe_run_hooks (Lisp_Object hook) |
| 1933 | { | 1929 | { |
| 1930 | Lisp_Object args[2]; | ||
| 1931 | struct gcpro gcpro1; | ||
| 1934 | ptrdiff_t count = SPECPDL_INDEX (); | 1932 | ptrdiff_t count = SPECPDL_INDEX (); |
| 1935 | 1933 | ||
| 1936 | specbind (Qinhibit_quit, hook); | 1934 | args[0] = hook; |
| 1937 | run_hook_with_args (1, &hook, safe_run_hook_funcall); | 1935 | args[1] = hook; |
| 1936 | |||
| 1937 | GCPRO1 (hook); | ||
| 1938 | specbind (Qinhibit_quit, Qt); | ||
| 1939 | run_hook_with_args (2, args, safe_run_hook_funcall); | ||
| 1938 | unbind_to (count, Qnil); | 1940 | unbind_to (count, Qnil); |
| 1941 | UNGCPRO; | ||
| 1939 | } | 1942 | } |
| 1940 | 1943 | ||
| 1941 | 1944 | ||