Simon Bin writes:
> 2011/12/9 David Engster <deng@...>:
>> Simon Bin writes:
>>> Just a small question, can I use EDE to set the c-file-style for all
>>> files in a project? It *looks* like I might add c-file-style to
>
>>> :local-variables, but
>>>
>>> :local-variables '((c-file-style . stroustrup))
>>>
>>> doesn't seem to have any effect. maybe I'm doing it wrong...
>>
>> Works for me. Are you maybe overriding the setting in some hook?
>> Otherwise, I wouldn't know why this does not work.
>
> Thanks for the reply. I see... the variable does get set, but cc-mode
> only cares about it when it is actually in the file local variable
> list. So the c-style cannot be set that way
That's probably because EDE is pretty much the last thing that runs when
setting up the buffer, so the variable is set too late, and cc-mode
cannot know that you've changed it afterwards. You can either use Alex'
solution, or you put an after-method on ede-set-project-variables for
your project type. If you're using ede-cpp-root-project, this
(defmethod ede-set-project-variables :after ((this ede-cpp-root-project)
&optional buffer)
(when c-file-style
(c-set-style c-file-style)))
should work (untested).
-David
|