Created
November 16, 2010 21:55
-
-
Save kyleburton/702595 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun krb-rename-file-visited-by-this-buffer (new-name) | |
(interactive (list (read-string (format "Rename [%s] to: " buffer-file-name)))) | |
(let ((file-name buffer-file-name)) | |
(if (not (string-match "/" new-name)) | |
(setq new-name (format "%s%s" (file-name-directory file-name) | |
new-name))) | |
(message "rename-file: %s to %s" file-name new-name) | |
(rename-file file-name new-name) | |
(kill-buffer (buffer-name)) | |
(find-file new-name))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment