diff options
-rw-r--r-- | fussy.el | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -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)) |