]> git.eshelyaron.com Git - emacs.git/commitdiff
EUDC: Fix whitespace in BBDB backend
authorThomas Fitzsimmons <fitzsim@fitzsim.org>
Fri, 10 Nov 2017 14:37:52 +0000 (09:37 -0500)
committerThomas Fitzsimmons <fitzsim@fitzsim.org>
Wed, 15 Nov 2017 02:09:24 +0000 (21:09 -0500)
* lisp/net/eudcb-bbdb.el (eudc-bbdb-format-query): Fix
whitespace.
(eudc-bbdb-filter-non-matching-record): Likewise.
(eudc-bbdb-extract-addresses): Likewise.

lisp/net/eudcb-bbdb.el

index f9c8578e373a49bed9a5b212179edc48530444ac..7edc740b53f126abb25f7555bdcd8d2948e684cb 100644 (file)
@@ -86,30 +86,30 @@ BBDB < 3 used `net'; BBDB >= 3 uses `mail'."
   (catch 'unmatch
     (progn
       (dolist (condition eudc-bbdb-current-query)
-        (let ((attr (car condition))
-              (val (cdr condition))
-              (case-fold-search t)
-              bbdb-val)
-          (or (and (memq attr '(firstname lastname aka company phones
-                                          addresses net))
-                   (progn
-                     (setq bbdb-val
-                           (eval (list (intern (concat "bbdb-record-"
-                                                       (symbol-name
-                                                        (eudc-bbdb-field
-                                                         attr))))
-                                       'record)))
-                     (if (listp bbdb-val)
-                         (if eudc-bbdb-enable-substring-matches
-                             (eval `(or ,@(mapcar (lambda (subval)
-                                                    (string-match val subval))
-                                                  bbdb-val)))
-                           (member (downcase val)
-                                   (mapcar 'downcase bbdb-val)))
-                       (if eudc-bbdb-enable-substring-matches
-                           (string-match val bbdb-val)
-                         (string-equal (downcase val) (downcase bbdb-val))))))
-              (throw 'unmatch nil))))
+       (let ((attr (car condition))
+             (val (cdr condition))
+             (case-fold-search t)
+             bbdb-val)
+         (or (and (memq attr '(firstname lastname aka company phones
+                                         addresses net))
+                  (progn
+                    (setq bbdb-val
+                          (eval (list (intern (concat "bbdb-record-"
+                                                      (symbol-name
+                                                       (eudc-bbdb-field
+                                                        attr))))
+                                      'record)))
+                    (if (listp bbdb-val)
+                        (if eudc-bbdb-enable-substring-matches
+                            (eval `(or ,@(mapcar (lambda (subval)
+                                                   (string-match val subval))
+                                                 bbdb-val)))
+                          (member (downcase val)
+                                  (mapcar 'downcase bbdb-val)))
+                      (if eudc-bbdb-enable-substring-matches
+                          (string-match val bbdb-val)
+                        (string-equal (downcase val) (downcase bbdb-val))))))
+             (throw 'unmatch nil))))
       record)))
 
 ;; External.
@@ -123,7 +123,7 @@ BBDB < 3 used `net'; BBDB >= 3 uses `mail'."
 (declare-function bbdb-address-location "ext:bbdb" t) ; via bbdb-defstruct
 (declare-function bbdb-record-addresses "ext:bbdb" t) ; via bbdb-defstruct
 (declare-function bbdb-records          "ext:bbdb"
-                  (&optional dont-check-disk already-in-db-buffer))
+                 (&optional dont-check-disk already-in-db-buffer))
 
 (defun eudc-bbdb-extract-phones (record)
   (require 'bbdb)
@@ -141,23 +141,23 @@ BBDB < 3 used `net'; BBDB >= 3 uses `mail'."
   (require 'bbdb)
   (let (s c val)
     (mapcar (lambda (address)
-              (setq c (bbdb-address-streets address))
-              (dotimes (n 3)
-                (unless (zerop (length (setq s (nth n c))))
-                  (setq val (concat val s "\n"))))
-              (setq c (bbdb-address-city address)
-                    s (bbdb-address-state address))
-              (setq val (concat val
-                                (if (and (> (length c) 0) (> (length s) 0))
-                                    (concat c ", " s)
-                                  c)
-                                " "
-                                (bbdb-address-zip address)))
-              (if eudc-bbdb-use-locations-as-attribute-names
-                  (cons (intern (bbdb-address-location address)) val)
-                (cons 'addresses (concat (bbdb-address-location address)
-                                         "\n" val))))
-            (bbdb-record-addresses record))))
+             (setq c (bbdb-address-streets address))
+             (dotimes (n 3)
+               (unless (zerop (length (setq s (nth n c))))
+                 (setq val (concat val s "\n"))))
+             (setq c (bbdb-address-city address)
+                   s (bbdb-address-state address))
+             (setq val (concat val
+                               (if (and (> (length c) 0) (> (length s) 0))
+                                   (concat c ", " s)
+                                 c)
+                               " "
+                               (bbdb-address-zip address)))
+             (if eudc-bbdb-use-locations-as-attribute-names
+                 (cons (intern (bbdb-address-location address)) val)
+               (cons 'addresses (concat (bbdb-address-location address)
+                                        "\n" val))))
+           (bbdb-record-addresses record))))
 
 (defun eudc-bbdb-format-record-as-result (record)
   "Format the BBDB RECORD as a EUDC query result record.