branch: elpa/macrostep
commit b060e1ad3c61154943c1c87800b01b3f338dfaa5
Author: George Kettleborough <[email protected]>
Commit: George Kettleborough <[email protected]>
Add visible highlight of expanded section
---
macrostep.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/macrostep.el b/macrostep.el
index 89dfde1..4cd417b 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -234,6 +234,11 @@
"Face for gensyms created in the fifth level of macro expansion."
:group 'macrostep)
+(defface macrostep-expansion-highlight-face
+ '((t :background "#eee8d5"))
+ "Face for macro-expansion highlight."
+ :group 'macrostep)
+
(defface macrostep-macro-face
'((t :underline t))
"Face for macros in macro-expanded code."
@@ -341,6 +346,11 @@ buffer and expand the next macro form found, if any."
(let ((new-ol
(make-overlay (point)
(scan-sexps (point) 1))))
+ ;; move overlay over newline to make it prettier
+ (when (= (char-after (overlay-end new-ol)) ?\n)
+ (move-overlay new-ol
+ (overlay-start new-ol) (+ (overlay-end new-ol) 1)))
+ (overlay-put new-ol 'face 'macrostep-expansion-highlight-face)
(overlay-put new-ol 'evaporate t)
(overlay-put new-ol 'priority priority)
(overlay-put new-ol 'macrostep-original-text text)