2

I have an org-file which might look like the following:

* Appointments
** Meet someone important
<2018-02-15 Thu 08:00-09:00>

* Discussions
** TODO Discuss something with someone
    SCHEDULED: <2018-02-15 Thu 08:00-09:00>

Generating the agenda results in something like

8:00-9:00 Scheduled: TODO Discuss something with someone
8:00-9:00 Meet someone important

Is there a simple way to change the sorting of the agenda to sort entries with a plain time stamp before scheduled items, that is I would the agenda prefer to look like

8:00-9:00 Meet someone important
8:00-9:00 Scheduled: TODO Discuss something with someone

I had a look at the documentation for org-agenda-sorting-strategy but this looked quite complicated and I could not figure out how to achieve the desired result.

1 Answer 1

4

It's a little hard to figure out org-agenda-sorting-strategy the first time around. If you look at the value (say, with C-h v), it's a list of lists. The individual lists describe the sorting to be used in a specific "context", like agenda or todo for different kinds of agenda views.

The default value is:

((agenda habit-down time-up priority-down category-keep)
  (todo priority-down category-keep)
  (tags priority-down category-keep)
  (search category-keep))

So for the agenda view, it will sort first to put habits at the end (that's what the -down means for it), then entries with time of day first, priority in decreasing order, and keep the default order of categories.

So what you want sounds like ts-up, to keep active timestamps early first. Therefore, we want the first value to look like:

(agenda ts-up habit-down time-up priority-down category-keep)

The easiest way is to customize the variable and add the ts-up there.

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.