Comments (9)
BTW, I've started working on this.
from php-mode.
Good idea. Redefining the core of php-mode, particularly how we inform Emacs about the structure of the language, will make it easier to take advantage of things like customizable lineup functions in cc-mode. It also feels like a good direction to go in terms of making the codebase more consistent in structure. After all, php-mode is going on fourteen years now, and lots of people have worked on it, and we certainly haven't all been consistent in the way we've implemented things. And in all those years Elisp and standard libraries have improved as well, like ERT, things we ought to leverage in our favor. So I like this idea a lot, using more of cc-mode.
from php-mode.
I'm getting closer! It seems like most fontification can be done with trivial
definitions of php-font-lock-keywords-*
, which means the cc-mode
machinery
is doing something right.
On my current branch, here are the definitions of the php-font-lock-keywords-*
variables:
(defconst php-font-lock-keywords-1 (c-lang-const c-matchers-1 php)
"Basic highlighting for PHP mode.")
(defconst php-font-lock-keywords-2 (c-lang-const c-matchers-2 php)
"Medium level highlighting for PHP mode.")
(defconst php-font-lock-keywords-3 (c-lang-const c-matchers-3 php)
"Detailed highlighting for PHP mode.")
(defvar php-font-lock-keywords php-font-lock-keywords-3
"Default expressions to highlight in PHP mode.")
Indentation still needs some work, but is mostly there.
from php-mode.
Awesome, thanks for the work. :)
from php-mode.
After playing around with haxneys changes, I believe this is an excellent course of direction. I rerolled the original changes on current php-mode and made some fixes to make it pass the test suite.
In case anyone's interested: https://github.com/jorissteyn/php-mode/tree/work/ccmode
It seems to work really well, but I still have some fixes upcoming -- if only PHP had chosen :: as namespace separator :). Feedback is very welcome!
from php-mode.
Great submission :)
I pushed it in a new branch for people to test and mentioned that in the README.
Thanks for the effort!
from php-mode.
Great idea to mention this experiment in the README, but if it's not on master, the only people who will read it are the people that already know about it :)
from php-mode.
Great point. I'm in such a habit of looking at all the different branches that people not doing that honestly didn't cross my mind at the time. I've copied the mention into the README on the master
branch.
from php-mode.
As discussed in PR #168, the hard require 'cl I added to get this branch pass CI is bogus. It should work with:
(unless (require 'cl-lib nil t)
(require 'cl))
But I don't know what difference between master and the cc-mode branch causes this, I'm not calling set-difference anywhere in php-mode/php-mode-test.
Error output: https://travis-ci.org/jorissteyn/php-mode/jobs/34121887
from php-mode.
Related Issues (20)
- (define-key map [tab] 'indent-for-tab-command) is a bug HOT 2
- Text inside Heredoc breaks indentation.
- Syntax highlighting for SQL strings HOT 2
- Please tag release (prerelease or beta is ok) for Emacs 28 compatibility HOT 1
- Error in ternary operator indentation HOT 1
- Unexpected syntax highlights after "new" in string HOT 1
- Automatic, overly-clever brace-matching is annoying and how to turn it off is non-obvious HOT 2
- Function faces HOT 1
- Commented out array elements break indentation HOT 2
- Drop Emacs 25 Support
- WordPress coding style removing spaces around function args HOT 1
- The last argument of the method is not highlighted
- PEAR method chaining wrong indentation HOT 5
- File mode specification error HOT 5
- Indentation issue with closure/anonymous functions
- Lineup Cascaded Calls doesn't work properly
- emacs master results in error HOT 2
- Drop Emacs 26 Support
- Newline Indentation aligning with equal sign HOT 3
- while keyword says 'At top level' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-mode.