emacs-devel
[Top][All Lists]
Advanced

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

Re: rename-file


From: Miles Bader
Subject: Re: rename-file
Date: Thu, 27 Aug 2009 20:50:24 +0900

Stephen Berman <address@hidden> writes:
> I don't understand how anyone can deny that evaluating the variable
> whose value is documented as the "Name of file visited in current
> buffer, or nil if not visiting a file" should return the correct current
> name of the visited file.

Because "rename-file" is a relatively low-level command, which just
tells the OS to rename the file.

If you want "smart" renaming, use dired to rename files ("R" command).
It will update buffer filenames (and buffer names) accordingly.

While the latter behavior is convenient, there's certainly nothing
_wrong_ with the former -- there's no guarantee that a buffer's filename
variable refers an existing file at all (and really there can't be,
since in the general case, emacs can't keep track of what goes on in the
filesystem behind its back).

-Miles

-- 
"An atheist doesn't have to be someone who thinks he has a proof that
there can't be a god.  He only has to be someone who believes that the
evidence on the God question is at a similar level to the evidence on
the werewolf question."  [John McCarthy]




reply via email to

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