[Remind-Fans] Several questions from a newbie

Eugene static-const at ya.ru
Mon May 17 01:15:43 EDT 2010


В Sun, 16 May 2010 21:43:36 -0400
Ben Love <blove+remind at kylimar.com> пишет:

> * Eugene wrote on [2010-05-14 22:52:35 +0400]:
> > Hi.
> > 
> > I'm trying to figure out whether Remind can satisfy my needs. There
> > are basically three questions. For each of those, I'd like to know
> > whether a solution exists and what it is (which keywords/clauses I
> > must use etc.).
> > 
> > 1. For each periodic and non-periodic event, I'd like to specify
> > number of days N so that the software reminds me about the event N
> > days before it occurs.
> > 
> > 2. For each periodic event, I'd like to mark it as DONE (probably
> > specifying the date D) so that Remind won't remind me about the
> > dates when event occurs and which are <= D.
> > 
> > 3. I'd like the software to continue reminding me about each
> > periodic and non-periodic event which occured in the past but
> > wasn't marked as DONE. 
> > 
> > I believe that Remind is capable to solve 1 and 2, but I doubt about
> > the last one. Please help me if you can.
> 
> I believe the first case is simply solved with a +N modifier on the
> date.  However, 2 and 3 are a lot more complicated.  I've actually
> desired the same behaviour, but I couldn't figure out how to do it
> with pure remind.  So, here are the perl scripts that I use to make it
> happen:
> 
> <...>
> 
> This is a sample .todo file.  It should be generated and updated
> directly by the perl scripts.  I'm providing it for reference.
> ########################## .todo
> # ^\s*# lines are ignored.
> # ^\s*$ lines are ignored.
> # FORMAT: (whitespace before/after ignored; whitespace separated)
> # ID TYPE DATE
> # where:
> # ID - case sensitive unique identifer for event (\w+)
> # TYPE - (case insensitive)
> #     "DONE" (for last done date)
> #     "SNOOZE" (for snooze until date)
> # DATE - a date in YYYY-MM-DD format.
> Sample DONE 2008-11-01
> sample2 DONE 2009-02-06
> ########################## .todo
> 
> And here's the last bit of magic that makes it all work.  These are
> the remind scripts that call out to perl and do all the checking.  I
> usually keep this stuff in a separate file and include it in the
> appropriate places.
> 
> ########################## .reminders.todo
> ; Create a todo list
> 
> ;;;;; HELPER FUNCTIONS
> ; returns a INT (number of days behind or ahead of due date)
> FSET _due(y,m,d) (date(y,m,d)-today())
> FSET _duedt(dt) (dt-today())
> 
> ; these both return DATEs (i.e. the next DATE to be reminded for)
> FSET _todo_yearly(id,m,d) coerce("DATE", shell("~/bin/remind.check "
> + id + " yearly " + m + " " + d)) FSET _todo_once(id,y,m,d)
> coerce("DATE", shell("~/bin/remind.check " + id + " once " + y + " "
> + m + " " + d)) ; these both return DATEs (i.e. the "due" DATE of the
> next reminder) ; due_m, due_y, orig_todo_m, orig_todo_d FSET
> _due_yearly(id,m,d,m2,d2) coerce("DATE", shell("~/bin/remind.due " +
> id + " yearly " + m + " " + d + " " + m2 + " " + d2)) FSET
> _due_once(id,y,m,d) coerce("DATE", shell("~/bin/remind.due " + id + "
> once " + y + " " + m + " " + d))
> 
> ; TODO: due date doesn't work if prev DONE occurred between REMIND
> and DUE dates. ; due date DOES work if prev DONE is on or after prev
> DUE date.
> 
> ;;;;;;;;;TODOs
> 
> ; Sample ToDo
> ; Don't forget variable names only have 12 significant characters!
> if ! defined("td_sample")
> 	SET td_sample _todo_yearly("Sample",10,01)
> 	SET dd_sample _due_yearly("Sample",12,01,10,01)
> 	preserve td_sample dd_sample
> endif
> REM [trigger(td_sample)] MSG Sample reminder due on 1 Dec.  Starts
> reminding on 1 Oct.  ([_duedt(dd_sample)]
> day[plural(_duedt(dd_sample))] remaining) (Sample) I always output
> the "name" that needs to be passed into the perl scripts.
> 
> ; Sample2
> if ! defined("td_sample2")
> 	SET td_sample2 _todo_yearly("sample2",02,01)
> 	preserve td_sample2
> endif
> REM [trigger(td_sample2)] MSG Simple reminder, but supports marking
> as done and snoozing. (sample2)
> ########################## .reminders.todo
> 
> Of course, the reminders themselves look very nasty.  That's quite a
> lot of code for every reminder to be added.  I've started writing a
> simple generator for them, but I haven't gotten that far yet.
> 
> These scripts are what I currently use, so they should work.  But
> they'll probably require a little customization for your situation
> (e.g. file names and locations).
> 
> If anyone has a better/simpler way to accomplish this, I'd love to
> hear about it.
> 
> Ben
> 

Wow, thanks. I'll look into your solution.

Best regards,
Eugene.



More information about the Remind-fans mailing list