The first line of a text file is line number 1 in probably every application I have ever come across, including Emacs.
Every application I have at hand also uses column number 1 for the first column of each line. Except for Emacs, which says it is column number 0.
My questions:
- Is column number 1 the near-universal convention (as it would seem)?
- What is the history/rationale for Emacs using column number 0 by default? (It's used both in the return value of
current-column
and on the mode line whencolumn-number-mode
is enabled.) Is this a historical convention on some old operating system or community, or did it debut in Emacs?
I just found out that Emacs 26.1 introduced a new customizable variable column-number-indicator-zero-based
to control this. From the release notes:
Traditionally, in Column Number mode, the displayed column number counts from zero starting at the left margin of the window. This behavior is now controlled by 'column-number-indicator-zero-based'. If you would prefer for the displayed column number to count from one, you may set this variable to nil. (Behind the scenes, there is now a new mode line construct, '%C', which operates exactly as '%c' does except that it counts from one.)
This is neat, but still doesn't shed light on the history or rationale.