emacs-devel
[Top][All Lists]
Advanced

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

tab widths with a remapped default face


From: Miles Bader
Subject: tab widths with a remapped default face
Date: Fri, 06 Jun 2008 01:19:55 -0400

The following patch seems to fix the bad tab rendering when the default
face is altered using face remapping.  Any objections?

It will also change the way tabs are computed for explicit faces (and
other implicit faces such as the region), but I think it's probably
usually the right thing to do for those cases too.

Thanks,

-Miles


--- orig/src/xdisp.c
+++ mod/src/xdisp.c
@@ -21125,14 +21125,14 @@
        }
       else if (it->char_to_display == '\t')
        {
-         int tab_width = it->tab_width * FRAME_SPACE_WIDTH (it->f);
+         int tab_width = it->tab_width * font->space_width;
          int x = it->current_x + it->continuation_lines_width;
          int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width;
 
          /* If the distance from the current position to the next tab
             stop is less than a space character width, use the
             tab stop after that.  */
-         if (next_tab_x - x < FRAME_SPACE_WIDTH (it->f))
+         if (next_tab_x - x < font->space_width)
            next_tab_x += tab_width;
 
          it->pixel_width = next_tab_x - x;


-- 
Year, n. A period of three hundred and sixty-five disappointments.




reply via email to

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