lewang / ws-butler

Unobtrusively trim extraneous white-space *ONLY* in lines edited.
242 stars 26 forks source link

In a markdown file, the trailling two whitespaces is meaningful #23

Closed wasphin closed 7 years ago

wasphin commented 8 years ago

In a markdown file, the trailling two whitespaces are meaningful. So is there an option to skip trimming these two whitespaces.

See https://github.com/syl20bnr/spacemacs/issues/6510

lewang commented 8 years ago

What's the significance of two trailing white spaces in markdown?

On Wed, Jul 13, 2016 at 3:37 AM, was4444 notifications@github.com wrote:

In a markdown file, the trailling two whitespaces are meaningful. So is there an option to skip trimming these two whitespaces.

See syl20bnr/spacemacs#6510 https://github.com/syl20bnr/spacemacs/issues/6510

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lewang/ws-butler/issues/23, or mute the thread https://github.com/notifications/unsubscribe/AAjzbK60hSg9NA5-luHWiEBbPN5bTxzGks5qVJWpgaJpZM4JLJDL .

Le

wasphin commented 8 years ago

@lewang. newline. http://daringfireball.net/projects/markdown/syntax#p

When you do want to insert a
break tag using Markdown, you end a line with two or more spaces, then type return.

lewang commented 8 years ago

Is it only two spaces? Does 3 spaces just have no valid meaning?

It seems like ws-butler should just not be enabled for this mode.

On Wed, Jul 13, 2016 at 9:24 PM, was4444 notifications@github.com wrote:

@lewang https://github.com/lewang. newline.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lewang/ws-butler/issues/23#issuecomment-232532154, or mute the thread https://github.com/notifications/unsubscribe/AAjzbPGpVG02sm288eAjEqgssuff_39Uks5qVY-zgaJpZM4JLJDL .

Le

wasphin commented 8 years ago

@lewang, the docs said that 2 or 2+(2, 3, 4, ...) spaces are all meaningful. Yes, though less willing to disable it.

lewang commented 8 years ago

Can you try https://github.com/lewang/ws-butler/pull/24 ? If it fixes the issue I will cut a release with this change soon.

wasphin commented 8 years ago

Seems not work, some instructions is needed. Not that familiar with Emacs. I use Spacemacs to manage packages, the ws-butler version is 20150126.759. Here is what I do:

  1. replace the ws-butler.el file;
  2. run emacs --batch --eval '(byte-compile-file "ws-butler.el")'
wasphin commented 8 years ago

@lewang, it works. It seems Spacemacs only use ws-butler in changed mode.

It works if I set dotspacemacs-whitespace-cleanup to changed.

https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Bdistribution/spacemacs-base/config.el#L165

https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Bdistribution/spacemacs-base/packages.el#L1630