alphapapa / org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
GNU General Public License v3.0
1.38k stars 108 forks source link

time-grid should not consume all items in list of TODO entries #212

Open schemar opened 2 years ago

schemar commented 2 years ago

First of all, thank you so much for super-agenda :heart:

I encounter unexpected behavior where I am not sure whether it is the intended way.

When I open the "List of all TODO entries" (t), all my items are under the time-grid group, even though there is no time grid in the TODO list.

I would expect the time-grid group to be empty and all tasks to be passed to the next group.

My config:

(setq org-super-agenda-groups
      '((:name "Today"
               :time-grid t)
        (:name "Foo"
               :tag "foo")
        (:name "Bar"
               :tag "bar")))

When I M-x org-agenda -> t, all my tasks are listed under Today instead of Foo, Bar, and Other. Am I misunderstanding something here?

alphapapa commented 2 years ago

Hi,

This is probably due to a peculiarity of how Org makes agenda views and the "List of all TODO entries" view (which isn't an agenda view but is prepared by the org-agenda library, so maybe it is an agenda view? issues like this are one of the reasons I wrote org-ql...).

You can see here what causes the :time-grid selector to collect an item: https://github.com/alphapapa/org-super-agenda/blob/fb5e2ef277bc811a3b061106c99e4c47b6b86f80/org-super-agenda.el#L449 You can then look at the text properties of collected items using C-u C-x = and see if any match. And then, if you're brave enough, you could dig into org-agenda.el and find the code that adds those text properties.

You might have found a bug in Org, or maybe just an inconsistency. Whether fixing it here and/or in Org would be appropriate, I don't know. I don't expect that I'll have time to work on fixing this myself anytime soon, so help would be appreciated. Thanks.

angel-devicente commented 2 years ago

In case it can be useful, I was having the same issue, since I wanted the global TODO list grouped also with org-super-agenda and without the need to modify the source code as in #221, I ended up with this, which works nicely.

(setq own-agenda-groups '((:name "Efemerides" :tag "efemerides" :order 1)       
                         (:name "IMPORTANT" :priority "A" :transformer          
                                (--> it                                         
                                     (propertize it 'face                       
                                                 '(:foreground "red" :background "green")))
                                :order 1)                                       
                         (:name "Astrophysics" :tag "astrophysics" :order 3)    
                         (:name "Hacking" :tag "hacking" :order 3)              
                         (:name "Admin" :tag "admin" :order 4)))               

(setq org-agenda-custom-commands                                                
      '(("h" "Agenda and tasks"                                                 
         ((agenda "" ((org-super-agenda-groups                                  
                       (append                                                  
                        '((:todo "DONE" :discard)                               
                          (:name "Schedule" :time-grid t :transformer           
                                 (--> it                                        
                                      (propertize it 'face                      
                                                  '(:foreground "yellow")))))   
                        own-agenda-groups))))                                   
          (alltodo "" ((org-super-agenda-groups                                 
                        (append                                                 
                         '((:todo "DONE" :discard))                             
                         own-agenda-groups))))))))                              
alphapapa commented 1 year ago

Fixing this will require some research and testing to confirm that nothing else gets broken.

In the meantime, I can recommend using org-ql as an alternative to using the Org Agenda "all TODOs" view.