unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 396355f: Re-fix charset issues when yanking non-plain-text elements
@ 2021-11-11 11:19 Eli Zaretskii
  2021-11-11 11:54 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2021-11-11 11:19 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

>    (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?



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-12  8:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 11:19 master 396355f: Re-fix charset issues when yanking non-plain-text elements Eli Zaretskii
2021-11-11 11:54 ` Lars Ingebrigtsen
2021-11-11 14:05   ` Eli Zaretskii
2021-11-12  2:45     ` Lars Ingebrigtsen
2021-11-12  8:55       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).