[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/setup bb11fa8 06/19: Avoid reconstructing entire edebug
From: |
Stefan Monnier |
Subject: |
[elpa] externals/setup bb11fa8 06/19: Avoid reconstructing entire edebug specification |
Date: |
Mon, 15 Mar 2021 17:26:27 -0400 (EDT) |
branch: externals/setup
commit bb11fa8aa713fa43c029f752c32d8053226d46f7
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>
Avoid reconstructing entire edebug specification
---
setup.el | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/setup.el b/setup.el
index 5089b2e..9973212 100644
--- a/setup.el
+++ b/setup.el
@@ -81,6 +81,9 @@
(defvar setup-macros nil
"Local macro definitions to be bound in `setup' bodies.")
+(defvar setup-edebug-specifications nil
+ "Part of the edebug specification for `setup'.")
+
;;;###autoload
(defun setup-make-docstring ()
"Return a docstring for `setup'."
@@ -159,7 +162,6 @@ If not given, it is assumed nothing is evaluated."
(if (plist-get opts :repeatable) '(...)))))
(put name 'setup-shorthand (plist-get opts :shorthand))
(put name 'lisp-indent-function (plist-get opts :indent))
- (put name 'setup-repeatable (plist-get opts :repeatable))
(put name 'setup-debug (plist-get opts :debug))
;; forget previous definition
(setq setup-macros (delq (assq name setup-macros)
@@ -183,17 +185,23 @@ If not given, it is assumed nothing is evaluated."
`(with-eval-after-load setup-name ,,body))
`(,name (&rest args) `,,body)))
setup-macros)
+ ;; update edebug specification for `setup'
+ (setq setup-edebug-specifications
+ (delq (assoc (symbol-name name)
+ setup-edebug-specifications)
+ setup-edebug-specifications))
+ (let ((body (cond ((eq (plist-get opts :debug) 'none) nil)
+ ((plist-get opts :debug))
+ ('(sexp)))))
+ ;; FIXME: Use `&interpose' in Emacsā„28.
+ (push (if (plist-get opts :repeatable)
+ `(,(symbol-name name) &rest ,@body)
+ `(,(symbol-name name) ,@body))
+ setup-edebug-specifications))
(put 'setup 'edebug-form-spec
- (let (specs)
- (dolist (name (mapcar #'car setup-macros))
- (let ((body (cond ((eq (get name 'setup-debug) 'none) nil)
- ((get name 'setup-debug) nil)
- ('(sexp)))))
- (push (if (get name 'setup-repeatable)
- `(,(symbol-name name) &rest ,@body)
- `(,(symbol-name name) ,@body))
- specs)))
- `(&rest &or [symbolp sexp] ,@specs form))))
+ (append '(&rest &or [symbolp sexp])
+ setup-edebug-specifications
+ '(form))))
;;; definitions of `setup' keywords
- [elpa] externals/setup updated (6d84649 -> 39accbf), Stefan Monnier, 2021/03/15
- [elpa] externals/setup aa9bad8 05/19: Drop unused setup-indent property, Stefan Monnier, 2021/03/15
- [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 <=
- [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, 2021/03/15
- [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