From 104d92199e3cba7cefd504f24c3610031fa384de Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 17 Nov 2020 00:33:56 -0500 Subject: [PATCH] agenda: Fix toggling of archive files * lisp/org-agenda.el (org-agenda-archives-mode): Turn archive mode off if with-files in non-nil but files are already included so that a repeated `vA` can toggle in the same manner as a repeated `va`. Reported-by: Gustavo Barros Ref: https://orgmode.org/list/87o8jxz5hu.fsf@gmail.com --- lisp/org-agenda.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index b6d15e7b8..b6168d45c 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8620,7 +8620,10 @@ log items, nothing else." When called with a prefix argument, include all archive files as well." (interactive "P") (setq org-agenda-archives-mode - (if with-files t (if org-agenda-archives-mode nil 'trees))) + (cond ((and with-files (eq org-agenda-archives-mode t)) nil) + (with-files t) + (org-agenda-archives-mode nil) + (t 'trees))) (org-agenda-set-mode-name) (org-agenda-redo) (message