From 587efce9faeb1a0b23b8367c02264a6f988832d0 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 22 Jun 2023 16:59:19 +0200 Subject: [PATCH] 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'. --- lisp/yank-media.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))) -- 2.39.2