Dot Space Space

An Emacs anecdote

I have a confession to make. I used to put two spaces after each sentence, as it used to be done by typewriter typists before computers [citation needed].

The moment when I started to form this habit was around 2010. I was young and easy to impress, and I was picking up more advanced Emacs use working on the TeX source for my diploma thesis. While editing these large chunks of free-form text was when I discovered the fill-paragraph function, otherwise known as M-q, for automatically breaking text at the correct column width. This is very useful for editing text files, so it quickly became a habit to press M-q often. I’m still using it right now, in fact.

Now after a while of using this feature, I started to observe that this didn’t work exactly how I thought. Readjusting text where one line ends with a full stop, it would surprisingly add two spaces in the middle after breaking.

This text:

Hello world.
This is a text.

Would turn into that text after a press of M-q:

Hello world.  This is a text.

Then somewhere in Emacs documentation, I found key bindings jump back and forth between sentences (M-a, M-e), and these also rely on double-spaces to tell apart sentence ends from abbreviations (e.g. as in Dr. Seuss).

I did not end up picking up these shortcuts, but it was enough for me to rationalize the double spaces. In reality of course, I only started with that habit so that M-q would not break the otherwise consistent spacing style accidentally.

I used this for about 10 years now, and of course it didn’t elude me that I was the only one doing that, but it’s hard to put down old habits.

Recently, I found what I think is the remedy - M-q is actually configurable in Emacs, and the old habit of pressing M-q will now just fix my sentences to single-spaces again going forward.

This is what is needed:

(setq sentence-end-double-space nil)

What do we learn from this story? I’m not sure. Maybe that old habits are hard to shake. Some quirks creep in without you noticing and a tiny change might fix them.

M-q

Comments