refactor!(lib): remove {doplist!,plist-delete!,doom-plist-delete}

BREAKING CHANGE: With 26.x support dropped, I've dropped:

- doom-plist-delete: use map-delete instead
- plist-delete!: use cl-callf + map-delete instead
- doplist: use (cl-loop for X on PLIST by #'cddr ...) instead

These were removed as part of an ongoing effort to eliminate
redundancies with built-in packages and reduce Doom's overall footprint.
This commit is contained in:
Henrik Lissner 2022-06-17 14:28:41 +02:00
parent fd12794930
commit cb03d3258d
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
3 changed files with 2 additions and 35 deletions

View file

@ -3,24 +3,6 @@
;;
;;; Macros
;;;###autoload
(cl-defmacro doplist! ((arglist plist &optional retval) &rest body)
"Loop over a PLIST's (property value) pairs then return RETVAL.
Evaluate BODY with either ARGLIST bound to (cons PROP VAL) or, if ARGLIST is a
list, the pair is destructured into (CAR . CDR)."
(declare (indent 1))
(let ((plist-var (make-symbol "plist")))
`(let ((,plist-var (copy-sequence ,plist)))
(while ,plist-var
(let ,(if (listp arglist)
`((,(pop arglist) (pop ,plist-var))
(,(pop arglist) (pop ,plist-var)))
`((,arglist (cons (pop ,plist-var)
(pop ,plist-var)))))
,@body))
,retval)))
;;; DEPRECATED In favor of `cl-callf'
;;;###autoload
(defmacro plist-put! (plist &rest rest)
@ -31,11 +13,6 @@ list, the pair is destructured into (CAR . CDR)."
`(setq ,plist (plist-put ,plist prop value))
`(plist-put ,plist prop value))))
;;;###autoload
(defmacro plist-delete! (plist prop)
"Delete PROP from PLIST in-place."
`(setq ,plist (doom-plist-delete ,plist ,prop)))
;;
;;; Library
@ -65,16 +42,6 @@ list, the pair is destructured into (CAR . CDR)."
(setq plist (cddr plist)))
p))
;;;###autoload
(defun doom-plist-delete (plist &rest props)
"Delete PROPS from a copy of PLIST."
(let (p)
(while plist
(if (not (memq (car plist) props))
(cl-callf plist-put p (car plist) (nth 1 plist)))
(setq plist (cddr plist)))
p))
;;;###autoload
(defun doom-plist-keys (plist)
"Return the keys in PLIST."

View file

@ -506,7 +506,7 @@ elsewhere."
(when (and (not ignore)
(equal built-in '(quote prefer)))
(setq built-in `(locate-library ,(symbol-name name) nil (get 'load-path 'initial-value))))
(cl-callf doom-plist-delete plist :built-in)
(cl-callf map-delete plist :built-in)
(cl-callf plist-put plist :ignore built-in))
`(let* ((name ',name)
(plist (cdr (assq name doom-packages))))

View file

@ -51,7 +51,7 @@ exist, and `org-link' otherwise."
(if (file-exists-p file-name)
'org-link
'error)))
(doom-plist-delete plist :requires))))
(plist-put plist :requires nil))))
;;