From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Roberts Subject: [PATCH] org-mac-ical: Include repeating events in diary file Date: Sat, 30 Jul 2011 11:36:19 -0500 Message-ID: <85D38C62-CE6A-497C-861A-06050EFD0609@refactory.com> Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: multipart/mixed; boundary="Apple-Mail=_98A30915-52EB-4DFA-AC5F-B6EB87590E15" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnCWX-0003rE-67 for emacs-orgmode@gnu.org; Sat, 30 Jul 2011 12:36:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QnCWW-0007Oi-9X for emacs-orgmode@gnu.org; Sat, 30 Jul 2011 12:36:25 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:58842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QnCWW-0007Oa-2N for emacs-orgmode@gnu.org; Sat, 30 Jul 2011 12:36:24 -0400 Received: by iyb14 with SMTP id 14so6531524iyb.0 for ; Sat, 30 Jul 2011 09:36:22 -0700 (PDT) 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: emacs-orgmode@gnu.org --Apple-Mail=_98A30915-52EB-4DFA-AC5F-B6EB87590E15 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii This patch fixes two bugs. The original code always included events in = December of the previous year and January of the next year regardless of = the month range. This fixes that. Also, the original code didn't keep = repeating events that started outside of the month range. The new code = keeps all repeating events. Don Roberts --Apple-Mail=_98A30915-52EB-4DFA-AC5F-B6EB87590E15 Content-Disposition: attachment; filename=0001-org-mac-ical-Clean-up-org-mac-iCal-range-checking-to.patch Content-Type: application/octet-stream; name="0001-org-mac-ical-Clean-up-org-mac-iCal-range-checking-to.patch" Content-Transfer-Encoding: quoted-printable =46rom=205f1c8e1ab67c929eccdf9c3fb9e8b4d33900bdec=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Don=20Roberts=20=0A= Date:=20Sat,=2030=20Jul=202011=2009:20:09=20-0500=0ASubject:=20[PATCH]=20= org-mac-ical:=20Clean=20up=20org-mac-iCal-range=20checking=20to=0A=20= eliminate=20end-of-year=20special=20cases=20and=20include=20repeating=0A=20= events=20in=20diary=20file=0A=0A---=0A=20contrib/lisp/org-mac-iCal.el=20= |=20=20=2028=20+++++++++++++++-------------=0A=201=20files=20changed,=20= 15=20insertions(+),=2013=20deletions(-)=0A=0Adiff=20--git=20= a/contrib/lisp/org-mac-iCal.el=20b/contrib/lisp/org-mac-iCal.el=0Aindex=20= 83804c1..ee1c073=20100644=0A---=20a/contrib/lisp/org-mac-iCal.el=0A+++=20= b/contrib/lisp/org-mac-iCal.el=0A@@=20-162,23=20+162,25=20@@=20date=20= range=20so=20that=20Emacs=20calendar=20view=20doesn't=20grind=20to=20a=20= halt"=0A=20=09(re-search-forward=20= "\\(^DTSTART;.*:\\)\\([0-9][0-9][0-9][0-9]\\)\\([0-9][0-9]\\)"=20nil=20= t)=0A=20=09(if=20(or=20(eq=20(match-string=202)=20nil)=20(eq=20= (match-string=203)=20nil))=0A=20=09=20=20=20=20(progn=0A-=09=20=20=20=20=20= =20(setq=20yearEntry=200)=0A-=09=20=20=20=20=20=20(setq=20monthEntry=20= 0))=0A+=09=20=20=20=20=20=20(setq=20yearEntry=201)=0A+=09=20=20=20=20=20=20= (setq=20monthEntry=201))=0A=20=09=20=20(setq=20yearEntry=20= (string-to-number=20(match-string=202)))=0A=20=09=20=20(setq=20= monthEntry=20(string-to-number=20(match-string=203))))=0A=20=09(setq=20= year=20(string-to-number=20(format-time-string=20"%Y")))=0A=20=09(setq=20= month=20(string-to-number=20(format-time-string=20"%m")))=0A-=09(when=20= (or=0A-=09=20=20=20=20=20=20=20(and=0A-=09=09(=3D=20yearEntry=20year)=0A= -=09=09(or=20(<=20monthEntry=20(-=20month=20(/=20org-mac-iCal-range=20= 2)))=20(>=20monthEntry=20(+=20month=20(/=20org-mac-iCal-range=202)))))=0A= -=09=20=20=20=20=20=20=20(<=20yearEntry=20(-=20year=201))=0A-=09=20=20=20= =20=20=20=20(>=20yearEntry=20(+=20year=201))=0A-=09=20=20=20=20=20=20=20= (and=0A-=09=09(=3D=20yearEntry=20(-=20year=201))=20(/=3D=20monthEntry=20= 12))=0A-=09=20=20=20=20=20=20=20(and=0A-=09=09(=3D=20yearEntry=20(+=20= year=201))=20(/=3D=20monthEntry=201)))=0A-=09=20=20(delete-region=20= startEntry=20endEntry))))=0A+=20=20=20=20=20=20=20=20(setq=20now=20(list=20= month=201=20year))=0A+=20=20=20=20=20=20=20=20(setq=20entryDate=20(list=20= monthEntry=201=20yearEntry))=0A+=20=20=20=20=20=20=20=20;;=20Check=20to=20= see=20if=20this=20is=20a=20repeating=20event=0A+=20=20=20=20=20=20=20=20= (goto-char=20(point-min))=0A+=20=20=20=20=20=20=20=20(setq=20isRepeating=20= (re-search-forward=20"^RRULE:"=20nil=20t))=0A+=09;;=20Delete=20if=20= outside=20range=20and=20not=20repeating=0A+=20=20=20=20=20=20=20=20(when=20= (and=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20isRepeating)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(>=20(abs=20(-=20= (calendar-absolute-from-gregorian=20now)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (calendar-absolute-from-gregorian=20entryDate)))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(*=20(/=20org-mac-iCal-range=202)=20= 30))=0A+=09=20=20(delete-region=20startEntry=20endEntry)))=0A+=20=20=20=20= =20=20=20=20=20=20(goto-char=20(point-max))))=0A=20=20=20=20=20(while=20=0A= =20=09(re-search-forward=20"^END:VEVENT$"=20nil=20t)=0A=20=20=20=20=20=20= =20(delete-blank-lines))=0A--=20=0A1.7.6=0A=0A= --Apple-Mail=_98A30915-52EB-4DFA-AC5F-B6EB87590E15--