minibuffer

How to manipulate property lists in Emacs Lisp?

October 05, 2023
(plist-get '(:a 1 :b 2 :c 3) :c) ;; 3
(plist-get '(:a 1 :b 2 :a 3) :a) ;; 1

(plist-member '(:a 1 :b 2 :c 3) :b) ;; (:b 2 :c 3)

(plist-get '(:a 1 :b 2) :c) ;; nil
(plist-get '(:a 1 :b 2 :c nil) :c) ;; nil
(plist-member '(:a 1 :b 2) :c) ;; nil
(plist-member '(:a 1 :b 2 :c nil) :c) ;; (:c nil)