Browse Source

Remove agenda-archives even with buffer restriction

* lisp/org-agenda.el (org-search-view): Remove agenda-archives even
  with buffer restriction.
Allen Li 1 year ago
parent
commit
8944b578b8
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lisp/org-agenda.el

+ 3 - 3
lisp/org-agenda.el

@@ -4487,9 +4487,9 @@ is active."
       (setq files (org-agenda-files nil 'ifmode))
       ;; Add `org-agenda-text-search-extra-files' unless there is some
       ;; restriction.
-      (unless (get 'org-agenda-files 'org-restrict)
-	(when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
-	  (pop org-agenda-text-search-extra-files)
+      (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
+	(pop org-agenda-text-search-extra-files)
+	(unless (get 'org-agenda-files 'org-restrict)
 	  (setq files (org-add-archive-files files))))
       ;; Uniquify files.  However, let `org-check-agenda-file' handle
       ;; non-existent ones.