emacs-devel
[Top][All Lists]
Advanced

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

Re: Fix for Arithmetic Error while opening org-agenda


From: aaermolov
Subject: Re: Fix for Arithmetic Error while opening org-agenda
Date: Sat, 11 Mar 2017 22:11:16 +0300

Hi,

I think you'd better send this patch to the repective maillist, e.g.
address@hidden, for the fix to be applied properly in terms of
Org versions/etc.

regards,
Alex

Narendra Joshi <address@hidden> writes:

> Hi,
>
> While opening `org-agenda', I am getting an Arithmetic error if there
> are entries in an org file with timestamps of the form <... ++0d>, I
> have attached a patch for it. It would be great if someone can submit it
> on my behalf.
>
> diff --git a/lisp/org/org.el b/lisp/org/org.el
> index 02a7a0c..abb2269 100644
> --- a/lisp/org/org.el
> +++ b/lisp/org/org.el
> @@ -17250,11 +17250,11 @@ org-closest-date
>                    (- cday (1+ (floor (/ missing-hours 24)))))
>               n2 (+ cday (floor (/ (- dn missing-hours) 24))))))
>         ((eq dw 'day)
> -     (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn))))
> +     (setq n1 (+ sday (* dn (floor (if (= dn 0) 0 (/ (- cday sday) dn)))))
>             n2 (+ n1 dn)))
>         ((eq dw 'year)
>       (setq d (nth 1 start) m (car start) y1 (nth 2 start) y2 (nth 2 current))
> -     (setq y1 (+ (* (floor (/ (- y2 y1) dn)) dn) y1))
> +     (setq y1 (+ (* (floor (if (= dn 0) 0 (/ (- y2 y1) dn))) dn) y1))
>       (setq date1 (list m d y1)
>             n1 (calendar-absolute-from-gregorian date1)
>             date2 (list m d (+ y1 (* (if (< n1 cday) 1 -1) dn)))
>
>
> Thanks,
> -- 
> Narendra Joshi

Attachment: signature.asc
Description: PGP signature


reply via email to

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