From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: [patch] Problem with insert anniversary agenda function (was Re: org-bbdb-anniversaries gives error 'bad sexp') Date: Thu, 16 Jun 2011 09:04:29 +0100 Message-ID: <87lix242ya.fsf_-_@ucl.ac.uk> 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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QX859-0006GX-0O for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 04:37:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QX853-0001aO-S5 for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 04:37:42 -0400 Received: from vscani-b2.ucl.ac.uk ([144.82.108.135]:44209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QX853-0001Yy-3S for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 04:37:37 -0400 In-Reply-To: <87zklioqm9.fsf_-_@ucl.ac.uk> (Eric S. Fraga's message of "Wed, 15 Jun 2011 20:13:02 +0100") 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: Carsten Dominik Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=org-agenda-consider-iso-dates.patch Content-Description: have insert anniversary in agenda view allow for ISO calendar dates diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 991a94a..0d074a7 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -7770,11 +7770,12 @@ the resulting entry will not be shown. When TEXT is empty, switch to (insert "\n") (require 'diary-lib) (let ((calendar-date-display-form - (if (if (boundp 'calendar-date-style) - (eq calendar-date-style 'european) - (with-no-warnings ;; european-calendar-style is obsolete as of version 23.1 - (org-bound-and-true-p european-calendar-style))) ; Emacs 22 - '(day " " month " " year) + (if (boundp 'calendar-date-style) + (if (eq calendar-date-style 'european) + '(day " " month " " year) + (if (eq calendar-date-style 'iso) + '(year " " month " " day) + '(month " " day " " year))) '(month " " day " " year)))) (insert (format "%%%%(diary-anniversary %s) %s" --=-=-= Content-Type: text/plain 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. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.399.g01eb.dirty) --=-=-=--