From e6276da02a325e72282a1e809b4c6c91c42bab6b Mon Sep 17 00:00:00 2001 From: Zhang Chiyuan Date: Wed, 20 Aug 2008 15:32:02 +0000 Subject: [PATCH] Raise an error when yas/load-directory get a parameter that is not a directory. --- yasnippet.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)