From: Robert Pluim <rpluim@gmail.com>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: 37785@debbugs.gnu.org
Subject: bug#37785: [PATCH] Add a way to disable substitution of command keys in help strings
Date: Thu, 17 Oct 2019 11:44:50 +0200 [thread overview]
Message-ID: <m2k1931zal.fsf@gmail.com> (raw)
In-Reply-To: <7a45908a-cc9a-277b-53ea-933756e0e067@gmail.com> ("Clément Pit-Claudel"'s message of "Wed, 16 Oct 2019 21:41:27 -0400")
>>>>> On Wed, 16 Oct 2019 21:41:27 -0400, Clément Pit-Claudel <cpitclaudel@gmail.com> said:
Clément> Hi all,
Clément> On 2019-10-05 04:13, Eli Zaretskii wrote (on emacs-devel):
>> I guess we need to add some feature to control whether help-echo gets
>> run through substitute-command-keys, or add an alternative to
>> help-echo that works exactly like it, but without substitutions.
>> Patches welcome.
Clément> […]
>> I'd prefer a property like help-echo-inhibit-substitution that is
>> non-nil, to inhibit the call to substitute-command-keys. A value of
>> nil is easy to confuse with no property at all.
Clément> Here is a first cut at a patch implementing this feature. I hope this
Clément> tracker is the right place to post it. I'm also not quite sure I got
Clément> the Changelog format right.
Clément> Cheers,
Clément> Clément.
Clément> From 8092b19d819182c91e6066d24f243dc7d7d8641e Mon Sep 17 00:00:00 2001
Clément> From: =?UTF-8?q?Cl=C3=A9ment=20Pit-Claudel?= <clement.pitclaudel@live.com>
Clément> Date: Wed, 16 Oct 2019 21:28:47 -0400
Clément> Subject: [PATCH] Add a way to disable substitution of command keys in help
Clément> strings
Clément> * src/keyboard.c (show_help_substitute_command_keys): New function
Clément> (show_help_echo, parse_menu_item): Use it
Clément> (syms_of_keyboard): Define Qshow_help_inhibit_substitution
Clément> * doc/lispref/text.texi (Special Properties), etc/NEWS: Document
Clément> the effect of 'show-help-inhibit-substitution'
Full stops at the end of sentences. Also, I think I prefer Eli's name,
mainly because yours combines 'show' with 'inhibit', which I find
jarring, and because Eli's contains 'help-echo', which mirrors the
name of the affected property.
Clément> ++++
Clément> +** Adding a non-nil 'show-help-inhibit-substitution' text property on
Clément> +the first character of a help string disables conversion via
Clément> +'substitute-command-keys'.
Clément> +
Should this be in the 'Lisp Changes' section of NEWS? Also, first line
should be a complete sentence, so:
** New text property 'show-help-inhibit-substitution'.
Setting this on the first character of a help string disables
conversion via 'substitute-command-keys'.
Clément> +/* Substitute key descriptions and quotes in HELP, unless its first
Clément> + character has a non-nil show-help-inhibit-substitution property. */
Two spaces after full stop.
Clément> +
Clément> +static Lisp_Object
Clément> +show_help_substitute_command_keys (Lisp_Object help)
Clément> +{
Clément> + if (STRINGP (help) &&
Clément> + SCHARS (help) > 0 &&
Clément> + !NILP (Fget_text_property (make_fixnum(0),
Clément> + Qshow_help_inhibit_substitution,
Clément> + help)))
Break before operators, not after.
Robert
next prev parent reply other threads:[~2019-10-17 9:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-17 1:41 bug#37785: [PATCH] Add a way to disable substitution of command keys in help strings Clément Pit-Claudel
2019-10-17 9:44 ` Robert Pluim [this message]
2019-10-17 12:01 ` Clément Pit-Claudel
2019-10-17 13:13 ` Eli Zaretskii
2019-10-17 13:47 ` Clément Pit-Claudel
2019-10-17 14:06 ` Eli Zaretskii
2019-10-17 15:53 ` Clément Pit-Claudel
2019-10-17 17:18 ` Eli Zaretskii
2019-10-19 20:35 ` Clément Pit-Claudel
2019-10-20 12:08 ` Eli Zaretskii
2019-10-21 1:53 ` Clément Pit-Claudel
2019-10-17 15:06 ` Robert Pluim
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2k1931zal.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=37785@debbugs.gnu.org \
--cc=cpitclaudel@gmail.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).