[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep f34deb7 055/110: Specify text bounds when proper
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep f34deb7 055/110: Specify text bounds when propertizing SLIME macros |
Date: |
Sat, 7 Aug 2021 09:18:01 -0400 (EDT) |
branch: elpa/macrostep
commit f34deb73fc1dcac798a2dda314e5f4a957cd3930
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Specify text bounds when propertizing SLIME macros
---
macrostep.el | 57 +++++++++++++++++++++++++++------------------------------
1 file changed, 27 insertions(+), 30 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 7d239e2..a8832e1 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -923,38 +923,35 @@ 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))
- (end-point))
- (save-excursion
- (insert expansion)
- (setq end-point (point)))
- (macrostep-slime--propertize-macros)
- (goto-char end-point)))
+ (start (point)))
+ (insert expansion)
+ (macrostep-slime--propertize-macros start (point))))
-(defun macrostep-slime--propertize-macros ()
- "Put text properties on macros in the form following point."
+(defun macrostep-slime--propertize-macros (start end)
+ "Put text properties on macro forms between START and END."
(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))
- (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)))))))))))
+ (goto-char start)
+ (while (search-forward-regexp (rx (submatch "(")
+ (submatch
+ (+ (or (syntax word)
+ (syntax symbol)))))
+ end 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))
+ (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
- [nongnu] elpa/macrostep 424e373 110/110: Merge pull request #16 from fice-t/master, (continued)
- [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, 2021/08/07
- [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 <=
- [nongnu] elpa/macrostep b449cd0 059/110: Restore compiler-macro expansion under SLIME, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 5e0c28f 068/110: Establish *macroexpand-printer-bindings* before pretty printing, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 80ae101 083/110: Fix SLIME functions for updated generic interface, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 8f74a4b 084/110: Toggle separate-buffer expansion with prefix (#8), ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep c594c09 092/110: `cl-macs' is no longer needed at run-time, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 94d40f2 093/110: Check that compiler-macros return a changed form, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d6aa67c 097/110: Be consistent about only using prefixed `cl-lib`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 1e25932 105/110: add lib/.nosearch, ELPA Syncer, 2021/08/07