unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Making `x-underline-at-descent-line' a face attribute
       [not found] <87lezt5v7h.fsf.ref@yahoo.com>
@ 2022-01-06  4:44 ` Po Lu
  2022-01-06  5:08   ` Jim Porter
                     ` (2 more replies)
  0 siblings, 3 replies; 43+ messages in thread
From: Po Lu @ 2022-01-06  4:44 UTC (permalink / raw)
  To: emacs-devel


It would be more useful that way for people who rely on an underline at
the descent line to achieve a bordered effect on the modeline, but who
don't otherwise want that setting to be applied to text.  Obviously, we
should keep the global setting for backwards compatibility, probably
with precedence over the face attribute.

WDYT?



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  4:44 ` Making `x-underline-at-descent-line' a face attribute Po Lu
@ 2022-01-06  5:08   ` Jim Porter
  2022-01-06  5:35     ` Po Lu
  2022-01-06  8:43     ` Eli Zaretskii
  2022-01-06  8:44   ` Eli Zaretskii
  2022-01-06  8:48   ` Lars Ingebrigtsen
  2 siblings, 2 replies; 43+ messages in thread
From: Jim Porter @ 2022-01-06  5:08 UTC (permalink / raw)
  To: Po Lu, emacs-devel

On 1/5/2022 8:44 PM, Po Lu wrote:
> It would be more useful that way for people who rely on an underline at
> the descent line to achieve a bordered effect on the modeline, but who
> don't otherwise want that setting to be applied to text.  Obviously, we
> should keep the global setting for backwards compatibility, probably
> with precedence over the face attribute.
> 
> WDYT?

What about enhancing the :box attribute further to allow different 
widths (and possibly colors) for each of the 4 sides? It's already 
possible to specify an outline just on the top and bottom (or the left 
and right) in Emacs 28.

This would also allow mixing a bordered effect with a "regular" 
underline, which could be useful for emphasizing parts of the mode line.

- Jim




^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  5:08   ` Jim Porter
@ 2022-01-06  5:35     ` Po Lu
  2022-01-06  8:47       ` Eli Zaretskii
  2022-01-06  8:43     ` Eli Zaretskii
  1 sibling, 1 reply; 43+ messages in thread
From: Po Lu @ 2022-01-06  5:35 UTC (permalink / raw)
  To: Jim Porter; +Cc: emacs-devel

Jim Porter <jporterbugs@gmail.com> writes:

> What about enhancing the :box attribute further to allow different
> widths (and possibly colors) for each of the 4 sides? It's already
> possible to specify an outline just on the top and bottom (or the left
> and right) in Emacs 28.

> This would also allow mixing a bordered effect with a "regular"
> underline, which could be useful for emphasizing parts of the mode
> line.

That could work as well, but underline-at-descent-line seems an odd
setting to apply via a global variable.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  5:08   ` Jim Porter
  2022-01-06  5:35     ` Po Lu
@ 2022-01-06  8:43     ` Eli Zaretskii
  2022-01-06 17:47       ` Jim Porter
  1 sibling, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-06  8:43 UTC (permalink / raw)
  To: Jim Porter; +Cc: luangruo, emacs-devel

> From: Jim Porter <jporterbugs@gmail.com>
> Date: Wed, 5 Jan 2022 21:08:57 -0800
> 
> What about enhancing the :box attribute further to allow different 
> widths (and possibly colors) for each of the 4 sides?

The width part is already supported.  We could make the value of
:color be a cons cell as well, if that is useful (is it?)

But mixing :box and :underline is IMO not a good idea.  They are
separate attributes.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  4:44 ` Making `x-underline-at-descent-line' a face attribute Po Lu
  2022-01-06  5:08   ` Jim Porter
@ 2022-01-06  8:44   ` Eli Zaretskii
  2022-01-06  9:36     ` Po Lu
  2022-01-06  8:48   ` Lars Ingebrigtsen
  2 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-06  8:44 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Date: Thu, 06 Jan 2022 12:44:50 +0800
> 
> 
> It would be more useful that way for people who rely on an underline at
> the descent line to achieve a bordered effect on the modeline, but who
> don't otherwise want that setting to be applied to text.  Obviously, we
> should keep the global setting for backwards compatibility, probably
> with precedence over the face attribute.

Are you proposing a change in the possible values of the :underline
face attribute, or are you proposing a new face attribute?



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  5:35     ` Po Lu
@ 2022-01-06  8:47       ` Eli Zaretskii
  0 siblings, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-06  8:47 UTC (permalink / raw)
  To: Po Lu; +Cc: jporterbugs, emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 06 Jan 2022 13:35:58 +0800
> 
> underline-at-descent-line seems an odd setting to apply via a global
> variable.

It isn't odd: it expresses personal subjective preferences of some
people.  Such a preference doesn't change with frames or faces.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  4:44 ` Making `x-underline-at-descent-line' a face attribute Po Lu
  2022-01-06  5:08   ` Jim Porter
  2022-01-06  8:44   ` Eli Zaretskii
@ 2022-01-06  8:48   ` Lars Ingebrigtsen
  2022-01-06  9:38     ` Po Lu
  2 siblings, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-06  8:48 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> It would be more useful that way for people who rely on an underline at
> the descent line to achieve a bordered effect on the modeline, but who
> don't otherwise want that setting to be applied to text.  Obviously, we
> should keep the global setting for backwards compatibility, probably
> with precedence over the face attribute.

I think that sounds like a good idea.  With a new text property that
allows many different underline positions, perhaps?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  8:44   ` Eli Zaretskii
@ 2022-01-06  9:36     ` Po Lu
  2022-01-06 12:02       ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Po Lu @ 2022-01-06  9:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> Are you proposing a change in the possible values of the :underline
> face attribute, or are you proposing a new face attribute?

I'm talking about a new face attribute, thanks.

But if it would also be possible to implement what I'm looking for (the
ability to place the underline at the descent line) as a new value of
:underline, I'd be fine with that as well.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  8:48   ` Lars Ingebrigtsen
@ 2022-01-06  9:38     ` Po Lu
  0 siblings, 0 replies; 43+ messages in thread
From: Po Lu @ 2022-01-06  9:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I think that sounds like a good idea.  With a new text property that
> allows many different underline positions, perhaps?

I think it would be more intuitive to have that as a face attribute.
But if some people want it as a text property, that would be nice to
have as well.

Thanks.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  9:36     ` Po Lu
@ 2022-01-06 12:02       ` Eli Zaretskii
  2022-01-06 12:24         ` Po Lu
  0 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-06 12:02 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 06 Jan 2022 17:36:52 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Are you proposing a change in the possible values of the :underline
> > face attribute, or are you proposing a new face attribute?
> 
> I'm talking about a new face attribute, thanks.
> 
> But if it would also be possible to implement what I'm looking for (the
> ability to place the underline at the descent line) as a new value of
> :underline, I'd be fine with that as well.

