[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 4027218 3/6: Have ebdb-record-mail sort mails by p
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 4027218 3/6: Have ebdb-record-mail sort mails by priority |
Date: |
Tue, 19 May 2020 15:49:20 -0400 (EDT) |
branch: externals/ebdb
commit 4027218c7a47f96b23212d302dd084e58fa9ab06
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Have ebdb-record-mail sort mails by priority
Fixes #87
* ebdb.el (ebdb-record-mail): Primary mails first.
---
ebdb.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 25eff4b..6788310 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -4484,7 +4484,7 @@ If RECORDS are given, only search those records."
If NO-ROLES is non-nil, exclude mail fields from RECORD's roles.
If LABEL is a string, return the mail with that label. If
DEFUNCT is non-nil, also consider RECORD's defunct mail
-addresses."
+addresses. Sort mails by descending priority."
(let ((mails (slot-value record 'mail)))
(when (and (null no-roles) (slot-exists-p record 'organizations))
(dolist (r (slot-value record 'organizations))
@@ -4499,7 +4499,10 @@ addresses."
mails)))
(if label
(object-assoc label 'label mails)
- mails)))
+ (sort mails (lambda (m1 m2)
+ (or (eql (slot-value m1 'priority) 'primary)
+ (and (eql (slot-value m1 'priority) 'normal)
+ (eql (slot-value m2 'priority) 'defunct))))))))
- [elpa] externals/ebdb updated (5d8b473 -> 15f5bd8), Eric Abrahamsen, 2020/05/19
- [elpa] externals/ebdb 4f72046 1/6: New defcustoms handling formatting of anniversary dates, Eric Abrahamsen, 2020/05/19
- [elpa] externals/ebdb d0321ab 2/6: Fix to previous anniversary display defcustoms, Eric Abrahamsen, 2020/05/19
- [elpa] externals/ebdb 4027218 3/6: Have ebdb-record-mail sort mails by priority,
Eric Abrahamsen <=
- [elpa] externals/ebdb 3913555 4/6: Update last commit, Eric Abrahamsen, 2020/05/19
- [elpa] externals/ebdb f28b665 5/6: Prevent sort from actually altering record mails, Eric Abrahamsen, 2020/05/19
- [elpa] externals/ebdb 15f5bd8 6/6: Don't do anything clever with phone numbers by default, Eric Abrahamsen, 2020/05/19