branch: elpa/macrostep
commit ee46132b5be689b573d3386284ad53aa35de4d8c
Author: joddie <[email protected]>
Commit: joddie <[email protected]>
Print dotted lists in expansions correctly
---
macrostep.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/macrostep.el b/macrostep.el
index 06f333e..0bdcc3c 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -566,15 +566,21 @@ sub-forms. See also `macrostep-sexp-at-point'."
(insert " ")
(setq sexp (cdr sexp)))
;; print remaining list elements
- (dolist (inner sexp)
- (macrostep-print-sexp inner)
- (insert " "))
- (backward-delete-char 1)
+ (while sexp
+ (if (listp sexp)
+ (progn
+ (macrostep-print-sexp (car sexp))
+ (when (cdr sexp) (insert " "))
+ (setq sexp (cdr sexp)))
+ ;; Print tail of dotted list
+ (insert ". ")
+ (macrostep-print-sexp sexp)
+ (setq sexp nil)))
(insert ")")))))
;; print non-lists as normal
(t (prin1 sexp (current-buffer)))))
-
+
(provide 'macrostep)