mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 22:41:06 -08:00
Merge pull request from npostavs/quasiquote
Quasiquote GitHub-reference: https://github.com/jwiegley/use-package/issues/56
This commit is contained in:
commit
d6a5c43915
1 changed files with 6 additions and 8 deletions
|
|
@ -439,10 +439,8 @@ Return the list of recognized keywords."
|
||||||
(plist-keys args)))
|
(plist-keys args)))
|
||||||
|
|
||||||
(defun plist-get-value (plist prop)
|
(defun plist-get-value (plist prop)
|
||||||
(let ((value-or-symbol (plist-get plist prop)))
|
"Return the value of PROP in PLIST as if it was backquoted."
|
||||||
(if (symbolp value-or-symbol)
|
(eval (list '\` (plist-get plist prop))))
|
||||||
(symbol-value value-or-symbol)
|
|
||||||
value-or-symbol)))
|
|
||||||
|
|
||||||
(defmacro use-package (name &rest args)
|
(defmacro use-package (name &rest args)
|
||||||
"Use a package with configuration options.
|
"Use a package with configuration options.
|
||||||
|
|
@ -473,20 +471,20 @@ For full documentation. please see commentary.
|
||||||
(pre-init-body (plist-get args :pre-init))
|
(pre-init-body (plist-get args :pre-init))
|
||||||
(init-body (plist-get args :init))
|
(init-body (plist-get args :init))
|
||||||
(config-body (plist-get args :config))
|
(config-body (plist-get args :config))
|
||||||
(diminish-var (plist-get args :diminish))
|
(diminish-var (plist-get-value args :diminish))
|
||||||
(defines (plist-get args :defines))
|
(defines (plist-get-value args :defines))
|
||||||
(idle-body (plist-get args :idle))
|
(idle-body (plist-get args :idle))
|
||||||
(keybindings-alist (plist-get-value args :bind))
|
(keybindings-alist (plist-get-value args :bind))
|
||||||
(mode-alist (plist-get-value args :mode))
|
(mode-alist (plist-get-value args :mode))
|
||||||
(interpreter-alist (plist-get-value args :interpreter))
|
(interpreter-alist (plist-get-value args :interpreter))
|
||||||
(predicate (plist-get args :if))
|
(predicate (plist-get args :if))
|
||||||
(pkg-load-path (plist-get args :load-path))
|
(pkg-load-path (plist-get-value args :load-path))
|
||||||
(defines-eval (if (null defines)
|
(defines-eval (if (null defines)
|
||||||
nil
|
nil
|
||||||
(if (listp defines)
|
(if (listp defines)
|
||||||
(mapcar (lambda (var) `(defvar ,var)) defines)
|
(mapcar (lambda (var) `(defvar ,var)) defines)
|
||||||
`((defvar ,defines)))))
|
`((defvar ,defines)))))
|
||||||
(requires (plist-get args :requires))
|
(requires (plist-get-value args :requires))
|
||||||
(requires-test (if (null requires)
|
(requires-test (if (null requires)
|
||||||
t
|
t
|
||||||
(if (listp requires)
|
(if (listp requires)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue