Christopher Allan Webber

VCS friendly, patchable, document line wrapping

Christopher Allan Webber at

A new blogpost: Having spent years being frustrated with plaintext conventions that are either just vcs/patch unfriendly or just annoying to view, I've finally come up with a good solution: each sentence on its own line, and wrap that line!

Claes Wallin (韋嘉誠), AJ Jordan, X11R5, Tyng-Ruey Chuang and 2 others likes this.

Claes Wallin (韋嘉誠) shared this.

Show all 9 replies

glad to know I'm not the only compulsive M-q'er out there...

Nathan Smith at 2015-12-18T00:38:41Z

sazius, Christopher Allan Webber likes this.

" In trying to please the plaintext gods, we have defiled their temple. Can we do better? "

And, as importantly, can we appease them to be safe from their wrath?

Their wrath would be the merge conflicts, I suppose. So it all goes hand in hand!

Claes Wallin (韋嘉誠) at 2015-12-18T13:56:51Z

Christopher Allan Webber, sazius likes this.

I admit I was surprised at the conclusion. I thought it was going to be the opposite, indented at the beginning of each sentence. I think that reads better, and it creates fewer lines by virtue of wasting less whitespace.

But now I tried it out, and indented-first-line makes emacs indent the lines below. And when I tried dustycloud-style, I was surprised to see that emacs even did the right thing when autofilling the first line! When it inserts a new second line, it preserves the indentation of the existing second line. Awesome.

So the proposal makes perfect use of the existing tool. I will adopt this right away.

Claes Wallin (韋嘉誠) at 2015-12-18T14:03:45Z

Christopher Allan Webber likes this.

Others have pointed out that "we should be changing the tools, not the way we write things", which is probably true. You can wdiff, and you can use git --word-diff, but applying patches is not as easy I think, and certainly version control systems usually don't have a good merge strategy. And what about those \n shifting around?

I'm down with more tool-based strategies if they exist and work though. Refutations welcome! :)

(I do think that all formats do work within tools though. The fact that we're filling/wrapping paragraphs is to satisfy our existing plaintext editor tools...)

Christopher Allan Webber at 2015-12-18T15:46:53Z

Claes Wallin (韋嘉誠) likes this.