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 #32 received at 42865 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
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 15:01:11 +0200
Juri Linkov <juri <at> 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




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

Previous Next


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