summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-01-12 19:42:13 +0800
committerJSDurand <mmemmew@gmail.com>2022-01-12 19:42:13 +0800
commit1f6ce7201597b84c646280ca7fe838498319c3be (patch)
treedba4cf7921f09c60f39f6ca29b5b14289b0bf197
parentbde550449375a9f5f6dbc652cce2e017de9df835 (diff)
modeline: silence keycast when deactivated
* modeline.el (modeline-format-keycast): Previously there was a bug that the last key cast message will still appear on the mode line after durand-keycase-mode has been deactivated. Now this is fixed.
-rw-r--r--modeline.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/modeline.el b/modeline.el
index b244463..804442e 100644
--- a/modeline.el
+++ b/modeline.el
@@ -371,14 +371,16 @@ mouse-3: Toggle minor modes"
(defun modeline-format-keycast ()
"Format the keycast information."
(declare (side-effect-free t))
- (modeline-propertize
- (format-mode-line mode-line-keycast)
- nil
- "Minor mode
+ (cond
+ (durand-keycast-mode
+ (modeline-propertize
+ (format-mode-line mode-line-keycast)
+ nil
+ "Minor mode
mouse-1: Display minor mode menu
mouse-2: Show help for minor mode
mouse-3: Toggle minor modes"
- mode-line-minor-mode-keymap))
+ mode-line-minor-mode-keymap))))
;;; NOTE: The minor mode menu does not work with my custom mode line.