From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: docs for insert-file-contents use 'bytes' Date: Tue, 30 Sep 2008 15:06:17 +0900 Message-ID: References: <86ljxa67xi.fsf@lifelogs.com> <86hc7y64vm.fsf@lifelogs.com> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222754805 18669 80.91.229.12 (30 Sep 2008 06:06:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2008 06:06:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 30 08:07:43 2008 connect(): Connection refused 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 1KkYOc-00031V-Bh for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2008 08:07:42 +0200 Original-Received: from localhost ([127.0.0.1]:43114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkYNZ-0000HY-Eb for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2008 02:06:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkYNT-0000HP-PP for emacs-devel@gnu.org; Tue, 30 Sep 2008 02:06:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkYNS-0000GM-Hg for emacs-devel@gnu.org; Tue, 30 Sep 2008 02:06:30 -0400 Original-Received: from [199.232.76.173] (port=36626 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkYNS-0000G2-B5 for emacs-devel@gnu.org; Tue, 30 Sep 2008 02:06:30 -0400 Original-Received: from tyo201.gate.nec.co.jp ([202.32.8.193]:39036) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KkYNN-0000wh-Sb; Tue, 30 Sep 2008 02:06:26 -0400 Original-Received: from relay31.aps.necel.com ([10.29.19.54]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m8U66HLc013380; Tue, 30 Sep 2008 15:06:18 +0900 (JST) Original-Received: from relay21.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay31.aps.necel.com with ESMTP; Tue, 30 Sep 2008 15:06:18 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.112.215] [10.114.112.215]) by relay21.aps.necel.com with ESMTP; Tue, 30 Sep 2008 15:06:18 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id 23CF745B; Tue, 30 Sep 2008 15:06:17 +0900 (JST) System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: <86hc7y64vm.fsf@lifelogs.com> (Ted Zlatanov's message of "Mon, 29 Sep 2008 16:04:13 -0500") Original-Lines: 21 X-detected-operating-system: by monty-python.gnu.org: Solaris 8 (1) 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:104249 Archived-At: Ted Zlatanov writes: > EZ> Like with any other random bytes, I think: it will produce eight-bit-* > EZ> characters in the buffer. IOW, you get garbled text. > > This is not a safe operation mode with multibyte sequences; is there a > way to DTRT? I'm specifically thinking about a paged buffer mode where > you only see a small portion of the file (for editing large files, as we > discussed in another newsgroup a while ago). Why is it "not safe"? How would you do things differently? In conjunction with _file_ contents, a byte offset seems certainly the most natural thing. An "encoded character offset", for instance, would be far less efficient, much more complex to implement (and thus buggier), and harder to use in general. -Miles -- Sabbath, n. A weekly festival having its origin in the fact that God made the world in six days and was arrested on the seventh.