emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] org-agenda: Skip formatting if format string is ""


From: Samim Pezeshki
Subject: Re: [PATCH] org-agenda: Skip formatting if format string is ""
Date: Wed, 9 Feb 2022 22:44:11 +0330

Thanks Ihor for the detailed explanation,
I updated the patch as you suggested.

On Sun, Feb 6, 2022 at 12:53 PM Ihor Radchenko <yantar92@gmail.com> wrote:
Samim Pezeshki <p.samim@gmail.com> writes:

> This commit prevents having extra spaces when the TODO format string is an
> empty string ("").  It was not working properly, with this patch now it
> works correctly.

Thanks for the patch!

>                 (concat
>                  (substring x 0 (match-end 1))
> ...
> +       (unless (string= org-agenda-todo-keyword-format "")
> +         (format org-agenda-todo-keyword-format
> +                             (match-string 2 x))
> +         ;; Remove `display' property as the icon could leak
> +         ;; on the white space.
> +         (org-add-props " " (org-plist-delete (text-properties-at 0 x)
> +                                              'display)))
>                     (substring x (match-end 3)))))))
>        x)))

Your patch will unconditionally hide todo keywords in agenda even when
org-agenda-todo-keyword-format is not empty. This will happen because
(unless ...) form will only return the last " ", but never the keyword.

You should better wrap the (org-add-props ...) with another unless
condition.

Best,
Ihor

Attachment: 0001-lisp-org-agenda.el-Fix-bug-in-org-agenda-highlight-t.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]