unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* tab widths with a remapped default face
@ 2008-06-06  5:19 Miles Bader
  2008-06-06  5:53 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Miles Bader @ 2008-06-06  5:19 UTC (permalink / raw)
  To: emacs-devel

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.




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

end of thread, other threads:[~2008-06-06 21:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-06  5:19 tab widths with a remapped default face Miles Bader
2008-06-06  5:53 ` Stefan Monnier
2008-06-06  7:26   ` Miles Bader
2008-06-06  7:53     ` Stefan Monnier
2008-06-06 19:34       ` Gerd Möllmann
2008-06-06  8:08     ` Miles Bader
2008-06-06 19:13       ` Stefan Monnier
2008-06-06 21:41         ` Miles Bader

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