emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [patch] Don't show trailing colon in agenda custom command desc
@ 2019-02-22  3:37 Carlos Pita
  2019-02-22 19:01 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos Pita @ 2019-02-22  3:37 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

Hi all,

here is a simple patch to avoid showing ugly trailing colons in custom
agenda commands when no matcher was specified (for example, in the
case of alltodo).

Best regards
--
Carlos

[-- Attachment #2: 0001-org-agenda-don-t-show-trailing-color-if-no-matcher.patch --]
[-- Type: text/x-patch, Size: 966 bytes --]

From 4125d3ff9e4f26c3346b847288cad3e69a38da23 Mon Sep 17 00:00:00 2001
From: memeplex <carlosjosepita@gmail.com>
Date: Fri, 22 Feb 2019 00:32:58 -0300
Subject: [PATCH] org-agenda: don't show trailing color if no matcher

* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
  when no matcher was specified there is no point in showing
  a trailing colon (and space).
---
 lisp/org-agenda.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ff98cd65d..ab50d4274 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3027,7 +3027,8 @@ s   Search for keywords                 M   Like m, but only TODO entries
 					    (symbol-name type)
 					  "Lambda expression"))
 		      (t "???"))))
-	      (if org-agenda-menu-show-matcher
+	      (if (and org-agenda-menu-show-matcher
+		       match (not (string-empty-p match)))
 		  (setq line
 			(concat line ": "
 				(cond
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] Don't show trailing colon in agenda custom command desc
  2019-02-22  3:37 [patch] Don't show trailing colon in agenda custom command desc Carlos Pita
@ 2019-02-22 19:01 ` Nicolas Goaziou
  2019-02-22 19:30   ` Carlos Pita
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2019-02-22 19:01 UTC (permalink / raw)
  To: Carlos Pita; +Cc: emacs-orgmode

Hello,

Carlos Pita <carlosjosepita@gmail.com> writes:

> here is a simple patch to avoid showing ugly trailing colons in custom
> agenda commands when no matcher was specified (for example, in the
> case of alltodo).
>
> Best regards
> --
> Carlos
>
> From 4125d3ff9e4f26c3346b847288cad3e69a38da23 Mon Sep 17 00:00:00 2001
> From: memeplex <carlosjosepita@gmail.com>
> Date: Fri, 22 Feb 2019 00:32:58 -0300
> Subject: [PATCH] org-agenda: don't show trailing color if no matcher
>
> * lisp/org-agenda.el (org-agenda-get-restriction-and-command):
>   when no matcher was specified there is no point in showing
>   a trailing colon (and space).

Applied, with some refactoring. Please double check I didn't fumble it.

Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] Don't show trailing colon in agenda custom command desc
  2019-02-22 19:01 ` Nicolas Goaziou
@ 2019-02-22 19:30   ` Carlos Pita
  0 siblings, 0 replies; 3+ messages in thread
From: Carlos Pita @ 2019-02-22 19:30 UTC (permalink / raw)
  To: Carlos Pita, emacs-orgmode

> Applied, with some refactoring. Please double check I didn't fumble it.

I looked at the code and tested it a bit and seems to be ok. Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-22 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22  3:37 [patch] Don't show trailing colon in agenda custom command desc Carlos Pita
2019-02-22 19:01 ` Nicolas Goaziou
2019-02-22 19:30   ` Carlos Pita

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).