emacs-devel
[Top][All Lists]
Advanced

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

Re: write-region bug ?


From: Noam Postavsky
Subject: Re: write-region bug ?
Date: Wed, 8 Jan 2020 19:43:49 -0500

On Wed, 8 Jan 2020 at 19:04, Jean-Christophe Helary
<address@hidden> 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 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.

> >       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.



reply via email to

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