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
Indenting of curly braces #114
Comments
You can customize Would you mind please typing your example in a file and then pasting the full output of |
Thanks for your reply, @ejmr. Here's the requested output:
Forgot to mention that I get exactly the same result when starting emacs without a site file ( |
Just tried it with the latest commit from your repository and get exactly the same result (build 2013-06-09). |
Thank you for the information. I am going to spend some time today trying to fix this. |
How about your Emacs version from I am using GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.17). If I start it via |
Emacs version I'm using is:
But your tip on using What do you think php-mode is doing wrong? |
Off the top of my head I am not sure what PHP Mode may be doing wrong. We define various CC Mode styles specifically for PHP so I am going to double-check the code for them to make sure they are not stomping over user settings. In the mean time you could use this in your dot-emacs file: (add-hook 'php-mode-hook (lambda () (c-set-style "linux"))) This is what I use and it's never caused me any problems. But I'm still going to double-check all of the PHP Mode changes related to |
Ok, Eric. Wish I could help tracking down this bug. Many thanks for the assistance! |
Oh. Just been hacking on In my case its value is set to (cond ((eq php-mode-coding-style 'pear)
(php-enable-pear-coding-style)
(run-hooks 'php-mode-pear-hook))
((eq php-mode-coding-style 'drupal)
(php-enable-drupal-coding-style)
(run-hooks 'php-mode-drupal-hook))
((eq php-mode-coding-style 'wordpress)
(php-enable-wordpress-coding-style)
(run-hooks 'php-mode-wordpress-hook))
((eq php-mode-coding-style 'symfony2)
(php-enable-symfony2-coding-style)
(run-hooks 'php-mode-symfony2-hook))) Simply setting |
Nice find. That is the problem. I never noticed it since the hook I use from the post above always runs after that Thanks for both finding the bug and the solution. |
Setting
This if (test) { exit; } becomes this (i.e.no identation) if (test) { exit; } |
Thanks for the information. Sorry about the slow response, I have simply been busy with other things. But I still intend to have a new version of PHP Mode out soon and will work to fix this for that release. |
I can't seem to get
php-mode
to indent curly braces correctly. For instance, if the intended result is:if(expression) { statement; }
... I always get:
This with
c-default-style
set tolinux
andc-basic-offset
to 2.I've had a look in the
php-mode
group searching for any customizations that might affect brace indentation but didn't find any.This can't be a bug: what am I missing?
The text was updated successfully, but these errors were encountered: