diff options
author | Case Duckworth | 2022-02-28 09:40:07 -0600 |
---|---|---|
committer | Case Duckworth | 2022-02-28 09:40:18 -0600 |
commit | b0346f62835ccb79f38e05223313985c2e0a296e (patch) | |
tree | 4ea4577d77efa36a32c76f5029e6701440c71ee3 /lisp | |
parent | Add org-taskwise (diff) | |
download | emacs-b0346f62835ccb79f38e05223313985c2e0a296e.tar.gz emacs-b0346f62835ccb79f38e05223313985c2e0a296e.zip |
Add input method to the modeline
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/+modeline.el | 25 |
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 |