unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Miles Bader <miles@gnu.org>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: emacs-devel@gnu.org
Subject: Re: rename-file
Date: Thu, 27 Aug 2009 20:50:24 +0900	[thread overview]
Message-ID: <buoskfdtr0f.fsf@dhlpc061.dev.necel.com> (raw)
In-Reply-To: <871vmxebsm.fsf@escher.local.home> (Stephen Berman's message of "Thu, 27 Aug 2009 13:28:09 +0200")

Stephen Berman <stephen.berman@gmx.net> 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	other threads:[~2009-08-27 11:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26 16:05 rename-file Sam Steingold
2009-08-26 18:58 ` rename-file Stephen Berman
2009-08-27  3:16   ` rename-file Stefan Monnier
2009-08-27  8:38     ` rename-file Stephen Berman
2009-08-27  9:09       ` rename-file Andreas Schwab
2009-08-27 10:01         ` rename-file Stephen Berman
2009-08-27 10:21           ` rename-file Andreas Schwab
2009-08-27 11:28             ` rename-file Stephen Berman
2009-08-27 11:50               ` Miles Bader [this message]
2009-08-27 14:59                 ` rename-file Stephen Berman
2009-08-27 12:18               ` rename-file Andreas Schwab
2009-08-27 17:08       ` rename-file Stefan Monnier
2009-08-26 19:21 ` rename-file Stefan Monnier
2009-08-26 20:20   ` rename-file Lennart Borgman
2009-08-26 20:35   ` rename-file Sam Steingold
2009-08-27  3:15     ` rename-file Eli Zaretskii
2009-08-27  3:25     ` rename-file Richard Stallman
2009-08-27  3:41       ` rename-file Sam Steingold
2009-08-27 17:11         ` rename-file Stefan Monnier
2009-08-29  0:46         ` rename-file Richard Stallman
2009-08-31 22:09           ` rename-file Sam Steingold
2009-08-27 14:47     ` rename-file Sam Steingold
2009-08-26 20:42 ` rename-file martin rudalics
2009-08-27 13:49 ` rename-file Daniel Colascione

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=buoskfdtr0f.fsf@dhlpc061.dev.necel.com \
    --to=miles@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).