From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: aaermolov@gmail.com Newsgroups: gmane.emacs.devel Subject: Re: Fix for Arithmetic Error while opening org-agenda Date: Sat, 11 Mar 2017 22:11:16 +0300 Message-ID: <87zigrr5m3.fsf@laptoptop> References: <87r325yry0.fsf@vicarie> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1489259558 29244 195.159.176.226 (11 Mar 2017 19:12:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2017 19:12:38 +0000 (UTC) To: Narendra Joshi , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 11 20:12:34 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmmRN-0006mx-Gg for ged-emacs-devel@m.gmane.org; Sat, 11 Mar 2017 20:12:33 +0100 Original-Received: from localhost ([::1]:44455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmmRQ-00024F-9F for ged-emacs-devel@m.gmane.org; Sat, 11 Mar 2017 14:12:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmmQV-0001fO-GP for emacs-devel@gnu.org; Sat, 11 Mar 2017 14:11:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmmQR-0000o9-AZ for emacs-devel@gnu.org; Sat, 11 Mar 2017 14:11:39 -0500 Original-Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:34676) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmmQR-0000kr-3b for emacs-devel@gnu.org; Sat, 11 Mar 2017 14:11:35 -0500 Original-Received: by mail-lf0-x244.google.com with SMTP id y193so9094505lfd.1 for ; Sat, 11 Mar 2017 11:11:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=w0RK5MYRolDrLKZKUqtJUkM0h0k4giIQltb2RqkEe1Y=; b=HzKMZ/KNXgRjuHwahZbrme7uDfhXOSxABVDFBcAq7wotEK7wXrLr5CyaS749I0k53T FaJdHTItz6iUcKGwNZt5pdW5bYQlcVlyR2nE9dz+1Zug/DMOL3CNzAcAFnDTSGbeZbzS 4eBce+8WFQKdrrXzTR3k5OfXSPB/pyC5E7bblkdb+cPTPioYvQlJ1G/dlBTW4jy3y2Sr jIa4Xwv2tfwXh5xTo9WyQeco5wr5vOOTtqrdidiM89o+kkrpFRxdUYgtaIfrK+OzGIYG S/U4CVzmnyCmUZyr/pVECUf4tBkme7XWVuKQcPdIKBofxqMQ0rds3IcJ8HfJOfzYlBfg KRwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=w0RK5MYRolDrLKZKUqtJUkM0h0k4giIQltb2RqkEe1Y=; b=IjGjlihQnTZPNw/tH22fd8q1OzVZ1XpZjhL9dQ50EIooJHrPkNuYDsbq2LMzr57zHk z9iiy53C07SuhzOzkCK0CesWVtWg24uxXigaWSO1K/Khi12X//0f2eK9lAUyl0JB+ugq hoJFeL7Xso3WEJguHYZjuI9E6t1uL1vNBWsv56vo7wzhMbzZ1PnVPy9ZXtjX7JX5Sl5k +vkEXbelwRNmaFOhs552dDK1OyCDarSJ/7WVh8GAAkt8hdY0IDoWOSyWj4xRPgsoIRVP 6IZ9qwJwM69gLvnDxJUtUWd+Wnk5LK6Hvlqw9VZNjR+zzpFRPyUZIZ7n+vHy6/vCjIVf /10g== X-Gm-Message-State: AMke39k2AUOTQNx/5a5QIIXCYuongCvzipS4slWHycRgGpiWhtkdoZrI8goqno8tuo8+tw== X-Received: by 10.25.80.86 with SMTP id z22mr5776511lfj.157.1489259492472; Sat, 11 Mar 2017 11:11:32 -0800 (PST) Original-Received: from localhost (ppp109-252-44-18.pppoe.spdop.ru. [109.252.44.18]) by smtp.gmail.com with ESMTPSA id z26sm2625088lja.61.2017.03.11.11.11.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Mar 2017 11:11:31 -0800 (PST) In-Reply-To: <87r325yry0.fsf@vicarie> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::244 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212916 Archived-At: --=-=-= Content-Type: text/plain Hi, I think you'd better send this patch to the repective maillist, e.g. emacs-orgmode@gnu.org, for the fix to be applied properly in terms of Org versions/etc. regards, Alex Narendra Joshi 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEB3ti1VTUGbnAlLnVmGVYjLx0AQMFAljES9QACgkQmGVYjLx0 AQP/gwgAvvUrFSmFl1kLfu+Ex19MnF1K6TEFfmgTBrSAsdBOAoI33K1pWsyfPZVU SV/fH92RpYpNup635JE2QS0ov5AJAx7SDKyIhKWdObmuAWkYh5MgbrZgOmf+m7WQ GWuh5Y70XVNil1tbGGCHu6jOmHAiLMRwmiq6sHzMkf3eFjeYmVip4TodlVIHKi8H UICBMHTLFF9e1dMR6YN1GJCXO3RYIaqWnjctvIbE5Bqa/FrfNV8Lyu61HBE6G733 8iWXLWry5BHVedbPVjg5CNGqZbc/Hhbnmk2vc2TFbQpnZttnS22w2hHvG9abURPY N8ohyx3HYIbLnW6FMu9Twdo1eRhALw== =3iR8 -----END PGP SIGNATURE----- --=-=-=--