Raise an error when yas/load-directory get a parameter that is not a directory.

This commit is contained in:
Zhang Chiyuan 2008-08-20 15:32:02 +00:00
parent 2b6dab409c
commit e6276da02a

View File

@ -1057,8 +1057,9 @@ name. And under each subdirectory, each file is a definition
of a snippet. The file name is the trigger key and the of a snippet. The file name is the trigger key and the
content of the file is the template." content of the file is the template."
(interactive "DSelect the root directory: ") (interactive "DSelect the root directory: ")
(when (file-directory-p directory) (unless (file-directory-p directory)
(add-to-list 'yas/root-directory directory)) (error "Error %s not a directory" directory))
(add-to-list 'yas/root-directory directory)
(dolist (dir (yas/directory-files directory nil)) (dolist (dir (yas/directory-files directory nil))
(yas/load-directory-1 dir)) (yas/load-directory-1 dir))
(when (interactive-p) (when (interactive-p)