From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: How to change Perl mode indentation to two spaces and no tabs?
Date: Tue, 16 Jun 2015 00:51:48 +0200 [thread overview]
Message-ID: <877fr4pou3.fsf@debian.uxu> (raw)
In-Reply-To: mailman.5061.1434401625.904.help-gnu-emacs@gnu.org
Kenneth Wolcott <kennethwolcott@gmail.com> writes:
> It does says "(Perl)" on the mode line, but even
> with the most recent idea submitted here (I love the
> support!) the indentation is still by multiplies of
> four spaces, not two spaces. I did exit emacs and
> come back in.
As for the tab width, my initial suggestion doesn't do
what you want.
As for tabs (instead of spaces), I don't get tabs,
even with
emacs -Q file.pl
Are you sure you get tabs?
Also, this works for me:
(defun my-init-perl-mode ()
(setq perl-indent-level 2)
(setq perl-continued-statement-offset 2)
(setq perl-continued-brace-offset -2) )
;; (my-init-perl-mode)
;; ^ evaluate here
And I don't need to restart Emacs to get it to work!
However I can think of one more thing.
After evaluating (my-init-perl-mode), say that you
have a piece of Perl like this:
sub setup_db {
print BOLD, RED, " Type ", YELLOW, "y", RED, " to reset database: ", RESET;
open(my $in, "<-") or die "setup_db: cannot open stdin.\n";
If you put point on the second line and hit TAB, it
will work. If you put point on the third line and hit
TAB, it won't work because it will look at the line
above for alignment.
--
underground experts united
http://user.it.uu.se/~embe8573
next prev parent reply other threads:[~2015-06-15 22:51 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
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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877fr4pou3.fsf@debian.uxu \
--to=embe8573@student.uu.se \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).