aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2011-04-28 21:35:20 +0200
committerJuanma Barranquero2011-04-28 21:35:20 +0200
commit638f053a0eb0c69390c29346ac465f30abd80a88 (patch)
treec15ffc9513f1c0dde205dad566573b7b990e0ca8 /src
parentf042970d4c3c5b93ce302a6447b7b998649325f5 (diff)
downloademacs-638f053a0eb0c69390c29346ac465f30abd80a88.tar.gz
emacs-638f053a0eb0c69390c29346ac465f30abd80a88.zip
Add delayed warnings support.
* etc/NEWS: Document `delayed-warnings-list' and `delayed-warnings-hook'. * lisp/subr.el (display-delayed-warnings): New function. (delayed-warnings-hook): New variable. * src/keyboard.c (Qdelayed_warnings_hook): Define. (command_loop_1): Run `delayed-warnings-hook' if Vdelayed_warnings_list is non-nil. (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it. (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/keyboard.c19
2 files changed, 27 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 107d6f0073a..e20feb0f6f7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12011-04-28 Juanma Barranquero <lekktu@gmail.com>
2
3 * keyboard.c (Qdelayed_warnings_hook): Define.
4 (command_loop_1): Run `delayed-warnings-hook'
5 if Vdelayed_warnings_list is non-nil.
6 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
7 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
8
12011-04-28 Eli Zaretskii <eliz@gnu.org> 92011-04-28 Eli Zaretskii <eliz@gnu.org>
2 10
3 * doprnt.c (doprnt): Don't return value smaller than the buffer 11 * doprnt.c (doprnt): Don't return value smaller than the buffer
diff --git a/src/keyboard.c b/src/keyboard.c
index fac098ddffd..a94456fce2e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -267,6 +267,8 @@ static Lisp_Object Qpost_command_hook;
267 267
268static Lisp_Object Qdeferred_action_function; 268static Lisp_Object Qdeferred_action_function;
269 269
270static Lisp_Object Qdelayed_warnings_hook;
271
270static Lisp_Object Qinput_method_exit_on_first_char; 272static Lisp_Object Qinput_method_exit_on_first_char;
271static Lisp_Object Qinput_method_use_echo_area; 273static Lisp_Object Qinput_method_use_echo_area;
272 274
@@ -1356,6 +1358,10 @@ command_loop_1 (void)
1356 if (!NILP (echo_area_buffer[0])) 1358 if (!NILP (echo_area_buffer[0]))
1357 resize_echo_area_exactly (); 1359 resize_echo_area_exactly ();
1358 1360
1361 /* If there are warnings waiting, process them. */
1362 if (!NILP (Vdelayed_warnings_list))
1363 safe_run_hooks (Qdelayed_warnings_hook);
1364
1359 if (!NILP (Vdeferred_action_list)) 1365 if (!NILP (Vdeferred_action_list))
1360 safe_run_hooks (Qdeferred_action_function); 1366 safe_run_hooks (Qdeferred_action_function);
1361 } 1367 }
@@ -1573,6 +1579,10 @@ command_loop_1 (void)
1573 if (!NILP (echo_area_buffer[0])) 1579 if (!NILP (echo_area_buffer[0]))
1574 resize_echo_area_exactly (); 1580 resize_echo_area_exactly ();
1575 1581
1582 /* If there are warnings waiting, process them. */
1583 if (!NILP (Vdelayed_warnings_list))
1584 safe_run_hooks (Qdelayed_warnings_hook);
1585
1576 safe_run_hooks (Qdeferred_action_function); 1586 safe_run_hooks (Qdeferred_action_function);
1577 1587
1578 /* If there is a prefix argument, 1588 /* If there is a prefix argument,
@@ -11498,6 +11508,7 @@ syms_of_keyboard (void)
11498 DEFSYM (Qpre_command_hook, "pre-command-hook"); 11508 DEFSYM (Qpre_command_hook, "pre-command-hook");
11499 DEFSYM (Qpost_command_hook, "post-command-hook"); 11509 DEFSYM (Qpost_command_hook, "post-command-hook");
11500 DEFSYM (Qdeferred_action_function, "deferred-action-function"); 11510 DEFSYM (Qdeferred_action_function, "deferred-action-function");
11511 DEFSYM (Qdelayed_warnings_hook, "delayed-warnings-hook");
11501 DEFSYM (Qfunction_key, "function-key"); 11512 DEFSYM (Qfunction_key, "function-key");
11502 DEFSYM (Qmouse_click, "mouse-click"); 11513 DEFSYM (Qmouse_click, "mouse-click");
11503 DEFSYM (Qdrag_n_drop, "drag-n-drop"); 11514 DEFSYM (Qdrag_n_drop, "drag-n-drop");
@@ -12069,6 +12080,14 @@ This function is called with no arguments after each command
12069whenever `deferred-action-list' is non-nil. */); 12080whenever `deferred-action-list' is non-nil. */);
12070 Vdeferred_action_function = Qnil; 12081 Vdeferred_action_function = Qnil;
12071 12082
12083 DEFVAR_LISP ("delayed-warnings-list", Vdelayed_warnings_list,
12084 doc: /* List of warnings to be displayed as soon as possible.
12085Each element must be a list (TYPE MESSAGE [LEVEL [BUFFER-NAME]]),
12086as per the args of `display-warning' (which see).
12087If this variable is non-nil, `delayed-warnings-hook' will be run
12088immediately after running `post-command-hook'. */);
12089 Vdelayed_warnings_list = Qnil;
12090
12072 DEFVAR_LISP ("suggest-key-bindings", Vsuggest_key_bindings, 12091 DEFVAR_LISP ("suggest-key-bindings", Vsuggest_key_bindings,
12073 doc: /* *Non-nil means show the equivalent key-binding when M-x command has one. 12092 doc: /* *Non-nil means show the equivalent key-binding when M-x command has one.
12074The value can be a length of time to show the message for. 12093The value can be a length of time to show the message for.