Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Last active January 18, 2018 18:24
Show Gist options
  • Save dustinlacewell-wk/30d4e42df70eaa97632d8a2a3406c957 to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/30d4e42df70eaa97632d8a2a3406c957 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)))
first)
(setq a (list :foo 1 :bar 2))
(setq b (list :foo 2))
(message "Before:")
(print-plist a)
(setq 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