all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>
Cc: Eric Lilja <mindcooler@gmail.com>, Emacs Devel <emacs-devel@gnu.org>
Subject: Re: A bad indentation made by C
Date: 22 Apr 2007 14:02:26 +0200	[thread overview]
Message-ID: <20070422132250.GA2402@muc.de> (raw)
In-Reply-To: <462B46D9.3050003@gmail.com>

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 <http://php-mode.sourceforge.net/>

> 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)

  reply	other threads:[~2007-04-22 12:02 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 [this message]
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
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=20070422132250.GA2402@muc.de \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --cc=mindcooler@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.