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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stephen Berman <stephen.berman <at> gmx.net>
Subject: bug#73986: closed (Re: bug#73986: 31.0.50; Allow suppressing
 message passed to set-transient-map)
Date: Thu, 31 Oct 2024 10:03:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#73986: 31.0.50; Allow suppressing message passed to set-transient-map

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 73986 <at> debbugs.gnu.org.

-- 
73986: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73986
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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

[Message part 3 (message/rfc822, inline)]
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 4 (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 5 (text/x-patch, attachment)]

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.