Category Archives: wickedcoolemacs

Emacs: Choosing between Org and Planner

jaaronfarr asked me why I switched from Planner to Org. Both of them are popular personal information managers for Emacs, and both of them have practically all the features I need. They both do a good job at helping people
manage tasks, schedule, and notes. If you have a few
months to explore this, I suggest that you try both for at least a
month each. On the other hand, if you want quick results, some time
thinking about how you plan can save you more time later.

I tried out Org because I was working on a chapter about schedule
management and it wasn’t fair to just rely on the manual or the
mailing list. In the beginning, I
felt frustrated by the lack of things I’d gotten used to in Planner:
the freedom to edit anything on my day page, little conveniences like +2tue to mean two Tuesdays from now (which Carsten has just added), publishing my blog…

After two months of using Org almost every day, I’m starting to
understand it. I’ve come to appreciate the ease of working with an
outline. I love the way it clocks time. I find the daily and weekly
views really helpful. I’ve hacked stuff for it: time/load estimation,
time reporting, next action summaries, agenda publishing… I’m fairly deeply

As a geek, I have to confess—I like Planner more. Planner is more fun
to code. Maybe it’s because I’ve spent years with it, and I know my
way around the source.

Maybe it’s because we split Planner up into lots of little pieces that
can be reused and advised. Maybe the modularity of Planner is because
chunks of the code were written on a computer with a teensy screen,
which forced me to write functions that fit 80×48 characters. (See,
that limitation was there for a reason!) There are plenty of entry
points. From time to time, I still find myself copying an entire
function in order to change something in the middle, but usually I can
just get away with wrapping something around something else. With Org,
I find myself doing a lot of copy-and-paste programming. I’d fix this
by breaking the functions down into smaller bits, but I don’t have the
brainspace right now. Maybe after the book.

Org is better for my brain, though. It gives me a better overview of
both the ground-level tasks (what am I going to do right now, today,
this week) as well as the 50,000-foot view (what are my big projects)?
Planner’s good at the ground-level tasks, but the overview’s always
been a little awkward because it has to visit a number of files to get
a big picture. Org handles that easily.

And the one-place-for-data thing of Org is pretty cool, too. Org
dynamically generates reports, which could take a bit longer if you
have a large Org file. Planner copies data wherever it makes sense, so
you’d have a copy of the task on your day page and a copy of the task
on your plan page. Plan pages can get out of sync unless you’re either
religious about using planner-edit-task-description and other
functions to edit your tasks, or you use planner-id and you’re lucky.
Timeclock entries get out of sync, too. You can trust Org more than
Planner in terms of consistency.

So now I’m kinda in the middle of these two modules. I use Org for all
my work tasks, and I’m moving towards using it for all of my personal
tasks as well. But I still keep my blog entries in Planner, even
though they get mirrored into a WordPress blog on my web server.

*What would I recommend?*

It depends on the way you think. If you’re the kind of person who was
never happy with day planners because you needed more space to doodle,
write notes, move things around, add other things, try out Planner. If
you like outlines and organizing your tasks into projects, try out
Org.

Note that just because you work that way now doesn’t mean you’ll work
that way in the future. Don’t worry. Emacs will adapt. You can switch
between Planner and Org fairly easily. Just give yourself a week or so
to adjust (or a month if you’ve customized your old tool extensively
and miss lots of things about it). Use the tool every day, and you’ll
be fine.

Have you tried out both? Or have you tried out one of them and are curious about the other? I’d love to learn from your experience or answer your questions.

On Technorati: , , ,

Random Emacs symbol: malayalam-composition-function – Function: Compose Malayalam characters in REGION, or STRING if specified.

Emacs: Getting Things Done with Org – Basic

2(please remove leading spaces from code excerpts)

You’d like to use the Org Mode for Emacs to manage your tasks. In this
blog post, I’ll cover the absolute minimum you need to get started.
We’ll assume that you already have GNU Emacs 22 and that you’re reasonably
familiar with using Emacs, including installing external modules and
adding them to your load path.

There are a million ways to plan, but we’re going to focus on two. The
first approach is Getting Things Done (GTD), described by David Allen
in the book of the same title. GTD focuses on next actions (the very
next thing you can do) and uses context lists to keep things
manageable. Popular ways to do GTD are with index cards, recycled
business cards, or software programs. If most of your tasks are in
your head or scattered on scraps of paper, GTD will probably give you
the most organizational bang for the least effort.

The second approach is day planning. You plan your week based on your
projects and priorities, write your tasks onto the pages for each day,
and copy unfinished tasks over to the next day. If you’ve used one of
those Filofax, Franklin-Covey or Dayrunner personal organizers, you’re
probably used to this way of planning.

As you learn more about Emacs and task management, you’ll probably
develop your own way of doing things. These two are a good place to
start, though. (Don’t recognize how you plan your day, but
interested in using Emacs anyway? Please get in touch with me! I may
know of something that fits, and I’d certainly love to hear about the
way you work.)

If you use GTD, read on. Otherwise, read the Setup and then wait for
the next blog post! =)

Set up

Org is part of Emacs 22. To make it even easier to collect tasks and
notes, install a separate package called Remember.

