[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/setup d9a5850 02/19: Manually specify macro arity via :
From: |
Stefan Monnier |
Subject: |
[elpa] externals/setup d9a5850 02/19: Manually specify macro arity via :repeatable |
Date: |
Mon, 15 Mar 2021 17:26:26 -0400 (EDT) |
branch: externals/setup
commit d9a5850cadd374d200421314da3b810a37141007
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Philip K <philipk@posteo.net>
Manually specify macro arity via :repeatable
---
setup.el | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/setup.el b/setup.el
index 510c599..ad05086 100644
--- a/setup.el
+++ b/setup.el
@@ -162,15 +162,15 @@ the specification."
(setq setup-macros (delq (assq name setup-macros)
setup-macros))
;; define macro for `cl-macrolet'
- (push (let* ((arity (func-arity fn))
- (body (if (plist-get opts :repeatable)
+ (push (let* ((arity (plist-get opts :repeatable))
+ (body (if arity
`(progn
- (unless (zerop (mod (length args) ,(car arity)))
+ (unless (zerop (mod (length args) ,arity))
(error "Illegal arguments"))
(let (aggr)
(while args
- (let ((rest (nthcdr ,(car arity) args)))
- (setf (nthcdr ,(car arity) args) nil)
+ (let ((rest (nthcdr ,arity args)))
+ (setf (nthcdr ,arity args) nil)
(push (apply #',fn args) aggr)
(setq args rest)))
`(progn ,@(nreverse aggr))))
@@ -245,7 +245,7 @@ the specification."
:signature '(PACKAGE ...)
:documentation "Install PACKAGE if it hasn't been installed yet."
:shorthand #'cadr
- :repeatable t)
+ :repeatable 1)
(setup-define :require
(lambda (feature)
@@ -253,7 +253,7 @@ the specification."
:signature '(FEATURE ...)
:documentation "Eagerly require FEATURE."
:shorthand #'cadr
- :repeatable t)
+ :repeatable 1)
(setup-define :global
(lambda (key fn)
@@ -265,7 +265,7 @@ the specification."
:signature '(KEY FUNCTION ...)
:documentation "Globally bind KEY to FUNCTION."
:debug '(form [&or [symbolp sexp] form])
- :repeatable t)
+ :repeatable 2)
(setup-define :bind
(lambda (key fn)
@@ -278,7 +278,7 @@ the specification."
:documentation "Bind KEY to FUNCTION in current map."
:after-loaded t
:debug '(form [&or [symbolp sexp] form])
- :repeatable t)
+ :repeatable 2)
(setup-define :unbind
(lambda (key)
@@ -291,7 +291,7 @@ the specification."
:documentation "Unbind KEY in current map."
:after-loaded t
:debug '(form)
- :repeatable t)
+ :repeatable 1)
(setup-define :rebind
(lambda (key fn)
@@ -306,7 +306,7 @@ the specification."
:signature '(KEY FUNCTION ...)
:documentation "Unbind the current key for FUNCTION, and bind it to KEY."
:after-loaded t
- :repeatable t)
+ :repeatable 2)
(setup-define :hook
(lambda (hook)
@@ -314,7 +314,7 @@ the specification."
:signature '(FUNCTION ...)
:documentation "Add FUNCTION to current hook."
:debug '(form [&or [symbolp sexp] form])
- :repeatable t)
+ :repeatable 1)
(setup-define :hook-into
(lambda (mode)
@@ -322,7 +322,7 @@ the specification."
setup-mode))
:signature '(HOOK ...)
:documentation "Add current mode to HOOK."
- :repeatable t)
+ :repeatable 1)
(setup-define :option
(lambda (var val)
@@ -349,7 +349,7 @@ will use the car value to modify the behaviour. If NAME
has the
form (append VAR), VAL is appended to VAR. If NAME has the
form (prepend VAR), VAL is prepended to VAR."
:debug '(sexp form)
- :repeatable t)
+ :repeatable 2)
(setup-define :hide-mode
(lambda ()
@@ -378,7 +378,7 @@ will use the car value to modify the behaviour. If NAME
has the
form (append VAR), VAL is appended to VAR. If NAME has the
form (prepend VAR), VAL is prepended to VAR."
:debug '(sexp form)
- :repeatable t)
+ :repeatable 2)
(setup-define :local-hook
(lambda (hook fn)
@@ -388,14 +388,14 @@ form (prepend VAR), VAL is prepended to VAR."
:signature '(HOOK FUNCTION ...)
:documentation "Add FUNCTION to HOOK only in buffers of the current mode."
:debug '(symbolp form)
- :repeatable t)
+ :repeatable 2)
(setup-define :also-load
(lambda (feature)
`(require ',feature))
:signature '(FEATURE ...)
:documentation "Load FEATURE with the current body."
- :repeatable t
+ :repeatable 1
:after-loaded t)
(setup-define :needs
@@ -404,7 +404,7 @@ form (prepend VAR), VAL is prepended to VAR."
(throw 'setup-exit nil)))
:signature '(PROGRAM ...)
:documentation "If PROGRAM is not in the path, stop here."
- :repeatable t)
+ :repeatable 1)
(setup-define :if
(lambda (condition)
@@ -413,7 +413,7 @@ form (prepend VAR), VAL is prepended to VAR."
:signature '(CONDITION ...)
:documentation "If CONDITION is non-nil, stop evaluating the body."
:debug '(form)
- :repeatable t)
+ :repeatable 1)
(setup-define :when-loaded
(lambda (&rest body) `(progn ,@body))
- [elpa] externals/setup 44d2cfd 09/19: Ignore package.el files, (continued)
- [elpa] externals/setup 44d2cfd 09/19: Ignore package.el files, Stefan Monnier, 2021/03/15
- [elpa] externals/setup d2e31e7 01/19: Replaced CC0 LICENSE with GPL, Stefan Monnier, 2021/03/15
- [elpa] externals/setup bb11fa8 06/19: Avoid reconstructing entire edebug specification, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 0e4995f 15/19: Use fenced code block for example, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 7fddc97 17/19: Explain usage of keywords for local macros, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 8ca0d20 18/19: Bump version to 0.1.1, Stefan Monnier, 2021/03/15
- [elpa] externals/setup c9bc47a 16/19: Simplify edebug specification generation, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 39accbf 19/19: Mention GitHub mirror, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 578f7bb 04/19: Update setup-define docstring, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 894819d 10/19: Drop "none" as argument for :debug, Stefan Monnier, 2021/03/15
- [elpa] externals/setup d9a5850 02/19: Manually specify macro arity via :repeatable,
Stefan Monnier <=
- [elpa] externals/setup 1bfca33 03/19: Avoid manual signature specification via help-function-arglist, Stefan Monnier, 2021/03/15
- [elpa] externals/setup fc958ad 08/19: Rename :needs argument to executable, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 295e173 12/19: Update README, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 9bd5f5b 14/19: Fix markdown code syntax, Stefan Monnier, 2021/03/15
- [elpa] externals/setup e8a5ac7 07/19: Rename :hook argument to function, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 5e24fe1 11/19: Decrease required Emacs version to 24.4, Stefan Monnier, 2021/03/15
- [elpa] externals/setup 9d9f5ef 13/19: Rename arguments to avoid manual :signatures specifications, Stefan Monnier, 2021/03/15