From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom Date: Thu, 20 Aug 2020 03:52:39 +0300 Organization: LINKOV.NET Message-ID: <87a6yqc874.fsf@mail.linkov.net> References: <87lfihi0w5.fsf@iris.silentflame.com> <87mu2sm5vu.fsf@gnus.org> <875z9fe3l9.fsf@mail.linkov.net> <87eeo37x1f.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15537"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 42865@debbugs.gnu.org, Sean Whitton To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 20 05:34:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8bLA-0003uE-Fq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Aug 2020 05:34:12 +0200 Original-Received: from localhost ([::1]:55448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8bL9-0007WB-HN for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Aug 2020 23:34:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8bL0-0007Vm-1p for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 23:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58109) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k8bKz-0004p7-Oi for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 23:34:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k8bKz-0004A0-Mc for bug-gnu-emacs@gnu.org; Wed, 19 Aug 2020 23:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Aug 2020 03:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42865 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 42865-submit@debbugs.gnu.org id=B42865.159789438215900 (code B ref 42865); Thu, 20 Aug 2020 03:34:01 +0000 Original-Received: (at 42865) by debbugs.gnu.org; 20 Aug 2020 03:33:02 +0000 Original-Received: from localhost ([127.0.0.1]:41419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8bK2-00048H-3V for submit@debbugs.gnu.org; Wed, 19 Aug 2020 23:33:02 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:44091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8bJx-00047a-D5 for 42865@debbugs.gnu.org; Wed, 19 Aug 2020 23:32:57 -0400 X-Originating-IP: 91.129.102.47 Original-Received: from mail.gandi.net (m91-129-102-47.cust.tele2.ee [91.129.102.47]) (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 591E7E0003; Thu, 20 Aug 2020 03:32:48 +0000 (UTC) In-Reply-To: <87eeo37x1f.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 19 Aug 2020 12:25:00 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185665 Archived-At: >> 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.