emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* patch: accept lazy filter in org-agenda-to-appt
@ 2011-10-23 19:45 Peter Münster
  2011-10-23 20:05 ` Peter Münster
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Münster @ 2011-10-23 19:45 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patch: accept lazy filter in org-agenda-to-appt
  2011-10-23 19:45 patch: accept lazy filter in org-agenda-to-appt Peter Münster
@ 2011-10-23 20:05 ` Peter Münster
  2011-10-24  5:51   ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Münster @ 2011-10-23 20:05 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

The following patch replaces the previous one:

--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 20:03:11 +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 (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)
--8<---------------cut here---------------end--------------->8---


Sorry for the noise...

-- 
           Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patch: accept lazy filter in org-agenda-to-appt
  2011-10-23 20:05 ` Peter Münster
@ 2011-10-24  5:51   ` Bastien
  0 siblings, 0 replies; 3+ messages in thread
From: Bastien @ 2011-10-24  5:51 UTC (permalink / raw)
  To: Peter Münster; +Cc: emacs-orgmode

Hi Peter,

pmlists@free.fr (Peter Münster) writes:

> The following patch replaces the previous one:

The patch is correct, thanks.

Could you send it using git format-patch, taking care of
adding a small ChangeLog for this?

Since it is a small change, please add TINYCHANGE at the
end of your commit message.

Please read http://orgmode.org/worg/org-contribute.html if
you have any question.

It makes things way easier for me!  Thanks a lot,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-24  5:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 19:45 patch: accept lazy filter in org-agenda-to-appt Peter Münster
2011-10-23 20:05 ` Peter Münster
2011-10-24  5:51   ` Bastien

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).