From: Alan Mackenzie <acm@muc.de>
To: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: A bad indentation made by C
Date: 22 Apr 2007 19:50:41 +0200 [thread overview]
Message-ID: <20070422191108.GA1067@muc.de> (raw)
In-Reply-To: <462B7626.9010401@gmail.com>
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.
next prev parent reply other threads:[~2007-04-22 17:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-22 11:28 A bad indentation made by C Lennart Borgman (gmail)
2007-04-22 12:02 ` Alan Mackenzie
2007-04-22 12:42 ` Lennart Borgman (gmail)
2007-04-22 14:17 ` Alan Mackenzie
2007-04-22 14:50 ` Lennart Borgman (gmail)
2007-04-22 17:50 ` Alan Mackenzie [this message]
2007-04-23 4:49 ` Stefan Monnier
2007-04-23 5:29 ` Lennart Borgman (gmail)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070422191108.GA1067@muc.de \
--to=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=lennart.borgman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.