unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: master 396355f: Re-fix charset issues when yanking non-plain-text elements
Date: Thu, 11 Nov 2021 13:19:52 +0200	[thread overview]
Message-ID: <83mtmb0wiv.fsf@gnu.org> (raw)

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



             reply	other threads:[~2021-11-11 11:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 11:19 Eli Zaretskii [this message]
2021-11-11 11:54 ` master 396355f: Re-fix charset issues when yanking non-plain-text elements Lars Ingebrigtsen
2021-11-11 14:05   ` Eli Zaretskii
2021-11-12  2:45     ` Lars Ingebrigtsen
2021-11-12  8:55       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mtmb0wiv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).