unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8506: 24.0.50; Wrong column count
@ 2011-04-15 11:48 Eli Barzilay
  2011-04-15 14:56 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Barzilay @ 2011-04-15 11:48 UTC (permalink / raw)
  To: 8506

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 ⟨

The column number that is shown is 2.



In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0)
 of 2011-04-15 on winooski.ccs.neu.edu
Windowing system distributor `Fedora Project', version 11.0.10904000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: POSIX
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  value of $XMODIFIERS: @im=none
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr message sendmail regexp-opt format-spec rfc822
mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader emacsbug
url-util url-parse auth-source eieio byte-opt bytecomp byte-compile
assoc gnus-util time-date password-cache url-vars mm-util mail-prsvr
multi-isearch pp help-fns cus-start cus-load quail help-mode easymenu
view tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face files text-properties overlay md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#8506: 24.0.50; Wrong column count
  2011-04-15 11:48 bug#8506: 24.0.50; Wrong column count Eli Barzilay
@ 2011-04-15 14:56 ` Eli Zaretskii
  2011-04-15 15:24   ` Eli Barzilay
  2011-10-07  7:05   ` Glenn Morris
  0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2011-04-15 14:56 UTC (permalink / raw)
  To: Eli Barzilay; +Cc: 8506

> 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.






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#8506: 24.0.50; Wrong column count
  2011-04-15 14:56 ` Eli Zaretskii
@ 2011-04-15 15:24   ` Eli Barzilay
  2011-04-15 21:03     ` Eli Barzilay
  2011-10-07  7:05   ` Glenn Morris
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Barzilay @ 2011-04-15 15:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 8506

25 minutes ago, Eli Zaretskii wrote:
> [...]
> This is intentional.
> [...]
> 
> However, at least on my machine, with "Arial Unicode MS" font, the
> character actually displays thinner than normal, so perhaps the font
> is wrong.

Yeah, I have a similarly narrower rendering, using Consolas.


> 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.

Maybe add an option to make the column count ignore these widths
(which could also be used if you want it to be faster)?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#8506: 24.0.50; Wrong column count
  2011-04-15 15:24   ` Eli Barzilay
@ 2011-04-15 21:03     ` Eli Barzilay
  2011-04-15 21:14       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Barzilay @ 2011-04-15 21:03 UTC (permalink / raw)
  To: Eli Zaretskii, 8506

6 hours ago, Eli Barzilay wrote:
> 25 minutes ago, Eli Zaretskii wrote:
> > [...]
> > This is intentional.
> > [...]
> > 
> > However, at least on my machine, with "Arial Unicode MS" font, the
> > character actually displays thinner than normal, so perhaps the font
> > is wrong.
> 
> Yeah, I have a similarly narrower rendering, using Consolas.

Two more points:

* It looks like it might be intentionally narrower -- I see that it's
  exactly 1.5 times narrower than plain characters.

* Perhaps a better complaint would have been about cursor navigation.
  I'm editing more text with those brackets, and the random horizontal
  jumps make it a nightmare.


But at least I can now do

  (set-char-table-range char-width-table '(#x2329 . #x232A) 1)

which less erroneous than the actual

  (set-char-table-range char-width-table '(#x2329 . #x232A) 0.666)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#8506: 24.0.50; Wrong column count
  2011-04-15 21:03     ` Eli Barzilay
@ 2011-04-15 21:14       ` Eli Zaretskii
  2011-04-15 21:19         ` Eli Barzilay
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2011-04-15 21:14 UTC (permalink / raw)
  To: Eli Barzilay; +Cc: 8506

> From: Eli Barzilay <eli@barzilay.org>
> Date: Fri, 15 Apr 2011 17:03:25 -0400
> 
> * Perhaps a better complaint would have been about cursor navigation.
>   I'm editing more text with those brackets, and the random horizontal
>   jumps make it a nightmare.

What jumps?  You said nothing about cursor jumps in your original
report.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#8506: 24.0.50; Wrong column count
  2011-04-15 21:14       ` Eli Zaretskii
@ 2011-04-15 21:19         ` Eli Barzilay
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Barzilay @ 2011-04-15 21:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 8506

Two minutes ago, Eli Zaretskii wrote:
> > From: Eli Barzilay <eli@barzilay.org>
> > Date: Fri, 15 Apr 2011 17:03:25 -0400
> > 
> > * Perhaps a better complaint would have been about cursor
> >   navigation.  I'm editing more text with those brackets, and the
> >   random horizontal jumps make it a nightmare.
> 
> What jumps?  You said nothing about cursor jumps in your original
> report.

[Brain fart, sorry.  Those were my own functions.]

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#8506: 24.0.50; Wrong column count
  2011-04-15 14:56 ` Eli Zaretskii
  2011-04-15 15:24   ` Eli Barzilay
@ 2011-10-07  7:05   ` Glenn Morris
  2011-10-07 11:45     ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2011-10-07  7:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Eli Barzilay, 8506

Eli Zaretskii wrote:

> That's why Emacs thinks you are in column 2 after this character: it
> is told that its width is 2.

From reading this report, it seems to me that there is not actually a
bug here, is that correct?

(The rest of the discussion seems to be about fonts and some
user-defined functions.)





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#8506: 24.0.50; Wrong column count
  2011-10-07  7:05   ` Glenn Morris
@ 2011-10-07 11:45     ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2011-10-07 11:45 UTC (permalink / raw)
  To: Glenn Morris; +Cc: eli, 8506

> From: Glenn Morris <rgm@gnu.org>
> Cc: Eli Barzilay <eli@barzilay.org>,  8506@debbugs.gnu.org
> Date: Fri, 07 Oct 2011 03:05:03 -0400
> 
> Eli Zaretskii wrote:
> 
> > That's why Emacs thinks you are in column 2 after this character: it
> > is told that its width is 2.
> 
> >From reading this report, it seems to me that there is not actually a
> bug here, is that correct?

Yes, it's correct.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-07 11:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-15 11:48 bug#8506: 24.0.50; Wrong column count Eli Barzilay
2011-04-15 14:56 ` Eli Zaretskii
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

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).