emacs-devel
[Top][All Lists]
Advanced

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

Re: [Unicode-2] `read' always returns multibyte symbol


From: Katsumi Yamaoka
Subject: Re: [Unicode-2] `read' always returns multibyte symbol
Date: Thu, 15 Nov 2007 08:52:57 +0900
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

>>>>> Stefan Monnier wrote:

>> !     ;; Use a unibyte buffer in order to make `read' read non-ASCII
>> !     ;; group names (which have been encoded) as unibyte strings.
>> !     (mm-with-unibyte-buffer
>> !       (insert-buffer-substring cur)

> Why is `cur' a multibyte buffer?  Since it contains encoded strings, I'd
> expect it would be better (more robust and convenient) to use a unibyte
> buffer for it.

Good point.  The `cur' is `nntp-server-buffer' (" *nntpd*") or
`gnus-work-buffer' (" *gnus work*") as the case may be.  Gnus uses
those buffers for various purposes.  Although there looks no
situation where it is necessary to have multibyte data as far as
I can observe, Gnus explicitly sets them as multibyte buffers (see
`nnheader-init-server-buffer' and `gnus-set-work-buffer').  I
believe the reason they do so is to prevent from breaking data
when copying them to another multibyte buffer (IIUC, copying data
from a multibyte buffer to a unibyte buffer causes no problem).
So, I didn't modify those buffers' multibyteness.  If I introduced
a new unibyte work buffer (such as " *gnus binary work*"), it
required that `gnus-read-active-file-2' binds `nntp-server-buffer'
to it for example.  It is used by all the back ends but I'm not
sure it never causes a problem with them all.

Regards,




reply via email to

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