GNU bug report logs -
#53894
27.2; Clipboard copy -> C-y -> M-y -> Same clipboard copy does not push to kill ring
Previous Next
Reported by: Ignacio Casso <ignaciocasso <at> hotmail.com>
Date: Wed, 9 Feb 2022 09:35:01 UTC
Severity: normal
Tags: patch
Found in version 27.2
Done: Po Lu <luangruo <at> yahoo.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Ignacio Casso <ignaciocasso <at> hotmail.com> writes:
> I'm not sure if it's intentional or not, or even if Emacs can do
> anything about it (maybe since the text is the same, the clipboard is not
> actually modified and Emacs has no way to know). I just wanted to report
> it in case it is a bug.
It's intentional:
(defun gui-selection-value ()
(let ((clip-text
(when select-enable-clipboard
(let ((text (gui--selection-value-internal 'CLIPBOARD)))
(when (string= text "")
(setq text nil))
;; When `select-enable-clipboard' is non-nil,
;; killing/copying text (with, say, `C-w') will push the
;; text to the clipboard (and store it in
;; `gui--last-selected-text-clipboard'). We check
;; whether the text on the clipboard is identical to this
;; text, and if so, we report that the clipboard is
;; empty. See (bug#27442) for further discussion about
;; this DWIM action, and possible ways to make this check
;; less fragile, if so desired.
(prog1
(unless (equal text gui--last-selected-text-clipboard)
text)
(setq gui--last-selected-text-clipboard text)))))
But it's pretty fragile DWIM action, and is frequently not what I mean,
so I often resort to `clipboard-yank' instead to ensure that I really
get the clipboard contents.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 3 years and 52 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.