GNU bug report logs - #880
23.0.60; c-mode indentation and php

Previous Next

Package: notemacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Thu, 4 Sep 2008 08:35:02 UTC

Severity: normal

Merged with 877

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 880 in the body.
You can then email your comments to 880 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#880; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: "Lennart Borgman \(gmail\)" <lennart.borgman <at> gmail.com>
Cc: emacs-pretest-bug <at> gnu.org
Subject: Re: 23.0.60; c-mode indentation and php
Date: Thu, 4 Sep 2008 08:33:17 +0000
Hi, Lennart,

On Wed, Sep 03, 2008 at 11:34:04PM +0200, Lennart Borgman (gmail) wrote:
> In php-mode.el (not yet a part of Emacs, but has been discussed for
> inclusion) c-indent-line is used for indentation.

UUURRRKKK!!!

> That works nicely for the php code part of a php template page, but
> there is a disturbing glitch that probably can be fixed.

> Constructs like the one below are rather common.

>    if (1) {
>  ?>
>   ...
>  <?php
>      }

> If you try to indent the line with the single "}" in c-mode it does not
> get aligned with "if (1) {". I have narrowed this down to

>    if (1) {
>  ?php
>      }

> Adding a semicolon after "?php" makes everything work.

Without the semicolon, the close brace is on a "statement continued"
(statement-cont) line.

> Is the current indentation behaviour in this case useful in some way?

Yes.  I'm characterising your "in this case" as "after a line lacking ;
or }".  It's essential to normal C indentation.  E.g.:

    a = b + c // no semicolon
        + d ; // statement-cont (use C-s C-c) gets more indentation. 
	
> Is there some option to change it?

Yes.  Write a PHP-specific function to determine whether a line ends with
a "virtual semicolon", and set `c-at-vsemi-p-fn' to this function.  This
mechanism is used for AWK Mode, and is described in detail in cc-defs.el
(search for "virtual").

> The example came from a bug report/question for nXhtml:

>   https://answers.launchpad.net/nxhtml/+question/43320


> In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
>  of 2008-09-03
> Windowing system distributor `Microsoft Corp.', version 5.1.2600
> configured using `configure --with-gcc (3.4) --no-opt --cflags
> -Ic:/g/include -fno-crossjumping'

-- 
Alan Mackenzie (Nuremberg, Germany).




bug reassigned from package `emacs' to `emacs,cc-mode'. Request was from "Juanma Barranquero" <lekktu <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Thu, 04 Sep 2008 11:20:05 GMT) Full text and rfc822 format available.

Forcibly Merged 877 880. Request was from "Juanma Barranquero" <lekktu <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Thu, 04 Sep 2008 11:20:06 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>, don <at> donarmstrong.com:
bug#880; Package emacs,cc-mode. Full text and rfc822 format available.

Message #12 received at 880 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: lennart.borgman <at> gmail.com
Cc: 880 <at> debbugs.gnu.org
Subject: Re: bug#880: 23.0.60; c-mode indentation and php
Date: Thu, 04 Sep 2008 12:42:04 -0400
If you want to be "helpful" and cc bug reports to people when you file
them, plese use X-Debbugs-CC instead of CC, so that they get a copy
with the bug report number in the address.




bug reassigned from package `emacs,cc-mode' to `php-mode'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Thu, 04 Sep 2008 16:50:09 GMT) Full text and rfc822 format available.

bug reassigned from package 'php-mode' to 'notemacs'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Mon, 30 Nov 2009 21:55:09 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 877 <at> debbugs.gnu.org and "Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 01 Mar 2011 09:01:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 29 Mar 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 87 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.