summary refs log tree commit diff stats
path: root/lisp/+modeline.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/+modeline.el')
-rw-r--r--lisp/+modeline.el25
1 files changed, 25 insertions, 0 deletions
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