emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: write-region bug ?


From: Jean-Christophe Helary
Subject: Re: write-region bug ?
Date: Thu, 9 Jan 2020 00:27:35 +0900


> On Jan 6, 2020, at 14:58, Jean-Christophe Helary <address@hidden> wrote:
> 
> 
> 
>> On Jan 6, 2020, at 14:29, Eli Zaretskii <address@hidden> wrote:
>> 
>> 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.
> 
> 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."


→ 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 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]