Categories: geek » emacs » planner

RSS - Atom - Subscribe via email

Capturing Notes with Remember

Posted: - Modified: | emacs, org, planner, wickedcoolemacs

Ideas come from everywhere. While reading this blog, you might come across interesting snippets that you’d like to save. While writing code, you might be hit by an idea for something you want to do with the program. While on a phone call, you might need to write down what you need to prepare for a meeting the next day.

How do you take notes now? Do you jot your notes on a scrap of paper or into a leather notebook? Do you copy and paste what you’re looking at into a plain text file or document? Do you scribble things into a personal digital assistant?

I’ve tried different note-taking strategies: colorful mindmaps, outlined text files, even voice recordings. I felt frustrated every time I had to write down whose e-mail or which webpage prompted the note (shouldn’t the computer do that automatically?), but I was even more frustrated when I’d come across a note and not remember why I wrote it.

Remember changed all that for me. The key ideas behind Remember are that you should be able to write notes with minimal distraction, and that as the context should be automatically picked up so that you don’t have to write it down. If you’re writing a note based on a mail message, Remember will pick up the details of the message and create a hyperlink so that you can view the original message when reviewing your notes. If you’re working on a file, Remember will link to it so that you can jump back to it. If you’re browsing a web page (in Emacs, of course), Remember will remember the title and URL, so that you can go back to the page when you want to clarify something in your notes. After you save the note, you’ll be back in the same environment you were: no need to switch applications and no need to remember different keyboard shortcuts.

You might think that Remember’s only worth it if you do _everything_ in Emacs. For me, it worked the other way around. I started by using Remember to take notes in Planner, a personal information manager available for Emacs. As I got accustomed to the way Remember and Planner just automatically hyperlinked to whatever I was looking at, I thought: Why doesn’t my mail client do this? Why doesn’t my web browser do this? Why doesn’t my chat client do this? So I ended up reading through the manuals, figuring out how to do all these things in Emacs—and I loved it, eventually doing most of my work (and play!) within an Emacs frame. Although I use other applications now, like Lotus Notes for work mail and Mozilla Firefox for browsing, I still switch back to Emacs for my notes.

In this section, you’ll learn how to set up Remember and take quick notes in Emacs. We’ll start by configuring Remember to save your notes to a file, and how to configure Remember to save to different places depending on the content. You’ll also learn how to quickly search your notes file for entries.

You can also integrate Remember into other note-taking systems in Emacs. The sections that cover those systems will also show you how to configure Remember to save your notes there.

Setting Up Remember

Remember is a separate package, which you can download from https://gna.org/projects/remember-el . As of this writing, the latest stable release is Remember 1.9. Download the latest version and unpack it into your ~/elisp directory. You should end up with a new directory, ~/elisp/remember-1.9 .

To configure Remember to save to plain text files, add this code to your ~/.emacs and evaluate it:

