emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Standard skipping conditions have no effect
@ 2014-06-01 23:21 Thomas Morgan
  2014-06-02  1:00 ` Thomas Morgan
  2014-06-02 11:30 ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Morgan @ 2014-06-01 23:21 UTC (permalink / raw)
  To: emacs-orgmode

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

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

* Re: Standard skipping conditions have no effect
  2014-06-01 23:21 Standard skipping conditions have no effect Thomas Morgan
@ 2014-06-02  1:00 ` Thomas Morgan
  2014-06-02 11:30 ` Bastien
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Morgan @ 2014-06-02  1:00 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3141 bytes --]

Attached are the files referred to in the bug report.

Thomas Morgan <tlm@ziiuu.com> 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
>



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test-case.org --]
[-- Type: text/x-org, Size: 35 bytes --]

* TODO Buckle my shoe 							:foo:

[-- Attachment #3: setup.el --]
[-- Type: application/emacs-lisp, Size: 111 bytes --]

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

* Re: Standard skipping conditions have no effect
  2014-06-01 23:21 Standard skipping conditions have no effect Thomas Morgan
  2014-06-02  1:00 ` Thomas Morgan
@ 2014-06-02 11:30 ` Bastien
  2014-06-02 14:03   ` Thomas Morgan
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien @ 2014-06-02 11:30 UTC (permalink / raw)
  To: Thomas Morgan; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

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,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-agenda-customization.patch --]
[-- Type: text/x-diff, Size: 2375 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

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

* Re: Standard skipping conditions have no effect
  2014-06-02 11:30 ` Bastien
@ 2014-06-02 14:03   ` Thomas Morgan
  2014-06-02 17:59     ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Morgan @ 2014-06-02 14:03 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi, Bastien, 

This works for me -- thanks!

Best,

Thomas

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

* Re: Standard skipping conditions have no effect
  2014-06-02 14:03   ` Thomas Morgan
@ 2014-06-02 17:59     ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2014-06-02 17:59 UTC (permalink / raw)
  To: Thomas Morgan; +Cc: emacs-orgmode

Hi Thomas,

Thomas Morgan <tlm@ziiuu.com> writes:

> This works for me -- thanks!

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

-- 
 Bastien

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

end of thread, other threads:[~2014-06-02 18:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-01 23:21 Standard skipping conditions have no effect Thomas Morgan
2014-06-02  1:00 ` Thomas Morgan
2014-06-02 11:30 ` Bastien
2014-06-02 14:03   ` Thomas Morgan
2014-06-02 17:59     ` 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).