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

Alan Mackenzie wrote:
> Hi, Lennart!

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

Well everyone knows my bug reporting skills ;-)

Yes, you are right, but I actually hoped that you should guess the right 
things.


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

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?


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


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

I have uploaded the slightly changed version here:

   http://ourcomments.org/Emacs/DL/elisp/

Otherwise it is part of nXhtml. There are some problem with my webhost 
right now so it may be difficult to retrieve it. Mail me if you want it.

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

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