FStarLang / fstar-mode.el

Emacs support for F*
Apache License 2.0
67 stars 17 forks source link

Auto-fill in comments #48

Closed kkohbrok closed 7 years ago

kkohbrok commented 7 years ago

It would be nice to have automatic line breaks happening in comments when the line grows too long. From what I could find on that subject, it is already implemented in modes for other languages. Not sure if this is feasible to do, but I think this would be a useful feature.

cpitclaudel commented 7 years ago

Are you thinking of M-x auto-fill-mode?

kkohbrok commented 7 years ago

Yes, except that it only applies in a comment environment: ( .... ) or line //. such that if I type normal code, lines don't get wrapped and if I type an actual text (such as in a comment), lines do get wrapped.

cpitclaudel commented 7 years ago

comment-auto-fill-only-comments? :)

kkohbrok commented 7 years ago

Amazing, thank you!

How did I miss this? Is that a standard thing in every mode? If not, then it might be worth mentioning on the Readme page. Or set it by default? I don't know how well it plays with fsdoc, though.

cpitclaudel commented 7 years ago

I think it's pretty standard, yes :) https://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Fill.html

cpitclaudel commented 7 years ago

In fact, it was the subject of an early request: https://github.com/FStarLang/fstar-mode.el/issues/15

kkohbrok commented 7 years ago

Ok, I guess I have to search more thoroughly next time. Thanks again!

cpitclaudel commented 7 years ago

No problem. Happy to help :)