#16 function &name() Indentation Problem

closed
None
5
2008-10-17
2008-06-06
sonots
No

When I write a code as
<?php
function name()
{
$a = 'a';
return $a;
}
function &name()
{
$a = 'a';
return $a;
}
?>
php-mode.el indents as
<?php
function name()
{
$a = 'a';
return $a;
}
function &name()
{
$a = 'a';
return $a;
}
?>
I believe correct indentation is as follows:
<?php
function name()
{
$a = 'a';
return $a;
}
function &name()
{
$a = 'a';
return $a;
}
?>

My emacs is NTemacs (GNU Emacs 22.0.50.1)
php-mode.el version is 1.4.0.

Discussion

  • That would make it a bug. However, I'm not seeing the brace after a function with an ampersand being indented as I believe you're reporting.

    I'd suggest taking a look at your setting for c-offsets-alist. While visiting a PHP file, run `M-x customize-variable RET c-offsets-alist RET' and make sure the setting for `defun-open' is 0.

     
    • assigned_to: nobody --> ashawley
    • status: open --> closed