[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: indentation (Indent More)
From: |
Robert Thorpe |
Subject: |
Re: indentation (Indent More) |
Date: |
Sun, 19 Jul 2015 01:34:17 +0100 |
"Russ P." <russ.paielli@gmail.com> writes:
> On Wednesday, July 15, 2015 at 1:34:38 PM UTC-7, Bobby Casey wrote:
>> On Sun, Jul 12, 2015 at 2:03 AM, Russ P. <russ.p@gmail.com> wrote:
>> > I recently decided to decrease my indentation from 4 spaces to 2 spaces
>> > (as recommended for Scala). I have the following in my .emacs file:
>> >
>> > (global-set-key "\t" 'tab-to-tab-stop) ; "normal" tab key
>> > (setq tab-stop-list '(2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36))
>> > (setq-default indent-tabs-mode nil)
>> > (setq-default tab-width 2)
>> >
>> > It works fine, but when I try to use
>> >
>> > Edit/Text Properties/Indentation/Indent More
>> >
>> > it still adds 4 spaces. How can I change that to 2 spaces? Thanks
>> >
>>
>> According to the help for `increase-left-margin' the variable
>> `standard-indent' is used to specify spacing. Setting that to 2
>> should fix the issue.
>>
>> As an aside, are you sure you want two spaces for everything rather
>> than just in scala-mode?
>
> I only want it in scala-mode, but I don't really care enough to bother
> changing it unless there is a dirt-simple way to do it. Thanks for the
> help.
Look in the scala-mode documentation.
There are two aspects to tabs:
* How a tab character is displayed.
This is controlled by the variable tab-width. Usually in a programming
mode, the only way you can insert a tab character is with C-q TAB or C-q
C-i though. By default Emacs binds TAB to a command.
* What pressing tab inserts.
If a mode doesn't have an indentation convention then this is defined by
tab-stops-list and tab-to-tab-stop. If the mode does have an
indentation convention then that takes over and it's defined by a mode
specific variable.
So, Your editing of tab-stops-list, tab-to-tab-stop doesn't help you.
Editing tab-width only helps if scala-mode is inserting tabs and it's
probably inserting spaces. So, check scala-mode's sources.
I couldn't even find scala-mode on the web, only scala-mode2.
BR,
Robert Thorpe