From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: 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:15:30 +0100 Message-ID: <11FE107E-7777-4D43-99B7-891FF75463DE@gmail.com> References: <87ei9a30tx.fsf@norang.ca> <87k4j2e1bb.fsf@noorul.maa.corp.collab.net> <87y67i0z5c.fsf@norang.ca> <87zkr3h3qv.fsf@norang.ca> <257A79BB-86AC-43E5-AE9D-132168283FFB@gmail.com> <87k4i7gz5a.fsf@norang.ca> <8739ord2r4.fsf@norang.ca> <97009C4F-F6B7-4C54-BF3C-B3DE5EF15547@gmail.com> <10856187-1F13-4E34-90AE-B25B2C6EFC83@gmail.com> <320B5333-BD2A-40B2-8FE7-972BFC72C32F@gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=34034 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pf8bB-0001r8-EB for emacs-orgmode@gnu.org; Tue, 18 Jan 2011 05:15:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pf8b7-0004MM-QZ for emacs-orgmode@gnu.org; Tue, 18 Jan 2011 05:15:37 -0500 Received: from mail-fx0-f41.google.com ([209.85.161.41]:64100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pf8b7-0004MG-8h for emacs-orgmode@gnu.org; Tue, 18 Jan 2011 05:15:33 -0500 Received: by fxm12 with SMTP id 12so6936122fxm.0 for ; Tue, 18 Jan 2011 02:15:32 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Julien Danjou Cc: Bernt Hansen , Org Mode , Noorul Islam K M On Jan 18, 2011, at 11:00 AM, Julien Danjou wrote: > 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 =20 > 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. > > > [=E2=80=A6] > >> 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. I applied the patch, with minor modifications and added documentation. Thanks. - Carsten > =46rom 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 =20= > 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 =20 > [y]ear [q]uit/abort > + (message "View: [d]ay [w]eek [m]onth [y]ear [space]reset =20 > [q]uit/abort > time[G]rid [[]inactive [f]ollow [l]og [L]og-all =20 > [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 =20= > 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-=20 > 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." > --=20 > 1.7.2.3 > > > --=20 > Julien Danjou > =E2=9D=B1 http://julien.danjou.info - Carsten