emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: pmlists@free.fr (Peter Münster)
To: emacs-orgmode@gnu.org
Subject: [PATCH] Agenda: Allow filter list without category in org-agenda-to-appt
Date: Mon, 24 Oct 2011 21:09:38 +0200	[thread overview]
Message-ID: <87hb2yb40d.fsf@micropit.couberia.bzh> (raw)

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?= <pmrb@free.fr>
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

             reply	other threads:[~2011-10-24 19:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 19:09 Peter Münster [this message]
2011-10-24 21:51 ` [PATCH] Agenda: Allow filter list without category in org-agenda-to-appt Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hb2yb40d.fsf@micropit.couberia.bzh \
    --to=pmlists@free.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).