branch: elpa/evil commit 9af2faf95992d36781cd697c9fcdbe108372ce3d Author: Elliott Shugerman <eeshuger...@gmail.com> Commit: Tom Dalziel <33435574+tomd...@users.noreply.github.com>
Fix pasting from ?+ in Emacs 29 --- evil-common.el | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/evil-common.el b/evil-common.el index 7ae8feb3f7..0ee6c1484a 100644 --- a/evil-common.el +++ b/evil-common.el @@ -2147,22 +2147,23 @@ The following special registers are supported. (and (< reg (length kill-ring)) (current-kill reg t)))) ((memq register '(?* ?+)) - ;; the following code is modified from - ;; `x-selection-value-internal' - (let ((what (if (eq register ?*) 'PRIMARY 'CLIPBOARD)) - (request-type (or (and (boundp 'x-select-request-type) - x-select-request-type) - '(UTF8_STRING COMPOUND_TEXT STRING))) - text) - (unless (consp request-type) - (setq request-type (list request-type))) - (while (and request-type (not text)) - (condition-case nil - (setq text (evil-get-selection what (pop request-type))) - (error nil))) - (when text - (remove-text-properties 0 (length text) '(foreign-selection nil) text)) - text)) + (let ((what (if (eq register ?*) 'PRIMARY 'CLIPBOARD))) + (if (version<= "25" emacs-version) + (gui--selection-value-internal what) + ;; the following code is modified from `x-selection-value-internal' + (let ((request-type (or (and (boundp 'x-select-request-type) + x-select-request-type) + '(UTF8_STRING COMPOUND_TEXT STRING))) + text) + (unless (consp request-type) + (setq request-type (list request-type))) + (while (and request-type (not text)) + (condition-case nil + (setq text (evil-get-selection what (pop request-type))) + (error nil))) + (when text + (remove-text-properties 0 (length text) '(foreign-selection nil) text)) + text)))) ((eq register ?\C-W) (unless (evil-ex-p) (user-error "Register <C-w> only available in ex state"))