ahungry / prog-fill

Emacs prog-fill functionality (smartly break lines to use vertical space)
GNU General Public License v3.0
20 stars 1 forks source link

Other languages and techniques #3

Open alphapapa opened 6 years ago

alphapapa commented 6 years ago

Hi,

This looks very interesting! Thanks for sharing. Have you thought about using the Emacs syntax-table to determine where to break lines? I guess it might not be as specific as detecting method invocations, but it might be more generically applicable, which might make it easy to support any major mode's language, even if not in an optimal way.

ahungry commented 6 years ago

That's a good idea, I'll have to look into, thanks!

Do you happen to have a small reference or sample handy? (I haven't manually parsed the Emacs syntax-table in the past).

alphapapa commented 6 years ago

I would look at the "Syntax Tables" section of the elisp manual. The syntax-ppss function is probably most of what you need.