[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep c5d1c5b 009/110: Autoload macro definitions if n
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep c5d1c5b 009/110: Autoload macro definitions if needed. |
Date: |
Sat, 7 Aug 2021 09:17:52 -0400 (EDT) |
branch: elpa/macrostep
commit c5d1c5b22b63c721fb7a4638301a0ef46b23d52d
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Autoload macro definitions if needed.
Also add a couple of necessary (require) statements
---
macrostep.el | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 0bdcc3c..31967e0 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -158,6 +158,8 @@
;; We use `pp-buffer' to pretty-print macro expansions
(require 'pp)
+(require 'ring)
+(eval-when-compile (require 'cl))
;;; Constants and dynamically bound variables
@@ -394,18 +396,29 @@ If no more macro expansions are visible after this, exit
(eq (car form) 'lambda)) ; hack
nil
(condition-case err
- (let ((macro (symbol-function (car form))))
- (and (consp macro)
- (eq (car macro) 'macro)))
+ (let ((fun (symbol-function (car form))))
+ (and (consp fun)
+ (or (eq (car fun) 'macro)
+ (and
+ (eq (car fun) 'autoload)
+ (eq (nth 4 fun) 'macro)))))
(error nil))))
(defun macrostep-macro-definition (form)
"Return, as a function, the macro definition to apply in expanding FORM."
- (cdr (symbol-function (car form))))
-
+ (let ((fun (symbol-function (car form))))
+ (if (consp fun)
+ (case (car fun)
+ ((macro)
+ (cdr fun))
+
+ ((autoload)
+ (load-library (nth 1 fun))
+ (macrostep-macro-definition form)))
+ (error "(%s ...) is not a macro form" form))))
+
(defun macrostep-expand-1 (form)
"Return result of macro-expanding the top level of FORM by exactly one step.
-
Unlike `macroexpand', this function does not continue macro
expansion until a non-macro-call results."
(if (not (macrostep-macro-form-p form)) form
- [nongnu] elpa/macrostep ff3888f 065/110: Use a form-tracking stream rather than gensym substitution, (continued)
- [nongnu] elpa/macrostep ff3888f 065/110: Use a form-tracking stream rather than gensym substitution, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0fd292c 006/110: Better README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0db08ec 007/110: add Url: header for marmalade, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep aa4736c 067/110: Fix some silly errors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0b1c0fe 069/110: Add swank/gray:stream-read-char-no-hang implementation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 704f164 091/110: Merge branch 'generic', ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep bf87b7c 095/110: Whitespace cleanup, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d1e954d 099/110: Attempt to shell out to "indent" in macrostep-c, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep b65cc96 102/110: Makefile tweaks, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 424e373 110/110: Merge pull request #16 from fice-t/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep c5d1c5b 009/110: Autoload macro definitions if needed.,
ELPA Syncer <=
- [nongnu] elpa/macrostep 8b89694 012/110: Only enter macrostep-mode after successful macro expansion, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep b060e1a 014/110: Add visible highlight of expanded section, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 4b0d96f 013/110: Remove incorrect use of :version in defgroup, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0bcb143 019/110: Handle backquotes better, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 1c01145 039/110: Merge pull request #9 from xuchunyang/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep c20152b 011/110: Handle aliases by using `indirect-function' instead of `symbol-function', ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 99ac330 029/110: Make inner macrolet definitions correctly shadow outer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0c8b64c 051/110: Position macrostep-slime-macro-form-p in the correct package, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep f34deb7 055/110: Specify text bounds when propertizing SLIME macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep b449cd0 059/110: Restore compiler-macro expansion under SLIME, ELPA Syncer, 2021/08/07