4

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?

1
  • 1
    Good question, and good answer @wasamasa.
    – Drew
    Jun 28, 2020 at 15:59

1 Answer 1

6

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.