A day page for Org-Mode - AlmostObsolete.net

    _   _              _    ___  _            _     _                  _
   /_\ | |_ __  ___ __| |_ / _ \| |__ ___ ___| |___| |_ ___   _ _  ___| |_
  / _ \| | '  \/ _ (_-<  _| (_) | '_ (_-</ _ \ / -_)  _/ -_)_| ' \/ -_)  _|
 /_/ \_\_|_|_|_\___/__/\__|\___/|_.__/__/\___/_\___|\__\___(_)_||_\___|\__|
                                                   In Glorious ASCII-VISION
Home

Summary: I've added a day page to Org-Mode because I missed having it from PlannerMode, code below.

Update 2011-09-11 Sun: I've pushed the code up to Github: https://github.com/almost/org-daypage

2010-06-29 Tue A day page for Org-Mode    emacs

I use the incredible Emacs Org-Mode to make notes and to keep track of my life. I used to use PlannerMode but was lured by the incredible number of features of Org-Mode and its breakneck development speed. Combined with the excellent Dropbox either of these packages are a great way to keep track of things.

While the two have many similarities they do handle agendas in quite different ways. PlannerMode works a bit like a paper day planner, you have a page (a separate file) for each day on which you enter any scheduled items and your TODO list for that day. Each day it automatically moves any TODO items from previous days that haven't been marked as DONE to the current day. I also took to using the day page for the current day as a sort of scratch pad for quick notes, I'd also sometimes make notes on a future day page that I knew I'd need on that day.

Org-Mode works a little differently, you have as many files as you want for different projects and you can tag any section in any of those files with a Timestamp. You can also make TODO items in any file and set scheduled and deadline dates. Org-Mode then uses an Agenda View buffer to show all the items scheduled marked for a specific day (or set of days) together. This means you can keep all the items for a particular project together but still view what's scheduled for today or this week over all projects with ease. It also means you can create special Agenda Views that are filtered in any way you find useful.

Org Mode is great, but I really miss having a day page I can quickly jot down notes on without having to think about what file they should go in. I also miss being able to add quick notes to future day pages. These use cases should be covered by having a misc.org file and adding future timestamps to my notes1 but it just doesn't feel as natural and frictionless to me as it did in PlannerMode.

So I decided to combine Org-Mode and day pages. I have one Org file per day and I have a key mapping (C-con, but one of the F keys might work well) bound to bring up today's page. Now when I want to make a note I just hit C-con and type away. I also have another mapping (C-coN) which first prompts for a date using Org-Mode's rather nice date prompt.

(setq daypage-path "~/notes/days/")

(defun find-daypage (&optional date)
  "Go to the day page for the specified date, 
   or toady's if none is specified."
  (interactive (list 
                (org-read-date "" 'totime nil nil
                               (current-time) "")))
  (setq date (or date (current-time)))
  (find-file 
       (expand-file-name 
        (concat daypage-path 
        (format-time-string "%Y-%m-%d" date) ".org")))
  (when (eq 0 (buffer-size))
        ;; Insert an initial for the page
        (insert (concat "* <" 
                        (format-time-string "%Y-%m-%d %a" date) 
                        "> Notes\n\n")
        (beginning-of-buffer)
        (next-line 2)))

(defun todays-daypage ()
  "Go straight to today's day page without prompting for a date."
  (interactive) 
  (find-daypage))

(global-set-key "\C-con" 'todays-daypage)
(global-set-key "\C-coN" 'find-daypage)

I also find it useful to show this day page along with Agenda view each day when I'm checking on what I have to do for that day. I also like to have a calendar shown along side as well.

(defun tom-show-agenda () 
  (interactive)
  (delete-other-windows)
  (org-agenda-list)
  (calendar) 
  (other-window 1) 
  (split-window-vertically) 
  (other-window 1) 
  (todays-daypage))

(global-set-key "\C-coo" 'find-daypage)
; I often want to view my agenda after switching to Emacs from
; elsewhere, in this case I often have my hand on the mouse and f12 is
; much easier to hit than C-coo.
(global-set-key [f12] 'find-daypage)

Finally, it's nice to still be able to Timestamp or Schedule items in a day page and have them appear on the agenda (for that day or for another). This is easily handled by having the day pages included in the Agenda just like any other Org file.

(setq org-agenda-files 
     (append 
        org-agenda-files 
        (list (expand-file-name daypage-path))))

I've only been using this addition to my setup for a few days but so far it's been great. The reduction in mental friction may be small but I really feel it makes a difference, I'm finding myself more likely to note things down and less likely to lose my place elsewhere in the process.

 __________________
< made in Org-mode >
 ------------------
        \   ^__^
         \  (oo)xxxxxxxx
            (__)\       )\/\
                 |   | ----w |
                 ||     ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Footnotes:

1 The Remember package also goes some way to reducing friction in capturing notes. But I find it doesn't work too well for me, I often forget to hit C-cC-c after I've entered a note or find that I want to keep a partially completed note open.

Date: 2011-09-11 09:20:11 BST

Author: Thomas Parslow

Org version 7.5 with Emacs version 23

Validate XHTML 1.0