Fix pasting from ?+ register in Emacs 29 #1677
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I found that on Emacs v29,
" + p
does not paste from the system clipboard if the clipboard was populated outside emacs, rather it pastes from the kill ring.It looks like this same bug briefly existed in the built-in
gui-selection-value
until it was fixed in this commit by checking a new vargui--last-cut-in-clipboard
.It also looks like
gui--selection-value-internal
(previouslyx-selection-value-internal
) has drifted from the evil code that's based on it. Rather than attempt to bring the evil code up to date while keeping compatibility with Emacs 24, I opted for a version check so we can just callgui--selection-value-internal
if it exists.It's unclear to me why this code was duplicated in evil in the first place. It's entirely possible it was for a good and still-applicable reason, in which case merging my fix here would be problematic. Anyway, here's the commit where it happened -- @f-fr, do you happen to recall?