From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.devel Subject: Re: master d1c9310: DOn't use string-as-unibyte in Gnus Date: Wed, 01 Feb 2017 19:00:51 +0900 Organization: Emacsen advocacy group Message-ID: References: <20170131165808.28198.10570@vcs.savannah.gnu.org> <20170131165808.9F18722015F@vcs.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1485943325 4857 195.159.176.226 (1 Feb 2017 10:02:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 1 Feb 2017 10:02:05 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (i686-pc-cygwin) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 01 11:02:01 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYrjl-00013u-C1 for ged-emacs-devel@m.gmane.org; Wed, 01 Feb 2017 11:02:01 +0100 Original-Received: from localhost ([::1]:45486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYrjq-0007Vt-O9 for ged-emacs-devel@m.gmane.org; Wed, 01 Feb 2017 05:02:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYris-0006ms-JT for emacs-devel@gnu.org; Wed, 01 Feb 2017 05:01:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYrin-0003fC-Ot for emacs-devel@gnu.org; Wed, 01 Feb 2017 05:01:06 -0500 Original-Received: from mail-hampton.hostforweb.net ([205.234.186.191]:41043 helo=hampton.hostforweb.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cYrin-0003ds-Lu for emacs-devel@gnu.org; Wed, 01 Feb 2017 05:01:01 -0500 Original-Received: from s70.gtokyofl21.vectant.ne.jp ([202.215.75.70]:60000 helo=localhost) by hampton.hostforweb.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1cYrif-002zsb-4e; Wed, 01 Feb 2017 04:00:58 -0600 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Cancel-Lock: sha1:K6jYDh3i3QPDP8zyVj7HZBxwvgo= X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hampton.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Get-Message-Sender-Via: hampton.hostforweb.net: authenticated_id: yamaoka/from_h X-Authenticated-Sender: hampton.hostforweb.net: yamaoka@jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (barebone) [generic] [fuzzy] X-Received-From: 205.234.186.191 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211832 Archived-At: Hi Lars, On Tue, 31 Jan 2017 16:58:08 +0000, Lars Ingebrigtsen wrote: > branch: master > commit d1c931009004aef847105b7bac6b6ffafd985b82 > Author: Lars Ingebrigtsen > Commit: Lars Ingebrigtsen > DOn't use string-as-unibyte in Gnus [...] > * lisp/gnus/mml.el (mml-generate-mime-1): Ditto. [...] > --- a/lisp/gnus/mml.el > +++ b/lisp/gnus/mml.el > @@ -696,9 +696,10 @@ be \"related\" or \"alternate\"." > (set-buffer-multibyte nil) > (cond > ((cdr (assq 'buffer cont)) > - (insert (string-as-unibyte > + (insert (encode-coding-string > (with-current-buffer (cdr (assq 'buffer cont)) > - (buffer-string))))) > + (buffer-string)) > + 'utf-8))) > ((and filename > (not (equal (cdr (assq 'nofile cont)) "yes"))) > (let ((coding-system-for-read mm-binary-coding-system)) This change breaks a jpeg image (at least). Recipe: =E3=83=BBVisit an image file using `universal-coding-system-argument' with `binary' and `find-file', i.e.: C-x RET c binary RET C-x C-f FILENAME RET C-c C-c =E3=83=BBOpen a message draft. =E3=83=BBInsert this mml tag: <#part type=3D"image/jpeg" disposition=3Dinline buffer=3D"IMAGE"> Where "IMAGE" is the buffer name that visits the image file. =E3=83=BBPreview it by `C-c RET P' or send it by `C-c C-c'. This means that a warning often seen recently =E2=80=98string-as-unibyte=E2=80=99 is an obsolete function (as of 26.1); use =E2=80=98encode-coding-string=E2=80=99. does not say the truth, does it? Thanks.