From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org-agenda-filter-by-tag doesn't work with custom effort property Date: Wed, 25 Feb 2009 19:26:01 +0100 Message-ID: <812AB8C2-90A0-48B9-9ACE-AF5D08F06436@uva.nl> References: <877i3f6g5v.fsf@CPU107.opentrends.net> <87myca4e36.fsf@CPU107.opentrends.net> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LcOSN-00063K-Ue for emacs-orgmode@gnu.org; Wed, 25 Feb 2009 13:26:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LcOSM-000600-Cw for emacs-orgmode@gnu.org; Wed, 25 Feb 2009 13:26:07 -0500 Received: from [199.232.76.173] (port=40656 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LcOSM-0005zY-4j for emacs-orgmode@gnu.org; Wed, 25 Feb 2009 13:26:06 -0500 Received: from mail-fx0-f172.google.com ([209.85.220.172]:47669) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LcOSL-0005MQ-Nn for emacs-orgmode@gnu.org; Wed, 25 Feb 2009 13:26:05 -0500 Received: by fxm20 with SMTP id 20so112641fxm.42 for ; Wed, 25 Feb 2009 10:26:04 -0800 (PST) In-Reply-To: <87myca4e36.fsf@CPU107.opentrends.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Daniel Clemente Cc: emacs-orgmode@gnu.org On Feb 25, 2009, at 6:32 PM, Daniel Clemente wrote: > El dc, feb 25 2009, Carsten Dominik va escriure: >> On Feb 24, 2009, at 3:52 PM, Daniel Clemente wrote: >> >>> >>> Hi, I would like to contribute 1 byte to org-mode; it's an "a": >>> >>> >>> --- a/lisp/org-agenda.el >>> +++ b/lisp/org-agenda.el >>> @@ -4407,7 +4407,7 @@ to switch to narrowing." >>> (lambda (x) (if (cdr x) (char-to-string (cdr x)) = "")) >>> alist "")) >>> (efforts (org-split-string >>> - (or (cdr (assoc (concat org-effort-property "_ALL") >>> + (or (cadr (assoc (concat org-effort-property "_ALL") >>> org-global-properties)) >>> "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 = 8:00" >> >> I don't think this is correct. >> >> What are the symptoms of the problem you encounter? > > Before describing the problem: the (or ) was taking either the =20 > (cdr ) or "0 0:10=85". But cdr always return a list (not a string), so = =20 > if the cdr is used, the result will be a list, and this is wrong =20 > because it org-split-string expects a string, not a list. Hi Daniel, the cdr returns the cdr of a list. That is ofte a list, but it cal =20 also be an atom. For example: (cdr '(a . b)) =3D> a (cdr '(a b c d)) =3D> (b c d) The global property list is constructed like this '((key1 . value1) (key2 . value2)) so (cdr (assoc key1 list)) returns value1, a string. Maybe you have an incorrect definition of `org-global-properties'. I suspect that you did not make the value with customize, but by hand and that you wrote (setq org-global-properties '(("EFFORT_ALL "0 1:00...."))) It should be (setq org-global-properties '(("EFFORT_ALL . "0 1:00...."))) HTH - Carsten > > > The problem can be reproduced with: > 1. C-c a > 2. a > 3. / > > I get: > Debugger entered--Lisp error: (wrong-type-argument stringp ("0 0:10 =20= > 0:30 1:00 2:00 3:00 4:00 5:00 6:00 12:00 18:00 24:00 30:00")) > string-match("[ \f \n=85]+" ("0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 =20= > 6:00 12:00 18:00 24:00 30:00") 0) > org-split-string(("0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 12:00 =20= > 18:00 24:00 30:00")) > org-agenda-filter-by-tag(nil) > call-interactively(org-agenda-filter-by-tag nil nil) > > > > I'm using: > (add-to-list 'org-global-properties '("Effort_ALL" "0 0:10 0:30 1:00 =20= > 2:00 3:00 4:00 5:00 6:00 12:00 18:00 24:00 30:00")) > > org-mode 6.21b (from Emacs from Bazaar of 24-2-2009) > > > -- Daniel