all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Chong Yidong <cyd@gnu.org>
Cc: darthandrus@gmail.com, 11068@debbugs.gnu.org
Subject: bug#11068: 24.0.94; Face-remapped background does not extend to end of window
Date: Sun, 25 Mar 2012 06:02:49 +0200	[thread overview]
Message-ID: <83ty1ds4ye.fsf@gnu.org> (raw)
In-Reply-To: <87mx75z8n6.fsf@gnu.org>

> From: Chong Yidong <cyd@gnu.org>
> Cc: darthandrus@gmail.com,  monnier@iro.umontreal.ca,  11068@debbugs.gnu.org
> Date: Sun, 25 Mar 2012 11:01:17 +0800
> 
> Eli Zaretskii <eliz@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.

OK.

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

Right.

> 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?

Here I disagree: I think we should confine the internal details of
face remapping to lookup_basic_face, instead of spilling our knowledge
about that all over.  As you just said above, if face-remapping-alist
is nil, that function returns immediately, so there's nothing lost
here for the "usual" use-case.

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

OK, but to be absolutely fair, I must point out that, while the patch
is very simple, it has one non-trivial consequence: when the default
face _is_ remapped, the empty space to the right of any L2R line and
the empty lines beyond EOB are filled with stretch glyphs of a
suitably computed width.  Before the patch, there were no glyphs in
those places.  So, from the POV of the content of the glyph matrices,
the change introduced by these patches is quite prominent.  In
particular, this could potentially affect any code that examines the
glyphs of a glyph matrix; previously, such stretch glyphs were only
present at the left side of R2L glyph rows.





  reply	other threads:[~2012-03-25  4:02 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 20:49 bug#11068: 24.0.94; Face-remapped background does not extend to end of window Ivan Andrus
     [not found] ` <handler.11068.B.13324512277363.ack@debbugs.gnu.org>
2012-03-22 21:18   ` bug#11068: Acknowledgement (24.0.94; Face-remapped background does not extend to end of window) Ivan Andrus
2012-03-22 21:33     ` Glenn Morris
2012-03-22 21:31 ` bug#11069: 24.0.94; Face-remapped background does not extend to end of window Glenn Morris
2012-03-23 10:36 ` bug#11068: " Eli Zaretskii
2012-03-23 10:48   ` Ivan Andrus
2012-03-24 12:37   ` Eli Zaretskii
2012-03-24 13:42     ` martin rudalics
2012-03-24 14:12       ` Eli Zaretskii
2012-03-24 19:48         ` martin rudalics
2012-03-24 20:47           ` Eli Zaretskii
2012-03-25 12:54             ` martin rudalics
2012-03-25 17:22               ` Eli Zaretskii
2012-03-25 19:19                 ` martin rudalics
2012-03-25 19:53                   ` Stefan Monnier
2012-03-25 20:44                     ` martin rudalics
2012-03-25 21:49                   ` Eli Zaretskii
2012-03-25 21:53                     ` Eli Zaretskii
2012-03-26  7:05                     ` martin rudalics
2012-03-26 19:32                       ` Eli Zaretskii
2012-03-27  9:23                         ` martin rudalics
2012-03-27 18:40                           ` Eli Zaretskii
2012-03-30  7:35                             ` martin rudalics
2012-03-30  8:18                               ` Eli Zaretskii
2012-03-30 10:14                                 ` martin rudalics
2012-03-30 11:42                                   ` Eli Zaretskii
2012-03-31 10:29                                     ` Eli Zaretskii
2012-03-30 10:47                                 ` martin rudalics
2012-03-24 18:04       ` Stefan Monnier
2012-03-24 19:48         ` martin rudalics
2012-03-24 14:17     ` Chong Yidong
2012-03-24 14:40       ` Eli Zaretskii
2012-03-25  3:01         ` Chong Yidong
2012-03-25  4:02           ` Eli Zaretskii [this message]
2012-03-25  6:20             ` Chong Yidong
2012-03-25 12:55               ` martin rudalics
2012-03-25 17:26                 ` Eli Zaretskii
2012-03-25 19:20                   ` martin rudalics
2012-03-25 17:51               ` Eli Zaretskii
2012-03-26  4:16                 ` Chong Yidong
2012-03-26 19:35                   ` Eli Zaretskii
2012-03-30  8:49                   ` Eli Zaretskii
2012-03-25 12:54             ` martin rudalics
2012-03-25 17:25               ` Eli Zaretskii
2012-03-25 19:19                 ` martin rudalics
2012-03-25 21:50                   ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ty1ds4ye.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=11068@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=darthandrus@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.