From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [patch] Problem with insert anniversary agenda function (was Re: org-bbdb-anniversaries gives error 'bad sexp') Date: Thu, 16 Jun 2011 14:41:51 +0200 Message-ID: References: <87wrht82iw.fsf@gmx.co.uk> <19919.63774.257976.613699@gargle.gargle.HOWL> <87k4drew8z.fsf@fastmail.fm> <87liy6vitg.fsf@fastmail.fm> <87mxhmfwqd.fsf@nzebook.haselwarter.org> <87lix529x6.fsf@fastmail.fm> <87boy14siq.fsf@nzebook.haselwarter.org> <87zklioqm9.fsf_-_@ucl.ac.uk> <87lix242ya.fsf_-_@ucl.ac.uk> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXCoe-0007CO-1t for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 09:41:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXCoX-0007je-15 for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 09:40:59 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:48815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXCoW-0007in-KK for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 09:40:52 -0400 Received: by ewy9 with SMTP id 9so635395ewy.0 for ; Thu, 16 Jun 2011 06:40:51 -0700 (PDT) In-Reply-To: <87lix242ya.fsf_-_@ucl.ac.uk> 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: Eric S Fraga Cc: emacs-orgmode@gnu.org On Jun 16, 2011, at 10:04 AM, Eric S Fraga wrote: > Eric S Fraga writes: > >> Carsten Dominik writes: >> >>> On Jun 13, 2011, at 6:15 PM, Philipp Haselwarter wrote: >>> >>>> thanks, got it working now (with some fiddling). >>>> >>>> looks like `calendar-date-style' is not honored /at all/, if you don't >>>> use YYYY-MM-DD format (as stated in the org-bbdb.el header, admittedly), >>>> it just blows up in your face :) >>> >>> While I think the org-bbdb code could be made more forgiving, >>> I strongly feel that calendar-date-style is an evil variable, >>> especially if it is applied to input. One should never rely on it. >>> >>> my 5c. >>> >>> - Carsten >> >> Although I am likely to agree with you on this, any interactions with >> Emacs's diary requires working with it. >> >> This reminds me of a problem with the insert anniversary function in the >> default agenda view ("i a"). This function ignores the >> calendar-date-style and inserts dates in the american style, which of >> course means that diary entries are quietly ignored if you have >> calendar-date-style set to anything other than 'american... >> >> Not a big deal... I don't use anniversaries *that* often! > > I've made a simple change (attached) to org-agenda.el which at least > considers the 'iso date style as well as european. Might not be fancy > lisp code but I think it works? > > > I know I should be formatting this appropriately etc but I'm still not > very comfortable with git... too much to do, so little time. sorry. Thanks for the patch! Indeed, there was a bug here which always forced one particular date style even though the code was supposed to do the right thing. Thanks! However, instead of applying your patch, I thought that maybe I should put my foot where my mouth is and remove these dependencies altogether. So I have just introduced a few functions org-anniversary, org-cyclic and a few more which are just like their diary-* cousins, but with a stable (ISO) order of arguments. Ahhhhh, I like this *much* better. `i a' in the agenda will now also use org-anniversary, not diary-anniversary. For users of org-diary-class, there is a new function org-class which works the same as org-diary-class, but with stable argument ordering. - Carsten