emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-agenda: allow to negate skip conditions
@ 2010-12-14 17:16 Julien Danjou
  2010-12-14 17:18 ` Julien Danjou
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Danjou @ 2010-12-14 17:16 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Julien Danjou

* org-agenda.el (org-agenda-skip-if): Allow to negate conditions.

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 lisp/org-agenda.el |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index f476449..537a421 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4076,7 +4076,12 @@ See `org-agenda-skip-if' for details."
 See `org-agenda-skip-if' for details."
   (org-agenda-skip-if t conditions))
 
-(defun org-agenda-skip-if (subtree conditions)
+(defun org-agenda-skip-if-not (subtree conditions)
+  "Skip entry if none of CONDITIONS is false.
+See `org-agenda-skip-if' for details."
+  (org-agenda-skip-if subtree conditions t))
+
+(defun org-agenda-skip-if (subtree conditions &optional not)
   "Checks current entity for CONDITIONS.
 If SUBTREE is non-nil, the entire subtree is checked.  Otherwise, only
 the entry, i.e. the text before the next heading is checked.
@@ -4112,17 +4117,21 @@ Instead of a list a keyword class may be given
 would skip entries that haven't been marked with any of \"DONE\"
 keywords. Possible classes are: `todo', `done', `any'.
 
-If any of these conditions is met, this function returns the end point of
-the entity, causing the search to continue from there.  This is a function
-that can be put into `org-agenda-skip-function' for the duration of a command."
-  (let (beg end m)
-    (org-back-to-heading t)
-    (setq beg (point)
-	  end (if subtree
-		  (progn (org-end-of-subtree t) (point))
-		(progn (outline-next-heading) (1- (point)))))
-    (goto-char beg)
-    (and
+If any of these conditions is met, this function returns the end
+point of the entity, causing the search to continue from there.
+
+If NOT is set to t, then this function returns the end point of
+the entity only if none of the condition is met, causing the
+search to continue from there.
+
+This is a function that can be put into
+`org-agenda-skip-function' for the duration of a command."
+  (org-back-to-heading t)
+  (let ((beg (point))
+	(end (if subtree
+		 (save-excursion (org-end-of-subtree t))
+	       (save-excursion (outline-next-heading) (1- (point))))))
+    ((if not 'or 'and)
      (or
       (and (memq 'scheduled conditions)
 	   (re-search-forward org-scheduled-time-regexp end t))
-- 
1.7.2.3

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

* Re: [PATCH] org-agenda: allow to negate skip conditions
  2010-12-14 17:16 [PATCH] org-agenda: allow to negate skip conditions Julien Danjou
@ 2010-12-14 17:18 ` Julien Danjou
  2010-12-15 10:55   ` REJECT patches (was: Re: [PATCH] org-agenda: allow to negate skip conditions ) Giovanni Ridolfi
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Danjou @ 2010-12-14 17:18 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 221 bytes --]

On Tue, Dec 14 2010, Julien Danjou wrote:

> * org-agenda.el (org-agenda-skip-if): Allow to negate conditions.

This was not meant to be sent as it is. Forget it.

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* REJECT patches (was: Re: [PATCH] org-agenda: allow to negate skip conditions )
  2010-12-14 17:18 ` Julien Danjou
@ 2010-12-15 10:55   ` Giovanni Ridolfi
  2010-12-15 11:13     ` Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Giovanni Ridolfi @ 2010-12-15 10:55 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: David Maus, Dan Davison, John Wiegley


Please, reject the following patches:

Julien Danjou <julien@danjou.info> writes:

> On Tue, Dec 14 2010, Julien Danjou wrote:
>
>> * org-agenda.el (org-agenda-skip-if): Allow to negate conditions.
>
> This was not meant to be sent as it is. Forget it.

1. see above

http://patchwork.newartisans.com/patch/482/

2. my "stupid patch" to add (debug) calls to org-capture.el
   to help in fixing the :PROPERTIES: bug[1]

http://patchwork.newartisans.com/patch/477/


cheers,
Giovanni

[1]
http://lists.gnu.org/archive/html/emacs-orgmode/2010-12/msg00690.html

by the way, perhaps the bug will be fixed if the path[2] by Julien is applied.

[2] http://patchwork.newartisans.com/patch/478/

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

* Re: REJECT patches (was: Re: [PATCH] org-agenda: allow to negate skip conditions )
  2010-12-15 10:55   ` REJECT patches (was: Re: [PATCH] org-agenda: allow to negate skip conditions ) Giovanni Ridolfi
@ 2010-12-15 11:13     ` Carsten Dominik
  0 siblings, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2010-12-15 11:13 UTC (permalink / raw)
  To: Giovanni Ridolfi; +Cc: David Maus, emacs-orgmode, Dan Davison, John Wiegley


On Dec 15, 2010, at 11:55 AM, Giovanni Ridolfi wrote:

>
> Please, reject the following patches:

Done.

- Carsten

>
> Julien Danjou <julien@danjou.info> writes:
>
>> On Tue, Dec 14 2010, Julien Danjou wrote:
>>
>>> * org-agenda.el (org-agenda-skip-if): Allow to negate conditions.
>>
>> This was not meant to be sent as it is. Forget it.
>
> 1. see above
>
> http://patchwork.newartisans.com/patch/482/
>
> 2. my "stupid patch" to add (debug) calls to org-capture.el
>   to help in fixing the :PROPERTIES: bug[1]
>
> http://patchwork.newartisans.com/patch/477/
>
>
> cheers,
> Giovanni
>
> [1]
> http://lists.gnu.org/archive/html/emacs-orgmode/2010-12/msg00690.html
>
> by the way, perhaps the bug will be fixed if the path[2] by Julien  
> is applied.
>
> [2] http://patchwork.newartisans.com/patch/478/
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2010-12-15 11:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-14 17:16 [PATCH] org-agenda: allow to negate skip conditions Julien Danjou
2010-12-14 17:18 ` Julien Danjou
2010-12-15 10:55   ` REJECT patches (was: Re: [PATCH] org-agenda: allow to negate skip conditions ) Giovanni Ridolfi
2010-12-15 11:13     ` Carsten Dominik

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