Browse Source

org-agenda: Fix "org-agenda: one-armed “if” -> “when”"

* lisp/org-agenda.el (org-tags-view): Re-instate delete `else' part.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00286.html>
Nicolas Goaziou 1 year ago
parent
commit
68b376dee0
1 changed files with 7 additions and 6 deletions
  1. 7 6
      lisp/org-agenda.el

+ 7 - 6
lisp/org-agenda.el

@@ -4751,12 +4751,13 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
       (setq match nil))
     (catch 'exit
       ;; TODO: this code is repeated a lot...
-      (when org-agenda-sticky
-	(setq org-agenda-buffer-name
-	      (if (stringp match)
-		  (format "*Org Agenda(%s:%s)*"
-			  (or org-keys (or (and todo-only "M") "m")) match)
-		(format "*Org Agenda(%s)*" (or (and todo-only "M") "m")))))
+      (if org-agenda-sticky
+	  (setq org-agenda-buffer-name
+		(if (stringp match)
+		    (format "*Org Agenda(%s:%s)*"
+			    (or org-keys (or (and todo-only "M") "m")) match)
+		  (format "*Org Agenda(%s)*" (or (and todo-only "M") "m"))))
+	(setq matcher (org-make-tags-matcher match)))
       ;; Prepare agendas (and `org-tag-alist-for-agenda') before
       ;; expanding tags within `org-make-tags-matcher'
       (org-agenda-prepare (concat "TAGS " match))