[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TAB button behavior in C mode and PHP mode
From: |
PJ Weisberg |
Subject: |
Re: TAB button behavior in C mode and PHP mode |
Date: |
Wed, 15 Dec 2010 14:38:55 -0800 |
> On Dec 9, 5:15 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
>> The direct answer is: C-q TAB
>> C-q is a very convenient command that's worth knowing.
C-q, in fact, will literally insert ANY character, including
characters like ESC and backspace. Very handy sometimes, indeed.
On 12/14/10, Alexander Stepanov <darkdrip@gmail.com> wrote:
> On Dec 9, 5:15 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
>> > When I edit code in C mode or PHP mode and make additional indentation
>> > using TAB Emacs doesn't input this tabs.
>>
>> The direct answer is: C-q TAB
>> C-q is a very convenient command that's worth knowing.
>>
>> The longer answer is that there are usually two cases:
>> - the indentation you want corresponds to a different indentation style,
>> in which case you should try and see if you con configure the major
>> mode so as to indent the way you like it. If you can't, then maybe
>> you should report it as a bug to the major mode's maintainer.
>>
>> - the indentation you want does not correspond to a particular style,
>> but is due to particular circumstances at this precise location (or
>> in other words, it does correspond to a particular style, but there's
>> little hope to make Emacs understand this style). In that case, you
>> want C-q TAB (or use SPC which works wonders as well :-).
>>
>> In some major modes (the ones using SMIE), you can tell the major mode
>> that the indentation you've setup on a particular line should be trusted
>> as gospel. For SMIE based modes, you do that by adding a special
>> comment at the end of that line like /* fixindent */. For one-off
>> occurrences it can be convenient.
>>
>> Stefan
>
> Thanks. You solution is better. Torsten's method breaks TAB button
> behavior in other parts of Emacs.
>
--
-PJ