Make missing directories automatically
This commit is contained in:
parent
e6a79ce0a8
commit
8f34521e56
1 changed files with 11 additions and 0 deletions
11
config.org
11
config.org
|
@ -142,6 +142,17 @@ It’s 2022.
|
|||
(setq python-shell-interpreter "python3")
|
||||
#+END_SRC
|
||||
|
||||
Make new directories automatically (from [[https://emacsredux.com/blog/2022/06/12/auto-create-missing-directories/][Emacs Redux]]).
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun er-auto-create-missing-dirs ()
|
||||
(let ((target-dir (file-name-directory buffer-file-name)))
|
||||
(unless (file-exists-p target-dir)
|
||||
(make-directory target-dir t))))
|
||||
|
||||
(add-to-list 'find-file-not-found-functions #'er-auto-create-missing-dirs)
|
||||
#+END_SRC
|
||||
|
||||
** OS-specific stuff
|
||||
|
||||
On Linux, I have to tell Emacs to use Chrome for web links.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue