summaryrefslogtreecommitdiff
path: root/fussy.el
diff options
context:
space:
mode:
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))