Skip to content

Commit

Permalink
Merge pull request #29 from Wilfred/rename_file_and_buffer_tweaks
Browse files Browse the repository at this point in the history
Increase flexibility for inputs to crux-rename-file-and-buffer
  • Loading branch information
bbatsov committed Apr 30, 2016
2 parents 6d11d2e + 1967a75 commit 225b5e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crux.el
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ point reaches the beginning or end of the buffer, stop there."
(let ((filename (buffer-file-name)))
(if (not (and filename (file-exists-p filename)))
(rename-buffer (read-from-minibuffer "New name: " (buffer-name)))
(let ((new-name (read-file-name "New name: " filename)))
(let* ((new-name (read-from-minibuffer "New name: " filename))
(containing-dir (file-name-directory new-name)))
(make-directory containing-dir t)
(cond
((vc-backend filename) (vc-rename-file filename new-name))
(t
Expand Down

0 comments on commit 225b5e3

Please sign in to comment.