Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#70 dirname(__FILE__).'/subpath' breaks indentation

open
nobody
Indentation (6)
5
2009-06-18
2009-06-18
David
No

On a project I work on the following code is common but php-mode can't tab it correctly (at least with my config and emacs22/php-mode-1.5).

<?php
$somepath = dirname(__FILE__).'/subpath';
// this line always indents incorrectly
?>

Any ideas why it's getting tabbed all the way up to the dot?

Discussion

  • alone 1998 company study available

     
  • Yup, same exact problem I have (ubuntu 9.10). Everything below dirname() gets messed up on the indenting.

     
  • Tim Macinta
    Tim Macinta
    2010-07-27

    This bug might actually be a little worse than described. For me at least, the indentation is messed up on for all lines below the "somepath" line rather than just the first line, at least until a different block is reached. I'm experiencing the problem on OS X with Emacs 23.2.1.

    One workaround that I found was to add some parentheses:

    $somepath = (dirname(__FILE__)).'/subpath';

    or:

    $somepath = (dirname(__FILE__).'/subpath');