There's no built-in setter for plist-get
. Example:
(let ((pl '(:what (one))))
(push 'two (plist-get pl :what))
pl)
Error: let*: Symbol’s function definition is void: \(setf\ plist-get\)
How can I make setf
work with plist-get
?
There's no built-in setter for plist-get
. Example:
(let ((pl '(:what (one))))
(push 'two (plist-get pl :what))
pl)
Error: let*: Symbol’s function definition is void: \(setf\ plist-get\)
How can I make setf
work with plist-get
?
It's trivial to define your own:
(gv-define-simple-setter plist-get plist-put)
(let ((pl '(:what (one))))
(push 'two (plist-get pl :what))
pl) ; => (:what (two one))
You can find more examples in gv.el.