summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-11-17 00:33:56 -0500
committerKyle Meyer <kyle@kyleam.com>2020-11-17 00:49:22 -0500
commit104d92199e3cba7cefd504f24c3610031fa384de (patch)
tree834a71de3e794aa2de7ad782f69ae6af24661936
parent9bb93006ea150adb9f64e6f944bb8c0f68d327cd (diff)
downloadorg-mode-104d92199e3cba7cefd504f24c3610031fa384de.tar.gz
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 <gusbrs.2016@gmail.com> Ref: https://orgmode.org/list/87o8jxz5hu.fsf@gmail.com
-rw-r--r--lisp/org-agenda.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b6d15e7..b6168d4 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