I don't think many people will like this. But as I keep modifying and
expanding bbdb-parse-zip and bbdb-address-zip-string and all the other
functions I started to work on this patch. It's not based on the
latest 2.2 tarball but if people decide to incorporate it, then I'll
get the latest tarball and redo it.
Therefore: Shall we move to plain strings or not?
Alex.
~/elisp/bbdb $ cvs diff -c -D yesterday
cvs diff: Diffing .
Index: ChangeLog
===================================================================
RCS file: /home/cvsroot/emacs/bbdb2/ChangeLog,v
retrieving revision 1.5
diff -c -r1.5 ChangeLog
*** ChangeLog 2000/05/25 23:10:34 1.5
--- ChangeLog 2000/07/16 00:28:24
***************
*** 1,3 ****
--- 1,35 ----
+ 2000-07-16 <[EMAIL PROTECTED]>
+
+ * lisp/bbdb.el (bbdb-file-format): Set to 6.
+
+ * lisp/bbdb-migrate.el (bbdb-migration-features): Added
+ description for version 6.
+ (bbdb-migrate): Added migration 5 -> 6.
+ (bbdb-unmigrate-record): Added unmigration 6 -> 5.
+ (bbdb-migrate-plain-zip-codes): New function with code from
+ bbdb-address-zip-string.
+ (bbdb-unmigrate-plain-zip-codes): New function with code from
+ bbdb-parse-zip-string.
+
+ * lisp/bbdb-com.el (bbdb-parse-zip-string): Just return string now.
+ (bbdb-create-internal): Doc change, check wether zip code is stringp.
+ (bbdb-address-edit-default): Use bbdb-address-zip instead of
+ bbdb-address-zip-string.
+
+ * lisp/bbdb.el (bbdb-continental-zip-regexp): New option.
+ (bbdb-address-is-continental): Uses bbdb-continental-zip-regexp now.
+ (bbdb-address-zip-string): defalised to bbdb-address-zip.
+ (bbdb-format-address-continental): Use bbdb-address-zip instead of
+ bbdb-address-zip-string.
+ (bbdb-format-address-default): Ditto.
+
+ * lisp/bbdb-print.el (bbdb-print-format-address-continental): Use
+ bbdb-address-zip instead of bbdb-address-zip-string.
+ (bbdb-print-format-address-default): Ditto.
+
+ * lisp/bbdb-snarf.el (bbdb-snarf-region): Store zip code as plain
+ string instead of passing it through bbdb-parse-zip-string.
+
2000-05-26 Alex Schroeder <[EMAIL PROTECTED]>
* lisp/bbdb-com.el (bbdb-parse-zip-string): Match brazilian zip
cvs diff: Diffing lisp
Index: lisp/bbdb-com.el
===================================================================
RCS file: /home/cvsroot/emacs/bbdb2/lisp/bbdb-com.el,v
retrieving revision 1.5
retrieving revision 1.6
diff -c -r1.5 -r1.6
*** lisp/bbdb-com.el 2000/05/25 23:11:00 1.5
--- lisp/bbdb-com.el 2000/07/15 23:26:28 1.6
***************
*** 324,370 ****
;;; Parsing other things
- ;;; Ideally we'd pass the country field in here to help with
- ;;; parsing. Or maybe even the entire address string, in case you have
- ;;; a handy postcode database.
(defun bbdb-parse-zip-string (string)
! (cond ((string-match "^[ \t\n]*$" string) 0)
! ;; Matches 1 to 6 digits.
! ((string-match "^[ \t\n]*[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[ \t\n]*$" string)
! (string-to-int string))
! ;; Matches 5 digits and 3 or 4 digits.
! ((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))))
! ;; Match zip codes for continental Europe. Examples "CH-8057"
! ;; or "F - 83320" (result is ("CH" "8057") or ("F" "83320")).
! ;; Support for "NL-2300RA" added at request from Carsten Dominik
! ;; <[EMAIL PROTECTED]>
! ((string-match
! "^[ \t\n]*\\([A-Z]+\\)[ \t\n]*-?[ \t\n]*\\([0-9]+ ?[A-Z]*\\)[ \t\n]*$" string)
! (list (substring string (match-beginning 1) (match-end 1))
! (substring string (match-beginning 2) (match-end 2))))
! ;; Match zip codes from Sweden where the five digits are grouped 3+2
! ;; at the request from Mats Lofdahl <[EMAIL PROTECTED]>.
! ;; (result is ("SE" (133 36)))
! ((string-match
! "^[ \t\n]*\\([A-Z]+\\)[ \t\n]*-?[ \t\n]*\\([0-9]+\\)[ \t\n]+\\([0-9]+\\)[
\t\n]*$" string)
! (list (substring string (match-beginning 1) (match-end 1))
! (list (bbdb-subint string 2)
! (bbdb-subint string 3))))
! ;; Add some error messages
! ((string-match "-[^-]+-" string)
! (error "too many dashes in zip code."))
! ((< (length string) 3)
! (error "not enough digits in zip code."))
! (t (error "not a valid 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
--- 324,334 ----
;;; Parsing other things
(defun bbdb-parse-zip-string (string)
! "Legacy function.
! Used to convert a zip code string into a zip code datastructure."
! string)
(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
***************
*** 463,470 ****
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\" ... ) \"State\" zip \"Country\"]
! where `zip' is nil, an integer, or a cons.
PHONES is a list of phone-number objects. A phone-number is a vector of
the form
[\"location\" areacode prefix suffix extension-or-nil]
--- 427,433 ----
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\" ... ) \"State\" \"Zip\" \"Country\"].
PHONES is a list of phone-number objects. A phone-number is a vector of
the form
[\"location\" areacode prefix suffix extension-or-nil]
***************
*** 504,518 ****
(bbdb-check-type (aref addr 1) listp)
(bbdb-check-type (aref addr 2) stringp)
(bbdb-check-type (aref addr 3) stringp)
! ; FIXME this seems to be too stringent, still.
! ; (while (and (aref addr 4)
! ; (not (integerp (aref addr 4)))
! ; (not (and (consp (aref addr 4))
! ; (integerp (car (aref addr 4)))
! ; (integerp (car (cdr (aref addr 4))))
! ; (null (cdr (cdr (aref addr 4)))))))
! ; (aset addr 4 (signal 'wrong-type-argument
! ; (list 'zipcodep (aref addr 4))))) ;;; zipcodep isn't REAL.
(bbdb-check-type (aref addr 5) stringp)
addr)
addrs))
--- 467,473 ----
(bbdb-check-type (aref addr 1) listp)
(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)
addr)
addrs))
***************
*** 920,928 ****
l))
(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)))))
(country (bbdb-read-string "Country: " (bbdb-address-country addr))))
(bbdb-address-set-streets addr str)
(bbdb-address-set-city addr cty)
--- 875,881 ----
l))
(cty (bbdb-read-string "City: " (bbdb-address-city addr)))
(ste (bbdb-read-string "State: " (bbdb-address-state addr)))
! (zip (bbdb-read-string "Zip Code: " (bbdb-address-zip addr)))
(country (bbdb-read-string "Country: " (bbdb-address-country addr))))
(bbdb-address-set-streets addr str)
(bbdb-address-set-city addr cty)
Index: lisp/bbdb-migrate.el
===================================================================
RCS file: /home/cvsroot/emacs/bbdb2/lisp/bbdb-migrate.el,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** lisp/bbdb-migrate.el 2000/05/25 21:53:44 1.3
--- lisp/bbdb-migrate.el 2000/07/16 00:28:38 1.4
***************
*** 62,68 ****
'((3 . "* Date format for `creation-date' and `timestamp' has changed,
from \"dd mmm yy\" (ex: 25 Sep 97) to \"yyyy-mm-dd\" (ex: 1997-09-25).")
(4 . "* Country field added.")
! (5 . "* More flexible street address.")))
;;;###autoload
(defun bbdb-migration-query (ondisk)
--- 62,69 ----
'((3 . "* Date format for `creation-date' and `timestamp' has changed,
from \"dd mmm yy\" (ex: 25 Sep 97) to \"yyyy-mm-dd\" (ex: 1997-09-25).")
(4 . "* Country field added.")
! (5 . "* More flexible street address.")
! (6 . "* Zip codes are stored as plain strings.")))
;;;###autoload
(defun bbdb-migration-query (ondisk)
***************
*** 170,176 ****
(list (car records)))
records (cdr records)))
newrecs))
!
;; Unknown Version
(t (error (format "BBDB Cannot migrate from unknown version %d"
(car bbdb-file-format-migration))))))
--- 171,185 ----
(list (car records)))
records (cdr records)))
newrecs))
! ;; Version 5 -> 6
! ((= (car bbdb-file-format-migration) 5)
! (let (newrecs)
! (while records
! (setq newrecs (append newrecs
! (list (bbdb-migrate-plain-zip-codes (car records))))
! records (cdr records)))
! newrecs))
!
;; Unknown Version
(t (error (format "BBDB Cannot migrate from unknown version %d"
(car bbdb-file-format-migration))))))
***************
*** 181,186 ****
--- 190,198 ----
`bbdb-file-format') to the version to be saved (the cdr of
`bbdb-file-format-migration')."
(cond
+ ;; Version 6 -> 5
+ ((= (cdr bbdb-file-format-migration) 5)
+ (bbdb-unmigrate-plain-zip-codes record))
;; Version 5 -> 4
((= (cdr bbdb-file-format-migration) 4)
;; Take all the old addresses, ie. the 5th field, and for each
***************
*** 210,216 ****
(setq old-addr-list (cdr old-addr-list))
(setq new-addr-list (append new-addr-list (list new-addr)))))
(aset record 5 new-addr-list)))
-
;; Version 4 -> 3
((= (cdr bbdb-file-format-migration) 3)
;; Take all the old addresses, ie. the 5th field, and for each
--- 222,227 ----
***************
*** 259,264 ****
--- 270,368 ----
(setq b (eval (list (nth 2 (car changes)) (quote a))))
(eval (list (nth 1 (car changes)) rec (quote b)))
(setq changes (cdr changes))))
+ rec)
+
+ (defun bbdb-migrate-plain-zip-codes (rec)
+ "Make all zip codes plain strings.
+ This uses the code that used to be in bbdb-address-zip-string."
+ (let (addr zip (addrs (bbdb-record-addresses rec)))
+ (while addrs
+ (setq addr (car addrs)
+ zip (if (stringp (bbdb-address-zip addr))
+ (bbdb-address-zip addr)
+ ;; if not a string, make it a string...
+ (if (consp (bbdb-address-zip addr))
+ ;; if a cons cell with two strings
+ (if (and (stringp (car (bbdb-address-zip addr)))
+ (stringp (car (cdr (bbdb-address-zip addr)))))
+ ;; if the second string starts with 4 digits
+ (if (string-match "^[0-9][0-9][0-9][0-9]"
+ (car (cdr (bbdb-address-zip addr))))
+ (concat (car (bbdb-address-zip addr))
+ "-"
+ (car (cdr (bbdb-address-zip addr))))
+ ;; if ("abc" "efg")
+ (concat (car (bbdb-address-zip addr))
+ " "
+ (car (cdr (bbdb-address-zip addr)))))
+ ;; if ("SE" (123 45))
+ (if (and (stringp (nth 0 (bbdb-address-zip addr)))
+ (consp (nth 1 (bbdb-address-zip addr)))
+ (integerp (nth 0 (nth 1 (bbdb-address-zip addr))))
+ (integerp (nth 1 (nth 1 (bbdb-address-zip addr)))))
+ (format "%s-%d %d"
+ (nth 0 (bbdb-address-zip addr))
+ (nth 0 (nth 1 (bbdb-address-zip addr)))
+ (nth 1 (nth 1 (bbdb-address-zip addr))))
+ ;; if a cons cell with two numbers
+ (if (and (integerp (car (bbdb-address-zip addr)))
+ (integerp (car (cdr (bbdb-address-zip addr)))))
+ (format "%05d-%04d" (car (bbdb-address-zip addr))
+ (car (cdr (bbdb-address-zip addr))))
+ ;; else a cons cell with a string an a number (possible
+error
+ ;; if a cons cell with a number and a string -- note the
+ ;; order!)
+ (format "%s-%d" (car (bbdb-address-zip addr))
+ (car (cdr (bbdb-address-zip addr)))))))
+ ;; if nil or zero
+ (if (or (eq 0 (bbdb-address-zip addr))
+ (null (bbdb-address-zip addr)))
+ ""
+ ;; else a number, could be 3 to 5 digits (possible error:
+assuming
+ ;; no leading zeroes in zip codes)
+ (format "%d" (bbdb-address-zip addr))))))
+ (bbdb-address-set-zip addr zip)
+ (setq addrs (cdr addrs))))
+ rec)
+
+ (defun bbdb-unmigrate-plain-zip-codes (rec)
+ "Make zip code string into zip code datastructures.
+ This uses the code that used to be in bbdb-parse-zip-string."
+ (let (addr string zip (addrs (bbdb-record-addresses rec)))
+ (while addrs
+ (setq addr (car addrs)
+ string (bbdb-address-zip addr)
+ zip (cond ((string-match "^[ \t\n]*$" string) 0)
+ ;; Matches 1 to 6 digits.
+ ((string-match "^[ \t\n]*[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[
+\t\n]*$" string)
+ (string-to-int string))
+ ;; Matches 5 digits and 3 or 4 digits.
+ ((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))))
+ ;; Match zip codes for continental Europe. Examples "CH-8057"
+ ;; or "F - 83320" (result is ("CH" "8057") or ("F" "83320")).
+ ;; Support for "NL-2300RA" added at request from Carsten Dominik
+ ;; <[EMAIL PROTECTED]>
+ ((string-match
+ "^[ \t\n]*\\([A-Z]+\\)[ \t\n]*-?[ \t\n]*\\([0-9]+ ?[A-Z]*\\)[
+\t\n]*$" string)
+ (list (substring string (match-beginning 1) (match-end 1))
+ (substring string (match-beginning 2) (match-end 2))))
+ ;; Match zip codes from Sweden where the five digits are grouped
+3+2
+ ;; at the request from Mats Lofdahl
+<[EMAIL PROTECTED]>.
+ ;; (result is ("SE" (133 36)))
+ ((string-match
+ "^[ \t\n]*\\([A-Z]+\\)[ \t\n]*-?[ \t\n]*\\([0-9]+\\)[
+\t\n]+\\([0-9]+\\)[ \t\n]*$" string)
+ (list (substring string (match-beginning 1) (match-end 1))
+ (list (bbdb-subint string 2)
+ (bbdb-subint string 3))))))
+ (bbdb-address-set-zip addr zip)
+ (setq addrs (cdr addrs))))
rec)
(defun bbdb-migrate-change-dates (rec)
Index: lisp/bbdb-print.el
===================================================================
RCS file: /home/cvsroot/emacs/bbdb2/lisp/bbdb-print.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** lisp/bbdb-print.el 2000/05/25 23:13:05 1.2
--- lisp/bbdb-print.el 2000/07/15 23:27:43 1.3
***************
*** 436,442 ****
"")
(let ((c (bbdb-address-city addr))
(s (bbdb-address-state addr))
! (z (bbdb-address-zip-string addr)))
(if (or (> (length c) 0)
(> (length z) 0)
(> (length s) 0))
--- 436,442 ----
"")
(let ((c (bbdb-address-city addr))
(s (bbdb-address-state addr))
! (z (bbdb-address-zip addr)))
(if (or (> (length c) 0)
(> (length z) 0)
(> (length s) 0))
***************
*** 476,482 ****
"")
(let ((c (bbdb-address-city addr))
(s (bbdb-address-state addr))
! (z (bbdb-address-zip-string addr)))
(if (or (> (length c) 0)
(> (length z) 0)
(> (length s) 0))
--- 476,482 ----
"")
(let ((c (bbdb-address-city addr))
(s (bbdb-address-state addr))
! (z (bbdb-address-zip addr)))
(if (or (> (length c) 0)
(> (length z) 0)
(> (length s) 0))
Index: lisp/bbdb-snarf.el
===================================================================
RCS file: /home/cvsroot/emacs/bbdb2/lisp/bbdb-snarf.el,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** lisp/bbdb-snarf.el 2000/05/24 22:47:11 1.1
--- lisp/bbdb-snarf.el 2000/07/15 23:29:20 1.2
***************
*** 207,213 ****
(goto-char (point-max))
;; zip
(re-search-backward bbdb-snarf-zip-regexp (point-min) t)
! (setq zip (bbdb-parse-zip-string (match-string 0)))
;; state
(skip-chars-backward " \t")
(setq mk (point))
--- 207,213 ----
(goto-char (point-max))
;; zip
(re-search-backward bbdb-snarf-zip-regexp (point-min) t)
! (setq zip (match-string 0))
;; state
(skip-chars-backward " \t")
(setq mk (point))
Index: lisp/bbdb.el
===================================================================
RCS file: /home/cvsroot/emacs/bbdb2/lisp/bbdb.el,v
retrieving revision 1.3
retrieving revision 1.5
diff -c -r1.3 -r1.5
*** lisp/bbdb.el 2000/05/25 21:56:36 1.3
--- lisp/bbdb.el 2000/07/16 00:25:15 1.5
***************
*** 44,50 ****
(defconst bbdb-version-date "$Date: 2000/05/02 18:19:16 $")
;; File format
! (defconst bbdb-file-format 5)
(defvar bbdb-file-format-migration nil
"A cons of two elements: the version read, and the version to write.
nil if the database was read in and is to be written in the current
--- 44,50 ----
(defconst bbdb-version-date "$Date: 2000/05/02 18:19:16 $")
;; File format
! (defconst bbdb-file-format 6)
(defvar bbdb-file-format-migration nil
"A cons of two elements: the version read, and the version to write.
nil if the database was read in and is to be written in the current
***************
*** 339,344 ****
--- 339,352 ----
:group 'bbdb-record-display
:type 'integer)
+ (defcustom bbdb-continental-zip-regexp "^\\s *[A-Z][A-Z]?\\s *-\\s *[0-9][0-9][0-9]"
+ "Regexp matching continental zip codes.
+ Addresses with zip codes matching the regexp will be formated using
+ `bbdb-format-address-continental'. The regexp should match zip codes
+ of the form CH-8052, NL-2300RA, and SE-132 54."
+ :group 'bbdb-record-display
+ :type 'regexp)
+
(defcustom bbdb-completion-type nil
"*Controls the behaviour of 'bbdb-complete-name'. If nil, completion is
done across the set of all full-names and user-ids in the bbdb-database;
***************
*** 822,870 ****
(format " x%d" (bbdb-phone-extension phone))
""))))
! (defun bbdb-address-zip-string (addr)
! "Transform the zip data into a formated string."
! ;; if a cons cell
! (if (consp (bbdb-address-zip addr))
! ;; if a cons cell with two strings
! (if (and (stringp (car (bbdb-address-zip addr)))
! (stringp (car (cdr (bbdb-address-zip addr)))))
! ;; if the second string starts with 4 digits
! (if (string-match "^[0-9][0-9][0-9][0-9]"
! (car (cdr (bbdb-address-zip addr))))
! (concat (car (bbdb-address-zip addr))
! "-"
! (car (cdr (bbdb-address-zip addr))))
! ;; if ("abc" "efg")
! (concat (car (bbdb-address-zip addr))
! " "
! (car (cdr (bbdb-address-zip addr)))))
! ;; if ("SE" (123 45))
! (if (and (stringp (nth 0 (bbdb-address-zip addr)))
! (consp (nth 1 (bbdb-address-zip addr)))
! (integerp (nth 0 (nth 1 (bbdb-address-zip addr))))
! (integerp (nth 1 (nth 1 (bbdb-address-zip addr)))))
! (format "%s-%d %d"
! (nth 0 (bbdb-address-zip addr))
! (nth 0 (nth 1 (bbdb-address-zip addr)))
! (nth 1 (nth 1 (bbdb-address-zip addr))))
! ;; if a cons cell with two numbers
! (if (and (integerp (car (bbdb-address-zip addr)))
! (integerp (car (cdr (bbdb-address-zip addr)))))
! (format "%05d-%04d" (car (bbdb-address-zip addr))
! (car (cdr (bbdb-address-zip addr))))
! ;; else a cons cell with a string an a number (possible error
! ;; if a cons cell with a number and a string -- note the
! ;; order!)
! (format "%s-%d" (car (bbdb-address-zip addr))
! (car (cdr (bbdb-address-zip addr)))))))
! ;; if nil or zero
! (if (or (eq 0 (bbdb-address-zip addr))
! (null (bbdb-address-zip addr)))
! ""
! ;; else a number, could be 3 to 5 digits (possible error: assuming
! ;; no leading zeroes in zip codes)
! (format "%d" (bbdb-address-zip addr)))))
(defmacro bbdb-record-lessp (record1 record2)
(list 'string< (list 'bbdb-record-sortkey record1)
--- 830,839 ----
(format " x%d" (bbdb-phone-extension phone))
""))))
! ;; Legacy function. Used to convert a zip datastructure string into a
! ;; formated string. As zip codes are plain strings now, use
! ;; `bbdb-address-zip' instead.
! (defalias 'bbdb-address-zip-string 'bbdb-address-zip)
(defmacro bbdb-record-lessp (record1 record2)
(list 'string< (list 'bbdb-record-sortkey record1)
***************
*** 989,1009 ****
(defun bbdb-address-is-continental (addr)
"Return non-nil if the address ADDR is a continental address.
! A continental address has zip codes of the form
! CH-8052, NL-2300RA or SE-132 54.
This is a possible identifying function for
`bbdb-address-formatting-alist' and
`bbdb-address-print-formatting-alist'."
! (and (consp (bbdb-address-zip addr))
! (stringp (car (bbdb-address-zip addr)))
! (let ((z (car (cdr (bbdb-address-zip addr)))))
! (or (integerp z)
! (and (stringp z)
! (string-match "^[0-9][0-9][0-9][0-9]" z))
! (and (consp z)
! (integerp (nth 0 z))
! (integerp (nth 1 z)))))))
(defun bbdb-format-streets (addr)
"Insert street subfields of address ADDR in current buffer.
--- 958,969 ----
(defun bbdb-address-is-continental (addr)
"Return non-nil if the address ADDR is a continental address.
! This is done by comparing the zip code to `bbdb-continental-zip-regexp'.
This is a possible identifying function for
`bbdb-address-formatting-alist' and
`bbdb-address-print-formatting-alist'."
! (string-match bbdb-continental-zip-regexp (bbdb-address-zip addr)))
(defun bbdb-format-streets (addr)
"Insert street subfields of address ADDR in current buffer.
***************
*** 1033,1039 ****
(bbdb-format-streets addr)
(let ((c (bbdb-address-city addr))
(s (bbdb-address-state addr))
! (z (bbdb-address-zip-string addr)))
(if (or (> (length c) 0)
(> (length z) 0)
(> (length s) 0))
--- 993,999 ----
(bbdb-format-streets addr)
(let ((c (bbdb-address-city addr))
(s (bbdb-address-state addr))
! (z (bbdb-address-zip addr)))
(if (or (> (length c) 0)
(> (length z) 0)
(> (length s) 0))
***************
*** 1066,1072 ****
(bbdb-format-streets addr)
(let ((c (bbdb-address-city addr))
(s (bbdb-address-state addr))
! (z (bbdb-address-zip-string addr)))
(if (or (> (length c) 0)
(> (length z) 0)
(> (length s) 0))
--- 1026,1032 ----
(bbdb-format-streets addr)
(let ((c (bbdb-address-city addr))
(s (bbdb-address-state addr))
! (z (bbdb-address-zip addr)))
(if (or (> (length c) 0)
(> (length z) 0)
(> (length s) 0))
cvs diff: Diffing misc
cvs diff: Diffing tex
cvs diff: Diffing texinfo
cvs diff: Diffing utils
_______________________________________________
bbdb-info mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/bbdb-info