Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pasting from ?+ register in Emacs 29 #1677

Merged
merged 3 commits into from
Sep 29, 2022

Conversation

eeshugerman
Copy link
Contributor

@eeshugerman eeshugerman commented Sep 27, 2022

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 var gui--last-cut-in-clipboard.

It also looks like gui--selection-value-internal (previously x-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 call gui--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?

@eeshugerman eeshugerman changed the title Fix pasting from ?+ register in emacs 29 Fix pasting from ?+ register in Emacs 29 Sep 28, 2022
@tomdl89
Copy link
Member

tomdl89 commented Sep 28, 2022

Thanks for the PR. If you'd like to err on the safe side, we could change (version<= "25" emacs-version) to (version<= "29" emacs-version), merge it, and give the bleeding edge folks a chance to report back? p.s. Frank hasn't been active on here for years, so don't be too optimistic about hearing from him.

@eeshugerman
Copy link
Contributor Author

👍 I like that idea -- will update this evening

@f-fr
Copy link

f-fr commented Sep 28, 2022

Actually I did reply (by mail, I don't know why the answer doesn't appear hear ...). Anyway, that was my (not very helpful) answer:

I do not remember anymore, sorry. At that time we also tried to keep compatibility with Emacs 22, 23 or so, maybe that was the reason. I would suggest going ahead and see if it works with Emacs ≥ 26 or so.

PS: the commit referred to some bug report, so maybe checkout the revision before that commit and try to reproduce the problem

@eeshugerman
Copy link
Contributor Author

Got it, thanks for the input Frank! To play it safe I went with just 29 for now.

@tomdl89 tomdl89 merged commit faee2de into emacs-evil:master Sep 29, 2022
@smartepsh
Copy link

Thank you so much for the fix. I've been using simpleclip before this and it was very awkward.

@dvzubarev
Copy link
Contributor

I described a problem that is related to this fix in #1843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants