diff options
Diffstat (limited to 'fussy.lisp')
-rw-r--r-- | fussy.lisp | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -197,12 +197,17 @@ returns a list of those names." (defun all-themes (&key sort-by) (a:mappend #'themes-in-package (all-theme-packages sort-by))) +(defvar *theme-matcher-cache* (make-hash-table :test #'equal)) + (defun theme-mentions-anywhere (term) - (lambda (theme) - (or (search term theme) - (with-slots (name keywords description authors maintainer) (theme-package theme) - (or (search term (symbol-name name) :test #'char-equal) - (search term description :test #'char-equal)))))) + (or (gethash (string-downcase term) *theme-matcher-cache*) + (setf (gethash (string-downcase term) *theme-matcher-cache*) + (lambda (theme) + (or (search term theme) + (with-slots + (name keywords description authors maintainer) (theme-package theme) + (or (search term (symbol-name name) :test #'char-equal) + (search term description :test #'char-equal)))))))) (defun search-themes (terms &key sort-by) (remove-if-not |