]> git.eshelyaron.com Git - emacs.git/commitdiff
plist-get-value treats arg as backquoted
authorNoam Postavsky <npostavs@gmail.com>
Thu, 26 Sep 2013 02:24:45 +0000 (22:24 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Thu, 26 Sep 2013 02:36:10 +0000 (22:36 -0400)
This allows use of variables or even arbitrary expressions to construct
use-package arguments:

(use-package some-package
  :mode ,mode-spec
  :bind (,binding
         ,@more-bindings
         ,@(cl-loop for i from ?a to ?z
                    collect `(,(string i) . nifty-function))))

lisp/use-package/use-package.el

index 68270657a9b3345bc5699b631d0953aa70194c65..e1ba6e28c09e8a6beb515e891de3588e0bafcb93 100644 (file)
@@ -439,10 +439,8 @@ Return the list of recognized keywords."
     (plist-keys args)))
 
 (defun plist-get-value (plist prop)
-  (let ((value-or-symbol (plist-get plist prop)))
-    (if (symbolp value-or-symbol)
-        (symbol-value value-or-symbol)
-      value-or-symbol)))
+  "Return the value of PROP in PLIST as if it was backquoted."
+  (eval (list '\` (plist-get plist prop))))
 
 (defmacro use-package (name &rest args)
 "Use a package with configuration options.