[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mode loaded twice with Local Variables

From: Stuart D. Herring
Subject: Re: Mode loaded twice with Local Variables
Date: Wed, 14 Jun 2006 16:09:52 -0700 (PDT)
User-agent: SquirrelMail/1.4.3a-11.EL3

>   I didn't  think it  was the right  fix for  one reason :  some modes
>   /may/  behave  differently  on  startup  if  /some/  variables  have
>   /certain/  values.  In  other   words,  Local  Variables  would  set
>   variables  to  some  value  before  launching  the  mode,  expecting
>   a specified behavior.
>   My change provides this feature, AFAIK, but I do agree that it could
>   be too... dangerous to patch normal-mode, and not so needed.

I've suddenly run into a very similar thing when writing a mode -- wanting
it to depend on file-local variables at "startup".  Perhaps you'll be
interested to note the solution I found:

  hack-local-variables-hook's value is nil

  Normal hook run after processing a file's local variables specs.
  Major modes can use this to examine user-specified local variables
  in order to initialize other data structure based on them.

  Defined in `files'.

As far as I can tell, it's run whether or not there actually were any
variables to set, so it's useful as a core component of a major mode.

Hope it helps,

This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during

reply via email to

[Prev in Thread] Current Thread [Next in Thread]