From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 42865@debbugs.gnu.org, Sean Whitton <spwhitton@spwhitton.name>
Subject: bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom
Date: Wed, 19 Aug 2020 04:16:58 +0300 [thread overview]
Message-ID: <875z9fe3l9.fsf@mail.linkov.net> (raw)
In-Reply-To: <87mu2sm5vu.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 18 Aug 2020 15:37:57 +0200")
>> +(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)?
next prev parent reply other threads:[~2020-08-19 1:16 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-14 17:38 bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom Sean Whitton
2020-08-18 13:37 ` Lars Ingebrigtsen
2020-08-19 1:16 ` Juri Linkov [this message]
2020-08-19 10:25 ` Lars Ingebrigtsen
2020-08-20 0:52 ` Juri Linkov
2020-08-20 13:01 ` Lars Ingebrigtsen
2020-08-20 23:19 ` Juri Linkov
2020-08-21 11:28 ` Lars Ingebrigtsen
2020-08-23 18:39 ` Juri Linkov
2020-08-24 13:14 ` Lars Ingebrigtsen
2020-08-24 13:26 ` Stefan Kangas
2020-08-24 14:00 ` Lars Ingebrigtsen
2020-08-24 18:38 ` Juri Linkov
2020-08-24 19:34 ` Stefan Kangas
2020-08-25 18:40 ` Juri Linkov
2020-08-26 0:36 ` Stefan Kangas
2020-08-27 19:08 ` Juri Linkov
2020-11-15 20:40 ` Juri Linkov
2020-08-20 0:55 ` Juri Linkov
2020-08-20 13:05 ` Lars Ingebrigtsen
2020-11-15 20:33 ` Juri Linkov
2020-08-19 16:36 ` Sean Whitton
2020-08-19 16:32 ` Sean Whitton
2020-08-19 16:49 ` Lars Ingebrigtsen
2020-09-10 16:05 ` Sean Whitton
2020-09-11 11:57 ` Lars Ingebrigtsen
2020-09-12 21:22 ` Sean Whitton
2020-09-13 13:09 ` Lars Ingebrigtsen
2021-06-06 9:20 ` Lars Ingebrigtsen
2021-06-28 2:02 ` Sean Whitton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875z9fe3l9.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=42865@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=spwhitton@spwhitton.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).