[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom
From: |
Juri Linkov |
Subject: |
bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom |
Date: |
Wed, 19 Aug 2020 04:16:58 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
>> +(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)?
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Sean Whitton, 2020/08/14
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Lars Ingebrigtsen, 2020/08/18
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom,
Juri Linkov <=
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Lars Ingebrigtsen, 2020/08/19
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Juri Linkov, 2020/08/19
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Lars Ingebrigtsen, 2020/08/20
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Juri Linkov, 2020/08/20
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Lars Ingebrigtsen, 2020/08/21
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Juri Linkov, 2020/08/23
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Lars Ingebrigtsen, 2020/08/24
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Stefan Kangas, 2020/08/24
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Lars Ingebrigtsen, 2020/08/24
- bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom, Juri Linkov, 2020/08/24