emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] scratch/gnus-decoded f041412 1/7: Decode group names i


From: Eric Abrahamsen
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Andreas Schwab <address@hidden> writes:

> On Jun 21 2019, Eric Abrahamsen <address@hidden> wrote:
>
>> 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))
>
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]