From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nerius Landys Newsgroups: gmane.emacs.help Subject: Re: [emacs] tabs, spaces, and indentation Date: Fri, 8 Oct 2010 15:12:05 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016363b91640460700492224de5 X-Trace: dough.gmane.org 1286575965 28926 80.91.229.12 (8 Oct 2010 22:12:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Oct 2010 22:12:45 +0000 (UTC) Cc: help-gnu-emacs To: PJ Weisberg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 09 00:12:44 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P4LB8-0000BP-EM for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Oct 2010 00:12:38 +0200 Original-Received: from localhost ([127.0.0.1]:50591 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4LB7-0007BC-RT for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Oct 2010 18:12:37 -0400 Original-Received: from [140.186.70.92] (port=58721 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4LAf-0007Ac-4T for Help-gnu-emacs@gnu.org; Fri, 08 Oct 2010 18:12:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4LAc-0006nl-Ht for Help-gnu-emacs@gnu.org; Fri, 08 Oct 2010 18:12:09 -0400 Original-Received: from mail-qw0-f41.google.com ([209.85.216.41]:36936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4LAc-0006ne-Ej for Help-gnu-emacs@gnu.org; Fri, 08 Oct 2010 18:12:06 -0400 Original-Received: by qwb8 with SMTP id 8so190334qwb.0 for ; Fri, 08 Oct 2010 15:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=QMRJH5n/vvDmFvQU7JDIMp3aZunJXOrZRf1Ig6KF29c=; b=u1WAFALNf4KOhRPGx0iJ4hZJAiiqjjfx49XpvyeW/9nZj2JGxuP4W1kH4T+10WwObP 0osi3LDGNwjwtTnJtARhBN3TAa5fB5VccnMZkldXnh0ghZpBZ8/GjOv+eNseGhMcpTDk Bjuz8X3FfuiHKPI+KxjaFcqdqkYeLawj17y4o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=vxFWIyte7KSawmGrntMYju4wnm7lB+QCl4G8+UBkQ5r9OJngNKNFaRjJxK3RDQoeF4 tkOCDaJppNX0yzAXXXizLx4tRNKdeovey2XmtaVWH/RVOEBmbJX+D4JhAVaoqmR76IT/ KDXJU6toCEt42pM6dFTicCjGrS0mF640zY5hk= Original-Received: by 10.229.223.210 with SMTP id il18mr2493173qcb.133.1286575925518; Fri, 08 Oct 2010 15:12:05 -0700 (PDT) Original-Received: by 10.229.52.17 with HTTP; Fri, 8 Oct 2010 15:12:05 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75099 Archived-At: --0016363b91640460700492224de5 Content-Type: text/plain; charset=ISO-8859-1 > > > > 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 > punctuation.) > > 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. --0016363b91640460700492224de5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


> Setting indent-line-function and indent-region-function doesn't se= em
> 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 maj= or 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. =A0You can always insert a<= br> > literal tab with C-q Tab.
>
> Dunno what to do about #2. =A0The 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 a= fter
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. =A0(Personally, I'd also prefer it to be off. =A0I ca= n press
TAB when I want the line indented in the standard way. =A0If I indented
it differently I don't want it changed because I fixed some
punctuation.)

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. =A0You can "fix" those by rebinding them to
'self-insert-command, just like you can with TAB.


Wow sounds like Em= acs is becoming too intelligent.=A0 Kind of like that old version of Micros= oft Word.

--0016363b91640460700492224de5--