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).
This commit is contained in:
memeplex 2019-02-22 00:32:58 -03:00 committed by Nicolas Goaziou
parent b0932f703e
commit 029cf66f01

View file

@ -3026,19 +3026,18 @@ s Search for keywords M Like m, but only TODO entries
(symbol-name type)
"Lambda expression"))
(t "???"))))
(if org-agenda-menu-show-matcher
(setq line
(concat line ": "
(cond
((stringp match)
(setq match (copy-sequence match))
(org-add-props match nil 'face 'org-warning))
((listp type)
(format "set of %d commands" (length type))))))
(when (org-string-nw-p match)
(add-text-properties
0 (length line) (list 'help-echo
(concat "Matcher: " match)) line)))
(cond
((not (org-string-nw-p match)) nil)
(org-agenda-menu-show-matcher
(setq line
(concat line ": "
(cond
((stringp match)
(propertize match nil 'face 'org-warning))
((listp type)
(format "set of %d commands" (length type)))))))
(t
(org-add-props line nil 'help-echo (concat "Matcher: " match))))
(push line lines)))
(setq lines (nreverse lines))
(when prefixes