From: Samim Pezeshki <p.samim@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: emacs-orgmode@gnu.org, Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: [PATCH] org-agenda: Skip formatting if format string is ""
Date: Tue, 15 Mar 2022 22:05:53 +0330 [thread overview]
Message-ID: <CAJAdVc3XwOdhUG1WTEPvoyr9HJ4BKb_Cwthtua72KAb64idrpA@mail.gmail.com> (raw)
In-Reply-To: <CAJAdVc1mTZVaqWW7YvuxXFPqOVrK_HNgWopSNmD_q_a_Lk+RuA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]
Hi!
Is there anything I need to do for this to be merged?
Thanks
On Wed, Feb 9, 2022 at 10:44 PM Samim Pezeshki <p.samim@gmail.com> wrote:
> 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 #2: Type: text/html, Size: 3084 bytes --]
next prev parent reply other threads:[~2022-03-15 18:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-05 17:02 [PATCH] org-agenda: Skip formatting if format string is "" Samim Pezeshki
2022-02-06 9:28 ` Ihor Radchenko
2022-02-09 19:14 ` Samim Pezeshki
2022-03-15 18:35 ` Samim Pezeshki [this message]
2022-03-21 7:34 ` Ihor Radchenko
-- strict thread matches above, loose matches on Subject: below --
2021-05-08 15:55 Samim Pezeshki
2021-05-15 8:12 ` Bastien
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=CAJAdVc3XwOdhUG1WTEPvoyr9HJ4BKb_Cwthtua72KAb64idrpA@mail.gmail.com \
--to=p.samim@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
--cc=yantar92@gmail.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).