From cb03d3258d05026796c4217bece9d7c01c659e8e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 17 Jun 2022 14:28:41 +0200 Subject: [PATCH] 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. --- core/autoload/plist.el | 33 --------------------------- core/core-packages.el | 2 +- modules/lang/org/autoload/org-link.el | 2 +- 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/core/autoload/plist.el b/core/autoload/plist.el index 61ecf2022..5facb90e6 100644 --- a/core/autoload/plist.el +++ b/core/autoload/plist.el @@ -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." diff --git a/core/core-packages.el b/core/core-packages.el index 232733bc9..e15af625e 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -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)))) diff --git a/modules/lang/org/autoload/org-link.el b/modules/lang/org/autoload/org-link.el index 8be27d577..50675947d 100644 --- a/modules/lang/org/autoload/org-link.el +++ b/modules/lang/org/autoload/org-link.el @@ -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)))) ;;