[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 4bb77e3 11/15: Add mail deletion behavior
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 4bb77e3 11/15: Add mail deletion behavior |
Date: |
Sun, 1 Apr 2018 06:02:49 -0400 (EDT) |
branch: externals/ebdb
commit 4bb77e377f04ac26ab0b743a9d0a46fd2d14ab1a
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Add mail deletion behavior
* ebdb.el (ebdb-record-delete-field): If deleting a record mail leaves
no primary mail address, set the first of the remaining mails as
primary.
---
ebdb.el | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/ebdb.el b/ebdb.el
index 613660b..e23e294 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -3025,9 +3025,21 @@ If FIELD doesn't specify a year, use the current year."
"Possibly set the priority of a newly-added mail address.
If RECORD has no other primary mail, set MAIL's priority to
primary."
- (when (null (object-assoc 'primary 'priority (ebdb-record-mail record)))
+ (when (null (object-assoc 'primary 'priority (ebdb-record-mail record t)))
(setf (slot-value mail 'priority) 'primary)))
+(cl-defmethod ebdb-record-delete-field :after ((record ebdb-record-entity)
+ (mail ebdb-field-mail)
+ &optional _slot)
+ "Possibly alter the priority of RECORD's remaining mails.
+If there aren't any other primary mails, make the first of the
+remaining mails primary."
+ (let* ((mails (remove mail (ebdb-record-mail record)))
+ (clone (unless (object-assoc 'primary 'priority mails)
+ (clone (car mails)))))
+ (when clone
+ (ebdb-record-change-field record (car mails) clone))))
+
(defun ebdb-compose-mail (&rest args)
"Start composing a mail message to send.
ARGS is passed to `compose-mail'."
- [elpa] externals/ebdb updated (9e7a96f -> d60338c), Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb 261454d 03/15: Return results of ebdb-loop-with-exit in correct order, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb bbfdc70 04/15: Set mail priority on record creation, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb 5b4d834 01/15: Organization/role delete method needs to be an :around, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb 9ab7b56 07/15: Improvements to ebdb-edit-foo, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb a25e1eb 06/15: Use values from "slots" in role field ebdb-read, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb 9bd965b 02/15: Simplify ebdb-with-record-edits, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb 4bb77e3 11/15: Add mail deletion behavior,
Eric Abrahamsen <=
- [elpa] externals/ebdb 27a1fa5 05/15: Move field manipulation "convenience logic" into ebdb-com, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb 70754b8 08/15: Fix unnecessary code in ebdb-follow-related, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb c3e06ee 12/15: Use quoted field class, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb a7e88d4 14/15: Update copyright dates, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb 7a5ce18 13/15: Handle mail priority after customization edits, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb d60338c 15/15: Bump version to 0.5, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb b323307 09/15: Add a "follow related" action to role fields, Eric Abrahamsen, 2018/04/01
- [elpa] externals/ebdb dd2f73c 10/15: Change behavior of mail insertion, Eric Abrahamsen, 2018/04/01