Is it possible to get my items sorted in a chronological manner, such that the grid remains in "today" relative to other entries? Something like this:

cat1:  sched  5 days ago TODO task 1.
cat3:  sched  4 days ago DONE task 2.
fname: dline  3 days ago TODO task 3.
cat4:  sched  2 days ago TODO task 4.
cat1:  today!            DONE task with no time, for today.
       07:00 -----
       08:00 -----
       09:00 -----
       10:00 -----
cat1:  11:00-12:00 today! TODO task with time, for today.
       13:00 -----
       14:00 -----
       15:00 -----
cat2:  16:00 ----- today! TODO another with time, for today.
       17:00 -----
       18:00 -----
reps:  19:00 ----- Repetitive task. Everyday.
       20:00 -----
       21:00 -----
cat3:  dline in  1 days  TODO task for tomorrow.
fname: dline in  2 days  TODO for this I still have two days.
cat2:  dline in 12 days  TODO I will do this someday.

I tried many configurations on org-agenda-sorting-stratergy, together with org-sort-agenda-notime-is-late, but none of them seem to work.

Close attempts:


All the empty lines in the grid (in example 7:00, 8, 9, 10, 13, etc) get together on top of the view.

Then, my repetitive events, that look like this:

** Repetitive task. Everyday. <2020-01-01 19:00 +1d>

go next (Apparently sorted by their original date rather than by the next occurrence of them)

And finally the scheduled/deadline items.

(agenda time-up timestamp-up)

Almost there, but future events (the last three lines in the example above) get placed before the grid, so all items with no information about the "time of the day" stay together at the top.

1 Answer 1


No can do: if you look at org-agenda-add-time-grid-maybe, you'll see that the grid is added either at the beginning or at end of the list of agenda items. The grid is accumulated in a list named new, whereas the list of agenda items is passed in through a variable named list. The function then does this:

      (if (member 'time-up org-agenda-sorting-strategy-selected)
         (append new list)
        (append list new))

So the grid is either before all the agenda items or after all the agenda items: there is no provision to put it in the middle.

You could modify this code to find the place in list at which to splice the time-grid list new, but that is certainly not doable by user-accessible means (setting options e.g.) You'd need to redefine the function to do the splicing.

  • This layout makes a lot of sense to me, but I am not versed enough in elisp to take this quest. So I guess that's it. Thanks
    – onlycparra
    Commented Apr 7, 2022 at 4:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.