evil-mode and trying to make sure that it gets disabled after invoking an
I've tried using
after advice to advise the
ansi-term function, as well as adding a hook to
term-mode, but that doesn't seem to disable evil mode in the ansi-term buffer.
I ended up defining a separate interactive function that calls
ansi-term with a fixed argument and then disables evil-mode for just the current buffer.
(defun ansi-term-disable-evil () "interactively call ansi-term" (interactive) (ansi-term "/bin/tcsh") ; probably shouldn't be hardcoded (evil-local-mode -1))
This function has the desired effect (disabling evil-mode in the ansi-term buffer).
Using after advice, however, does not work and I'm trying to understand why.
Here is what I I tried in an attempt to disable evil-mode locally after executing
(defun ansi-term-post () "configuration settings for ansi-term" (evil-local-mode -1)) (advice-add 'ansi-term :after 'ansi-term-post) ; I used an ordinary symbol here, not a function object with #'
However, this didn't actually disable evil-mode in the ansi-term buffer. I'm trying to understand why.