[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 41912b9 11/15: Improve check for field existence d
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 41912b9 11/15: Improve check for field existence during snarf collapsing |
Date: |
Thu, 22 Mar 2018 00:58:55 -0400 (EDT) |
branch: externals/ebdb
commit 41912b992473ea25b13a0d620bf72ba027baef3c
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Improve check for field existence during snarf collapsing
* ebdb-snarf.el (ebdb-snarf-collapse): Instead of looking for an
ebdb-string match for an existing field, use the higher-level
`ebdb-record-search'. This should end up being a bit smarter about
knowing when a record already has a field.
---
ebdb-snarf.el | 41 ++++++++++++++++++-----------------------
1 file changed, 18 insertions(+), 23 deletions(-)
diff --git a/ebdb-snarf.el b/ebdb-snarf.el
index d307f23..fa892fd 100644
--- a/ebdb-snarf.el
+++ b/ebdb-snarf.el
@@ -265,29 +265,24 @@ vectors, usually to `ebdb-snarf-query'."
(append fields names)))))
(setq record rec)))
(if record
- (let (slot)
- (dolist (f fields)
- (condition-case nil
- (progn
- (setq slot (car (ebdb-record-field-slot-query
- (eieio-object-class record)
- `(nil . ,(eieio-object-class f)))))
- ;; Make sure that record can accept field, and doesn't
- ;; already have it.
- (unless
- (when (setq slot-val (ignore-errors
- (ebdb-record-field record
slot)))
- (member (ebdb-string f)
- (mapcar #'ebdb-string
- (if (listp slot-val)
- slot-val
- (list slot-val)))))
- (push f out-fields)))
- (ebdb-unacceptable-field nil)))
- (dolist (name names)
- (unless (ebdb-record-search
- record 'ebdb-field-name (ebdb-string name))
- (push name out-names))))
+ (dolist (f fields)
+ (condition-case nil
+ (progn
+ ;; Make sure that record can accept field, and doesn't
+ ;; already have it.
+ (when (and (car-safe (ebdb-record-field-slot-query
+ (eieio-object-class record)
+ `(nil . ,(eieio-object-class f))))
+ (null (ebdb-record-search
+ record
+ (eieio-object-class f)
+ (ebdb-string f))))
+ (push f out-fields)))
+ (ebdb-unacceptable-field nil)))
+ (dolist (name names)
+ (unless (ebdb-record-search
+ record 'ebdb-field-name (ebdb-string name))
+ (push name out-names)))
(setq out-names names
out-fields fields))
(push (vector record out-names out-fields) output)))
- [elpa] externals/ebdb b228892 04/15: Change interactive behavior of ebdb-mail-aliases, (continued)
- [elpa] externals/ebdb b228892 04/15: Change interactive behavior of ebdb-mail-aliases, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb fff770e 05/15: ebdb-mua defgroup in wrong file, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb 78cfb2a 06/15: Pop up EBDB windows before formatting records, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb ff6e919 09/15: Add a basic language field, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb 5e42dff 03/15: Forgot to pop-to-buffer to after creating citation buffer, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb 8e8c2e1 07/15: Make gnus-message window config stuff customizable, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb 76f8d4b 10/15: Make it clear what field type we're prompting for, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb 925e0ea 14/15: Remove mail-citation-prefix-regexp from strings to snarf, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb 03d432d 02/15: Don't append citation to kill ring in ebdb-cite-records-ebdb, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb d53ddc1 08/15: Use Gnus' window configuration for popping up EBDB buffers, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb 41912b9 11/15: Improve check for field existence during snarf collapsing,
Eric Abrahamsen <=
- [elpa] externals/ebdb b56bf29 12/15: Adjust snarfing regexp for names, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb 091a744 15/15: Make phone number snarfing regexp less permissive, Eric Abrahamsen, 2018/03/22
- [elpa] externals/ebdb bb01b5c 13/15: Mostly re-write ebdb-snarf-collect, Eric Abrahamsen, 2018/03/22