Commits

Anonymous committed 723a208

Comments (0)

Files changed (40)

+1998-07-19  SL Baur  <steve@altair.xemacs.org>
+
+	* lisp/bbdb-migrate.el (bbdb-migration-query): Don't pass an
+	integer to concat.
+
+	* lisp/bbdb.el (bbdb-y-or-n-p): raise-screen -> raise-frame,
+	screen-visible-p -> frame-visible-p, selected-screen ->
+	selected-frame.
+	(bbdb-pop-up-bbdb-buffer-horizontally): screen-width -> frame-width.
+
+	* lisp/bbdb-xemacs.el (bbdb-fontify-buffer): set-extent-attribute
+	-> set-extent-property, set-extent-data -> set-extent-property.
+	(bbdb-hack-x-face): set-extent-data -> set-extent-property.
+
+	* lisp/bbdb-srv.el (bbdb/srv-handle-headers): Use new name for
+	set-window-buffer-dedicated.
+
+Sun Mar 15 23:46:00 1998  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el: BBDB 2.00 released
+
+Fri Mar 13 01:52:00 1998  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el: BBDB 1.91unoff released
+
+Wed Mar 12 15:37:86 1998  Colin Rafferty  <colin@xemacs.org>
+
+	* lisp/bbdb.el (parse-bbdb-internal): Fixed the error message on
+	  mismatched bbdb-file-format.
+
+Fri Feb 06 00:00:00 1998  Colin Rafferty  <colin@xemacs.org>
+
+	* bbdb-com.el (bbdb-current-field): Made it correctly count the
+	  number of lines of a specially-formatted note field.
+
+Mon Mar 09 23:25:00 1998  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el: BBDB 1.90unoff released
+	* lisp/bbdb.el (defface): Fixed defface standin
+	* lisp/bbdb.el (bbdb-alist-with-header): Created widget for
+	  bbdb-auto-notes-alist custom fix.
+	* lisp/bbdb.el (bbdb-create-hook): Default to bbdb-creation-date-hook
+	* lisp/bbdb.el (bbdb-change-hook): Default to bbdb-timestamp-hook
+	* lisp/bbdb.el (bbdb-initialize): Added autoload for bbdb-srv
+	* Makefile: Removed my paths
+	* Makefile: Added 19.34 comment about Custom
+	* Makefile: Started test harness for 19.34 and 20.2
+	* INSTALL: Added 19.34 comment about Custom
+	* lisp/Makefile: Fixed 19.34 problem with custom (:link bug)
+	* lisp/bbdb-hooks.el (bbdb-auto-notes-alist): Fixed customization
+	* lisp/bbdb-srv.el (bbdb/srv-handle-headers): buffer-disable-undo
+	  doesn't always return the argument
+	* texinfo/bbdb.texinfo: Finished revisions.
+	
+Mon Mar 09 03:03:21 1998  Carsten Leonhardt  <leo@arioch.oche.de>
+
+	* lisp/bbdb-xemacs.el (bbdb-fontify-buffer): don't access
+	  scrollbars on XEmacsen without scrollbars
+
+Mon Mar 02 00:00:00 1998  Colin Rafferty  <colin@xemacs.org>
+
+	* bbdb-com.el (bbdb-refile-notes-generate-alist): Created.
+	* bbdb-com.el (bbdb-refile-notes-default-merge-function): Created.
+	* bbdb-com.el (bbdb-refile-notes-remove-duplicates): Created.
+	* bbdb-com.el (bbdb-refile-notes-string-least): Create.
+	* bbdb-com.el (bbdb-refile-record): Use `bbdb-refile-notes-generate-alist'
+	  and `bbdb-refile-notes-default-merge-function' for merging notes.
+
+Wed Feb 25 23:35:00 1998  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb-print.el (bbdb-print-alist-widget): Protect bbdb-default-area-code
+	* lisp/bbdb-print.el (bbdb-print-alist): Protect bbdb-default-area-code
+	* lisp/bbdb-com.el (bbdb-read-new-record): Protect bbdb-default-area-code
+	* lisp/bbdb-com.el (bbdb-prompt-for-new-field-value): Protect bbdb-default-area-code
+	* lisp/bbdb-com.el (bbdb-dial): Protect bbdb-default-area-code
+	
+Sat Jan 16 00:00:00 1998  Colin Rafferty  <colin@xemacs.org>
+
+	* lisp/Makefile (extras): fixed typo in bbdb-migrate.elc
+
+Sun Feb 22 20:58:00 1998  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el: BBDB 1.59unoff released
+	* lisp/bbdb.el: Created defface stand-in macro
+	* lisp/bbdb.el (bbdb-initialize): Reword
+	* lisp/bbdb.el (bbdb-initialize): Add keybinding for bbdb-print
+	* lisp/bbdb.el (bbdb-initialize): Add autoloads for
+	  bbdb-show-all-recipients (bbdb-com), bbdb-ftp, bbdb-print
+	* lisp/bbdb.el (bbdb-initialize): Use bbdb-add-hook if none in Emacs
+	* lisp/bbdb-ftp.el: Changed comment - can use EFS
+	* lisp/bbdb-gnus.el: Changed GNUS/Gnus stuff around to reflect docs
+	* lisp/bbdb-gnus.el (bbdb/gnus-summary-author-in-bbdb): Now uses
+	  `bbdb-message-marker-field' as documented
+	* lisp/bbdb-gnus.el (bbdb-insinuate-gnus): Use `add-hook', not
+	  `bbdb-add-hook'
+	* lisp/bbdb-hooks.el: Use add-hook, not bbdb-add-hook
+	* lisp/bbdb-mhe.el: Use add-hook, not bbdb-add-hook
+	* lisp/bbdb-rmail.el: Use add-hook, not bbdb-add-hook
+	* lisp/bbdb-vm.el: Use add-hook, not bbdb-add-hook
+	* lisp/bbdb-xemacs.el: Use add-hook, not bbdb-add-hook
+	* lisp/bbdb-print.el: Moved key binding to bbdb.el
+	* lisp/bbdb-print.el: Changed default of `bbdb-print-elide'
+	* lisp/bbdb-print.el (bbdb-print-alist-widget): Fixed problem with 
+	  nil `bbdb-default-area-code'
+	* lisp/bbdb-sc.el: Fixed intro comments
+	* lisp/bbdb-sc.el: Use add-hook, not bbdb-add-hook
+	* Makefile: Alphabetized MUA directory variables, added OTHERDIR
+	  variable
+	* lisp/Makefile: Support for OTHERDIR, rearranged flags to Emacs
+	  so we can use bbdb-split-string (19.34 doesn't have split-string)
+	* texinfo/bbdb.texinfo: Almost finished doc rewrite
+	* misc/bbdb_gnus-summary-get-author.fig: Created
+
+Fri Feb 20 19:31:00 1998  Christopher Kline <ckline@media.mit.edu>
+
+        * texinfo/bbdb.texinfo: Documentation for BBDB-Reportmail
+
+Thu Feb 19 13:41:17 1998  Sam Steingold <sds@usa.net>
+
+	* lisp/bbdb.el (bbdb-version): Return a string if non-interactive
+	  
+Mon Jan  5 20:40:03 1998  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el: BBDB 1.58unoff released
+	* lisp/auto-autoloads.el: Removed all autoloads except `bbdb-initialize'
+	* lisp/bbdb-com.el: Fixed copyright
+	* lisp/bbdb-com.el: Removed autoloads
+	* lisp/bbdb-com.el: Finger group changed
+	* lisp/bbdb-com.el (bbdb-compare-records): Changed to backquote notation
+	* lisp/bbdb-ftp.el: Customized
+	* lisp/bbdb-ftp.el: Added provide of bbdb-ftp
+	* lisp/bbdb-gnus.el: Removed autoloads
+	* lisp/bbdb-gnus.el (bbdb/gnus-summary-prefer-real-names): Reformatted doc
+	* lisp/bbdb-gnus.el (bbdb/gnus-score-as-text): Remove `when'
+	* lisp/bbdb-gnus.el (bbdb-insinuate-gnus): Remove `when'
+	* lisp/bbdb-hooks.el: Added provide of bbdb-hooks
+	* lisp/bbdb-hooks.el (bbdb-time-internal-format): Replaces bbdb-time-string
+	* lisp/bbdb-hooks.el (bbdb-ignore-most-messages-alist): Fixed custom spec
+	* lisp/bbdb-hooks.el (bbdb-ignore-some-messages-alist): Fixed custom spec
+	* lisp/bbdb-hooks.el (bbdb-auto-notes-alist): Fixed custom spec
+	* lisp/bbdb-hooks.el (bbdb-auto-notes-ignore): Fixed custom spec
+	* lisp/bbdb-hooks.el (bbdb-auto-notes-ignore-all): Fixed custom spec
+	* lisp/bbdb-migrate.el: Created from migrate code in bbdb.el
+	* lisp/bbdb-print.el: Customized
+	* lisp/bbdb-print.el: Removed autoloads
+	* lisp/bbdb-reportmail.el: Changed setup docs, added RCS ID and Log strings
+	* lisp/bbdb-sc.el: Fixed jwz's e-mail address
+	* lisp/bbdb-sc.el: Customized
+	* lisp/bbdb-sc.el: Removed autoloads
+	* lisp/bbdb-sc.el: Added provide of bbdb-sc
+	* lisp/bbdb-snarf.el: Customized
+	* lisp/bbdb-snarf.el: Removed autoloads
+	* lisp/bbdb-srv.el: Rearranged copyright
+	* lisp/bbdb-srv.el: Customized
+	* lisp/bbdb-w3.el: Removed autoloads
+	* lisp/bbdb-w3.el: Added provide of bbdb-w3
+	* lisp/bbdb-whois.el: Added to copyright
+	* lisp/bbdb-whois.el: Customized
+	* lisp/bbdb-xemacs.el: Removed autoloads
+	* lisp/bbdb.el: Added define-widget definition for users without Custom
+	* lisp/bbdb.el: Added utilities custom groups
+	* lisp/bbdb.el: Removed migration code
+	* lisp/bbdb.el: Commented some code
+	* lisp/bbdb.el (bbdb-string-trim): Delete still more text properties
+	* lisp/bbdb.el (bbdb-save-db): Made error message slightly more obvious
+	* lisp/bbdb.el (bbdb-initialize): Added symbols for selective insinuation
+	* lisp/bbdb.el (bbdb-initialize): Rearranged and added some autoloads
+	* Makefile: Added migrate.el
+	* Makefile: Added deploy target
+	* texinfo/bbdb.texinfo: Changed `setq' to `add-hook' in setup instructions
+	* texinfo/bbdb.texinfo: Added to Internals section
+	
+Mon Dec  1 09:00:12 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el: BBDB 1.57Aunoff released
+	* texinfo/bbdb.texinfo: Documented new startup procedure
+	* INSTALL: Documented new startup procedure
+
+Sun Nov 30 23:26:21 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el: BBDB 1.57unoff released
+
+Sun Nov 30 22:47:04 1997  Sam Steingold  <sshteingold@cctrading.com>
+
+	* lisp/bbdb-hooks.el (bbdb-time-string): Uses format string now
+	* lisp/bbdb-com.el (bbdb-display-some): Added
+	* lisp/bbdb-com.el (bbdb-kill-older): Created
+	* lisp/bbdb-com.el (bbdb-timestamp-older): Created
+	* lisp/bbdb-com.el (bbdb-timestamp-newer): Created
+	* lisp/bbdb-com.el (bbdb-creation-older): Created
+	* lisp/bbdb-com.el (bbdb-creation-newer): Created
+
+Sun Nov 30 22:44:42 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/auto-autoloads.el: Autoloads for date functions
+	* lisp/bbdb-com.el (bbdb-complete-clicked-name): Make 19.34 happy
+	* lisp/bbdb-com.el (bbdb-compare-records): Created
+	* lisp/bbdb-com.el: Customized variables
+	* lisp/bbdb-gnus.el: Customized variables
+	* lisp/bbdb-hooks.el: Customized variables
+	* lisp/bbdb.el: Customized variables
+	* lisp/bbdb.el: Added timezone require to support date functions
+	* lisp/bbdb.el: Added migration functions, changed database version
+	* lisp/bbdb.el: Added definitions for utility functions that don't 
+	                appear in all Emacsen (in the case of string>, in none)
+	* lisp/bbdb.el (defstruct): Added documentation
+	* lisp/bbdb.el (bbdb-format-record): Can now define printing
+	                                     functions for each note field
+		                             (bbdb-format-record-fieldname)
+	* lisp/bbdb.el (bbdb-copy-thing): Created
+	* lisp/bbdb.el (bbdb-initialize): Created - Use it to initialize
+	* texinfo/Makefile (clean): Changed since we now distribute *.info*
+	* texinfo/Makefile (reallyclean): clean + removes *.info*
+	* texinfo/bbdb.texinfo: Removed `BBDB database' per jwz, added
+	                        prereq section, more special fields, some
+				internals.
+	* INSTALL: Created
+				
+Thu Oct 30 07:06:15 1997  Hrvoje Niksic <hniksic@srce.hr>
+
+	* lisp/bbdb.el: Custom blob to make defcustom and defgroup
+	  transparent in non-customized Emacsen
+
+Sun Nov 30 12:03:41 1997  Soren Dayton <csdayton@cs.uchicago.edu>
+
+	* lisp/bbdb-print.el (bbdb-print-tex-quote): Escape tildes properly
+
+Tue Nov 10 20:10:53 1997 Jens-Ulrik Holger Petersen <petersen@kurims.kyoto-u.ac.jp>
+
+	* lisp/bbdb-gnus.el (bbdb-insinuate-gnus): Improve output of
+	  warning messages.
+	* lisp/bbdb-gnus.el (bbdb/gnus-summary-known-poster-mark): Correct 
+	  docstring. 
+
+Sat Nov  8 17:00:21 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el (bbdb-string-trim): Just remove 'face property.
+	* lisp/bbdb.el: Define `defvaralias' as empty function if it's not 
+	  defined.  (GNU Emacs doesn't have it)
+
+Sun Nov  2 01:32:23 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el: BBDB 1.56unoff released 
+	* lisp/bbdb-sc.el: Added
+	* lisp/bbdb-gnus.el (bbdb-insinuate-gnus): Commented back in score 
+	  hook addition, can now set up format functions one at a time
+	  (latter based on function from Christoph Wedler)
+	* lisp/bbdb-gnus.el (bbdb/gnus-score-default-internal): Added to
+	  automagically catch changes to `bbdb/gnus-score-default'.
+	* lisp/bbdb-gnus.el (bbdb/gnus-annotate-sender): Now takes REPLACE 
+	  argument.
+	* lisp/bbdb-vm.el (bbdb/vm-annotate-sender): Ditto
+	* lisp/bbdb-mhe.el (bbdb/mh-annotate-sender): Ditto
+	* lisp/bbdb-rmail.el (bbdb/rmail-annotate-sender): Ditto
+	* lisp/auto-autoloads.el: Support for bbdb-sc, housekeeping for others.
+	* Makefile (install-pkg): Bug fix.
+	* texinfo/bbdb.texinfo: More rewriting, documentation for the
+	  Summary Buffer stuff in bbdb-gnus.el
+
+Tue Oct 28 16:08:54 1997  Christoph Wedler  <wedler@fmi.uni-passau.de>
+
+	* lisp/bbdb-gnus.el (bbdb/gnus-define-format-functions): New
+ 	  variable.
+	* lisp/bbdb-gnus.el (bbdb-insinuate-gnus): Use it.  Only define user
+	  functions the first time.  Use `bbdb-warn' instead `error'.
+	* lisp/bbdb.el (bbdb-warn): New function.  Use it.
+
+Sun Oct 26 20:47:20 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/auto-autoloads.el: Remove summary buffer autoloads
+	* lisp/bbdb-gnus.el: Variable aliases for backward compatibility
+	* lisp/bbdb-gnus.el (bbdb/gnus-summary-user-format-letter): Add
+	  more descriptive documentation.
+	* lisp/bbdb-gnus.el (bbdb/gnus-summary-in-bbdb-format-letter): Added
+	* lisp/bbdb-gnus.el (bbdb/gnus-lines-and-from): Variable name change
+	* lisp/bbdb-gnus.el (bbdb/gnus-summary-author-in-bbdb): Added
+	* lisp/bbdb-gnus.el (bbdb-insinuate-gnus): Commented out score
+	  insinuation, add %ub summary line code creation
+	* lisp/bbdb.el: Remove summary buffer autoloads
+
+Sun Oct 26 00:14:36 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb.el: BBDB 1.55unoff released
+	* texinfo/bbdb.texinfo: Partial rewrite
+	* lisp/bbdb.el: new autoloads.  Override bbdb-display-completion-list
+	  for XEmacs users.
+	* lisp/bbdb-w3.el (bbdb-www): Uses browse-url-browser-function
+	  instead of a manual funcall 
+	* lisp/bbdb-snarf.el (bbdb-snarf-region): Toss trailing space too
+
+Sat Oct 25 23:47:40 1997  Brian Edmonds  <edmonds@cs.ubc.ca>
+Sat Oct 25 23:47:40 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb-gnus.el: Changed *everything* beginning with
+          `gnus-bbdb' to `bbdb/gnus'
+	* lisp/bbdb-gnus.el (bbdb/gnus-summary-get-author): Integrated (along
+	  with associated variables and functions)
+	* lisp/bbdb-gnus.el (bbdb/gnus-score): Integrated (along with
+	  associated variables and functions)
+	* lisp/bbdb-gnus.el (bbdb-insinuate-gnus): Activate above new
+	  features
+
+Sat Oct 25 17:54:26 1997  Marco Walther  <Marco.Walther@mch.sni.de>
+Sat Oct 25 17:54:26 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* lisp/bbdb-com.el (bbdb-complete-name): Clicking on name in
+	  completion buffer now restores configuration (uses callback below)
+	* lisp/bbdb-com.el (bbdb-complete-clicked-name): Created.  See above
+	* lisp/bbdb-com.el (bbdb-display-completion-list): Wrapper 
+	* lisp/bbdb-xemacs.el (bbdb-xemacs-display-completion-list):
+	  XEmacs version of bbdb-display-completion-list, allows callbacks
+	* lisp/auto-autoloads.el: autoload for XEmacs version of
+	  bbdb-display-completion-list
+
+Mon Oct 20 18:38:28 1997  Colin Rafferty  <craffert@ml.com>
+
+	* Makefile (install-pkg): Made it install the el before the .elc.
+
+Mon Oct 20 12:15:15 1997  Christoph Wedler  <wedler@fmi.uni-passau.de>
+
+	* lisp/bbdb-xemacs.el (global-bbdb-menu-commands): Bug fix "Finger
+ 	  All Records".
+	* lisp/bbdb-xemacs.el (build-bbdb-finger-menu): Use
+	  `bbdb-record-finger-host'.
+	* lisp/bbdb-com.el (bbdb-finger): Doc string extension.
+	* texinfo/bbdb.texinfo (BBDB Mode): Add documentation for
+	  `bbdb-finger'.
+
+Tue Oct 14 20:06:38 1997  david carlton <carlton@math.mit.edu>
+
+	* Makefile (install-pkg): Fix info linking - use texinfo, not info
+
+Mon Oct 13 16:41:27 1997  Soren Dayton <csdayton@cs.uchicago.edu>
+
+	* lisp/bbdb-w3.el (bbdb-www): Use browse-url instead of funcalling
+	  contents of browse-url-browser-function.
+
+Sat Oct 11 19:19:27 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* bbdb.el: BBDB 1.54unoff released
+	* lisp/Makefile: Changed VM, GNUS, and MHE definitions so they can 
+	  be blank if the packages are in load-path.  Added bbdb-snarf and 
+	  bbdb-w3.  Made bbdb-srv and bbdb-reportmail skipping messages more
+	  informative.  Added check for itimer for bbdb-srv.
+	* lisp/bbdb-w3.el (bbdb-insinuate-w3): Created from bare add-hook
+	  statement found in David's version.  Add this to w3-mode-hook
+	  (yes, that's singular, not plural)
+	* lisp/bbdb-w3.el (bbdb-www): Modified to use
+	  browse-url-browser-function instead of having two functions, one 
+	  for netscape and one for w3.
+	* lisp/bbdb-snarf.el: Fixed area code pattern to use [2-9] instead 
+	  of [0-9] for first digit.
+	* lisp/auto-autoloads.el: Autoloads for bbdb-snarf, bbdb-www,
+	  changed package dir from `bbdb-1.52' to `bbdb', autoload for
+	  bbdb-insinuate-message.
+	* lisp/bbdb.el: Added autoloads for bbdb-insinuate-message,
+	  bbdb-www, bbdb-www-grab-homepage, bbdb-insinuate-w3, bbdb-snarf.
+	* lisp/bbdb.el (bbdb-mode): Documentation for bbdb-www `w' keystroke
+	* lisp/bbdb.el (bbdb-mode-map): bbdb-www invocation
+	* lisp/bbdb.el (bbdb-split): Documented.
+	* lisp/bbdb-gnus.el (bbdb-insinuate-message): Use it.  Sets the
+	  M-t binding for message-mode.  This isn't in bbdb-insinuate-gnus 
+	  because some like to use message-mode before loading gnus.  Add
+	  it to `message-setup-hook', _not_ `message-load-hook'.
+
+Sat Oct 11 19:01:00 1997  David Carlton <carlton@math.mit.edu>
+
+	* lisp/bbdb-w3.el: Added to bbdb distribution.  I don't know who
+	  the original author is, but David mailed it to me.
+	  
+Sat Oct 11 19:00:00 1997  John Heidemann <johnh@isi.edu>
+
+	* lisp/bbdb-snarf.el: Added to bbdb distribution.  Grabs text from 
+	  paragraph around point and makes a bbdb record out of it.  See
+	  the source for docs until I get around to adding to the texinfo
+	  file.
+
+Sat Oct 11 18:50:52 1997  Kees de Bruin <kees_de_bruin@tasking.nl>
+
+	* lisp/bbdb-vm.el (bbdb/vm-alternate-full-name): make VM use the
+	  canonicalized net address instead of the default address.
+	* lisp/bbdb-com.el (bbdb-sendmail-internal): Still more
+ 	  message-mode fixes.  Default to message-mode if neither mh-e nor
+ 	  vm are in `features'.  If message-mode is to be used and it's not
+ 	  loaded, autoload it.
+
+Thu Oct  9 06:37:00 1997  Matt Simmons <simmonmt@acm.org>
+        * lisp/Makefile: Check for itimer before building bbdb-srv.
+          Complain nicely when check fails.
+
+Sun Oct  5 20:16:00 1997  Matt Simmons <simmonmt@acm.org>
+	* bbdb.el: BBDB 1.53unoff released
+
+Sun Oct  5 19:53:12 1997  Boris Goldowsky <boris@gnu.ai.mit.edu>
+	* tex/bbdb-cols.tex, tex/bbdb-print-brief.tex, tex/bbdb-print.tex,
+	  lisp/bbdb-print.el: New version of bbdb-print
+
+Sun Oct  5 19:51:21 1997  Jamie Zawinski <jwz@netscape.com>
+	* utils/bbdb-cid.pl, utils/bbdb-src.pl, utils/bbdb-to-netscape.el:
+	  New utilities
+	* lisp/bbdb-com.el (bbdb-parse-phone-number): Changed comment to
+	  reflect new area codes that don't have [012] as their second digit
+	* lisp/bbdb-srv.el (bbdb/srv-auto-create-mail-news-dispatcher):
+	  Classification of messages as mail or news
+	* lisp/bbdb-srv.el (bbdb-src-add-phone): Supports caller ID util
+	* lisp/bbdb-srv.el (bbdb/srv-handle-headers): Make sure *BBDB* is
+	  bottommost buffer
+
+Sun Oct  5 19:51:20 1997  Seth Golub  <seth@cs.wustl.edu>
+	* utils/bbdb-areacode-split.pl: New utility
+	
+Sun Oct  5 19:51:19 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* A grand reorg: .tex files -> tex subdirectory,
+	                 .texinfo files -> texinfo subdirectory,
+			 .el files -> lisp subdirectory,
+	* Makefile: modified all Makefiles to deal with reorg,
+	            rewrote XEmacs package section
+	* lisp/bbdb.el (bbdb-frob-mode-line): I like version numbers on modelines
+	* lisp/bbdb.el (bbdb-version-date): Separate date from version number
+	* lisp/bbdb.el (bbdb-version): Modified to deal with version
+	  number separate from date
+
+Mon Sep 29 18:49:47 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* Makefile: patch to avoid building bbdb-srv and bbdb-reportmail
+	          if gnuserv and reportmail (respectively) aren't present
+	* bbdb.el (bbdb-frob-mode-line): Print the version number on the
+                  mode line
+
+Sun Sep 28 00:50:07 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* bbdb.el: BBDB 1.52unoff released
+	* bbdb.el (bbdb-y-or-n-p): Fix obsolete functions
+	* bbdb-ftp.el: Added check for efs
+	* Makefile: renamed it, removed mail-extr and mail-abbrev, did
+		  some reformatting
+
+Sun Sep 28 00:49:00 1997  Colin Rafferty <craffert@ml.com>
+
+        * auto-autoloads.el, Makefile: Use BBDB as an XEmacs package
+
+Sun Sep 28 00:03:31 1997  Jens-Ulrik Hoger Petersen <petersen@kurims.kyoto-u.ac.jp>
+
+	* bbdb-gnus.el (bbdb/gnus-update-record): Changed method for
+		  referencing article buffer.  Needed when
+		  gnus-single-article-buffer is nil.
+	* bbdb-hooks.el (bbdb-header-start): See above.
+
+Sat Sep 27 23:56:35 1997  Christopher Kline <ckline@mitre.org>
+
+	* bbdb-reportmail.el: Created
+
+Sat Sep 27 23:47:01 1997  Soren Dayton <csdayton+bbdb@cs.uchicago.edu>
+
+	* bbdb-com.el (bbdb-send-mail-internal): Allow use of message-mail
+	* bbdb.el (bbdb-send-mail-style): Documentation change.  See above.
+
+Sat Sep 27 23:44:43 1997  Colin Rafferty <craffert@ml.com>
+
+	* bbdb.el (bbdb-annotate-message-sender): Use address for name if no name
+
+Sat Sep 27 23:39:09 1997  Christoph Wedler <wedler@fmi.uni-passau.de>
+
+	* bbdb-com.el (bbdb-finger-host-field): Added code to check for
+		  finger-host field.  Finger is done on finger-host if it
+		  exists, on net address otherwise.
+
+Sat Sep 27 20:06:05 1997  Matt Simmons  <simmonmt@acm.org>
+
+	* bbdb-com.el (bbdb-phone-area-regexp): Fix US area code pattern
+To compile and install the BBDB:
+
+  1) Configure the compilation process
+       Edit the Makefile, setting (if necessary) the paths to the Mail
+       and News reader(s), the XEmacs package installation paths (if
+       applicable), and the miscellaneous (but still important) build
+       tool names and paths.
+
+       NOTE:  Gnu Emacs 19.34 users should add the path to Custom
+       1.9962 if they plan to build Gnus support.  Gnus support will
+       not build under Gnu Emacs 19.34 without Custom 1.9962.
+
+  2) Build the BBDB
+       To build the BBDB with support for all of the supported mail
+       and news programs (gnus, mh-e, rmail, and vm), issue the
+       command 'make all'.  (The BBDB also supports send-mail mode -
+       support for it is automatically compiled in, regardless of the
+       build options supplied) To build with support only for gnus,
+       mh-e, rmail, and/or vm, issue the 'make' command with one or
+       more of the following arguments: 'gnus', 'mh-e', 'rmail',
+       and/or 'vm'.  To build the BBDB without support for any mail
+       program (except for send-mail mode), issue the command
+       'make bbdb'.
+
+  3) Install the BBDB
+       The three most typical installations are outlined below:
+
+        a) In-place.
+             i)   Follow steps 1 and 2
+             ii)  Add the lisp subdirectory to the Emacs load-path
+             iii) Add the tex subdirectory to the TeX
+                  search path (can be done by adding the complete path
+                  to the tex subdirectory to the environment variable
+                  TEXINPUTS)
+             iv)  Add the texinfo directory to the Info search path.
+        b) "Normal".
+             i)   Follow steps 1 and 2.
+             ii)  Copy the .el and .elc files from the lisp
+                  subdirectory to a directory on the Emacs load-path
+                  (or make a new directory, copy the files to it, and
+                  add the new directory to the load-path).
+             iii) Copy the .tex files from the tex subdirectory to a
+                  directory on the TeX search path (or make a new
+                  directory, copy the files to it, and add the new
+                  directory to the TeX search path.
+             iv)  Copy the .info and .info-* files from the texinfo
+                  subdirectory to a directory on the Info search path
+                  (or make a new directory, copy the files to it, and
+                  add the new directory to the Info search path)
+        c) XEmacs Package
+             NOTE: This installation option is only available to users 
+                   running XEmacs 20.4 or higher.  At the time of this 
+                   writing, this includes only XEmacs beta testers.
+             i)    Follow steps 1 and 2, making sure to set the
+                   appropriate variables in the XEmacs package
+                   section.
+             ii)   Issue the 'make install-pkg' command.
+
+***************************************************************************
+*                                                                         *
+*         THE BBDB INITIALIZATION PROCEDURE CHANGED IN 1.57unoff.         *
+*                                                                         *
+*                              YOU *MUST* ADD                             *
+*                                                                         *
+*   (require 'bbdb)                                                       *
+*   (bbdb-initialize)                                                     *
+*                                                                         *
+*   TO YOUR BBDB INITIALIZATION CODE.  THIS TAKES THE PLACE OF ALL BBDB   *
+*    AUTOLOADS.  IT DOES *NOT* TAKE THE PLACE OF THE INSINUATION CODE.    *
+*                                                                         *
+*       If you do not add this code, you will receive keymap errors       *
+*                          (among other things)                           *
+*                                                                         *
+***************************************************************************
+
+For information on post-installation BBDB configuration and setup, see 
+the info file.
+
+Questions, Comments, Suggestions, and Bug Reports may be directed to
+the BBDB mailing list at info-bbdb@xemacs.org.  To subscribe, send
+mail to info-bbdb-request@xemacs.org, with 'subscribe' as the subject.
+# Makefile for bbdb lisp code
+
+# This file is part of XEmacs.
+
+# XEmacs 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.
+
+# XEmacs 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 XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+VERSION = 1.02
+AUTHOR_VERSION = 2.0
+MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
+PACKAGE = bbdb
+PKG_TYPE = regular
+REQUIRES = bbdb edit-utils gnus mh-e rmail supercite vm tm apel mail-lib xemacs-base
+CATEGORY = comm
+
+ELCS = lisp/bbdb-com.elc lisp/bbdb-ftp.elc lisp/bbdb-gnus.elc \
+	lisp/bbdb-hooks.elc lisp/bbdb-mhe.elc lisp/bbdb-migrate.elc \
+	lisp/bbdb-print.elc lisp/bbdb-reportmail.elc lisp/bbdb-rmail.elc \
+	lisp/bbdb-sc.elc lisp/bbdb-snarf.elc lisp/bbdb-srv.elc \
+	lisp/bbdb-vm.elc lisp/bbdb-w3.elc lisp/bbdb-whois.elc \
+	lisp/bbdb-xemacs.elc lisp/bbdb.elc
+EXTRA_SOURCES = README INSTALL
+
+DATA_FILES = $(shell echo utils/*.?l)
+DATA_DEST = $(PACKAGE)
+INFO_FILES = texinfo/$(PACKAGE).info*
+TEXI_FILES = texinfo/$(PACKAGE).texinfo
+MANUAL = bbdb
+
+include ../../XEmacs.rules
+
+GENERATED = lisp/auto-autoloads.elc lisp/custom-load.elc
+
+all:: lisp/auto-autoloads.el $(ELCS) lisp/auto-autoloads.elc \
+	lisp/custom-load.elc texinfo/bbdb.info
+
+clean::
+	rm -f texi/*.info*
+
+texinfo/bbdb.info: texinfo/bbdb.texinfo
+	(cd texinfo; $(MAKEINFO) -o bbdb.info bbdb.texinfo)
+
+lisp/auto-autoloads.el: $(ELC:.elc=.el) _pkg.el
+	$(RCOPY) _pkg.el lisp
+	$(XEMACS) -batch -vanilla \
+		-eval "(setq autoload-package-name \"$(PACKAGE)\")" \
+		-l autoload -f batch-update-directory lisp
+
+lisp/custom-load.el: $(ELC:.elc=.el)
+	$(XEMACS) -batch -vanilla -l cus-dep \
+		-f Custom-make-dependencies lisp
+
+.PHONY: srckit
+
+srckit: 
+	@echo "You cannot build a source package for bbdb"
+
+binkit: binkit-sourcedatainfo
+# Makefile for the Insidious Big Brother Database.
+# Original Author: Jamie Zawinski (jwz@netscape.com)
+#
+# Makefile,v 1.58 1998/03/10 07:27:02 simmonmt Exp
+#
+# Makefile,v
+# Revision 1.58  1998/03/10 07:27:02  simmonmt
+# Removed my paths, added comments about the Custom requirement for
+# building Gnus support under 19.34
+#
+# Revision 1.57  1998/02/23 07:08:48  simmonmt
+# Alphabetized MUA directory variables, added OTHERDIR variable
+#
+# Revision 1.56  1997/11/02 06:35:43  simmonmt
+# Fixed package install - `foo 'bar` (as opposed to `foo 'bar'`) works
+# in Bourne shell, but not in others.  That and it's not exactly
+# intuitive.
+#
+# Revision 1.55  1997/10/26 05:11:20  simmonmt
+# Installation timing change: .el before .elc.  Tried to optimize
+# install
+#
+# Revision 1.54  1997/10/11 23:48:40  simmonmt
+# Removed my paths from VMDIR and MHEDIR.  Seems I had broken the
+# documented 'if these are blank and the packages live on load-path,
+# Emacs will find them' behavior by dying if VMDIR, MHEDIR and GNUSDIR
+# weren't set.  It's fixed now.
+#
+# Revision 1.53  1997/10/06 01:15:13  simmonmt
+# Fixed for new grand reorg.  Rewrote XEmacs package installation code.
+#
+#
+
+# ************************
+# MUA-specific definitions
+# ************************
+
+# If the VM, GNUS, or MH-E source is not in the standard emacs library 
+# (that is, it's not on the load-path by default in a -q emacs) then
+# set these variables to point at them.  You need to do this because
+# otherwise "require" won't work in the batch emacs.
+#
+# Set the ones you've got, and comment out the rest.
+GNUSDIR         = 
+MHEDIR 	        = 
+VMDIR           = 
+
+# ***************************
+# Locations of other packages
+# ***************************
+#
+# Add the directories (if any) containing the optional packages you
+# will use with the BBDB (see the "Byte Compiling the Lisp files"
+# section of the BBDB manual for more information).  If more than one
+# directory is to be used, separate the directories with spaces.  Do
+# not quote the directory names.  GNU Emacs 19.34 should put the path
+# to Custom 1.9962 here if they plan to build Gnus support.
+OTHERDIR	=
+
+# **************************
+# XEmacs Packagization (sp?)
+# **************************
+
+# If you're installing this as an XEmacs package, either set the following
+# variable to point to the root of the package directory, or set it on the
+# command line ( 'make PACKAGEROOT=foo' )
+#PACKAGEROOT=
+
+# Uncomment this definition if you want the lisp and info files to be linked
+# in (as opposed to being copied)
+#LINKTOPACKAGE=yes
+
+# If you uncommented the above, the lisp and info directories will be linked
+# from this directory to PACKAGEROOT.  For example, lisp will be linked with:
+#
+#   ln -s `pwd`/lisp $(PACKAGEROOT)/bbdb/lisp
+#
+# If `pwd` will not return the correct path, set LINKPATH below to the correct
+# path.
+#LINKPATH=
+
+# *******************************
+# Other important things to check
+# *******************************
+
+        EMACS = xemacs -no-site-file -no-init-file
+     MAKEINFO = makeinfo
+
+# Uncomment one of the below
+#  SYSVINSTALL = /usr/sbin/install
+   BSDINSTALL = /usr/ucb/install
+
+          TAR = tar
+     COMPRESS = gzip --verbose --best
+ COMPRESS_EXT = gz
+
+   BUILDFLAGS = $(MAKEFLAGS) "EMACS=$(EMACS)" "MAKEINFO=$(MAKEINFO)" \
+		"VMDIR=$(VMDIR)" "GNUSDIR=$(GNUSDIR)" "MHEDIR=$(MHEDIR)" \
+		"OTHERDIR=$(OTHERDIR)"
+
+#    COMPRESS = compress
+#COMPRESS_EXT = Z
+
+# You shouldn't need to change anything after this point.
+
+syntax:
+	@echo "" ;\
+	echo "*** make one or more of: rmail vm mhe gnus all bbdb" ;\
+	echo "" ;\
+
+all: bbdb rmail vm mhe gnus info
+
+bbdb:
+	cd lisp; $(MAKE) $(BUILDFLAGS) bbdb
+
+rmail:
+	cd lisp; $(MAKE) $(BUILDFLAGS) rmail
+
+vm:
+	cd lisp; $(MAKE) $(BUILDFLAGS) vm
+
+mhe:
+	cd lisp; $(MAKE) $(BUILDFLAGS) mhe
+
+gnus:
+	cd lisp; $(MAKE) $(BUILDFLAGS) gnus
+
+autoloads:
+	cd lisp; $(MAKE) $(BUILDFLAGS) autoloads
+
+install-pkg: bbdb autoloads info
+	if [ -z "$(PACKAGEROOT)" ] ; then \
+	   echo "You must specify PACKAGEROOT (see Makefile)"; \
+	   exit 1 ; \
+	else \
+	   rm -fr $(PACKAGEROOT)/lisp/bbdb $(PACKAGEROOT)/info/bbdb \
+		  $(PACKAGEROOT)/etc/bbdb; \
+           if [ -z "$(LINKTOPACKAGE)" ] ; then \
+	      mkdir -p -m 0755 $(PACKAGEROOT)/lisp/bbdb; \
+	      if [ -z "$(SYSVINSTALL)" ] ; then \
+		for i in `ls lisp/*.elc` ; do \
+		   $(BSDINSTALL) -c -m 0644 `echo $$i | sed 's/c$$//g'` \
+			$(PACKAGEROOT)/lisp/bbdb ; \
+		   $(BSDINSTALL) -c -m 0644 $$i $(PACKAGEROOT)/lisp/bbdb ; \
+		done ; \
+	      else \
+		for i in `ls lisp/*.elc` ; do \
+		   $(SYSVINSTALL) -c $(PACKAGEROOT)/lisp/bbdb -s -m 0644 \
+			`echo $$i | sed 's/c$$//g'` $(PACKAGEROOT)/lisp/bbdb ; \
+		   $(SYSVINSTALL) -c $(PACKAGEROOT)/lisp/bbdb -s -m 0644 $$i ; \
+		done ; \
+	      fi ; \
+	      mkdir -p -m 0755 $(PACKAGEROOT)/info/bbdb ; \
+	      if [ -z "$(SYSVINSTALL)" ] ; then \
+		for i in `ls texinfo/*.info* ` ; do \
+		   $(BSDINSTALL) -c -m 0644 $$i $(PACKAGEROOT)/info/bbdb ; \
+		done ; \
+	      else \
+		for i in `ls texinfo/*.info* ` ; do \
+		   $(SYSVINSTALL) -c $(PACKAGEROOT)/info/bbdb -s -m 0644 $$i ; \
+		done ; \
+	      fi ; \
+	      mkdir -p -m 0755 $(PACKAGEROOT)/etc/bbdb/tex \
+			       $(PACKAGEROOT)/etc/bbdb/utils ; \
+	      if [ -z "$(SYSVINSTALL)" ] ; then \
+		for i in `ls tex/*.tex` ; do \
+		   $(BSDINSTALL) -c -m 0644 $$i $(PACKAGEROOT)/etc/bbdb/tex ; \
+		done ; \
+		for i in `ls -d utils/* |egrep -v '(RCS|SCCS)'` ; do \
+		   $(BSDINSTALL) -c -m 0644 $$i $(PACKAGEROOT)/etc/bbdb/utils ; \
+		done ; \
+	      else \
+		for i in `ls tex/*.tex` ; do \
+		   $(SYSVINSTALL) -c $(PACKAGEROOT)/etc/bbdb/tex -s -m 0644 $$i; \
+		done ; \
+		for i in `ls -d utils/* |egrep -v '(RCS|SCCS)'` ; do \
+		   $(SYSVINSTALL) -c $(PACKAGEROOT)/etc/bbdb/utils -s -m 0644 $$i; \
+		done ; \
+	      fi ; \
+	   else \
+	      if [ -z "$(LINKPATH)" ] ; then \
+		 ln -s `pwd`/lisp $(PACKAGEROOT)/lisp/bbdb ; \
+		 ln -s `pwd`/texinfo $(PACKAGEROOT)/info/bbdb ; \
+	      else \
+		 ln -s $(LINKPATH)/lisp $(PACKAGEROOT)/lisp/bbdb ; \
+		 ln -s $(LINKPATH)/texinfo $(PACKAGEROOT)/info/bbdb ; \
+	      fi ; \
+	   fi ; \
+	fi
+
+info:
+	cd texinfo; $(MAKE)
+
+clean:
+	cd lisp; $(MAKE) clean
+	cd texinfo; $(MAKE) clean
+
+# Testing
+
+
+# FSF Emacs 19.34
+
+emacs19.34-test: emacs19.34-test-setup emacs19.34-test-bbdb
+emacs19.34-test: emacs19.34-test-rmail emacs19.34-test-vm
+emacs19.34-test: emacs19.34-test-mhe   emacs19.34-test-gnus
+emacs19.34-test: emacs19.34-test-all
+
+emacs19.34-test-setup:
+	@echo '--- TESTING BBDB WITH FSF EMACS 19.34 ---'
+	@echo
+	@echo '** Setting up **'
+	make clean
+	rm -f /p/local/elisp-19.34/gnus/lisp/*
+	cp /home/simmonmt/gnus/lisp/*.el /p/local/elisp-19.34/gnus/lisp
+
+emacs19.34-test-bbdb:
+	@echo
+	@echo '** Testing build of "bbdb" **'
+	@echo
+	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
+	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 bbdb
+
+emacs19.34-test-rmail:
+	@echo
+	@echo '** Testing build of "rmail" **'
+	@echo
+	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
+	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 rmail
+
+emacs19.34-test-vm:
+	@echo
+	@echo '** Testing build of "vm" **'
+	@echo
+	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
+	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 vm
+
+emacs19.34-test-mhe:
+	@echo
+	@echo '** Testing build of "mhe" **'
+	@echo
+	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
+	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 mhe
+
+emacs19.34-test-gnus:
+	@echo
+	@echo '** Testing build of "gnus" **'
+	@echo
+	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
+	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 gnus
+
+emacs19.34-test-all:
+	@echo
+	@echo '** Testing build of "all" **'
+	@echo
+	-make clean
+	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
+	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 all
+
+# FSF Emacs 20.2
+
+emacs20.2-test: emacs20.2-test-setup emacs20.2-test-bbdb
+emacs20.2-test: emacs20.2-test-rmail emacs20.2-test-vm
+emacs20.2-test: emacs20.2-test-mhe   emacs20.2-test-gnus
+emacs20.2-test: emacs20.2-test-all
+
+emacs20.2-test-setup:
+	@echo '--- TESTING BBDB WITH FSF EMACS 20.2 ---'
+	@echo
+	@echo '** Setting up **'
+	make clean
+	rm -f /p/local/elisp-20.2/gnus/lisp/*
+	cp /home/simmonmt/gnus/lisp/*.el /p/local/elisp-20.2/gnus/lisp
+
+emacs20.2-test-bbdb:
+	@echo
+	@echo '** Testing build of "bbdb" **'
+	@echo
+	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp bbdb
+
+emacs20.2-test-rmail:
+	@echo
+	@echo '** Testing build of "rmail" **'
+	@echo
+	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp rmail
+
+emacs20.2-test-vm:
+	@echo
+	@echo '** Testing build of "vm" **'
+	@echo
+	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp vm
+
+emacs20.2-test-mhe:
+	@echo
+	@echo '** Testing build of "mhe" **'
+	@echo
+	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp mhe
+
+emacs20.2-test-gnus:
+	@echo
+	@echo '** Testing build of "gnus" **'
+	@echo
+	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp gnus
+
+emacs20.2-test-all:
+	@echo
+	@echo '** Testing build of "all" **'
+	@echo
+	-make clean
+	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp all
+
+
+# Deployment
+
+TARFILES=	bbdb-Makefile bbdb.texinfo bbdb.el $(DEPSRCS) \
+		bbdb-print.tex multicol.tex
+
+tar: $(TARFILES)
+	@NAME=`sed -n							     \
+  's/^(defconst bbdb-version "\([0-9]\.[0-9][0-9]*\).*/bbdb-\1/p' bbdb.el` ; \
+  rm -f $$NAME ; ln -s . $$NAME ;					    \
+  echo creating tar file $${NAME}.tar.$(COMPRESS_EXT)... ;		    \
+   $(TAR) -vchf - `echo $(TARFILES)				    	    \
+   | sed "s|^|$$NAME/|g; s| | $$NAME/|g" `				    \
+   | $(COMPRESS) > $${NAME}.tar.$(COMPRESS_EXT) ;			    \
+  rm $$NAME
+Read the INSTALL file.
+# Makefile for the Insidious Big Brother Database.
+# Original Author: Jamie Zawinski (jwz@netscape.com)
+#
+# Makefile,v 1.7 1998/03/10 07:33:12 simmonmt Exp
+#
+# Makefile,v
+# Revision 1.7  1998/03/10 07:33:12  simmonmt
+# Finally fixed that damn 19.34 :link problem - needed to put OTHERDIR
+# stuff first in the load-path before loading bbdb.el.
+#
+# Revision 1.6  1998/02/23 07:23:23  simmonmt
+# Support for OTHERDIR, rearranged flags to Emacs so we can use
+# bbdb-split-string (19.34 doesn't have split-string)
+#
+# Revision 1.5  1998/01/06 06:48:50  simmonmt
+# Fixed bug
+#
+# Revision 1.4  1998/01/06 06:45:39  simmonmt
+# Added deploy target.  Added migrate.el
+#
+# Revision 1.3  1997/11/02 06:32:38  simmonmt
+# Support for bbdb-sc.el
+#
+# Revision 1.2  1997/10/12 00:24:41  simmonmt
+# Changed VM, GNUS, and MHE definitions.  If the corresponding DIR
+# variables are set, the (the DIR vars) are added to load-path.  The
+# relevant el files are then loaded using the load-path.  This allows
+# VMDIR, et al to be unset if the packages live in load-path by
+# default.  Added bbdb-snarf and bbdb-w3.  Made the bbdb-srv and
+# bbdb-reportmail skip messages more informative for the poor souls (FSF
+# Emacs users) who can't use them.  Added a check for itimer, since
+# apparently some FSF Emacs users have installed gnuserv - without
+# itimer, bbdb-srv still won't compile.
+#
+# Revision 1.1  1997/10/06 01:16:00  simmonmt
+# Initial revision
+#
+#
+
+# this is lovely, isn't it?  Surprisingly enough, it seems to work...
+VM	= -eval '(progn (if (not (string-match "$(VMDIR)" ""))            \
+			    (setq load-path (cons "$(VMDIR)" load-path))) \
+			(if (load "vm-version" t)                         \
+			    (cond ((> (string-to-number vm-version) 5.31) \
+                                   (load "vm"))                           \
+                                  (t (load "vm-vars") (load "vm")))))'
+
+GNUS	= -eval '(if (not (string-match "$(GNUSDIR)" ""))             \
+		     (setq load-path (cons "$(GNUSDIR)" load-path)))' 
+
+MHE	= -eval '(progn (if (not (string-match "$(MHEDIR)" ""))            \
+			    (setq load-path (cons "$(MHEDIR)" load-path))) \
+			(load "mh-e"))'
+
+# This is hideous and sick, but FSF 19.34 doesn't ship with split, and we
+# can't load bbdb.el to get bbdb-split because we have to put OTHERDIR
+# at the front of the load-path before loading bbdb.el.  This makes my
+# head hurt.
+PUSHPATH= -eval "`\
+           dir=\". $(OTHERDIR)\"; \
+	   echo \(setq load-path \(append \(list ; \
+           for i in $$dir ; do \
+              echo \\"$$i\\"\ ; \
+	   done ;\
+	   echo \) load-path\)\) ; \
+           `"
+
+#foo:
+#	@echo $(PUSHPATH)
+#	echo
+#	$(EMACS) -batch -q $(PUSHPATH) -eval '(message (prin1-to-string load-path))'
+
+#-eval '(setq load-path                                        \
+#                     (append (bbdb-split (if (/= 0 (length "$(OTHERDIR)")) \
+#                                              (concat ". " "$(OTHERDIR)")   \
+#                                              ".") " ")                     \
+#					       load-path))'
+
+        EMACS = xemacs
+     MAKEINFO = makeinfo
+
+.SUFFIXES: .elc .el .tar .Z .gz .uu
+
+DEPSRCS=	bbdb-com.el  bbdb-hooks.el  bbdb-gnus.el  bbdb-mhe.el \
+		bbdb-rmail.el bbdb-vm.el bbdb-ftp.el bbdb-whois.el \
+		bbdb-xemacs.el bbdb-print.el bbdb-srv.el bbdb-reportmail.el \
+		bbdb-migrate.el
+
+DEPBINS=	${DEPSRCS:.el=.elc}
+SRCS=		bbdb.el  $(DEPSRCS)
+BINS=		bbdb.elc $(DEPBINS)
+
+syntax:
+	@echo "" ;\
+	echo "*** Make should be run from the `cd ..;pwd` directory" ;\
+	echo "" ;\
+
+all:	rmail gnus vm mhe bbdb info
+
+auto-autoloads.elc: auto-autoloads.el
+	$(EMACS) -batch -q -f batch-byte-compile ./auto-autoloads.el
+
+bbdb.elc:            bbdb.el
+bbdb-com.elc:        bbdb.elc bbdb-com.el
+bbdb-ftp.elc:        bbdb.elc bbdb-ftp.el
+bbdb-migrate.elc:    bbdb.elc bbdb-migrate.el
+bbdb-print.elc:      bbdb.elc bbdb-print.el
+bbdb-snarf.elc:      bbdb.elc bbdb-snarf.el
+bbdb-whois.elc:      bbdb.elc bbdb-whois.el
+bbdb-w3.elc:         bbdb.elc bbdb-w3.el
+bbdb-xemacs.elc:     bbdb.elc bbdb-xemacs.el
+
+.el.elc:
+	$(EMACS) -batch -q $(PUSHPATH) -l ./bbdb.elc -f batch-byte-compile $<
+
+bbdb.elc:	bbdb.el
+	$(EMACS) -batch -q -f batch-byte-compile ./bbdb.el
+
+bbdb-gnus.elc:	bbdb.elc bbdb-gnus.el
+	$(EMACS) -batch -q $(PUSHPATH) -l ./bbdb.elc $(GNUS)   \
+		-f batch-byte-compile $(@:.elc=.el)
+bbdb-mhe.elc:	bbdb.elc bbdb-mhe.el
+	$(EMACS) -batch -q $(PUSHPATH) -l ./bbdb.elc $(MHE)    \
+		-f batch-byte-compile $(@:.elc=.el)
+bbdb-rmail.elc:	bbdb.elc bbdb-rmail.el
+	$(EMACS) -batch -q $(PUSHPATH) -l ./bbdb.elc $(RMAIL)  \
+		-f batch-byte-compile $(@:.elc=.el)
+bbdb-vm.elc:	bbdb.elc bbdb-vm.el
+	$(EMACS) -batch -q $(PUSHPATH) -l ./bbdb.elc $(VM)     \
+		-f batch-byte-compile $(@:.elc=.el)
+
+bbdb-srv.elc:   bbdb.elc bbdb-srv.el
+	$(EMACS) -batch -q $(PUSHPATH) -l ./bbdb.elc -eval '(if (and (locate-library "gnuserv") (locate-library "itimer")) (byte-compile-file "bbdb-srv.el") (message "Optional package bbdb-srv skipped - gnuserv not found"))'
+
+bbdb-reportmail.elc: bbdb.elc bbdb-reportmail.el
+	$(EMACS) -batch -q $(PUSHPATH) -l ./bbdb.elc -eval '(if (locate-library "reportmail") (byte-compile-file "bbdb-reportmail.el") (message "Optional package bbdb-reportmail skipped - reportmail not found"))'
+
+bbdb-sc.elc: bbdb.elc bbdb-sc.el
+	$(EMACS) -batch -q $(PUSHPATH) -l ./bbdb.elc -eval '(if (locate-library "supercite") (byte-compile-file "bbdb-sc.el") (message "Optional package bbdb-sc skipped - supercite not found"))'
+
+# bbdb-hooks uses VM macros if it can find VM.  If you don't have VM,
+# then the $(VM) makefile variable should be undefined or empty.
+bbdb-hooks.elc:  bbdb.elc bbdb-hooks.el
+	$(EMACS) -batch -q $(PUSHPATH) -l ./bbdb.elc $(VM) \
+	-f batch-byte-compile $(@:.elc=.el)
+
+autoloads: auto-autoloads.elc
+
+extras: bbdb-print.elc bbdb-ftp.elc bbdb-whois.elc bbdb-xemacs.elc  \
+	bbdb-srv.elc bbdb-reportmail.elc bbdb-snarf.elc bbdb-w3.elc \
+	bbdb-sc.elc bbdb-migrate.elc
+bbdb:	bbdb.elc bbdb-com.elc bbdb-hooks.elc extras
+rmail:	bbdb bbdb-rmail.elc
+vm:	bbdb bbdb-vm.elc
+mhe:	bbdb bbdb-mhe.elc
+gnus:	bbdb bbdb-gnus.elc
+# aliases
+mh:	mhe
+mh-e:	mhe
+
+deploy:
+	@for fname in `cd RCS; ls |sed 's/,v$$//g'` ; do \
+	  if [ -w "$$fname" ] ; then \
+	    echo "File $$fname needs to be checked in" ; \
+	    exit 1 ; \
+	  fi ; \
+	done ; \
+	if [ -z "$(REVTAG)" ] ; then \
+	  echo "REVTAG needs to be set" ; \
+	  exit 1 ; \
+	fi ; \
+	rcs "-n$(REVTAG)": RCS/* ; \
+	co -kv RCS/*
+
+
+clean:
+	$(RM) bbdb.elc bbdb-*.elc bbdb.info auto-autoloads.elc
+
+;;;###autoload
+(package-provide 'bbdb
+		 :version 1.01
+		 :type 'regular)

lisp/auto-autoloads.el

+;;; DO NOT MODIFY THIS FILE
+(if (not (featurep 'bbdb-autoloads))
+    (progn
+
+;;;### (autoloads nil "_pkg" "lisp/_pkg.el")
+
+(package-provide 'bbdb :version 1.01 :type 'regular)
+
+;;;***
+
+;;;### (autoloads (bbdb-initialize) "bbdb" "lisp/bbdb.el")
+
+(autoload 'bbdb-initialize "bbdb" "\
+*Initialize the BBDB.  One or more of the following symbols can be
+passed as arguments to initiate the appropriate insinuations.
+
+ Initialization of mail/news readers:
+
+   Gnus       Initialize BBDB support for the Gnus version 3.14 or
+              older.
+   gnus       Initialize BBDB support for the Gnus mail/news reader
+              version 3.15 or newer.  If you pass the `gnus' symbol,
+              you should probably also pass the `message' symbol.
+   mh-e       Initialize BBDB support for the MH-E mail reader.
+   rmail      Initialize BBDB support for the RMAIL mail reader.
+   sendmail   Initialize BBDB support for sendmail (M-x mail).
+   vm         Initialize BBDB support for the VM mail reader.
+              NOTE: For the VM insinuation to work properly, you must
+              either call `bbdb-initialize' with the `vm' symbol from
+              within your VM initialization file (\"~/.vm\") or you
+              must call `bbdb-insinuate-vm' manually from within your
+              VM initialization file.
+
+ Initialization of miscellaneous package:
+
+   message    Initialize BBDB support for Message mode.
+   reportmail Initialize BBDB support for the Reportmail mail
+              notification package.
+   sc         Initialize BBDB support for the Supercite message
+              citation package.
+   w3         Initialize BBDB support for Web browsers." nil nil)
+
+;;;***
+
+
+(provide 'bbdb-autoloads)
+))
+;;; -*- Mode:Emacs-Lisp -*-
+
+;;; This file is part of the Insidious Big Brother Database (aka BBDB),
+;;; copyright (c) 1991, 1992, 1993 Jamie Zawinski <jwz@netscape.com>.
+;;; It contains most of the user-level interactive commands for BBDB.
+;;; See bbdb.texinfo.
+
+;;; The Insidious Big Brother Database 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.
+;;;
+;;; BBDB 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 GNU Emacs; see the file COPYING.  If not, write to
+;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;
+;; bbdb-com.el,v 1.59 1998/03/13 09:54:22 simmonmt Exp
+;;
+;; bbdb-com.el,v
+;; Revision 1.59  1998/03/13 09:54:22  simmonmt
+;; Colin's fix for properly counting the size of notes fields
+;;
+;; Revision 1.58  1998/03/10 07:35:09  simmonmt
+;; Colin's new refiling code, protecting default-area-code
+;;
+;; Revision 1.57  1998/01/06 04:51:10  simmonmt
+;; Fixed copyright, moved customized finger variables into
+;; utilities-finger group (from finger).  Removed autoloads.
+;;
+;; Revision 1.56  1997/12/01 04:54:52  simmonmt
+;; Added sshteingold@cctrading.com's date-based database-manipulation
+;; functions.  Customized variables.
+;;
+;; Revision 1.55  1997/10/26 04:47:03  simmonmt
+;; Fix name completion bug (original fix by Marco Walther
+;; <Marco.Walther@mch.sni.de>, mangled beyond recognition by Matt Simmons
+;; <simmonmt@acm.org>
+;; Docs for bbdb-finger by Christoph Wedler  <wedler@fmi.uni-passau.de>
+;;
+;; Revision 1.54  1997/10/11 23:53:42  simmonmt
+;; Message-mode fixes from Kees de Bruin <kees_de_bruin@tasking.nl>
+;;
+;; Revision 1.53  1997/10/06 01:03:34  simmonmt
+;; Jamie Zawinski <jwz@netscape.com>'s comment change about the new area
+;; codes that aren't restricted to [012] in the second digit.
+;;
+;; Revision 1.52  1997/09/28 05:57:13  simmonmt
+;; Fixed area code parsing for new US area codes.  Patches integrated:
+;; use of message-mail for sending mail, finger-host record for fingering
+;;
+;;
+
+(require 'bbdb)
+
+(defmacro bbdb-grovel-elide-arg (arg)
+  (list 'if arg
+	(list 'not (list 'eq arg 0))
+	'bbdb-elided-display))
+
+
+(defmacro bbdb-search (records &optional name company net notes phone)
+  ;; this macro only emits code for those things being searched for;
+  ;; literal nils at compile-time cause no code to be emitted.
+  (let (clauses)
+    ;; I didn't protect these vars from multiple evaluation because that
+    ;; actually generates *less efficient code* in elisp, because the extra
+    ;; bindings can't easily be optimized away without lexical scope.  fmh.
+    (or (stringp name) (symbolp name) (error "name must be atomic"))
+    (or (stringp company) (symbolp company) (error "company must be atomic"))
+    (or (stringp net) (symbolp net) (error "net must be atomic"))
+    (or (stringp notes) (symbolp notes) (error "notes must be atomic"))
+    (or (stringp phone) (symbolp phone) (error "phone must be atomic"))
+    (if phone
+	(setq clauses
+	      (cons
+	       (` (let ((rest-of-phones (bbdb-record-phones record))
+			(done nil))
+		    (if rest-of-phones
+			(while (and rest-of-phones (not done))
+			  (setq done (string-match (, phone)
+						   ;; way way wasteful...
+						   (bbdb-phone-string
+						    (car rest-of-phones)))
+				rest-of-phones (cdr rest-of-phones)))
+		      ;; so that "^$" can be used to find entries that
+		      ;; have no phones
+		      (setq done (string-match (, phone) "")))
+		    done))
+	       clauses)))
+    (if notes
+	(setq clauses
+	      (cons
+	       (` (if (stringp (, notes))
+		      (string-match (, notes)
+				    (or (bbdb-record-notes record) ""))
+		    (if (eq (car (, notes)) '*)
+			(let ((fields all-fields) done tmp)
+			  (if (bbdb-record-raw-notes record)
+			      (while (and (not done) fields)
+				(setq tmp (bbdb-record-getprop
+					   record (car fields))
+				      done (and tmp (string-match
+						     (cdr (, notes))
+						     tmp))
+				      fields (cdr fields)))
+			    ;; so that "^$" can be used to find entries that
+			    ;; have no notes
+			    (setq done (string-match (cdr (, notes)) "")))
+			  done)
+		      (string-match (cdr (, notes))
+				    (or (bbdb-record-getprop
+					 record (car (, notes))) "")))))
+	       clauses)))
+    (if name
+	(setq clauses
+	      (append
+	       (` ((string-match (, name) (or (bbdb-record-name record) ""))
+		   (let ((rest-of-aka (bbdb-record-aka record))
+			 (done nil))
+		     (while (and rest-of-aka (not done))
+		       (setq done (string-match (, name) (car rest-of-aka))
+			     rest-of-aka (cdr rest-of-aka)))
+		     done)))
+	       clauses)))
+    (if net
+	(setq clauses
+	      (cons
+	       (` (let ((rest-of-nets (bbdb-record-net record))
+			(done nil))
+		    (if rest-of-nets
+			(while (and rest-of-nets (not done))
+			  (setq done (string-match (, net) (car rest-of-nets))
+				rest-of-nets (cdr rest-of-nets)))
+		      ;; so that "^$" can be used to find entries that
+		      ;; have no net addresses.
+		      (setq done (string-match (, net) "")))
+		    done))
+	       clauses)))
+    (if company
+	(setq clauses
+	      (cons
+	       (` (string-match (, company)
+				(or (bbdb-record-company record) "")))
+	       clauses)))
+
+    (` (let ((matches '())
+	     (,@ (if notes
+		     '((all-fields (cons 'notes
+					 (mapcar
+					  (function (lambda (x)
+						      (intern (car x))))
+					  (bbdb-propnames)))))
+		   nil))
+	     (case-fold-search bbdb-case-fold-search)
+	     (records (, records))
+	     record)
+	 (while records
+	   (setq record (car records))
+	   (if (or (,@ clauses))
+	       (setq matches (cons record matches)))
+	   (setq records (cdr records)))
+	 (nreverse matches)))))
+
+
+(defun bbdb (string elidep)
+  "Display all entries in the BBDB matching the regexp STRING 
+in either the name(s), company, network address, or notes."
+  (interactive "sRegular Expression: \nP")
+  (let ((bbdb-elided-display (bbdb-grovel-elide-arg elidep))
+	(notes (cons '* string)))
+    (bbdb-display-records
+     (bbdb-search (bbdb-records) string string string notes nil))))
+
+(defun bbdb-name (string elidep)
+  "Display all entries in the BBDB matching the regexp STRING in the name
+\(or ``alternate'' names\)."
+  (interactive "sRegular Expression: \nP")
+  (let ((bbdb-elided-display (bbdb-grovel-elide-arg elidep)))
+    (bbdb-display-records (bbdb-search (bbdb-records) string))))
+
+(defun bbdb-company (string elidep)
+  "Display all entries in BBDB matching STRING in the company field."
+  (interactive "sRegular Expression: \nP")
+  (let ((bbdb-elided-display (bbdb-grovel-elide-arg elidep)))
+    (bbdb-display-records (bbdb-search (bbdb-records) nil string))))
+
+(defun bbdb-net (string elidep)
+  "Display all entries in BBDB matching regexp STRING in the network address."
+  (interactive "sRegular Expression: \nP")
+  (let ((bbdb-elided-display (bbdb-grovel-elide-arg elidep)))
+    (bbdb-display-records (bbdb-search (bbdb-records) nil nil string))))
+
+(defun bbdb-notes (which string elidep)
+  "Display all entries in BBDB matching STRING in the named notes field."
+  (interactive
+    (list (completing-read "Notes field to search (RET for all): "
+			   (append '(("notes")) (bbdb-propnames))
+			   nil t)
+	  (if (featurep 'gmhist)
+	      (read-with-history-in 'bbdb-notes-field "Regular expression: ")
+	      (read-string "Regular Expression: "))
+	  current-prefix-arg))
+  (let ((bbdb-elided-display (bbdb-grovel-elide-arg elidep))
+	(notes (if (string= which "")
+		   (cons '* string)
+		 (cons (intern which) string))))
+    (bbdb-display-records (bbdb-search (bbdb-records) nil nil nil notes))))
+
+(defun bbdb-phones (string elidep)
+  "Display all entries in BBDB matching the regexp STRING in the phones field."
+  (interactive "sRegular Expression: \nP")
+  (let ((bbdb-elided-display (bbdb-grovel-elide-arg elidep)))
+    (bbdb-display-records
+     (bbdb-search (bbdb-records) nil nil nil nil string))))
+
+(defun bbdb-changed (elidep)
+  "Display all entries in the bbdb database which have been changed since
+the database was last last saved."
+  (interactive "P")
+  (let ((bbdb-elided-display (bbdb-grovel-elide-arg elidep)))
+    (bbdb-display-records
+      (bbdb-with-db-buffer
+	bbdb-changed-records))))
+
+(defun bbdb-display (record)
+  "Prompts for and displays a single record (this is faster than searching.)"
+  (interactive (list (bbdb-completing-read-record "Display record of: ")))
+  (bbdb-display-records (list record)))
+
+(defun bbdb-display-some (function)
+  "Display records according to FUNCTION.  FUNCTION is called with one
+argument, the record, and should return nil if the record is not to be
+displayed.  If the record is to be displayed, it (the record) should
+be returned."
+  (bbdb-display-records (delq nil (mapcar function (bbdb-records)))))
+
+
+
+(defun bbdb-redisplay-records ()
+  "Regrinds the contents of the *BBDB* buffer, without scrolling.
+If possible, you should call bbdb-redisplay-one-record instead."
+  (let ((p (point))
+	(m (mark)))
+    (goto-char (window-start))
+    (let ((p2 (point)))
+      (bbdb-display-records-1 bbdb-records)
+      (goto-char p2)
+      (if m (set-mark m)))
+    (recenter 0)
+    (goto-char p)
+    (save-excursion
+      (run-hooks 'bbdb-list-hook))
+    ))
+
+(defun bbdb-redisplay-one-record (record &optional record-cons next-record-cons
+					 delete-p)
+  "Regrind one record.  The *BBDB* buffer must be current when this is called."
+  (bbdb-debug (if (not (eq (not (not delete-p))
+			   (not (not (bbdb-record-deleted-p record)))))
+		  (error "splorch.")))
+  (if (null record-cons) (setq record-cons (assq record bbdb-records)))
+  (if (null next-record-cons)
+      (setq next-record-cons (car (cdr (memq record-cons bbdb-records)))))
+  (beginning-of-line)
+  (let ((marker (nth 2 record-cons))
+	(next-marker (nth 2 next-record-cons))
+	(buffer-read-only nil)
+	(p (point)))
+    (bbdb-debug
+      (if (null record-cons) (error "doubleplus ungood: record unexists!"))
+      (if (null marker) (error "doubleplus ungood: marker unexists!")))
+    (goto-char marker)
+    (if delete-p nil
+	(bbdb-format-record (car record-cons) (car (cdr record-cons))))
+    (delete-region (point) (or next-marker (point-max)))
+    (goto-char p)
+    (save-excursion
+      (run-hooks 'bbdb-list-hook))
+    ))
+
+
+
+(defconst bbdb-phone-area-regexp "(?[ \t]*\\+?1?[ \t]*[-\(]?[ \t]*[-\(]?[ \t]*\\([2-9][0-9][0-9]\\)[ \t]*)?[- \t]*")
+(defconst bbdb-phone-main-regexp "\\([1-9][0-9][0-9]\\)[ \t]*-?[ \t]*\\([0-9][0-9][0-9][0-9]\\)[ \t]*")
+(defconst bbdb-phone-ext-regexp  "x?[ \t]*\\([0-9]+\\)[ \t]*")
+
+(defconst bbdb-phone-regexp-1 (concat "^[ \t]*" bbdb-phone-area-regexp bbdb-phone-main-regexp bbdb-phone-ext-regexp "$"))
+(defconst bbdb-phone-regexp-2 (concat "^[ \t]*" bbdb-phone-area-regexp bbdb-phone-main-regexp "$"))
+(defconst bbdb-phone-regexp-3 (concat "^[ \t]*" bbdb-phone-main-regexp bbdb-phone-ext-regexp "$"))
+(defconst bbdb-phone-regexp-4 (concat "^[ \t]*" bbdb-phone-main-regexp "$"))
+(defconst bbdb-phone-regexp-5 (concat "^[ \t]*" bbdb-phone-ext-regexp "$"))
+
+(defun bbdb-parse-phone-number (string &optional number-type)
+  "Parse a phone number from STRING and return a list of integers the form
+\(area-code exchange number) or (area-code exchange number extension).
+This is both lenient and strict in what it will parse - whitespace may 
+appear (or not) between any of the groups of digits, parentheses around the
+area code are optional, as is a dash between the exchange and number, and
+a '1' preceeding the area code; but there must be three digits in the area 
+code and exchange, and four in the number (if they are present).  An error 
+will be signalled if unparsable.  All of these are unambigously parsable:
+
+  ( 415 ) 555 - 1212 x123   ->   (415 555 1212 123)
+  (415)555-1212 123         ->   (415 555 1212 123)
+  (1-415) 555-1212 123      ->   (415 555 1212 123)
+  1 (415)-555-1212 123      ->   (415 555 1212 123)
+  555-1212 123              ->   (0 555 1212 123)
+  555 1212                  ->   (0 555 1212)
+  415 555 1212              ->   (415 555 1212)
+  1 415 555 1212            ->   (415 555 1212)
+  5551212                   ->   (0 555 1212)
+  4155551212                ->   (415 555 1212)
+  4155551212123             ->   (415 555 1212 123)
+  5551212x123               ->   (0 555 1212 123)
+  1234                      ->   (0 0 0 1234)
+
+Note that \"4151212123\" is ambiguous; it could be interpreted either as
+\"(415) 121-2123\" or as \"415-1212 x123\".
+
+\(And uh, oh yeah, this does little if bbdb-north-american-phone-numbers-p
+is nil...\)"
+
+  (cond ((if number-type
+	     (eq number-type 'euro)
+	   (not bbdb-north-american-phone-numbers-p))
+	 (list (bbdb-string-trim string)))
+	((string-match bbdb-phone-regexp-1 string)
+	 ;; (415) 555-1212 x123
+	 (list (bbdb-subint string 1) (bbdb-subint string 2)
+	       (bbdb-subint string 3) (bbdb-subint string 4)))
+	((string-match bbdb-phone-regexp-2 string)
+	 ;; (415) 555-1212
+	 (list (bbdb-subint string 1) (bbdb-subint string 2)
+	       (bbdb-subint string 3)))
+	((string-match bbdb-phone-regexp-3 string)
+	 ;; 555-1212 x123
+	 (list 0 (bbdb-subint string 1) (bbdb-subint string 2)
+	       (bbdb-subint string 3)))
+	((string-match bbdb-phone-regexp-4 string)
+	 ;; 555-1212
+	 (list 0 (bbdb-subint string 1) (bbdb-subint string 2)))
+	((string-match bbdb-phone-regexp-5 string)
+	 ;; x123
+	 (list 0 0 0 (bbdb-subint string 1)))
+	(t (error "phone number unparsable."))))
+
+
+
+(defun bbdb-parse-zip-string (string)
+  (cond ((string-match "^[ \t\n]*$" string) 0)
+	((string-match "^[ \t\n]*[0-9][0-9][0-9][0-9][0-9][ \t\n]*$" string)
+	 (string-to-int string))
+	((string-match "^[ \t\n]*\\([0-9][0-9][0-9][0-9][0-9]\\)[ \t\n]*-?[ \t\n]*\\([0-9][0-9][0-9][0-9]\\)[ \t\n]*$" string)
+	 (list (bbdb-subint string 1) (bbdb-subint string 2)))
+	;; Match zip codes for Canada, UK, etc. (result is ("LL47" "U4B")).
+	((string-match
+	  "^[ \t\n]*\\([A-Za-z0-9]+\\)[ \t\n]+\\([A-Za-z0-9]+\\)[ \t\n]*$"
+	  string)
+	 (list (substring string (match-beginning 1) (match-end 1))
+	       (substring string (match-beginning 2) (match-end 2))))
+	((string-match "-[^-]-" string)
+	 (error "too many dashes in zip code."))
+	((string-match "[^-0-9 \t\n]" string)
+	 (error "illegal characters in zip code."))
+	((string-match "[0-9][0-9][0-9][0-9][0-9][0-9]" string)
+	 (error "too many digits in zip code."))
+	((< (length string) 5)
+	 (error "not enough digits in zip code."))
+	(t (error "not a valid 5-digit or 5+4 digit zip code."))))
+
+
+(defun bbdb-read-new-record ()
+  "Prompt for and return a completely new bbdb-record.  Doesn't insert it in to
+the database or update the hashtables, but does insure that there will not be
+name collisions."
+  (bbdb-records) ; make sure database is loaded
+  (if bbdb-readonly-p (error "The Insidious Big Brother Database is read-only."))
+  (let (firstname lastname)
+    (bbdb-error-retry
+      (progn
+	(if current-prefix-arg
+	    (setq firstname (bbdb-read-string "First Name: ")
+		  lastname (bbdb-read-string "Last Name: "))
+	  (let ((names (bbdb-divide-name (bbdb-read-string "Name: "))))
+	    (setq firstname (car names)
+		  lastname (nth 1 names))))
+	(if (string= firstname "") (setq firstname nil))
+	(if (string= lastname "") (setq lastname nil))
+	(if (bbdb-gethash (downcase (if (and firstname lastname) (concat firstname " " lastname)
+					(or firstname lastname ""))))
+	    (error "%s %s is already in the database" (or firstname "") (or lastname "")))))
+    (let ((company (bbdb-read-string "Company: "))
+	  (net (bbdb-split (bbdb-read-string "Network Address: ") ","))
+	  (addrs (let (L L-tail str addr)
+		   (while (not (string= ""
+				 (setq str (bbdb-read-string "Address Description [RET when no more addrs]: "))))
+		     (setq addr (make-vector bbdb-address-length nil))
+		     (bbdb-record-edit-address addr str)
+		     (if L
+			 (progn (setcdr L-tail (cons addr nil))
+				(setq L-tail (cdr L-tail)))
+			 (setq L (cons addr nil)
+			       L-tail L)))
+		   L))
+	  (phones (let (L L-tail str)
+		    (while (not (string= ""
+					 (setq str
+					       (bbdb-read-string "Phone Location [RET when no more phones]: "))))
+		      (let* ((phonelist
+			      (bbdb-error-retry
+				(bbdb-parse-phone-number
+				  (read-string "Phone: "
+					       (condition-case nil
+						   (format "(%03d) " bbdb-default-area-code)
+						 (t nil))))))
+			     (phone (apply 'vector str
+					   (if (= 3 (length phonelist))
+					       (nconc phonelist '(0))
+					       phonelist))))
+			(if L
+			    (progn (setcdr L-tail (cons phone nil))
+				   (setq L-tail (cdr L-tail)))
+			    (setq L (cons phone nil)
+				  L-tail L))))
+		    L))
+	  (notes (bbdb-read-string "Additional Comments: ")))
+      (if (string= company "") (setq company nil))
+      (if (string= notes "") (setq notes nil))
+      (let ((record
+	     (vector firstname lastname nil company phones addrs net notes
+		     (make-vector bbdb-cache-length nil))))
+	record))))
+
+(defun bbdb-create (record)
+  "Add a new entry to the bbdb database; prompts for all relevant info
+using the echo area, inserts the new record in the db, sorted alphabetically,
+and offers to save the db file.  DO NOT call this from a program.  Call
+bbdb-create-internal instead."
+  (interactive (list (bbdb-read-new-record)))
+  (bbdb-invoke-hook 'bbdb-create-hook record)
+  (bbdb-change-record record t)
+  (bbdb-display-records (list record)))
+
+
+(defmacro bbdb-check-type (place predicate)
+  (list 'while (list 'not (list predicate place))
+	(nconc (cond ((eq (car-safe place) 'aref)
+		      (list 'aset (nth 1 place) (nth 2 place)))
+		     ((eq (car-safe place) 'car)
+		      (list 'setcar (nth 1 place)))
+		     ((eq (car-safe place) 'cdr)
+		      (list 'setcdr (nth 1 place)))
+		     (t (list 'setq place)))
+	       (list 
+		(list 'signal ''wrong-type-argument
+		      (list 'list (list 'quote predicate) place))))))
+
+
+(defun bbdb-create-internal (name company net addrs phones notes)
+  "Adds a record to the database; this function does a fair amount of
+error-checking on the passed in values, so it's safe to call this from
+other programs.
+
+NAME is a string, the name of the person to add.  An error is signalled
+ if that name is already in use.
+COMPANY is a string or nil.
+NET is a comma-separated list of email addresses, or a list of strings.
+ An error is signalled if that name is already in use.
+ADDRS is a list of address objects.  An address is a vector of the form
+   [\"location\" \"line1\" \"line2\" \"line3\" \"City\" \"State\" zip]
+ where `zip' is nil, an integer, or a cons of two integers.
+PHONES is a list of phone-number objects.  A phone-number is a vector of
+ the form
+   [\"location\" areacode prefix suffix extension-or-nil]
+ or
+   [\"location\" \"phone-number\"]
+NOTES is a string, or an alist associating symbols with strings."
+  (let (firstname lastname aka)
+    (while (progn
+	     (setq name (and name (bbdb-divide-name name)))
+	     (setq firstname (car name) lastname (nth 1 name))
+	     (bbdb-gethash (downcase (if (and firstname lastname)
+					 (concat firstname " " lastname)
+				       (or firstname lastname "")))))
+      (setq name (signal 'error
+			 (list (format "%s %s is already in the database"
+				       (or firstname "") (or lastname ""))))))
+    (and company (bbdb-check-type company stringp))
+    (if (stringp net)
+	(setq net (bbdb-split net ",")))
+    (let ((rest net))
+      (while rest
+	(while (bbdb-gethash (downcase (car rest)))
+	  (setcar rest
+		  (signal 'error (list (format
+					"%s is already in the database"
+					(car rest))))))
+	(setq rest (cdr rest))))
+    (setq addrs
+	  (mapcar
+	    (function (lambda (addr)
+	      (while (or (not (vectorp addr))
+			 (/= (length addr) bbdb-address-length))
+		(setq addr (signal 'wrong-type-argument (list 'vectorp addr))))
+	      (bbdb-check-type (aref addr 0) stringp)
+	      (bbdb-check-type (aref addr 1) stringp)
+	      (bbdb-check-type (aref addr 2) stringp)
+	      (bbdb-check-type (aref addr 3) stringp)
+	      (bbdb-check-type (aref addr 4) stringp)
+	      (bbdb-check-type (aref addr 5) stringp)
+	      (while (and (aref addr 6)
+			  (not (integerp (aref addr 6)))
+			  (not (and (consp (aref addr 6))
+				    (integerp (car (aref addr 6)))
+				    (integerp (car (cdr (aref addr 6))))
+				    (null (cdr (cdr (aref addr 6)))))))
+		(aset addr 6 (signal 'wrong-type-argument
+				     (list 'zipcodep (aref addr 6)))))
+	      addr))
+	    addrs))
+    (setq phones
+	  (mapcar
+	   (function (lambda (phone)
+	     (while (or (not (vectorp phone))
+			(and (/= (length phone) 2)
+			     (/= (length phone) bbdb-phone-length)))
+	       (setq phone
+		     (signal 'wrong-type-argument (list 'vectorp phone))))
+	     (bbdb-check-type (aref phone 0) stringp)
+	     (if (= 2 (length phone))
+		 (bbdb-check-type (aref phone 1) stringp)
+	       (bbdb-check-type (aref phone 1) integerp)
+	       (bbdb-check-type (aref phone 2) integerp)
+	       (bbdb-check-type (aref phone 3) integerp)
+	       (and (aref phone 4) (bbdb-check-type (aref phone 4) integerp))
+	       (if (eq 0 (aref phone 4)) (aset phone 4 nil)))
+	     phone))
+	   phones))
+    (or (stringp notes)
+	(setq notes
+	      (mapcar (function (lambda (note)
+		        (bbdb-check-type note consp)
+			(bbdb-check-type (car note) symbolp)
+			(if (consp (cdr note))
+			    (setq note (cons (car note) (car (cdr note)))))
+			(bbdb-check-type (cdr note) stringp)
+		        note))
+		      notes)))
+    (let ((record
+	   (vector firstname lastname aka company phones addrs net notes
+		   (make-vector bbdb-cache-length nil))))
+      (bbdb-invoke-hook 'bbdb-create-hook record)
+      (bbdb-change-record record t)
+      record)))
+
+
+
+
+(defun bbdb-current-record (&optional planning-on-modifying)
+  "Returns the record which the point is point at.  In linear time, man..."
+  (if (and planning-on-modifying bbdb-readonly-p)
+      (error "The Insidious Big Brother Database is read-only."))
+  (if (not (equal bbdb-buffer-name (buffer-name (current-buffer))))
+      (error "this command only works while in the \"%s\" buffer."
+	     bbdb-buffer-name))
+  (let ((p (point))
+	(rest bbdb-records)
+	(rec nil))
+    (while (and (cdr rest) (not rec))
+      (if (> (nth 2 (car (cdr rest))) p)
+	  (setq rec (car (car rest))))
+      (setq rest (cdr rest)))
+    (or rec (car (car rest)))))
+
+
+;; yow, are we object oriented yet?
+(defun bbdb-record-get-field-internal (record field)
+  (cond ((eq field 'name)	(bbdb-record-name record))
+	((eq field 'net)	(bbdb-record-net record))
+	((eq field 'aka)	(bbdb-record-aka record))
+	((eq field 'phone)	(bbdb-record-phones record))
+	((eq field 'address)	(bbdb-record-addresses record))
+	((eq field 'property)	(bbdb-record-raw-notes record))
+	(t (error "doubleplus ungood: unknown field type %s" field))))
+
+(defun bbdb-record-store-field-internal (record field value)
+  (cond ((eq field 'name)	(error "doesn't work on names"))
+	((eq field 'net)	(bbdb-record-set-net record value))
+	((eq field 'aka)	(bbdb-record-set-aka record value))
+	((eq field 'phone)	(bbdb-record-set-phones record value))
+	((eq field 'address)	(bbdb-record-set-addresses record value))
+	((eq field 'property)	(bbdb-record-set-raw-notes record value))
+	(t (error "doubleplus ungood: unknown field type %s" field))))
+
+(defun bbdb-record-edit-field-internal (record field &optional which)
+  (cond ((eq field 'name)	(bbdb-record-edit-name record))
+	((eq field 'net)	(bbdb-record-edit-net record))
+	((eq field 'aka)	(bbdb-record-edit-aka record))
+	((eq field 'phone)	(bbdb-record-edit-phone which))
+	((eq field 'address)	(bbdb-record-edit-address which))
+	((eq field 'property)	(bbdb-record-edit-property record (car which)))
+	(t (error "doubleplus ungood: unknown field type %s" field))))
+
+	
+(defun bbdb-current-field (&optional planning-on-modifying)
+  (save-excursion
+    ;; get to beginning of this record
+    (beginning-of-line)
+    (let ((p (point)))
+      (while (not (or (eobp) (looking-at "^[^ \t\n]")))
+	(forward-line -1))
+      (let* ((record (or (bbdb-current-record planning-on-modifying)
+			 (error "unperson")))
+	     (bbdb-elided-display (nth 1 (assq record bbdb-records)))
+	     (count 0)
+	     (tmp (nconc
+		   (list (list 'name record))
+		   (and (bbdb-field-shown-p 'phone)
+		     (mapcar (function (lambda (phone) (list 'phone phone)))
+			     (bbdb-record-phones record)))
+		   (and (bbdb-field-shown-p 'address)
+		     (apply 'nconc
+		       (mapcar (function (lambda (addr)
+				(let ((L (list 'address addr)))
+				  (nconc
+				   (if (string= "" (bbdb-address-street1 addr))
+				       nil (list L))
+				   (if (string= "" (bbdb-address-street2 addr))
+				       nil (list L))
+				   (if (string= "" (bbdb-address-street3 addr))
+				       nil (list L))
+				   (list L)))))
+			       (bbdb-record-addresses record))))
+		   (if (and (bbdb-record-net record)
+			    (bbdb-field-shown-p 'net))
+		       (list (list 'net record)))
+		   (if (and (bbdb-record-aka record)
+			    (bbdb-field-shown-p 'aka))
+		       (list (list 'aka record)))
+		   (let ((notes (bbdb-record-raw-notes record)))
+		     (if (stringp notes)
+			 (setq notes (list (cons 'notes notes))))
+		     (apply
+		       'nconc
+		       (mapcar
+			(function (lambda (note)
+			  (if (bbdb-field-shown-p (car note))
+			      (let* ((L (list 'property note))
+				     (LL (list L))
+				     (i 0)
+				     (notefun (intern (concat "bbdb-format-record-"
+							      (symbol-name (car note)))))
+				     (text (if (fboundp notefun)
+						 (funcall notefun (cdr note))
+					     (cdr note))))
+				(while (string-match "\n" text i)
+				  (setq i (match-end 0)
+					LL (cons L LL)))
+				LL))))
+			notes)))
+		   )))
+	(while (< (point) p)
+	  (setq count (1+ count))
+	  (forward-line 1))
+	(nth count tmp)))))
+
+
+(defun bbdb-apply-next-command-to-all-records ()
+  "Typing \\<bbdb-mode-map>\\[bbdb-apply-next-command-to-all-records] \
+in the *BBDB* buffer makes the next command operate on all
+of the records currently displayed.  \(Note that this only works for
+certain commands.\)"
+  (interactive)
+  (message (substitute-command-keys
+	    "\\<bbdb-mode-map>\\[bbdb-apply-next-command-to-all-records] - "))
+  (setq prefix-arg current-prefix-arg
+	last-command this-command)
+  nil)
+
+(defmacro bbdb-do-all-records-p ()
+  "Whether the last command was bbdb-apply-next-command-to-all-records."
+  '(eq last-command 'bbdb-apply-next-command-to-all-records))
+
+
+(defun bbdb-insert-new-field (name contents)
+  "Add a new field to the current record; the field type and contents
+are prompted for if not supplied.
+
+If you are inserting a new phone-number field, you can control whether
+it is a north american or european phone number by providing a prefix
+argument.  A prefix arg of ^U means it's to be a euronumber, and any
+other prefix arg means it's to be a a structured north american number.
+Otherwise, which style is used is controlled by the variable
+bbdb-north-american-phone-numbers-p."
+  (interactive (let ((name "")
+		     (completion-ignore-case t))
+		 (while (string= name "")
+		   (setq name
+			 (downcase
+			   (completing-read "Insert Field: "
+			     (append '(("phone") ("address") ("net")
+				       ("AKA") ("notes"))
+				     (bbdb-propnames))
+			     nil
+			     nil ; used to be t
+			     nil))))
+		 (setq name (intern name))
+		 (list name (bbdb-prompt-for-new-field-value name))))
+  (if (null contents)
+      (setq contents (bbdb-prompt-for-new-field-value name)))
+  (let ((record (bbdb-current-record t)))
+    (if (null record) (error "current record unexists!"))
+    (cond ((eq name 'phone)
+	   (bbdb-record-set-phones record
+	     (nconc (bbdb-record-phones record) (list contents))))
+	  ((eq name 'address)
+	   (bbdb-record-set-addresses record
+	     (nconc (bbdb-record-addresses record) (list contents))))
+	  ((eq name 'net)
+	   (if (bbdb-record-net record)
+	       (error "There already are net addresses!"))
+	   (if (stringp contents)
+	       (setq contents (bbdb-split contents ",")))
+	   ;; first detect any conflicts....
+	   (let ((nets contents))
+	     (while nets
+	       (let ((old (bbdb-gethash (downcase (car nets)))))
+		 (if (and old (not (eq old record)))
+		     (error "net address \"%s\" is used by \"%s\""
+			    (car nets)
+			    (or (bbdb-record-name old) (car (bbdb-record-net old))))))
+	       (setq nets (cdr nets))))
+	   ;; then store.
+	   (let ((nets contents))
+	     (while nets
+	       (bbdb-puthash (downcase (car nets)) record)
+	       (setq nets (cdr nets))))
+	   (bbdb-record-set-net record contents)
+	   )
+	  ((eq name 'aka)
+	   (if (bbdb-record-aka record)
+	       (error "there already are alternate names!"))
+	   (if (stringp contents)
+	       (setq contents (bbdb-split contents ";")))
+	   ;; first detect any conflicts....
+	   (let ((aka contents))
+	     (while aka
+	       (let ((old (bbdb-gethash (downcase (car aka)))))
+		 (if (and old (not (eq old record)))
+		     (error "alternate name \"%s\" is used by \"%s\""
+			    (car aka)
+			    (or (bbdb-record-name old)
+				(car (bbdb-record-net old))))))
+	       (setq aka (cdr aka))))
+	   ;; then store.
+	   (let ((aka contents))
+	     (while aka
+	       (bbdb-puthash (downcase (car aka)) record)
+	       (setq aka (cdr aka))))
+	   (bbdb-record-set-aka record contents)
+	   )
+	  ((eq name 'notes)
+	   (if (bbdb-record-notes record) (error "there already are notes!"))
+	   (bbdb-record-set-notes record contents))
+	  ((assoc (symbol-name name) (bbdb-propnames))
+	   (if (and (consp (bbdb-record-raw-notes record))
+		    (assq name (bbdb-record-raw-notes record)))
+	       (error "there is already a \"%s\" note!" name))
+	   (bbdb-record-putprop record name contents))
+	  (t (error "doubleplus ungood: unknow how to set slot %s" name)))
+    (bbdb-change-record record nil)
+;    (bbdb-offer-save)
+    (let ((bbdb-elided-display nil))
+      (bbdb-redisplay-one-record record))))
+
+(defun bbdb-prompt-for-new-field-value (name)
+  (cond ((eq name 'net) (bbdb-read-string "Net: "))
+	((eq name 'aka) (bbdb-read-string "Alternate Names: "))
+	((eq name 'phone)
+	 (let ((p (make-vector
+		    (if (if current-prefix-arg
+			    (numberp current-prefix-arg)
+			    bbdb-north-american-phone-numbers-p)
+			bbdb-phone-length
+			2)
+		    0)))
+	   (aset p 0 nil)
+	   (aset p 1
+		 (if (= bbdb-phone-length (length p))
+		     (if (integerp bbdb-default-area-code)
+			 bbdb-default-area-code
+		       0)
+		     nil))
+	   (bbdb-record-edit-phone p)
+	   p))
+	((eq name 'address)
+	 (let ((a (make-vector bbdb-address-length nil)))
+	   (bbdb-record-edit-address a)
+	   a))
+	((eq name 'notes) (bbdb-read-string "Notes: "))
+	((assoc (symbol-name name) (bbdb-propnames))
+	 (bbdb-read-string (format "%s: " name)))
+	(t
+	 (if (bbdb-y-or-n-p (format "\"%s\" is an unknown field name.  Define it? " name))
+	     (bbdb-set-propnames
+	       (append (bbdb-propnames) (list (list (symbol-name name)))))
+	     (error "unknown field \"%s\"" name))
+	 (bbdb-read-string (format "%s: " name)))))
+
+
+(defun bbdb-edit-current-field ()
+  "Edit the contents of the Insidious Big Brother Database field displayed on 
+the current line (this is only meaningful in the \"*BBDB*\" buffer.)   If the 
+cursor is in the middle of a multi-line field, such as an address or comments 
+section, then the entire field is edited, not just the current line."
+  (interactive)
+  (let* ((record (bbdb-current-record t))
+	 (field (bbdb-current-field t))
+	 need-to-sort)
+    (or field (error "on an unfield"))
+    (setq need-to-sort
+	  (bbdb-record-edit-field-internal record (car field) (nth 1 field)))
+    (bbdb-change-record record need-to-sort)
+    (bbdb-redisplay-one-record record)
+;    (bbdb-offer-save)
+    ))
+
+(defun bbdb-record-edit-name (bbdb-record)
+  (let (fn ln co need-to-sort new-name old-name)
+    (bbdb-error-retry
+      (progn
+	(if current-prefix-arg
+	    (setq fn (bbdb-read-string "First Name: "
+				       (bbdb-record-firstname bbdb-record))
+		  ln (bbdb-read-string "Last Name: "
+				       (bbdb-record-lastname bbdb-record)))
+	  (let ((names (bbdb-divide-name
+			(bbdb-read-string "Name: "
+			  (bbdb-record-name bbdb-record)))))
+	    (setq fn (car names)
+		  ln (nth 1 names))))
+	(setq need-to-sort (or (not (string= fn
+					     (or (bbdb-record-firstname bbdb-record) "")))
+			       (not (string= ln
+					     (or (bbdb-record-lastname bbdb-record) "")))))
+	(if (string= "" fn) (setq fn nil))
+	(if (string= "" ln) (setq ln nil))
+	;; check for collisions
+	(setq new-name (if (and fn ln) (concat fn " " ln)
+			   (or fn ln))
+	      old-name (bbdb-record-name bbdb-record))
+	(if (and new-name
+		 (not (and old-name (string= (downcase new-name)
+					     (downcase old-name))))
+		 (bbdb-gethash (downcase new-name)))
+	    (error "%s is already in the database!" new-name))))
+    (setq co (bbdb-read-string "Company: "
+			       (bbdb-record-company bbdb-record)))
+    (if (string= "" co) (setq co nil))
+    (setq need-to-sort
+	  (or need-to-sort
+	      (not (equal (if co (downcase co) "")
+			  (downcase (or (bbdb-record-company bbdb-record)
+					""))))))
+    ;;
+    ;; delete the old hash entry
+    (and (bbdb-record-name bbdb-record)
+	 (bbdb-remhash (downcase (bbdb-record-name bbdb-record))))
+    (bbdb-record-set-namecache bbdb-record nil)
+    (bbdb-record-set-firstname bbdb-record fn)
+    (bbdb-record-set-lastname bbdb-record ln)
+    (bbdb-record-set-company bbdb-record co)
+    ;; add a new hash entry
+    (and (or fn ln)
+	 (bbdb-puthash (downcase (bbdb-record-name bbdb-record))
+		       bbdb-record))
+    need-to-sort))
+
+(defun bbdb-record-edit-address (addr &optional location)
+  (let* ((loc (or location (bbdb-read-string "Location: " (bbdb-address-location addr))))
+	 (st1 (bbdb-read-string "Street, line 1: " (bbdb-address-street1 addr)))
+	 (st2 (if (string= st1 "") ""
+		  (bbdb-read-string "Street, line 2: " (bbdb-address-street2 addr))))
+	 (st3 (if (string= st2 "") ""
+		  (bbdb-read-string "Street, line 3: " (bbdb-address-street3 addr))))
+	 (cty (bbdb-read-string "City: " (bbdb-address-city addr)))
+	 (ste (bbdb-read-string "State: " (bbdb-address-state addr)))
+	 (zip (bbdb-error-retry
+		(bbdb-parse-zip-string
+		  (bbdb-read-string "Zip Code: " (bbdb-address-zip-string addr))))))
+    (bbdb-address-set-location addr loc)
+    (bbdb-address-set-street1 addr st1)
+    (bbdb-address-set-street2 addr st2)
+    (bbdb-address-set-street3 addr st3)
+    (bbdb-address-set-city addr cty)
+    (bbdb-address-set-state addr ste)
+    (bbdb-address-set-zip addr zip)
+    nil))
+
+(defun bbdb-record-edit-phone (phone-number)
+  (let ((newl (bbdb-read-string "Location: "
+				 (bbdb-phone-location phone-number)))
+	(newp (let ((bbdb-north-american-phone-numbers-p
+		     (= (length phone-number) bbdb-phone-length)))
+		(bbdb-error-retry
+		  (bbdb-parse-phone-number
+		    (read-string "Phone: " (bbdb-phone-string phone-number))
+		    )))))
+    (bbdb-phone-set-location phone-number newl)
+    (bbdb-phone-set-area phone-number (nth 0 newp)) ; euronumbers too.
+    (if (= (length phone-number) 2)
+	nil
+      (bbdb-phone-set-exchange phone-number (nth 1 newp))
+      (bbdb-phone-set-suffix phone-number (nth 2 newp))
+      (bbdb-phone-set-extension phone-number (or (nth 3 newp) 0))))
+  nil)
+
+(defun bbdb-record-edit-net (bbdb-record)
+  (let ((str (bbdb-read-string "Net: "
+	       (mapconcat (function identity)
+			  (bbdb-record-net bbdb-record)
+			  ", "))))
+    (let ((oldnets (bbdb-record-net bbdb-record))
+	  (newnets (bbdb-split str ",")))
+      ;; first check for any conflicts...
+      (let ((rest newnets))
+	(while rest
+	  (let ((old (bbdb-gethash (downcase (car rest)))))
+	    (if (and old (not (eq old bbdb-record)))
+		(error "net address \"%s\" is used by \"%s\""
+		       (car rest) (bbdb-record-name old))))
+	  (setq rest (cdr rest))))
+      ;; then update.
+      (let ((rest oldnets))
+	(while rest
+	  (bbdb-remhash (downcase (car rest)))
+	  (setq rest (cdr rest))))
+      (let ((nets newnets))
+	(while nets
+	  (bbdb-puthash (downcase (car nets)) bbdb-record)
+	  (setq nets (cdr nets))))
+      (bbdb-record-set-net bbdb-record newnets)
+      ))
+  nil)
+
+(defun bbdb-record-edit-aka (bbdb-record)
+  (let ((str (bbdb-read-string "AKA: "
+	       (mapconcat (function identity)
+			  (bbdb-record-aka bbdb-record)
+			  "; "))))
+    (let ((oldaka (bbdb-record-aka bbdb-record))
+	  (newaka (bbdb-split str ";")))
+      ;; first check for any conflicts...
+      (let ((rest newaka))
+	(while rest
+	  (let ((old (bbdb-gethash (downcase (car rest)))))
+	    (if (and old (not (eq old bbdb-record)))
+		(error "alternate name address \"%s\" is used by \"%s\""
+		       (car rest) (bbdb-record-name old))))
+	  (setq rest (cdr rest))))
+      ;; then update.
+      (let ((rest oldaka))
+	(while rest
+	  (bbdb-remhash (downcase (car rest)))
+	  (setq rest (cdr rest))))
+      (let ((aka newaka))
+	(while aka
+	  (bbdb-puthash (downcase (car aka)) bbdb-record)
+	  (setq aka (cdr aka))))
+      (bbdb-record-set-aka bbdb-record newaka)
+      ))
+  nil)
+
+(defun bbdb-record-edit-notes (bbdb-record &optional regrind)
+  (interactive (list (bbdb-current-record t) t))
+  (let ((notes (bbdb-read-string "Notes: " (bbdb-record-notes bbdb-record))))
+    (bbdb-record-set-notes bbdb-record (if (string= "" notes) nil notes)))
+  (if regrind
+      (save-excursion
+	(set-buffer bbdb-buffer-name)
+	(bbdb-redisplay-one-record bbdb-record)))
+  nil)
+
+(defun bbdb-record-edit-property (bbdb-record &optional prop regrind)
+  (interactive (list (bbdb-current-record t) nil t))
+  (let* ((propnames (bbdb-propnames))
+	 (propname (if prop (symbol-name prop)
+		     (completing-read
+		       (format "Edit property of %s: "
+			       (bbdb-record-name bbdb-record))
+		       (cons '("notes") propnames))))
+	 (propsym (or prop (if (equal "" propname) 'notes (intern propname))))
+	 (string (bbdb-read-string (format "%s: " propname)
+				   (bbdb-record-getprop bbdb-record propsym))))
+    (bbdb-record-putprop bbdb-record propsym
+			 (if (string= "" string) nil string)))
+  (if regrind
+      (save-excursion
+	(set-buffer bbdb-buffer-name)
+	(bbdb-redisplay-one-record bbdb-record)))
+  nil)
+
+
+(defsubst bbdb-field-equal (x y)
+  (if (and (consp x) (consp y))
+      (and (eq (car x) (car y))
+	   (eq (car (cdr x)) (car (cdr y)))
+	   (eq (car (cdr (cdr x))) (car (cdr (cdr y)))))
+    (eq x y)))
+
+(defun bbdb-next-field (&optional count planning-on-modifying)
+  (or count (setq count 1))
+  (beginning-of-line)
+  (let* ((record (bbdb-current-record planning-on-modifying))
+	 (field (bbdb-current-field planning-on-modifying))
+	 (next-record record)
+	 (next-field field)
+	 (signum (if (< count 0) -1 1))
+	 (i 0))
+    (if (< count 0) (setq count (- count)))
+    (if field
+	(while (and next-field (< i count))
+	  (while (bbdb-field-equal next-field field)
+	    (forward-line signum)
+	    (setq next-record (bbdb-current-record planning-on-modifying)
+		  next-field (bbdb-current-field planning-on-modifying))
+	    (or (eq next-record record)
+		(setq next-field nil)))
+	  (setq i (1+ i))