From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65667 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: [Unicode-2] `read' always returns multibyte symbol Date: Thu, 15 Nov 2007 08:52:57 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195084431 3314 80.91.229.12 (14 Nov 2007 23:53:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2007 23:53:51 +0000 (UTC) Cc: Kenichi Handa , ding@gnus.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 15 00:53:54 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IsS3O-0005hI-87 for ged-emacs-devel@m.gmane.org; Thu, 15 Nov 2007 00:53:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IsS3B-0003f2-Lv for ged-emacs-devel@m.gmane.org; Wed, 14 Nov 2007 18:53:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IsS34-0003cW-OX for emacs-devel@gnu.org; Wed, 14 Nov 2007 18:53:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IsS33-0003bk-0f for emacs-devel@gnu.org; Wed, 14 Nov 2007 18:53:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IsS32-0003bd-MY for emacs-devel@gnu.org; Wed, 14 Nov 2007 18:53:32 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IsS31-0005dm-Js for emacs-devel@gnu.org; Wed, 14 Nov 2007 18:53:32 -0500 Original-Received: from [66.225.201.151] (port=52007 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.68) (envelope-from ) id 1IsS2r-0002lp-3Z; Wed, 14 Nov 2007 17:53:22 -0600 X-Hashcash: 1:20:071114:monnier@iro.umontreal.ca::+G/NK+fOGDbqZI4k:00000000000000000000000000000000000003/xU X-Hashcash: 1:20:071114:handa@ni.aist.go.jp::UzHpCyNyASee87yW:0000000000000000000000000000000000000000000Wra X-Hashcash: 1:20:071114:ding@gnus.org::SFkVDd1ZKyHPd7h8:00005bG0 X-Hashcash: 1:20:071114:emacs-devel@gnu.org::sl6aF7wjKvNbHi1K:0000000000000000000000000000000000000000008BLK X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:77NSEyJY9qyGKp+xGvuP4N5I4Bo= X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:83217 gmane.emacs.gnus.general:65667 Archived-At: >>>>> 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,