[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb be9464d 319/350: When merging organization records
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb be9464d 319/350: When merging organization records, possibly merge role fields |
Date: |
Mon, 14 Aug 2017 11:47:02 -0400 (EDT) |
branch: externals/ebdb
commit be9464d940ef53213e31db94510ed44ee85a9e1f
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
When merging organization records, possibly merge role fields
* ebdb.el (ebdb-merge): When two organizations are merged, it's
reasonable to expect that role fields pointing to both orgs should
be preserved and moved to point to the "new" org. Ask the user if
that's the case.
---
ebdb.el | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 583794d..3181591 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2648,12 +2648,22 @@ priority."
(right ebdb-record-organization)
&optional auto)
"Merge organization RIGHT into LEFT, and return LEFT."
- (with-slots (name domain) right
- (when (or auto (yes-or-no-p (format "Use name %s? " (ebdb-string name))))
- (ebdb-record-change-name left name))
- (when (and domain
- (or auto (yes-or-no-p (format "Use domain %s? " domain))))
- (setf (slot-value left 'domain) domain)))
+ (let ((roles (append (gethash (ebdb-record-uuid left) ebdb-org-hashtable)
+ (gethash (ebdb-record-uuid right) ebdb-org-hashtable)))
+ (l-uuid (ebdb-record-uuid left)))
+ (with-slots (name domain) right
+ (when (or auto (yes-or-no-p (format "Use name %s? " (ebdb-string name))))
+ (ebdb-record-change-name left name))
+ (when (and domain
+ (or auto (yes-or-no-p (format "Use domain %s? " domain))))
+ (setf (slot-value left 'domain) domain)))
+ (when (and roles (or auto (yes-or-no-p
+ (format "Move all person roles from %s to %s"
+ (ebdb-string right)
+ (ebdb-string left)))))
+ (dolist (r roles)
+ (setf (slot-value r 'org-uuid) l-uuid))
+ (puthash l-uuid roles ebdb-org-hashtable)))
(cl-call-next-method))
(cl-defmethod ebdb-record-field-slot-query ((class (subclass
ebdb-record-organization))
- [elpa] externals/ebdb bc3c712 332/350: Move "Writing Internationalization Libraries" in manual, (continued)
- [elpa] externals/ebdb bc3c712 332/350: Move "Writing Internationalization Libraries" in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 3210ad7 338/350: Compiler-inspired fixes version 443992, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d7bc0c9 284/350: Drop the whole auto-notes thing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b25edb9 002/350: Squash "prep" branch, push to Github, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4bdf47e 263/350: Get notice routine working, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9ce8e30 310/350: Check db editable before reading new record, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a4d11f5 293/350: Modify ebdb-mua-yank-cc to yank from any EBDB buffer, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7caa1b4 308/350: Fix bug in reading mail alias fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f987d46 305/350: Fix buffer modification call, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c890b24 296/350: Mention mail aliases in the manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb be9464d 319/350: When merging organization records, possibly merge role fields,
Eric Abrahamsen <=
- [elpa] externals/ebdb 969c44c 303/350: Small tweaks to README, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1df6476 322/350: Remove stray code, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8455b47 329/350: Bug in 851c0f1, signature snarfing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5cfad1d 317/350: Don't need so much docstring on ebdb-mode, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb acaf3d0 350/350: Move the mail field sorting thing to a :before method, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 2c05d6e 348/350: Wrong slot names when reading addresses, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a4e9f16 324/350: Also snarf URL fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 761dc23 346/350: Fix bug in searching by database, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6c13763 335/350: Don't require ebdb-chn from ebdb-i18n, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f64c791 347/350: Add internationalized version of ebdb-string for addresses, Eric Abrahamsen, 2017/08/14