Open dvzubarev opened 10 months ago
I'm confused, do you hit this bug on Emacs 29? Or Only 30? I can't reproduce it on 29, FWIW.
I can reproduce this on:
What are your values of variables:
window-system
select-enable-clipboard
Mine is:
'(x haiku)
or the second variable is nil, then that's why it is working for you. A comment from gui-last-cut-in-clipboard
;; The doc string of `interprogram-paste-function' says to return
;; nil if no other program has provided text to paste.
I think it means that if you copied text to clipboard from Emacs then this function should return nil
.
unless
statement that I pasted in the first message checks exactly this.
It may be useful for something, but evil uses this function to get the last value from the clipboard.
So I think that it is pretty safe to override gui-last-cut-in-clipboard
locally, before invocation of this function.
(let ((gui-last-cut-in-clipboard nil))
(gui--selection-value-internal what))
unless
statement will always succeed in this case.
os | emacs version | window-system |
select-enable-clipboard |
---|---|---|---|
MacOS 13.4 | 29.1 | ns |
nil |
NixOS 23.05 | 29.1 | x |
nil |
Also, up until a couple months ago I ran Emacs 29 on Arch Linux with window-system
== pgtk
, never noticed the issue you describe.
I can reproduce the "Register '+' is empty" error by setting select-enable-clipboard
to t
on my NixOS system (but not on MacOS).
I'm confused as to why you would bother with specifying the +
register at all when select-enable-clipboard
is t
? Doesn't that essentially make +
the default register? My intention in asking is not to dismiss this bug report entirely -- the "register is empty" error is clearly not the correct behavior -- just trying to understand the severity/impact of the problem.
I'm confused as to why you would bother with specifying the + register at all when select-enable-clipboard is t?
p/P
gets buggy sometimes and does not paste from clipboard. I don't know how to reproduce it and even whether it has something to do with evil. C-r +
works every time. It's kind of muscle memory for me.
Doesn't that essentially make + the default register?
not sure what letter is associated with default register, but from quick testing it seems I can use C-r 1
instead of C-r +
.
Issue type
Bug report
Environment
Emacs version: 30.0.50 Operating System: Ubuntu 22.04 Evil version: 1.15.0 Evil installation type: MELPA Graphical: Tested in a
make emacs
session: NoReproduction steps
i C-r +
(so far so good)ygE
i C-r +
or"+p
- evil-get-register: Register ‘+’ is empty"+ygE
i C-r +
or"+p
- evil-get-register: Register ‘+’ is emptyExpected behavior
I would expect that text is pasted after yanking text inside Emacs, like it works in Emacs 28.
Actual behavior
evil-get-register: Register ‘+’ is empty
Further notes
It is related to #1677 After yanking text inside Emacs try to eval
(gui--selection-value-internal 'CLIPBOARD)
. It will return nil. I extracted the code that works for Emacs <29:Eval
(old-x-selection 'CLIPBOARD)
it will return text that was yanked inside Emacs. Skimming over code ofgui--selection-value-internal
It seems that it can't pass the first unless.