From 9e4cacc8032babcd7b9b6000aec26d066c1cc339 Mon Sep 17 00:00:00 2001 From: Max Mikhanosha Date: Sat, 21 Apr 2012 08:31:37 -0400 Subject: [PATCH] Fix q key in sticky agenda not honoring org-agenda-restore-windows-after-quit * lisp/org-agenda.el (org-agenda-quit): copy the code for optionally restoring window configuration after burying the sticky agenda buffer. --- lisp/org-agenda.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 293f18ee5..b35829c3e 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6372,8 +6372,13 @@ If ERROR is non-nil, throw an error, otherwise just return nil." (not (one-window-p)) (delete-window))) (with-current-buffer buf - (bury-buffer))) - (org-agenda-Quit)))) + (bury-buffer) + ;; Maybe restore the pre-agenda window configuration. + (and org-agenda-restore-windows-after-quit + (not (eq org-agenda-window-setup 'other-frame)) + org-pre-agenda-window-conf + (set-window-configuration org-pre-agenda-window-conf)))))) + (org-agenda-Quit)))) (defun org-agenda-exit () "Exit agenda by removing the window or the buffer. -- 2.11.4.GIT