unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: TAB button behavior in C mode and PHP mode
       [not found] ` <jwv62v39ea6.fsf-monnier+gnu.emacs.help@gnu.org>
@ 2010-12-14 11:56   ` Alexander Stepanov
  2010-12-15 22:38     ` PJ Weisberg
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Stepanov @ 2010-12-14 11:56 UTC (permalink / raw)
  To: help-gnu-emacs

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: TAB button behavior in C mode and PHP mode
  2010-12-14 11:56   ` TAB button behavior in C mode and PHP mode Alexander Stepanov
@ 2010-12-15 22:38     ` PJ Weisberg
  0 siblings, 0 replies; 2+ messages in thread
From: PJ Weisberg @ 2010-12-15 22:38 UTC (permalink / raw)
  To: help-gnu-emacs

> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-15 22:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <7dd2f48c-e5b0-461a-b88f-d9d18ce54e00@a17g2000yql.googlegroups.com>
     [not found] ` <jwv62v39ea6.fsf-monnier+gnu.emacs.help@gnu.org>
2010-12-14 11:56   ` TAB button behavior in C mode and PHP mode Alexander Stepanov
2010-12-15 22:38     ` PJ Weisberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).