emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorrect TAB width


From: Bertrand Petit
Subject: Re: Incorrect TAB width
Date: Mon, 13 Jun 2005 21:10:14 +0200
User-agent: Mutt/1.4.2i

On Mon, Jun 13, 2005 at 11:03:14AM -0400, Richard Stallman wrote:
> This is an important problem, and I think we need to fix it.

        I agree. This bug leads to incorrect indentations. I am not
alone with this trouble, a message in emacs-devel on the 17th of
December, 2004, also describes the same problem:

<URL:http://lists.gnu.org/archive/html/emacs-devel/2004-12/msg00650.html>

>  I cannot reproduce it myself, since I don't have a new version of
> X.

        We can arrange for a private access to my font server if it
may help you.

> It surprises me that any any version of X can tell whether the Emacs
> buffer contains tabs or spaces.

        I suppose something has changed in the way the font metrics
are conveyed to the display client. 

> If Emacs even looks at the fonts' width for tab, that seems to be a
> bug.

        It seems so. The tabulation width calculation method was
reported on the 27th of December, 2004, by Kenichi Handa:

  Tab width is calculated as this (x_produce_glyphs):
    int tab_width = it->tab_width * FRAME_COLUMN_WIDTH (it->f);
  and, x_new_font sets the column width (i.e. the
  canonical character width) of a frame as this:
    FRAME_COLUMN_WIDTH (f) = FONT_WIDTH (FRAME_FONT (f));
  and FONT_WIDTH is defined as this:
    #define FONT_WIDTH(f) ((f)->max_bounds.width)

<URL:http://lists.gnu.org/archive/html/emacs-devel/2004-12/msg00884.html>

> So if you can find out where Emacs even pays attention to what the
> font says or does for a tab character, that should be a start at
> debugging this problem.

        For emacs 21.4a the tab width calculation is located for X11
displays at the 1982nd ligne of xdisp.c and at the 2200th line of
w32disp.c for ms-windows.

-- 
%!PS
297.6 420.9 translate 90 rotate 0 setgray gsave 0 1 1{pop 0 180 moveto 100
180 170 100 170 -10 curveto 180 -9 180 -9 190 -10 curveto 190 100 100 180
0 180 curveto fill 180 rotate}for grestore/Bookman-LightItalic findfont
240 scalefont setfont -151.536392 -63.7998886 moveto (bp)show showpage

Attachment: pgpjJKGPj3VTT.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]