#!/usr/bin/perl
Sender: owner-cbbers@me.umn.edu
To: cbbers@me.umn.edu
Subject: [CBB] CBB/Emacs database interface
Date: Sun, 3 Jan 1999 22:37:28 -0600

I put together a very simple interface to the emacs database, edb 
(available from theory.lcs.mit.edu under people/mernst).  I realize this 
will be of limited interest, but if you use edb with emacs, this 
interface will allow you to browse CBB data in text mode.  (It will also 
allow modification--- not AT ALL a good idea as the file format gets 
modified by edb.  But, infinite customization in true emacs style is also 
possible...)

I've provided a fmt and a dba file.  If your CBB data file is named 
"foo.cbb" then call these "foo.fmt" and "foo.dba" and put them in the 
directory with foo.cbb.  (Not strictly necessary but allows edb to find 
them without questioning you about it.)  PLEASE work with a COPY of your
main CBB data file.  You have been warned.  I disclaim all responsibility
for loss or damage to your data.

This is of course released into the public domain (wowie kazowie).

Bob Newell
Los Alamos, New Mexico

fmt file
-------------cut-----------
== Date  Check  Desc  Debit  Credit  
     Categ  Comment  Cleared ==
\cbb-date  \check  \desc  \debit  \credit  
     \cat  \com  \cleared
-------------cut-----------

dba file
-------------cut-----------
(database-set-fieldnames-to-list database '(
    (cbb-date . date) check desc debit credit cat com cleared))

(database-set-print-name database "Check Book Balancer")

(setq db-before-read-hooks
 (function (lambda ()
  (save-excursion
   (switch-to-buffer db-buffer)
   (while (search-forward-regexp "^#" nil t)
     (beginning-of-line)(kill-line)(kill-line))))))
-----------cut-------------
