[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/setup 1893abc 13/24: Document :shorthand and extractors
From: |
Stefan Monnier |
Subject: |
[elpa] externals/setup 1893abc 13/24: Document :shorthand and extractors |
Date: |
Thu, 25 Mar 2021 13:42:36 -0400 (EDT) |
branch: externals/setup
commit 1893abc9965b32bbc9f6efe3d1d803b8e45ab550
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>
Document :shorthand and extractors
---
setup.el | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/setup.el b/setup.el
index d7f6782..e9aafbf 100644
--- a/setup.el
+++ b/setup.el
@@ -101,7 +101,8 @@ Do not modify this variable by hand. Instead use
(defmacro setup (name &rest body)
"Configure feature or subsystem NAME.
BODY may contain special forms defined by `setup-define', but
-will otherwise just be evaluated as is."
+will otherwise just be evaluated as is.
+NAME may also be a macro, if it can provide a symbol."
(declare (debug (&rest &or [symbolp sexp] form))
(indent defun))
(when (consp name)
@@ -142,6 +143,12 @@ Give an advertised calling convention.
:documentation STRING
A documentation string.
+ :shorthand EXTRACTOR
+If a macro defines a shorthand, it might be used as the first
+argument of a `setup' form, instead of a symbol. EXTRACTOR must
+be a function of one argument. It takes the entire macro and
+returns a symbol to replace NAME.
+
:debug SPEC
A edebug specification, see Info node `(elisp) Specification List'.
If not given, it is assumed nothing is evaluated."
@@ -238,14 +245,18 @@ If not given, it is assumed nothing is evaluated."
(lambda (package)
`(unless (package-installed-p ',package)
(package-install ',package)))
- :documentation "Install PACKAGE if it hasn't been installed yet."
+ :documentation "Install PACKAGE if it hasn't been installed yet.
+This macro can be used as HEAD, and it will replace itself with
+the first PACKAGE."
:repeatable t
:shorthand #'cadr)
(setup-define :require
(lambda (feature)
`(require ',feature))
- :documentation "Eagerly require FEATURE."
+ :documentation "Eagerly require FEATURE.
+This macro can be used as HEAD, and it will replace itself with
+the first FEATURE."
:repeatable t
:shorthand #'cadr)
- [elpa] externals/setup updated (8712651 -> 7a78f66), Stefan Monnier, 2021/03/25
- [elpa] externals/setup 672876d 03/24: Reorder setup-define options consistently., Stefan Monnier, 2021/03/25
- [elpa] externals/setup d0262df 06/24: Reindent example in Commentary section, Stefan Monnier, 2021/03/25
- [elpa] externals/setup cb8085e 01/24: Remove debug specification for :hook, Stefan Monnier, 2021/03/25
- [elpa] externals/setup a090d3b 02/24: Add :advise macro to wrap advice-add, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 5dfdfb7 04/24: Remove setup-edebug-specifications declaration, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 4c1ca62 05/24: Make explicit that setup-macros is modified by setup-define., Stefan Monnier, 2021/03/25
- [elpa] externals/setup f3e1b0f 10/24: Link to repository, Stefan Monnier, 2021/03/25
- [elpa] externals/setup d1a55e7 07/24: Simplify setup docstring, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 483c938 08/24: Mention that :when-loaded is bad style, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 1893abc 13/24: Document :shorthand and extractors,
Stefan Monnier <=
- [elpa] externals/setup 2e18255 23/24: Always push cons as name onto body, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 844b6bc 15/24: Removed unnecessary unquote in :unbind, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 8f586c3 16/24: Fix hide-mode handling for the first element in minor-mode-alist, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 58cb897 09/24: Remove empty lines in docstrings, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 48658fb 20/24: Fix broken markup in README, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 903564b 21/24: Add if-package and if-feature macros, Stefan Monnier, 2021/03/25
- [elpa] externals/setup f3d4d27 11/24: Replace (function-)form with sexp where necessary, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 546c5f2 12/24: Bump version to 0.1.2, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 7cb02ce 19/24: Remove unnecessary unquote in :bind and :rebind, Stefan Monnier, 2021/03/25
- [elpa] externals/setup 4d74aa7 14/24: Don't require extra quoting for :advise, Stefan Monnier, 2021/03/25