diff --git a/yasnippet.el b/yasnippet.el index c225653..86515d8 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -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 content of the file is the template." (interactive "DSelect the root directory: ") - (when (file-directory-p directory) - (add-to-list 'yas/root-directory directory)) + (unless (file-directory-p directory) + (error "Error %s not a directory" directory)) + (add-to-list 'yas/root-directory directory) (dolist (dir (yas/directory-files directory nil)) (yas/load-directory-1 dir)) (when (interactive-p)