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

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

[elpa] externals/which-key d924a4a766 01/11: Calculate format string onl


From: ELPA Syncer
Subject: [elpa] externals/which-key d924a4a766 01/11: Calculate format string only once
Date: Thu, 11 Aug 2022 12:58:11 -0400 (EDT)

branch: externals/which-key
commit d924a4a766d3f895acbddf02d01db1e3f049f899
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Calculate format string only once
---
 which-key.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/which-key.el b/which-key.el
index 19d1f9fb3d..d9dcf8dee9 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1874,13 +1874,12 @@ that width."
          (col-sep-width  (which-key--max-len col-keys 1))
          (col-desc-width (which-key--max-len
                           col-keys 2 which-key-min-column-description-width))
-         (col-width      (+ 1 col-key-width col-sep-width col-desc-width)))
+         (col-width      (+ 1 col-key-width col-sep-width col-desc-width))
+        (col-format     (concat "%" (int-to-string col-key-width)
+                                 "s%s%-" (int-to-string col-desc-width) "s")))
     (cons col-width
-          (mapcar (lambda (k)
-                    (format (concat "%" (int-to-string col-key-width)
-                                    "s%s%-" (int-to-string col-desc-width) "s")
-                            (nth 0 k) (nth 1 k) (nth 2 k)))
-                  col-keys))))
+          (mapcar (lambda (k) (apply #'format col-format k))
+                 col-keys))))
 
 (defun which-key--partition-list (n list)
   "Partition LIST into N-sized sublists."



reply via email to

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