Re: [O] Standard skipping conditions have no effect

2014-06-02 Thread Bastien
Hi Thomas,

Thomas Morgan  writes:

> This works for me -- thanks!

Applied, thanks, I'll keep an eye on the other problems I found.

-- 
 Bastien



Re: [O] Standard skipping conditions have no effect

2014-06-02 Thread Thomas Morgan
Hi, Bastien, 

This works for me -- thanks!

Best,

Thomas



Re: [O] Standard skipping conditions have no effect

2014-06-02 Thread Bastien
Hi Thomas,

thanks for this bug report.

Can you try the attached patch and report if it works for you?

There are still some glitches with the customization types I want
to check before applying the patch.

Thanks in advance,

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 84b75a9..2833fca 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -390,32 +390,36 @@ the daily/weekly agenda, see `org-agenda-skip-function'.")
 			   (repeat :inline t :tag "Conditions for skipping"
    (choice
 :tag "Condition type"
-(list :tag "Regexp matches" :inline t (const :format "" regexp) (regexp))
-(list :tag "Regexp does not match" :inline t (const :format "" notregexp) (regexp))
+(list :tag "Regexp matches" :inline t
+	  (const :format "" 'regexp)
+	  (regexp))
+(list :tag "Regexp does not match" :inline t
+	  (const :format "" 'notregexp)
+	  (regexp))
 (list :tag "TODO state is" :inline t
-	  (const todo)
+	  (const 'todo)
 	  (choice
-	   (const :tag "any not-done state" todo)
-	   (const :tag "any done state" done)
-	   (const :tag "any state" any)
+	   (const :tag "Any not-done state" 'todo)
+	   (const :tag "Any done state" 'done)
+	   (const :tag "Any state" 'any)
 	   (list :tag "Keyword list"
 		 (const :format "" quote)
 		 (repeat (string :tag "Keyword")
 (list :tag "TODO state is not" :inline t
-	  (const nottodo)
+	  (const 'nottodo)
 	  (choice
-	   (const :tag "any not-done state" todo)
-	   (const :tag "any done state" done)
-	   (const :tag "any state" any)
+	   (const :tag "Any not-done state" 'todo)
+	   (const :tag "Any done state" 'done)
+	   (const :tag "Any state" 'any)
 	   (list :tag "Keyword list"
 		 (const :format "" quote)
 		 (repeat (string :tag "Keyword")
-(const :tag "scheduled" scheduled)
-(const :tag "not scheduled" notscheduled)
-(const :tag "deadline" deadline)
-(const :tag "no deadline" notdeadline)
-(const :tag "timestamp" timestamp)
-(const :tag "no timestamp" nottimestamp))
+(const :tag "scheduled" 'scheduled)
+(const :tag "not scheduled" 'notscheduled)
+(const :tag "deadline" 'deadline)
+(const :tag "no deadline" 'notdeadline)
+(const :tag "timestamp" 'timestamp)
+(const :tag "no timestamp" 'nottimestamp))
 		   (list :tag "Non-standard skipping condition"
 			 :value (org-agenda-skip-function)
 			 (const org-agenda-skip-function)

-- 
 Bastien


[O] Standard skipping conditions have no effect

2014-06-01 Thread Thomas Morgan
Hello, Org mode hackers,

Here is a recipe for a bug on the maint branch that causes standard
skipping conditions to have no effect.

1. Change the load path setting in `setup.el'.

2. Start Emacs with `emacs -Q -l setup.el'.

3. Customize the agenda commands with `M-x org-agenda C'.

4. Add a new command, change the match field to tag `foo', and add a
   standard skipping condition for TODO states, so that the command
   looks like this in the customization buffer:

   ,
   | INS DEL Choice: Value Menu Single command:
   | Access Key(s) : x
   | [X] Description: Describe command here
   | Choice: Value Menu Tags/Property match (all agenda files)
   | Match (only for some commands): foo
   | Local settings for this command.  Remember to quote values:
   | INS DEL Setting: Value Menu Standard skipping condition:
   | org-agenda-skip-function
   | List:
   | List:
   | Skipping range: Value Menu Skip entry
   | Conditions for skipping:
   | INS DEL Condition type: Value Menu TODO state is:
   | todo
   | Choice: Value Menu any not-done state
   | INS
   | INS
   | [ ] Export:
   | INS
   `

