[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep 0bcb143 019/110: Handle backquotes better
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep 0bcb143 019/110: Handle backquotes better |
Date: |
Sat, 7 Aug 2021 09:17:54 -0400 (EDT) |
branch: elpa/macrostep
commit 0bcb14304890815fe8c63f84fae99badb583ea6f
Author: George Kettleborough <g.kettleborough@member.fsf.org>
Commit: George Kettleborough <g.kettleborough@member.fsf.org>
Handle backquotes better
---
macrostep.el | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 38f0bc1..1784e8b 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -496,8 +496,11 @@ so that they can be colored consistently. See also
`macrostep-print-sexp'.
Also moves point to the beginning of the returned s-expression."
- (if (not (looking-at "("))
+ (if (and (not (looking-at "("))
+ (not (looking-at "`")))
(backward-up-list 1))
+ (if (equal (char-before) ?`)
+ (backward-char))
(or (get-text-property (point) 'macrostep-expanded-text)
(progn
;; use scan-sexps for the side-effect of producing an error
@@ -589,14 +592,16 @@ fontified using the same face (modulo the number of
faces; see
(put symbol 'macrostep-gensym-face face)
face))))
-(defun macrostep-print-sexp (sexp)
+(defun macrostep-print-sexp (sexp &optional no-macro-show)
"Pretty-print SEXP, a macro expansion, in the current buffer.
Fontifies uninterned symbols and macro forms using
`font-lock-face' property, and saves the actual text of SEXP's
sub-forms as the `macrostep-expanded-text' text property so that
any uninterned symbols can be reused in macro expansions of the
-sub-forms. See also `macrostep-sexp-at-point'."
+sub-forms. If NO-MACRO-SHOW is non-nil then any macros in the
+expansion will not be fontified. See also
+`macrostep-sexp-at-point'."
(cond
((symbolp sexp)
(let ((p (point)))
@@ -615,14 +620,22 @@ sub-forms. See also `macrostep-sexp-at-point'."
(insert "'")
(macrostep-print-sexp (cadr sexp)))
- ((and (memq head '(\` \, \,@)) ; quasiquote, unquote etc.
+ ((and (memq head '(\, \,@)) ; unquote
(= (length sexp) 2))
(princ head (current-buffer))
(macrostep-print-sexp (cadr sexp)))
-
+ ((and (eq head '\`)
+ (= (length sexp) 2))
+ (insert "`") ; backquote
+ (put-text-property
+ (1- (point)) (point) 'macrostep-expanded-text sexp)
+ (put-text-property
+ (1- (point)) (point) 'font-lock-face 'macrostep-macro-face)
+ (macrostep-print-sexp (cadr sexp) t))
(t ; other list form
(insert "(")
- (when (macrostep-macro-form-p sexp)
+ (when (and (not no-macro-show)
+ (macrostep-macro-form-p sexp))
(let ((p (point)))
;; save the real expansion as a text property on the
;; opening paren
- [nongnu] elpa/macrostep 0b1c0fe 069/110: Add swank/gray:stream-read-char-no-hang implementation, (continued)
- [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, 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 <=
- [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
- [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