[gnu.emacs.bug] editing filename via find-alternate-file

peck@sun.com (Jeff Peck) (09/20/89)

 Most of my usage of find-alternate-file arise from having misspelled
a file or directory name, or i want to go back to a different version.
In each case, i typically want to just edit the filename a little bit.
The standard find-alternate-file does not supply the filename in the default
so i would have to retype it.  I suggest that the filename be included
in the default. (M-b C-k will remove it easily enough).

[This also makes a handy way to verify what your current filename is]

(defun find-alter-file (filename)
  "Like find-alternate-file, but presents current filename for editing."
  (interactive (list (read-file-name
		      "Find alternate file: "
		      (or (buffer-file-name) default-directory))))
  (find-alternate-file filename))