switching states via hooks

Leo Alekseyev dnquark at gmail.com
Sat Jan 14 01:35:05 CET 2012


I was trying to get finer-grained control over which states buffers
start up in.  I defined something like

(defun my-switch-to-emacs-state-hook ()
  (if evil-mode (evil-emacs-state)))

(add-hook 'org-src-mode-hook 'my-switch-to-emacs-state-hook)

The hook runs, but the state switch doesn't take place.  On the other
hand, if I evaluate (my-switch-to-emacs-state-hook) in the buffer, the
switch takes place.  Can anyone shed light on why that might be
happening?

--Leo



More information about the implementations-list mailing list