all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings via "Emacs development discussions." <emacs-devel@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: buffer-face-set changes the fringe, is it a bug?
Date: Mon, 6 Jul 2020 20:55:04 +0200 (CEST)	[thread overview]
Message-ID: <alpine.NEB.2.21.2007062018330394.23098@sdf.lonestar.org> (raw)
In-Reply-To: <83h7uksehi.fsf@gnu.org>


>
>> Sorry, but that doesn't make any sense.  The default face does not 
>> contain any blue or red, it's black on white.  So how could blue or red 
>> enter into the face when no face is specified (i.e. when the face is 
>> omitted)?  At the very least, this is not what one understands with the 
>> (previous or current) documentation.
>
> You need to look at the code to make sense of what I said.
>

... and to make sense of what the documentation says.  I think this is 
problematic.

>
>> I'm not entirely sure, but apparently the logic in 
>> draw_fringe_bitmap_1() is to take DEFAULT_FACE_ID as an initial value 
>> for face_id, and if face_id is not set explicitly to a different value, 
>> to reset its value to FRINGE_FACE_ID.
>>
>> In handle_single_display_spec(), face_id is initially set to 
>> DEFAULT_FACE_ID, which means (given the above) that when face is 
>> omitted it is FRINGE_FACE_ID that will in fact be used.  When face is 
>> 'fringe' the derived face that is created is equivalent to 
>> FRINGE_FACE_ID.  When face is explicitly set to 'default', a derived 
>> face is created, and is subjected to face remappings in the buffer.
>
> Yes.
>

So the documentation should be:

The optional @var{face} names a face whose foreground and background 
colors are to be used to display the bitmap; this face is automatically 
merged with the @code{fringe} face.  When @var{face} is omitted and the 
@code{default} face has not been remapped, that effectively means to use 
the @code{fringe} face.  When @var{face} is omitted and the @code{default} 
face has been remapped, that means to use the remapped @code{default} 
face.  It is not recommended to omit the @var{face}: it is recommended to 
indicate the @code{fringe} face when one does not want to use another 
face.

Compare this with what one would naturally expect, and which is in fact 
very close to the previous version of the documentation:

The optional @var{face} names a face whose foreground and background 
colors are to be used to display the bitmap; this face is automatically 
merged with the @code{fringe} face.  When @var{face} is omitted, this 
means to use the @code{fringe} face.

>
>> I think again that this is a bug, and that one should have (if my 
>> understanding is correct), in handle_single_display_spec():
>>
>> int face_id = lookup_basic_face (it->f, FRINGE_FACE_ID);
>>
>> instead of:
>>
>> int face_id = lookup_basic_face (it->f, DEFAULT_FACE_ID);
>
> I disagreed already, and provide my reasons.
>

Hmmm...  I don't think they are convincing, and I do think that the 
current behavior is not what one would naturally expect.  But I'm not in a 
position to impose anything.

Thanks again for your attention.

Gregory



  reply	other threads:[~2020-07-06 18:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05  8:56 buffer-face-set changes the fringe, is it a bug? Gregory Heytings via Emacs development discussions.
2020-07-05 10:50 ` Eli Zaretskii
2020-07-05 12:43   ` Gregory Heytings via Emacs development discussions.
2020-07-05 15:32     ` Eli Zaretskii
2020-07-05 16:25       ` Gregory Heytings via Emacs development discussions.
2020-07-05 16:40         ` Eli Zaretskii
2020-07-05 16:59           ` Gregory Heytings via Emacs development discussions.
2020-07-05 17:24             ` Eli Zaretskii
2020-07-06 12:22       ` Gregory Heytings via Emacs development discussions.
2020-07-06 16:41         ` Eli Zaretskii
2020-07-06 17:08           ` Gregory Heytings via Emacs development discussions.
2020-07-06 18:08             ` Eli Zaretskii
2020-07-06 18:55               ` Gregory Heytings via Emacs development discussions. [this message]
2020-07-07 12:59                 ` Gregory Heytings via Emacs development discussions.
2020-07-07 14:59                   ` Eli Zaretskii
2020-07-07 15:47                     ` Gregory Heytings via Emacs development discussions.
2020-07-07 18:34                       ` Eli Zaretskii
2020-07-07 18:47                         ` Gregory Heytings via Emacs development discussions.
2020-07-07 19:20                           ` Eli Zaretskii
2020-07-07 19:44                             ` Gregory Heytings via Emacs development discussions.
2020-07-08  2:24                               ` Eli Zaretskii
2020-07-08  6:55                                 ` Gregory Heytings via Emacs development discussions.
2020-07-08  7:00                                   ` Gregory Heytings via Emacs development discussions.
2020-07-08 14:41                                     ` Eli Zaretskii
2020-07-09  3:01                                       ` Richard Stallman
2020-07-09  7:01                                         ` Gregory Heytings via Emacs development discussions.
2020-07-09 17:17                                           ` Eli Zaretskii
2020-07-09 17:14                                         ` Eli Zaretskii
2020-07-10 10:24                                           ` Gregory Heytings via Emacs development discussions.

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=alpine.NEB.2.21.2007062018330394.23098@sdf.lonestar.org \
    --to=emacs-devel@gnu.org \
    --cc=ghe@sdf.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 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.