"Linux Gazette...making Linux just a little more fun!"

A True "Notebook" Computer?

by Larry Ayers


Recently I happened across an ingeniously designed add-on LISP package for the GNU Emacs editor. It's called Notes-Mode, and it helps organize and cross-reference notes by subject and date. It was written by John Heidemann. Here's his account of how he happened to write the package:

Briefly, I started keeping notes on-line shortly after I got a portable computer in January, 1994. After a month-and-a-half of notes, I realized that one does not live by grep alone, so I started adding indexing facilities. In June of 1995 some other Ficus-project members started keeping and indexing on-line notes using other home-grown systems. After some discussion, we generalized my notes-mode work and they started using it. Over the next 18 months notes-mode grew. Finally, in April, 1996 I wrote documentation, guaranteeing that innovation on notes-mode will now cease or the documentation will become out of date.

Using Notes-Mode

Here's what one of my smaller notes files looks like:

25-Jul-97 Friday

* Today
prev: <file:///~/notes/199707/970724#* Today>
next: <file:///~/notes/199707/970728#* Today>

* Prairie Plants
prev: <file:///~/notes/199707/970724#* Prairie Plants>
next: <none>
So far the only results I've seen in response to the various desultory efforts I've made to direct-seed prairie plants in the west prairie: 1: Several rattlesnake-master plants in a spot where we burned a brush-pile. Two are blooming this summer. 2: One new-england aster near the above. There are probably others which are small and haven't flowered yet. * Linux Notes ------------- prev: <file:///~/notes/199707/970724#* Linux Notes> next: <file:///~/notes/199708/970804#* Linux Notes> I noticed today that a new version of e2compress was available, and I've patched the 2.0.30 kernel source but haven't compiled it yet. I've been experimenting with the color-syntax-highlighting version of nedit 4.03 lately; it has a nifty dialog-box interface for creating and modifying modes. Easier than LISP!

The first entry,Today, contains nothing; it just serves as a link to move from the current notes file to either the previous day's file or the next day's. Any other word preceded by an asterisk and a space will serve as a hyper-link to previous or next entries with the same subject. Type in a new (or previously-used) subject with the asterisk and space, press enter, and the dashed line and space will automatically be entered into the file; this format is what the Perl indexing script uses to identify discrete entries.

While in Emacs with a notes-mode file loaded, several keyboard commands allow you to navigate between successive entries, either by day or by subject, depending on where the cursor is when the keystroke is executed. A handy key-binding for notes-mode is Control-c n, which will initialize a new notes file for the day if the following LISP code is entered into your ~.emacs file:
(define-key global-map "^Cn" 'notes-index-todays-link). The "^C" part is entered into the file by entering Control-q Control-c.

When Notes-Mode is installed a subdirectory is created in your home directory called Notes. As you use the mode a subdirectory for each month is created as well as a subdirectory under each month's directory for each week in the month. The individual note files, one for each day the mode is used, are given numerical names; the format of the path and filename can be seen in the above example.

The ability to navigate among your notes is enabled by means of a Perl script called mkall, which is intended to be run daily by cron. Mkall in turn calls other Perl scripts which update the index file with entries for any new notes you may have made. This system works well, making good use of Linux's automation facilities. Once you have it set up you never have to think about it again.

While this mode is designed for an academic environment in which voluminous notes are taken on a variety of subjects, it can also be useful for anyone who wants to keep track of on-line notes. It could even be used as a means of organizing diary or journal entries. The only disadvantage I've seen is that, though the notes-files are ASCII text readable by any editor, the navigation and hyper-linking features are only available from within Emacs. This is fine if you use Emacs as your main editor but makes the package not too useful for anyone else. XEmacs users are out of luck as well, as the package doesn't work "out-of-the-box" with XEmacs. I imagine a skilled LISP hacker could modify Notes-Mode for XEmacs; I've made some tentative attempts but without success.


The only source I've seen for this package is from the author's web page, at this URL:

The documentation for Notes-Mode can be browsed on-line at this site if you'd like to read more before trying it out.

Copyright © 1997, Larry Ayers
Published in Issue 22 of the Linux Gazette, October 1997