[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs] tabs, spaces, and indentation

From: Nerius Landys
Subject: Re: [emacs] tabs, spaces, and indentation
Date: Fri, 8 Oct 2010 15:12:05 -0700

> Setting indent-line-function and indent-region-function doesn't seem
> to do a damn thing, but (local-set-key "\t" 'self-insert-command)
> works for #1 when it's called after you've switched to the major mode
> you're using.
> Also, if you configure tab-always-indent to nil Tab will only indent
> if the cursor is at the start of the line.  You can always insert a
> literal tab with C-q Tab.
> Dunno what to do about #2.  The help docs lead me to believe setting
> indent-line-function and indent-region-function is the answer, but
> like I said those don't seem to do anything.

I guess there isn't an easier way to do it, because a few hours after
I wrote this somebody posted a proposal on emacs-devel for making #2
easier to turn on and off, because right now every major mode does it
it's own way.  (Personally, I'd also prefer it to be off.  I can press
TAB when I want the line indented in the standard way.  If I indented
it differently I don't want it changed because I fixed some

Anyway, I've discovered that c-mode binds certain keys (semicolor,
comma, etc) to functions that indent the line in addition to inserting
a character.  You can "fix" those by rebinding them to
'self-insert-command, just like you can with TAB.

Wow sounds like Emacs is becoming too intelligent.  Kind of like that old version of Microsoft Word.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]