[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep 522226f 050/110: Improve `macrostep-slime-macro-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep 522226f 050/110: Improve `macrostep-slime-macro-form-p` |
Date: |
Sat, 7 Aug 2021 09:18:00 -0400 (EDT) |
branch: elpa/macrostep
commit 522226f7e5ba9721901e6cccda9d758962907029
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Improve `macrostep-slime-macro-form-p`
- Only check for compiler macros when `macrostep-expand-compiler-macros`
is non-nil
- Exclude `lambda` from treatment as a macro
---
macrostep.el | 57 ++++++++++++++++++++++++++++++---------------------------
1 file changed, 30 insertions(+), 27 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 2fa7ed1..32aa72a 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -941,36 +941,39 @@ expansion will not be fontified. See also
(+ (or (syntax word)
(syntax symbol)))))
limit t)
- (unless (let ((case-fold-search t))
- (string-match (match-string 2) "lambda"))
- (let ((paren-begin (match-beginning 1)) (paren-end (match-end 1))
- (symbol-begin (match-beginning 2)) (symbol-end (match-end 2)))
- (save-excursion
- (goto-char (match-beginning 0))
- (let* ((sexp (slime-sexp-at-point))
- (macro-type (macrostep-slime-macro-form-p sexp)))
- (when macro-type
- (put-text-property paren-begin paren-end
- 'macrostep-macro-start t)
- (put-text-property symbol-begin symbol-end
- 'font-lock-face
- (cl-ecase macro-type
- (macro
- 'macrostep-macro-face)
- (compiler-macro
-
'macrostep-compiler-macro-face))))))))))))
+ (let ((paren-begin (match-beginning 1)) (paren-end (match-end 1))
+ (symbol-begin (match-beginning 2)) (symbol-end (match-end 2)))
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (let* ((sexp (slime-sexp-at-point))
+ (macro-type (macrostep-slime-macro-form-p sexp)))
+ (when macro-type
+ (put-text-property paren-begin paren-end
+ 'macrostep-macro-start t)
+ (put-text-property symbol-begin symbol-end
+ '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:when (cl:consp sexp)
- (cl:cond
- ((cl:macro-function (cl:car sexp))
- 'macro)
- ((cl:compiler-macro-function (cl:car sexp))
- 'compiler-macro)
- (t
- nil))))))
+ `(cl:let ((sexp (cl:read-from-string ,form))
+ (expand-compiler-macros ,macrostep-expand-compiler-macros))
+ (cl:cond
+ ((cl:not (cl:consp sexp))
+ nil)
+ ((cl:eq (cl:car sexp) 'cl:lambda)
+ nil)
+ ((cl:macro-function (cl:car sexp))
+ 'macro)
+ ((cl:and expand-compiler-macros
+ (cl:compiler-macro-function (cl:car sexp)))
+ 'compiler-macro)
+ (t
+ nil)))))
(provide 'macrostep)
- [nongnu] elpa/macrostep afed3cf 072/110: MARKER-CHAR-POSITION => MARKER-CHAR-ID, (continued)
- [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, 2021/08/07
- [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 <=
- [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
- [nongnu] elpa/macrostep cb2019e 017/110: acknowledgements in docs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 5c62a4c 021/110: Merge remote-tracking branch 'georgek/backquotes', ELPA Syncer, 2021/08/07