Hi!

This is my first patch.

The patch skips formatting TODO item in org-agenda when the format string
is "".
When the format string was "" the extra space would still be inserted which
was not needed when there is no TODO keyword.

Thanks,
Samim
From dc3ba301219622bc7d324901a5f277024f8b55cc Mon Sep 17 00:00:00 2001
From: Samim Pezeshki <psa...@gmail.com>
Date: Sat, 8 May 2021 20:09:16 +0430
Subject: [PATCH] org-agenda: Skip formatting if format string is ""

When the format string was "" the extra space would still be inserted
which was not needed when there is no TODO keyword.
---
 lisp/org-agenda.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 85e201086..32ed19afc 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7147,12 +7147,13 @@ The optional argument TYPE tells the agenda type."
 	    (setq x
 		  (concat
 		   (substring x 0 (match-end 1))
-		   (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))
+       (when (not (eq 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)))
 
-- 
2.31.1

Reply via email to