From: Ihor Radchenko <yantar92@gmail.com>
To: Protesilaos Stavrou <info@protesilaos.com>, emacs-orgmode@gnu.org
Subject: Re: Adaptive Org faces in headings?
Date: Sun, 26 Apr 2020 15:42:02 +0800 [thread overview]
Message-ID: <87imhmd779.fsf@localhost> (raw)
In-Reply-To: <878sii4yj7.fsf@protesilaos.com>
> Does the community know of a solution to this issue?
Not precisely answer to your question, but I use the code below to get
more complete fontification in agenda. The code does not consider
heading level, but can be easily modified to do so [ (insert "* ") ->
(insert (s-concat (make-string level ?*) " ")) ]
(define-advice org-agenda-format-item (:filter-args (&rest args) fontify-org)
"Force fontify ageda item. (hack)"
(cl-multiple-value-bind (extra txt level category tags dotime remove-re habitp) (car args)
(with-temp-buffer
(cl-letf (((symbol-function 'yant/process-att-abbrev) #'identity)
((symbol-function 'yant/process-att-id-abbrev) #'identity)) ;; expanding sometimes causes errors when attempting to access ancestors
(org-mode)
(insert "* "
txt
"\t"
(or (and tags (s-join ":" `(nil ,@(cl-remove-duplicates tags) nil)))
"")
"\n")
(font-lock-fontify-buffer)
(goto-char (point-min))
(looking-at "^\\* \\(\\([^\t]+\\)[ ]+\\(:\\([[:alnum:]_@#%:]+\\):\\)*\\)[ ]*$")
(setq txt (match-string 2))
(setq tags (and tags (s-split ":" (match-string 3) 't))))
(list extra txt level category tags dotime remove-re habitp)))
)
Protesilaos Stavrou <info@protesilaos.com> writes:
> Dear all,
>
> I have noticed that Org faces that combine with headings do not adapt to
> their context. This applies to keywords, priority cookies, links, and
> possibly other elements as well.
>
> For example, a "todo" keyword (`org-todo' face) will not scale in size
> to match that of the heading level (`org-level-N' face) if the latter
> uses a `:height' property. Same principle for keywords not inheriting
> the heading's background, overline, etc.
>
> My expectation is to allow `org-level-N' to pass its attributes to any
> element on the same line, unless that element has conflicting face
> attributes of its own. So, in my example, the heading could pass its
> height to the "todo" keyword when the `org-todo' face does not define a
> `:height' of its own. Otherwise it would refrain from overriding that
> attribute.
>
> Does the community know of a solution to this issue?
>
> I am running:
>
> * Org mode version 9.3.
>
> * GNU Emacs 27.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.17,
> cairo version 1.17.3) of 2020-04-20.
>
> Best regards,
> Protesilaos
>
>
> --
> Protesilaos Stavrou
> protesilaos.com
>
--
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China
Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg
next prev parent reply other threads:[~2020-04-26 7:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-26 5:16 Adaptive Org faces in headings? Protesilaos Stavrou
2020-04-26 7:42 ` Ihor Radchenko [this message]
2020-09-05 14:47 ` Bastien
2020-09-06 19:58 ` Protesilaos Stavrou
2020-09-05 21:39 ` Diego Zamboni
2020-09-07 4:08 ` Protesilaos Stavrou
2020-09-09 8:49 ` Bastien
2020-09-09 9:11 ` TEC
2020-09-09 14:44 ` Bastien
2020-09-12 7:33 ` Protesilaos Stavrou
2020-09-17 8:25 ` [PATCH] " Ihor Radchenko
2020-09-18 9:52 ` Protesilaos Stavrou
2020-09-20 3:24 ` Sheng Yang
2020-10-27 18:30 ` Rob Davenport
2020-10-28 15:37 ` Rob Davenport
2020-09-21 16:05 ` Mikhail Skorzhinskii
2020-09-23 12:25 ` Bastien
2020-09-23 12:28 ` Protesilaos Stavrou
2020-09-26 6:31 ` Bastien
2020-10-05 10:11 ` Protesilaos Stavrou
2020-10-07 4:20 ` Kyle Meyer
2020-10-07 5:29 ` Protesilaos Stavrou
2020-10-08 3:37 ` Kyle Meyer
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=87imhmd779.fsf@localhost \
--to=yantar92@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=info@protesilaos.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/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).