aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 4ad6e4e6bd1..8a2b7d58c4b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1331,6 +1331,7 @@ command_loop_1 (void)
1331 display_malloc_warning (); 1331 display_malloc_warning ();
1332 1332
1333 Vdeactivate_mark = Qnil; 1333 Vdeactivate_mark = Qnil;
1334 backtrace_yet = false;
1334 1335
1335 /* Don't ignore mouse movements for more than a single command 1336 /* Don't ignore mouse movements for more than a single command
1336 loop. (This flag is set in xdisp.c whenever the tool bar is 1337 loop. (This flag is set in xdisp.c whenever the tool bar is
@@ -1841,7 +1842,7 @@ safe_run_hooks_1 (ptrdiff_t nargs, Lisp_Object *args)
1841static Lisp_Object 1842static Lisp_Object
1842safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) 1843safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args)
1843{ 1844{
1844 eassert (nargs == 2); 1845 eassert (nargs >= 2 && nargs <= 4);
1845 AUTO_STRING (format, "Error in %s (%S): %S"); 1846 AUTO_STRING (format, "Error in %s (%S): %S");
1846 Lisp_Object hook = args[0]; 1847 Lisp_Object hook = args[0];
1847 Lisp_Object fun = args[1]; 1848 Lisp_Object fun = args[1];
@@ -1915,6 +1916,17 @@ safe_run_hooks_maybe_narrowed (Lisp_Object hook, struct window *w)
1915 unbind_to (count, Qnil); 1916 unbind_to (count, Qnil);
1916} 1917}
1917 1918
1919void
1920safe_run_hooks_2 (Lisp_Object hook, Lisp_Object arg1, Lisp_Object arg2)
1921{
1922 specpdl_ref count = SPECPDL_INDEX ();
1923
1924 specbind (Qinhibit_quit, Qt);
1925 run_hook_with_args (4, ((Lisp_Object []) {hook, hook, arg1, arg2}),
1926 safe_run_hook_funcall);
1927 unbind_to (count, Qnil);
1928}
1929
1918 1930
1919/* Nonzero means polling for input is temporarily suppressed. */ 1931/* Nonzero means polling for input is temporarily suppressed. */
1920 1932
@@ -12638,10 +12650,17 @@ cancels any modification. */);
12638 12650
12639 DEFSYM (Qdeactivate_mark, "deactivate-mark"); 12651 DEFSYM (Qdeactivate_mark, "deactivate-mark");
12640 DEFVAR_LISP ("deactivate-mark", Vdeactivate_mark, 12652 DEFVAR_LISP ("deactivate-mark", Vdeactivate_mark,
12641 doc: /* If an editing command sets this to t, deactivate the mark afterward. 12653 doc: /* Whether to deactivate the mark after an editing command.
12642The command loop sets this to nil before each command, 12654The command loop sets this to nil before each command,
12643and tests the value when the command returns. 12655and tests the value when the command returns.
12644Buffer modification stores t in this variable. */); 12656If an editing command sets this non-nil, deactivate the mark after
12657the command returns.
12658
12659Buffer modifications store t in this variable.
12660
12661By default, deactivating the mark will save the contents of the region
12662according to `select-active-regions', unless this is set to the symbol
12663`dont-save'. */);
12645 Vdeactivate_mark = Qnil; 12664 Vdeactivate_mark = Qnil;
12646 Fmake_variable_buffer_local (Qdeactivate_mark); 12665 Fmake_variable_buffer_local (Qdeactivate_mark);
12647 12666