From: William Xu <william.xwl@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: prettify-symbols-mode in org agenda?
Date: Sat, 01 May 2021 15:33:52 +0200 [thread overview]
Message-ID: <m2bl9ud1dr.fsf@gmail.com> (raw)
In-Reply-To: 87v98263bg.fsf@localhost
Ihor Radchenko <yantar92@gmail.com> writes:
> Bastien <bzg@gnu.org> writes:
>
>> Thanks for bringing this idea up.
>>
>> If allowing prettify-symbols-mode in Org agenda mode does not slow
>> down the agenda display and does not create spacing problems, then
>> yes, why not.
>
> Here is the patch. It will be great if other people test it first, as I
> rewrote it from advised functions in my personal config.
Works for me. Thanks!
> (org-agenda-highlight-todo): Preserve composition property used,
> i.e. by `prettify-symbols-mode'.
It looks like this change is not really needed, my emacs is built from
git master. Maybe the 'composition property is now preserved
automatically in the buffer?
-William
> @@ -7110,7 +7119,8 @@ (defun org-agenda-limit-interactively (remove)
> (defun org-agenda-highlight-todo (x)
> (let ((org-done-keywords org-done-keywords-for-agenda)
> (case-fold-search nil)
> - re)
> + re
> + composition-property)
> (if (eq x 'line)
> (save-excursion
> (beginning-of-line 1)
> @@ -7119,10 +7129,12 @@ (defun org-agenda-highlight-todo (x)
> (when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +"))
> (add-text-properties (match-beginning 0) (match-end 1)
> (list 'face (org-get-todo-face 1)))
> - (let ((s (buffer-substring (match-beginning 1) (match-end 1))))
> + (setq composition-property (plist-get (text-properties-at (match-beginning 1)) 'composition))
> + (let ((s (org-buffer-substring-fontified (match-beginning 1) (match-end 1))))
> (delete-region (match-beginning 1) (1- (match-end 0)))
> (goto-char (match-beginning 1))
> - (insert (format org-agenda-todo-keyword-format s)))))
> + (insert (format org-agenda-todo-keyword-format s))
> + (add-text-properties (match-beginning 1) (match-end 1) (list 'composition composition-property)))))
> (let ((pl (text-property-any 0 (length x) 'org-heading t x)))
> (setq re (get-text-property 0 'org-todo-regexp x))
> (when (and re
next prev parent reply other threads:[~2021-05-01 13:34 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-31 12:11 prettify-symbols-mode in org agenda? William Xu
2020-11-03 5:05 ` Ihor Radchenko
2020-11-03 19:05 ` William Xu
2020-11-04 1:47 ` Ihor Radchenko
2021-04-27 20:53 ` Bastien
2021-05-01 12:33 ` Ihor Radchenko
2021-05-01 13:33 ` William Xu [this message]
2021-05-01 14:37 ` Ihor Radchenko
2021-05-02 12:31 ` William Xu
2021-05-02 12:58 ` Ihor Radchenko
2021-05-02 13:56 ` William Xu
2021-05-03 17:16 ` Bastien
2021-05-04 4:23 ` Ihor Radchenko
2021-05-04 14:51 ` Ihor Radchenko
2021-05-05 15:23 ` Ihor Radchenko
2021-05-05 18:01 ` William Xu
2021-05-06 2:15 ` Ihor Radchenko
2021-05-14 15:35 ` William Xu
2021-05-15 12:15 ` Ihor Radchenko
2021-05-16 9:49 ` William Xu
2021-05-17 14:04 ` Ihor Radchenko
2021-05-17 17:44 ` William Xu
2021-06-20 11:27 ` Ihor Radchenko
2021-06-22 15:25 ` William Xu
2021-06-22 15:42 ` Ihor Radchenko
2021-06-22 18:07 ` William Xu
2021-07-02 14:11 ` Ihor Radchenko
2021-07-01 15:49 ` Timothy
2021-07-02 14:13 ` Ihor Radchenko
2021-10-26 9:03 ` William Xu
2021-10-27 6:50 ` 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=m2bl9ud1dr.fsf@gmail.com \
--to=william.xwl@gmail.com \
--cc=emacs-orgmode@gnu.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 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).