summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Wahl <marcowahlsoft@gmail.com>2018-06-23 20:36:04 +0200
committerMarco Wahl <marcowahlsoft@gmail.com>2018-06-23 20:36:04 +0200
commitd6ebe38e2c420daa8ff0a27f5e4d5af2672a84f6 (patch)
tree0ed2831eedf7bb900bb413cd08ce179aa258a7cc
parent62dd2cc829c541fd1773130d1cfb069fc168a236 (diff)
parent00c1184a042da4fc9642eab8020accd87dd9e1c0 (diff)
downloadorg-mode-d6ebe38e2c420daa8ff0a27f5e4d5af2672a84f6.tar.gz
Merge branch 'keep-some-local-variables-at-rebuild' into keep-text-scale-in-agenda-at-reload
-rw-r--r--lisp/org-agenda.el44
1 files changed, 26 insertions, 18 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 6636a2a..3255d73 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2184,29 +2184,37 @@ The following commands are available:
\\{org-agenda-mode-map}"
(interactive)
- (cond (org-agenda-doing-sticky-redo
- ;; Refreshing sticky agenda-buffer
- ;;
- ;; Preserve the value of `org-agenda-local-vars' variables,
- ;; while letting `kill-all-local-variables' kill the rest
- (let ((save (buffer-local-variables)))
- (kill-all-local-variables)
+ (let ((agenda-local-vars-to-keep
+ '(text-scale-mode-amount
+ text-scale-mode
+ text-scale-mode-lighter
+ face-remapping-alist))
+ (save (buffer-local-variables)))
+ (kill-all-local-variables)
+ (cond (org-agenda-doing-sticky-redo
+ ;; Refreshing sticky agenda-buffer
+ ;;
+ ;; Preserve the value of `org-agenda-local-vars' variables.
(mapc #'make-local-variable org-agenda-local-vars)
(dolist (elem save)
(pcase elem
(`(,var . ,val) ;ignore unbound variables
(when (and val (memq var org-agenda-local-vars))
- (set var val))))))
- (setq-local org-agenda-this-buffer-is-sticky t))
- (org-agenda-sticky
- ;; Creating a sticky Agenda buffer for the first time
- (kill-all-local-variables)
- (mapc 'make-local-variable org-agenda-local-vars)
- (setq-local org-agenda-this-buffer-is-sticky t))
- (t
- ;; Creating a non-sticky agenda buffer
- (kill-all-local-variables)
- (setq-local org-agenda-this-buffer-is-sticky nil)))
+ (set var val)))))
+ (setq-local org-agenda-this-buffer-is-sticky t))
+ (org-agenda-sticky
+ ;; Creating a sticky Agenda buffer for the first time
+ (mapc 'make-local-variable org-agenda-local-vars)
+ (setq-local org-agenda-this-buffer-is-sticky t))
+ (t
+ ;; Creating a non-sticky agenda buffer
+ (setq-local org-agenda-this-buffer-is-sticky nil)))
+ (mapc #'make-local-variable agenda-local-vars-to-keep)
+ (dolist (elem save)
+ (pcase elem
+ (`(,var . ,val) ;ignore unbound variables
+ (when (and val (memq var agenda-local-vars-to-keep))
+ (set var val))))))
(setq org-agenda-undo-list nil
org-agenda-pending-undo-list nil
org-agenda-bulk-marked-entries nil)