Subject: Re: bug#7767: 23.2.91; file-local-variables-alist should have the permanent-local property

From: Stefan Monnier <[email-masked]>
Date: Sat, 01 Jan 2011 14:38:58 -0500

> I tried to debug the problem and it seems that `hack-local-variables'
> will collect the local variables into `file-local-variables-alist' than
> run the hook `before-hack-local-variables-hook' which containts the
> function `c-before-hack-hook'.
> `c-before-hack-hook' will see the `mode' variable and call `c++-mode'
> which than will call `kill-all-local-variables' setting
> `file-local-variables-alist' to nil so that the remaining variables are
> not processed.

It sounds like cc-mode does something odd here.

> Adding the `permanent-local' property to `file-local-variables-alist'
> seems to fix the problem.

My first impression is rather that this would work around the problem
introduced by cc-mode.  So I'd first want to make sure that cc-mode has
a good reason to call c++-mode from before-hack-local-variables-hook.

> This happens both on the trunk and on the emacs-23 branch.

Alan, could you enlighten us?

        Stefan