drym-org / symex.el

An intuitive way to edit Lisp symbolic expressions ("symexes") structurally in Emacs
Other
271 stars 22 forks source link

`symex-join-lines-backwords` moves cursor into sexp. #59

Closed markgdawson closed 1 year ago

markgdawson commented 1 year ago

symex-join-lines-backwords doesn't work as I expected when moving a sexp into an empty line above, like this:

(+ 1

    |(+ 2))

It produces (note the cursor position):

(+ 1
     (|+ 2))

rather than:

(+ 1
     |(+ 2))

The inconsistent cursor position means it can't be repeated (either by running the command again or by using the a count).

Removing the call to foward-char here seems to work in every case that I can find.

countvajhula commented 1 year ago

Missed seeing this earlier - thanks for reporting it! The code moving forward by a character seems to have had some specific idea behind it, but evidently I neglected to note what it was, and I couldn't detect a failing case after removing it, either 🤷