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

indenting constant blocks without the staircase effect? #32

Open
ldeck opened this issue Apr 28, 2016 · 2 comments
Open

indenting constant blocks without the staircase effect? #32

ldeck opened this issue Apr 28, 2016 · 2 comments

Comments

@ldeck
Copy link

ldeck commented Apr 28, 2016

I'm using cperl-mode 6.2 with GNU Emacs 24.5.1 (x86_64-apple-darwin15.0.0, NS apple-appkit-1404.11), using prelude starter kit.

A constant block like this:

use constant {
  ONE => 1,
  TWO => 2
};

is formatted like this by cperl:

use constant {
  ONE => 1,
    TWO => 2
  };

I have the following settings:

(defun my-cperl-mode-defaults ()
  (setq cperl-close-paren-offset -2
        cperl-close-brace-offset -2
        cperl-continued-statement-offset 2
        cperl-continued-brace-offset 2
        cperl-fix-hanging-brace-when-indent t
        cperl-indent-level 2
       cperl-indent-parens-as-block t
       cperl-tabs-always-indent t)

  (setq cperl-hairy)
  )

(setq prelude-cperl-mode-hook 'my-cperl-mode-defaults)
(add-hook 'cperl-mode-hook (lambda ()
                             (run-hooks 'prelude-cperl-mode-hook)) t)

This problem seems to have been noted here.

Has it been fixed in a later version? Is there a workaround?
Thanks!

@renormalist
Copy link
Collaborator

I don't think it is already fixed, as I remember it annoyed me too. If you could take this cperl-mode.el here and prepare the patch from stoackoverflow into a github pull request I am happy to apply it.

@renormalist
Copy link
Collaborator

Any contributors? Looks like a doable task, yet I don't have the energy to do and verify...

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

No branches or pull requests

2 participants