macrostep icon indicating copy to clipboard operation
macrostep copied to clipboard

`macrostep-expand` fails with a "Scan error" unlike `eval-last-sexp`

Open wasamasa opened this issue 9 years ago • 1 comments

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?

wasamasa avatar Jun 26 '15 19:06 wasamasa

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))

stsquad avatar Apr 27 '18 10:04 stsquad