From f48b89a683f9ff36d164b20c1df44ca6e6aefd7e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 18 Jan 2011 10:59:13 +0100 Subject: [PATCH] org-agenda: add a binding to reset the view * org-agenda.el (org-agenda-reset-view): New function. (org-agenda-view-mode-dispatch): Bind space to org-agenda-reset-view. Signed-off-by: Julien Danjou --- lisp/org-agenda.el | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 241ed30..138165f 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6157,11 +6157,12 @@ With prefix ARG, go backward that many times the current span." (defun org-agenda-view-mode-dispatch () "Call one of the view mode commands." (interactive) - (message "View: [d]ay [w]eek [m]onth [y]ear [q]uit/abort + (message "View: [d]ay [w]eek [m]onth [y]ear [space]reset [q]uit/abort time[G]rid [[]inactive [f]ollow [l]og [L]og-all [E]ntryText [a]rch-trees [A]rch-files clock[R]eport include[D]iary") (let ((a (read-char-exclusive))) (case a + (? (call-interactively 'org-agenda-reset-view)) (?d (call-interactively 'org-agenda-day-view)) (?w (call-interactively 'org-agenda-week-view)) (?m (call-interactively 'org-agenda-month-view)) @@ -6183,6 +6184,10 @@ With prefix ARG, go backward that many times the current span." (?q (message "Abort")) (otherwise (error "Invalid key" ))))) +(defun org-agenda-reset-view () + "Switch to default view for agenda." + (interactive) + (org-agenda-change-time-span (or org-agenda-ndays org-agenda-span))) (defun org-agenda-day-view (&optional day-of-year) "Switch to daily view for agenda. With argument DAY-OF-YEAR, switch to that day of the year." -- 1.7.2.3