unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: yuri.v.khan@gmail.com, 26909@debbugs.gnu.org
Subject: bug#26909: 25.1; A face for margins
Date: Tue, 12 May 2020 13:28:27 -0400	[thread overview]
Message-ID: <92f9039a-ef7e-bcae-fb97-1ecb4ffc6d3a@gmail.com> (raw)
In-Reply-To: <835zd183wy.fsf@gnu.org>

On 12/05/2020 13.21, Eli Zaretskii wrote:
>> Cc: yuri.v.khan@gmail.com, 26909@debbugs.gnu.org
>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>> Date: Tue, 12 May 2020 13:06:00 -0400
>>
>>> Something like that, yes.  But you will need to make sure
>>> extend_face_to_end_of_line is called also for empty lines.  And of
>>> course the "silly" changes need to be made less silly. 
>>
>> Where the less silly strategy would be to only run the extend_face code when the margins face isn't customized, right?
> 
> The other way around, surely?

Indeed.

>>> And you need
>>> to compute the pixel-width of the stretch glyph, since the code you
>>> cited only places a single SPC character there, which is not what you
>>> want if the margin is wider than one column.
>>
>> Hmm, I think the code already does that?
> 
> Does it where?  space_glyph is initiated in init_display_interactive,
> and I don't see its pixel_width changed anywhere.  What do you get in
> the width of that glyph in the margins?
> 
>>>> +    case MARGIN_FACE_ID:		name = Qmargin;			break;
>>>
>>> If this is going to be an additional basic face, then why do you call
>>> lookup_named_face  and not lookup_basic_face?
>>
>> It's because I have no idea what a basic face is, so I just cribbed from places that use the fringe face.  It does things like the following, and I have no idea what those mean:
>>
>>       face_id = NILP (face) ? lookup_named_face (w, f, Qfringe, false)
>> 	: lookup_derived_face (w, f, face, FRINGE_FACE_ID, 0);
>>       if (face_id < 0)
>> 	face_id = FRINGE_FACE_ID;
> 
> Why not "crib" from a few lines above the code you hacked, where it
> gets at the default face?

Or from below, where it says "face_id = FRINGE_FACE_ID;"… I don't know: I don't know what this code does.  I will try to take the time to understand it; the original silly patch was just a few lines thrown together as a proof of concept.






  reply	other threads:[~2020-05-12 17:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 14:07 bug#26909: 25.1; A face for margins Yuri Khan
2017-05-13 14:27 ` Eli Zaretskii
2017-05-13 14:59   ` Yuri Khan
2017-05-13 16:40     ` Eli Zaretskii
2017-05-13 17:19       ` Yuri Khan
2017-05-13 17:42         ` Eli Zaretskii
2020-05-11 21:01   ` Clément Pit-Claudel
2020-05-12 16:52     ` Eli Zaretskii
2020-05-12 17:06       ` Clément Pit-Claudel
2020-05-12 17:21         ` Eli Zaretskii
2020-05-12 17:28           ` Clément Pit-Claudel [this message]
2020-05-12 17:40             ` Eli Zaretskii
2020-10-01  2:49     ` Lars Ingebrigtsen

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=92f9039a-ef7e-bcae-fb97-1ecb4ffc6d3a@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=26909@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=yuri.v.khan@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 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).