HEREDOC friendly php-mode for Emacs?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

HEREDOC friendly php-mode for Emacs?

Post by nielsene »

Does anyone know of a HEREDOC friendly php-mode for Emacs? I've been converting to HEREDOCs for most XHTML output or SQL query construction in my PHP code and am getting tired of the way the basic PHP-mode for Emacs really screws up the indenting and such.

My "dream" formatting would be that all lines after the <<<LABEL would be pushed un-touched by the auto-formatter so I can embed appropriate spacing. The formatter should pick up on the line after LABEL; at the same level as the initial assignment.

Current behavoir of php-mode is to indent the first line after the assignment to the same level as the assignemnt, and each following line two spaces further over (normal line-continuation format). As a result the LABEL; ending doesn't fall in zeroth column and as such won't end the HEREDOC. I can go back and manually remove the wrong indentation, but then the following codes lines need t be re-set manually to the correct indentation level.
jsnmtth
Forum Newbie
Posts: 1
Joined: Mon Mar 12, 2012 12:53 pm

Re: HEREDOC friendly php-mode for Emacs?

Post by jsnmtth »

I am encountering the same problem. Did you ever find a solution?
Post Reply