Skip to content

Instantly share code, notes, and snippets.

@kawaguchi
Created September 9, 2009 02:43
Show Gist options
  • Save kawaguchi/183421 to your computer and use it in GitHub Desktop.
Save kawaguchi/183421 to your computer and use it in GitHub Desktop.
(defadvice find-file
(before find-file-create-intermediate-directories (filename &optional wildcards))
"中間ディレクトリが存在しない時は作成する"
(let ((dir (file-name-directory filename)))
(if (and dir
(not (file-exists-p dir)))
(make-directory dir t))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment