unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Eli Barzilay <eli@barzilay.org>
Cc: 8506@debbugs.gnu.org
Subject: bug#8506: 24.0.50; Wrong column count
Date: Fri, 15 Apr 2011 17:56:21 +0300	[thread overview]
Message-ID: <83lizbpnqi.fsf@gnu.org> (raw)
In-Reply-To: <m3ei5320rm.fsf@winooski.ccs.neu.edu>

> From: Eli Barzilay <eli@barzilay.org>
> Date: Fri, 15 Apr 2011 07:48:45 -0400
> 
> Column numbers in the mode line are wrong with certain characters, I've
> seen this with angle brackets.  To reproduce the problem:
> 
>   * Start emacs and go to the scratch buffer
>   * M-x column-number-mode
>   * C-\ sgml RET
>   * enter &lang;
> 
> The column number that is shown is 2.

This is intentional.  The character that is inserted by the above is
〈, u+2329 (LEFT-POINTING ANGLE BRACKET), and that character is marked
as "W" (meaning Wide) in the Unicode Data Base, see here:

 http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt

Therefore, characters.el has this:

  ;; 2: East Asian Wide and Full-width characters.
  (let ((l '((#x1100 . #x115F)
	     (#x2329 . #x232A)  <<<<<<<<<<<<<<<<<<<<
	     (#x2E80 . #x303E)
	     (#x3040 . #xA4CF)
	     (#xAC00 . #xD7A3)
	     (#xF900 . #xFAFF)
	     (#xFE30 . #xFE6F)
	     (#xFF01 . #xFF60)
	     (#xFFE0 . #xFFE6)
	     (#x20000 . #x2FFFF)
	     (#x30000 . #x3FFFF))))
    (dolist (elt l)
      (set-char-table-range char-width-table elt 2)))

and consequently (aref char-width-table ?\〈) => 2.  That's why Emacs
thinks you are in column 2 after this character: it is told that its
width is 2.

However, at least on my machine, with "Arial Unicode MS" font, the
character actually displays thinner than normal, so perhaps the font
is wrong.

OTOH, this page:

  http://en.wikipedia.org/wiki/Bracket

says that these two characters "are canonically equivalent to the CJK
code points U+300x and thus likely to render as double-width symbols".

Unless someone comes up with a good reason why we should change the
width of this character in char-width-table, or there are other
characters which somehow defeat the column numbers, I suggest to close
this bug.






  reply	other threads:[~2011-04-15 14:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 11:48 bug#8506: 24.0.50; Wrong column count Eli Barzilay
2011-04-15 14:56 ` Eli Zaretskii [this message]
2011-04-15 15:24   ` Eli Barzilay
2011-04-15 21:03     ` Eli Barzilay
2011-04-15 21:14       ` Eli Zaretskii
2011-04-15 21:19         ` Eli Barzilay
2011-10-07  7:05   ` Glenn Morris
2011-10-07 11:45     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83lizbpnqi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=8506@debbugs.gnu.org \
    --cc=eli@barzilay.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).