help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to change Perl mode indentation to two spaces and no tabs?


From: Kenneth Wolcott
Subject: Re: How to change Perl mode indentation to two spaces and no tabs?
Date: Mon, 15 Jun 2015 12:58:07 -0700

On Mon, Jun 15, 2015 at 12:47 PM, John Mastro <john.b.mastro@gmail.com> wrote:
>>   I like the syntax highlighting and the formatting (in general) of
>> the perl mode, I just want multiples of two spaces for indentation
>> rather than multiples of  four.
>
> Then it looks like you'll want something like:
>
>     (defun my-init-perl-mode ()
>       (setq perl-indent-level 2
>             perl-continued-statement-offset 2
>             perl-continued-brace-offset -2))
>
>     (eval-after-load 'perl-mode
>       '(add-hook 'perl-mode-hook #'my-init-perl-mode))
>
> See `C-h f perl-mode RET' for more information on those, and other,
> options. I based the above on the "LW" style (the default) with every 4
> replaced by a 2.
>
> --
> john

Thanks, John!

I did as you suggested, looking at the built-in help for perl-mode.

I'm now experimenting with these lines in my ~/.emacs file.

Well, initial experiments still show that the default perl-mode still
seems to override what I have in the ~/.emacs file, as the four-space
indentation is still occurring.

I'm still googling for this as well; haven't found the right info yet.

Thanks,
Ken Wolcott



reply via email to

[Prev in Thread] Current Thread [Next in Thread]