[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb e947f59 06/17: Drop postcode guards
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb e947f59 06/17: Drop postcode guards |
Date: |
Tue, 26 Sep 2017 17:15:33 -0400 (EDT) |
branch: externals/ebdb
commit e947f59f7b45377c368ce847d2767d70a3e5f15b
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Drop postcode guards
* ebdb.el: This was a lot of code just to prevent people from writing
invalid postcodes. And so what if they did? Deleting:
ebdb-continental-postcode-regexp, ebdb-check-postcode,
ebdb-parse-postcode, and ebdb-address-continental-p.
(ebdb-read): Don't check postcode.
---
ebdb.el | 68 +++--------------------------------------------------------------
1 file changed, 3 insertions(+), 65 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index bbe3656..b0ee788 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -555,38 +555,6 @@ See also `ebdb-print-address-format-list'."
(choice (string)
(function :tag "Function")))))
-(defcustom ebdb-continental-postcode-regexp
- "^\\s *[A-Z][A-Z]?\\s *-\\s *[0-9][0-9][0-9]"
- "Regexp matching continental postcodes.
-Used by address format identifier `ebdb-address-continental-p'.
-The regexp should match postcodes of the form CH-8052, NL-2300RA,
-and SE-132 54."
- :group 'ebdb-record-edit
- :type 'regexp)
-
-(defcustom ebdb-legal-postcodes
- '(;; empty string
- "^$"
- ;; Matches 1 to 6 digits.
- "^[ \t\n]*[0-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[ \t\n]*$"
- ;; Matches 5 digits and 3 or 4 digits.
- "^[ \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]*$"
- ;; Match postcodes for Canada, UK, etc. (result is ("LL47" "U4B")).
- "^[ \t\n]*\\([A-Za-z0-9]+\\)[ \t\n]+\\([A-Za-z0-9]+\\)[ \t\n]*$"
- ;; Match postcodes 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
- ;; <address@hidden>
- "^[ \t\n]*\\([A-Z]+\\)[ \t\n]*-?[ \t\n]*\\([0-9]+ ?[A-Z]*\\)[ \t\n]*$"
- ;; Match postcodes from Sweden where the five digits are grouped 3+2
- ;; at the request from Mats Lofdahl <address@hidden>.
- ;; (result is ("SE" (133 36)))
- "^[ \t\n]*\\([A-Z]+\\)[ \t\n]*-?[ \t\n]*\\([0-9]+\\)[ \t\n]+\\([0-9]+\\)[
\t\n]*$")
- "List of regexps that match legal postcodes.
-Whether this is used at all depends on the variable `ebdb-check-postcode'."
- :group 'ebdb-record-edit
- :type '(repeat regexp))
-
(defcustom ebdb-default-separator '("[,;]" ", ")
"The default field separator. It is a list (SPLIT-RE JOIN).
This is used for fields which do not have an entry in `ebdb-separator-alist'."
@@ -699,13 +667,6 @@ In rare cases, this may lead to confusion with EBDB's MUA
interface."
:type '(choice (const :tag "None" nil)
(string :tag "Default Country")))
-(defcustom ebdb-check-postcode t
- "If non-nil, require legal postcodes when entering an address.
-The format of legal postcodes is determined by the variable
-`ebdb-legal-postcodes'."
- :group 'ebdb-record-edit
- :type 'boolean)
-
(defcustom ebdb-default-user-field 'ebdb-field-notes
"Default field when editing EBDB records."
:group 'ebdb-record-edit
@@ -1689,11 +1650,9 @@ first one."
(postcode
(if (plist-member slots :postcode)
(plist-get slots :postcode)
- (ebdb-error-retry
- (ebdb-parse-postcode
- (ebdb-read-string "Postcode: "
- (when obj (ebdb-address-postcode obj))
- ebdb-postcode-list)))))
+ (ebdb-read-string "Postcode: "
+ (when obj (ebdb-address-postcode obj))
+ ebdb-postcode-list)))
(country
(if (plist-member slots :country)
(plist-get slots :country)
@@ -4873,18 +4832,6 @@ be nil."
(and first (ebdb-string-trim first))
suffix))))
-(defun ebdb-parse-postcode (string)
- "Check whether STRING is a legal postcode.
-Do this only if `ebdb-check-postcode' is non-nil."
- (if ebdb-check-postcode
- (let ((postcodes ebdb-legal-postcodes) re done)
- (while (setq re (pop postcodes))
- (if (string-match re string)
- (setq done t postcodes nil)))
- (if done string
- (signal 'ebdb-unparseable (list string))))
- string))
-
(defsubst ebdb-record-lessp (record1 record2)
(string< (ebdb-record-sortkey record1)
(ebdb-record-sortkey record2)))
@@ -5002,15 +4949,6 @@ actual speedup."
(thread-yield)))
(or records ebdb-record-tracker))))
-(defun ebdb-address-continental-p (address)
- "Return non-nil if ADDRESS is a continental address.
-This is done by comparing the postcode to `ebdb-continental-postcode-regexp'.
-
-This is a possible identifying function for
-`ebdb-address-format-list' and `ebdb-print-address-format-list'."
- (string-match ebdb-continental-postcode-regexp
- (ebdb-address-postcode address)))
-
(defvar ebdb-i18n-countries-pref-scripts)
;; This function can provide some guidance for writing
- [elpa] externals/ebdb updated (c298037 -> 91d73f8), Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb 1abf847 02/17: Fix slot customize declaration for bank account field, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb 2a17bb6 03/17: Set up EBDB buffers to offer save on save-some-buffers, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb 26d632b 05/17: Finish ebdb-internationalize-addresses, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb 3f1eb0d 04/17: New defsubst ebdb-i18n-countries, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb f143265 07/17: Quietly swap order of arguments to ebdb-read-i18n for addresses, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb 880be9f 14/17: Fix to dumb mistakes in 8fc7b6d69, fast lookups, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb b371784 15/17: Change ebdb-vcard to use generic ebdb-field-tags, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb c5aac30 01/17: Change name of automatic save option, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb fb7e4d2 11/17: Add formatting for Russian phone numbers, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb e947f59 06/17: Drop postcode guards,
Eric Abrahamsen <=
- [elpa] externals/ebdb e78dd19 10/17: Provide an ebdb-parse method for addresses, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb 7e7d6cd 09/17: Start collecting random internationalized methods, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb e326805 08/17: Simplify address formatting, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb 4f8e2a0 16/17: Use ebdb-i18n-countries defsubst in i18n address reading, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb 91d73f8 17/17: Bump version to 0.3.3, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb 7c16983 12/17: Fix all when-let and if-let to use starred versions, Eric Abrahamsen, 2017/09/26
- [elpa] externals/ebdb bd7b45a 13/17: Revert "Use value of ebdb-mua-folder-list in VM splitting", Eric Abrahamsen, 2017/09/26