defunkt / coffee-mode

Emacs Major Mode for CoffeeScript
http://ozmm.org/posts/coffee_mode.html
574 stars 147 forks source link

Support for filling long strings? #319

Closed timvisher closed 6 years ago

timvisher commented 9 years ago

I think the right way to do this would be

charnock = "stah oesuth aoesut haoesut haoesut haoseut haoseut haosenut haosentu haosentu haoesutnh satoeuh santoeuh sanoetuh saenotuh aeostnuh."
charnock = "stah oesuth aoesut haoesut haoesut haoseut haoseut haosenut" +
           "haosentu haosentu haoesutnh satoeuh santoeuh sanoetuh saenotuh" +
           "aeostnuh."
syohex commented 8 years ago

M-x auto-fill-mode ?

timvisher commented 8 years ago

@syohex filling produces:

charnock = "stah oesuth aoesut haoesut haoesut haoseut haoseut
haosenut haosentu haosentu haoesutnh satoeuh santoeuh sanoetuh
saenotuh aeostnuh."
syohex commented 8 years ago
charnock = "stah oesuth aoesut haoesut haoesut haoseut haoseut haosenut haosentu haosentu haoesutnh satoeuh santoeuh sanoetuh saenotuh aeostnuh."

is different from

charnock = "stah oesuth aoesut haoesut haoesut haoseut haoseut haosenut
            haosentu haosentu haoesutnh satoeuh santoeuh sanoetuh saenotuh
            aeostnuh."

Your expected result has more spaces than original string.

timvisher commented 8 years ago

@syohex Let's move the goalpost, then, shall we? :)

syohex commented 8 years ago

Hmm, it is necessary to parse string and its content and it is difficult to implement in Emacs Lisp.

Is there such converter or beautifier in JavaScript or AltJS ?

timvisher commented 8 years ago

Not that i'm aware of. But i wouldn't count myself as particularly knowledgeable about such things.

timvisher commented 6 years ago

I don't use coffee-mode anymore. :(