From mboxrd@z Thu Jan 1 00:00:00 1970 From: Niels Giesen Subject: Re: Patch for bug in adjusting time ranges in Agenda Date: Mon, 17 Oct 2011 10:50:30 +0200 Message-ID: References: <87obxzitcv.fsf@gmail.com> <31715.1318783422@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016364ed99a02c35604af7ab386 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:45620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFiu1-00051g-Rx for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 04:50:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFiu0-0005RN-4k for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 04:50:33 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:50563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFitz-0005R4-Qa for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 04:50:32 -0400 Received: by qadb17 with SMTP id b17so2274942qad.0 for ; Mon, 17 Oct 2011 01:50:31 -0700 (PDT) In-Reply-To: <31715.1318783422@alphaville.dokosmarshall.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: Orgmode --0016364ed99a02c35604af7ab386 Content-Type: text/plain; charset=UTF-8 On Sun, Oct 16, 2011 at 6:43 PM, Nick Dokos wrote: > Niels Giesen wrote: > > > *bump* > > > > Has this one slipped through (as I were posting two other patches round > the same date, one also > > having to do with date/time ranges in the agenda -- which were both > accepted), or am I just > > impatient? > > > > I tried to check patchwork ( > http://patchwork.newartisans.com/project/org-mode/) > but the server seems to be having problems right now. However, that's the > first > place to check when it comes back: if it's there, somebody will get to it > sooner > or later. > Ok, I checked today (server is up again) and it's not there. But I've been a fool. Should've submitted as an attachment as per http://orgmode.org/worg/org-contribute.html . Should I try and resubmit? > > Nick > > > On Sun, Oct 2, 2011 at 12:24 PM, Niels Giesen > wrote: > > > > Hi Orgers, > > > > The discussion in the recent thread "Time range end in agenda view > not > > displayed" prompted me to take a closer look at time/date ranges in > the > > Agenda view. I noticed that the commands `org-agenda-do-date-later' > and > > `org-agenda-do-date-earlier' do not work correctly on timestamp > ranges, > > in that they only shift the rightmost timestamp in the range. The > patch > > below should fix this. > > > > #+begin_src diff > > From 2e6b64dc8dcae0fd312729af96ab10d8d2e9d91b Mon Sep 17 00:00:00 > 2001 > > From: Niels Giesen > > Date: Sun, 2 Oct 2011 09:15:21 +0200 > > Subject: [PATCH] Fix shift-adjusting time and date ranges from > within Agenda. > > > > ,* org-mode/lisp/org-agenda.el (org-agenda-date-later): Adjust both > > start and end timestamp for a range, and set > > `org-last-changed-timestamp' to a representation of the new range. > > --- > > lisp/org-agenda.el | 8 +++++++- > > 1 files changed, 7 insertions(+), 1 deletions(-) > > > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > > index b1fa5f5..e4c1053 100644 > > --- a/lisp/org-agenda.el > > +++ b/lisp/org-agenda.el > > @@ -7517,7 +7517,13 @@ the same tree node, and the headline of the > tree node in the Org-mode > > file." > > (goto-char pos) > > (if (not (org-at-timestamp-p)) > > (error "Cannot find time stamp")) > > - (org-timestamp-change arg (or what 'day))) > > + (org-timestamp-change arg (or what 'day)) > > + (when (org-at-date-range-p) > > + (let ((end org-last-changed-timestamp)) > > + (re-search-backward org-tr-regexp-both) > > + (org-timestamp-change arg (or what 'day)) > > + (setq org-last-changed-timestamp > > + (concat org-last-changed-timestamp "--" end))))) > > (org-agenda-show-new-time marker org-last-changed-timestamp)) > > (message "Time stamp changed to %s" > org-last-changed-timestamp))) > > > > -- > > 1.7.2.5 > > > > #+end_src > > > > Regards, > > niels > > -- > > http://pft.github.com > > > > -- > > http://pft.github.com > > > > > > ---------------------------------------------------- > > Alternatives: > > > > ---------------------------------------------------- > -- http://pft.github.com --0016364ed99a02c35604af7ab386 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Sun, Oct 16, 2011 at 6:43 PM, Nick Do= kos <nicholas= .dokos@hp.com> wrote:
Niels Giesen <niels.giesen@gmail.com> wrote:

> *bump*
>
> Has this one slipped through (as I were posting two other patches roun= d the same date, one also
> having to do with date/time ranges in the agenda -- which were both ac= cepted), or am I just
> impatient?
>

I tried to check patchwork (http://patchwork.newartisans.com/pr= oject/org-mode/)
but the server seems to be having problems right now. However, that's t= he first
place to check when it comes back: if it's there, somebody will get to = it sooner
or later.

Ok, I checked today (server i= s up again) and it's not there. But I've been a fool. Should've= submitted as an attachment as per=C2=A0http://orgmode.org/worg/org-contribute.html=C2=A0.= Should I try and resubmit?
=C2=A0

Nick

> On Sun, Oct 2, 2011 at 12:24 PM, Niels Giesen <niels.giesen@gmail.com> wrote:
>
> =C2=A0 =C2=A0 Hi Orgers,
>
> =C2=A0 =C2=A0 The discussion in the recent thread "Time range end= in agenda view not
> =C2=A0 =C2=A0 displayed" prompted me to take a closer look at tim= e/date ranges in the
> =C2=A0 =C2=A0 Agenda view. I noticed that the commands `org-agenda-do-= date-later' and
> =C2=A0 =C2=A0 `org-agenda-do-date-earlier' do not work correctly o= n timestamp ranges,
> =C2=A0 =C2=A0 in that they only shift the rightmost timestamp in the r= ange. The patch
> =C2=A0 =C2=A0 below should fix this.
>
> =C2=A0 =C2=A0 #+begin_src diff
> =C2=A0 =C2=A0 =C2=A0From 2e6b64dc8dcae0fd312729af96ab10d8d2e9d91b Mon = Sep 17 00:00:00 2001
> =C2=A0 =C2=A0 =C2=A0From: Niels Giesen <niels.giesen@gmail.com>
> =C2=A0 =C2=A0 =C2=A0Date: Sun, 2 Oct 2011 09:15:21 +0200
> =C2=A0 =C2=A0 =C2=A0Subject: [PATCH] Fix shift-adjusting time and date= ranges from within Agenda.
>
> =C2=A0 =C2=A0 =C2=A0,* org-mode/lisp/org-agenda.el (org-agenda-date-la= ter): Adjust both
> =C2=A0 =C2=A0 =C2=A0 =C2=A0start and end timestamp for a range, and se= t
> =C2=A0 =C2=A0 =C2=A0 =C2=A0`org-last-changed-timestamp' to a repre= sentation of the new range.
> =C2=A0 =C2=A0 =C2=A0---
> =C2=A0 =C2=A0 =C2=A0 lisp/org-agenda.el | =C2=A0 =C2=A08 +++++++-
> =C2=A0 =C2=A0 =C2=A0 1 files changed, 7 insertions(+), 1 deletions(-)<= br> >
> =C2=A0 =C2=A0 =C2=A0diff --git a/lisp/org-agenda.el b/lisp/org-agenda.= el
> =C2=A0 =C2=A0 =C2=A0index b1fa5f5..e4c1053 100644
> =C2=A0 =C2=A0 =C2=A0--- a/lisp/org-agenda.el
> =C2=A0 =C2=A0 =C2=A0+++ b/lisp/org-agenda.el
> =C2=A0 =C2=A0 =C2=A0@@ -7517,7 +7517,13 @@ the same tree node, and the= headline of the tree node in the Org-mode
> =C2=A0 =C2=A0 file."
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char pos)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (not (org-at-times= tamp-p))
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (error "Cannot find tim= e stamp"))
> =C2=A0 =C2=A0 =C2=A0- =C2=A0 =C2=A0 =C2=A0 (org-timestamp-change arg (= or what 'day)))
> =C2=A0 =C2=A0 =C2=A0+ =C2=A0 =C2=A0 =C2=A0 (org-timestamp-change arg (= or what 'day))
> =C2=A0 =C2=A0 =C2=A0+ =C2=A0 =C2=A0 =C2=A0 (when (org-at-date-range-p)=
> =C2=A0 =C2=A0 =C2=A0+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((end org-last-= changed-timestamp))
> =C2=A0 =C2=A0 =C2=A0+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (re-search-ba= ckward org-tr-regexp-both)
> =C2=A0 =C2=A0 =C2=A0+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-timestam= p-change arg (or what 'day))
> =C2=A0 =C2=A0 =C2=A0+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq org-las= t-changed-timestamp
> =C2=A0 =C2=A0 =C2=A0+ =C2=A0 =C2=A0 =C2=A0 =C2=A0(concat org-last-chan= ged-timestamp "--" end)))))
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-agenda-show-new-time mar= ker org-last-changed-timestamp))
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "Time stamp changed t= o %s" org-last-changed-timestamp)))
>
> =C2=A0 =C2=A0 =C2=A0--
> =C2=A0 =C2=A0 =C2=A01.7.2.5
>
> =C2=A0 =C2=A0 #+end_src
>
> =C2=A0 =C2=A0 Regards,
> =C2=A0 =C2=A0 niels
> =C2=A0 =C2=A0 --
> =C2=A0 =C2=A0 http= ://pft.github.com
>
> --
> http://pft.github.= com
>
>
> ----------------------------------------------------
> Alternatives:
>
> ----------------------------------------------------



--
http://pft.github.com
--0016364ed99a02c35604af7ab386--