mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 19:29:37 +00:00
plist-get-value treats arg as backquoted
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))))
This commit is contained in:
parent
9c9329f522
commit
dd20db220d
1 changed files with 2 additions and 4 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue