How to control Emacs vs. vi state with a file local variable?

Frank Fischer frank-fischer at shadow-soft.de
Wed Oct 31 17:39:02 CET 2012


Am Tue, 16 Oct 2012 09:19:47 +0100
schrieb Christoph LANGE <langec at web.de>:

> Dear evil developers/users,
> 
> I would like to generally open all files of a certain type (org-mode)
> in vi state but make exceptions for a few individual files.  Using
> file local variables didn't work.
> 
> I tried
> 
> Local Variables:
> eval: (evil-emacs-state)
> End:
> 
> but apparently the order of execution was the following:
> 
> 1. load the file
> 2. apply the local variables, switching to Emacs state
> 3. here, or possibly before (2), switch buffer to org-mode
> 4. on seeing that org-mode is not in the list of
> evil-emacs-state-modes, switch to vi state
> 
> If this assumption is right, is there any way of opening individual 
> files in Emacs state?

I think your assumptions are right and there is currently no way. 

But maybe the following patch could help. It defines a new variable
`evil-this-buffer-initial-state' that can be set to some value != nil
to overwrite the initial state in the current buffer. When set in a
file variable it should do what you want.

Best
Frank
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initvar.patch
Type: text/x-patch
Size: 1279 bytes
Desc: not available
Url : https://lists.ourproject.org/pipermail/implementations-list/attachments/20121031/236ea51c/attachment.bin 


More information about the implementations-list mailing list