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: Wed, 19 Aug 2020 04:16:58 +0300 Organization: LINKOV.NET Message-ID: <875z9fe3l9.fsf@mail.linkov.net> References: <87lfihi0w5.fsf@iris.silentflame.com> <87mu2sm5vu.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="21055"; 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 Wed Aug 19 05:16: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 1k8EaC-0005OX-Ch for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Aug 2020 05:16:12 +0200 Original-Received: from localhost ([::1]:46444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8EaB-0005RY-FU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Aug 2020 23:16:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8Ea3-0005Pm-DN for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2020 23:16:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k8Ea3-0004pa-3s for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2020 23:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k8Ea2-0001dq-TG for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2020 23:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Aug 2020 03:16:02 +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.15978069496276 (code B ref 42865); Wed, 19 Aug 2020 03:16:02 +0000 Original-Received: (at 42865) by debbugs.gnu.org; 19 Aug 2020 03:15:49 +0000 Original-Received: from localhost ([127.0.0.1]:37498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8EZp-0001dA-22 for submit@debbugs.gnu.org; Tue, 18 Aug 2020 23:15:49 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:42293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8EZm-0001ch-E1 for 42865@debbugs.gnu.org; Tue, 18 Aug 2020 23:15:47 -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 97D30E0002; Wed, 19 Aug 2020 03:15:36 +0000 (UTC) In-Reply-To: <87mu2sm5vu.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 18 Aug 2020 15:37:57 +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:185549 Archived-At: >> +(defcustom copy-region-quietly nil >> + "Whether the copying of an inactive region is indicated visually. >> +If nil, behave as per the documentation of `indicate-copied-region'. >> +`no-swap' means inhibit briefly swapping point and mark. >> +`no-message' means inhibit displaying a message. >> +Any other value means inhibit both swapping and message-displaying." >> + :type '(choice :tag "Copy region quietly" >> + (const :tag "Default behavior" nil) >> + (const :tag "Don't swap point and mark" no-swap) >> + (const :tag "Don't display a message" no-message) >> + (const >> + :tag >> + "Don't swap point and mark or display a message" >> + t)) >> + :group 'killing) > > Thanks for the patch. > > The change looks reasonable to me, but I'm not quite sure of how useful > this is. Does many people want to tweak the behaviour of this command > to this extent? > > Perhaps somebody else on the bug tracker has opinions here. When I needed to customize the behaviour of 'indicate-copied-region', I relied on advice-add like this: (advice-add 'kill-ring-save :after (lambda (&rest _args) (let ((text (substring-no-properties (current-kill 0)))) (message "Copied text \"%s\"" ;; Don't show newlines literally (query-replace-descr (if (> (length text) 64) (concat (substring text 0 64) "..." (substring text -16)) text))))) '((name . indicate-copied-region))) that tries to fix the problem of multi-line messages that abruptly changes the window configuration by resizing the echo area after text copying. This problem is caused by the fact that 'indicate-copied-region' displays the constant number of copied characters, including newlines. 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. Regarding disabling the "swapping point and mark" feature: since 'indicate-copied-region' uses 'blink-matching-delay', shouldn't this behaviour be disabled by the existing option 'blink-matching-paren-on-screen' in 'indicate-copied-region' as well (in addition to 'blink-matching-open' where it's used originally)?