From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: egh@e6h.org, 42184@debbugs.gnu.org, mail@nicolasgoaziou.fr, bzg@gnu.org
Subject: bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27
Date: Sun, 05 Jul 2020 18:02:04 +0200 [thread overview]
Message-ID: <871rlqeyrn.fsf@gmail.com> (raw)
In-Reply-To: <838sfyt3ej.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 Jul 2020 17:58:12 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> The only faces I added were org-level-[3-8], because I don't see why
>> different heading levels should not work with
>> org-fontify-whole-heading-line.
>
> The original code only affects certain heading levels, it doesn't
> affect all of them.
By "the original code", you mean this part in
org-set-font-lock-defaults, right?
> `(,(if org-fontify-whole-heading-line
> "^\\(\\**\\)\\(\\* \\)\\(.*\n?\\)"
> "^\\(\\**\\)\\(\\* \\)\\(.*\\)")
That seems to apply to all heading levels to me? Group 1 captures all
but the last stars, group 2 the last star, and group 3 the heading text?
> Which is
> another aspect of your proposed patch I'd like to change: it seems to
> cause these faces be extended unconditionally, not just under these
> optional variables. Or did I miss something?
IIUC, org-fontify-whole-heading-line (which predates :extend t) is Org's
way of letting users "opt in" to face extension, by applying the
org-level-* face to the final newline *iff* this user option is set.
Adding :extend t to the face definition thus will not cause the
backgrounds to extend unconditionally: as long as the user option is
unset, the final newline will not be fontified.
>> AFAICT, this is the simplest way to fix org-fontify-whole-heading-line
>> and org-fontify-whole-block-delimiter-line for Emacs ≥27. These user
>> options work under the assumption that simply fontifying the final
>> newline is enough to extend attributes past EOL.
>
> Nevertheless, I would like to see the :extend attribute applied only
> under the above options; there's the set-face-extend function for
> doing that.
OK. That's more or less what I had in mind when I went into my
"long-term fix" ideas.
Note that Org tries to support older Emacs versions. AFAICT, with my
patch, (1) org-fontify-whole-heading-line is fixed for Emacs 27, (2) no
further modification is needed for Emacs ≤26.
I can try to cook up a patch based on set-face-extend instead, with all
the fboundp fun that entails to prevent byte-compiler warnings with
older Emacs versions. I'm not sure where the calls to set-face-extend
should be inserted; when setting up the major mode?
At this point, I should probably wait for Org maintainers to chime in…
next prev parent reply other threads:[~2020-07-05 16:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-04 2:29 bug#42184: 27.0.91; org-fontify-whole-heading-line does not work in emacs 27 Erik Hetzner
2020-07-04 17:13 ` Kévin Le Gouguec
2020-07-04 17:18 ` Eli Zaretskii
2020-07-04 17:50 ` Kévin Le Gouguec
2020-07-04 19:52 ` Kévin Le Gouguec
2020-07-05 2:30 ` Eli Zaretskii
2020-07-05 8:57 ` Kévin Le Gouguec
2020-07-05 14:58 ` Eli Zaretskii
2020-07-05 16:02 ` Kévin Le Gouguec [this message]
2020-07-05 16:21 ` Eli Zaretskii
2020-07-08 11:50 ` Kévin Le Gouguec
2020-07-09 14:16 ` Kévin Le Gouguec
2020-08-06 4:10 ` Kyle Meyer
2020-08-06 9:32 ` Kévin Le Gouguec
2020-08-06 13:35 ` Eli Zaretskii
2020-09-06 8:12 ` Bastien
2020-09-06 14:10 ` Kévin Le Gouguec
2020-09-06 15:06 ` Stefan Kangas
2020-09-06 14:19 ` Kyle Meyer
2020-09-06 15:06 ` Stefan Kangas
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=871rlqeyrn.fsf@gmail.com \
--to=kevin.legouguec@gmail.com \
--cc=42184@debbugs.gnu.org \
--cc=bzg@gnu.org \
--cc=egh@e6h.org \
--cc=eliz@gnu.org \
--cc=mail@nicolasgoaziou.fr \
/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).