From mboxrd@z Thu Jan 1 00:00:00 1970 From: pmlists@free.fr (Peter =?utf-8?Q?M=C3=BCnster?=) Subject: patch: accept lazy filter in org-agenda-to-appt Date: Sun, 23 Oct 2011 21:45:06 +0200 Message-ID: <87pqhna3wd.fsf@micropit.couberia.bzh> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RI3z0-0002KY-5b for emacs-orgmode@gnu.org; Sun, 23 Oct 2011 15:45:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RI3yz-0002NJ-8v for emacs-orgmode@gnu.org; Sun, 23 Oct 2011 15:45:22 -0400 Received: from lo.gmane.org ([80.91.229.12]:60396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RI3yz-0002ND-2s for emacs-orgmode@gnu.org; Sun, 23 Oct 2011 15:45:21 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RI3yx-0000dY-1l for emacs-orgmode@gnu.org; Sun, 23 Oct 2011 21:45:19 +0200 Received: from arennes-359-1-251-199.w2-2.abo.wanadoo.fr ([2.2.202.199]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 Oct 2011 21:45:19 +0200 Received: from pmlists by arennes-359-1-251-199.w2-2.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 Oct 2011 21:45:19 +0200 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: emacs-orgmode@gnu.org Hello, I use `org-agenda-to-appt' this way: --8<---------------cut here---------------start------------->8--- (org-agenda-to-appt t '((headline "TODO"))) --8<---------------cut here---------------end--------------->8--- But this works only with the following patch: --8<---------------cut here---------------start------------->8--- === modified file 'lisp/org/org-agenda.el' --- lisp/org/org-agenda.el 2011-09-02 16:38:40 +0000 +++ lisp/org/org-agenda.el 2011-10-23 19:43:51 +0000 @@ -8415,10 +8415,12 @@ (ok (or (null filter) (and (stringp filter) (string-match filter evt)) (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 (or (eq cat-filter nil) + (string-match cat-filter cat)) + (or (eq evt-filter nil) + (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) --8<---------------cut here---------------end--------------->8--- -- Peter