GNU bug report logs - #73986
31.0.50; Allow suppressing message passed to set-transient-map

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Thu, 24 Oct 2024 14:08:01 UTC

Severity: normal

Found in version 31.0.50

Done: Stephen Berman <stephen.berman <at> gmx.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73986 in the body.
You can then email your comments to 73986 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#73986; Package emacs. (Thu, 24 Oct 2024 14:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephen Berman <stephen.berman <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 24 Oct 2024 14:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Allow suppressing message passed to set-transient-map
Date: Thu, 24 Oct 2024 16:06:22 +0200
[Message part 1 (text/plain, inline)]
If a caller of set-transient-map passes a suitable format string, this
is displayed as a message on activating the transient map.  An example
is text-scale-adjust, which displays the message "Use +, =, -, 0, C-+,
C-=, C--, C-0 for further adjustment".  So if after typing `C-x C-+' you
immediately type `+ + + - - -', the text size increases three times and
then decreases three times.  But on each key press the message is
redisplayed, which is slighty annoying (it actually looks like it stays
in the echo area but there is a brief flicker on each key press); the
message is helpful the first time, if you're unfamiliar with the
command, but on repeated uses, it becomes visual noise.  So I propose a
user option to suppress the message, as in the attached patch.

One thing I'm not sure about is whether the call to `message' in the
local function `clearfun' of set-transient-map, which is added to
pre-command-hook, should also be conditioned on the proposed user
option; I tested both with and without such conditioning and saw no
difference, so the patch omits it.  But I admit I don't see what the
purpose of clearfun is, so maybe it should be so conditioned.

If the patch (or a corrected version of it) is accepted, I will also
update the elisp manual and NEWS accordingly.

(An alternative to the above proposal is suppressing the message after
displaying it once (or perhaps n times, though that seems extravagant).
Or allowing both alternatives (or all three) as values of the user
option.  I prefer the simpler display-or-suppress proposal, but can
implement an alternative if desired.)


In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.43, cairo version 1.18.2) of 2024-10-21 built on strobelfssd
Repository revision: b3af195213518514f78ac6f66f9598e45befd1ec
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101013
System Description: Linux From Scratch r12.2-17-systemd

Configured using:
 'configure -C 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt6/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
[Message part 2 (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73986; Package emacs. (Thu, 24 Oct 2024 17:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 73986 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 73986 <at> debbugs.gnu.org
Subject: Re: bug#73986: 31.0.50; Allow suppressing message passed to
 set-transient-map
Date: Thu, 24 Oct 2024 20:12:20 +0300
> If a caller of set-transient-map passes a suitable format string, this
> is displayed as a message on activating the transient map.  An example
> is text-scale-adjust, which displays the message "Use +, =, -, 0, C-+,
> C-=, C--, C-0 for further adjustment".  So if after typing `C-x C-+' you
> immediately type `+ + + - - -', the text size increases three times and
> then decreases three times.  But on each key press the message is
> redisplayed, which is slighty annoying (it actually looks like it stays
> in the echo area but there is a brief flicker on each key press); the
> message is helpful the first time, if you're unfamiliar with the
> command, but on repeated uses, it becomes visual noise.  So I propose a
> user option to suppress the message, as in the attached patch.

Instead of adding a myriad of user options for every command
that displays a message, we decided to create a single point
of customization, so you could just set these options:

  (add-to-list 'set-message-functions 'inhibit-message)
  (add-to-list 'inhibit-message-regexps "for further adjustment")




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73986; Package emacs. (Thu, 24 Oct 2024 18:13:01 GMT) Full text and rfc822 format available.

Message #11 received at 73986 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Juri Linkov <juri <at> linkov.net>
Cc: 73986 <at> debbugs.gnu.org
Subject: Re: bug#73986: 31.0.50; Allow suppressing message passed to
 set-transient-map
Date: Thu, 24 Oct 2024 20:12:06 +0200
On Thu, 24 Oct 2024 20:12:20 +0300 Juri Linkov <juri <at> linkov.net> wrote:

>> If a caller of set-transient-map passes a suitable format string, this
>> is displayed as a message on activating the transient map.  An example
>> is text-scale-adjust, which displays the message "Use +, =, -, 0, C-+,
>> C-=, C--, C-0 for further adjustment".  So if after typing `C-x C-+' you
>> immediately type `+ + + - - -', the text size increases three times and
>> then decreases three times.  But on each key press the message is
>> redisplayed, which is slighty annoying (it actually looks like it stays
>> in the echo area but there is a brief flicker on each key press); the
>> message is helpful the first time, if you're unfamiliar with the
>> command, but on repeated uses, it becomes visual noise.  So I propose a
>> user option to suppress the message, as in the attached patch.
>
> Instead of adding a myriad of user options for every command
> that displays a message, we decided to create a single point
> of customization, so you could just set these options:
>
>   (add-to-list 'set-message-functions 'inhibit-message)
>   (add-to-list 'inhibit-message-regexps "for further adjustment")

Ah, thanks, I now vaguely recall seeing these but forgot about them.
They indeed do work just as well as my proposed change to
set-transient-map for text-scale-adjust as well as two private functions
I use that pass a message string matching the same regexp, so that
satisfies my immediate wish.  Still, there could be any number of
callers of set-transient-map that pass message strings users may want to
suppress but that require a different regexp, in which case the burden
on the user is more than with my patch.  But since that's AFAIK
currently only a theoretical possibility, I won't pursue the proposal.
I'll wait a few days in case someone does chime in favor of my patch,
but otherwise I'll then close the bug.

Steve Berman




Reply sent to Stephen Berman <stephen.berman <at> gmx.net>:
You have taken responsibility. (Thu, 31 Oct 2024 10:03:02 GMT) Full text and rfc822 format available.

Notification sent to Stephen Berman <stephen.berman <at> gmx.net>:
bug acknowledged by developer. (Thu, 31 Oct 2024 10:03:02 GMT) Full text and rfc822 format available.

Message #16 received at 73986-done <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Juri Linkov <juri <at> linkov.net>
Cc: 73986-done <at> debbugs.gnu.org
Subject: Re: bug#73986: 31.0.50; Allow suppressing message passed to
 set-transient-map
Date: Thu, 31 Oct 2024 11:02:12 +0100
On Thu, 24 Oct 2024 20:12:06 +0200 Stephen Berman <stephen.berman <at> gmx.net> wrote:

> On Thu, 24 Oct 2024 20:12:20 +0300 Juri Linkov <juri <at> linkov.net> wrote:
>
>>> If a caller of set-transient-map passes a suitable format string, this
>>> is displayed as a message on activating the transient map.  An example
>>> is text-scale-adjust, which displays the message "Use +, =, -, 0, C-+,
>>> C-=, C--, C-0 for further adjustment".  So if after typing `C-x C-+' you
>>> immediately type `+ + + - - -', the text size increases three times and
>>> then decreases three times.  But on each key press the message is
>>> redisplayed, which is slighty annoying (it actually looks like it stays
>>> in the echo area but there is a brief flicker on each key press); the
>>> message is helpful the first time, if you're unfamiliar with the
>>> command, but on repeated uses, it becomes visual noise.  So I propose a
>>> user option to suppress the message, as in the attached patch.
>>
>> Instead of adding a myriad of user options for every command
>> that displays a message, we decided to create a single point
>> of customization, so you could just set these options:
>>
>>   (add-to-list 'set-message-functions 'inhibit-message)
>>   (add-to-list 'inhibit-message-regexps "for further adjustment")
>
> Ah, thanks, I now vaguely recall seeing these but forgot about them.
> They indeed do work just as well as my proposed change to
> set-transient-map for text-scale-adjust as well as two private functions
> I use that pass a message string matching the same regexp, so that
> satisfies my immediate wish.  Still, there could be any number of
> callers of set-transient-map that pass message strings users may want to
> suppress but that require a different regexp, in which case the burden
> on the user is more than with my patch.  But since that's AFAIK
> currently only a theoretical possibility, I won't pursue the proposal.
> I'll wait a few days in case someone does chime in favor of my patch,
> but otherwise I'll then close the bug.

Now closed.

Steve Berman




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 28 Nov 2024 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.