From 8331e0190888f3ec6c45f9bfa2f2303ecb72a45a Mon Sep 17 00:00:00 2001 From: Gregg Sangster Date: Thu, 16 Mar 2023 15:54:27 -0400 Subject: [PATCH] Add xah-fly-keys to modal segment --- mood-line-segment-modal.el | 10 ++++++++++ mood-line.el | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mood-line-segment-modal.el b/mood-line-segment-modal.el index 163ad5b..d5638ab 100644 --- a/mood-line-segment-modal.el +++ b/mood-line-segment-modal.el @@ -114,6 +114,16 @@ The `Face' may be either a face symbol or a property list of key-value pairs face (:inherit mood-line-status-warning)) "--- ")) +;; ---------------------------------- ;; +;; Xah segment function +;; ---------------------------------- ;; + +(defun mood-line-segment-modal--xah () + "Display the current xah-fly-keys state." + (if (bound-and-true-p xah-fly-insert-state-p) + " " + " ")) + ;; -------------------------------------------------------------------------- ;; ;; ;; Provide package diff --git a/mood-line.el b/mood-line.el index cc19d64..97a3d32 100644 --- a/mood-line.el +++ b/mood-line.el @@ -83,6 +83,7 @@ (declare-function mood-line-segment-modal--evil "mood-line-segment-modal" ()) (declare-function mood-line-segment-modal--meow "mood-line-segment-modal" ()) (declare-function mood-line-segment-modal--god "mood-line-segment-modal" ()) +(declare-function mood-line-segment-modal--xah "mood-line-segment-modal" ()) (declare-function mc/num-cursors "multiple-cursors" ()) @@ -381,7 +382,10 @@ Modal modes checked, in order: `evil-mode', `meow-mode', `god-mode'." (mood-line-segment-modal--meow)) ((featurep 'god-mode) (require 'mood-line-segment-modal) - (mood-line-segment-modal--god)))) + (mood-line-segment-modal--god)) + ((bound-and-true-p xah-fly-keys) + (require 'mood-line-segment-modal) + (mood-line-segment-modal--xah)))) ;; -------------------------------------------------------------------------- ;; ;;