From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: write-region bug ? Date: Wed, 8 Jan 2020 19:43:49 -0500 Message-ID: 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> <81246516-A350-4E2A-9F1C-F80BFA0C0316@traduction-libre.org> <83o8veaq74.fsf@gnu.org> <6F6EA940-AA81-40DC-9102-2A7633D76377@traduction-libre.org> Mime-Version: 1.0 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="34660"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Emacs developers To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 09 01:46:11 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 1ipLwZ-000hil-Cz for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Jan 2020 01:44:59 +0100 Original-Received: from localhost ([::1]:51384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipLwY-0000Nx-9T for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Jan 2020 19:44:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56837) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipLvk-0007V4-GK for emacs-devel@gnu.org; Wed, 08 Jan 2020 19:44:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipLvi-0006Wx-PG for emacs-devel@gnu.org; Wed, 08 Jan 2020 19:44:08 -0500 Original-Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]:42718) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipLvi-0006T9-6q for emacs-devel@gnu.org; Wed, 08 Jan 2020 19:44:06 -0500 Original-Received: by mail-ot1-x32c.google.com with SMTP id 66so5519000otd.9 for ; Wed, 08 Jan 2020 16:44:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=N2IUo2SU+9vujp/xWire6mSzvkI1emnpEklRIHoLlGQ=; b=iKTI7kyX8niVfike0kC6ZTIo7PPP4cue/eUOkSHnpdU+dC4aJDoe20XI5tGT393ME9 Umg2E/4xaTSv6R9x1iExt9CEXqTP8hMyuQVScKt3RbhCm7X6x6rfDx8EucU+0klDuL4g yRGfGrpXyFWwPD1WrGagGKvpDGbH/Q5S6ho4pDZ41NA/I686XqZ+tGm6P7z42oPnbPYH K+zpQA2AceqGO7FwFj/vb+s4J2h84MLv3f/TZiue6QC7Phx7gTQscFo08pCKMDjLXUFE VURk3W0fwrL6l4djOD7doLTIB5gh1PwuQVyKlXvjwiHHXbh9XGXncLzOGqOTFjdkqtUm OTqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=N2IUo2SU+9vujp/xWire6mSzvkI1emnpEklRIHoLlGQ=; b=DFbZ0F9hMr2zxnoL2kH0uV8f6kzKBNb/TPxLRmvTgVaJr5/NksNSoqgwdoptsghdOc ZuifARQaExEaOCqxTzEX6aNo6wOe5tbFerPloDh592DrRKi6vpukPrvtZE3x6pVV42UC CAPgi/EpzUNI01d1jUyGljXmE9K1jE10Oh5U7uKEOAhMRNwXpNNtwWAD1u2TQHPysjUB wRbEfGCRVM85O5IdXwohIVHqHJR1iRdRLouzscXGbYUJdSEIo3a+tSW3gZ9gQ/j8wNHi s2247NMKGfPdoKj10o2Z4R1AO8RMsz0IxBIYWo+mBx09I1Z/epgAOPmEneRR6XexVxF8 /ceQ== X-Gm-Message-State: APjAAAXvUPaiMM+tY8ZsgwJobcZWnCfkA6/YW+DgKBOBTK/1QF7NVJ8S ZtWhGqi56C6Lc1jAjz3Tu0tosnWbZI06mEuTjTty9Q== X-Google-Smtp-Source: APXvYqyRbSvHDD5LT0Zurbz5qJglugb5ghLbgThwByiYQ0czi5ZIxORBTcSdrtI0oKCbY9AHA8pRp3sNTN/k+2tQC8M= X-Received: by 2002:a05:6830:1d59:: with SMTP id p25mr6619879oth.308.1578530645200; Wed, 08 Jan 2020 16:44:05 -0800 (PST) In-Reply-To: <6F6EA940-AA81-40DC-9102-2A7633D76377@traduction-libre.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32c 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:244156 Archived-At: On Wed, 8 Jan 2020 at 19:04, Jean-Christophe Helary wrote: > >> "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 visit= ed 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 th= e opposite: full contents of file A.txt is written to file B.txt. > >> > >> There is obviously something that I am missing in the documentation. > > Saving a buffer means copying its text into the file that was > > visited (q.v.) in that buffer. > > > > IOW, the association established by visiting means that saving the > > buffer well update the visited file. > > That's obviously not the part I do not understand. I think the problem is that "visiting" can mean both reading the file contents into the buffer, and setting up the association for future buffer saves. For write-region, visiting means only setting up the association, not reading the file contents. Normally, visiting is done by find-file, which both reads the file in, and sets up the association, so the ambiguity doesn't matter in that case.