5. Type `M-x org-agenda x'.  The resulting agenda view looks like this:

   ,
   | Headlines with TAGS match: foo
   | Press `C-u r' to search again with new search string
   |   test-case:  TODO Buckle my shoe  
:foo:
   `

   I expected the TODO item to be filtered out.

   This is the value of `org-agenda-custom-commands':

   ,
   | (("x" "Describe command here" tags "foo"
   |   ((org-agenda-skip-function
   | '(org-agenda-skip-entry-if todo todo
   |  ("n" "Agenda and all TODO's"
   |   ((agenda "" nil)
   |(alltodo "" nil))
   |   nil))
   `

   The problem seems to be that the arguments to
   `org-agenda-skip-entry-if' are unquoted.  The following steps verify
   that.

6. Change `org-agenda-custom-commands', quoting the arguments to
   `org-agenda-skip-entry-if'.

   ,
   | (setq org-agenda-custom-commands
   |   '(("x" "Describe command here" tags "foo"
   |  ((org-agenda-skip-function
   |'(org-agenda-skip-entry-if 'todo 'todo
   | ("n" "Agenda and all TODO's"
   |  ((agenda "" nil)
   |   (alltodo "" nil))
   |  nil)))
   `

7. Remake the custom agenda view with `M-x org-agenda x'.

   ,
   | Headlines with TAGS match: foo
   | Press `C-u r' to search again with new search string
   `

   As expected, the TODO item is filtered.

Best,

Thomas



Re: [O] Standard skipping conditions have no effect

2014-06-01 Thread Thomas Morgan
Attached are the files referred to in the bug report.

Thomas Morgan  writes:

> Hello, Org mode hackers,
>
> Here is a recipe for a bug on the maint branch that causes standard
> skipping conditions to have no effect.
>
> 1. Change the load path setting in `setup.el'.
>
> 2. Start Emacs with `emacs -Q -l setup.el'.
>
> 3. Customize the agenda commands with `M-x org-agenda C'.
>
> 4. Add a new command, change the match field to tag `foo', and add a
>standard skipping condition for TODO states, so that the command
>looks like this in the customization buffer:
>
>,
>| INS DEL Choice: Value Menu Single command:
>| Access Key(s) : x
>| [X] Description: Describe command here
>| Choice: Value Menu Tags/Property match (all agenda files)
>| Match (only for some commands): foo
>| Local settings for this command.  Remember to quote values:
>| INS DEL Setting: Value Menu Standard skipping condition:
>| org-agenda-skip-function
>| List:
>| List:
>| Skipping range: Value Menu Skip entry
>| Conditions for skipping:
>| INS DEL Condition type: Value Menu TODO state is:
>| todo
>| Choice: Value Menu any not-done state
>| INS
>| INS
>| [ ] Export:
>| INS
>`
>
> 5. Type `M-x org-agenda x'.  The resulting agenda view looks like this:
>
>,
>| Headlines with TAGS match: foo
>| Press `C-u r' to search again with new search string
>|   test-case:  TODO Buckle my shoe
>   :foo:
>`
>
>I expected the TODO item to be filtered out.
>
>This is the value of `org-agenda-custom-commands':
>
>,
>| (("x" "Describe command here" tags "foo"
>|   ((org-agenda-skip-function
>| '(org-agenda-skip-entry-if todo todo
>|  ("n" "Agenda and all TODO's"
>|   ((agenda "" nil)
>|(alltodo "" nil))
>|   nil))
>`
>
>The problem seems to be that the arguments to
>`org-agenda-skip-entry-if' are unquoted.  The following steps verify
>that.
>
> 6. Change `org-agenda-custom-commands', quoting the arguments to
>`org-agenda-skip-entry-if'.
>
>,
>| (setq org-agenda-custom-commands
>|   '(("x" "Describe command here" tags "foo"
>|  ((org-agenda-skip-function
>|'(org-agenda-skip-entry-if 'todo 'todo
>| ("n" "Agenda and all TODO's"
>|  ((agenda "" nil)
>|   (alltodo "" nil))
>|  nil)))
>`
>
> 7. Remake the custom agenda view with `M-x org-agenda x'.
>
>,
>| Headlines with TAGS match: foo
>| Press `C-u r' to search again with new search string
>`
>
>As expected, the TODO item is filtered.
>
> Best,
>
> Thomas
>


* TODO Buckle my shoe 			:foo:


setup.el
Description: application/emacs-lisp