From: Dan Espen <despen@verizon.net>
To: help-gnu-emacs@gnu.org
Subject: Re: How to change Perl mode indentation to two spaces and no tabs?
Date: Mon, 15 Jun 2015 16:10:35 -0400 [thread overview]
Message-ID: <mlnbdd$phq$1@dont-email.me> (raw)
In-Reply-To: mailman.5060.1434398291.904.help-gnu-emacs@gnu.org
Kenneth Wolcott <kennethwolcott@gmail.com> writes:
R> 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.
Make sure you are in perl-mode.
You could be in cperl-mode.
(Look at your mode line while editing a Perl file.)
Then set either perl-indent-level or cperl-indent-level in a hook as
shown above.
The technique above is going to require an Emacs restart to take effect.
Stilll having issues?
Add a message to the defun to verify that the defun is being run:
(message "defun has run")
--
Dan Espen
next prev parent reply other threads:[~2015-06-15 20:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.5054.1434389545.904.help-gnu-emacs@gnu.org>
2015-06-15 18:27 ` How to change Perl mode indentation to two spaces and no tabs? Emanuel Berg
2015-06-15 19:17 ` Kenneth Wolcott
2015-06-15 19:47 ` John Mastro
2015-06-15 19:58 ` Kenneth Wolcott
[not found] ` <mailman.5060.1434398291.904.help-gnu-emacs@gnu.org>
2015-06-15 20:10 ` Dan Espen [this message]
2015-06-15 20:53 ` Kenneth Wolcott
[not found] ` <mailman.5061.1434401625.904.help-gnu-emacs@gnu.org>
2015-06-15 22:51 ` Emanuel Berg
2015-06-15 23:48 ` Kenneth Wolcott
[not found] ` <mailman.5067.1434412130.904.help-gnu-emacs@gnu.org>
2015-06-16 0:48 ` Emanuel Berg
2015-06-17 3:55 ` Robert Thorpe
2015-06-15 16:38 Kenneth Wolcott
2015-06-16 7:28 ` tomas
2015-06-16 13:31 ` Kenneth Wolcott
[not found] ` <mailman.5082.1434439741.904.help-gnu-emacs@gnu.org>
2015-06-16 21:48 ` Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='mlnbdd$phq$1@dont-email.me' \
--to=despen@verizon.net \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.