From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: PJ Weisberg Newsgroups: gmane.emacs.help Subject: Re: [emacs] tabs, spaces, and indentation Date: Wed, 6 Oct 2010 21:22:34 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1286425387 24519 80.91.229.12 (7 Oct 2010 04:23:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Oct 2010 04:23:07 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Nerius Landys Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 07 06:23:06 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 1P3i0Y-0004vj-74 for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Oct 2010 06:23:06 +0200 Original-Received: from localhost ([127.0.0.1]:45690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3i0X-00057w-DP for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Oct 2010 00:23:05 -0400 Original-Received: from [140.186.70.92] (port=42526 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3i07-00057j-6b for help-gnu-emacs@gnu.org; Thu, 07 Oct 2010 00:22:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P3i06-0002FL-7A for help-gnu-emacs@gnu.org; Thu, 07 Oct 2010 00:22:39 -0400 Original-Received: from smtpauth14.prod.mesa1.secureserver.net ([64.202.165.39]:53853) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1P3i05-0002FA-S6 for help-gnu-emacs@gnu.org; Thu, 07 Oct 2010 00:22:38 -0400 Original-Received: (qmail 19379 invoked from network); 7 Oct 2010 04:22:36 -0000 Original-Received: from unknown (209.85.214.169) by smtpauth14.prod.mesa1.secureserver.net (64.202.165.39) with ESMTP; 07 Oct 2010 04:22:36 -0000 Original-Received: by iwn2 with SMTP id 2so608489iwn.0 for ; Wed, 06 Oct 2010 21:22:35 -0700 (PDT) Original-Received: by 10.42.0.134 with SMTP id 6mr195204icc.71.1286425354946; Wed, 06 Oct 2010 21:22:34 -0700 (PDT) Original-Received: by 10.42.5.138 with HTTP; Wed, 6 Oct 2010 21:22:34 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 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:75083 Archived-At: On Wed, Oct 6, 2010 at 1:06 PM, Nerius Landys wrote: > The behavior for this particular mode of operation that would be nice is = as > follows: > > 1. Hitting the Tab key places a literal Tab character in my file.=A0 That= is > all. > 2. I notice that sometimes when I complete a like (e.g. adding a semicolo= n > or adding a paren) it auto-indents for me.=A0 I want to turn this off > completely. 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.