-
Notifications
You must be signed in to change notification settings - Fork 119
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
Non-C-style comments are filled incorrectly #76
Comments
What version of Emacs and php-mode are you using?
The second comment screws up on |
I'm using Aquamacs 2.4, which is built on Emacs 23.3.50.1. My php-mode.el has the following version info in it:
I believe it is current master (I use subtree merging to pull it into my .emacs.d, which is a git repo). |
It is. Thanks for the info. I have no access to a computer which Aquamacs but I'll try getting a friend to see if he can duplicate it. |
I just tried firing up an instance of Emacs 24, freshly downloaded from Emacs for OS X, and in Emacs 24, I see the behavior you describe. So, that difference is probably a discrepancy between Emacs 23 and 24. |
Here's what I've figured out so far, just in case anyone else whats to pitch in. I started looking at the code in But I still feel like some tweaking to the syntax class of |
Thanks very much for looking into this. Maybe looking at C++-mode's innards would help? Filling both /*- and //-style comments works as expected there, so it might give useful hints on how to handle #, too. |
No problem, it's my job. :)
That's a good idea. I'll check it out. |
Maybe a hacky way to approach this would be to see if a fill was triggered on a |
Like |
@NateEag I've found that all three styles of comment can be indented correctly after you evaluate this form: ;; this is the relevant bit, you'll notice it's adding # as a comment start char
(setq-local comment-start-skip "\\(//+\\|#+\\|/[*]\\{1,2\\}\\)\\s *") I'll write a php-mode test and raise a PR this weekend if you're happy with the fix. In the meanwhile you can solve the problem by adding that configuration to your Here's a gif showing the behaviour of Emacs 24.5.1 before and after evaluating the form above: |
@trashofmasters I am not actively using php-mode these days, but thanks for the info. Glad to hear you've found a workaround for this. |
I wasn't aware of this issue, but maybe https://github.com/emacs-php/php-mode/pull/530/files seems to fix this issue. Thanks for reporting! |
You're very welcome. Thanks for your years of faithful maintenance, @zonuexe ! |
Consider the following set of comments:
All three are correctly highlighted as comments by php-mode.
However, if you use Meta-Q to wrap the comments, only the last comment is filled correctly. The first two are wrapped, but no comment prefix is inserted at the beginning of the new lines.
The text was updated successfully, but these errors were encountered: