[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rename-file
From: |
martin rudalics |
Subject: |
Re: rename-file |
Date: |
Wed, 26 Aug 2009 22:42:51 +0200 |
User-agent: |
Thunderbird 2.0.0.21 (Windows/20090302) |
> Why isn't the buffer, which is visiting a file, renamed
> when I rename the underlying file with rename-file?
Personally, I do the following when renaming a file or a directory:
First I do a `bookmark-set-filename' on every involved buffer. Next I
do (the precise reasons I don't remember) for any BUFFER whose filename
is set to NEW
(with-current-buffer buffer
(let ((buffer-modified-p (buffer-modified-p)))
;; make buffer visit new
(set-visited-file-name new nil t)
(clear-visited-file-modtime)
(set-buffer-modified-p buffer-modified-p)))))
`dired-rename-file' does something similar, but I never looked into
that.
Finally, I do a redisplay to assure that modelines and frame titles get
updated correctly. When renaming directories I also set the default
directory, if necessary.
All these are sufficient for my personal needs and have not caused any
problems over the past five years. But I'm afraid there's a number of
more hairy issues involved when a package has stored away some buffers'
names in a local list.
martin
- Re: rename-file, (continued)
- Re: rename-file, Stefan Monnier, 2009/08/26
- Re: rename-file, Lennart Borgman, 2009/08/26
- Re: rename-file, Sam Steingold, 2009/08/26
- Re: rename-file, Eli Zaretskii, 2009/08/26
- Re: rename-file, Richard Stallman, 2009/08/26
- Re: rename-file, Sam Steingold, 2009/08/26
- Re: rename-file, Stefan Monnier, 2009/08/27
- Re: rename-file, Richard Stallman, 2009/08/28
- Re: rename-file, Sam Steingold, 2009/08/31
- Re: rename-file, Sam Steingold, 2009/08/27
Re: rename-file,
martin rudalics <=
Re: rename-file, Daniel Colascione, 2009/08/27