emacs-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH] setting indentation styles via `c-file-style' fails to a


From: Stefan Monnier
Subject: Re: [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation
Date: Thu, 02 Jun 2011 10:35:50 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> I agree with Stefan, the whole business of initialising style variables
> has passed the level of complexity at which humans can handle it.  IMAO,
> the straw that broke the camel's back was the misuse of `c-file-style' in
> .dir-locals (for which I accept I'm mostly to blame).  Before any other
> ways of simplification are explored, this use of `c-file-style' needs to
> be separated from the normal use, possibly by something like this in the
> Emacs core:

>     (if (and (boundp 'c-file-style)
>              c-file-style)
>         (setq c-dir-style c-file-style
>             c-file-style nil))

> Then CC Mode could get rid of all the attempted hacks for handling the
> hybrid `c-file-style'.

I'd rather not hardcode such CC-mode-specific code in Emacs core, but
maybe we can provide a generic way to do that or something similar.
The direct way to do the above would be for Emacs to provide
a "dir-locals-redirect" property which you could set on c-file-style,
redirecting it to c-dir-style.  Or maybe it would be enough to provide
both the list of file-local and the list of dir-local variables, so
that CC-mode could tell whether c-file-style was set file-locally, or
dir-locally, or some other way.


        Stefan



reply via email to

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