summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-01-30 00:04:54 -0500
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-01-30 10:39:53 +0100
commit7834a1ce66d3e60b9ecf5ad04a12d76d23cfbc5c (patch)
tree48e3646634a03cb7f7a42cc8628c1768f834f9d3
parenta1116aa54ee4befd8fa52e3f92207db200ebfd59 (diff)
downloadorg-mode-7834a1ce66d3e60b9ecf5ad04a12d76d23cfbc5c.tar.gz
org-agenda: Add only-window setup option
* lisp/org-agenda.el (org-agenda-window-setup, org-agenda-prepare-window): Add option to show agenda as the only window in the current frame.
-rw-r--r--etc/ORG-NEWS3
-rw-r--r--lisp/org-agenda.el5
2 files changed, 8 insertions, 0 deletions
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index fa9d0ad..7fcfdd9 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -192,6 +192,9 @@ manual for details.
*** Countdown timers can now be paused.
~org-timer-pause-time~ now pauses and restarts both relative and
countdown timers.
+*** New option ~only-window~ for ~org-agenda-window-setup~
+When ~org-agenda-window-setup~ is set to ~only-window~, the agenda is
+displayed as the sole window of the current frame.
** Miscellaneous
*** Strip all meta data from ITEM special property
ITEM special property does not contain TODO, priority or tags anymore.
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 3476a25..b83c331 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1095,6 +1095,7 @@ Possible values for this option are:
current-window Show agenda in the current window, keeping all other windows.
other-window Use `switch-to-buffer-other-window' to display agenda.
+only-window Show agenda, deleting all other windows.
reorganize-frame Show only two windows on the current frame, the current
window and the agenda.
other-frame Use `switch-to-buffer-other-frame' to display agenda.
@@ -1105,6 +1106,7 @@ See also the variable `org-agenda-restore-windows-after-quit'."
(const current-window)
(const other-frame)
(const other-window)
+ (const only-window)
(const reorganize-frame)))
(defcustom org-agenda-window-frame-fractions '(0.5 . 0.75)
@@ -3621,6 +3623,9 @@ FILTER-ALIST is an alist of filters we need to apply when
(org-switch-to-buffer-other-window abuf))
((equal org-agenda-window-setup 'other-frame)
(switch-to-buffer-other-frame abuf))
+ ((eq org-agenda-window-setup 'only-window)
+ (delete-other-windows)
+ (org-pop-to-buffer-same-window abuf))
((equal org-agenda-window-setup 'reorganize-frame)
(delete-other-windows)
(org-switch-to-buffer-other-window abuf)))