[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to make c-indent-line-region respect indent-tabs-mode when it's
From: |
Hong Xu |
Subject: |
Re: How to make c-indent-line-region respect indent-tabs-mode when it's already aligned? |
Date: |
Sat, 30 May 2015 15:48:42 -0700 |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Hong Xu <hong@topbug.net>
>> Date: Sat, 30 May 2015 01:28:13 -0700
>>
>> Currently it seems that c-indent-line-region ignores the value of
>> indent-tabs-mode. For example, I have the following in a buffer
>>
>> int main()
>> {
>> <Tab>int x;
>> }
>>
>> and my indent-tabs-mode is nil. If 8 spaces is what expected, calling
>> c-indent-line-or-region would do nothing. However, if it's not aligned
>>
>> int main()
>> {
>> <Tab> int x;
>> }
>>
>> calling c-indent-line-or-region would correct the tab with appropriate
>> number of spaces.
>>
>> Is there a different line indentation function which respects
>> indent-tabs-mode even the line is already aligned?
>
> You are using the wrong command. You should use untabify to convert
> tabs to spaces, or tabify to do the opposite.
Thanks. Is there a single command to do formatting though? I think
people want to format the line more than simply "indent" the line.
Hong
signature.asc
Description: PGP signature