[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep e35b61d 047/110: Add compiler-macro support for
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep e35b61d 047/110: Add compiler-macro support for SLIME |
Date: |
Sat, 7 Aug 2021 09:18:00 -0400 (EDT) |
branch: elpa/macrostep
commit e35b61d74876341e8578fb3f9c768a9220dfe672
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Add compiler-macro support for SLIME
---
macrostep.el | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 2b093f5..2bac0ba 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -915,7 +915,11 @@ expansion will not be fontified. See also
(add-hook 'slime-mode-hook #'macrostep-slime-mode-hook)
(defun macrostep-slime-expand-1 (sexp)
- (slime-eval `(swank:swank-macroexpand-1 ,sexp)))
+ (cl-ecase (macrostep-slime-macro-form-p sexp)
+ (macro
+ (slime-eval `(swank:swank-macroexpand-1 ,sexp)))
+ (compiler-macro
+ (slime-eval `(swank:swank-compiler-macroexpand-1 ,sexp)))))
(defun macrostep-slime-insert (expansion)
"Insert EXPANSION at point, indenting to match the current column."
@@ -941,22 +945,33 @@ expansion will not be fontified. See also
(symbol-begin (match-beginning 2)) (symbol-end (match-end 2)))
(save-excursion
(goto-char (match-beginning 0))
- (let ((sexp (slime-sexp-at-point)))
- (when (macrostep-slime-macro-form-p sexp)
+ (let* ((sexp (slime-sexp-at-point))
+ (macro-type (macrostep-slime-macro-form-p sexp)))
+ (when macro-type
;; Hack to make `macrostep-next-macro' etc. work.
;; TODO: Re-consider how macro forms are marked in
;; expanded text.
(put-text-property paren-begin paren-end
'macrostep-expanded-text sexp)
(put-text-property symbol-begin symbol-end
- 'font-lock-face
'macrostep-macro-face))))))))))
+ 'font-lock-face
+ (cl-ecase macro-type
+ (macro
+ 'macrostep-macro-face)
+ (compiler-macro
+
'macrostep-compiler-macro-face))))))))))))
(defun macrostep-slime-macro-form-p (form)
(slime-eval
`(cl:let ((sexp (cl:read-from-string ,form)))
- (cl:and (cl:consp sexp)
- (cl:macro-function (cl:car sexp))
- t))))
+ (cl:when (cl:consp sexp)
+ (cl:cond
+ ((cl:macro-function (cl:car sexp))
+ 'macro)
+ ((cl:compiler-macro-function (cl:car sexp))
+ 'compiler-macro)
+ (t
+ nil))))))
(provide 'macrostep)
- [nongnu] elpa/macrostep a5b980e 035/110: Update readme, (continued)
- [nongnu] elpa/macrostep a5b980e 035/110: Update readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep fbd61eb 030/110: Tests for macrolet/cl-macrolet support, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep afed3cf 072/110: MARKER-CHAR-POSITION => MARKER-CHAR-ID, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2390cec 075/110: slime-sexp-at-point may return nil, deal with it, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2c5bda2 090/110: Update README, bump version number, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 6c8ae5b 098/110: Remove call to `define-error` for Emacs <24.4, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 29fd924 107/110: Move overlay face to a different overlay, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d459ded 024/110: bump version number, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 96e0c02 041/110: WIP: Add generic interface for other languages, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep e9a95f4 049/110: Fix `macrostep--macro-form-info`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep e35b61d 047/110: Add compiler-macro support for SLIME,
ELPA Syncer <=
- [nongnu] elpa/macrostep 3766ffb 043/110: Hack to propertize macros in SLIME expansions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 522226f 050/110: Improve `macrostep-slime-macro-form-p`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 059dda6 066/110: Also hook into slime-repl-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep e582ca7 078/110: Fix trivial bug printing a single non-list form, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 84e5bfa 086/110: Make tests pass again, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2dd3447 004/110: Fix bug with output of macros that expand to a string (e.g. `rx'), ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 6c4afbe 002/110: Got rid of `macrostep-change-group'. Updated some documentation., ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep e2bf1aa 005/110: Change :reverse-video to :inverse-video for e24, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 993a79f 010/110: bump version number, add changelog, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 9cd6742 016/110: Try to be smarter about maintaining buffer state, ELPA Syncer, 2021/08/07