summaryrefslogtreecommitdiff
path: root/fussy.lisp
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-03-24 15:23:13 -0700
committercolin <colin@cicadas.surf>2024-03-24 15:23:13 -0700
commitb2e73ea9e87c072ca39831f4600f4579f5953022 (patch)
tree7b17e40bad17f36d5a192642f517cb129848d329 /fussy.lisp
parent95909f31b7d5f15d86bf70e9df49ae2f41da5b71 (diff)
Add: complement term filters in theme searchHEADmain
Diffstat (limited to 'fussy.lisp')
-rw-r--r--fussy.lisp17
1 files changed, 11 insertions, 6 deletions
diff --git a/fussy.lisp b/fussy.lisp
index 08a7eab..b367f71 100644
--- a/fussy.lisp
+++ b/fussy.lisp
@@ -220,15 +220,20 @@ returns a list of those names."
(defvar *theme-matcher-cache* (make-hash-table :test #'equal))
+(defun theme-term-matcher (term)
+ (if (eq #\- (elt term 0))
+ (complement (theme-term-matcher (string-left-trim "-" 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)))))))
+
(defun theme-mentions-anywhere (term)
(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))))))))
+ (theme-term-matcher term))))