diff options
author | Nicolas Dudebout <nicolas.dudebout@gmail.com> | 2018-02-21 20:43:24 -0500 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-02-22 14:37:45 +0100 |
commit | db90aadd383817452b2cf305e52ec9c196555733 (patch) | |
tree | 3300aed9b636c6a11c7ca79b0f2b0c4c98885ce1 | |
parent | 6655429b8d7ee686a8300b61af587599cd656a22 (diff) | |
download | org-mode-db90aadd383817452b2cf305e52ec9c196555733.tar.gz |
org-agenda: make log and clockreport modes local
* lisp/org-agenda.el (org-agenda-mode): Only set `org-agenda-show-log'
and `org-agenda-clock-report-mode' to their default values when
constructing an agenda buffer, and not when redoing it.
* lisp/org-agenda.el (org-agenda-log-mode,
org-agenda-clockreport-mode): Do not set the global default value
`org-agenda-start-with-log-mode' (respectively
`org-agenda-start-with-clockreport-mode') with the current value of
`org-agenda-log-mode' (respectively `org-agenda-clockreport-mode'),
which, with sticky agendas is even buffer local.
`org-agenda-show-log' indicates if the the current agenda buffer has
log-mode enabled. When building a new agenda buffer, it gets its
value from `org-agenda-start-with-log-mode'. It is is semantically a
buffer local variable: when creating a new agenda buffer you expect it
to be set to the value in `org-agenda-start-with-log-mode'. However,
2e9c2d71 while fixing an issue with sticky agendas rendered the
variable `org-agenda-log-mode' effectively global: toggling log mode
in a given agenda buffer modifies the global default for all agenda
buffers. The same reasoning holds for clockreport mode.
This change ensures that a log or clockreport mode change made in one
agenda buffer does not propagate to other agenda buffers, existing or
new. The change is however preserved on org-agenda-redo in the
initial agenda buffer, whether using sticky agendas or not.
TINYCHANGE
-rw-r--r-- | lisp/org-agenda.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index b80504f..b5f277c 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -2213,9 +2213,9 @@ The following commands are available: nil t) (unless org-agenda-keep-modes (setq org-agenda-follow-mode org-agenda-start-with-follow-mode - org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode)) - (setq org-agenda-show-log org-agenda-start-with-log-mode) - (setq org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode) + org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode + org-agenda-show-log org-agenda-start-with-log-mode + org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode)) (add-to-invisibility-spec '(org-filtered)) (add-to-invisibility-spec '(org-link)) (easy-menu-change @@ -8187,7 +8187,6 @@ so that the date SD will be in that range." (interactive) (org-agenda-check-type t 'agenda) (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode)) - (setq org-agenda-start-with-clockreport-mode org-agenda-clockreport-mode) (org-agenda-set-mode-name) (org-agenda-redo) (message "Clocktable mode is %s" @@ -8211,7 +8210,6 @@ log items, nothing else." nil 'clockcheck)) (special '(closed clock state)) (t (not org-agenda-show-log)))) - (setq org-agenda-start-with-log-mode org-agenda-show-log) (org-agenda-set-mode-name) (org-agenda-redo) (message "Log mode is %s" (if org-agenda-show-log "on" "off"))) |