[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 05f67d6 081/350: Fix merging procedure
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 05f67d6 081/350: Fix merging procedure |
Date: |
Mon, 14 Aug 2017 11:46:07 -0400 (EDT) |
branch: externals/ebdb
commit 05f67d6c75b8c0752d8adf951c93217daa22b50a
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Fix merging procedure
* ebdb.el (ebdb-merge): Don't prompt about alternate names unless the
names are actually different. Treat the notes field class correctly.
---
ebdb.el | 39 ++++++++++++++++++++++++---------------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 117f3e6..201f524 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -1819,8 +1819,13 @@ record."
(delete-dups
(append fields lfields)))
(when (or notes lnotes)
- (setf (slot-value left 'notes)
- (mapconcat #'identity (list notes lnotes) "\n\n"))))))
+ (when (null (equal notes lnotes))
+ (setf (slot-value left 'notes)
+ (make-instance
+ ebdb-default-notes-class
+ :notes
+ (concat (when notes (ebdb-string notes)) " "
+ (when lnotes (ebdb-string lnotes))))))))))
left)
(cl-defmethod ebdb-stamp-time ((record ebdb-record))
@@ -2282,10 +2287,10 @@ priority."
(right ebdb-record-person)
&optional auto)
"Merge person RIGHT into LEFT, and return LEFT."
- (with-slots (name
- aka
- relations
- organizations)
+ (with-slots ((rname name)
+ (raka aka)
+ (rrelations relations)
+ (rorganizations organizations))
right
(with-slots ((lname name)
(laka aka)
@@ -2296,18 +2301,22 @@ priority."
(if auto
(object-add-to-list left 'aka name)
- (if (yes-or-no-p (format "Make %s the primary name? " (ebdb-record-name
right)))
- (progn
- (ebdb-record-change-name left name)
- (when (yes-or-no-p (format "Keep %s as an aka? "
(ebdb-record-name left)))
- (object-add-to-list left 'aka lname)))
- (when (yes-or-no-p (format "Keep %s as an aka? " (ebdb-record-name
right)))
- (object-add-to-list left 'aka name))))
+ (unless (equal rname lname)
+ (let ((prefix (format "Merging %s with %s:"
+ (ebdb-record-name right)
+ (ebdb-record-name left))))
+ (if (yes-or-no-p (format "%s Use %s as primary name? " prefix
(ebdb-record-name right)))
+ (progn
+ (ebdb-record-change-name left name)
+ (when (yes-or-no-p (format "%s Keep %s as an aka? " prefix
(ebdb-record-name left)))
+ (object-add-to-list left 'aka lname)))
+ (when (yes-or-no-p (format "%s Keep %s as an aka? " prefix
(ebdb-record-name right)))
+ (object-add-to-list left 'aka name))))))
(setf (slot-value left 'relations)
- (delete-dups (append relations lrelations)))
+ (delete-dups (append rrelations lrelations)))
(setf (slot-value left 'organizations)
- (delete-dups (append organizations lorganizations)))))
+ (delete-dups (append rorganizations lorganizations)))))
(cl-call-next-method left right auto))
(cl-defmethod ebdb-record-field-slot-query ((class (subclass
ebdb-record-person)) &optional query alist)
- [elpa] externals/ebdb b9da0f4 142/350: Check Organization headers and display/update organization records, (continued)
- [elpa] externals/ebdb b9da0f4 142/350: Check Organization headers and display/update organization records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6fe34b0 145/350: Fix bugs in ebdb-annotate-message, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f0b0a32 093/350: Fix organization name matching in migration, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1fe77aa 152/350: Tiny tweak to snarfing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 189314d 151/350: Fix up Org link following, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 52d3d54 113/350: Remove all pop-up-window-size type options, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4cd4a0c 123/350: Simplify searching, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5b24d54 126/350: Special-case mail symbol in ebdb-record-field, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5613bc2 137/350: Fix bug in ebdb-record-field-slot-query, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 86b386d 141/350: Compiler-inspired fixes, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 05f67d6 081/350: Fix merging procedure,
Eric Abrahamsen <=
- [elpa] externals/ebdb 1ded570 086/350: Note new database-related commands in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ef673e2 094/350: Improve organization searching, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bc71bda 099/350: Many fixes to migration routine, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 548e05d 106/350: Tweaks to MUA interactive commands, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dd83c7e 115/350: Short-circuit ebdb-info, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a0eada8 128/350: Change some of the EBDB buffer formatting defaults, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 20906ae 131/350: ebdb-prompt-for-record should load if necessary, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1bc78ab 133/350: Add helm-ebdb file, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ed3e270 119/350: Reverse order of args in return value of ebdb-popup-window, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ed6e228 136/350: Make ebdb-annotate-message more class agnostic, Eric Abrahamsen, 2017/08/14