GNU bug report logs - #42865
28.0.50; Add new 'copy-region-quietly' defcustom

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Fri, 14 Aug 2020 17:39:01 UTC

Severity: normal

Tags: patch

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 42865 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom
Date: Thu, 20 Aug 2020 03:52:39 +0300
>> Regarding a new option to disable such messages at all, it seems this
>> is a more general question because AFAIR, in the past, users asked for
>> a way to disable messages for many other commands, such as "Wrote ..."
>> of 'save-buffer', etc.
>>
>> Maybe there should be a new feature allowing to disable messages selectively
>> for different commands?  Maybe just by putting a symbol property on the
>> command symbol.
>
> Many commands can issue different messages, while it's normally just the
> specific "everything went well" thing users want to disable.  So I think
> that may be confusing, interface wise?
>
> But perhaps not?  If the symbol wasn't `silent' but instead
> `no-normal-message' or something, then that could be used to disable any
> messaging in the command on the "happy path".

Generally, different error levels should specify the message priority
(debug, info, warning, error).  I'm not quite sure what functions
correspond to these levels in Emacs.  Definitely, errors should be raised
by the function 'error', but it seems most messages are informational.

Anyway, here is a patch that allows disabling messages for particular
commands with e.g.

  (put 'kill-ring-save 'inhibit-message t)

diff --git a/src/xdisp.c b/src/xdisp.c
index ad03ac4605..9cbbec61f6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10984,7 +10984,7 @@ message3 (Lisp_Object m)
       message_dolog (buffer, nbytes, true, multibyte);
       SAFE_FREE ();
     }
-  if (! inhibit_message)
+  if (! inhibit_message && NILP (Fget (Vthis_command, Qinhibit_message)))
     message3_nolog (m);
 }
 
@@ -34348,6 +34353,7 @@ syms_of_xdisp (void)
 
   DEFSYM (Qredisplay_internal_xC_functionx, "redisplay_internal (C function)");
 
+  DEFSYM (Qinhibit_message, "inhibit-message");
   DEFVAR_BOOL("inhibit-message", inhibit_message,
               doc:  /* Non-nil means calls to `message' are not displayed.
 They are still logged to the *Messages* buffer.






This bug report was last modified 3 years and 329 days ago.

Previous Next


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