minibuffer

How to change values in Emacs Lisp property lists?

October 06, 2023
(plist-put '(:a 1 :b 2) :a 10) ;; (:a 10 :b 2)
(plist-put '(:a 1 :b 2 :a 3) :a 10) ;; (:a 10 :b 2 :a 3)

(let ((foo '(:a 1 :b 2)))
  (plist-put foo :a 10)
  foo)
;; (:a 10 :b 2)