[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Spaces rather than tabs by a major mode hook
From: |
Tassilo Horn |
Subject: |
Re: Spaces rather than tabs by a major mode hook |
Date: |
Thu, 9 Jun 2022 21:54:27 +0200 (GMT+02:00) |
The TAB key is usually bound to some indentation command such as
indent-according-to-mode. So bind that to some other key and TAB to
self-insert-command.
HTH,
Tassilo
09.06.2022 21:40:26 goncholden <goncholden@protonmail.com>:
>
> ------- Original Message -------
> On Friday, June 10th, 2022 at 7:24 AM, Tassilo Horn <tsdh@gnu.org> wrote:
>
>
>> goncholden goncholden@protonmail.com writes:
>>
>>>>> ((c++-mode
>>>>> (indent-tabs-mode . t)
>>>>> (c-mode
>>>>> (indent-tabs-mode . t)))
>>>
>>> Suppose I have a file with tabs, would the change show the tabs as
>>> spaces? I would rather have the file show as it is. If there are
>>> tabs in the file, would (setq-default indent-tabs-mode nil) show them
>>> as spaces?
>>
>>
>> It doesn't affect how tabs/spaces are displayed. It just defines if
>> emacs' indentation commands may insert tabs. Even with indent-tabs-mode
>> set to nil, you can still manually insert a TAB using C-q TAB.
>>
>> If you want to convert a file from/to tabs, you can use the commands
>> tabify and untabify.
>>
>> Bye,
>> Tassilo
>
> Makes sense but I find it somewhat complicated.
>
> It works well if I press return and get indentation with spaces. But if
> someone presses the tab key, why does it not accept that tab?
>
> I would like to be able to introduce a tab with the tab key but indent with
> spaces.
- Re: Spaces rather than tabs by a major mode hook, (continued)
- Re: Spaces rather than tabs by a major mode hook, goncholden, 2022/06/09
- Re: Spaces rather than tabs by a major mode hook, Yuri Khan, 2022/06/09
- Re: Spaces rather than tabs by a major mode hook, Emanuel Berg, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, goncholden, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, Eli Zaretskii, 2022/06/11
- Re: Spaces rather than tabs by a major mode hook, goncholden, 2022/06/09
- RE: [External] : Re: Spaces rather than tabs by a major mode hook, Drew Adams, 2022/06/09
- RE: [External] : Re: Spaces rather than tabs by a major mode hook, Drew Adams, 2022/06/09
- Re: Spaces rather than tabs by a major mode hook, Tassilo Horn, 2022/06/09
- Re: Spaces rather than tabs by a major mode hook, goncholden, 2022/06/09
- Re: Spaces rather than tabs by a major mode hook,
Tassilo Horn <=
- Re: Spaces rather than tabs by a major mode hook, Eli Zaretskii, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, goncholden, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, Po Lu, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, goncholden, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, tomas, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, Eli Zaretskii, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, goncholden, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, Eli Zaretskii, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, goncholden, 2022/06/10
- Re: Spaces rather than tabs by a major mode hook, Eli Zaretskii, 2022/06/10