Fuco1 / smartparens

Minor mode for Emacs that deals with parens pairs and tries to be smart about it.
GNU General Public License v3.0
1.83k stars 194 forks source link

sp-clone-sexp with point not immediately before sexp #949

Open whxvd opened 5 years ago

whxvd commented 5 years ago

According to docstring M-x sp-clone-sexp RET on (| ()) should yield

(  ())
(  ())

because point is two spaces before an sexp, i.e. not immediately before. But the actual behavior results in

(  ()
   ())

as if it were executed on ( |()).

Fuco1 commented 5 years ago

I think the docs are not clear but the expected behaviour is the one that happens.

The provision in the docstring is supposed to handle this case:

((asdasd |asdsad asdda))

turns into

((asdasd asdsad asdda)
 (asdasd |asdsad asdda))

If you can come up with some better wording, I'll be happy to improve the documentation. Or maybe we can add examples?

whxvd commented 5 years ago

I will come up with a PR, after studying and clarifying remaining questions about the Smartparens terminology.

whxvd commented 5 years ago

There is a Smartparens documentation on readthedocs. And there is docs subdir in the repo. The readme mentions only the wiki.

Is the wiki a superset of the other two sources?

whxvd commented 5 years ago

Is the wiki a superset of the other two sources?

I just found that the "Automatic escaping" wiki page refers to readthedocs. Probably the readthedocs stuff is created from the docs subdir in the smarparens repo. So I assume that the wiki, including what it links to, is indeed a superset of all documentation (excluding external blog articles).

Fuco1 commented 5 years ago

Wiki is the "old" documentation which I'm moving to readthedocs. So the pages already migrated to sphinx have priority, otherwise the wiki is the authoritative source.