[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 396355f: Re-fix charset issues when yanking non-plain-text el
From: |
Eli Zaretskii |
Subject: |
Re: master 396355f: Re-fix charset issues when yanking non-plain-text elements |
Date: |
Thu, 11 Nov 2021 13:19:52 +0200 |
> (let ((data (gui-backend-get-selection (or type 'PRIMARY)
> (or data-type 'STRING))))
> (when (and (stringp data)
> - (setq data-type (get-text-property 0 'foreign-selection data)))
> + ;; If this text property is set, then the data needs to
> + ;; be decoded -- otherwise it has already been decoded
> + ;; by the lower level functions.
> + (get-text-property 0 'foreign-selection data))
The old code took the data-type from the value of the
foreign-selection property, but now we disregard that. Is that on
purpose?
> + ;; Guess at the charset for types like text/html
> + ;; -- it can be anything, and different
> + ;; applications use different encodings.
> + ((string-match-p "\\`text/" (symbol-name data-type))
> + (decode-coding-string
> + data (car (detect-coding-string data))))
Did you really need the explicit call to detect-coding-string? AFAIR,
decode-coding-string does that automatically if needed. Did that fail
in some case?
- Re: master 396355f: Re-fix charset issues when yanking non-plain-text elements,
Eli Zaretskii <=