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

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

[elpa] externals/company 0c23389d6c 1/2: Use if-let* instead if-let (the


From: ELPA Syncer
Subject: [elpa] externals/company 0c23389d6c 1/2: Use if-let* instead if-let (the latter is marked obsolete in 31.1)
Date: Wed, 6 Nov 2024 15:57:38 -0500 (EST)

branch: externals/company
commit 0c23389d6c6472665031db1df09751309196fcf6
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    Use if-let* instead if-let (the latter is marked obsolete in 31.1)
---
 company.el | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/company.el b/company.el
index 569320236d..9141981783 100644
--- a/company.el
+++ b/company.el
@@ -781,11 +781,11 @@ See `company-quick-access-keys' for more details."
 
 (defun company-keymap--quick-access-modifier ()
   "Return string representation of the `company-quick-access-modifier'."
-  (if-let ((modifier (assoc-default company-quick-access-modifier
-                                    '((meta . "M")
-                                      (super . "s")
-                                      (hyper . "H")
-                                      (control . "C")))))
+  (if-let* ((modifier (assoc-default company-quick-access-modifier
+                                     '((meta . "M")
+                                       (super . "s")
+                                       (hyper . "H")
+                                       (control . "C")))))
       modifier
     (warn "company-quick-access-modifier value unknown: %S"
           company-quick-access-modifier)
@@ -1987,11 +1987,11 @@ end of the match."
   :type 'integer)
 
 (defun company--render-icons-margin (icon-mapping root-dir candidate selected)
-  (if-let ((ws (window-system))
-           (candidate candidate)
-           (kind (company-call-backend 'kind candidate))
-           (icon-file (or (alist-get kind icon-mapping)
-                          (alist-get t icon-mapping))))
+  (if-let* ((ws (window-system))
+            (candidate candidate)
+            (kind (company-call-backend 'kind candidate))
+            (icon-file (or (alist-get kind icon-mapping)
+                           (alist-get t icon-mapping))))
       (let* ((bkg (face-attribute (if selected
                                       'company-tooltip-selection
                                     'company-tooltip)
@@ -2116,10 +2116,10 @@ See `company-text-icons-mapping'."
 
 (defun company-text-icons-margin (candidate selected)
   "Margin function which returns unicode icons."
-  (when-let ((candidate candidate)
-             (kind (company-call-backend 'kind candidate))
-             (conf (or (alist-get kind company-text-icons-mapping)
-                       (alist-get t company-text-icons-mapping))))
+  (when-let* ((candidate candidate)
+              (kind (company-call-backend 'kind candidate))
+              (conf (or (alist-get kind company-text-icons-mapping)
+                        (alist-get t company-text-icons-mapping))))
     (cl-destructuring-bind (icon &optional fg bg) conf
       (propertize
        (format company-text-icons-format icon)
@@ -2181,9 +2181,9 @@ PROPERTY return nil."
 
 (defun company-dot-icons-margin (candidate selected)
   "Margin function that uses a colored dot to display completion kind."
-  (when-let ((kind (company-call-backend 'kind candidate))
-             (conf (or (assoc-default kind company-text-icons-mapping)
-                       (assoc-default t company-text-icons-mapping))))
+  (when-let* ((kind (company-call-backend 'kind candidate))
+              (conf (or (assoc-default kind company-text-icons-mapping)
+                        (assoc-default t company-text-icons-mapping))))
     (cl-destructuring-bind (_icon &optional fg bg) conf
       (propertize company-dot-icons-format
                   'face
@@ -2437,7 +2437,7 @@ For more details see `company-insertion-on-trigger' and
       (if company-abort-manual-when-too-short
           ;; Must not be less than minimum or initial length.
           (min company-minimum-prefix-length
-               (if-let ((mp-len-override (cdr-safe company--manual-prefix)))
+               (if-let* ((mp-len-override (cdr-safe company--manual-prefix)))
                    (if (numberp mp-len-override)
                        mp-len-override
                      (length (car-safe company--manual-prefix)))



reply via email to

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