I'd prefer to enhance :underline.  Introducing a new attribute might
be more tricky, as our experience with :extend shows.  For example,
we'd need to decide how to reconcile that new attribute with
:underline, for starters.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06 12:02       ` Eli Zaretskii
@ 2022-01-06 12:24         ` Po Lu
  2022-01-06 13:51           ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Po Lu @ 2022-01-06 12:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> I'd prefer to enhance :underline.  Introducing a new attribute might
> be more tricky, as our experience with :extend shows.

Could you elaborate on that? It could be knowledge that would come in
handy for me in the future.

> For example, we'd need to decide how to reconcile that new attribute
> with :underline, for starters.

That would be fairly simple: :underline doesn't accept any attribute
that changes the position of the underline, so I don't know why they
would conflict.

Thanks.




^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06 12:24         ` Po Lu
@ 2022-01-06 13:51           ` Eli Zaretskii
  2022-01-07  0:47             ` Po Lu
  0 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-06 13:51 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 06 Jan 2022 20:24:07 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I'd prefer to enhance :underline.  Introducing a new attribute might
> > be more tricky, as our experience with :extend shows.
> 
> Could you elaborate on that? It could be knowledge that would come in
> handy for me in the future.

What would you like me to elaborate on? the :extend attribute? or
something else?

> > For example, we'd need to decide how to reconcile that new attribute
> > with :underline, for starters.
> 
> That would be fairly simple: :underline doesn't accept any attribute
> that changes the position of the underline, so I don't know why they
> would conflict.

For example, what does it mean when a face specifies this new
attribute, but doesn't specify :underline?  Or what if it does specify
:underline, but its style is 'wave'?



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06  8:43     ` Eli Zaretskii
@ 2022-01-06 17:47       ` Jim Porter
  2022-01-06 20:07         ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Jim Porter @ 2022-01-06 17:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, emacs-devel

On 1/6/2022 12:43 AM, Eli Zaretskii wrote:
>> From: Jim Porter <jporterbugs@gmail.com>
>> Date: Wed, 5 Jan 2022 21:08:57 -0800
>>
>> What about enhancing the :box attribute further to allow different
>> widths (and possibly colors) for each of the 4 sides?
> 
> The width part is already supported.  We could make the value of
> :color be a cons cell as well, if that is useful (is it?)

Looking at the docs for :box, I only see the ability to set separate 
vertical and horizontal widths (but not to set all 4 sides to different 
values). The latter would be useful in some cases, for example to make 
the tab-bar tabs look more like tabs. You could specify a box with a 
border on all sides but the bottom for the active tab, and a border 
*only* on the bottom for inactive tabs, so you get something like:

               +----------+
     inactive  |  active  |  inactive
   ------------+          +------------

One benefit of making :color a cons cell is that it would be possible to 
create an effect like `:style released-button', but allow the programmer 
to control the exact colors to use. That could be useful in some 
situations. For instance, the modeline could have a border at the top 
and bottom (but not the sides) with different colors to make it appear 
raised. I tried using `:style released-button' for that, but it appears 
to only support a :box with non-zero widths on all sides.

> But mixing :box and :underline is IMO not a good idea.  They are
> separate attributes.

I think I agree. From the original message, it sounded like the goal was 
to get a border around the modeline, so using :underline isn't the ideal 
option semantically. If :box were more flexible, it'd be possible to use 
that to draw borders around things, even if that "border" was just on 
the bottom (making it look similar to an underline).



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06 17:47       ` Jim Porter
@ 2022-01-06 20:07         ` Eli Zaretskii
  2022-01-06 20:18           ` Juri Linkov
  2022-01-06 20:49           ` Jim Porter
  0 siblings, 2 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-06 20:07 UTC (permalink / raw)
  To: Jim Porter; +Cc: luangruo, emacs-devel

> Cc: luangruo@yahoo.com, emacs-devel@gnu.org
> From: Jim Porter <jporterbugs@gmail.com>
> Date: Thu, 6 Jan 2022 09:47:33 -0800
> 
> On 1/6/2022 12:43 AM, Eli Zaretskii wrote:
> >> From: Jim Porter <jporterbugs@gmail.com>
> >> Date: Wed, 5 Jan 2022 21:08:57 -0800
> >>
> >> What about enhancing the :box attribute further to allow different
> >> widths (and possibly colors) for each of the 4 sides?
> > 
> > The width part is already supported.  We could make the value of
> > :color be a cons cell as well, if that is useful (is it?)
> 
> Looking at the docs for :box, I only see the ability to set separate 
> vertical and horizontal widths (but not to set all 4 sides to different 
> values). The latter would be useful in some cases, for example to make 
> the tab-bar tabs look more like tabs.

That is not the right way of displaying tabs with 3D appearance.  We
should provide professionally looking tabs, not some emulation of them
with a box of 4 different width -- that would look extremely
unprofessional and unclean.

In general, I think the visual appearance of tab-bar and tab-line
buttons needs a lot of love and care; what we have now simply looks
badly, IMNSHO.  We've basically copied the code that displays the tool
bar, but without the attention that was at the time given to the
visual appearance of the (native tool-bar buttons.  The result is that
the tool-bar buttons look much prettier than the tab bar and the tab
lines.  Compare our tab bar with that of any of the Web browsers out
there, and you will see what I mean.  there's no good reason why our
tabs couldn't look as pretty as those of the browser, the only problem
is that it involves coding in C, not Lisp.  I still hope someone with
experience in graphics programming will do that.

> One benefit of making :color a cons cell is that it would be possible to 
> create an effect like `:style released-button', but allow the programmer 
> to control the exact colors to use.

Once again, the released-button style should be produced by actually
drawing a released button, like we do on the tool bar and the mode
line.  Playing color games with the :box attribute will produce an
unclean emulation of that, and I therefore object to doing that.  We
shouldn't implement such unclean visuals.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06 20:07         ` Eli Zaretskii
@ 2022-01-06 20:18           ` Juri Linkov
  2022-01-07  0:55             ` Po Lu
  2022-01-06 20:49           ` Jim Porter
  1 sibling, 1 reply; 43+ messages in thread
From: Juri Linkov @ 2022-01-06 20:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, Jim Porter, emacs-devel

> In general, I think the visual appearance of tab-bar and tab-line
> buttons needs a lot of love and care; what we have now simply looks
> badly, IMNSHO.  We've basically copied the code that displays the tool
> bar, but without the attention that was at the time given to the
> visual appearance of the (native tool-bar buttons.  The result is that
> the tool-bar buttons look much prettier than the tab bar and the tab
> lines.  Compare our tab bar with that of any of the Web browsers out
> there, and you will see what I mean.  there's no good reason why our
> tabs couldn't look as pretty as those of the browser, the only problem
> is that it involves coding in C, not Lisp.  I still hope someone with
> experience in graphics programming will do that.

Everyone with experience in graphics programming is welcome.
If no one will undertake this task, we could try to use SVG.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06 20:07         ` Eli Zaretskii
  2022-01-06 20:18           ` Juri Linkov
@ 2022-01-06 20:49           ` Jim Porter
  2022-01-07  6:43             ` Eli Zaretskii
  1 sibling, 1 reply; 43+ messages in thread
From: Jim Porter @ 2022-01-06 20:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, emacs-devel

On 1/6/2022 12:07 PM, Eli Zaretskii wrote:
>> Cc: luangruo@yahoo.com, emacs-devel@gnu.org
>> From: Jim Porter <jporterbugs@gmail.com>
>> Date: Thu, 6 Jan 2022 09:47:33 -0800
>>
>> Looking at the docs for :box, I only see the ability to set separate
>> vertical and horizontal widths (but not to set all 4 sides to different
>> values). The latter would be useful in some cases, for example to make
>> the tab-bar tabs look more like tabs.
> 
> That is not the right way of displaying tabs with 3D appearance.  We
> should provide professionally looking tabs, not some emulation of them
> with a box of 4 different width -- that would look extremely
> unprofessional and unclean.
> 
> In general, I think the visual appearance of tab-bar and tab-line
> buttons needs a lot of love and care; what we have now simply looks
> badly, IMNSHO.  We've basically copied the code that displays the tool
> bar, but without the attention that was at the time given to the
> visual appearance of the (native tool-bar buttons.  The result is that
> the tool-bar buttons look much prettier than the tab bar and the tab
> lines.  Compare our tab bar with that of any of the Web browsers out
> there, and you will see what I mean.  there's no good reason why our
> tabs couldn't look as pretty as those of the browser, the only problem
> is that it involves coding in C, not Lisp.  I still hope someone with
> experience in graphics programming will do that.

It's interesting that you mention web browsers in particular, since 
that's part of what got me to think about using :box to create 
nicer-looking tab-bar tabs. In Firefox, the visuals are determined by 
CSS, and Emacs's :box attribute bears a striking resemblance to CSS's 
`border'. Having done some similar UI design in CSS, I'd likely 
implement the visuals for tabs partly using CSS `border' in the same way 
that I described using :box. (Of course, I'd use many other CSS features 
to adjust the appearance until it looks good.)

That said, CSS has somewhat of a reputation for being tricky to get 
right and occasionally producing unexpected results (just websearch for 
"CSS is awesome"). Maybe it's not a good idea to make Emacs face 
attributes work too much like CSS.

>> One benefit of making :color a cons cell is that it would be possible to
>> create an effect like `:style released-button', but allow the programmer
>> to control the exact colors to use.
> 
> Once again, the released-button style should be produced by actually
> drawing a released button, like we do on the tool bar and the mode
> line.  Playing color games with the :box attribute will produce an
> unclean emulation of that, and I therefore object to doing that.  We
> shouldn't implement such unclean visuals.

I don't have a strong opinion on this, so I don't mind if :color stays 
the way it is. It's just the first example I could come up with that 
someone might use the feature for.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06 13:51           ` Eli Zaretskii
@ 2022-01-07  0:47             ` Po Lu
  2022-01-07  7:12               ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Po Lu @ 2022-01-07  0:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> What would you like me to elaborate on? the :extend attribute? or
> something else?

Yes, specifically the issues encountered while adding it.

> For example, what does it mean when a face specifies this new
> attribute, but doesn't specify :underline?  Or what if it does specify
> :underline, but its style is 'wave'?

If :underline isn't specified but this new attribute is, then the
underline should just not be drawn.  As for a wave, it can be drawn at
the descent line as well.

Thanks in advance.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06 20:18           ` Juri Linkov
@ 2022-01-07  0:55             ` Po Lu
  2022-01-07  7:17               ` Eli Zaretskii
  2022-01-07  8:40               ` Juri Linkov
  0 siblings, 2 replies; 43+ messages in thread
From: Po Lu @ 2022-01-07  0:55 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Eli Zaretskii, Jim Porter, emacs-devel

Juri Linkov <juri@linkov.net> writes:

>> In general, I think the visual appearance of tab-bar and tab-line
>> buttons needs a lot of love and care; what we have now simply looks
>> badly, IMNSHO.  We've basically copied the code that displays the tool
>> bar, but without the attention that was at the time given to the
>> visual appearance of the (native tool-bar buttons.  The result is that
>> the tool-bar buttons look much prettier than the tab bar and the tab
>> lines.  Compare our tab bar with that of any of the Web browsers out
>> there, and you will see what I mean.  there's no good reason why our
>> tabs couldn't look as pretty as those of the browser, the only problem
>> is that it involves coding in C, not Lisp.  I still hope someone with
>> experience in graphics programming will do that.

> Everyone with experience in graphics programming is welcome.

So basically what people want is to clone the appearance of, say,
Mozilla Firefox's tabs?

That should be doable.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-06 20:49           ` Jim Porter
@ 2022-01-07  6:43             ` Eli Zaretskii
  0 siblings, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-07  6:43 UTC (permalink / raw)
  To: Jim Porter; +Cc: luangruo, emacs-devel

> Cc: luangruo@yahoo.com, emacs-devel@gnu.org
> From: Jim Porter <jporterbugs@gmail.com>
> Date: Thu, 6 Jan 2022 12:49:59 -0800
> 
> It's interesting that you mention web browsers in particular, since 
> that's part of what got me to think about using :box to create 
> nicer-looking tab-bar tabs. In Firefox, the visuals are determined by 
> CSS, and Emacs's :box attribute bears a striking resemblance to CSS's 
> `border'. Having done some similar UI design in CSS, I'd likely 
> implement the visuals for tabs partly using CSS `border' in the same way 
> that I described using :box. (Of course, I'd use many other CSS features 
> to adjust the appearance until it looks good.)

It may look similar, but it isn't.  Face properties are not meant to
produce 3D visual appearances of buttons and button-like widgets, they
are meant to support text display.

> > Once again, the released-button style should be produced by actually
> > drawing a released button, like we do on the tool bar and the mode
> > line.  Playing color games with the :box attribute will produce an
> > unclean emulation of that, and I therefore object to doing that.  We
> > shouldn't implement such unclean visuals.
> 
> I don't have a strong opinion on this, so I don't mind if :color stays 
> the way it is. It's just the first example I could come up with that 
> someone might use the feature for.

See above: I simply think that face properties are inappropriate for
this job.  They could be used for prototyping, but not for the real
thing, because it will just look bad.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07  0:47             ` Po Lu
@ 2022-01-07  7:12               ` Eli Zaretskii
  2022-01-07  7:14                 ` Po Lu
  0 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-07  7:12 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 07 Jan 2022 08:47:17 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > What would you like me to elaborate on? the :extend attribute? or
> > something else?
> 
> Yes, specifically the issues encountered while adding it.

There were too many, search the debbugs database.  Basically, how to
merge faces with different values of the attribute, how to inherit the
attribute, etc.

> > For example, what does it mean when a face specifies this new
> > attribute, but doesn't specify :underline?  Or what if it does specify
> > :underline, but its style is 'wave'?
> 
> If :underline isn't specified but this new attribute is, then the
> underline should just not be drawn.  As for a wave, it can be drawn at
> the descent line as well.

Those are your opinions, but they are not necessarily correct/evident,
and I can envision use cases and/or users who would have different
expectations.

It is better to avoid the need to resolve these issues in the first
place.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07  7:12               ` Eli Zaretskii
@ 2022-01-07  7:14                 ` Po Lu
  2022-01-07  8:28                   ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Po Lu @ 2022-01-07  7:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> Those are your opinions, but they are not necessarily correct/evident,
> and I can envision use cases and/or users who would have different
> expectations.
>
> It is better to avoid the need to resolve these issues in the first
> place.

Thanks, one last question (before I start to implement this): what would
you recommend as a special value of `:underline'?

Would it be okay to add a new property to the property list that is
already accepted as such a value?



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07  0:55             ` Po Lu
@ 2022-01-07  7:17               ` Eli Zaretskii
  2022-01-07  8:40               ` Juri Linkov
  1 sibling, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-07  7:17 UTC (permalink / raw)
  To: Po Lu; +Cc: jporterbugs, emacs-devel, juri

> From: Po Lu <luangruo@yahoo.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  Jim Porter <jporterbugs@gmail.com>,
>   emacs-devel@gnu.org
> Date: Fri, 07 Jan 2022 08:55:53 +0800
> 
> Juri Linkov <juri@linkov.net> writes:
> 
> >> In general, I think the visual appearance of tab-bar and tab-line
> >> buttons needs a lot of love and care; what we have now simply looks
> >> badly, IMNSHO.  We've basically copied the code that displays the tool
> >> bar, but without the attention that was at the time given to the
> >> visual appearance of the (native tool-bar buttons.  The result is that
> >> the tool-bar buttons look much prettier than the tab bar and the tab
> >> lines.  Compare our tab bar with that of any of the Web browsers out
> >> there, and you will see what I mean.  there's no good reason why our
> >> tabs couldn't look as pretty as those of the browser, the only problem
> >> is that it involves coding in C, not Lisp.  I still hope someone with
> >> experience in graphics programming will do that.
> 
> > Everyone with experience in graphics programming is welcome.
> 
> So basically what people want is to clone the appearance of, say,
> Mozilla Firefox's tabs?

Not necessarily clone what Firefox (or any other browser) does, but
IMO we should have our tabs look much more professional
(a.k.a. "pretty") than they look now.  if we don't reproduce the looks
of the browser tabs, but our tab buttons are good looking, that's good
enough for me.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07  7:14                 ` Po Lu
@ 2022-01-07  8:28                   ` Eli Zaretskii
  2022-01-07 11:04                     ` Po Lu
  0 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-07  8:28 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 07 Jan 2022 15:14:45 +0800
> 
> Thanks, one last question (before I start to implement this): what would
> you recommend as a special value of `:underline'?
> 
> Would it be okay to add a new property to the property list that is
> already accepted as such a value?

Yes, something like

   (:color COLOR :style STYLE :position POS)

where POS can be t (with the same effect as non-nil value of
x-underline-at-descent-line) or (if you want to get fancy) a number,
to specify an explicit offset from the baseline.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07  0:55             ` Po Lu
  2022-01-07  7:17               ` Eli Zaretskii
@ 2022-01-07  8:40               ` Juri Linkov
  2022-01-07  9:40                 ` Stefan Kangas
  2022-01-07 13:14                 ` Eli Zaretskii
  1 sibling, 2 replies; 43+ messages in thread
From: Juri Linkov @ 2022-01-07  8:40 UTC (permalink / raw)
  To: Po Lu; +Cc: Jim Porter, Eli Zaretskii, emacs-devel

>>> In general, I think the visual appearance of tab-bar and tab-line
>>> buttons needs a lot of love and care; what we have now simply looks
>>> badly, IMNSHO.  We've basically copied the code that displays the tool
>>> bar, but without the attention that was at the time given to the
>>> visual appearance of the (native tool-bar buttons.  The result is that
>>> the tool-bar buttons look much prettier than the tab bar and the tab
>>> lines.  Compare our tab bar with that of any of the Web browsers out
>>> there, and you will see what I mean.  there's no good reason why our
>>> tabs couldn't look as pretty as those of the browser, the only problem
>>> is that it involves coding in C, not Lisp.  I still hope someone with
>>> experience in graphics programming will do that.
>
>> Everyone with experience in graphics programming is welcome.
>
> So basically what people want is to clone the appearance of, say,
> Mozilla Firefox's tabs?

Actually, in the last version of Mozilla Firefox
tabs looks exactly like in Emacs.  This is because
the design of tabs in the web browsers is going
in the direction of simplification of tabs appearance.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07  8:40               ` Juri Linkov
@ 2022-01-07  9:40                 ` Stefan Kangas
  2022-01-08 18:20                   ` Juri Linkov
  2022-01-07 13:14                 ` Eli Zaretskii
  1 sibling, 1 reply; 43+ messages in thread
From: Stefan Kangas @ 2022-01-07  9:40 UTC (permalink / raw)
  To: Juri Linkov, Po Lu; +Cc: Jim Porter, Eli Zaretskii, emacs-devel

Juri Linkov <juri@linkov.net> writes:

> Actually, in the last version of Mozilla Firefox
> tabs looks exactly like in Emacs.  This is because
> the design of tabs in the web browsers is going
> in the direction of simplification of tabs appearance.

There are still some differences, right?

What I see is that Firefox doesn't have any whitespace between tabs,
fixed width, a bigger close button, the current tab is highlighted with
a colored line at the top, they have favicons, variable width fonts,
shading...  It would be nice if we could reproduce some of that.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07  8:28                   ` Eli Zaretskii
@ 2022-01-07 11:04                     ` Po Lu
  2022-01-07 12:21                       ` Eli Zaretskii
  2022-01-09  0:43                       ` Po Lu
  0 siblings, 2 replies; 43+ messages in thread
From: Po Lu @ 2022-01-07 11:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: emacs-devel@gnu.org
>> Date: Fri, 07 Jan 2022 15:14:45 +0800
>> 
>> Thanks, one last question (before I start to implement this): what would
>> you recommend as a special value of `:underline'?
>> 
>> Would it be okay to add a new property to the property list that is
>> already accepted as such a value?
>
> Yes, something like
>
>    (:color COLOR :style STYLE :position POS)
>
> where POS can be t (with the same effect as non-nil value of
> x-underline-at-descent-line) or (if you want to get fancy) a number,
> to specify an explicit offset from the baseline.

Thanks, I implemented that, though I haven't written any documentation
yet.  It would be nice if someone could test the attached diff on
MS-Windows.

BTW, there's a `hash' parameter in struct face, but I can't find where
it's calculated.  I assume I have to the hashing take any new fields
into account, but I don't know how.  Can you help with this?  Thanks.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test.diff --]
[-- Type: text/x-patch, Size: 12195 bytes --]

diff --git a/src/dispextern.h b/src/dispextern.h
index 954992a0ec..368507732c 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1720,6 +1720,12 @@ #define FONT_TOO_HIGH(ft)						\
   int box_vertical_line_width;
   int box_horizontal_line_width;
 
+
+  /* The amount of pixels above the descent line the underline should
+     be displayed.  It does not take effect unless
+     `underline_at_descent_line_p` is t.  */
+  int underline_pixels_above_descent_line;
+
   /* Type of box drawn.  A value of FACE_NO_BOX means no box is drawn
      around text in this face.  A value of FACE_SIMPLE_BOX means a box
      of width box_line_width is drawn in color box_color.  A value of
@@ -1753,6 +1759,9 @@ #define FONT_TOO_HIGH(ft)						\
   bool_bf strike_through_color_defaulted_p : 1;
   bool_bf box_color_defaulted_p : 1;
 
+  /* True means the underline should be drawn at the descent line.  */
+  bool_bf underline_at_descent_line_p : 1;
+
   /* TTY appearances.  Colors are found in `lface' with empty color
      string meaning the default color of the TTY.  */
   bool_bf tty_bold_p : 1;
diff --git a/src/haikuterm.c b/src/haikuterm.c
index 2239770de9..560ce913ac 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -608,7 +608,12 @@ haiku_draw_text_decoration (struct glyph_string *s, struct face *face,
 	  unsigned long thickness, position;
 	  int y;
 
-	  if (s->prev && s->prev && s->prev->hl == DRAW_MOUSE_FACE)
+	  if (s->prev
+	      && s->prev->face->underline == FACE_UNDER_LINE
+	      && (s->prev->face->underline_at_descent_line_p
+		  == s->face->underline_at_descent_line_p)
+	      && (s->prev->face->underline_pixels_above_descent_line
+		  == s->face->underline_pixels_above_descent_line))
 	    {
 	      struct face *prev_face = s->prev->face;
 
@@ -639,7 +644,8 @@ haiku_draw_text_decoration (struct glyph_string *s, struct face *face,
 	      val = (WINDOW_BUFFER_LOCAL_VALUE
 		     (Qx_underline_at_descent_line, s->w));
 	      underline_at_descent_line
-		= !(NILP (val) || EQ (val, Qunbound));
+		= (!(NILP (val) || EQ (val, Qunbound))
+		   || s->face->underline_at_descent_line_p);
 
 	      val = (WINDOW_BUFFER_LOCAL_VALUE
 		     (Qx_use_underline_position_properties, s->w));
@@ -652,7 +658,9 @@ haiku_draw_text_decoration (struct glyph_string *s, struct face *face,
 	      else
 		thickness = 1;
 	      if (underline_at_descent_line)
-		position = (s->height - thickness) - (s->ybase - s->y);
+		position = ((s->height - thickness)
+			    - (s->ybase - s->y)
+			    - s->face->underline_pixels_above_descent_line);
 	      else
 		{
 		  /* Get the underline position.  This is the
diff --git a/src/nsterm.m b/src/nsterm.m
index a15dc47a22..4f60cc737d 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3265,7 +3265,11 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
           /* If the prev was underlined, match its appearance.  */
           if (s->prev
 	      && s->prev->face->underline == FACE_UNDER_LINE
-              && s->prev->underline_thickness > 0)
+              && s->prev->underline_thickness > 0
+	      && (s->prev->face->underline_at_descent_line_p
+		  == s->face->underline_at_descent_line_p)
+	      && (s->prev->face->underline_pixels_above_descent_line
+		  == s->face->underline_pixels_above_descent_line))
             {
               thickness = s->prev->underline_thickness;
               position = s->prev->underline_position;
@@ -3286,7 +3290,8 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
 
 	      val = (WINDOW_BUFFER_LOCAL_VALUE
 		     (Qx_underline_at_descent_line, s->w));
-	      underline_at_descent_line = !(NILP (val) || EQ (val, Qunbound));
+	      underline_at_descent_line = (!(NILP (val) || EQ (val, Qunbound))
+					   || s->face->underline_at_descent_line_p);
 
 	      val = (WINDOW_BUFFER_LOCAL_VALUE
 		     (Qx_use_underline_position_properties, s->w));
@@ -3299,7 +3304,8 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
 
               /* Determine the offset of underlining from the baseline.  */
               if (underline_at_descent_line)
-                position = descent - thickness;
+                position = (descent - thickness
+			    - s->face->underline_pixels_above_descent_line);
               else if (use_underline_position_properties
                        && font && font->underline_position >= 0)
                 position = font->underline_position;
@@ -3308,7 +3314,8 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors.
               else
                 position = minimum_offset;
 
-              position = max (position, minimum_offset);
+	      if (!s->face->underline_pixels_above_descent_line)
+		position = max (position, minimum_offset);
 
               /* Ensure underlining is not cropped.  */
               if (descent <= position)
diff --git a/src/w32term.c b/src/w32term.c
index 700c492cc3..78777f153c 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -2564,7 +2564,11 @@ w32_draw_glyph_string (struct glyph_string *s)
               int y;
 
               if (s->prev
-	          && s->prev->face->underline == FACE_UNDER_LINE)
+		  && s->prev->face->underline == FACE_UNDER_LINE
+		  && (s->prev->face->underline_at_descent_line_p
+		      == s->face->underline_at_descent_line_p)
+		  && (s->prev->face->underline_pixels_above_descent_line
+		      == s->face->underline_pixels_above_descent_line))
                 {
                   /* We use the same underline style as the previous one.  */
                   thickness = s->prev->underline_thickness;
@@ -2587,7 +2591,8 @@ w32_draw_glyph_string (struct glyph_string *s)
 		  val = (WINDOW_BUFFER_LOCAL_VALUE
 			 (Qx_underline_at_descent_line, s->w));
 		  underline_at_descent_line
-		    = !(NILP (val) || EQ (val, Qunbound));
+		    = (!(NILP (val) || EQ (val, Qunbound))
+		       || s->face->underline_at_descent_line_p);
 
 		  val = (WINDOW_BUFFER_LOCAL_VALUE
 			 (Qx_use_underline_position_properties, s->w));
@@ -2601,7 +2606,9 @@ w32_draw_glyph_string (struct glyph_string *s)
                     thickness = 1;
                   if (underline_at_descent_line
                       || !font)
-                    position = (s->height - thickness) - (s->ybase - s->y);
+		    position = ((s->height - thickness)
+				- (s->ybase - s->y)
+				- s->face->underline_pixels_above_descent_line);
                   else
                     {
                       /* Get the underline position.  This is the
@@ -2619,7 +2626,12 @@ w32_draw_glyph_string (struct glyph_string *s)
                       else
                         position = (font->descent + 1) / 2;
                     }
-                  position = max (position, minimum_offset);
+
+		  if (!(s->face->underline_at_descent_line_p
+			/* Ignore minimum_offset if the amount of pixels
+			   was explictly specified.  */
+			&& s->face->underline_pixels_above_descent_line))
+		    position = max (position, minimum_offset);
                 }
               /* Check the sanity of thickness and position.  We should
                  avoid drawing underline out of the current line area.  */
diff --git a/src/xfaces.c b/src/xfaces.c
index 3fd31b7f22..8064d47c94 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6041,6 +6041,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
       face->underline = FACE_UNDER_LINE;
       face->underline_defaulted_p = true;
       face->underline_color = 0;
+      face->underline_at_descent_line_p = false;
+      face->underline_pixels_above_descent_line = 0;
     }
   else if (STRINGP (underline))
     {
@@ -6050,12 +6052,16 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
       face->underline_color
 	= load_color (f, face, underline,
 		      LFACE_UNDERLINE_INDEX);
+      face->underline_at_descent_line_p = false;
+      face->underline_pixels_above_descent_line = 0;
     }
   else if (NILP (underline))
     {
       face->underline = FACE_NO_UNDERLINE;
       face->underline_defaulted_p = false;
       face->underline_color = 0;
+      face->underline_at_descent_line_p = false;
+      face->underline_pixels_above_descent_line = 0;
     }
   else if (CONSP (underline))
     {
@@ -6064,6 +6070,8 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
       face->underline = FACE_UNDER_LINE;
       face->underline_color = 0;
       face->underline_defaulted_p = true;
+      face->underline_at_descent_line_p = false;
+      face->underline_pixels_above_descent_line = 0;
 
       /* FIXME?  This is also not robust about checking the precise form.
          See comments in Finternal_set_lisp_face_attribute.  */
@@ -6100,6 +6108,13 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
               else if (EQ (value, Qwave))
                 face->underline = FACE_UNDER_WAVE;
             }
+	  else if (EQ (keyword, QCposition))
+	    {
+	      face->underline_at_descent_line_p = !NILP (value);
+
+	      if (FIXNATP (value))
+		face->underline_pixels_above_descent_line = XFIXNAT (value);
+	    }
         }
     }
 
@@ -6915,6 +6930,7 @@ syms_of_xfaces (void)
   DEFSYM (QCcolor, ":color");
   DEFSYM (QCline_width, ":line-width");
   DEFSYM (QCstyle, ":style");
+  DEFSYM (QCposition, ":position");
   DEFSYM (Qline, "line");
   DEFSYM (Qwave, "wave");
   DEFSYM (Qreleased_button, "released-button");
diff --git a/src/xterm.c b/src/xterm.c
index b284fdd312..717e946538 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4131,8 +4131,12 @@ x_draw_glyph_string (struct glyph_string *s)
               unsigned long thickness, position;
               int y;
 
-              if (s->prev &&
-	          s->prev->face->underline == FACE_UNDER_LINE)
+              if (s->prev
+		  && s->prev->face->underline == FACE_UNDER_LINE
+		  && (s->prev->face->underline_at_descent_line_p
+		      == s->face->underline_at_descent_line_p)
+		  && (s->prev->face->underline_pixels_above_descent_line
+		      == s->face->underline_pixels_above_descent_line))
                 {
                   /* We use the same underline style as the previous one.  */
                   thickness = s->prev->underline_thickness;
@@ -4155,7 +4159,8 @@ x_draw_glyph_string (struct glyph_string *s)
 		  val = (WINDOW_BUFFER_LOCAL_VALUE
 			 (Qx_underline_at_descent_line, s->w));
 		  underline_at_descent_line
-		    = !(NILP (val) || EQ (val, Qunbound));
+		    = (!(NILP (val) || EQ (val, Qunbound))
+		       || s->face->underline_at_descent_line_p);
 
 		  val = (WINDOW_BUFFER_LOCAL_VALUE
 			 (Qx_use_underline_position_properties, s->w));
@@ -4168,7 +4173,9 @@ x_draw_glyph_string (struct glyph_string *s)
                   else
                     thickness = 1;
                   if (underline_at_descent_line)
-                    position = (s->height - thickness) - (s->ybase - s->y);
+		    position = ((s->height - thickness)
+				- (s->ybase - s->y)
+				- s->face->underline_pixels_above_descent_line);
                   else
                     {
                       /* Get the underline position.  This is the
@@ -4188,12 +4195,16 @@ x_draw_glyph_string (struct glyph_string *s)
                       else
                         position = minimum_offset;
                     }
-                  position = max (position, minimum_offset);
+
+		  /* Ignore minimum_offset if the amount of pixels was
+		     explictly specified.  */
+		  if (!s->face->underline_pixels_above_descent_line)
+		    position = max (position, minimum_offset);
                 }
               /* Check the sanity of thickness and position.  We should
                  avoid drawing underline out of the current line area.  */
-              if (s->y + s->height <= s->ybase + position)
-                position = (s->height - 1) - (s->ybase - s->y);
+	      if (s->y + s->height <= s->ybase + position)
+		position = (s->height - 1) - (s->ybase - s->y);
               if (s->y + s->height < s->ybase + position + thickness)
                 thickness = (s->y + s->height) - (s->ybase + position);
               s->underline_thickness = thickness;

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07 11:04                     ` Po Lu
@ 2022-01-07 12:21                       ` Eli Zaretskii
  2022-01-07 12:33                         ` Po Lu
  2022-01-09  0:43                       ` Po Lu
  1 sibling, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-07 12:21 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 07 Jan 2022 19:04:50 +0800
> 
> BTW, there's a `hash' parameter in struct face, but I can't find where
> it's calculated.

It's calculated in lface_hash.

> I assume I have to the hashing take any new fields into account, but
> I don't know how.

No, not all of them.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07 12:21                       ` Eli Zaretskii
@ 2022-01-07 12:33                         ` Po Lu
  2022-01-07 12:41                           ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Po Lu @ 2022-01-07 12:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> It's calculated in lface_hash.

Thanks.

Judging by the contents of that function, it's a hash of the internal
vector representation of a face, and not of a struct face itself.

A lot of things make sense now.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07 12:33                         ` Po Lu
@ 2022-01-07 12:41                           ` Eli Zaretskii
  0 siblings, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-07 12:41 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 07 Jan 2022 20:33:41 +0800
> 
> Judging by the contents of that function, it's a hash of the internal
> vector representation of a face, and not of a struct face itself.

You've just understood the difference between the "Lisp face" and
"realized face".  Well, more or less, anyway.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07  8:40               ` Juri Linkov
  2022-01-07  9:40                 ` Stefan Kangas
@ 2022-01-07 13:14                 ` Eli Zaretskii
  2022-01-07 13:32                   ` martin rudalics
  2022-01-08 18:23                   ` Juri Linkov
  1 sibling, 2 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-07 13:14 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, jporterbugs, emacs-devel

> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  Jim Porter <jporterbugs@gmail.com>,
>   emacs-devel@gnu.org
> Date: Fri, 07 Jan 2022 10:40:29 +0200
> 
> Actually, in the last version of Mozilla Firefox
> tabs looks exactly like in Emacs.

I don't see how you can say that.  The tabs in the latest Firefox are
quite different from ours:

  . they have round corners
  . they have the same width, which changes as tabs are added/removed
  . they display over-long labels nicely
  . they are sensitive to mouse-over
  . they display small icons that hint on the tab's contents

Bottom line, they LOOK BETTER!



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07 13:14                 ` Eli Zaretskii
@ 2022-01-07 13:32                   ` martin rudalics
  2022-01-08 18:23                   ` Juri Linkov
  1 sibling, 0 replies; 43+ messages in thread
From: martin rudalics @ 2022-01-07 13:32 UTC (permalink / raw)
  To: Eli Zaretskii, Juri Linkov; +Cc: luangruo, jporterbugs, emacs-devel

 >    . they have the same width, which changes as tabs are added/removed

With one additional, quite useful, twist: The width of the tabs does not
change immediately when you click on an "x" to remove one of them so you
don't have to move the mouse to remove two or more consecutive tabs in a
row.

martin



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07  9:40                 ` Stefan Kangas
@ 2022-01-08 18:20                   ` Juri Linkov
  2022-01-08 18:52                     ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Juri Linkov @ 2022-01-08 18:20 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Po Lu, Jim Porter, Eli Zaretskii, emacs-devel

> What I see is that Firefox doesn't have any whitespace between tabs,
> fixed width, a bigger close button, the current tab is highlighted with
> a colored line at the top

Sadly, no colored line at the top, and the current tab has the same
appearance as other tabs, so it's impossible to notice the current tab
when looking at the tab bar.  This is a usability failure.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07 13:14                 ` Eli Zaretskii
  2022-01-07 13:32                   ` martin rudalics
@ 2022-01-08 18:23                   ` Juri Linkov
  2022-01-08 18:39                     ` Eli Zaretskii
  1 sibling, 1 reply; 43+ messages in thread
From: Juri Linkov @ 2022-01-08 18:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, jporterbugs, emacs-devel

> I don't see how you can say that.  The tabs in the latest Firefox are
> quite different from ours:
>
>   . they have round corners

Strange, I have no round corners on tabs.

>   . they are sensitive to mouse-over

The tab-line tabs are sensitive to mouse-over as well.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-08 18:23                   ` Juri Linkov
@ 2022-01-08 18:39                     ` Eli Zaretskii
  0 siblings, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-08 18:39 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, jporterbugs, emacs-devel

> From: Juri Linkov <juri@linkov.net>
> Cc: luangruo@yahoo.com,  jporterbugs@gmail.com,  emacs-devel@gnu.org
> Date: Sat, 08 Jan 2022 20:23:19 +0200
> 
> > I don't see how you can say that.  The tabs in the latest Firefox are
> > quite different from ours:
> >
> >   . they have round corners
> 
> Strange, I have no round corners on tabs.

Then maybe you don't have the latest version.

> >   . they are sensitive to mouse-over
> 
> The tab-line tabs are sensitive to mouse-over as well.

I was talking about the tab bar.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-08 18:20                   ` Juri Linkov
@ 2022-01-08 18:52                     ` Eli Zaretskii
  2022-01-08 19:09                       ` Juri Linkov
  0 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-08 18:52 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, jporterbugs, stefankangas, emacs-devel

> From: Juri Linkov <juri@linkov.net>
> Date: Sat, 08 Jan 2022 20:20:32 +0200
> Cc: Po Lu <luangruo@yahoo.com>, Jim Porter <jporterbugs@gmail.com>,
>  Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> 
> > What I see is that Firefox doesn't have any whitespace between tabs,
> > fixed width, a bigger close button, the current tab is highlighted with
> > a colored line at the top
> 
> Sadly, no colored line at the top, and the current tab has the same
> appearance as other tabs, so it's impossible to notice the current tab
> when looking at the tab bar.  This is a usability failure.

What version of Firefox do you have there?  In version 95.0.2, the
latest AFAIK, the current tab has a distinct appearance and is very
easy to spot.  Perhaps you customized the Firefox display to use
non-default colors and effects?



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-08 18:52                     ` Eli Zaretskii
@ 2022-01-08 19:09                       ` Juri Linkov
  2022-01-08 19:14                         ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Juri Linkov @ 2022-01-08 19:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, jporterbugs, stefankangas, emacs-devel

>> > What I see is that Firefox doesn't have any whitespace between tabs,
>> > fixed width, a bigger close button, the current tab is highlighted with
>> > a colored line at the top
>> 
>> Sadly, no colored line at the top, and the current tab has the same
>> appearance as other tabs, so it's impossible to notice the current tab
>> when looking at the tab bar.  This is a usability failure.
>
> What version of Firefox do you have there?  In version 95.0.2, the
> latest AFAIK, the current tab has a distinct appearance and is very
> easy to spot.  Perhaps you customized the Firefox display to use
> non-default colors and effects?

95.0.1 without customization, maybe this is fixed in 95.0.2.

>>>   . they are sensitive to mouse-over
>> 
>> The tab-line tabs are sensitive to mouse-over as well.

> I was talking about the tab bar.

The tab bar could have the same mouse-over sensitivity as the tab line.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-08 19:09                       ` Juri Linkov
@ 2022-01-08 19:14                         ` Eli Zaretskii
  0 siblings, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-08 19:14 UTC (permalink / raw)
  To: Juri Linkov; +Cc: luangruo, jporterbugs, stefankangas, emacs-devel

> From: Juri Linkov <juri@linkov.net>
> Cc: stefankangas@gmail.com,  luangruo@yahoo.com,  jporterbugs@gmail.com,
>   emacs-devel@gnu.org
> Date: Sat, 08 Jan 2022 21:09:00 +0200
> 
> > What version of Firefox do you have there?  In version 95.0.2, the
> > latest AFAIK, the current tab has a distinct appearance and is very
> > easy to spot.  Perhaps you customized the Firefox display to use
> > non-default colors and effects?
> 
> 95.0.1 without customization, maybe this is fixed in 95.0.2.

Well, you said "the latest", so I made a point of upgrading to the
latest one.

> >>>   . they are sensitive to mouse-over
> >> 
> >> The tab-line tabs are sensitive to mouse-over as well.
> 
> > I was talking about the tab bar.
> 
> The tab bar could have the same mouse-over sensitivity as the tab line.

Of course, it could.  It could do all the other things, too.  I hope
it will.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-07 11:04                     ` Po Lu
  2022-01-07 12:21                       ` Eli Zaretskii
@ 2022-01-09  0:43                       ` Po Lu
  2022-01-10 10:54                         ` Po Lu
  1 sibling, 1 reply; 43+ messages in thread
From: Po Lu @ 2022-01-09  0:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> Thanks, I implemented that, though I haven't written any documentation
> yet.  It would be nice if someone could test the attached diff on
> MS-Windows.

Does it work for everyone?  If it does, I'll write the documentation and
install it, if nobody minds.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-09  0:43                       ` Po Lu
@ 2022-01-10 10:54                         ` Po Lu
  2022-01-10 11:32                           ` Po Lu
  2022-01-10 17:41                           ` Eli Zaretskii
  0 siblings, 2 replies; 43+ messages in thread
From: Po Lu @ 2022-01-10 10:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> Po Lu <luangruo@yahoo.com> writes:
>
>> Thanks, I implemented that, though I haven't written any documentation
>> yet.  It would be nice if someone could test the attached diff on
>> MS-Windows.
>
> Does it work for everyone?  If it does, I'll write the documentation and
> install it, if nobody minds.

That was two days ago, so I'll assume nobody minds and install this
soon.  It works on NS, Haiku and X, at the very least.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-10 10:54                         ` Po Lu
@ 2022-01-10 11:32                           ` Po Lu
  2022-01-10 17:41                           ` Eli Zaretskii
  1 sibling, 0 replies; 43+ messages in thread
From: Po Lu @ 2022-01-10 11:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> That was two days ago, so I'll assume nobody minds and install this
> soon.  It works on NS, Haiku and X, at the very least.

Now done.  Please let me know of any problems.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-10 10:54                         ` Po Lu
  2022-01-10 11:32                           ` Po Lu
@ 2022-01-10 17:41                           ` Eli Zaretskii
  2022-01-11  0:47                             ` Po Lu
  1 sibling, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-10 17:41 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Mon, 10 Jan 2022 18:54:40 +0800
> 
> Po Lu <luangruo@yahoo.com> writes:
> 
> > Po Lu <luangruo@yahoo.com> writes:
> >
> >> Thanks, I implemented that, though I haven't written any documentation
> >> yet.  It would be nice if someone could test the attached diff on
> >> MS-Windows.
> >
> > Does it work for everyone?  If it does, I'll write the documentation and
> > install it, if nobody minds.
> 
> That was two days ago, so I'll assume nobody minds and install this
> soon.  It works on NS, Haiku and X, at the very least.

Can you post some tests to run and see if it works OK?

Thanks.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-10 17:41                           ` Eli Zaretskii
@ 2022-01-11  0:47                             ` Po Lu
  2022-01-11 16:46                               ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Po Lu @ 2022-01-11  0:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> Can you post some tests to run and see if it works OK?

Here you go:

  ;; Underline should appear at 3 pixels above the descent line.
  (set-face-attribute 'default nil :underline '(:position 3))

  ;; Underline should appear at the descent line.
  (set-face-attribute 'default nil :underline '(:position 0))

  ;; Underline should appear at the descent line.
  (set-face-attribute 'default nil :underline '(:position t))

  ;; Underline should appear at the default location determined by
  ;; x-use-underline-position-properties.
  (set-face-attribute 'default nil :underline '(:position nil))

Thanks.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: Making `x-underline-at-descent-line' a face attribute
  2022-01-11  0:47                             ` Po Lu
@ 2022-01-11 16:46                               ` Eli Zaretskii
  0 siblings, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-01-11 16:46 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Tue, 11 Jan 2022 08:47:34 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Can you post some tests to run and see if it works OK?
> 
> Here you go:
> 
>   ;; Underline should appear at 3 pixels above the descent line.
>   (set-face-attribute 'default nil :underline '(:position 3))
> 
>   ;; Underline should appear at the descent line.
>   (set-face-attribute 'default nil :underline '(:position 0))
> 
>   ;; Underline should appear at the descent line.
>   (set-face-attribute 'default nil :underline '(:position t))
> 
>   ;; Underline should appear at the default location determined by
>   ;; x-use-underline-position-properties.
>   (set-face-attribute 'default nil :underline '(:position nil))

The last one signals an error:

  Debugger entered--Lisp error: (error "Invalid face underline" :position nil)
    internal-set-lisp-face-attribute(default :underline (:position nil) 0)
    set-face-attribute(default nil :underline (:position nil))
    eval((set-face-attribute 'default nil :underline '(:position nil)) t)
    eval-expression((set-face-attribute 'default nil :underline '(:position nil)) nil nil 127)
    funcall-interactively(eval-expression (set-face-attribute 'default nil :underline '(:position nil)) nil nil 127)
    call-interactively(eval-expression nil nil)
    command-execute(eval-expression)

The rest seem to work correctly.



^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2022-01-11 16:46 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87lezt5v7h.fsf.ref@yahoo.com>
2022-01-06  4:44 ` Making `x-underline-at-descent-line' a face attribute Po Lu
2022-01-06  5:08   ` Jim Porter
2022-01-06  5:35     ` Po Lu
2022-01-06  8:47       ` Eli Zaretskii
2022-01-06  8:43     ` Eli Zaretskii
2022-01-06 17:47       ` Jim Porter
2022-01-06 20:07         ` Eli Zaretskii
2022-01-06 20:18           ` Juri Linkov
2022-01-07  0:55             ` Po Lu
2022-01-07  7:17               ` Eli Zaretskii
2022-01-07  8:40               ` Juri Linkov
2022-01-07  9:40                 ` Stefan Kangas
2022-01-08 18:20                   ` Juri Linkov
2022-01-08 18:52                     ` Eli Zaretskii
2022-01-08 19:09                       ` Juri Linkov
2022-01-08 19:14                         ` Eli Zaretskii
2022-01-07 13:14                 ` Eli Zaretskii
2022-01-07 13:32                   ` martin rudalics
2022-01-08 18:23                   ` Juri Linkov
2022-01-08 18:39                     ` Eli Zaretskii
2022-01-06 20:49           ` Jim Porter
2022-01-07  6:43             ` Eli Zaretskii
2022-01-06  8:44   ` Eli Zaretskii
2022-01-06  9:36     ` Po Lu
2022-01-06 12:02       ` Eli Zaretskii
2022-01-06 12:24         ` Po Lu
2022-01-06 13:51           ` Eli Zaretskii
2022-01-07  0:47             ` Po Lu
2022-01-07  7:12               ` Eli Zaretskii
2022-01-07  7:14                 ` Po Lu
2022-01-07  8:28                   ` Eli Zaretskii
2022-01-07 11:04                     ` Po Lu
2022-01-07 12:21                       ` Eli Zaretskii
2022-01-07 12:33                         ` Po Lu
2022-01-07 12:41                           ` Eli Zaretskii
2022-01-09  0:43                       ` Po Lu
2022-01-10 10:54                         ` Po Lu
2022-01-10 11:32                           ` Po Lu
2022-01-10 17:41                           ` Eli Zaretskii
2022-01-11  0:47                             ` Po Lu
2022-01-11 16:46                               ` Eli Zaretskii
2022-01-06  8:48   ` Lars Ingebrigtsen
2022-01-06  9:38     ` Po Lu

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