]> git.eshelyaron.com Git - emacs.git/commitdiff
Mention 'C-h' in echo for unfinished commands
authorDmitry Gutov <dmitry@gutov.dev>
Wed, 7 Feb 2024 19:50:37 +0000 (21:50 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 7 Feb 2024 20:32:35 +0000 (21:32 +0100)
* 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.

(cherry picked from commit f444786e58737a4ae6071957dfc60075bbd96edc)

etc/NEWS
lisp/cus-start.el
src/keyboard.c

index 88afdac94abe0dd15a695ebfcea7d051aef6fc89..dc62fdbb9bfdf010de9ca9c0642371c1ba477f95 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -305,6 +305,9 @@ between the auto save file and the current file.
 ** 'ffap-lax-url' now defaults to nil.
 Previously, it was set to t but this broke remote file name detection.
 
+** Unfinished commands' echo now ends with a suggestion to use Help.
+Customize 'echo-keystrokes-help' to nil to prevent that.
+
 \f
 * Editing Changes in Emacs 30.1
 
index 7e0b64e906715ac87740bced24d41dead090db1a..3fe62c8d0da13a718c63ce3e888a7311a09a8de1 100644 (file)
@@ -371,6 +371,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             (auto-save-timeout auto-save (choice (const :tag "off" nil)
                                                  (integer :format "%v")))
             (echo-keystrokes minibuffer number)
+             (echo-keystrokes-help minibuffer boolean "30.1")
             (polling-period keyboard float)
             (double-click-time mouse (restricted-sexp
                                       :match-alternatives (integerp 'nil 't)))
index 1f7253a7da1a923637641dc0d0b6d060fc2997b2..6d3db5ab61529aaa994306c4f9252c41eaaa5c2b 100644 (file)
@@ -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.