Don\'t abort loading more snippet dirs if one of them failed

This commit is contained in:
Joao Tavora 2012-03-09 11:05:39 +00:00
parent fe6351b18f
commit fcbbdbdbbc

View File

@ -1654,10 +1654,17 @@ Below TOP-LEVEL-DIR., each directory is a mode name."
(defun yas/load-snippet-dirs () (defun yas/load-snippet-dirs ()
"Reload the directories listed in `yas/snippet-dirs' or "Reload the directories listed in `yas/snippet-dirs' or
prompt the user to select one." prompt the user to select one."
(let (errors)
(if yas/snippet-dirs (if yas/snippet-dirs
(dolist (directory (reverse (yas/snippet-dirs))) (dolist (directory (reverse (yas/snippet-dirs)))
(yas/load-directory directory)) (condition-case oops
(call-interactively 'yas/load-directory))) (progn
(yas/load-directory directory)
(message "[yas] Loaded %s" directory))
(error (push oops errors)
(message "[yas] Check your `yas/snippet-dirs': %s" (second oops)))))
(call-interactively 'yas/load-directory))
errors))
(defun yas/reload-all (&optional interactive) (defun yas/reload-all (&optional interactive)
"Reload all snippets and rebuild the YASnippet menu. " "Reload all snippets and rebuild the YASnippet menu. "
@ -1677,10 +1684,7 @@ Below TOP-LEVEL-DIR., each directory is a mode name."
;; Reload the directories listed in `yas/snippet-dirs' or prompt ;; Reload the directories listed in `yas/snippet-dirs' or prompt
;; the user to select one. ;; the user to select one.
;; ;;
(condition-case oops (setq errors (yas/load-snippet-dirs))
(yas/load-snippet-dirs)
(error (push oops errors)
(message "[yas] Check your `yas/snippet-dirs': %s" (second oops))))
;; Reload the direct keybindings ;; Reload the direct keybindings
;; ;;
(yas/direct-keymaps-reload) (yas/direct-keymaps-reload)