From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jean-Christophe Helary Newsgroups: gmane.emacs.devel Subject: Re: write-region bug ? Date: Sun, 5 Jan 2020 14:14:29 +0900 Message-ID: References: <87k169okfu.fsf@igel.home> <83zhf5ixe1.fsf@gnu.org> <83woa7ezzb.fsf@gnu.org> <83tv5afuft.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="231654"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 06:15:49 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1inyGS-000y9V-F2 for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 06:15:48 +0100 Original-Received: from localhost ([::1]:39268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inyGQ-0002y6-MH for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 00:15:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36640) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inyGJ-0002xq-MI for emacs-devel@gnu.org; Sun, 05 Jan 2020 00:15:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inyGH-0001Ve-OQ for emacs-devel@gnu.org; Sun, 05 Jan 2020 00:15:39 -0500 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:42163) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1inyGH-0001Jm-HD for emacs-devel@gnu.org; Sun, 05 Jan 2020 00:15:37 -0500 Original-Received: from [172.20.10.2] (KD182251134161.au-net.ne.jp [182.251.134.161]) (Authenticated sender: jean.christophe.helary@traduction-libre.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 849FC200003 for ; Sun, 5 Jan 2020 05:14:53 +0000 (UTC) In-Reply-To: <83tv5afuft.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.40.2.2.4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.178.232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243964 Archived-At: > On Jan 5, 2020, at 12:33, Eli Zaretskii wrote: >=20 >> From: Jean-Christophe Helary = >> Date: Sun, 5 Jan 2020 11:01:56 +0900 >>=20 >>> VISIT basically tells that the buffer should be considered as >>> visiting FILENAME. Here, we have VISIT and FILENAME but we don't = have >>> the buffer (except that by accident). >>=20 >> *Yes*, that's where I stopped understanding the documentation. Thank = you for pointing that out. >=20 > Please make sure you read the doc string as it is on the latest > emacs-27 branch (or master). DEFUN ("write-region", Fwrite_region, Swrite_region, 3, 7, "r\nFWrite region to file: \ni\ni\ni\np", doc: /* Write current region into specified file. When called from a program, requires three arguments: START, END and FILENAME. START and END are normally buffer positions specifying the part of the buffer to write. If START is nil, that means to use the entire buffer contents; END is ignored. *** If START is a string, then output that string to the file instead of any buffer contents; END is ignored. *** Optional fourth argument APPEND if non-nil means append to existing file contents (if any). If it is a number, seek to that offset in the file before writing. Optional fifth argument VISIT, if t or a string, means set the last-save-file-modtime of buffer to this file's modtime and mark buffer not modified. *** If VISIT is t, the buffer is marked as visiting FILENAME. *** So, practically speaking, the START string is output to the file, and = then, the buffer is "marked as visiting FILENAME" which practically = speaking means that it overwrites the START string. What is that for ? Jean-Christophe Helary=