unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Miles Bader <miles@gnu.org>
To: emacs-devel@gnu.org
Subject: tab widths with a remapped default face
Date: Fri, 06 Jun 2008 01:19:55 -0400	[thread overview]
Message-ID: <6163snp2bo.fsf@fencepost.gnu.org> (raw)

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	other threads:[~2008-06-06  5:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06  5:19 Miles Bader [this message]
2008-06-06  5:53 ` tab widths with a remapped default face 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

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=6163snp2bo.fsf@fencepost.gnu.org \
    --to=miles@gnu.org \
    --cc=emacs-devel@gnu.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).