emacs-devel
[Top][All Lists]
Advanced

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

Re: A bad indentation made by C


From: Alan Mackenzie
Subject: Re: A bad indentation made by C
Date: 22 Apr 2007 19:50:41 +0200
Date: Sun, 22 Apr 2007 20:11:09 +0100
User-agent: Mutt/1.5.9i

Good evening!

On Sun, Apr 22, 2007 at 04:50:14PM +0200, Lennart Borgman (gmail) wrote:
> Alan Mackenzie wrote:
> >>>As a pure guess, the indentation of the "}" to column 1 probably comes
> >>>from `c-gnu-impose-minimum' which is installed on
> >>>c-special-indent-hook for the style "gnu".  If you set a different
> >>>style (e.g. by C-c .), this problem might go away.  Or remove it from
> >>>c-special-indent-hook in php-mode-hook or one of CC Mode's hooks.

> >>Thanks, that helped. But now I have one of my favourite questions I
> >>seldom ask: How do I make a local hook so much nil so that the global
> >>hook is not run?

> >Sorry, I can't parse that (but I do understand about writing foreign
> >languages).  Which local hook, which global hook?  When do you not
> >wan't which global hook to run?

> I want to set c-special-indent-hook to nil locally in the buffer and I 
> do not want to run the global hook then. Is the global hook still run 
> when I set the local hook to nil? I believe it is not run, but I am not 
> sure.

Ah, right!

c-special-indent-hook is already buffer local - try doing C-h v on it in
a CC Mode buffer.  Hmm.  The CC Mode manual should perhaps say this on
the page "Other Special Indentations".  [But after the release. :-]  Just
as a matter of interest, the only function CC Mode itself puts on this
hook is c-gnu-impose-minimum, and that only for "gnu" style.

For other hooks which aren't buffer local, I suppose you could do
something like this:
(make-local-variable 'foo-mode-hook)
(remove-hook 'foo-mode-hook 'bar)

-- 
Alan.




reply via email to

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