diff options
| author | ibbem <ibbem@ibbem.net> | 2023-03-15 10:39:48 +0100 |
|---|---|---|
| committer | Axel Forsman <axelsfor@gmail.com> | 2023-03-17 11:43:04 +0100 |
| commit | 53fb7af0204d297661949aa208a867d74362a256 (patch) | |
| tree | dcbe577dee29828890b555247e56861ebf003bc9 /evil-core.el | |
| parent | bdbf41bb91792418f96049d063c5d28a0777dad2 (diff) | |
Restore the input method on deactivation of evil-local-mode
This ensures that the input method after deactivating evil-local-mode is
the same as the input method used for states with a non-nil
:input-method property.
This issue was discovered while investigating why the input method
couldn't be set by the agda2-mode while evil was active [1]. As the
change in major mode (to agda2-mode) caused evil-local-mode to be
disabled and reenabled by `define-globalized-minor-mode evil-mode`, the
input method was lost because the default state (i.e. normal state) does
have an :input-method property of nil.
In summary this patch fixes the approach used by agda2-mode [2] and the
official recommendation in the Emacs manual [3], e.g.
(add-hook 'text-mode-hook
(lambda () (set-input-method "german-prefix")))
[1]: https://github.com/agda/agda/issues/2141
[2]: https://github.com/agda/agda/blob/37554c46cbd770fa630f9b164e2b543506acbdbc/src/data/emacs-mode/agda2-mode.el#L432
[3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Input-Method.html
Diffstat (limited to 'evil-core.el')
| -rw-r--r-- | evil-core.el | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/evil-core.el b/evil-core.el index 3216c7a..b1f5fb0 100644 --- a/evil-core.el +++ b/evil-core.el @@ -134,6 +134,7 @@ (remove-hook 'activate-mark-hook 'evil-visual-activate-hook t) (remove-hook 'input-method-activate-hook #'evil-activate-input-method t) (remove-hook 'input-method-deactivate-hook #'evil-deactivate-input-method t) + (activate-input-method evil-input-method) (evil-change-state nil))) ;; Make the variable permanent local. This is particular useful in |
