introduce php-template-compatility

avoid all the stuff to deal with html when you know that you only use
php-mode only for plain php scripts

Signed-off-by: Eric James Michael Ritz <lobbyjones@gmail.com>
Describe php-template-compatibility in the README

Signed-off-by: Eric James Michael Ritz <lobbyjones@gmail.com>
Update php-mode-modified for the php-template-compatibility change
Merge branch 'fxbois/php-template-compatibility'

* fxbois/php-template-compatibility:
  Update php-mode-modified for the php-template-compatibility change
  Describe php-template-compatibility in the README
  introduce php-template-compatility
Added gitignore with *.elc

Signed-off-by: Eric James Michael Ritz <lobbyjones@gmail.com>
Add James Laver to the list of contributors
README: Correct the documentation for chained-method call alignment

The current documentation says that PHP Mode only tries to guarantee
proper alignment when using one of three coding styles:

1. WordPress
2. Drupal
3. Pear

However, Michael Dwyer’s recent addition of a Symfony2 coding style is
another which should perform proper alignment.  So instead of
explicitly listing each coding style it is better to make note in the
README that chained-method call alignment is only a guarantee when
using the styles described under the ‘Coding Styles’ section.  This
way additions of new coding styles in the future will not require any
further changes to this part of the README.
Make `with-php-mode-test` aware of the Symfony2 coding style

GitHub-Issue: 94
Add a full copy of the license

The README links to an online copy, and comments in the source code
describe the license, but I’d rather be as explicit as possible.
Introduce ‘C-c C-w’ to toggle Subword Mode

Programmers who use cameCase may prefer to use Subword Mode. The keys
‘C-c C-w’ exist in cc-mode, performing the exact same behavior.
Because we have gradually move towards using cc-mode as the foundation
of new features it seems reasonable to introduce this change.

The source code contains a URL to the official GNU Emacs manual here
it explains exactly what Subword Mode does.

GitHub-Issue: 89
Document Subword Mode in the README

The README briefly explains the purpose of Subword Mode, linking to
the official manual for more information.  PHP Mode does not enable
Subword Mode by default.  So the README describes two ways to use it:

1. We can add a hook to PHP Mode that enables Subword Mode.  The
README demonstrates an example of this.

2. We can toggle the minor mode on and off by using ‘C-c C-w’ in PHP
Mode (and other modes based on cc-mode).

Adding (global-subword-mode t) to an Emacs config file will enable
Subword Mode for all buffers.  The README omits this third method
because, based on personal experience, I do not want the mode
affecting every buffer and file I use.  Instead I find it easier to
setup a hook or toggling the mode, as described in the README.

GitHub-Issue: 89
Merge branch 'ejmr/subword-mode'

* ejmr/subword-mode:
  Document Subword Mode in the README
  Introduce ‘C-c C-w’ to toggle Subword Mode
Fix indentation of statements after ‘foreach’ without braces

PHP Mode fails to indent the following code:

    foreach ($x as $s)
        echo $s;

It does not indent the second line if there are no braces following
the ‘foreach’.  Commit 89eefdf7 previously fixed this problem but a
regression happened when making changes to all of the indentation
styles.  Each CC Mode style that PHP Mode provides defines a value for
‘statement-cont’.  That controls the second line in the example.

We changed ‘statement-cont’ in the three original styles to use the
lineup function ‘c-lineup-cascaded-calls’ because that tells PHP Mode
to properly indent cascaded method calls, e.g.:

    foreach ($x as $s)
        echo $s->foo()
               ->bar();

However, changing the value of ‘statement-cont’ broke indentation for
the first example.  We address this problem by redefining
‘statement-cont’ in every style except ‘Symfony2’.  Each style
attempts to first use ‘c-lineup-cascaded-calls’ when indenting a line
that falls under the control of ‘statement-cont’, but if that returns
nil, which happens in the first ‘foreach’ above, then the style
defaults to indenting by ‘c-basic-offset’.  In other words, we first
attempt to align the code as a chained method, and failing that we
simply indent it normally.

This patch omits any change to the ‘Symfony2’ style because it uses a
different function for ‘statement-cont’ than all of the rest and will
require separate testing and modification.

Finally, this patch also introduces a unit-test for this problem so
that we can avoid future regressions.  The test contains the first
example in the commit message and makes sure that PHP indents the
second line by the value described by ‘c-basic-offset’.

GitHub-Issue: 99
Merge branch 'master' of https://github.com/ejmr/php-mode

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.