From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Agenda Bulk Scatter bug Date: Tue, 14 Jun 2011 10:51:54 +0200 Message-ID: <36CED999-3462-41AA-8A19-6FB41A0F967B@gmail.com> References: <201106041254.26344.robut@iinet.net.au> <2AA642BB-5BB4-40B0-976F-1DC938C064C3@gmail.com> <87sjrivyyi.fsf@ut.hh.sledj.net> <41EE7AE4-27D5-4925-A4AF-6B0E93C00164@gmail.com> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWPLu-0006kw-79 for emacs-orgmode@gnu.org; Tue, 14 Jun 2011 04:52:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWPLs-0000Yc-Ek for emacs-orgmode@gnu.org; Tue, 14 Jun 2011 04:52:01 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:55809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWPLs-0000YR-1M for emacs-orgmode@gnu.org; Tue, 14 Jun 2011 04:52:00 -0400 Received: by eyd9 with SMTP id 9so2161761eyd.0 for ; Tue, 14 Jun 2011 01:51:59 -0700 (PDT) In-Reply-To: <41EE7AE4-27D5-4925-A4AF-6B0E93C00164@gmail.com> 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: Carsten Dominik Cc: emacs-orgmode@gnu.org, David Edmondson On Jun 14, 2011, at 10:41 AM, Carsten Dominik wrote: > Hi David, >=20 > On Jun 10, 2011, at 11:05 AM, David Edmondson wrote: >=20 >> * carsten.dominik@gmail.com [2011-06-10 Fri 09:20] >>> Hi, I need a few testers: Something very strange is going on here. >>>=20 >>> When I evaluate this form >>>=20 >>> (decode-time (days-to-time (time-to-days (current-time)))) >>>=20 >>> I get a date in the year 3980. I think this used to work. >>> Is there anyone who has an idea what is going on here? >>=20 >> (decode-time (days-to-time (time-to-days (current-time)))) >> =3D> (0 0 1 10 6 3980 2 t 3600) >>=20 >> With "GNU Emacs 24.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) = of >> 2011-02-10 on keller, modified by Debian". >>=20 >> (time-to-days) returns the number of days since 0001-12-31bce, which >> (days-to-time) converts into a time value. That time value is = relative >> to 0001-12-31bce, _not_ relative to 1970-01-01, which is what >> (decode-time) is expecting. >>=20 >> Hence you end up 1970 years out. >=20 > Thank you for the analysis - the bulk scattering > command should now again work as advertised. OK, only after the git server starts working again. Until then, here is the patch: diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 65f37d4..b519ff2 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8199,9 +8199,11 @@ The prefix arg is passed through to the command = if possible." (setq day-of-week 0))))) ;; silently fail when try to replan a sexp entry (condition-case nil - (org-agenda-schedule nil - (days-to-time - (+ (org-today) distance))) + (let* ((date (calendar-gregorian-from-absolute + (+ (org-today) distance))) + (time (encode-time 0 0 0 (nth 1 date) (nth = 0 date) + (nth 2 date)))) + (org-agenda-schedule nil time)) (error nil))))))) =20 ((equal action ?f)