Skip to content

Commit

Permalink
Allow users to create directories with crux-rename-file-and-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Apr 30, 2016
1 parent 2be95ea commit 1967a75
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-from-minibuffer "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 1967a75

Please sign in to comment.