emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Gnus; Restore multi encoding support for NNTP


From: Lars Ingebrigtsen
Subject: Re: [PATCH] Gnus; Restore multi encoding support for NNTP
Date: Fri, 31 Dec 2021 16:59:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

LdBeth <andpuke@foxmail.com> writes:

> This property is automatically added by `decode-coding-string` when
> the decoding is non trivial. It seems Gnus can save and restore text
> properties without further modification, and at least this won't break
> anything that is already working. Please let me know if this is an
> unreliable behavior.
>
> ```
> (decode-coding-string "\262\342\312\324" 'gbk)
> ;; ==> #("测试" 0 2 (charset chinese-gbk)) ;; "test" in Chinese
>
> ```

Ah, right, I'd totally forgotten that bit.  I think it can be relied
upon.  And storing the info as a text property will probably work in
Gnus -- it'll save the data to .newsrc.eld, as you've found out -- but
it sounds pretty brittle to me.  That is, I wouldn't be surprised if the
text property goes missing at some point, because the code in Gnus isn't
written with text properties in mind.

> Lars> And...  I don't understand why `gnus-group-real-name' should encode
> Lars> anything -- it's a function used everywhere to just strip the prefix
> Lars> from group names, and doesn't really have anything conceptually to do
> Lars> with translating to on-the-wire formats.
>
> oops, I'm doing this wrong. I was meant to modify only where
> `gnus-group-real-name' been called inside `gnus-int.el`.
>
> Btw I figured it is not a good idea to do encoding in nntp.el because
> the decoding was not done in nntp.el either.

Perhaps just having this in an alist in nntp.el somewhere would be the
most logical choice, even though it means that nntp.el peeks at Gnus
variables. 

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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