diff options
author | Peter Münster <pmrb@free.fr> | 2011-10-24 20:52:45 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-10-24 23:43:58 +0200 |
commit | 68ffb7a7cc8cd99a49cf69491edba85988f8229c (patch) | |
tree | e9a36d6cd5a041195910848391b6d73586660512 | |
parent | 614c15744cde791bfe5dbed3f2b7d2c43ffbd330 (diff) | |
download | org-mode-68ffb7a7.tar.gz |
Agenda: Allow filter list without category in org-agenda-to-appt
* lisp/org-agenda.el (org-agenda-to-appt): Make sure filter-items are
strings before calling `string-match'.
Now it's possible to use (org-agenda-to-appt t '((headline "string"))).
TINYCHANGE
-rw-r--r-- | lisp/org-agenda.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 24ead18..0b4c07b 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8489,10 +8489,12 @@ details and examples." (and (stringp filter) (string-match filter evt)) (and (functionp filter) (funcall filter x)) (and (listp filter) - (or (string-match - (cadr (assoc 'category filter)) cat) - (string-match - (cadr (assoc 'headline filter)) evt)))))) + (let ((cat-filter (cadr (assoc 'category filter))) + (evt-filter (cadr (assoc 'headline filter)))) + (or (and (stringp cat-filter) + (string-match cat-filter cat)) + (and (stringp evt-filter) + (string-match evt-filter evt)))))))) ;; FIXME: Shall we remove text-properties for the appt text? ;; (setq evt (set-text-properties 0 (length evt) nil evt)) (when (and ok tod) |