(add-to-list 'load-path "~/elisp/remember-1.9") ;; (1)
(require 'remember-autoloads)
(setq remember-data-file "~/notes.txt")  ;; (2)
(global-set-key (kbd "C-c r") 'remember) ;; (3)

(defun wicked/remember-review-file ()
 "Open `remember-data-file'."
 (interactive)
 (find-file-other-window remember-data-file))
(global-set-key (kbd "C-c R") 'wicked/remember-review-file) ;; (4)
;; Not (global-set-key (kbd "C-c r")... as originally written... Thanks for catching that, Seth!

  • 1: Change this to the directory that contains remember.el
  • 2: Notes will be saved to this file. You can change this if you want; just keep in mind that this section refers to ~/notes.txt.
  • 3: C-c r (remember) is a handy shortcut key for remember. You can also bind it to other shortcut keys such as F9 r.
  • 4: This shortcut makes it easy to check your remembered notes.

After you’ve configured Remember, try it out by typing C-c r (remember). Your Emacs frame will be split in two, and one of the windows will be a *Remember* buffer. Type your note. The first line will be the headline, and the rest of the buffer will be the body of the note. If you call C-c r (remember) from a file, the filename will automatically be included at the end of the buffer. Type C-c C-c (remember-buffer) to save the note.

Try it now by typing C-c r (remember) to bring up the buffer, typing in a short note, and using C-c c (remember-buffer) to save it. If you open ~/notes.txt to review your note, you’ll find something like this:

 ** Sat Jan 12 14:43:02 2008 (Your headline goes here)

 Your note body goes here

 /home/sacha/.emacs

You can even save yourself some copying and pasting. Mark a region of text and use C-u C-c r (remember). The selected text will be included in the buffer, so all you have to do is comment on it.

Make a habit of typing C-c C-r or C-u C-c C-r (remember) when you need to remember something. Type C-c C-c (remember-buffer) to get back to work, knowing that your notes have been safely saved in your ~/notes.txt file.

Reviewing Your Notes

Use C-c R (wicked/remember-review-file) to check your notes, or open ~/notes.txt yourself.
To search your notes, use C-c R (wicked/remember-review-file) to open the file, then use C-s (isearch-forward) to search for words interactively, or use M-x occur to find all lines containing a word.

You may notice that the default format that Remember uses is an outline format that is compatible with Org and Allout, both of which have powerful outline-editing tools. I prefer Org’s outline-editing commands, and you’ll learn about them in the “Outline Notes with Org” section. Here’s a quick summary.

First, you need to switch the buffer to Org mode by typing M-x org-mode. To automatically open your notes file in Org mode, add

-*- mode: org -*-

to the first line of your ~/notes.txt. Then, when you open your ~/notes.txt file, it will be in Org mode.

You can quickly collapse or expand all the outline entries by pressing S-TAB (org-shifttab). To collapse or expand a single entry, move the point to the headline (the line beginning with *, **, or any number of asterisks), then press TAB (org-cycle). To move an entry up or down, move the point to the headline and press S-UP (org-shiftup) or S-DOWN (org-shiftdown). To demote or promote a heading, press M-RIGHT (org-metaright) or M-LEFT (org-metaleft).

You can treat ~/notes.txt as your inbox, and keep your organized notes in another file or groups of files. Cut and paste the text between the files to clear your inbox, and use M-x grep to search multiple files. Alternatively, you can keep all of your notes in one large text file, and use C-s (isearch-forward) and M-x occur to search for information.

Now you know the basics of remembering information, saving it into a file, and reviewing the file. By default, Remember annotates your notes with a filename, if you were looking at a file when you called C-c r (remember). As you learn more about Emacs, you may want to configure Remember to add more intelligent annotations and other text to the Remember buffer. The more work Remember does for you, the less work you have to do!

Enabling annotation functions

The easiest way to get Remember to automatically understand mail messages, Web pages, info files, BBDB contact records, and other sources of information in Emacs is to use either Org or Planner. To learn how to integrate Remember with either Org or Planner, read the section on “Outline Your Notes with Org” and “Writing Your Journal with Planner”.

You can also define your own annotation functions. When you call C-c r (remember) from a buffer, Remember goes through each of the functions in remember-annotation-functions, and it uses the first non-nil value returned.

For example, you may work with many temporary buffers that don’t have filenames. To create an annotation function that adds buffer names, add the following code to your ~/.emacs after the basic Remember configuration code:

(eval-after-load 'remember
  '(progn
    (add-to-list 'remember-annotation-functions 'buffer-name t)))

This adds buffer-name to the end of the annotation list, making it a last resort.

What if you want line numbers included with the filename or buffer name? You could replace the previous code with this:

(defun wicked/remember-line-numbers-and-file-names ()
 "Return FILENAME line NUMBER."
 (save-restriction
  (widen)
   (format " %s line %d"
    (or (buffer-file-name) (buffer-name))
    (line-number-at-pos))))
(eval-after-load 'remember
  '(progn
     (add-to-list 'remember-annotation-functions
                  'wicked/remember-line-numbers-and-file-names)))

With that code, C-c r (remember) will automatically pick up the line number from your file or buffer.

By default, Remember saves your notes to a plain-text file, so you’ll have to open the files manually. The command M-x ffap or find-find-file-at-point may be convenient. If you want hyperlinks that you can visit easily, consider saving your notes in an Org or Planner file instead.

Now you’ve got context. What else can you do with the Remember buffer?

Adding Other Text to the Remember Buffer

Remember has plenty of hooks that let you modify the behavior. For example, you might want to insert a random tagline or fortune-cookie saying whenever you create a note. This is a fun way to encourage yourself to write more, because then there’s a little surprise every time you open a Remember buffer.

Here is a totally small-scale way to use random lines from a text file. Let’s say that you have a text file made up of movie quotes, taglines, knock-knock jokes, or short fortune-cookie sayings. When I wrote this code, I used Japanese/English sentence pairs about cats, because I was studying Japanese. You can use whatever tickles your fancy, as long as this text file (~/taglines.txt) has one line per saying.

(defun wicked/random-tagline (&optional file)
  "Return a random tagline."
  (with-current-buffer (find-file-noselect (or file "~/taglines.txt"))
    (goto-char (random (point-max)))
    (let ((string
           (buffer-substring (line-beginning-position)
                             (line-end-position))))
      string)))

(eval-after-load 'remember
  '(progn
     (defadvice remember (after wicked activate)
       "Add random tagline."
       (save-excursion
         (goto-char (point-max))
         (insert "\n\n" (wicked/random-tagline) "\n\n")))))

If you want multi-line sayings, look into the Emacs fortune cookie package, and replace wicked/random-tagline with a function that returns a random string.

This code modifies the behavior of C-c r (remember) by inserting a random tagline after the buffer has been prepared. You can use the same idea to insert a timestamp noting the time you started, use a template, or modify the text in other ways.

Saving to Different Places

You can also change how Remember saves its notes. For example, if you want all of the notes that contain the word “:EMACS:” or “:WORK:” to go into separate files, you can add this code to your ~/.emacs:

(defvar wicked/remember-keywords
  '((":EMACS:" . "~/emacs.txt")
    (":WORK:" . "~/work.txt"))
  "*List of (REGEXP . FILENAME).
If an entry matches REGEXP, it will be storied in FILENAME.
The first regular expression that matches is used.")
(eval-after-load 'remember
  '(progn
     (defadvice remember-region (around wicked activate)
       "Save notes matching `wicked/remember-keywords' elsewhere."
       (let* ((b (or beg (min (point) (or (mark) (point-min)))))
	      (e (or end (max (point) (or (mark) (point-max)))))
	      (string (buffer-substring-no-properties b e))
	      (done nil)
	      (keywords wicked/remember-keywords))
	 (while keywords
	   (when (string-match (caar keywords) string)
	     (let ((remember-data-file (cdar keywords)))
	       ad-do-it)
	     (setq keywords nil done t))
	   (setq keywords (cdr keywords)))
	 (unless done
	   ad-do-it)))))

You can even configure Remember to use different handler functions. This chapter covers several note-taking systems for Emacs, and you may want to use Remember to save to more than one note-taking system. For example, you can set up C-c r p to start a Remember buffer that saves to Planner, and C-c r o to start a Remember buffer that saves to Org. Here’s the code for your ~/.emacs:

(defun wicked/remember-to-org ()
  "Remember to Org."
  (let ((remember-annotation-functions   ;; (1)
	 (cons 'org-remember-annotation
	       remember-annotation-functions)))
    (remember)
    (set (make-variable-buffer-local
	  'remember-handler-functions)
	 '(org-remember-handler))))      ;; (2)

(defun wicked/remember-to-planner ()
  "Remember to Planner."
  (let ((remember-annotation-functions   ;; (3)
	 (append planner-annotation-functions
		 remember-annotation-functions)))
    (remember)
    (set (make-variable-buffer-local
	  'remember-handler-functions)
	 '(remember-planner-append))))      ;; (4)

(global-unset-key (kbd "C-c r"))  ;; (5)
(global-set-key (kbd "C-c r o") 'wicked/remember-to-org)
(global-set-key (kbd "C-c r p") 'wicked/remember-to-planner)
  • 1: We need to make sure that Org-compatible links are created.
  • 2: This makes C-c C-c save the note to the Org file.
  • 3: Planner uses a list of annotation functions, so we add all of them to the beginning of the list.
  • 4: This makes C-c C-c save the note to the Planner page.
  • 5: We need to unset keyboard shortcuts before we can set longer keyboard shortcuts that start with the same sequence.

To learn more about configuring Remember with the different note-taking systems, read the sections for those systems.

Random Emacs symbol: compilation-find-file – Function: Find a buffer for file FILENAME.

How I got hooked

Posted: - Modified: | emacs, planner, wickedcoolemacs

I fell in love with Emacs because of Planner and Remember. I got hooked. By that, I mean that I discovered the joys of modifying the behavior of other people’s code through hooks. Well-written Emacs code has plenty of entry points so that you can change things without rewriting everything, and both Planner and Remember were well-written. The flexibility that John Wiegley had built into Planner and Remember (in his spare time!) convinced me that I absolutely needed to learn Emacs Lisp. I e-mailed John, singing high praises about Planner and volunteering to help track down any bug reports so that I could learn in the process of helping others.

What did he do? He made me the maintainer for Planner, the go-to person, the buck-stops-here person. Was I terrified? My first time being in charge of an open source project, a language that I had just begun to learn, and schoolwork to do on top of all of that… Of course I was scared. I found a way to make working on Planner part of my final-year project (might as well get academic credit for hacking on it!), made the Emacs Lisp Intro and the Emacs Lisp manuals my weekend, bedtime, and mealtime reading. Back then, Planner.el was one file, which made it a little less intimidating.

At first, I found it hard to think of a way to improve Planner, which was already a great way to track my tasks. Remember was also a good way to jot down short notes that were automatically added to my Planner day page. Both Planner and Remember had some support for picking up hyperlinks to whatever I was looking at when I created the task or note. What was missing? Timestamps so that I could tell when I wrote a note; more link support so that I could automatically link to a file or a mail message or a contact record; private, perhaps even encrypted segments; copying a note to another page; publishing a blog as RSS… For the next few years, I worked with incredible people who had thought
long and hard about how they managed their tasks and their notes, and
who taught me how they did things through their feature requests and
their code. I became more comfortable in Emacs Lisp than in any other computer language I knew (eventually maintaining Remember as well), I had formed a thriving community of about 200 people around the world who also contributed ideas and code, and I was hooked.

Because I could change so much about Emacs, I had so much fun
coming up with creative applications. When a friend and I
were studying Japanese, she wanted to know if I could set up Emacs with
flashcards and example sentences so that we could learn words in
context. I knew that Jim Breen had a huge database of example Japanese
sentences with their English translations and that this was freely
available on the Net. I downloaded the database and–one crazy idea
fueled by another in that natural sugar high that can happen when two
geeks start brainstorming–I made our learning fun by
extracting all the cat- and kitten-related sentences. This is how I
learned about such wonderfully onomatopeic words as “fuwafuwashita”,
which means “fluffy”. We both adored cute little kitties, and reading
example sentences about these furballs would make our studies
delightful. Now, where could we put these sentences so that we’d run
into them often? Aha! Remember! Every time we wrote a blog post or
needed a scratch pad to store some information, we would be rewarded by a
short sentence in Japanese about cute little kittens, and we could look
up the meaning and pronunciation with custom keyboard shortcuts. And
hey, it worked for me–I found myself writing because I wanted to see
what sentence would come up, and I found myself learning because I’d
run into all these cool words. For variety, I switched to sentences
about computers and other topics that I wanted to be able to discuss.
Try getting your blog editor or note manager to reward you each time you share a story or write down a tidbit of information. There is incredible power in customizing your note-taking system to just the way you think, and when you combine that with the delight of a surprise, you have something that is difficult to do with any other system–paper-based or electronic, text-based or graphical, commercial or free.

I turned the projects over to other maintainers when I started with graduate school, but as you can see, I still love working with Emacs. My mind does this little somersault of joy when I pull off a particularly nifty tweak or when I run across a beautiful piece of code. And yes, one of the reasons why I’m writing this book about Emacs is because I’d love to have an opportunity to explore all the nooks and crevices of this piece of software–well, not all, because by the time the book hits press, people will have added even more.

In this chapter on notetaking, I hope to be able to show you the mechanics of note-taking in Emacs–but more than that, I hope to show the sheer joy of having a system that you can play with, of not just filing notes in a database but M-x remember-ing in a system that will make you smile or laugh, of shaping and reshaping things until they fit you like clay fits your hand. Come and have fun.

Writing plans for the chapter on managing notes

Posted: - Modified: | emacs, org, planner, wickedcoolemacs, writing

– [ ] Keeping Notes in Emacs
Structured vs Unstructured (outline, free-form)
Flat vs Hyperlinked
Private vs Public
File structure (one file, daily, snippets)

In this section, you’ll learn about the different kinds of notes you take, and you will be able to choose one or two Emacs modules to start learning.

– [ ] Capture and retrieve – Remember, search

Getting the ideas out of your head and into your note-taking system; searching your notes (basic), searching your notes (specific)

Wicked cool code: Remembering to different note-taking systems, searching different note-taking systems

– [ ] Outline Notes with Org, Blorg

In this section, you’ll learn how to keep outlined notes using Org.  You’ll be able to create headings, sub-headings, and text notes. You’ll also learn how to manage outline items by promoting, demoting, and rearranging them. These basic editing commands are covered in the Emacs Org manual, so I’ll just give a brief summary..

You’ll also get tips on how to capture text quickly (M-x remember, dabbrev), work with large outline files (split windows are useful), and search your notes efficiently (searching headings or text).

Lastly, you’ll learn how to publish your Org file as HTML or LaTeX.

Wicked cool code would be: searching, how to import to and export from Freemind, a graphical mind-mapping program.

– [ ] Daily Notes with Planner

In this section, you’ll learn how to write a day-based journal using Planner. In addition to free-form notes on the page, you’ll also be able to keep semi-structured notes typed in manually or captured using Remember. You’ll also learn how to publish the resulting pages as HTML and RSS, and how to customize the output.

Wicked cool code would be: searching notes and displaying matching headlines, private notes, publishing note headlines, and publishing a note index.

– [ ] Hyperlinked Notes with Muse

In this section, you’ll learn how to create a personal wiki using Muse.  You’ll learn how to create pages, link to pages, and publish your wiki.

Wicked cool code: Capturing notes to specific pages using Remember and keyword matches, private pages, publishing pages when you save them.

– [ ] Snippets with Howm

In this section, you’ll learn how to manage random snippets of information using Howm.

– [ ] Blogging from Emacs – WordPress, LJ, Blogger,Muse-Blosxom, EmacsAtomAPI

In this section, you’ll learn how to use Emacs as a blogging client for many popular platforms. This is mainly for keeping other blogs in sync, although I’ll also talk about the possibility of using planner-rss + something like Feedwordpress.

– [ ] Encrypted Notes (full file, segments) – MOSTLY WRITTEN

In this section, you’ll learn how to encrypt your notes. Actually, this will probably be split up into the different tools…

Planner, basic configuration

Posted: - Modified: | emacs, planner, wickedcoolemacs

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.

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

Emacs: Choosing between Org and Planner

| emacs, org, planner, wickedcoolemacs

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.

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

Okay, we’re in business – 5 years of my life in WordPress

Posted: - Modified: | blogging, emacs, planner

After a fair bit of Emacs hacking to export all my blog entries from Planner into RSS and then import that into WordPress using Feedwordpress, I’m happy to present this WordPress view of my blog. It should stay relatively in-sync with my Emacs blog. Emacs still gives me a friendlier and more powerful interface for blogging, but at least this way you get to use all the fancy stuff for reading blog entries. =)

Random Emacs symbol: internal-set-alternative-font-registry-alist – Function: Define alternative font registries to try in face font selection.

Contact report

| bbdb, emacs, planner

I started tracking e-mail sent on 2006.09.01 with a
nifty piece of Emacs Lisp code I wrote just for the
purpose. Now I have two months of interesting data which include not
only e-mail but also the occasional in-person contact or phone call
that I remember to note. It's not complete – e-mail's the only thing
that gets automatically tracked – but it does give me interesting
information. Here's the contact report for your amusement:

Contact report

It's sorted by overall frequency and then by regular frequency.
Warning! Parentheses follow.

(defun sacha/count-matches (regexp string)
  (let ((count 0)
        (start 0))
    (while (string-match regexp string start)
      (setq start (match-end 0)
            count (1+ count)))
    count))

(defun sacha/bbdb-contact-report-as-alist (&rest regexps)
  "Creates a list of (name count-regexp1 count-regexp2 count-regexp3)..."
  (setq regexps (reverse regexps))
  (delq nil
        (mapcar
         (lambda (rec)
           (when (bbdb-record-name (car rec))
             (let ((reg regexps)
                   (notes (bbdb-record-notes (car rec)))
                   list)
               (while reg
                 (setq list (cons (sacha/count-matches (car reg) notes)
                                  list))
                 (setq reg (cdr reg)))
               (cons (sacha/planner-bbdb-annotation-from-bbdb rec)
                     list))))
         bbdb-records)))

(defun sacha/bbdb-alist-sort-by-total (alist)
  "Sort ALIST by total contact."
  (sort alist 'sacha/bbdb-contact-sort-predicate))

(defun sacha/bbdb-contact-sort-predicate (a b)
  (and a b
       (let ((count-a (apply '+ (cdr a)))
             (count-b (apply '+ (cdr b))))
         (or
          (> count-a count-b)
          (and (= count-a count-b)
               ;; If equal, look at the subtotal of the rest
               (sacha/bbdb-contact-sort-predicate (cdr a) (cdr b)))))))

(defun sacha/bbdb-kill-contact-barchart (alist)
  "Kill a barchart with the contact report for ALIST."
  (kill-new
   (mapconcat
    (lambda (entry)
      (concat
       (car entry)
       " | "
       (mapconcat (lambda (count)
                    (if (= count 0)
                        " "
                      (make-string count ?-)))
                  (cdr entry)
                  " | ")))
    alist
    "\n")))

;; Usage: (sacha/bbdb-kill-contact-barchart
;;         (sacha/bbdb-alist-sort-by-total
;;          (sacha/bbdb-contact-report-as-alist "2006.09" "2006.10")))
;; Then yank (paste) this into another buffer

Random Emacs symbol: standard-display-cyrillic-translit – Command: Display a cyrillic buffer using a transliteration.