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

Multiple names for "the same" file



    Date: 10 April 1982 10:38-EST
    From: Philip E. Agre <AGRE at MIT-AI>

    Do C-X C-F on dir;name > for some nonexistent file so as to get a new buffer
    with (new file) for dir;name >.  Type some text at it and then do C-X C-W
    dir;name nonnum for some non-numeric fn2.  Then type some more text at the
    buffer and do C-X C-F dir;name >.  It will read dir;name nonnum from disk and
    give you a second buffer for the same file with the old text.  This is just
    asking for lossage.  I don't know what the right behavior is here but this
    clearly isn't it.
The same thing happens if the fn2 is numeric.  c-X c-W changes the name of the
file associated with the buffer.  If you had modified and written out the second
buffer, it would have written to name >, not name nonnum.  Thus your two buffers
were in fact holding different files; they were only the same file as long as no
one created another file that was ">" the original file.  I can't think of any
behavior that would be better.

Possibly the editor could print a warning if you do a Find File or Write
File and there exists another editor buffer whose file had the same
truename the last time it was read or written.  Note that this is not
necessarily an error.  For instance, I often have a file read into two
editor buffers, where one is the version I am modifying and the other is
the installed version which I am keeping in the editor so I can refer back
to it.