Subject: bug#60781: 28.2; column-number-mode counts differently based on character encoding

From: Eli Zaretskii <[email-masked]>
Date: Fri, 13 Jan 2023 20:32:57 +0200

tags 60781 notabug
thanks

> Date: Fri, 13 Jan 2023 13:31:29 GMT
> From: Van Ly <[email-masked]>
> 
> // one right arrow key move of the cursor from the left most position
> // numbers differently in column-number-mode based on character encoding
> 
> These steps reproduce the observed unexpected behavior:
> 
> * emacs -Q /tmp/example.text
> * move cursor to line two at left most position, then right arrow key once
> * M-x column-number-mode
> * the modeline indicator shows (2,2)
> * move cursor to line nine at left most position, then right arrow key once
> * the modeline indicator shows (9,1)
> 
> // for cjk the column number is two
> // for ascii the column number is one
> 
> * expected modeline indicator to show (2,1) and (9,1)

Your expectations are incorrect.  Some characters, including the ones
in line 2 of your example file, are double-width characters, they take
up more than one column on display.  Which characters take two columns
is defined by the Unicode standard, and most fonts follow that
standard, in that the character glyphs they provide are indeed wider
than ASCII or Latin characters.  And column-number-mode counts columns
on display, it doesn't count characters.

This is not a bug, but the expected and correct behavior.