Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Created January 18, 2018 07:55
Show Gist options
  • Save dustinlacewell-wk/5c3ed20dcbec3df3537feaa713d8a2c5 to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/5c3ed20dcbec3df3537feaa713d8a2c5 to your computer and use it in GitHub Desktop.
(defun print-plist (a)
(loop for (key value) on a by 'cddr
do (message "key: %s - value: %s" key value)))
(defun merge-plist (first second)
(loop for (key value) on second by 'cddr
do (setq first (plist-put first key value))))
(setq a (list :foo 1 :bar 2))
(setq b (list :foo 2))
(message "Before:")
(print-plist a)
(merge-plist 'a b)
(message "After:")
(print-plist a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment