Fix doom-create-missing-directories-h
Hanging variable reference caused a void-variable error.
This commit is contained in:
parent
f2906b073f
commit
9fbfc44f73
1 changed files with 7 additions and 6 deletions
|
@ -62,12 +62,13 @@ possible."
|
|||
(add-hook! 'find-file-not-found-functions
|
||||
(defun doom-create-missing-directories-h ()
|
||||
"Automatically create missing directories when creating new files."
|
||||
(and (not (file-remote-p buffer-file-name))
|
||||
(not (file-directory-p (file-name-directory buffer-file-name)))
|
||||
(y-or-n-p (format "Directory `%s' does not exist! Create it?"
|
||||
(file-name-directory buffer-file-name)))
|
||||
(progn (make-directory parent-directory 'parents)
|
||||
t))))
|
||||
(unless (file-remote-p buffer-file-name)
|
||||
(let ((parent-directory (file-name-directory buffer-file-name)))
|
||||
(and (not (file-directory-p parent-directory))
|
||||
(y-or-n-p (format "Directory `%s' does not exist! Create it?"
|
||||
parent-directory))
|
||||
(progn (make-directory parent-directory 'parents)
|
||||
t))))))
|
||||
|
||||
;; Don't autosave files or create lock/history/backup files. The
|
||||
;; editor doesn't need to hold our hands so much. We'll rely on git
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue