emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Protesilaos Stavrou <info@protesilaos.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: StrawberryTea <look@strawberrytea.xyz>, emacs-orgmode@gnu.org
Subject: Re: [DISCUSSION] Face priority in Org fontification (was: [BUG] org dates, radio links, and special keywords override heading backgrounds [9.7 (9.7-??-902dacb @ /home/st/.config/emacs/.local/straight/build-30.0.50/org/)])
Date: Thu, 14 Mar 2024 11:20:23 +0200	[thread overview]
Message-ID: <87h6h9qieg.fsf@protesilaos.com> (raw)
In-Reply-To: <87r0geurzt.fsf@localhost>

> From: Ihor Radchenko <yantar92@posteo.net>
> Date: Wed, 13 Mar 2024 14:27:18 +0000

> [... 16 lines elided]

>>> CCing Protesilaos. This discussion might be of interest for him.
>>
>> I think it makes sense to not override the background because otherwise
>> the heading can look visually "broken". See attached screenshot for an
>> example: it is called "demo-org-heading-with-background.png". In that
>> screenshot I include an overline for the heading, to show how this is
>> not limited to the background colour but extends to all face attributes.
>> To this end, I also attach "demo-org-heading-with-more-height.png" which
>> shows how the date is not scaling to match the heading's increased text
>> height.
>
> I agree that override (what we do now) is clearly not good.
> The question, however, is whether we should prioritize object face over
> the containing element face or vice versa:
>
> Should link properties take precedence over headline or should headline
> properties take precedence?
>
> For example, if link explicitly sets face height to be smaller, should
> we honor it? Or should we honor the headline face height, if set?
> Similar for background. In your example, the white background override
> does not really look nice when heading has its own background.

This can get tricky, I know.

The idea is to make this behave how all faces relate to the 'default'
face with regard to their 'undefined' attributes. Namely, if a face
defines an attribute, then it overrides the 'default' face, otherwise it
falls back to it for the value of the given attribute.

In the case of the headlines then, every other element should attain the
attributes of the heading unless it explicitly overrides them. So a link
with an 'undefined' height will be as high as the heading, but a link
with a height of, say, 1.0 will keep that height even if the heading is
at a 2.0 height (or whatever).

Same idea for all face attributes.

Now the tricky part is to figure out which combinations can work this
way. Headings and source blocks are two obvious ones. Maybe there are
more, but I cannot think of one right now.

-- 
Protesilaos Stavrou
https://protesilaos.com


  reply	other threads:[~2024-03-14  9:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 21:13 [BUG] org dates, radio links, and special keywords override heading backgrounds [9.7 (9.7-??-902dacb @ /home/st/.config/emacs/.local/straight/build-30.0.50/org/)] StrawberryTea
2024-03-04 10:32 ` [DISCUSSION] Face priority in Org fontification (was: [BUG] org dates, radio links, and special keywords override heading backgrounds [9.7 (9.7-??-902dacb @ /home/st/.config/emacs/.local/straight/build-30.0.50/org/)]) Ihor Radchenko
2024-03-13  7:55   ` Protesilaos Stavrou
2024-03-13 14:27     ` Ihor Radchenko
2024-03-14  9:20       ` Protesilaos Stavrou [this message]
2024-03-15 13:58         ` Ihor Radchenko
     [not found]           ` <87jzm0abrd.fsf@strawberrytea.xyz>
2024-03-30 13:55             ` [DISCUSSION] Face priority in Org fontification StrawberryTea
2024-03-31 11:48           ` [DISCUSSION] Face priority in Org fontification (was: [BUG] org dates, radio links, and special keywords override heading backgrounds [9.7 (9.7-??-902dacb @ /home/st/.config/emacs/.local/straight/build-30.0.50/org/)]) Ihor Radchenko

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.orgmode.org/

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

  git send-email \
    --in-reply-to=87h6h9qieg.fsf@protesilaos.com \
    --to=info@protesilaos.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=look@strawberrytea.xyz \
    --cc=yantar92@posteo.net \
    /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/org-mode.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).