@@ -80,6 +80,11 @@ nil means obtained from the envrionment.")
80
80
(defvar sis-respect-evil-normal-escape t
81
81
" <escape> to english in normal state when the /respect mode/ is enabled." )
82
82
83
+ (defvar sis-respect-evil-hooks '(evil-insert-state-exit-hook)
84
+ " List of hook symbols that will be configured to cause input source to go
85
+ to english under /respect mode/. When changing this, one might also want
86
+ to add the corresponding entry hooks to `sis-context-hooks' ." )
87
+
83
88
(defvar sis-respect-minibuffer-triggers (list )
84
89
" Commands trigger to set input source in minibuffer.
85
90
@@ -159,8 +164,10 @@ Each detector should:
159
164
" Hooks trigger the set of input source following context." )
160
165
161
166
(defvar sis-context-triggers
162
- (list '('+org/insert-item-below 'sis--context-line nil )
163
- '('+org/insert-item-above 'sis--context-line nil ))
167
+ (and (featurep 'doom )
168
+ (modulep! :lang org )
169
+ (list '('+org/insert-item-below 'sis--context-line nil )
170
+ '('+org/insert-item-above 'sis--context-line nil )))
164
171
" Commands trigger the set of input source following context.
165
172
166
173
Each trigger should be a list: (FN PRE-FN-DETECTOR POST-FN-DETECTOR).
@@ -1010,7 +1017,8 @@ Possible values: \\='normal, \\='prefix, \\='sequence.")
1010
1017
(defun sis--respect-evil ()
1011
1018
" Respect evil."
1012
1019
(when (featurep 'evil )
1013
- (add-hook 'evil-insert-state-exit-hook #'sis-set-english )
1020
+ (dolist (hook sis-respect-evil-hooks)
1021
+ (add-hook hook #'sis-set-english ))
1014
1022
; ; evil's advice cause a lot of trouble
1015
1023
; ; let sis to manage input method
1016
1024
(advice-add 'evil-activate-input-method :override
@@ -1086,7 +1094,8 @@ Possible values: \\='normal, \\='prefix, \\='sequence.")
1086
1094
(sis--try-disable-auto-refresh-mode)
1087
1095
; ; for evil
1088
1096
(when (featurep 'evil )
1089
- (remove-hook 'evil-insert-state-exit-hook #'sis-set-english )
1097
+ (dolist (hook sis-respect-evil-hooks)
1098
+ (remove-hook hook #'sis-set-english ))
1090
1099
(advice-remove 'evil-activate-input-method #'sis--do-nothing-advice )
1091
1100
(advice-remove 'evil-deactivate-input-method #'sis--do-nothing-advice )
1092
1101
(advice-remove 'ad-Advice-toggle-input-method #'sis--original-advice )
0 commit comments