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 16:17:17 +0200 Message-ID: <20070422153743.GB2402@muc.de> References: <462B46D9.3050003@gmail.com> <20070422132250.GA2402@muc.de> <462B5818.8030008@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177251541 5705 80.91.229.12 (22 Apr 2007 14:19:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Apr 2007 14:19:01 +0000 (UTC) Cc: Eric Lilja , Emacs Devel To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 22 16:18:54 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 1Hfctt-0000Uk-Ea for ged-emacs-devel@m.gmane.org; Sun, 22 Apr 2007 16:18:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hfcz9-0002Of-8T for ged-emacs-devel@m.gmane.org; Sun, 22 Apr 2007 10:24:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HfcyD-00020u-EA for emacs-devel@gnu.org; Sun, 22 Apr 2007 10:23:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hfcy8-0001z0-Rx for emacs-devel@gnu.org; Sun, 22 Apr 2007 10:23:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hfcy8-0001yv-I2 for emacs-devel@gnu.org; Sun, 22 Apr 2007 10:23:12 -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 1Hfcsn-0003Le-Qh for emacs-devel@gnu.org; Sun, 22 Apr 2007 10:17:43 -0400 Original-Received: (qmail 38219 invoked by uid 3782); 22 Apr 2007 14:17:17 -0000 Original-Received: from acm.muc.de (p54a3cda5.dip.t-dialin.net [84.163.205.165]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 22 Apr 2007 16:17:15 +0200 Original-Received: (qmail 7796 invoked by uid 1000); 22 Apr 2007 15:37:43 -0000 Original-Date: Sun, 22 Apr 2007 16:37:43 +0100 Content-Disposition: inline In-Reply-To: <462B5818.8030008@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:69800 Archived-At: Hallo again, Lennart! On Sun, Apr 22, 2007 at 02:42:00PM +0200, Lennart Borgman (gmail) wrote: > Hi, Alan! > >On Sun, Apr 22, 2007 at 01:28:25PM +0200, Lennart Borgman (gmail) > >wrote: > >>but for php-mode.el. The php-mode I am using/distributing is derived > >>from c-mode. It uses c-indent-line. That works in many circumstances > >>but not all. > >>A rather annoying indentation is the following > >> for (;;) { > >> } > >>This happens only if the for-loop is on top level, but that happens > >>all the time in PHP. Maybe that little thing could be changed in > >>c-indent-line? Or maybe someone can help me a bit to fix this in > >>php-mode.el? > >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? > >The php-mode.el at SourceForge, when I last looked at it, didn't look > >like it was being actively maintained. The latest release was from > >2003, and it didn't appear to have been updated for CC Mode 5.30 > >(which superseded 5.28 in summer 2003). > I have tried to contact the author, Turadg, but he has not replied (yet). It might well me that he (?she) has simply lost interest and given up on the project. I hope you get an answer sometime, though. > >I think that php-mode.el needs a serious amount of work done on it to > >bring it up to date with the current CC Mode. It would probably be > >better to wait till after the release to do this. ;-) > I have done a bit of work on it, but not very much since I do not > understand most of it. Where's that little word "yet"? ;-) > I have uploaded the slightly changed version here: [ .... ] > If you want to have a look at it it would be nice. I think that there > can be some interest in it again, especially when used in nXhtml (or > something similar perhaps). Well, I'm struggling a bit to keep up with everything on CC Mode, so I'm not really in a position to take on anything extra. -- Alan.