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

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

[nongnu] elpa/keycast a3a0798349 25/31: Explicitly support compact mode


From: ELPA Syncer
Subject: [nongnu] elpa/keycast a3a0798349 25/31: Explicitly support compact mode line
Date: Sun, 9 Jan 2022 05:58:51 -0500 (EST)

branch: elpa/keycast
commit a3a0798349adf3e33277091fa8dee63173b68edf
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Explicitly support compact mode line
    
    By default the key is displayed with padding and a [box]:
      [ C-n ] next-line
    but if `mode-line-compact' is non-nil, then that became:
      [C-n ]next-line
    and now that we handle it explicitly, we get:
      [C-n] next-line
    
    Closes #13.
---
 keycast.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/keycast.el b/keycast.el
index 57742c8a52..714c402e57 100644
--- a/keycast.el
+++ b/keycast.el
@@ -230,9 +230,12 @@ instead."
              (unless (eq k t) (setq key k))
              (unless (eq c t) (setq cmd c))))
          (and key cmd
-              (let ((k (let ((pad (max 2 (- 5 (length key)))))
-                         (concat (make-string (ceiling pad 2) ?\s) key
-                                 (make-string (floor   pad 2) ?\s))))
+              (let ((k (if (and (bound-and-true-p mode-line-compact)
+                                (eq format mode-line-keycast-format))
+                           key
+                         (let ((pad (max 2 (- 5 (length key)))))
+                           (concat (make-string (ceiling pad 2) ?\s) key
+                                   (make-string (floor   pad 2) ?\s)))))
                     (c (format " %s" cmd)))
                 (format-spec
                  format



reply via email to

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