First, download and unpack Remember. As of this writing, Remember is
at version 1.9. You can get the TAR.GZ from
http://download.gna.org/remember-el/remember-1.9.tar.gz605 or the ZIP
archive from http://download.gna.org/remember-el/remember-1.9.zip606 . If
these instructions are out of date, check
http://www.emacswiki.org/cgi-bin/wiki/RememberMode607 to find out where to get Remember.

Then add this basic configuration for Org and Remember to your ~/.emacs,

   (add-to-list 'load-path "~/elisp/remember-1.9")                                  ;; (1)
   (require 'remember-autoloads)
   (setq org-remember-templates
      '(("Tasks" ?t "* TODO %?\n  %i\n  %a" "~/organizer.org")                      ;; (2)
        ("Appointments" ?a "* Appointment: %?\n%^T\n%i\n  %a" "~/organizer.org")))
   (setq remember-annotation-functions '(org-remember-annotation))
   (setq remember-handler-functions '(org-remember-handler))
   (eval-after-load 'remember
     '(add-hook 'remember-mode-hook 'org-remember-apply-template))
   (global-set-key (kbd "C-c r") 'remember)                                         ;; (3)

   (require 'org)
   (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))                           ;; (4)
   (global-set-key (kbd "C-c a") 'org-agenda)                                       ;; (5)
   (setq org-todo-keywords '("TODO" "STARTED" "WAITING" "DONE"))                    ;; (6)
   (setq org-agenda-include-diary t)                                                ;; (7)
   (setq org-agenda-include-all-todo t)                                             ;; (8)
  • (1): Change the directory as necessary.
  • (2): You can use a different filename.
  • (3): You can change this keyboard shortcut.
  • (4): This tells Emacs to open all .org files in org-mode.
  • (5): You can change this keyboard shortcut.
  • (6): This makes it easy to pull in holidays and other events. See the chapter on managing your schedule.
  • (7): This includes all unfinished todos in the Org daily and weekly views. You can remove this line when you get used to working with todo lists.

After you evaluate that code by calling M-x eval-buffer or restarting Emacs, you’re ready to create an Org file.

  1. Open ~/organizer.org (or whichever file you specified in (2)).
  2. Save it. This is probably the only time you’ll have an empty TODO list.
  3. Use C-c [ (org-agenda-file-to-front) to add it to your org-agenda-files. You only need to do this once for this agenda file.

Read on to find out how to use your new Org file for GTD, or skip ahead to the section on Day Planning to find out how to plan by day!

Org and GTD

So you’ve read David Allen’s book about Getting Things Done (or any of
the countless summaries of it on the Net), and you’d like to get
started with Emacs and Org mode. I’ll show you the bare minimum you
need to support the five phases in the GTD task workflow:

Phase GTD Org
Collect Capture everything you need to do. Collect all your bits of paper or put everything into your inbox
Process Actionable? Yes: do, delegate, or defer; no: file, throw, or incubate Put tasks on your list, track delegated tasks
Organize Next actions, projects, waiting for, someday/maybe Tag tasks, view tasks by tag
Review Daily, weekly, etc. Agenda view
Do Actually do the work! No, Emacs won’t do the work for you… (But it can brew coffee!)
Collect

The first thing you need to do is get all the tasks out of your head,
off scraps of paper, out of your e-mail, and so on. If this is the
first time you’re putting tasks into Org, you have a lot of tasks to
collect. The best way to collect lots of tasks is to open your Org
agenda file (~/organizer.org) and put this heading at the end of the
file:

   * Inbox

Now go to the end of the file, and type in ** TODO and the first task
you can think of, like this:

   ** TODO Buy milk

Press C-M-RET and keep typing other tasks. Keep going until you’ve
gone through all the things in your head and all the scraps of paper
lying around. Do not get distracted. Your goal is to write all the
tasks down. If you are as easily distracted as I am, do not even open
up a browser window or look at your e-mail. It can be a real struggle
sometimes to focus long enough to get everything down, especially when
you’re writing down all these tasks that you can work on. DO NOT DO A
TASK UNLESS IT TAKES LESS THAN TWO MINUTES TO DO. In fact, if you are
just starting out with GTD, you might find it better to resist all
temptations to do tasks during this step. Get it all out.

Now that you’ve gotten your tasks out of your head and into your
organizer.org file, breathe. There’s less stress in your brain now,
because you don’t have to worry about forgetting things (as long as
you remember to check your Org file, that is!).

DO NOT FILL YOUR BRAIN BACK UP WITH OTHER THINGS TO DO. The brain is a
wonderful thing, but it’s not good at remembering what you need to do.
Whenever a task comes your way—through e-mail, in conversation, in
the shower—put it in your ~/organizer.org. Well, you probably don’t
want to drip all over the computer, so sometimes you’ll need to hang
on to an idea—but get it out of your head and into your organizer as
quickly as possible.

To collect tasks within Emacs as they come up, use Remember. With the
basic configuration you set up in the previous section, you can use
C-c r t (or M-x remember and “t” for the Tasks template) to pop up a
buffer where you can type in the task description and some notes.

    ## Filing location: Select interactively, default, or last used:
    ##     C-u C-c C-c  to select file and header location interactively.
    ##         C-c C-c  "~/notebook/personal/organizer.org" -> "* Tasks"
    ## C-u C-u C-c C-c  "???" -> "* ???"
    ## To switch templates, use `M-x org-remember'.

    * TODO

And if you’re lucky, there will even be a hyperlink to the file or
e-mail you were looking at when you called C-c r t (remember, tasks).

If you brain-dump your tasks and use C-c r t to collect tasks as they
come up, you can free up your brain for other things, such as
contemplating the meaning of life.

Process

Now that you’ve collected all those tasks into your inbox, you can
process them. Open your Org agenda file and go to your inbox.

For every item there, decide if it’s something that you need to act
on. Is it really just a note? If so, take out the TODO keyword and
organize it like you would store other notes. If it’s a true-blue
task, decide if it’s something you can do within the next two minutes,
delegate to someone else, or leave on your task list. Go through your
list systematically, delegating and eliminating whenever possible.

If you delegate the task, change it to WAITING by moving your cursor
to the headline with the TODO keyword and typing S-r (org-shiftright)
until it changes to WAITING. To keep track of who you delegated it to,
just edit the task description to reflect it. Your organizer file will
look like this:

 ** WAITING Buy milk - WJY
Organize

You have a list of tasks that _you_ need to act on. If you’ve
braindumped everything that people have asked you to do and that
you’ve thought of doing, this is probably a very long list.
Intimidatingly long. The next step in restoring sanity to your life is
to organize your list into next actions, projects, things you’re
waiting for, and someday/maybe tasks.

Review that task list. For each task, decide if it’s something you can
do immediately. Is it something you can do in one sitting, and do you
have everything you need in order to do it? If so, great! It’s a next
action. Leave it on your task list.

If you can’t immediately work on a task, it may be a project in
disguise, and it needs to be broken down into smaller, concrete next
actions. For example, the task:

 ** TODO Write a book about Emacs

would probably result in me getting complete writer’s block. If you’re
faced with a big task like this, move it out of your inbox and make it
a project. Then you can think of the very next action you need to do.
Your Org file could look something like this:

 * Projects

 ** Emacs book
 *** TODO Write about basic Org and GTD

 * Inbox

 ** TODO ... lots of other things go here ...
 ** TODO ... lots of other things go here ...
 ** TODO ... lots of other things go here ...

A task might also be stuck because you need to wait for someone else.
For example, I’m currently working on renewing my visa, but I need to
wait for the embassy. Mark those stuck tasks as WAITING with S-right
(org-shiftright).

Someday/maybe tasks are nice to think about once in a while, but you
don’t want to clutter your day-to-day tasks with them. A basic way to
deal with this is to move those tasks into a separate Organizer file
such as ~/someday.org . Another is to use tags, which we’ll cover in
the section on intermediate Org. For now, just move them to another
file.

Review

You’ve gone from a whole bunch of tasks in your brain and on pieces of
paper to one text file containing everything you need to do, with an
easy way to get to just the things you can do right now. To view all
your tasks, type C-c a t (org-agenda, tasks). You’ll get something
that looks like this:

  Global list of TODO items of type: ALL
  Available with `N r': (0)ALL (1)TODO (2)STARTED (3)WAITING (4)DONE
  TODO Write about basic Org and GTD
  TODO Blog
  TODO Answer my mail
  TODO Alter slacks
  ...

Type “1 r” to show only the active tasks, and review what you’re
waiting for with “3 r”. Review this WAITING list every so often
to make sure that nothing falls through the cracks.

Type “f” to start follow mode, which displays the relevant lines from
your Org agenda file as you move around. This is helpful for quickly
reviewing your task list.

Do

All of the above should take you less than fifteen minutes of planning
each day. The rest of the time, you can focus on doing the work,
undistracted by shiny new tasks that pop up because you can get them
out of your way with C-c r t.

To work, review your task list with either C-c a t (org-agenda, tasks)
or C-a a (org-agenda, agenda). From the agenda view, type “t”
(org-agenda-todo) to change the task status. I find it helpful to mark
a task as STARTED because it helps me remember what I was working on
in case I get distracted by something urgent, but you can also use C-u
t to jump to a status without cycling through the ones in between
(say, marking a task as DONE). You can also press ENTER to jump to the
task headline and edit it directly.

Going back to reviews: As you mark tasks done, you’ll also want to do
daily and weekly reviews. You can see those with C-c a a (org-agenda,
org-agenda-list), which opens an Org agenda view. To see completed
tasks in the Org agenda view, type l (org-agenda-log-mode). To switch
to the day view, type d (org-agenda-day-view). To switch to the week
view, type w (org-agenda-week-view). The basic configuration I’ve
suggested here will automatically include unfinished tasks at the
beginning of the agenda. Scroll up to review your tasks, and press
ENTER on a line to jump to it.

Wrapping up

There’s a lot more you can do with Org to make it support GTD, but
here’s a basic configuration that can get you started on collecting,
processing, organizing, managing, and actually doing your tasks. Stay
tuned for the intermediate Org article for more tips on setting up
repeated tasks, clocking time, working with projects, and tagging
tasks!

On Technorati: , , ,

Random Emacs symbol: bbdb-edit-current-field – Command: Edit the contents of the Insidious Big Brother Database field displayed on

UPDATE: Thanks, Victor, for catching the bug! Changed org-install to org.

Planner, basic configuration

If you’re the kind of person who likes scribbling free-form tasks and
notes in your day planner, then Planner might be a good fit for you.
In this blog post, I’ll show you how to use Planner to organize the
things you need to do by the day you need to do them, check the things
you need to do, mark tasks complete, and review what you’ve finished.
I assume that you’ve already got GNU Emacs 22 installed and that
you’re comfortable with using Emacs as a text editor, although it
might not yet be your way of life. (Just you wait! Planner was the
thing that pushed me over the edge. ;) )

Set up

Here’s the bare minimum you need in order to use Planner to manage
your tasks day by day. You’ll need Planner, which is a separate
package that you can get from http://www.gna.org/projects/planner-el
. As of this writing, Planner is at version 3.41. You’ll also need
Muse, the markup engine that Planner is based on. You can get Muse
from https://gna.org/projects/muse-el . As of this writing, Muse is at
version 3.11.

Download the latest versions of Planner and Muse, and unpack them. If
you don’t know where to unpack them, I suggest creating an ~/elisp
directory and extracting the archives to that directory. You should
end up with two new directories: ~/elisp/planner-3.41 and
~/elisp/muse-3.11.

Here’s how to configure Planner:

1. Create a directory such as ~/Plans . This is where your Planner pages will be.

2. Add the following to your .emacs:

;; Load paths - change as necessary
(add-to-list 'load-path "~/elisp/planner-3.41")
(add-to-list 'load-path "~/elisp/muse-3.11/lisp")  ;; (1)

;; Basic configuration
(require 'muse-project)
(require 'planner-autoloads)
(setq planner-project "WikiPlanner")

;; Adjust this if you already have other Muse projects
(setq muse-project-alist
      '(("WikiPlanner"
	 ("~/Plans"                          ;; (2)
	  :default "TaskPool"                ;; (3)
          :major-mode planner-mode
          :visit-link planner-visit-link)))

;; Some handy keyboard shortcuts
(global-set-key (kbd "C-c d") 'planner-goto)                            ;; (4)
(global-set-key (kbd "C-c t") 'planner-create-task-from-buffer)
(global-set-key (kbd "<f9> d") 'planner-goto)                     ;; (5)
(global-set-key (kbd "<f9> t") 'planner-create-task-from-buffer)
(global-set-key (kbd "<f9> <f9>") 'planner-goto-today)      ;; (6)
(global-set-key (kbd "<f9> <f8>") 'planner-goto-yesterday)  ;; (7)
(global-set-key (kbd "<f9> <f10>") 'planner-goto-tomorrow)

(plan)  ;; (8)
  • (1) The lisp/ subdirectory is added to the load-path, not the base directory.
  • (2) Change this if you put your planner projects somewhere else.
  • (3) Muse will open the default page if you open a project.
  • (4) You’ll use these two commands often, so it helps to keep them close by. You can remember them as C-c d(ate), which jumps to a Planner date, and C-c t(ask), which creates a Planner task.
  • (5) I like dedicating one of my function keys to different Planner shortcuts. “F9 d(ate)” jumps to a Planner date and F9 t(ask) creates a task.
  • (6) You’ll check today’s page frequently, so make it an easy-to-hit shortcut. I like F9 F9 because I can just tap the key twice to see my tasks and schedule.
  • (7) This pair of keyboard shortcuts make it easy to navigate through pages.
  • (8) If this line is one of the last few in your ~/.emacs, then your Planner page for the day will display every time you start Emacs. It’s a good way to remember that it exists. ;)

Evaluate the code with M-x eval-buffer, or restart Emacs. Then you’re
ready to plan!

Planner and day pages

The first thing you need to learn is how to get to day pages
quickly. Planner needs to be at least as fast as opening a paper-based
day planner and finding the right page. Here are the two keybindings
from the previous section on setting up Planner:

F9 d(ate) or C-c d planner-goto Jumps to any day’s page
F9 F9 planner-goto-today Shows today’s page

F9 d (planner-goto) is smart. You can click on a date in the calendar
that pops up, or navigate to a date and press RET. Typing in the date
is much faster. The date format is yyyy.mm.dd, and it understands
partial dates (mm.dd, or just dd).

For example, if the date today is December 28, 2007, here’s what

Example Result Explanation
. 2007.12.28 Today
30 2007.12.30 Which day in the current month
1.30 2007.01.30 Which day and month in the current year
2008.01.30 2008.01.30 The full date

planner-goto also understands relative dates, and this is where things
get more interesting. If you are looking at a day page, dates are
calculated based on the day you’re currently looking at, or today if
you’re not looking at a day page. This allows you to use “+2fri” to
jump to successive paydays or use -1 to see the day before the one
you’re reading. Here are some examples that will show you what you can do:

  1. Jump to the day page for December 28, 2007 with F9 d or C-c d, specifying 2007.12.28 for the date.
  2. Use F9 d +5 to jump five days ahead. You should now see the page for 2008.01.02.
  3. Use F9 d -3 to jump three days back. (2007.12.30)
  4. Use F9 d +tue to jump to the next Tuesday. (2008.01.01)
  5. Use F9 d -2fri to jump to two Fridays ago. (2007.12.21)
  6. Use F9 d +2wed2007.12.01 to jump to the second Wednesday after Dec 1, 2007. (2007.12.12). +2wed01 would have worked, too.

(If you ever find yourself using a date shortcut like the one in (6),
please e-mail me, as I put that code in just for fun. =) )

Practice jumping around to different dates using F9 d or C-c d, the
two shortcuts we set up earlier. If one of those shortcuts feels more
natural to you, go ahead and use it. (Or bind it to something else, if
you want.) While you’re opening different day pages, write a few
reminders to yourself.

The basic configuration I suggested also has some handy shortcuts for
going to the previous and next days. Press F9 F8
(planner-goto-yesterday) to go to the day before the one that’s
currently displayed, and F9 F10 (planner-goto-tomorrow) to go to the
day after the one that’s displayed. You’ll find this handy when doing
your weekly planning. The standard shortcuts are C-c C-j C-y and C-c
C-j C-t. You may find those easier to type, but they were like a game
of Twister on my tiny keyboard. (This is also the reason why I’ve
remapped most of my keybindings. I simply can’t do the
Escape-Meta-Alt-Control-Shift thing.)

So now you know how to open different day pages. You can stop here and
already have a decent, minimalist day planner, using it like a
collection of text files that just happen to have useful navigational
commands. However, with a little more structure and some handy
shortcuts, you can be even more effective at managing your tasks.

Creating tasks

Two of the keyboard shortcuts in the sample configuration are C-c t
and F9 t, both bound to planner-create-task-from-buffer. This is an
incredibly useful function, and it gets even better as you set up more
parts of Planner. The key idea behind planner-create-task-from-buffer
is that you should be able to quickly jot down a task and GET BACK TO
WORK RIGHT AWAY. No need to fiddle around with other files or dig your
planner out of your backpack. No switching to another application (at
least, if you do most of your work within Emacs). And if you set it
up, you even get hyperlinks back to whatever you were looking at,
saving you time in searching for the file you wanted to work on or the
e-mail you wanted to answer.

Try it for yourself. Use C-c t, F9 t, or M-x
planner-create-task-from-buffer to create a task. Type in the task
description. For now, accept the default date and plan page. The task
will be created on today’s page. The task will also be copied to the
TaskPool page. To view today’s page, type F9 F9. You can use TAB
(muse-next-reference) to move the cursor to the next hyperlink, and
RET to visit the link.

planner-create-task-from-buffer understands all the date shortcuts
that planner-goto does, so you can easily schedule a task for this
Saturday (+sat) or three days from now (+3). If you create a task
that’s scheduled for some other day, you can either open the day page
with F9 d (planner-goto), or review it on the TaskPool.

Okay. You’ve got day pages. You’ve got tasks. You probably want to
find out how to mark tasks as done before your growing TODO list turns
into a monster and eats you.

Marking tasks as done, pending, or cancelled

When you finish a task, go to the day page or the plan page it’s on
and use C-c C-x (planner-task-done) to mark it as finished. Think of
it as marking completed tasks with a big X. In addition to the
satisfaction of seeing completed tasks grayed and crossed out, you’ll
also see the completed tasks drop to the bottom of your task list when
you save the file. This makes it easy to see what else you need to
do. Just pick the next item off your list and keep working.

Not quite done? You can mark it as pending with C-c C-p
(planner-task-pending). You can think of it as Pending or Postponed or
Procrastinated.

Realized that you didn’t need to do it after all? Either delete the
task with M-x planner-delete-task, or mark it as cancelled with C-c
M-C-x (planner-task-cancelled). Think of C-c M-C-x as similar to C-c
C-x (planner-task-done), but even better—you’ve gotten away without
doing something. C-c M-C-x doesn’t work on all terminals, so if your
computer gets confused and marks the task as done, call M-x
planner-task-cancelled instead.

NOTE: If your task is on both a day page and a plan page, make sure
you use these Planner commands and M-x planner-edit-task-description
in order to change the task status or description, and M-x
planner-delete-task to delete the task. These commands update the
linked page as well. If not, your tasks could get out of sync.

Even with your newfound powers of Planner task management, you’ll
probably still be left with unfinished business at the end of the day.
Unfortunately, Planner does not have a M-x planner-dilate-time command,
so you’ll just have to reschedule the tasks for another day.

Rescheduling tasks

If you wrote your tasks into your calendar using a paper-based
planner, you’d have to copy unfinished tasks to the next day one by
one. This is a powerful incentive to trim your task list and keep it
short. Planner can automatically copy unfinished tasks from the
previous days onto today’s page, saving you a lot of scribbling. Do
not let this tempt you into procrastination.

If you go back to the basic configuration, you’ll notice that it ends
with one command:

(plan)

This reviews the past few days of pages for unfinished tasks, carrying
them over to today’s page. By default, the past 3 days are checked,
which should be enough to get you through a blissful no-computer
weekend. If you’re in the habit of going for long spans of time
without opening Emacs (like 4 days! *gasp*), you may want to change
the line in your ~/.emacs to something like

(plan 5)        ;; Check the last 5 days

or even

(plan t)        ;; Check all days. Can be slow!

You can also call this interactively with something like C-u 5 M-x
plan, which checks the last 5 days.

plan carries unfinished tasks from previous days to today. What if you
want to trim today’s task list to a manageable size by proactively and
intentionally procrastinating things that you don’t need to do today?
That’s where planner-copy-or-move-task comes in.

To reschedule a task, move your cursor to the task on the day or plan
page. Type C-c C-c (planner-copy-or-move-task) and specify the
date. Again, planner-copy-or-move-task understands all the Planner
date shortcuts. If you reschedule a task from a day page, remember
that relative dates will be calculated based on the day page. For
example, if you’re on 2008.08.12 and you want to reschedule a task, +1
means 2008.08.13. If you reschedule a task from a plan page, dates are
relative to today.

If you want to reschedule many tasks, you might find it more
convenient to use M-x planner-copy-or-move-region. Move to the
beginning of the first task you want to move, press C-SPC to mark the
beginning of the region, move to the end of the last task you want to
move, and call M-x planner-copy-or-move-region.

Ruthlessly reschedule until your task list for today looks
manageable. A large task list can be overwhelming. It feels better to
complete everything on your task list and then add some more, than to
end each day with many unfinished tasks.

Review

You’ve got your day pages. You’ve added and scheduled tasks. You’ve
checked them off. At the end of the week, you’re wondering where all
the time went. Just hit F9 F9 (planner-goto-today) to jump to today’s
page, and then use F9 F8 (planner-goto-yesterday) and F9 F10
(planner-goto-tomorrow) to navigate around. (See, those keybindings
were there for a reason!)

But wait, there’s more! I’ll cover projects, timeclocking, and other
Planner goodies in an intermediate article on using Planner, so stay
tuned.

On Technorati: , ,

Random Emacs symbol: gnus-various – Group: Other Gnus options.

How to use Emacs Org as a Basic Day Planner

So you want to use Org as day planner. I’ll show you the bare minimum that you need in order to use Org to manage your tasks day by day. I assume that you’ve set up Org and Remember according to the basic configuration suggested in “Setup.” If you haven’t done that yet, please review the section on “Setup”, then return here.

Here’s what you’ll learn how to do:

  1. Collect your tasks
  2. Schedule the tasks for specific days
  3. View your daily or weekly agenda
  4. Mark tasks as done
  5. Reschedule a task
  6. Review your accomplishments

Collecting your tasks

If you’re adding many tasks, you may find it easier to edit your Organizer file. Open ~/organizer.org in Emacs and go to the end of the file. Add headlines like this:

 * Inbox
 ** TODO your task description here
 ** TODO another task...

Instead of typing ** TODO again and again, you can use C-M-RET to create another TODO heading at the same level as the previous one. Think of all the things you need to do over the next few days and add them to your Org agenda file.

More tasks will come up as you work on things. Instead of switching to your Org agenda file each time you need to add a task, you can use C-c r t (remember, Tasks template) to remember the task quickly. Try it now by typing C-c r t. Type in the task description and press C-c C-c (org-ctrl-c-ctrl-c) to add the task to the end of the ~/organizer.org file.

Now you have plenty of tasks on your list, but no idea when you need to do that. Here’s where scheduling and deadlines come in.

Scheduling tasks

To schedule a task, move your cursor to the TODO headline and press C-c C-s (org-schedule). Org will prompt you for a date. It understands full, partial, and relative dates. For example, if today is December 29, 2007, then It understands any of the following:

Input Result Explanation
(blank) 2007-12-30 Today
10:30 2007-12-30 10:30 Time today
3:30pm 2007-12-30 15:30 Time today
31 2007-12-31 Day in the current month
12-31 2007-12-31 Month and day in the current year
2008-01-01 2008-01-01 Date
2008-01-01 12:30am 2008-01-01 00:30 Date and time (also works with partial dates)
+2 2008-12-31 Two days from now
-3 2007-12-26 Three days ago
Fri 2008-01-04 The nearest Friday (on or after today)
+2w 2008-01-12 Two weeks from today

To set a deadline for a task, type C-c C-d (org-deadline). It accepts the same kinds of date that org-schedule does.

Try this out by scheduling all of your tasks over the next few days, adding deadlines where necessary.

Now that you’ve added date information to your tasks, you probably want to see those tasks organized by date instead of in the random way you entered them. Agenda views are going to become your new best friend.

Viewing your daily or weekly agenda

Type C-c a a (org-agenda, org-agenda-list) to view your agenda. By default, Org shows a weekly view of your scheduled tasks and appointments. This is your Org agenda view.

Here are some useful navigational keys:

  • Switch to a daily view with d (org-agenda-day-view)
  • Switch to a weekly view with w (org-agenda-week-view)
  • View earlier or later days/weeks with your left and right arrow keys (org-agenda-earlier, org-agenda-later)
  • Jump to a specific day with j (org-agenda-goto-date)

Get into the habit of typing C-c a a to check your task list. It may also help to add


(org-agenda-list)

to the bottom of your ~/.emacs. This opens your Org agenda view when you start up Emacs. Start your Emacs day with your Org agenda, check it every time you finish a task, and review it before you end the day. This will help you make sure that nothing falls through the cracks.

Marking tasks as done

The easiest way to mark a task as done is to go to its line in your Org agenda view. Type C-c a a (org-agenda, org-agenda-list) to view your tasks for today, move your cursor to the task, and type t (org-agenda-todo) to cycle the task status until it’s marked DONE. You can also type C-u t (org-agenda-todo with a prefix argument) to jump to a specific task status. For example, you could type C-u t DONE to mark a task as done.

You can also mark tasks done from your ~/organizer.org file. Open the file and move your cursor to the item. Type C-c C-t (org-todo) to change the task status. Again, you can type C-u C-c C-t (org-todo) to jump to a specific task status.

I find it helpful to mark tasks as STARTED when I start working on them, WAITING if I need something else in order to continue working on the task, and DONE when I’m finished with it. That way, I can quickly see which task I was supposed to be working on before I got distracted by something bright and shiny, and I can also see what I’m waiting for. Get into the habit of doing that, and you’ll find it easier to get back on track after distractions.

Unfortunately, Org does not come with a M-x org-zap-distractions command. There will be days when you can’t do everything on your task list.

Rescheduling Tasks

You don’t have to reschedule your tasks. Org will remind you of unfinished, scheduled tasks every single day. It will even helpfully tell you how many days you’ve procrastinated on that task. If you use C-c a a (org-agenda, org-agenda-list) when you have unfinished tasks on previous days, you’ll see task reminders like this:

Saturday  29 December 2007
  organizer: Scheduled:  TODO Respond to mail
  organizer: Sched. 6x:  TODO Write notes from mentoring conversation
  organizer: Sched. 2x:  WAITING Report time

You could let your unfinished tasks snowball on you in a big mass of procrastination. If you let your task list grow to an intimidating size, though, you may start stressing out about the things you aren’t doing. Let me show you how to procrastinate—I mean, reschedule your tasks effectively—so that you can work with a more manageable task list.

If tasks are starting to accumulate, it’s a good sign that you need to review those tasks. Do you really need to do them? If not, delete them by moving to the line in your Org agenda view and pressing C-k (org-agenda-kill). You can also edit your ~/organizer.org file and delete them, but org-agenda-kill is more convenient.

If you really need to do the tasks, but there’s no point in seeing it in today’s task list because you can’t do it today anyway, use C-c C-s (org-agenda-schedule) to reschedule the task. If you’re only moving it a couple of days ahead, use S-right (org-agenda-later) to move it forward, and S-left (org-agenda-earlier) if you overshoot.

Some tasks show up again and again on your task list, and you know you need to do them, but you don’t know where to getting started. “TODO Write a book” is not a good task, because it’s just too big to do in one sitting and it doesn’t tell you what to do right now. Big tasks are often projects in disguise. Break it down into smaller tasks, and schedule those instead. If you’re in the Org agenda view, press RET (org-agenda-switch-to) to jump to the task in your ~/organizer.org file. Break it down into smaller tasks by adding sub-headings and more TODOs, like this:

 ** Write a book
 *** TODO Make an outline of what to write
 *** TODO Read sample query letters
 *** TODO Write a query letter

… and so on.

Then you can use C-c C-s (org-schedule) to schedule those tasks.

Use these commands to keep your task list manageable. That way, you get the warm and fuzzy feeling of accomplishment when you finish what’s on your list and you look at everything you’ve done today.

Reviewing your accomplishments

If you’ve been good about keeping your tasks in your ~/organizer.org file, working with your Org agenda view, and marking tasks as DONE when you finish them, you’ll find it easy (and satisfying!) to review your accomplishments. Just open your daily or weekly Org agenda view with C-c a a (org-agenda, org-agenda-list). Type l (org-agenda-log-mode) to show completed tasks. Pat yourself on the back, then plan yourself another wonderful day tomorrow!

On Technorati: , ,

Random Emacs symbol: set-fill-column – Command: Set `fill-column’ to specified argument.

Oh no! Version dependencies…

2I really want to share my code for reviewing Org timeclock entries for each date. However, it depends on functionality that’s only in the development version of Org. Do I tell people to change to that version? Do I try to make it work with the standard version that comes with Emacs? And the development version of Org comes with all sorts of nice goodies, too…

Okay, I figured out what to do. I’m going to include it, but I’ll use a distinctive background to show people that this is only available with a newer version of Org. That way, the bleeding edge geeks can still do all sorts of cool stuff.

Clocking Time with Emacs Org

2Many professionals bill clients for their time. Even if you don’t, keeping track of the time you actually spend on tasks can help you improve your time estimates and check if you’re spending enough time on the things that are important to you. For example, keeping track of the time you spend on tasks might show you that you spend two and a half hours each day just responding to e-mail. If you can identify problem areas like that, then you can look for more effective ways to perform the tasks that take up a lot of your time.

I love Org’s timeclocking support, and I think you will too. Because it’s integrated with your task list, you don’t have to switch to separate application or reenter data. You can get more detailed time reports, too. All you have to do is remember to clock in before you start a task and clock out when you finish it.

Starting and stopping the clock

You can clock in by moving your cursor to the task headline in either your organizer.org file or the org agenda view, and then pressing C-c C-x C-i (org-agenda-clock-in or org-clock-in, depending on context). This adds the time stamp to the task. If you are already clocked into another task in that organizer file, you’ll be clocked out of it to prevent you from accidentally double-billing.

To clock out of a task, type C-c C-x C-o from the task headline. Marking a task as done will also automatically stop the clock, if that was the task with the active clock.

Here’s some code to make this even easier. The following code clocks in whenever you market task is started, and clocks out when you market a task as WAITING. It also automatically market task is started if you clock in. This takes advantage of the Org configuration previously suggested in the Setup section. Add this to your ~/.emacs and evaluate it:

(eval-after-load 'org
  '(progn
     (defun wicked/org-clock-in-if-starting ()
       "Clock in when the task is marked STARTED."
       (when (and (string= state "STARTED")
		  (not (string= last-state state)))
	 (org-clock-in)))
     (add-hook 'org-after-todo-state-change-hook
	       'wicked/org-clock-in-if-starting)
     (defadvice org-clock-in (after wicked activate)
      "Set this task's status to 'STARTED'."
      (org-todo "STARTED"))
    (defun wicked/org-clock-out-if-waiting ()
      "Clock out when the task is marked WAITING."
      (when (and (string= state "WAITING")
                 (equal (marker-buffer org-clock-marker) (current-buffer))
                 (< (point) org-clock-marker)
	         (> (save-excursion (outline-next-heading) (point))
		    org-clock-marker)
		 (not (string= last-state state)))
	(org-clock-out)))
    (add-hook 'org-after-todo-state-change-hook
	      'wicked/org-clock-out-if-waiting)))

What if you forgot to clock into a task when you started? No problem. Simply clock in and out of it, then edit the starting timestamp for the task in your ~/organizer.org file. To find a starting timestamp, move your cursor to the task headline. If the task has been collapsed to a single line, press TAB to expand it. Look for a line that starts with CLOCK:, or a collapsed segment that starts with :CLOCK:. If you see a collapsed segment, he expanded by moving a cursor to it and pressing tab. Find the clock entry you want to change, and if the timestamp, and press C-c C-y (org-evaluate-time-range) to update the time total.

Reporting time

By project

To see how much time you’ve spent on a project or task, open your ~/organizer.org file and press C-c C-x C-d (org-clock-display). Total times will be added to each headline, summarizing the times for each subtree.

You can also use one of Org’s dynamic blocks. Open your ~/organizer.org file, move your cursor to where you want the report inserted, and type C-c C-x C-r (org-clock-report). By default, the reports will include all the second-level headings for all the days.

What if you want to limit the report to just the time you clocked last week?

Reporting time for a period

To summarize it for a span of days, change the starting line from:

#+BEGIN: clocktable :maxlevel 2 :emphasize nil

to something like:

#+BEGIN: clocktable :maxlevel 2 :emphasize nil :tstart "<2007-12-25 Sun>" :tend "<2007-12-31 Mon>"

where tstart is the starting time/date and tend is the ending time/date. You can add the timestamps either manually or with C-c C-. (org-time-stamp). After you change the block definition, update the clock table by typing C-c C-x C-u (org-dblock-update).

You can also use a definition like:

#+BEGIN: clocktable :maxlevel 2 :emphasize nil :block today

to see today’s entries. Other block keywords are ‘yesterday’, ‘thisweek’, ‘lastweek’, ‘thismonth’, ‘lastmonth’, ‘thisyear’, or ‘lastyear’.

If you need more levels of headings, change the value of maxlevel. For example, to see a detailed clock table with up to 10 levels of headings, use

#+BEGIN: clocktable :maxlevel 10 :emphasize nil :block today

clocktable summarizes the reported time. What if you want the time broken down by day?

Reporting time by days

The following code creates a custom dynamic block that breaks the reported time by date. Add the following code to your ~/.emacs:

(defun org-dblock-write:rangereport (params)
  "Display day-by-day time reports."
  (let* ((ts (plist-get params :tstart))
         (te (plist-get params :tend))
         (start (time-to-seconds
                 (apply 'encode-time (org-parse-time-string ts))))
         (end (time-to-seconds
               (apply 'encode-time (org-parse-time-string te))))
         day-numbers)
    (setq params (plist-put params :tstart nil))
    (setq params (plist-put params :end nil))
    (while (<= start end)
      (save-excursion
        (insert "\n\n"
                (format-time-string (car org-time-stamp-formats)
                                    (seconds-to-time start))
                "----------------\n")
        (org-dblock-write:clocktable
         (plist-put
          (plist-put
           params
           :tstart
           (format-time-string (car org-time-stamp-formats)
                               (seconds-to-time start)))
          :tend
          (format-time-string (car org-time-stamp-formats)
                              (seconds-to-time end))))
        (setq start (+ 86400 start))))))

After you load that code, you’ll be able to use a dynamic block of the form

#+BEGIN: rangereport :maxlevel 2 :tstart "<2007-12-25 Tue>" :tend "<2007-12-30 Sun>"
...
#+END:

to see your time reported by date. Fill it in by moving your cursor within the block and typing C-c C-x C-u (org-dblock-update).

Org makes it easy to capture timeclock information by integrating the timeclock into your task list so that you don’t even have to think about it, and it can report this time by project or by date. You can use this information to bill clients, improve your time estimates, or reflect on the way you do things. All you have to do is clock in by marking a task as STARTED, and clock out by marking a task as WAITING or DONE. Don’t get discouraged if the time clock shows you do only a few hours of productive work each day. Use that to help you figure out how to do to things better!

On Technorati: , ,

Random Emacs symbol: term-previous-matching-input-string – Function: Return the string matching REGEXP ARG places along the input ring.