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

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

[elpa] externals/ebdb 7c16983 12/17: Fix all when-let and if-let to use


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 7c16983 12/17: Fix all when-let and if-let to use starred versions
Date: Tue, 26 Sep 2017 17:15:34 -0400 (EDT)

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

    Fix all when-let and if-let to use starred versions
    
    * ebdb-mua.el
    * ebdb-pgp.el
    * ebdb-snarf.el
    * ebdb-vcard.el
    * ebdb.el: Fix all uses.
---
 ebdb-mua.el   |  2 +-
 ebdb-pgp.el   |  3 ++-
 ebdb-snarf.el | 20 ++++++++++----------
 ebdb-vcard.el |  2 +-
 ebdb.el       | 10 +++++-----
 5 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/ebdb-mua.el b/ebdb-mua.el
index 6b37cbd..b08d9e7 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -1219,7 +1219,7 @@ buffer."
          (with-current-buffer buffer
             (delq nil
                   (mapcar (lambda (x)
-                            (when-let ((mail (car (ebdb-record-mail (car x) 
t))))
+                            (when-let* ((mail (car (ebdb-record-mail (car x) 
t))))
                               (ebdb-dwim-mail (car x) mail)))
                           ebdb-records)))))
     (if (derived-mode-p 'message-mode 'mail-mode)
diff --git a/ebdb-pgp.el b/ebdb-pgp.el
index bc9f391..1ebf85e 100644
--- a/ebdb-pgp.el
+++ b/ebdb-pgp.el
@@ -174,7 +174,8 @@ use one of the following, as appropriate:
                        (delete-dups
                         (mapcar
                          (lambda (record)
-                           (if-let ((field (car-safe (ebdb-record-field record 
'ebdb-field-pgp))))
+                           (if-let* ((field (car-safe (ebdb-record-field
+                           record 'ebdb-field-pgp))))
                               (slot-value field 'action)))
                          (delete-dups
                           (apply 'nconc
diff --git a/ebdb-snarf.el b/ebdb-snarf.el
index bf49d3b..45b5304 100644
--- a/ebdb-snarf.el
+++ b/ebdb-snarf.el
@@ -255,14 +255,14 @@ vectors, usually to `ebdb-snarf-query'."
     (pcase-dolist (`[,record ,names ,fields] input)
       (let (out-fields out-names)
        (unless record
-         (if-let ((rec (car-safe
-                        (ebdb-search
-                         (ebdb-records)
-                         (mapcar
-                          (lambda (f)
-                            (list (eieio-object-class-name f)
-                                  (ebdb-string f)))
-                          (append fields names))))))
+         (if-let* ((rec (car-safe
+                         (ebdb-search
+                          (ebdb-records)
+                          (mapcar
+                           (lambda (f)
+                             (list (eieio-object-class-name f)
+                                   (ebdb-string f)))
+                           (append fields names))))))
              (setq record rec)))
        (if record
            (let (slot)
@@ -274,8 +274,8 @@ vectors, usually to `ebdb-snarf-query'."
                                       `(nil . ,(eieio-object-class f)))))
                      ;; Make sure that record can accept field, and doesn't
                      ;; already have it.
-                     (unless (if-let ((slot-val (ignore-errors
-                                                  (ebdb-record-field record 
slot))))
+                     (unless (if-let* ((slot-val (ignore-errors
+                                                   (ebdb-record-field record 
slot))))
                                  (member (ebdb-string f)
                                          (mapcar #'ebdb-string
                                                  (if (listp slot-val)
diff --git a/ebdb-vcard.el b/ebdb-vcard.el
index 68d5a4b..882a9a4 100644
--- a/ebdb-vcard.el
+++ b/ebdb-vcard.el
@@ -343,7 +343,7 @@ method is just responsible for formatting the record name."
                                    _style
                                    _record)
   (let ((ret (cl-call-next-method)))
-    (if-let ((lab (slot-value field 'object-name)))
+    (if-let* ((lab (slot-value field 'object-name)))
        (concat ret
                ";TYPE=" (ebdb-vcard-escape lab))
       ret)))
diff --git a/ebdb.el b/ebdb.el
index b112f22..c3cda4a 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -324,7 +324,7 @@ anniversary date, and the sexp (as a string):
 (defun ebdb-diary-add-entries ()
   "Add anniversaries from EBDB to the diary."
   (pcase-dolist (`(,entry ,sexp) ebdb-diary-entries)
-    (when-let ((parsed (cdr-safe (diary-sexp-entry sexp entry original-date))))
+    (when-let* ((parsed (cdr-safe (diary-sexp-entry sexp entry 
original-date))))
       (diary-add-to-list original-date parsed sexp))))
 
 (defcustom ebdb-before-load-hook nil
@@ -2521,8 +2521,8 @@ subclasses, or it can be a string, in which case the 
class of
 RECORD is responsible for parsing it correctly.")
 
 (cl-defmethod ebdb-record-uuid ((record ebdb-record))
-  (if-let ((uuid-field (slot-value record 'uuid)))
-   (slot-value uuid-field 'uuid)))
+  (if-let* ((uuid-field (slot-value record 'uuid)))
+      (slot-value uuid-field 'uuid)))
 
 (cl-defmethod ebdb-read ((class (subclass ebdb-record)) &optional slots)
   "Create a new record from the values collected into SLOTS."
@@ -4923,7 +4923,7 @@ actual speedup."
        (style (if arg 'list 'inline))
        usable str)
     (dolist (r recs)
-      (if-let ((m (ebdb-record-mail r t)))
+      (if-let* ((m (ebdb-record-mail r t)))
          (push (cons r (or (object-assoc 'primary 'priority m)
                            (car m)))
                usable)))
@@ -5279,7 +5279,7 @@ values, by default the search is not handed to the name 
field itself."
 (cl-defmethod ebdb-record-search ((record ebdb-record)
                                  (_type (subclass ebdb-field-notes))
                                  (regexp string))
-  (if-let (notes (slot-value record 'notes))
+  (if-let* ((notes (slot-value record 'notes)))
       (ebdb-field-search notes regexp)))
 
 (cl-defmethod ebdb-record-search ((record ebdb-record-entity)



reply via email to

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