I have recently started using BBDB, and am finding it extremely
useful; thanks Jamie.

I had previously used a 1986 vintage rolodex mode, but it didn't have
half the utility of BBDB. However, it did have the feature that its
info was stored in a textual form (single line entries with embedded
C-m's) which was accessible outside emacs (yes, there is life outside
emacs). In fact, I have a ksh function that I use frequently for
finding phone numbers

phone()   { grep -i -h $1 ~/.rolodex | tr '\015' '\012'; }

In order to make the BBDB info accessible in the same way I've written
a simple function to dump phone nos out of BBDB, so now my phone
function is

phone()   { grep -i -h $1 ~/.rolodex ~/.bbdb-phones | tr '\015' '\012'; }

Hope someone else finds it useful

Graham


;; bbdb-dump.el
;;
;; Time-stamp: <June 28, 1994 10:31:04 graham>
;;

(defvar bbdb-phones  (expand-file-name "~/.bbdb-phones")
  "Name of file in which to dump phone numbers from bbdb")

(defun bbdb-dump-phones ()
  "Dump BBDB phone numbers in .rolodex form for use with phone alias
(GDG local function)"
  (interactive)
  (let ((bbdb-electric-p nil))
    (require 'bbdb-print)
    (bbdb-phone "" nil)
    (set-buffer bbdb-buffer-name)
    (save-excursion
      (set-buffer (find-file-noselect bbdb-phones))
      (delete-region (point-min) (point-max))
      (insert-buffer bbdb-buffer-name)
      (goto-char (point-min))
      (replace-string "\C-j" "\C-m")
      (goto-char (point-min))
      (replace-string "\C-m\C-m" "\C-j")
      (save-buffer))
    ))


Reply via email to