[EMAIL PROTECTED] (David S. Goldberg) writes:

> So I've finally got 2.2 running the way I want, and I just tried out
> the syncBBDB which worked quite well other than the inevitable
> duplicate records.  While cleaning them out I notice that any zip code
> I've got that starts with 0, and there are a good number of them as I
> live in a region of the country in which most zip codes start with 0,
> the leading 0 is gone.  A look through the manuals indicates that zip
> codes are either an integer if "american", which I presumably have
> set, or a list of strings if "non-american" which I apparently want to
> have set (much as I set bbdb-north-american-phone-numbers-p to nil).
> But I can't find any variable or whatever to specify the non-american
> zip codes.  How do I do this?

There is no way to do this.  There has been some talk and there have
been suggestions, but the current state of the art continues to be the
following, AFAIK:

When you enter a zip code, it is compared to a number of regexps.
Whatever regexp matches determines the fate of the zip code.
Here is a summary of what happens in the function
`bbdb-parse-zip-string':

    ;; Matches 1 to 6 digits.
    ((string-match "^[ \t\n]*[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[ \t\n]*$" string)

        -> stored as integer

    ;; 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)

        -> stored as list of two integers

    ;; 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)

        -> stored as lust of two strings

    ;; Match zip codes for continental Europe.  Examples "CH-8057"
    ;; or "F - 83320"
    ((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))))

        -> stored as lust of two strings

    ;; Match zip codes from Sweden where the five digits are grouped 3+2
    ((string-match
      "^[ \t\n]*\\([A-Z]+\\)[ \t\n]*-?[ \t\n]*\\([0-9]+\\)[ \t\n]+\\([0-9]+\\)[ 
\t\n]*$" string)

        -> stored as list of string with second element again a list
           of two strings

    ;; 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."))))

Alex.
-- 
http://www.geocities.com/kensanata/emacs.html


_______________________________________________
bbdb-info mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/bbdb-info

Reply via email to