From: Dmitry Gutov <dmitry@gutov.dev>
To: Eli Zaretskii <eliz@gnu.org>
Cc: justin@burkett.cc, philipk@posteo.net, luangruo@yahoo.com,
jb@jeremybryant.net, emacs-devel@gnu.org
Subject: Re: discoverability, better defaults and which-key in Emacs
Date: Wed, 7 Feb 2024 20:31:04 +0200 [thread overview]
Message-ID: <1056a72d-af5c-487e-be33-67522fe47d17@gutov.dev> (raw)
In-Reply-To: <86h6ikzc38.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
On 07/02/2024 14:35, Eli Zaretskii wrote:
>> Date: Wed, 7 Feb 2024 01:12:37 +0200
>> Cc: Philip Kaludercic <philipk@posteo.net>, Po Lu <luangruo@yahoo.com>,
>> Jeremy Bryant <jb@jeremybryant.net>, Emacs Devel <emacs-devel@gnu.org>
>> From: Dmitry Gutov <dmitry@gutov.dev>
>>
>> How about this?
>>
>> Since echo-keystrokes is 1 second by default, which defines a
>> significant timeout already, I think this can work without a yet another
>> timer.
>
> LGTM, but it should be a defcustom.
All right, see the attached.
[-- Attachment #2: echo_keystrokes_help.diff --]
[-- Type: text/x-patch, Size: 2055 bytes --]
diff --git a/etc/NEWS b/etc/NEWS
index ee7462cb2aa..d4b8bf21f94 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -307,6 +307,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 hide it.
+
\f
* Editing Changes in Emacs 30.1
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 7e0b64e9067..3fe62c8d0da 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -371,6 +371,7 @@ minibuffer-prompt-properties--setter
(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)))
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 @@ syms_of_keyboard (void)
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.
next prev parent reply other threads:[~2024-02-07 18:31 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 23:23 discoverability, better defaults and which-key in Emacs Jeremy Bryant
2024-02-01 2:45 ` Po Lu
2024-02-03 13:40 ` Philip Kaludercic
2024-02-04 22:03 ` Dmitry Gutov
2024-02-05 7:11 ` Philip Kaludercic
2024-02-05 15:38 ` Dmitry Gutov
2024-02-05 18:47 ` Philip Kaludercic
2024-02-05 19:17 ` Dmitry Gutov
2024-02-05 19:33 ` Justin Burkett
2024-02-05 23:05 ` Dmitry Gutov
2024-02-06 2:49 ` Justin Burkett
2024-02-06 23:12 ` Dmitry Gutov
2024-02-07 12:35 ` Eli Zaretskii
2024-02-07 18:31 ` Dmitry Gutov [this message]
2024-02-07 19:13 ` Eli Zaretskii
2024-02-07 19:51 ` Dmitry Gutov
2024-02-08 1:46 ` Visuwesh
2024-02-08 6:59 ` Eli Zaretskii
2024-02-08 12:18 ` Dmitry Gutov
2024-02-08 13:02 ` Eli Zaretskii
2024-02-08 13:36 ` Dmitry Gutov
2024-02-08 13:52 ` Eli Zaretskii
2024-02-08 14:43 ` Dmitry Gutov
2024-02-08 16:12 ` Dmitry Gutov
2024-02-11 2:17 ` Dmitry Gutov
2024-02-11 2:39 ` Po Lu
2024-02-11 12:30 ` Dmitry Gutov
2024-02-11 6:49 ` Eli Zaretskii
2024-02-11 12:26 ` Dmitry Gutov
2024-02-11 15:00 ` Eli Zaretskii
2024-02-11 20:36 ` Dmitry Gutov
2024-02-08 16:50 ` Eli Zaretskii
2024-02-08 13:41 ` Dmitry Gutov
2024-02-08 13:51 ` Rebinding Fn [Re: discoverability, better defaults and which-key in Emacs] Alan Mackenzie
2024-02-08 13:55 ` Eli Zaretskii
2024-02-08 14:04 ` Alan Mackenzie
2024-02-08 13:25 ` discoverability, better defaults and which-key in Emacs Po Lu
2024-02-08 13:27 ` Dmitry Gutov
2024-02-08 13:36 ` Dmitry Gutov
2024-02-01 7:35 ` Eli Zaretskii
2024-02-01 21:16 ` Jeremy Bryant
2024-02-02 6:43 ` Eli Zaretskii
2024-02-02 7:00 ` Emanuel Berg
2024-02-02 7:43 ` Eli Zaretskii
2024-02-02 15:25 ` [External] : " Drew Adams
2024-02-02 15:53 ` Emanuel Berg
2024-02-02 16:04 ` Emanuel Berg
2024-02-03 11:46 ` Jeremy Bryant
2024-02-03 11:39 ` Jeremy Bryant
2024-02-03 12:12 ` Eli Zaretskii
2024-02-03 14:07 ` Jeremy Bryant
2024-02-03 15:15 ` Eli Zaretskii
2024-02-04 22:18 ` Jeremy Bryant
2024-02-05 12:41 ` Eli Zaretskii
2024-02-03 11:30 ` Jeremy Bryant
2024-02-03 11:36 ` Moving which-key ELPA package into core - " Jeremy Bryant
2024-02-03 16:34 ` Stefan Monnier
2024-02-04 22:12 ` Jeremy Bryant
2024-02-04 23:06 ` Stefan Monnier
2024-02-01 21:17 ` orzodk
2024-02-01 22:24 ` Jeremy Bryant
2024-02-01 23:49 ` orzodk
2024-02-02 6:31 ` Eli Zaretskii
2024-02-02 16:00 ` Howard Melman
2024-02-02 19:24 ` Eli Zaretskii
2024-02-02 19:32 ` tomas
2024-02-02 20:16 ` Howard Melman
2024-02-03 7:25 ` Emanuel Berg
2024-02-03 8:49 ` Eli Zaretskii
2024-02-03 16:58 ` [External] : " Drew Adams
2024-02-04 22:25 ` Jeremy Bryant
2024-02-04 22:55 ` Emanuel Berg
2024-02-05 3:40 ` Emanuel Berg
2024-02-04 23:47 ` Drew Adams
2024-02-05 1:46 ` Emanuel Berg
2024-02-05 3:52 ` Divya Ranjan
2024-02-05 15:04 ` Drew Adams
2024-02-04 18:34 ` Howard Melman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1056a72d-af5c-487e-be33-67522fe47d17@gutov.dev \
--to=dmitry@gutov.dev \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=jb@jeremybryant.net \
--cc=justin@burkett.cc \
--cc=luangruo@yahoo.com \
--cc=philipk@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.