summaryrefslogtreecommitdiff
path: root/modeline.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-01-13 13:01:34 +0800
committerJSDurand <mmemmew@gmail.com>2021-01-13 13:01:34 +0800
commit3666deaed5b0baf0a74f14db5872105c9e7865f9 (patch)
tree3535c3f57ed9d5b1cd4e3e81831f627840b6e81b /modeline.el
parent1700588e1a3cfb5fa45fb64393c68782bc35fc38 (diff)
A temporary intermeidate step
Now I got almost every functionality that we need, including pdf, mu4e, magit, et cetera.
Diffstat (limited to 'modeline.el')
-rw-r--r--modeline.el30
1 files changed, 30 insertions, 0 deletions
diff --git a/modeline.el b/modeline.el
index 7da967e..0fdd0d5 100644
--- a/modeline.el
+++ b/modeline.el
@@ -43,6 +43,7 @@
(defun modeline-format-right ()
"The right mode line format."
(concat
+ (modeline-format-input-method)
(modeline-format-major-mode)
(modeline-format-vc-mode)))
@@ -137,6 +138,14 @@ MAP is the local keymap of the text."
(defface doom-modeline-buffer-major-mode nil
"The face for mode line major mode.")
+;;;###autoload
+(defface doom-modeline-input-method nil
+ "The face for mode line input method.")
+
+;;;###autoload
+(defface doom-modeline-input-method-alt nil
+ "The alternative face for mode line input method.")
+
;;; Various sections of the mode line
;;;###autoload
@@ -482,3 +491,24 @@ This will be displayed in the mode line."
(get-text-property 1 'help-echo vc-mode)
(get-text-property 1 'local-map vc-mode))
(modeline-spc)))))
+
+;;;###autoload
+(defun modeline-format-input-method ()
+ "Display the current input method on the mode line."
+ (cond
+ (current-input-method
+ (concat
+ (modeline-spc)
+ (modeline-propertize
+ (propertize
+ current-input-method-title
+ 'face (cond ((modeline-active-window-p) 'doom-modeline-input-method)
+ (t 'mode-line-inactive)))
+ nil
+ (format "Current input method: %s\nmouse-2: Disable input method\nmouse-3: Describe current input method"
+ current-input-method)
+ mode-line-input-method-map)
+ (modeline-spc))
+ )
+ (t "")))
+