浏览代码

Minor cleanups to theme-package error handling.

Brit Butler 12 年之前
父节点
当前提交
eb1c5d8f83
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      src/themes.lisp

+ 4 - 6
src/themes.lisp

@@ -22,17 +22,15 @@ any return value other than nil indicates the injection should be added."
22 22
     (list :head (injections-for :head)
23 23
           :body (injections-for :body))))
24 24
 
25
-(define-condition theme-does-not-exist-error (error)
25
+(define-condition theme-does-not-exist (error)
26 26
   ((theme :initarg :theme :reader theme))
27 27
   (:report (lambda (c stream)
28
-	     (format stream "THEME-DOES-NOT-EXIST-ERROR cannot find theme: '~A'" (theme c)))))
28
+             (format stream "Cannot find the theme: '~A'" (theme c)))))
29 29
 
30 30
 (defun theme-package (name)
31
-  "Find the package matching the theme NAME.  
32
-It will signal an error when it cannot find the package for the theme."
31
+  "Find the package matching the theme NAME or signal THEME-DOES-NOT-EXIST."
33 32
   (or (find-package (string-upcase (concatenate 'string "coleslaw.theme." name)))
34
-      (error 'theme-does-not-exist-error
35
-	     :theme name)))
33
+      (error 'theme-does-not-exist-error :theme name)))
36 34
 
37 35
 (defun theme-fn (name &optional (package (theme *config*)))
38 36
   "Find the symbol NAME inside PACKAGE which defaults to the theme package."