From mboxrd@z Thu Jan 1 00:00:00 1970 From: pmlists@free.fr (Peter =?utf-8?Q?M=C3=BCnster?=) Subject: [PATCH] Agenda: Allow filter list without category in org-agenda-to-appt Date: Mon, 24 Oct 2011 21:09:38 +0200 Message-ID: <87hb2yb40d.fsf@micropit.couberia.bzh> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIPuF-0006MF-KN for emacs-orgmode@gnu.org; Mon, 24 Oct 2011 15:09:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIPuE-0004uZ-BD for emacs-orgmode@gnu.org; Mon, 24 Oct 2011 15:09:55 -0400 Received: from lo.gmane.org ([80.91.229.12]:33735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIPuE-0004uT-0c for emacs-orgmode@gnu.org; Mon, 24 Oct 2011 15:09:54 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RIPuC-00089z-Ni for emacs-orgmode@gnu.org; Mon, 24 Oct 2011 21:09:52 +0200 Received: from arennes-359-1-280-111.w2-13.abo.wanadoo.fr ([2.13.47.111]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Oct 2011 21:09:52 +0200 Received: from pmlists by arennes-359-1-280-111.w2-13.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Oct 2011 21:09:52 +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, Here the output of "git format-patch master". I hope it's correct, it was my first git-commit... --8<---------------cut here---------------start------------->8--- >From 82da273bb0884347762e883786b334302ad3f0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCnster?= Date: Mon, 24 Oct 2011 20:52:45 +0200 Subject: [PATCH] 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 --- 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) -- 1.7.3.4 --8<---------------cut here---------------end--------------->8--- -- Peter