From 6d34a5533deec0ac3cd9605a202ee36dcdd4098e Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 30 Apr 2002 03:53:21 +0000 Subject: [PATCH] New file. --- bbdb-to-lsdb.el | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 bbdb-to-lsdb.el diff --git a/bbdb-to-lsdb.el b/bbdb-to-lsdb.el new file mode 100644 index 0000000..e13f61a --- /dev/null +++ b/bbdb-to-lsdb.el @@ -0,0 +1,52 @@ +;;; bbdb-to-lsdb.el --- the data conversion utility from BBDB to LSDB + +;; Copyright (C) 2002 Daiki Ueno + +;; Author: Daiki Ueno +;; Keywords: adress book + +;; This file is part of the Lovely Sister Database. + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;;; To convert your ~/.bbdb to ~/.lsdb, type the following command from shell: +;;; emacs -batch -l ./bbdb-to-lsdb.el + +;;; Code: + +(require 'bbdb) +(require 'lsdb) + +(let ((bbdb-records (bbdb-records)) + value) + (lsdb-maybe-load-hash-tables) + (while bbdb-records + (when (setq value (bbdb-record-net (car bbdb-records))) + (lsdb-update-record + (nconc + (list (bbdb-record-name (car bbdb-records)) + (cons 'net value)) + (if (setq value (bbdb-record-aka (car bbdb-records))) + (list (cons 'aka value))) + (if (setq value (bbdb-record-company (car bbdb-records))) + (list (cons 'company value))) + (bbdb-record-notes (car bbdb-records))))) + (setq bbdb-records (cdr bbdb-records))) + (lsdb-mode-save t)) + +;;; bbdb-to-lsdb.el ends here -- 1.7.10.4