What is a more sane, automatic solution to tabbing my code by 4 spaces for a bunch of files? How do I make sure that tabify does not affect perldoc?
views:
341answers:
4
+4
A:
Well, you'll need this
(setq-default tab-width 4)
Then
C-x h
M-x indent-region
This sounds very similar to this other stack overflow question.
Trey Jackson
2009-08-18 22:53:08
you mean tab-width of 4 right?
Kys
2009-08-18 22:58:18
Duh, thanks.
Trey Jackson
2009-08-18 23:14:37
It seems to not intepret perldoc effectively causing the =<something> to be indented as well
Kys
2009-08-18 23:21:30
Correct, I can't find anything others have written which handles indentation ignoring perldoc (or at least treating it special). Kind of surprising...
Trey Jackson
2009-08-19 18:50:03
A:
You should look up the documentation for the mode you are using (e.g. Lisp mode, C mode, Perl mode) for setting up the desired indentation and for reindenting a region (e.g. in SLIME, this is done with C-M-\
).
Svante
2009-08-18 23:01:23
+2
A:
I had massive issues with this: This is the solution I came up with for a 3-spaces rule.
;;;; Tab settings ;;;;
;Tab width is 3
(setq tab-width 3)
;Tab width is 3 by default..
(setq-default tab-width 3)
;Use spaces always.
(setq indent-tabs-mode nil)
;Jump by 3.
(setq c-basic-offset 3)
;this defaulted to 4 and had to be reset to 3.
(setq perl-indent-level 3)
;Tab stop list out to col 60
;Manually set by x3
(setq tab-stop-list '(3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60))
Paul Nathan
2009-08-18 23:28:04
A:
My cperl-mode seems to indent (or rather, not indent) POD fine, as long as it has a newline before the =head1
or =pod
. perlpod
says:
Without that empty line before the "=head1", many translators wouldn't have recognized the "=head1" as starting a Pod block.
jrockway
2009-08-19 18:23:09