From 8773d85db09f942e4b1ca14255b8cf689acded09 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 28 Jul 2019 14:14:42 +0200 Subject: [PATCH] Fix oversights in plist library - doplist! now returns the RETVAL expression - Fix doom-plist-merge (was incomplete) --- core/autoload/plist.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/autoload/plist.el b/core/autoload/plist.el index c61824ecb..81a8fbb5a 100644 --- a/core/autoload/plist.el +++ b/core/autoload/plist.el @@ -18,13 +18,13 @@ list, the pair is destructured into (CAR . CDR)." (,(pop arglist) (pop ,plist-var))) `((,arglist (cons (pop ,plist-var) (pop ,plist-var))))) - ,@body))))) + ,@body)) + ,retval))) ;;;###autoload (defmacro plist-put! (plist prop value) "Set PROP to VALUE in PLIST in-place." - (let ((plist-var (make-symbol "plist"))) - `(setq ,plist (plist-put ,plist ,prop ,value)))) + `(setq ,plist (plist-put ,plist ,prop ,value))) ;;;###autoload (defmacro plist-delete! (plist prop) @@ -63,8 +63,10 @@ BODY." ;;;###autoload (defun doom-plist-merge (from-plist to-plist) "Destructively merge FROM-PLIST onto TO-PLIST" - (while plist - (plist-put! old-plist (pop plist) (pop plist)))) + (let ((plist (copy-sequence from-plist))) + (while plist + (plist-put! to-plist (pop plist) (pop plist))) + to-plist)) ;;;###autoload (defun doom-plist-delete-nil (plist)