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

Christoph LANGE math.semantic.web at gmail.com
Mon Feb 4 10:56:39 CET 2013


Hi Frank,

with the recent improvements to evil (I can't tell the exact change
responsible for this) the feature I had once wished for (see old
communication below) suddenly started to work – thanks!

Christoph

2012-10-31 17:39 Frank Fischer:
>> 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.

-- 
Christoph Lange, School of Computer Science, University of Birmingham
http://cs.bham.ac.uk/~langec/, Skype duke4701

→ Enabling Domain Experts to use Formalised Reasoning @ AISB 2013
  2–5 April, Exeter, UK.  Deadline (extended) 28 Jan
  http://cs.bham.ac.uk/research/projects/formare/events/aisb2013/
→ Intelligent Computer Mathematics, 7–12 Jul, Bath, UK; Deadline 8 Mar
  http://cicm-conference.org/2013/
→ SePublica Workshop @ ESWC 2013.  Montpellier, France, 26-30 May.
  http://sepublica.mywikipaper.org



More information about the implementations-list mailing list