[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep a0ae61c 073/110: Properly handle forms not prese
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep a0ae61c 073/110: Properly handle forms not present in the expansion |
Date: |
Sat, 7 Aug 2021 09:18:05 -0400 (EDT) |
branch: elpa/macrostep
commit a0ae61c516d410c74353b9443c0293a060c55d55
Author: Luís Oliveira <loliveira@common-lisp.net>
Commit: Luís Oliveira <loliveira@common-lisp.net>
Properly handle forms not present in the expansion
---
macrostep.el | 2 +-
swank-macrostep.lisp | 28 +++++++++++++++++-----------
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 564784b..6794bb0 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -966,7 +966,7 @@ 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-end op-end-line end
end-line)
position
(put-text-property (+ start-offset start (* column-offset start-line))
(+ start-offset end (* column-offset end-line))
diff --git a/swank-macrostep.lisp b/swank-macrostep.lisp
index 84daa1a..6376af2 100644
--- a/swank-macrostep.lisp
+++ b/swank-macrostep.lisp
@@ -45,15 +45,20 @@
(list pretty-expansion
(loop for form in all-macros
for (start end) in positions
- ;; this assumes that the operator starts right
- ;; next to the opening parenthesis. We could
- ;; probably be more forgiving.
- for op-end = (+ start (length (to-string (first form))))
- collect (list
- (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)))))))))
+ 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))))))))))
(defun position-line (position string)
(let ((line 0)
@@ -195,7 +200,8 @@
in (collect-marker-positions
(pprint-to-string expansion (make-tracking-pprint-dispatch
forms))
(length forms))
- collect (list (find-non-whitespace-position printed-expansion start)
- (find-non-whitespace-position printed-expansion end))))
+ collect (when (and start end)
+ (list (find-non-whitespace-position printed-expansion start)
+ (find-non-whitespace-position printed-expansion
end)))))
(provide :swank-macrostep)
- [nongnu] elpa/macrostep a478a3a 054/110: Bind inhibit-read-only instead of buffer-read-only, (continued)
- [nongnu] elpa/macrostep a478a3a 054/110: Bind inhibit-read-only instead of buffer-read-only, ELPA Syncer, 2021/08/07
- [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 <=
- [nongnu] elpa/macrostep 817322b 074/110: Properly place the macrostep[-compiler]-macro-face, ELPA Syncer, 2021/08/07
- [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