From: Robert Pluim Date: Thu, 22 Jun 2023 14:59:19 +0000 (+0200) Subject: Autodetect coding system when yanking media X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=587efce9faeb1a0b23b8367c02264a6f988832d0;p=emacs.git Autodetect coding system when yanking media Some browers send eg 'text/html' selections formatted as UTF-8, but with a type of STRING, which actually means iso-latin-1. Autodetect the correct coding system to use by calling 'gui-get-selection'. * lisp/yank-media.el (yank-media--get-selection): Call 'gui-get-selection' instead of 'gui-backend-get-selection'. --- diff --git a/lisp/yank-media.el b/lisp/yank-media.el index 3e33c1f9994..abc137d9c38 100644 --- a/lisp/yank-media.el +++ b/lisp/yank-media.el @@ -81,7 +81,7 @@ all the different selection types." (gui-get-selection 'CLIPBOARD 'TARGETS))) (defun yank-media--get-selection (data-type) - (when-let ((data (gui-backend-get-selection 'CLIPBOARD data-type))) + (when-let ((data (gui-get-selection 'CLIPBOARD data-type))) (if (string-match-p "\\`text/" (symbol-name data-type)) (yank-media-types--format data-type data) data)))