[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/eudc-bbdb-3 c80692b 05/15: EUDC: Keep phone and ad
From: |
Thomas Fitzsimmons |
Subject: |
[Emacs-diffs] scratch/eudc-bbdb-3 c80692b 05/15: EUDC: Keep phone and address lists in BBDB-order |
Date: |
Tue, 21 Nov 2017 23:47:51 -0500 (EST) |
branch: scratch/eudc-bbdb-3
commit c80692bc69cda63a869d0402c4080aec9d7d2abb
Author: Thomas Fitzsimmons <address@hidden>
Commit: Thomas Fitzsimmons <address@hidden>
EUDC: Keep phone and address lists in BBDB-order
* lisp/net/eudcb-bbdb.el (eudc-bbdb-extract-phones): Return
phone numbers in the same order in which they are stored in
BBDB.
(eudc-bbdb-extract-addresses): Likewise.
---
lisp/net/eudcb-bbdb.el | 57 ++++++++++++++++++++++++++------------------------
1 file changed, 30 insertions(+), 27 deletions(-)
diff --git a/lisp/net/eudcb-bbdb.el b/lisp/net/eudcb-bbdb.el
index 1bb0daa..7370225 100644
--- a/lisp/net/eudcb-bbdb.el
+++ b/lisp/net/eudcb-bbdb.el
@@ -127,37 +127,40 @@ BBDB < 3 used `net'; BBDB >= 3 uses `mail'."
(defun eudc-bbdb-extract-phones (record)
(require 'bbdb)
- (mapcar (function
- (lambda (phone)
- (if eudc-bbdb-use-locations-as-attribute-names
- (cons (intern (bbdb-phone-location phone))
- (bbdb-phone-string phone))
- (cons 'phones (format "%s: %s"
- (bbdb-phone-location phone)
- (bbdb-phone-string phone))))))
- (bbdb-record-phones record)))
+ ;; Keep same order as in BBDB record.
+ (nreverse
+ (mapcar (function
+ (lambda (phone)
+ (if eudc-bbdb-use-locations-as-attribute-names
+ (cons (intern (bbdb-phone-location phone))
+ (bbdb-phone-string phone))
+ (cons 'phones (format "%s: %s"
+ (bbdb-phone-location phone)
+ (bbdb-phone-string phone))))))
+ (bbdb-record-phones record))))
(defun eudc-bbdb-extract-addresses (record)
(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))))
+ (nreverse
+ (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)))))
(defun eudc-bbdb-format-record-as-result (record)
"Format the BBDB RECORD as a EUDC query result record.
- [Emacs-diffs] scratch/eudc-bbdb-3 c6c1286 02/15: EUDC: Fix indentation in BBDB backend, (continued)
- [Emacs-diffs] scratch/eudc-bbdb-3 c6c1286 02/15: EUDC: Fix indentation in BBDB backend, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 3636aa2 03/15: EUDC: Fix whitespace in BBDB backend, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 5e6c763 14/15: EUDC: Wrap long lines in eudc-export.el, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 e02938d 11/15: EUDC: Obsolete eudc--using-bbdb-3-or-newer-p, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 06c3557 08/15: EUDC: Require bbdb and bbdb-com without ignoring errors, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 2beb511 04/15: EUDC: Wrap long line in BBDB backend, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 f529b7d 07/15: EUDC: Fix issues reported by checkdoc, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 262dce0 09/15: EUDC: Remove external BBDB function declarations, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 69e8cb9 15/15: EUDC: Port eudc-export.el to BBDB >= 3, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 f1ab95d 12/15: EUDC: Require bbdb, bbdb-com without NOERROR, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 c80692b 05/15: EUDC: Keep phone and address lists in BBDB-order,
Thomas Fitzsimmons <=
- [Emacs-diffs] scratch/eudc-bbdb-3 05257b9 10/15: EUDC: Port BBDB backend to BBDB >= 3, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 6e680a7 06/15: EUDC: Print multiple BBDB addresses properly, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 eaf20ca 13/15: EUDC: Fix whitespace in eudc-export.el, Thomas Fitzsimmons, 2017/11/21
- [Emacs-diffs] scratch/eudc-bbdb-3 9bfbbd4 01/15: BBDB: Import BBDB 3, Thomas Fitzsimmons, 2017/11/21