all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <87fto2zgyl.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <jwv7e9ey48l.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 21 Jun 2019 18:17:34 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> 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:テスト.

------

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)))
    
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:テスト". It
is written to newsrc with:

(with-current-buffer buf
  (insert "nnml:テスト")
  (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



  reply	other threads:[~2019-06-21 22:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190621205531.14822.22802@vcs0.savannah.gnu.org>
     [not found] ` <20190621205533.D5EB520A01@vcs0.savannah.gnu.org>
2019-06-21 22:17   ` [Emacs-diffs] scratch/gnus-decoded f041412 1/7: Decode group names in newsrc files as raw-text, not utf-8 Stefan Monnier
2019-06-21 22:55     ` Eric Abrahamsen [this message]
2019-06-22  8:20       ` Andreas Schwab
2019-06-22 15:45         ` Eric Abrahamsen

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

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

  git send-email \
    --in-reply-to=87fto2zgyl.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.