[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using current style in C?
From: |
Jérôme M. Berger |
Subject: |
Re: Using current style in C? |
Date: |
Mon, 04 Mar 2013 23:14:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.24) Gecko/20120206 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666 |
Stefan Monnier wrote:
>> Once upon a time, I'll swear I read somewhere about being able to configure
>> C-mode to "use the current style", but now I can't find it. I'd like to use
>> such a feature.
>
> Check c-guess (in cc-guess.el).
>
Thanks, that could be very useful. However, I just tried adding the
following to my c-mode-hook to configure the style automatically
when I open a file:
(setq c-guess-guessed-basic-offset nil)
(setq c-guess-guessed-offsets-alist nil)
(c-guess-no-install)
(if c-guess-guessed-basic-offset
(setq c-basic-offset c-guess-guessed-basic-offset))
(if c-guess-guessed-offsets-alist
(setq c-offsets-alist c-guess-guessed-offsets-alist))
For some reason, this is horribly slow (takes several minutes to
complete). When I remove those lines and launch c-guess-no-install
interactively with M-x, then it is almost instantaneous (less than
one second). Anybody knows what's happening?
Thanks,
Jerome
--
mailto:jeberger@free.fr
http://jeberger.free.fr
Jabber: jeberger@jabber.fr
signature.asc
Description: OpenPGP digital signature