Browse Source

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).
memeplex 6 years ago
parent
commit
029cf66f01
1 changed files with 12 additions and 13 deletions
  1. 12 13
      lisp/org-agenda.el

+ 12 - 13
lisp/org-agenda.el

@@ -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