From 1a98c38d9cac584a56cefd74612eefb335e89325 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 20 Jan 2016 09:44:28 -0500 Subject: [PATCH] Fix silly mistake in previous commit * yasnippet.el (yas--load-snippet-dirs): Put `make-directory' call in same branch of the `if' as the `dolist' loop. --- yasnippet.el | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index bd1d864..dcec0e2 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -1805,18 +1805,18 @@ With prefix argument USE-JIT do jit-loading of snippets." "Reload the directories listed in `yas-snippet-dirs' or prompt the user to select one." (let (errors) - (if yas-snippet-dirs - (when (member yas--default-user-snippets-dir yas-snippet-dirs) - (make-directory yas--default-user-snippets-dir t)) - (dolist (directory (reverse (yas-snippet-dirs))) - (cond ((file-directory-p directory) - (yas-load-directory directory (not nojit)) - (if nojit - (yas--message 3 "Loaded %s" directory) - (yas--message 3 "Prepared just-in-time loading for %s" directory))) - (t - (push (yas--message 0 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors)))) - (call-interactively 'yas-load-directory)) + (if (null yas-snippet-dirs) + (call-interactively 'yas-load-directory) + (when (member yas--default-user-snippets-dir yas-snippet-dirs) + (make-directory yas--default-user-snippets-dir t)) + (dolist (directory (reverse (yas-snippet-dirs))) + (cond ((file-directory-p directory) + (yas-load-directory directory (not nojit)) + (if nojit + (yas--message 3 "Loaded %s" directory) + (yas--message 3 "Prepared just-in-time loading for %s" directory))) + (t + (push (yas--message 0 "Check your `yas-snippet-dirs': %s is not a directory" directory) errors))))) errors)) (defun yas-reload-all (&optional no-jit interactive)