From f3e1bd52c57e536cd8b61568e1d0cc8de9c1d6ba Mon Sep 17 00:00:00 2001 From: Christian Dietrich Date: Mon, 14 Dec 2015 23:18:08 +0100 Subject: [PATCH] New 'echo-area-keystroke-hook' The echo-area-keystroke-hook is called when a keystroke is inserted partially and the keystroke is printed to the echo area. * src/keyboard.c: New hook is called when dash is printed to the echo area. --- src/keyboard.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index 02bc7d2..1a2b621 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -530,6 +530,11 @@ echo_dash (void) kset_echo_string (current_kboard, concat2 (KVAR (current_kboard, echo_string), dash)); echo_now (); + + /* Call the hook indicating that a keystroke was printed to the echo + area */ + safe_run_hooks (Qecho_area_keystroke_hook); + } static void @@ -11008,6 +11013,7 @@ syms_of_keyboard (void) DEFSYM (Qhelp_form_show, "help-form-show"); DEFSYM (Qecho_keystrokes, "echo-keystrokes"); + DEFSYM (Qecho_area_keystroke_hook, "echo-area-keystroke-hook"); Fset (Qinput_method_exit_on_first_char, Qnil); Fset (Qinput_method_use_echo_area, Qnil); @@ -11396,6 +11402,14 @@ See also `pre-command-hook'. */); DEFSYM (Qecho_area_clear_hook, "echo-area-clear-hook"); Fset (Qecho_area_clear_hook, Qnil); + DEFVAR_LISP ("echo-area-keystroke-hook", Vecho_area_keystroke_hook, + doc: /* Normal hook run after a partial key input is +printed to the echo area. If an unhandled error happens in this hook, +the function in which the error occured is unconditionally removed, +since otherwise the error might happen repeatedly and make Emacs +nonfunctional. */); + Vecho_area_keystroke_hook = Qnil; + DEFVAR_LISP ("lucid-menu-bar-dirty-flag", Vlucid_menu_bar_dirty_flag, doc: /* Non-nil means menu bar, specified Lucid style, needs to be recomputed. */); Vlucid_menu_bar_dirty_flag = Qnil; -- 2.6.2