Some time ago, I read parts of fill.el
. This turned out to be quite a rewarding experience, in a rather warped sense. Let me quote a few highlights from that file.
(defun fill-single-word-nobreak-p () "Don't break a line after the first or before the last word of a sentence." ;; Actually, allow breaking before the last word of a sentence, so long as ;; it's not the last word of the paragraph. (...))
This is just plain terrible (though funny, for certain values of “funny”). I’m going to submit a patch which incorporates the comment in the docstring.
Earlier in the file, in the function canonically-space-region
(which see – it’s actually interesting and potentially useful!) I found this gem:
;; Nuke tabs; they get screwed up in a fill. ;; This is quick, but loses when a tab follows the end of a sentence. ;; Actually, it is difficult to tell that from "Mr.\tSmith". ;; Blame the typist.
This not the end. Read fill.el
for yourself to get more fun. (And it’s even funnier to check who actually committed those lines!)