From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] scratch/gnus-decoded f041412 1/7: Decode group names in newsrc files as raw-text, not utf-8 Date: Fri, 21 Jun 2019 15:55:30 -0700 Message-ID: <87fto2zgyl.fsf@ericabrahamsen.net> References: <20190621205531.14822.22802@vcs0.savannah.gnu.org> <20190621205533.D5EB520A01@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="96032"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 22 00:57:26 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1heSTF-000OqB-B0 for ged-emacs-devel@m.gmane.org; Sat, 22 Jun 2019 00:57:25 +0200 Original-Received: from localhost ([::1]:38308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1heSTC-0005rj-KS for ged-emacs-devel@m.gmane.org; Fri, 21 Jun 2019 18:57:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33086) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1heSRf-0005rG-Qt for emacs-devel@gnu.org; Fri, 21 Jun 2019 18:55:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1heSRe-0000ot-71 for emacs-devel@gnu.org; Fri, 21 Jun 2019 18:55:47 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:53666 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1heSRe-0000di-35 for emacs-devel@gnu.org; Fri, 21 Jun 2019 18:55:46 -0400 Original-Received: from localhost (unknown [172.92.212.120]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id C776EFA42A; Fri, 21 Jun 2019 22:55:36 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Fri, 21 Jun 2019 18:17:34 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 52.70.2.18 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:238011 Archived-At: Stefan Monnier writes: >> (decode-coding-string >> - (symbol-name group) 'utf-8))) >> + (symbol-name group) 'raw-text))) > > Actually, I was misremembering: raw-text is basically like `binary`, so > the above `decoding` will only return ASCII and "eight-bit" byte-chars. > Is that the intention? To be perfectly honest, I don't know what the intention is, I'm just trying to preserve original behavior. Consider the group named nnml:=E3=83=86=E3=82=B9=E3=83=88. ------ In Emacs 26, this group name is the symbol 'nnml:\343\203\206\343\202\271\343\203\210, but kept in gnus-newsrc-alist as the string version of that. It is written to the newsrc (not newsrc.eld) file with: (with-current-buffer buf (mm-disable-multibyte) (insert "nnml:\343\203\206\343\202\271\343\203\210") (let ((coding-system-for-write 'raw-text)) (save-buffer))) =20=20=20=20 And read with: (set-buffer (nnheader-find-file-noselect newsrc-file)) (setq symbol (read (current-buffer))) (setq group (symbol-name symbol)) ----- In master, the group name is always the string "nnml:\343\203\206\343\202\271\343\203\210". It's written and read the same way. ----- In scratch/gnus-decoded, the group name is the string "nnml:=E3=83=86=E3=82= =B9=E3=83=88". It is written to newsrc with: (with-current-buffer buf (insert "nnml:=E3=83=86=E3=82=B9=E3=83=88") (let ((coding-system-for-write 'raw-text)) (save-buffer))) And read with: (set-buffer (nnheader-find-file-noselect newsrc-file)) (setq group (read (current-buffer)) group (decode-coding-string (symbol-name group) 'raw-text)) ----- What I'm hoping is that the bytes written to the newsrc file will be exactly the same over these three versions. This is for interoperability with other newsreader programs. The group name itself should go from encoded-string symbol in Emacs 26, to encoded string in master, to decoded string in scratch/gnus-decoded. If that's not what's happening, I would like to know! Eric