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: Sat, 22 Jun 2019 08:45:10 -0700 Message-ID: <874l4hzks9.fsf@ericabrahamsen.net> References: <20190621205531.14822.22802@vcs0.savannah.gnu.org> <20190621205533.D5EB520A01@vcs0.savannah.gnu.org> <87fto2zgyl.fsf@ericabrahamsen.net> 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="113296"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 22 17:46:28 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 1heiDi-000TII-QH for ged-emacs-devel@m.gmane.org; Sat, 22 Jun 2019 17:46:26 +0200 Original-Received: from localhost ([::1]:41342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1heiDh-0007uv-4h for ged-emacs-devel@m.gmane.org; Sat, 22 Jun 2019 11:46:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40998) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1heiCn-0007sC-67 for emacs-devel@gnu.org; Sat, 22 Jun 2019 11:45:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1heiCl-0007vv-8p for emacs-devel@gnu.org; Sat, 22 Jun 2019 11:45:29 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:40940 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 1heiCj-0007qN-IW for emacs-devel@gnu.org; Sat, 22 Jun 2019 11:45:27 -0400 Original-Received: from localhost (unknown [172.92.212.120]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id EEA3AFA648; Sat, 22 Jun 2019 15:45:16 +0000 (UTC) In-Reply-To: (Andreas Schwab's message of "Sat, 22 Jun 2019 10:20:05 +0200") 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:238038 Archived-At: Andreas Schwab writes: > On Jun 21 2019, Eric Abrahamsen wrote: > >> 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)) > > The coding rules for symbols and strings are quite different. If you > want read a symbol, you need to write a symbol. Actually what I want is to read/write strings. The calls to `read' made sense when group names were always symbols, but there isn't much point to that now. I was leaving them on general principle -- smallest viable change, etc -- but maybe I should just bite the bullet and switch to buffer substrings. Eric