emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb bf51b58 161/350: Fix ebdb-delete-redundant-mails


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb bf51b58 161/350: Fix ebdb-delete-redundant-mails
Date: Mon, 14 Aug 2017 11:46:27 -0400 (EDT)

branch: externals/ebdb
commit bf51b589cbd4d9f697e263b057189d53ce00d66e
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Fix ebdb-delete-redundant-mails
    
    * ebdb-com.el (ebdb-delete-redundant-mails): Possibly the last old
      code in EBDB.
---
 ebdb-com.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ebdb-com.el b/ebdb-com.el
index 7c4dc6d..2ffa1c7 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -1364,14 +1364,12 @@ In particular, ignore addresses \"Joe Smith 
<address@hidden>\"."
     (if (and name host)
         (concat (regexp-quote name) "@.*\\." (regexp-quote host)))))
 
-(defun ebdb-delete-redundant-mails (records &optional query update)
+(defun ebdb-delete-redundant-mails (records &optional query)
   "Delete redundant or duplicate mails from RECORDS.
 For example, \"address@hidden" is redundant w.r.t. \"address@hidden".
 Duplicates may (but should not) occur if we feed EBDB automatically.
 If QUERY is non-nil (as in interactive calls, unless we use a prefix arg)
 query before deleting the redundant mail addresses.
-If UPDATE is non-nil (as in interactive calls) update the database.
-Otherwise, this is the caller's responsiblity.
 
 Noninteractively, this may be used as an element of `ebdb-notice-record-hook'
 or `ebdb-change-hook'.  However, see also `ebdb-ignore-redundant-mails',
@@ -1406,9 +1404,10 @@ which is probably more suited for your needs."
                    (or (not query)
                        (y-or-n-p (format "Delete %s: " form))))
           (unless query (message "Deleting %s" form))
-          (ebdb-record-set-field record 'mail okay)
-          (when update
-            (ebdb-change-record record)))))))
+         (dolist (m okay)
+           (ebdb-record-insert-field record 'mail m))
+         (dolist (m redundant)
+           (ebdb-record-delete-field record 'mail m)))))))
 
 (defun ebdb-touch-records (records)
   "Touch RECORDS by calling `ebdb-change-hook' unconditionally."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]