branch: elpa/crux
commit 1967a754832d8e02c0b230ea8fc026fda400d417
Author: Wilfred Hughes <m...@wilfred.me.uk>
Commit: Wilfred Hughes <m...@wilfred.me.uk>

    Allow users to create directories with crux-rename-file-and-buffer
---
 crux.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/crux.el b/crux.el
index 8c167f9..ff88d40 100644
--- a/crux.el
+++ b/crux.el
@@ -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

Reply via email to