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: write-region bug ? Date: Fri, 3 Jan 2020 01:54:17 +0900 Message-ID: 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="105896"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 02 17:57:47 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 1in3n8-000RQX-Q9 for ged-emacs-devel@m.gmane.org; Thu, 02 Jan 2020 17:57:46 +0100 Original-Received: from localhost ([::1]:42910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1in3n7-0004Nh-BI for ged-emacs-devel@m.gmane.org; Thu, 02 Jan 2020 11:57:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60272) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1in3kp-0002Zm-Sy for emacs-devel@gnu.org; Thu, 02 Jan 2020 11:55:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1in3ko-0006Eq-Ii for emacs-devel@gnu.org; Thu, 02 Jan 2020 11:55:23 -0500 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:38067) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1in3ko-0006DP-CS for emacs-devel@gnu.org; Thu, 02 Jan 2020 11:55:22 -0500 X-Originating-IP: 182.251.133.156 Original-Received: from [172.20.10.2] (KD182251133156.au-net.ne.jp [182.251.133.156]) (Authenticated sender: jean.christophe.helary@traduction-libre.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 7975FC0005 for ; Thu, 2 Jan 2020 16:54:59 +0000 (UTC) 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.183.198 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:243867 Archived-At: I mentioned that in a mail sent on the 18th of December: > On Dec 18, 2019, at 23:10, Stefan Monnier = wrote: >=20 >> The code is a most simple one liner variation on the following: >>=20 >> (write-region "stuff" nil "path/to/my/file/test.txt" nil t nil t). >>=20 >> Sometimes the whole *line* above (contained in file "test.el") would = be >> copied to the file "test.txt" and I have no idea why. >=20 > Very curious. If you can come up with a recipe to reproduce it > somewhat-reliably, then please `M-x report-emacs-bug`. And I found a trivial way to reproduce the issue. Which may or may not = be an issue, depending on my understanding of the command, hence my = asking here for confirmation whether this is a bug or not... 1) create a foo.el file with only this content: (write-region "" nil "~/Desktop/bar.txt" nil t nil t) "~/Desktop/" can be anything that works on your system, the path just = needs to point at a file that does not exist. 2) open the file and evaluate the expression =E2=86=92 you should have an empty "bar.txt" at the location of your = choice 3) modify foo.el, by adding a line for ex 4) save-buffer =E2=86=92 foo.el changed on disk; really edit the buffer? (y, n, r or = C-h) =E2=86=92 for some reason, the foo.el buffer is now associated to = bar.txt, if you hit "y", bar.txt now contains (write-region "" nil = "~/Desktop/bar.txt" nil t nil t) Am I missing something ? Jean-Christophe Helary=20=