macrostep
macrostep copied to clipboard
`macrostep-expand` fails with a "Scan error" unlike `eval-last-sexp`
With eval-last-sexp
you can evaluate the last expression even if you put your cursor on the whitespace after the outer form, macrostep-expand
however fails with Scan error: "Unbalanced parentheses"
. Would it make sense to remedy this behaviour for more consistency?
Now I know what the problem is I have this fairly dumb solution:
;; see https://github.com/joddie/macrostep/issues/11
(defun my-macrostep-expand-wrapper ()
"Workaround `macrostep-expand' not liking white-space after a sexp."
(interactive)
(when (and (= ?\n (char-after))
(= (point) (cdr (bounds-of-thing-at-point 'sexp))))
(backward-char))
(macrostep-expand))