From 3666deaed5b0baf0a74f14db5872105c9e7865f9 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Wed, 13 Jan 2021 13:01:34 +0800 Subject: A temporary intermeidate step Now I got almost every functionality that we need, including pdf, mu4e, magit, et cetera. --- modeline.el | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'modeline.el') 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 ""))) + -- cgit v1.2.3-18-g5258