From 944eef90ec7962c3b17cf3e6df65bbac5f03dfdc Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 9 Jul 2024 02:38:23 -0400 Subject: [PATCH] fix(lib): doom-plist-merge causing side-effects This one was sneaky. `doom-plist-merge` was mutating the second plist fed to it, causing issues upwind of its uses. In #7925, for example, calling `doom-package-recipe` to read a package's recipe would end up altering it, copying sub-properties of :recipe to other packages' recipes. If you've hit #7925, you'll also need to delete your build-cache to get around the error. I.e. rm -f $EMACSDIR/.local/straight/build-*-cache.el doom sync # or upgrade Fix: #7925 --- lisp/lib/plist.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/lib/plist.el b/lisp/lib/plist.el index d50c01423..15c4133cd 100644 --- a/lisp/lib/plist.el +++ b/lisp/lib/plist.el @@ -29,9 +29,10 @@ ;;;###autoload (defun doom-plist-merge (from-plist to-plist) "Non-destructively merge FROM-PLIST onto TO-PLIST" - (let ((plist (copy-sequence from-plist))) - (while plist - (cl-callf plist-put to-plist (pop plist) (pop plist))) + (let ((from-plist (copy-sequence from-plist)) + (to-plist (copy-sequence to-plist))) + (while from-plist + (cl-callf plist-put to-plist (pop from-plist) (pop from-plist))) to-plist)) ;;;###autoload