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
This commit is contained in:
Henrik Lissner 2024-07-09 02:38:23 -04:00
parent 96de02c769
commit 944eef90ec
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -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