Browse Source

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.
Max Mikhanosha 13 years ago
parent
commit
9e4cacc803
1 changed files with 7 additions and 2 deletions
  1. 7 2
      lisp/org-agenda.el

+ 7 - 2
lisp/org-agenda.el

@@ -6372,8 +6372,13 @@ If ERROR is non-nil, throw an error, otherwise just return nil."
 		 (not (one-window-p))
 		 (not (one-window-p))
 		 (delete-window)))
 		 (delete-window)))
 	  (with-current-buffer buf
 	  (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 ()
 (defun org-agenda-exit ()
   "Exit agenda by removing the window or the buffer.
   "Exit agenda by removing the window or the buffer.