diff options
author | colin <colin@cicadas.surf> | 2023-03-25 16:44:06 -0700 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2023-03-25 16:44:06 -0700 |
commit | e2c4c4925e5c75b145fdeb94b7ee816657f6eb63 (patch) | |
tree | 0c47f1c027b150eae85a49bf75d1d806b155f210 /fussy.lisp |
initial commit
Diffstat (limited to 'fussy.lisp')
-rw-r--r-- | fussy.lisp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/fussy.lisp b/fussy.lisp new file mode 100644 index 0000000..9173e0a --- /dev/null +++ b/fussy.lisp @@ -0,0 +1,32 @@ +;;;; fussy.lisp + +(in-package #:fussy) + +(defvar +default-emacs-package-archive+ + "https://melpa.org/packages/archive-contents") + +(defun emacs-reader-readtable () + (let ((*readtable* (copy-readtable nil))) + (labels ((bracket-reader (stream char) + (declare (ignorable char)) + (read-delimited-list #\] stream))) + (set-macro-character #\[ #'bracket-reader) + (set-macro-character #\] (get-macro-character #\) nil)) + *readtable*))) + + +(defun fetch-emacs-archive (&optional (archive +default-emacs-package-archive+)) + (multiple-value-bind (stream status) (dexador:get archive :want-stream t) + (when (= 200 status) + (let ((*readtable* (emacs-reader-readtable))) + (read stream))))) + +(defun package-name-mentions (str) + (lambda (package) + (when (consp package) + (let ((string-name + (symbol-name (first package)))) + (search str string-name :test #'char-equal))))) + +(defun find-themes (archive-contents) + (remove-if-not (package-name-mentions "-theme") archive-contents)) |