[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep 817322b 074/110: Properly place the macrostep[-c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep 817322b 074/110: Properly place the macrostep[-compiler]-macro-face |
Date: |
Sat, 7 Aug 2021 09:18:05 -0400 (EDT) |
branch: elpa/macrostep
commit 817322b3234c89a5e6d043d79f70f3869723cccf
Author: Luís Oliveira <loliveira@common-lisp.net>
Commit: Luís Oliveira <loliveira@common-lisp.net>
Properly place the macrostep[-compiler]-macro-face
Simplified things a bit in the process given that we don't need to pass
the bounds of the macro forms, just the start position.
---
macrostep.el | 26 ++++++++++++++++----------
swank-macrostep.lisp | 21 ++++++++-------------
2 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 6794bb0..ebf01d4 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -966,17 +966,23 @@ sub-forms. See also `macrostep-sexp-at-point'."
(defun macrostep-slime--propertize-macros (start-offset column-offset
positions)
"Put text properties on macro forms."
(dolist (position positions)
- (destructuring-bind (_ type start start-line op-end op-end-line end
end-line)
+ (destructuring-bind (_ type start start-line op-length)
position
- (put-text-property (+ start-offset start (* column-offset start-line))
- (+ start-offset end (* column-offset end-line))
- 'macrostep-macro-start t)
- (put-text-property (+ 1 start-offset start (* column-offset start-line))
- (+ 1 start-offset op-end (* column-offset
op-end-line))
- 'font-lock-face
- (if (eq type :macro)
- 'macrostep-macro-face
- 'macrostep-compiler-macro-face)))))
+ (let ((opening-parenthesis-position
+ (+ start-offset start (* column-offset start-line))))
+ (put-text-property opening-parenthesis-position
+ (1+ opening-parenthesis-position)
+ 'macrostep-macro-start
+ t)
+ ;; this assumes that the operator starts right next to the
+ ;; opening parenthesis. We could probably be more robust.
+ (let ((op-start (1+ opening-parenthesis-position)))
+ (put-text-property op-start
+ (+ op-start op-length)
+ 'font-lock-face
+ (if (eq type :macro)
+ 'macrostep-macro-face
+ 'macrostep-compiler-macro-face)))))))
(defun macrostep-slime-macro-form-p (string)
(slime-eval
diff --git a/swank-macrostep.lisp b/swank-macrostep.lisp
index 6376af2..202801f 100644
--- a/swank-macrostep.lisp
+++ b/swank-macrostep.lisp
@@ -46,19 +46,14 @@
(loop for form in all-macros
for (start end) in positions
when (and start end)
- collect (let* ((op-name (to-string (first form)))
- ;; this assumes that the
- ;; operator starts right next
- ;; to the opening
- ;; parenthesis. We could
- ;; probably be more forgiving.
- (op-end (+ start (length op-name))))
- (list
- op-name
- (if (member form macros) :macro
:compiler-macro)
- start (position-line start pretty-expansion)
- op-end (position-line op-end
pretty-expansion)
- end (position-line end
pretty-expansion))))))))))
+ collect (let ((op-name (to-string (first form))))
+ (list op-name
+ (if (member form macros)
+ :macro
+ :compiler-macro)
+ start
+ (position-line start pretty-expansion)
+ (length op-name))))))))))
(defun position-line (position string)
(let ((line 0)
- [nongnu] elpa/macrostep 8d72b62 044/110: Fix indentation in new macrostep-pp function, (continued)
- [nongnu] elpa/macrostep 8d72b62 044/110: Fix indentation in new macrostep-pp function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 8950313 037/110: Bump version number and changelog for 0.8, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 5680278 056/110: Gross hack to macrostep--slime-propertize-macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 31e1dc2 060/110: Detect Elisp macro forms by advising `macroexpand`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep c61b836 062/110: Use SB-WALKER:WALK-FORM to collect macro forms, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 39e809a 064/110: swank-macrostep: call PROVIDE at the end, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 1be6c4d 061/110: Extract Elisp macro environments accurately, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d9c7629 063/110: Improvements to Elisp environment handling, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 59972eb 071/110: Fix handling of subforms contained within other subforms, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep a0ae61c 073/110: Properly handle forms not present in the expansion, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 817322b 074/110: Properly place the macrostep[-compiler]-macro-face,
ELPA Syncer <=
- [nongnu] elpa/macrostep aa40d97 076/110: Test expansion within Elisp macro-defining macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 1edee85 080/110: Reorganise and comment, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep bbfb033 081/110: Reorganise and document generic interface, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2bdc946 082/110: Remove dynamic binding of `macrostep-environment'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 31a23eb 085/110: Toggle separate-buffer expansion with prefix (#8), ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 47cbacb 087/110: Define `macrostep-propertize` before using it, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep a8e730e 089/110: Improve Makefile, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2473a6f 094/110: Pass START and END args to sexp-at-point-function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 03d4d7b 096/110: Add basic C macro expansion via cmacexp.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 9a6b04a 100/110: Restore Emacs 23 compatibility, ELPA Syncer, 2021/08/07