summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el1
-rw-r--r--lisp/+modeline.el25
2 files changed, 26 insertions, 0 deletions
diff --git a/init.el b/init.el index 247f241..42cac67 100644 --- a/init.el +++ b/init.el
@@ -1919,6 +1919,7 @@ See also `crux-reopen-as-root-mode'."
1919 +modeline-reading-mode 1919 +modeline-reading-mode
1920 +modeline-narrowed) 1920 +modeline-narrowed)
1921 ",") 1921 ",")
1922 +modeline-input-method
1922 ,(+modeline-concat 1923 ,(+modeline-concat
1923 '(+modeline-region 1924 '(+modeline-region
1924 +modeline-line-column 1925 +modeline-line-column
diff --git a/lisp/+modeline.el b/lisp/+modeline.el index 537c68b..c8dab4e 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el
@@ -301,5 +301,30 @@ See `line-number-mode', `column-number-mode', `file-percentage-mode'"
301 (force-mode-line-update))))) 301 (force-mode-line-update)))))
302 'mouse-face 'mode-line-highlight)))) 302 'mouse-face 'mode-line-highlight))))
303 303
304(defun +modeline-input-method (&optional spacer)
305 "Display which input method is active."
306 (when current-input-method
307 (concat (or spacer +modeline-default-spacer)
308 (propertize current-input-method-title
309 'help-echo (format
310 (concat "Current input method: %s\n"
311 "mouse-1: Describe current input method\n"
312 "mouse-3: Toggle input method")
313 current-input-method)
314 'local-map (purecopy
315 (let ((map (make-sparse-keymap)))
316 (define-key map [mode-line mouse-1]
317 (lambda (e)
318 (interactive "e")
319 (with-selected-window (posn-window (event-start e))
320 (describe-current-input-method))))
321 (define-key map [mode-line mouse-3]
322 (lambda (e)
323 (interactive "e")
324 (with-selected-window (posn-window (event-start e))
325 (toggle-input-method nil :interactive))))
326 map))
327 'mouse-face 'mode-line-highlight))))
328
304(provide '+modeline) 329(provide '+modeline)
305;;; +modeline.el ends here 330;;; +modeline.el ends here