From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: A bad indentation made by C Date: 22 Apr 2007 19:50:41 +0200 Message-ID: <20070422191108.GA1067@muc.de> References: <462B46D9.3050003@gmail.com> <20070422132250.GA2402@muc.de> <462B5818.8030008@gmail.com> <20070422153743.GB2402@muc.de> <462B7626.9010401@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177264266 17168 80.91.229.12 (22 Apr 2007 17:51:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Apr 2007 17:51:06 +0000 (UTC) Cc: Emacs Devel To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 22 19:50:59 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HfgDC-0004LV-4B for ged-emacs-devel@m.gmane.org; Sun, 22 Apr 2007 19:50:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HfgIV-00082i-2B for ged-emacs-devel@m.gmane.org; Sun, 22 Apr 2007 13:56:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HfgII-0007tu-Hs for emacs-devel@gnu.org; Sun, 22 Apr 2007 13:56:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HfgIH-0007tQ-US for emacs-devel@gnu.org; Sun, 22 Apr 2007 13:56:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HfgIH-0007t9-Ji for emacs-devel@gnu.org; Sun, 22 Apr 2007 13:56:13 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HfgCx-0003z1-Pq for emacs-devel@gnu.org; Sun, 22 Apr 2007 13:50:44 -0400 Original-Received: (qmail 62107 invoked by uid 3782); 22 Apr 2007 17:50:41 -0000 Original-Received: from acm.muc.de (p54A3DD1A.dip.t-dialin.net [84.163.221.26]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 22 Apr 2007 19:50:39 +0200 Original-Received: (qmail 1745 invoked by uid 1000); 22 Apr 2007 19:11:09 -0000 Original-Date: Sun, 22 Apr 2007 20:11:09 +0100 Content-Disposition: inline In-Reply-To: <462B7626.9010401@gmail.com> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:69808 Archived-At: 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.