emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: Bug: Jumping to a date in the agenda changes view back


From: Julien Danjou
Subject: Re: [Orgmode] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
Date: Tue, 18 Jan 2011 11:00:39 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

On Tue, Jan 18 2011, Carsten Dominik wrote:

> Otherwise, if would continue to use whatever value you set with your
> latest view change and keep this until you change it again.
>
>
> So what was your issue with this part?

My issue is that I use a default value of 14 days (you know I'm weird).
If I change the current span by pressing `d', `w', `m', I've only one
way to go back to my default 14 days view: close the agenda and reopen
it.


[…]

> So there you have your command to go back to the default
> span.

Yes, but:

> If you think we do need an extra command for this, you
> could do that under the "v" dispatcher in the agenda.
> Maybe "v SPACE"?

This is exactly what I meant! :-)
I'd like to not to have to do `C-a a' once again to reset my view.

Here's a patch for that.
From f48b89a683f9ff36d164b20c1df44ca6e6aefd7e Mon Sep 17 00:00:00 2001
From: Julien Danjou <address@hidden>
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 <address@hidden>
---
 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

-- 
Julien Danjou
❱ http://julien.danjou.info

Attachment: pgpzPRitFI9iW.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]