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 14:02:26 +0200 Message-ID: <20070422132250.GA2402@muc.de> References: <462B46D9.3050003@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177243364 7828 80.91.229.12 (22 Apr 2007 12:02:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Apr 2007 12:02:44 +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 14:02:38 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 1Hfam2-0006jx-QP for ged-emacs-devel@m.gmane.org; Sun, 22 Apr 2007 14:02:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HfarK-0006Np-2u for ged-emacs-devel@m.gmane.org; Sun, 22 Apr 2007 08:08:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HfarG-0006MN-9x for emacs-devel@gnu.org; Sun, 22 Apr 2007 08:07:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HfarE-0006K0-OZ for emacs-devel@gnu.org; Sun, 22 Apr 2007 08:07:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HfarE-0006Ju-Io for emacs-devel@gnu.org; Sun, 22 Apr 2007 08:07:56 -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 1Hfalw-0006T0-CS for emacs-devel@gnu.org; Sun, 22 Apr 2007 08:02:28 -0400 Original-Received: (qmail 23005 invoked by uid 3782); 22 Apr 2007 12:02:26 -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 14:02:23 +0200 Original-Received: (qmail 6015 invoked by uid 1000); 22 Apr 2007 13:22:50 -0000 Original-Date: Sun, 22 Apr 2007 14:22:50 +0100 Content-Disposition: inline In-Reply-To: <462B46D9.3050003@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:69793 Archived-At: Hi, Lennart! 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. Just as an aside, your bug report could have been a little more detailed and helpful, for example by saying where you got php-mode.el from (it isn't part of Emacs 22), and being a bit more precise about the indentation (you've pictured the "for" starting at column 2 despite having said "on top level"). It could have been MUCH more helpful by dumping CC Mode's configuration (C-c C-b). :-) However, assuming that the "for" is really at column 0, and that php-mode.el came from > 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. 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 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. ;-) -- Alan Mackenzie (Ittersbach, Germany)