* org-agenda-filter-by-tag doesn't work with custom effort property @ 2009-02-24 14:52 Daniel Clemente 2009-02-24 15:11 ` Daniel Clemente 2009-02-25 12:51 ` Carsten Dominik 0 siblings, 2 replies; 6+ messages in thread From: Daniel Clemente @ 2009-02-24 14:52 UTC (permalink / raw) To: emacs-orgmode 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" ""))) (effort-op org-agenda-filter-effort-default-operator) This solves the following stack trace: Debugger entered--Lisp error: (wrong-type-argument stringp ("0 0:10 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…]+" ("0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 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 18:00 24:00 30:00")) org-agenda-filter-by-tag(nil) call-interactively(org-agenda-filter-by-tag nil nil) Thanks, Daniel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: org-agenda-filter-by-tag doesn't work with custom effort property 2009-02-24 14:52 org-agenda-filter-by-tag doesn't work with custom effort property Daniel Clemente @ 2009-02-24 15:11 ` Daniel Clemente 2009-02-25 12:51 ` Carsten Dominik 1 sibling, 0 replies; 6+ messages in thread From: Daniel Clemente @ 2009-02-24 15:11 UTC (permalink / raw) To: emacs-orgmode Mmm... this also fails when editing the value of a property in column mode in agenda (C-c a a … C-c C-x C-c … e): Debugger entered--Lisp error: (wrong-type-argument stringp ("0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 12:00 18:00 24:00 30:00")) string-match("\\S-" ("0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 12:00 18:00 24:00 30:00")) org-property-get-allowed-values(#<marker at 120962 in proj.org> "Effort" table) org-columns-edit-value() call-interactively(org-columns-edit-value nil nil) But this is an old org-mode (6.12b) and it may have been corrected since then. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: org-agenda-filter-by-tag doesn't work with custom effort property 2009-02-24 14:52 org-agenda-filter-by-tag doesn't work with custom effort property Daniel Clemente 2009-02-24 15:11 ` Daniel Clemente @ 2009-02-25 12:51 ` Carsten Dominik 2009-02-25 17:32 ` Daniel Clemente 1 sibling, 1 reply; 6+ messages in thread From: Carsten Dominik @ 2009-02-25 12:51 UTC (permalink / raw) To: Daniel Clemente; +Cc: emacs-orgmode 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") I don't think this is correct. What are the symptoms of the problem you encounter? - Carsten > > org-global-properties)) > "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00" > ""))) > (effort-op org-agenda-filter-effort-default-operator) > > > This solves the following stack trace: > > > Debugger entered--Lisp error: (wrong-type-argument stringp ("0 0:10 > 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…]+" ("0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 > 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 > 18:00 24:00 30:00")) > org-agenda-filter-by-tag(nil) > call-interactively(org-agenda-filter-by-tag nil nil) > > > Thanks, > Daniel > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: org-agenda-filter-by-tag doesn't work with custom effort property 2009-02-25 12:51 ` Carsten Dominik @ 2009-02-25 17:32 ` Daniel Clemente 2009-02-25 18:26 ` Carsten Dominik 0 siblings, 1 reply; 6+ messages in thread From: Daniel Clemente @ 2009-02-25 17:32 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode 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 (cdr ) or "0 0:10…". But cdr always return a list (not a string), so if the cdr is used, the result will be a list, and this is wrong because it org-split-string expects a string, not a list. 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 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…]+" ("0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 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 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 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: org-agenda-filter-by-tag doesn't work with custom effort property 2009-02-25 17:32 ` Daniel Clemente @ 2009-02-25 18:26 ` Carsten Dominik 2009-02-26 12:03 ` Daniel Clemente 0 siblings, 1 reply; 6+ messages in thread From: Carsten Dominik @ 2009-02-25 18:26 UTC (permalink / raw) To: Daniel Clemente; +Cc: emacs-orgmode 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 > (cdr ) or "0 0:10…". But cdr always return a list (not a string), so > if the cdr is used, the result will be a list, and this is wrong > 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 also be an atom. For example: (cdr '(a . b)) => a (cdr '(a b c d)) => (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 > 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…]+" ("0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 > 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 > 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 > 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: org-agenda-filter-by-tag doesn't work with custom effort property 2009-02-25 18:26 ` Carsten Dominik @ 2009-02-26 12:03 ` Daniel Clemente 0 siblings, 0 replies; 6+ messages in thread From: Daniel Clemente @ 2009-02-26 12:03 UTC (permalink / raw) To: Carsten Dominik; +Cc: emacs-orgmode El dc, feb 25 2009, Carsten Dominik va escriure: > > the cdr returns the cdr of a list. That is ofte a list, but it cal also be an > atom. > > For example: > > (cdr '(a . b)) > > => a > Yes, you're right; I forgot the theory about conses. '(a b) is this: --------- --------- | a | X-+--> | b | X-+--> nil --------- --------- '(a . b) is this: --------- | a | X-+--> b --------- The problem was that I read in org-global-properties' documentation: > List of property/value pairs that can be inherited by any entry. And I thought that „pairs“ would be '(key value). Maybe it can be precised (like in other documentations): The entries in this list are cons cells where the car is a property name and cdr is a string with all possible values separated by spaces. Thanks, Daniel ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-02-26 12:04 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-02-24 14:52 org-agenda-filter-by-tag doesn't work with custom effort property Daniel Clemente 2009-02-24 15:11 ` Daniel Clemente 2009-02-25 12:51 ` Carsten Dominik 2009-02-25 17:32 ` Daniel Clemente 2009-02-25 18:26 ` Carsten Dominik 2009-02-26 12:03 ` Daniel Clemente
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).