Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More improvements on cc-mode based font locking #167

Merged
merged 8 commits into from
Aug 31, 2014

Conversation

jorissteyn
Copy link
Contributor

I managed to get the rough edges off the experimental branch and fix a few existing bugs along the way. I think most of them can be backported relatively easy regardless of using the cc-mode changes, lets discuss in issue #66.

The following issues seem to be fixed in this branch while still broken on master: #143, #138, #135, #130, #128, #100, #49.

php-extra-constants and web-mode-extra-php-constants can be used to
define additional symbols as constant, but this now only makes sense for
lower or camel-cased constants

Ideally we'd implement this using the cc-lang constructs but
c-constant-kwds does not allow user customization (c-lang-defconst). For
identifier keywords cc-mode has the *-extra-types variables but this
does not work for constant keywords.
All identifiers are recognized as words in cc-mode/php-mode, so special
care is taken to have our custom highlighting pattern for variable names
not include the separator.
Issue emacs-php#9 is not fixed (and expected to fail) but because of the
different highlighting of unmatched string delimiters in the cc-mode
branch the test passed. This commit makes the assertion more specific so
it fails again.
Related to issue-115, added test case
Those two were removed in the first cc-mode conversion commit. Below a
short summary of the styles and how I intend them to behave in this
branch.

Drupal: Sets indentation to two spaces, some indentation tweaks. Does
automatic removal of trailing whitespace.

Wordpress: Indentation tweaks and tab-width of four spaces.

PSR2, Symfony2 and PEAR: They are basically the same. The Symfony2 style
allows the unofficial 'hanging semicolon' behaviour. PEAR is the
default. I think it would be better for php-mode to just forget about
PEAR, drop Symfony2 as a style (the framework uses PSR-2) and use PSR-2
as default. The hanging semicolon could be a configurable option,
independent of the style in effect.

This commit fixes the failing test on whitespace removal (issue 53).
@ejmr ejmr merged commit 2468dc3 into emacs-php:cc-mode-conversion Aug 31, 2014
@ejmr
Copy link
Collaborator

ejmr commented Aug 31, 2014

Thanks for keeping up the great work! I've updated the cc-mode-conversion branch with all of these patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants