From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: docs for insert-file-contents use 'bytes' Date: Mon, 29 Sep 2008 23:12:58 +0300 Message-ID: References: <86ljxa67xi.fsf@lifelogs.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1222719220 669 80.91.229.12 (29 Sep 2008 20:13:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Sep 2008 20:13:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 29 22:14:38 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 1KkP8X-00062C-Um for ged-emacs-devel@m.gmane.org; Mon, 29 Sep 2008 22:14:30 +0200 Original-Received: from localhost ([127.0.0.1]:35657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkP7U-0007bx-Ue for ged-emacs-devel@m.gmane.org; Mon, 29 Sep 2008 16:13:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkP7N-0007Z7-Bf for emacs-devel@gnu.org; Mon, 29 Sep 2008 16:13:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkP7F-0007Sr-TO for emacs-devel@gnu.org; Mon, 29 Sep 2008 16:13:10 -0400 Original-Received: from [199.232.76.173] (port=42003 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkP7F-0007SL-1U for emacs-devel@gnu.org; Mon, 29 Sep 2008 16:13:09 -0400 Original-Received: from mtaout1.012.net.il ([84.95.2.1]:19502) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KkP7C-0007hK-U7 for emacs-devel@gnu.org; Mon, 29 Sep 2008 16:13:07 -0400 Original-Received: from HOME-C4E4A596F7 ([77.127.170.116]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K7Z002B047FWXB0@i-mtaout1.012.net.il> for emacs-devel@gnu.org; Mon, 29 Sep 2008 23:14:12 +0300 (IDT) In-reply-to: <86ljxa67xi.fsf@lifelogs.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.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:104232 Archived-At: > From: Ted Zlatanov > Date: Mon, 29 Sep 2008 14:58:17 -0500 > > The docs for insert-file-contents say the range is in bytes, but that > function does decoding of the contents. Can it, therefore, read from an > undesirable position (e.g. the middle of a UTF-8 sequence)? The range _is_ in bytes (you will see in fileio.c that Emacs uses `lseek' to get to the required file positions). Yes, reading a part of a multibyte sequence is a possibility. > How does Emacs handle that? Like with any other random bytes, I think: it will produce eight-bit-* characters in the buffer. IOW, you get garbled text. > Either way the docs need to state the operation mode clearly. Assuming I don't miss anything, and the above is indeed correct, what would you like the doc string to say, exactly?