[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep 3766ffb 043/110: Hack to propertize macros in SL
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep 3766ffb 043/110: Hack to propertize macros in SLIME expansions |
Date: |
Sat, 7 Aug 2021 09:17:59 -0400 (EDT) |
branch: elpa/macrostep
commit 3766ffbb8a2b950f29ee140e0349caa706a319aa
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Hack to propertize macros in SLIME expansions
---
macrostep.el | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/macrostep.el b/macrostep.el
index b83fedb..d7f71fe 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -880,7 +880,33 @@ expansion will not be fontified. See also
"Insert EXPANSION at point, indenting to match the current column."
(let* ((indent-string (concat "\n" (make-string (current-column) ? )))
(expansion (replace-regexp-in-string "\n" indent-string expansion)))
- (insert expansion)))
+ (save-excursion
+ (insert expansion))
+ (macrostep-slime--propertize-macros)
+ (forward-sexp)))
+
+(defun macrostep-slime--propertize-macros ()
+ "Put text properties on macros in the form following point."
+ (save-excursion
+ (let ((limit (scan-sexps (point) 1)))
+ (while (search-forward-regexp (rx (submatch "(")
+ (submatch
+ (+ (or (syntax word)
+ (syntax symbol)))))
+ limit t)
+ (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)))
+ (when (macrostep-slime-macro-form-p sexp)
+ ;; 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)))))))))
(defun macrostep-slime-macro-form-p (form)
(slime-eval
- [nongnu] elpa/macrostep fbd61eb 030/110: Tests for macrolet/cl-macrolet support, (continued)
- [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, 2021/08/07
- [nongnu] elpa/macrostep 3766ffb 043/110: Hack to propertize macros in SLIME expansions,
ELPA Syncer <=
- [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
- [nongnu] elpa/macrostep cb2019e 017/110: acknowledgements in docs, ELPA Syncer, 2021/08/07