bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom


From: Juri Linkov
Subject: bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom
Date: Thu, 20 Aug 2020 03:52:39 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> 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.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]