unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* write-region bug ?
@ 2020-01-02 16:54 Jean-Christophe Helary
  2020-01-02 17:08 ` Andreas Schwab
  0 siblings, 1 reply; 32+ messages in thread
From: Jean-Christophe Helary @ 2020-01-02 16:54 UTC (permalink / raw)
  To: Emacs developers

I mentioned that in a mail sent on the 18th of December:

> On Dec 18, 2019, at 23:10, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> 
>> The code is a most simple one liner variation on the following:
>> 
>> (write-region "stuff" nil "path/to/my/file/test.txt" nil t nil t).
>> 
>> Sometimes the whole *line* above (contained in file "test.el") would be
>> copied to the file "test.txt" and I have no idea why.
> 
> 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

→ 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

→  foo.el changed on disk; really edit the buffer? (y, n, r or C-h)

→ 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 


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2020-01-09 23:21 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-02 16:54 write-region bug ? Jean-Christophe Helary
2020-01-02 17:08 ` Andreas Schwab
2020-01-02 17:22   ` Jean-Christophe Helary
2020-01-02 17:25   ` Eli Zaretskii
2020-01-02 17:35     ` Jean-Christophe Helary
2020-01-04 19:58     ` Stefan Monnier
2020-01-04 20:19       ` Eli Zaretskii
2020-01-04 22:58         ` Stefan Monnier
2020-01-05  2:01           ` Jean-Christophe Helary
2020-01-05  3:33             ` Eli Zaretskii
2020-01-05  5:14               ` Jean-Christophe Helary
2020-01-05 15:20                 ` Eli Zaretskii
2020-01-05  3:37           ` Eli Zaretskii
2020-01-05  4:54             ` Stefan Monnier
2020-01-05 15:35               ` Eli Zaretskii
2020-01-05 16:42                 ` Jean-Christophe Helary
2020-01-06  3:37                   ` Eli Zaretskii
2020-01-06  3:50                     ` Jean-Christophe Helary
2020-01-06  5:29                       ` Eli Zaretskii
2020-01-06  5:58                         ` Jean-Christophe Helary
2020-01-08 15:27                           ` Jean-Christophe Helary
2020-01-08 16:05                             ` Eli Zaretskii
2020-01-09  0:04                               ` Jean-Christophe Helary
2020-01-09  0:43                                 ` Noam Postavsky
2020-01-09 12:30                             ` Jean-Christophe Helary
2020-01-09 14:07                               ` Eli Zaretskii
2020-01-09 14:39                                 ` Jean-Christophe Helary
2020-01-09 17:03                                   ` Eli Zaretskii
2020-01-09 23:21                                     ` Jean-Christophe Helary
2020-01-05 17:37                 ` Stefan Monnier
2020-01-05 18:26                   ` Eli Zaretskii
2020-01-05 19:27                     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).