From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 396355f: Re-fix charset issues when yanking non-plain-text elements Date: Thu, 11 Nov 2021 16:05:08 +0200 Message-ID: <83k0he23fv.fsf@gnu.org> References: <83mtmb0wiv.fsf@gnu.org> <87mtma7vrq.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27254"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 11 15:05:48 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlAi3-0006qa-T1 for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Nov 2021 15:05:48 +0100 Original-Received: from localhost ([::1]:59770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlAi2-0000bT-Np for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Nov 2021 09:05:46 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlAhT-0008LK-H1 for emacs-devel@gnu.org; Thu, 11 Nov 2021 09:05:11 -0500 Original-Received: from [2001:470:142:3::e] (port=54032 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlAhT-0005CO-6Z; Thu, 11 Nov 2021 09:05:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=AFvUvBeWIj2QcfJ5jm/SIjfILD0OIe1/fRlc5A7e+p4=; b=G18GvXnpuYLV hXZxZLH0gIn7xRE3JBGsHSq8iutD8FbVRrYqHk70pxiHl/PC+2tyta527h3mAxpODV40FBiu/luuU knSPgfry1azjKh77e+k7hppkPLSA7GdVZw5bTab9aUbeg3cqQPDuAjEieJv2ccVakHJoMzR9uWLOU pcBaVRb3+rW+dLAZOpacLLBA42zpsXVIFfLEy9muzmD4mAfUeyBGLklavHk2syjnbMQygomGiENCM QMMruH2OE5JLyqt4SzN9BspsCgr8H7tkudDnjf2ZMncX0SN2OgyRfxg4CCwKiET0SEyeDqHxY3pfH 8od95tsI53nOy3/6HXYvhw==; Original-Received: from [87.69.77.57] (port=2163 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlAhS-0003Ay-Q7; Thu, 11 Nov 2021 09:05:11 -0500 In-Reply-To: <87mtma7vrq.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 11 Nov 2021 12:54:17 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279260 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Thu, 11 Nov 2021 12:54:17 +0100 > > >> + ;; 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? > > Can you give a nil to decode-coding-string as the coding system? It's > not documented. If by nil you means "don't know", then I think you should use 'undecided instead. That's exactly what 'undecided means.