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

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

[elpa] externals/ebdb a5b00bd 074/350: Re-init mail fields after moving


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb a5b00bd 074/350: Re-init mail fields after moving them to a role
Date: Mon, 14 Aug 2017 11:46:06 -0400 (EDT)

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

    Re-init mail fields after moving them to a role
    
    * ebdb.el: (ebdb-record-adopt-role-fields): Mail field needs to be
      re-initialized or it won't be hashed and cached.
---
 ebdb.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/ebdb.el b/ebdb.el
index df6f967..36d8494 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -1047,16 +1047,16 @@ values, by default the search is not handed to the name 
field itself."
   The optional \"object-name\" slot can serve as a mail aka."
   :human-readable "mail")
 
-(cl-defmethod ebdb-init-field ((mail ebdb-field-mail) &optional record)
-  (with-slots (aka mail) mail
+(cl-defmethod ebdb-init-field ((field ebdb-field-mail) &optional record)
+  (with-slots (aka mail) field
     (ebdb-puthash mail record)
     (object-add-to-list (ebdb-record-cache record) 'mail-canon mail)
     (when aka
       (ebdb-puthash aka record)
       (object-add-to-list (ebdb-record-cache record) 'mail-aka aka))))
 
-(cl-defmethod ebdb-delete-field ((mail ebdb-field-mail) &optional record 
_unload)
-  (with-slots (aka mail) mail
+(cl-defmethod ebdb-delete-field ((field ebdb-field-mail) &optional record 
_unload)
+  (with-slots (aka mail) field
     (when record
       (when aka
        (ebdb-remhash aka record)
@@ -2364,7 +2364,8 @@ Currently only works for mail fields."
                                        (ebdb-string m)
                                        (ebdb-string org))))
          (setf (slot-value r 'mail) m)
-         (ebdb-record-delete-field record 'mail m))))))
+         (ebdb-record-delete-field record 'mail m)
+         (ebdb-init-field m record))))))
 
 (cl-defmethod ebdb-record-related ((_record ebdb-record-person)
                                   (field ebdb-field-relation))



reply via email to

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