summaryrefslogtreecommitdiff
path: root/fussy.el
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-03-25 17:21:26 -0700
committercolin <colin@cicadas.surf>2023-03-25 17:21:26 -0700
commit1939272b1c15d50f5fe1fa403bc9c8ee9fd0a84f (patch)
tree3ef8b80ae78c616d86a5ce76996c99b6ca63ce2a /fussy.el
parente2c4c4925e5c75b145fdeb94b7ee816657f6eb63 (diff)
It seems to finish!
Diffstat (limited to 'fussy.el')
-rw-r--r--fussy.el19
1 files changed, 17 insertions, 2 deletions
diff --git a/fussy.el b/fussy.el
index 91882bc..6f4e7aa 100644
--- a/fussy.el
+++ b/fussy.el
@@ -1,9 +1,24 @@
(require 'cl-lib)
(require 'package)
+(defvar +package-name-filter-out-list+
+ (list "airline-"))
+
+(defvar +excluded-package-names+
+ '(tramp-theme color-theme))
+
+(defun fussy-string-ends-with (str suffix)
+ (and (< (length suffix) (length str))
+ (string= suffix
+ (cl-subseq str (- (length str) (length suffix))))))
+
(defun fussy-is-theme-p (pkg-entry)
- (cl-search "-theme" (symbol-name (cl-first pkg-entry))
- :test 'char-equal))
+ (let ((name (symbol-name (cl-first pkg-entry))))
+ (and (or (fussy-string-ends-with name "-theme")
+ (fussy-string-ends-with name "-themes"))
+ (not (cl-member (cl-first pkg-entry) +excluded-package-names+))
+ (cl-notany (lambda (substr) (cl-search substr name))
+ +package-name-filter-out-list+))))
(defun fussy-themes-packages ()
(cl-remove-if-not 'fussy-is-theme-p package-archive-contents))