summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorDmitry Gutov <dmitry@gutov.dev>2024-02-07 21:50:37 +0200
committerDmitry Gutov <dmitry@gutov.dev>2024-02-07 21:50:53 +0200
commitf444786e58737a4ae6071957dfc60075bbd96edc (patch)
tree32003bb2a9fd19f1757911390f185f480567d08e /src/keyboard.c
parent2ecaa60f0521446c9d2c054a3493faaf46275223 (diff)
downloademacs-f444786e58737a4ae6071957dfc60075bbd96edc.tar.gz
Mention 'C-h' in echo for unfinished commands
* etc/NEWS: Mention it here. * lisp/cus-start.el (standard): Add type and version for it. * src/keyboard.c (echo-keystrokes-help): New user option (https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00174.html). * src/keyboard.c (echo_dash): Use it.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 1f7253a7da1..6d3db5ab615 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -589,6 +589,15 @@ echo_dash (void)
AUTO_STRING (dash, "-");
kset_echo_string (current_kboard,
concat2 (KVAR (current_kboard, echo_string), dash));
+
+ if (echo_keystrokes_help)
+ {
+ AUTO_STRING (help, " (\\`C-h' for help)");
+ kset_echo_string (current_kboard,
+ concat2 (KVAR (current_kboard, echo_string),
+ calln (Qsubstitute_command_keys, help)));
+ }
+
echo_now ();
}
@@ -13228,6 +13237,10 @@ The value may be integer or floating point.
If the value is zero, don't echo at all. */);
Vecho_keystrokes = make_fixnum (1);
+ DEFVAR_BOOL ("echo-keystrokes-help", echo_keystrokes_help,
+ doc: /* Non-nil means append small help text to the unfinished commands' echo. */);
+ echo_keystrokes_help = true;
+
DEFVAR_LISP ("polling-period", Vpolling_period,
doc: /* Interval between polling for input during Lisp execution.
The reason for polling is to make C-g work to stop a running program.