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

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

[nongnu] elpa/hyperdrive 70362a6a7e 061/102: Tidy: Simplify labeled func


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 70362a6a7e 061/102: Tidy: Simplify labeled function and custom value
Date: Wed, 29 Nov 2023 04:00:53 -0500 (EST)

branch: elpa/hyperdrive
commit 70362a6a7e503c34161c3973c9b399cea0b67523
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Tidy: Simplify labeled function and custom value
---
 hyperdrive-lib.el  | 17 +++++++----------
 hyperdrive-vars.el |  2 +-
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 4352569885..2f8f7cdf17 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -974,10 +974,10 @@ according to FORMATS, by default `hyperdrive-formats', 
which see."
                 hyperdrive)
                (format (or format "%H"))
                (formats (or formats hyperdrive-formats)))
-    (cl-labels ((fmt (naming value string face)
+    (cl-labels ((fmt (naming value face)
                   (if value
                       (format (alist-get naming formats)
-                              (propertize string 'face face))
+                              (propertize value 'face face))
                     "")))
       (format-spec format
                    ;; TODO(deprecate-28): Use lambdas in each specifier.
@@ -985,14 +985,11 @@ according to FORMATS, by default `hyperdrive-formats', 
which see."
                                  ;; HACK: Once using lambdas in this specifier,
                                  ;; remove the `string-match-p' check.
                                  (hyperdrive--preferred-format hyperdrive)))
-                     (?P . ,(fmt 'petname petname petname 'hyperdrive-petname))
-                     (?N . ,(fmt 'nickname nickname nickname 
'hyperdrive-nickname))
-                     (?k . ,(fmt 'short-key public-key
-                                 (concat (substring public-key 0 6) "…")
-                                 'hyperdrive-public-key))
-                     (?K . ,(fmt 'public-key public-key
-                                 public-key 'hyperdrive-public-key))
-                     (?S . ,(fmt 'seed seed seed 'hyperdrive-seed))
+                     (?P . ,(fmt 'petname petname 'hyperdrive-petname))
+                     (?N . ,(fmt 'nickname nickname 'hyperdrive-nickname))
+                     (?k . ,(fmt 'short-key public-key 'hyperdrive-public-key))
+                     (?K . ,(fmt 'public-key public-key 
'hyperdrive-public-key))
+                     (?S . ,(fmt 'seed seed 'hyperdrive-seed))
                      (?D . ,(if (car domains)
                                 (format (alist-get 'domains formats)
                                         (string-join
diff --git a/hyperdrive-vars.el b/hyperdrive-vars.el
index 3032d70491..0a2622262e 100644
--- a/hyperdrive-vars.el
+++ b/hyperdrive-vars.el
@@ -222,7 +222,7 @@ see."
                                 (petname    . "petname:%s")
                                 (nickname   . "nickname:%s")
                                 (public-key . "public-key:%s")
-                                (short-key  . "public-key:%s")
+                                (short-key  . "public-key:%.8s…")
                                 (seed       . "seed:%s")
                                 (domains    . "domains:%s"))
   "Alist mapping hyperdrive and hyperdrive entry metadata item to format 
string.



reply via email to

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