GNU bug report logs - #60781
28.2; column-number-mode counts differently based on character encoding

Previous Next

Package: emacs;

Reported by: Van Ly <van.ly <at> sdf.org>

Date: Fri, 13 Jan 2023 13:42:02 UTC

Severity: normal

Tags: notabug

Found in version 28.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Van Ly <van.ly <at> sdf.org>
Cc: 60781 <at> debbugs.gnu.org
Subject: bug#60781: 28.2; column-number-mode counts differently based on character encoding
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 <van.ly <at> sdf.org>
> 
> // 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.




This bug report was last modified 2 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.