Closed jsoo1 closed 4 years ago
I see that haskell-mode
actually uses these settings:
(setq-local paragraph-start (concat " *{-\\| *-- |\\|" page-delimiter))
(setq-local paragraph-separate (concat " *$\\| *\\({-\\|-}\\) *$\\|" page-delimiter))
Perhaps you'd like to try those out locally, because I feel like they should work well for Elm too. Note that haskell-mode
also has a custom fill-paragraph-function
to smartly fill inside comments, which we could also borrow if helpful.
Ok I will try it out.
I find it a bit awkward when editing Haskell since skipping language pragmas often means moving forward many "paragraphs". That said I think the paragraph settings can be a local configuration for me and other evil users. Treating multiline comments as paragraphs seems like the right choice in general. Also it seems like a nicer experience in elm since there will be no language pragmas.
I don’t have any strong feelings on using haskell’s specialized fill-paragraph rules. I can add them if you want but seems better to leave them out until really necessary.
I also noticed they inhibit electric indent. Maybe that would be something worth thinking about for elm too?
I don’t have any strong feelings on using haskell’s specialized fill-paragraph rules. I can add them if you want but seems better to leave them out until really necessary.
Agree, leave it out for now.
I also noticed they inhibit electric indent.
Yes, I think I added that myself: I'm pretty much the only active haskell-mode
maintainer at the moment too. :-)
Maybe that would be something worth thinking about for elm too?
Not sure, but possibly. I think I'd probably want an example of why it was necessary, though. Elm doesn't have the same type of indentation-driven layout rules as Haskell.
(setq-local paragraph-start (concat " *{-\\| *-- |\\|" page-delimiter))
(setq-local paragraph-separate (concat " *$\\| *\\({-\\|-}\\) *$\\|" page-delimiter))
Works nicely. dap
deletes the whole comment.
I also noticed they inhibit electric indent.
Yes, I think I added that myself: I'm pretty much the only active haskell-mode maintainer at the moment too. :-)
Maybe that would be something worth thinking about for elm too?
Not sure, but possibly. I think I'd probably want an example of why it was necessary, though. Elm doesn't have the same type of indentation-driven layout rules as Haskell.
Ok I will not do anything with electric indent.
Also
Yes, I think I added that myself: I'm pretty much the only active haskell-mode maintainer at the moment too. :-)
Thank you so much. I really appreciate all your work.
Awesome, thanks for fixing this up. :-)
Closes #163
I'm wondering if it's worth using anything other than default for
paragraph-separate
It's a little counter-intuitive to navigate through a doc-comment and then the defun as two separate paragraphs.This also leaves the following problem. If the point is in the indicated position,
(forward-paragraph)
doesn't continue past the comment closing:That means that
dap
will delete the comment close in addition tog
.I'm not sure being able to fill-paragraph a doc comment is really worth it. But the current PR does preserve the fill-paragraph behavior as before.
The PR also fixes the paragraph detection in a buffer with trailing whitespace.