From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Adding support for limits and exclusions to iCal recurring events Date: Wed, 24 Jul 2013 10:38:08 +0200 Message-ID: <87ip005p5b.fsf@gmail.com> References: <87ehbaxt33.fsf@toke.dk> <87d2qa6cnh.fsf@gmail.com> <87y58yprs6.fsf@toke.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1ua8-0003Sb-BA for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 04:38:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1ua5-0007BR-Ni for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 04:38:00 -0400 Received: from mail-we0-x234.google.com ([2a00:1450:400c:c03::234]:35404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1ua5-0007Av-DI for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 04:37:57 -0400 Received: by mail-we0-f180.google.com with SMTP id p59so4070178wes.25 for ; Wed, 24 Jul 2013 01:37:55 -0700 (PDT) In-Reply-To: <87y58yprs6.fsf@toke.dk> ("Toke \=\?utf-8\?Q\?H\=C3\=B8iland-J\?\= \=\?utf-8\?Q\?\=C3\=B8rgensen\=22's\?\= message of "Mon, 22 Jul 2013 16:56:25 +0200") 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: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Cc: emacs-orgmode@gnu.org Hello, Toke H=C3=B8iland-J=C3=B8rgensen writes: > Handling it in the agenda can be done by an exclusion function. I > currently have this in my org-agenda-skip-function-global (along with > another function to skip items after their END_DATE): > > (defun thj/skip-excluded () > "Skip agenda items on dates in EXCLUDE property" > (when (and (boundp 'date) date) > (let ((excluded-string (thj/get-property "EXCLUDE")) > exclusions) > (when excluded-string > (setq exclusions (mapcar > (lambda (ex-date-string) > (equal date (org-date-to-gregorian > (org-parse-time-string ex-date-= string)))) > (split-string excluded-string ","))) > (when (memq t exclusions) > (org-end-of-subtree t)))))) > > (Should probably be updated to use the org native property extraction > mechanism, but this predates my discovery of that). This is a separate issue anyway: it belongs to a new thread. IMO, it's an interesting feature to be able to stop a repeated event. >> On the other hand, I'm not sure about the END_DATE property. Couldn't >> DEADLINE be used for that matter? For example, `repeater-end-date' >> could be added to `org-icalendar-use-deadline' possible values. When >> this symbol belongs to variable's value and current entry has a >> deadline, any timestamps with a repeater get deadline's value as its >> END=C2=A0DATE property. >> >> What do you think? > > Sure, that would work. Two possible issues spring to mind: > > 1. Is there any use cases where someone might want a deadline (in its > current use) along with an end date? Or some other conflict? I would be great to have feedback from other iCalendar users about it. > 2. Will using the DEADLINE field make it harder to add exclusion from > the agenda? (I've never really used the deadline field, so don't know > what people normally use it for). I'm clearly no Agenda specialist. I thought a DEADLINE would end a repeated event already. If it's not the case, does it make sense to implement it too? >>> +(defun org-icalendar-zero-convert-timestamp (timestamp &optional forma= t) >>> + "Parse and format an org-formatted timestamp, zeroing the time compo= nent." >>> + (let ((time (org-parse-time-string timestamp)) >>> + (fmt (or format "%Y%m%dT%H%M%SZ"))) >>> + (format-time-string fmt (encode-time 0 0 0 (nth 3 time) (nth 4 tim= e) (nth 5 time))))) >> >> Can't `org-icalendar-convert-timestamp' be used instead? > > It could, conceivably. However, I couldn't find any functions that would > parse a property string into the timestamp format expected by > org-icalendar-convert-timestamp, I agree it's not obvious, but: (car (org-element-parse-secondary-string "<2013-07-24 Wed>" '(timestamp))) should do the job. You can set minutes and hours to 0 in the returned object, but it's not easier than creating a new function indeed. Regards, --=20 Nicolas Goaziou