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: Lars Ingebrigtsen
Subject: bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom
Date: Thu, 20 Aug 2020 15:01:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Juri Linkov <juri@linkov.net> writes:

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

They are, and it would be nice to allow users to switch them off
individually.  Your patch to implement this is temptingly short and easy:

> +  if (! inhibit_message && NILP (Fget (Vthis_command, Qinhibit_message)))

But I think this isn't flexible enough.  If you have one command calling
another command, and that command is the one with the message you want
to inhibit, you have to inhibit all the callers...  which you may not
want to:

(defun my-command ()
  (interactive)
  (chatty-command)
  (when once-in-a-while-there's-an-important-message
    (message "This is really important")))

there's no way to do that with this.

I think we'd have to introduce a new function, like...

(defun information (name &rest args)
  (when (information-wanted name)
    (apply #'message args)))

that would allow inhibiting messages based on names and or levels, so
copy-region would just have a

  (information 'copy-message ...)

instead of the message call.  (This is basically what Gnus does with
gnus-message, but there it's based on levels and not names.)

This would also allow users to say "switch off all purely informational
messages".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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