GNU bug report logs - #11068
24.0.94; Face-remapped background does not extend to end of window

Previous Next

Package: emacs;

Reported by: Ivan Andrus <darthandrus <at> gmail.com>

Date: Thu, 22 Mar 2012 21:21:02 UTC

Severity: wishlist

Found in version 24.0.94

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #49 received at 11068 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: darthandrus <at> gmail.com, 11068 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#11068: 24.0.94;
	Face-remapped background does not extend to end of window
Date: Sun, 25 Mar 2012 11:01:17 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> This looks a bit strange.  Why is DEFAULT_FACE_ID handled specially
>> here?
>
> In my testing, I didn't see the need to do it even for the default
> face, because it->face_id is already set to the ID of the remapped
> face.  So it's just me being paranoiac.

I'd just leave that bit out.

Also, in this hunk

@@ -18173,7 +18173,12 @@
 	  it->len = 1;
 
 	  if (default_face_p)
-	    it->face_id = DEFAULT_FACE_ID;
+	    {
+	      if (NILP (Vface_remapping_alist))
+		it->face_id = DEFAULT_FACE_ID;
+	      else
+		it->face_id = lookup_basic_face (it->f, DEFAULT_FACE_ID);
+	    }
 	  else if (it->face_before_selective_p)
 	    it->face_id = it->saved_face_id;
 	  face = FACE_FROM_ID (it->f, it->face_id);

You should call lookup_basic_face without the surrounding if statement,
because lookup_basic_face returns its second arg immediately if
face-remapping-alist is nil, making the extra check redundant.

And here

+	  if (row->reversed_p
+	      || lookup_basic_face (it->f, DEFAULT_FACE_ID) != DEFAULT_FACE_ID)

shouldn't you just compare default_face->id to DEFAULT_FACE_ID instead
of making another lookup_basic_face call?

With these changes, the patch seems pretty safe; even if something
screws up, it will only affect how remapped faces extend to the end of
the buffer, which was broken before anyway.  So feel free to commit.




This bug report was last modified 13 years and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.