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

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

[nongnu] elpa/keycast 72f649c992 1/2: keycast-mode-line-mode: Fix handli


From: ELPA Syncer
Subject: [nongnu] elpa/keycast 72f649c992 1/2: keycast-mode-line-mode: Fix handling of single element special-case
Date: Mon, 4 Mar 2024 16:00:48 -0500 (EST)

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

    keycast-mode-line-mode: Fix handling of single element special-case
    
    Since [1: 860b078] `keycast-mode-line-mode' we try to support the
    cases where the global `mode-line-format' is a single element or nil,
    but in the single element case we accidentally checked the local value
    and then modified the global value.
    
    1: 2022-12-05 860b0781a44b370ba5b41a80e838486325a89681
       keycast-mode-line-mode: Support atomic and void global mode-line-format
---
 keycast.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/keycast.el b/keycast.el
index 46412dbb5b..eaee2bde32 100644
--- a/keycast.el
+++ b/keycast.el
@@ -545,11 +545,12 @@ t to show the actual COMMAND, or a symbol to be shown 
instead."
   :global t
   (cond
    (keycast-mode-line-mode
-    (cond ((not (default-value 'mode-line-format))
-           (setq keycast--temporary-mode-line t)
-           (setq-default mode-line-format (list "")))
-          ((keycast--format-atom-p mode-line-format)
-           (setq-default mode-line-format (list "" mode-line-format))))
+    (let ((format (default-value 'mode-line-format)))
+      (cond ((not format)
+             (setq keycast--temporary-mode-line t)
+             (setq-default mode-line-format (list "")))
+            ((keycast--format-atom-p format)
+             (setq-default mode-line-format (list "" format)))))
     (let ((cons (keycast--tree-member keycast-mode-line-insert-after
                                       (default-value 'mode-line-format))))
       (unless cons



reply via email to

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