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: Thu, 9 Jan 2020 00:27:35 +0900 Message-ID: <81246516-A350-4E2A-9F1C-F80BFA0C0316@traduction-libre.org> References: <87k169okfu.fsf@igel.home> <83zhf5ixe1.fsf@gnu.org> <83woa7ezzb.fsf@gnu.org> <83r20efua9.fsf@gnu.org> <83k165gbl5.fsf@gnu.org> <046646BD-7C4A-4D42-93F0-9B45980DD9BC@traduction-libre.org> <83y2uldzlz.fsf@gnu.org> <8587D3AF-EB7F-4AF1-806A-5C5EBB5DF8AA@traduction-libre.org> <219F7B4D-88EA-4EE3-A8EB-244A08F43B63@traduction-libre.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="13996"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 08 16:28:34 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.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 1ipDFq-000vyn-SB for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Jan 2020 16:28:19 +0100 Original-Received: from localhost ([::1]:45672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipDFp-0001Ns-3U for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Jan 2020 10:28:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33092) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipDFK-0000uC-Ck for emacs-devel@gnu.org; Wed, 08 Jan 2020 10:27:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipDFI-0001Rx-7y for emacs-devel@gnu.org; Wed, 08 Jan 2020 10:27:45 -0500 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:50465) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipDFI-0001R0-1w for emacs-devel@gnu.org; Wed, 08 Jan 2020 10:27:44 -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 relay11.mail.gandi.net (Postfix) with ESMTPSA id 3A3AF10001A for ; Wed, 8 Jan 2020 15:27:39 +0000 (UTC) In-Reply-To: <219F7B4D-88EA-4EE3-A8EB-244A08F43B63@traduction-libre.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.231 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:244122 Archived-At: > On Jan 6, 2020, at 14:58, Jean-Christophe Helary = wrote: >=20 >=20 >=20 >> On Jan 6, 2020, at 14:29, Eli Zaretskii wrote: >>=20 >> This is explained at the very beginning of the "Files" node in the = Emacs manual. The Glossary also explains that under Saving and under = Visiting. These are very basic notions in Emacs, so if the relations = between a buffer visiting a file and what happens when you save that = buffer aren't clear to you, I suggest a good reading of those parts in = the manual. >=20 > I'm right there. Thank you. File A.txt contains: (write-region "stuff" nil "B.txt" nil t nil t) File B.txt is empty until I run file A.txt. The manual says: 25.4 Writing to Files write-region "If visit is t, then Emacs establishes an association between the buffer = and the file: the buffer is then visiting that file." 25.1 Visiting Files "Visiting a file means reading a file into a buffer. Once this is done, = we say that the buffer is visiting that file, and call the file the = visited file of the buffer." =E2=86=92 My understanding from the above manual quotes is that file = B.txt is read into the buffer where file A.txt is. I don't know how that should look like, but what I see is seemingly the = opposite: full contents of file A.txt is written to file B.txt. There is obviously something that I am missing in the documentation. Jean-Christophe=20=