Org-mode mailing list
 help / color / mirror / Atom feed
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
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



  reply	other threads:[~2021-05-01 13:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 12:11 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

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://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

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git