[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
column numbers for non-ASCII characters in error messages
From: |
Ben Pfaff |
Subject: |
column numbers for non-ASCII characters in error messages |
Date: |
Sat, 18 Dec 2010 10:38:47 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
The GNU coding standards say how to calculate column numbers for
ASCII characters:
Line numbers should start from 1 at the beginning of the file, and
column numbers should start from 1 at the beginning of the line. (Both
of these conventions are chosen for compatibility.) Calculate column
numbers assuming that space and all ASCII printing characters have
equal width, and assuming tab stops every 8 columns.
They don't say how to calculate them for non-ASCII characters. I
guess that this is because doing so is somewhat difficult.
However, I'd like to figure out what is the "best" way to do it.
So far, I've thought of the following ways:
* Byte offset from beginning of line.
* Display width from beginning of line, with double-wide
characters counting as two positions and combining
characters (e.g. combining accents) counting as zero
positions.
* Grapheme clusters (user-visible characters) from
beginning of line, as specified in Unicode Standard
Annex #29 "Unicode Text Segmentation".
Which one is most likely to be useful to users? It seems that
Emacs computes column positions in terms of display width.
Thanks,
Ben.
(If there is a better place to ask this question, let me know.)
--
Ben Pfaff
http://benpfaff.org
- column numbers for non-ASCII characters in error messages,
Ben Pfaff <=