Yesterday I posted the E05S04 tutorial video where I showed a custom view that has tasks tagged with URGENT together with tasks tagged with PHONE and then an agenda for the day. In the comments I was asked how to do such a view. So here is the code:
The code has to go to your „~/.emacs“ file or whatever file you use for initializing the orgmode customization (I use a „org-global.el“ for that which is stored in the cloud and synchronized to all PCs where I use OrgMode).
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
("D" "Overview for today"
((org-agenda-overriding-header "Urgent Tasks")
((org-agenda-overriding-header "Phone Calls")
This is the start of my example customization file. If you put it in your file locate that line with „custom-set-variables“ and inside that the „org-agenda-custom-commands“ list. After the last line the code for other custom agenda views goes on, so if you want to paste it into your file take the lines 9 to 29 and paste it to your org-agenda-custom-commands structure in the initialization file.
The „D“ in line 9 defines the key for that custom view together with the explanation. Then you get two views with „tags-todo“ one that selects the „URGENT“ tag, the other one that selects for items tagged with „PHONE“. Both sections get headlines.
In line 20 the agenda view for the current day starts. To avoid that we get an agenda with more than 1 day the setting „org-agenda-span“ is set to 1 (one day). I limited the view to 2 „org-agenda-files“, so you can select which of your org files will be searched to create that view. The setting „org-agenda-sorting-strategy“ has 2 entries „time-up“ to ensure that the first thing you see in your agenda is a sort of mini-daily timeline. The „priority-down“ setting makes sure that the tasks with the highest priority ends up on top of this list. So as an example the daily view looks like the picture on the right side (click to enlarge). This is like a quick „dashboard“ that shows all the important entries for today. I use that view when I create my daily plan every morning. Of course you can advance the agenda view of today by using the usual navigation keys („f“ for forward one day, „b“ for back one day) to see other days.