From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jonathan Groll Newsgroups: gmane.emacs.help Subject: Re: [emacs] tabs, spaces, and indentation Date: Thu, 07 Oct 2010 08:26:27 +0200 Message-ID: <83zkuqa57w.wl%lists@groll.co.za> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1286432848 14602 80.91.229.12 (7 Oct 2010 06:27:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Oct 2010 06:27:28 +0000 (UTC) To: Nerius Landys , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 07 08:27:26 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 1P3jwm-0003T2-78 for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Oct 2010 08:27:25 +0200 Original-Received: from localhost ([127.0.0.1]:38867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3jwR-000586-EM for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Oct 2010 02:26:59 -0400 Original-Received: from [140.186.70.92] (port=39785 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3jvz-000581-Bs for help-gnu-emacs@gnu.org; Thu, 07 Oct 2010 02:26:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P3jvy-0004jm-2u for help-gnu-emacs@gnu.org; Thu, 07 Oct 2010 02:26:31 -0400 Original-Received: from mail.groll.co.za ([166.84.7.40]:42682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P3jvx-0004jd-VS for help-gnu-emacs@gnu.org; Thu, 07 Oct 2010 02:26:30 -0400 Original-Received: from mail.groll.co.za.groll.co.za (localhost.panix.com [127.0.0.1]) by mail.groll.co.za (Postfix) with ESMTP id 5725A5FE5C; Thu, 7 Oct 2010 08:26:27 +0200 (SAST) In-Reply-To: Mail-Reply-To: lists@groll.co.za User-Agent: Wanderlust/2.15.6 (Almost Unreal) Emacs/24.0 Mule/6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:75084 Archived-At: On Wed, 6 Oct 2010 13:06:05 -0700,Nerius Landys wrote: >I tried searching on Google for commands that may help me, but most of w= hat I found >explained how to enable the kind of behavior that I'm NOT looking (I'm g= oing in the >opposite direction unfortunately). >The current default behavior that I am experiencing is as follows: >1. When I hit the Tab key, it indents the current line at the correct in= dentation >level.=C2=A0 Existing Tabs are preserved but spaces might be added. >2. When I complete some syntax on a line, such as adding a semicolon or = closing a >paren, it indents the line for me automatically. >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.=C2=A0 = That is all. >2. I notice that sometimes when I complete a like (e.g. adding a semicol= on or adding >a paren) it auto-indents for me.=C2=A0 I want to turn this off completel= y. >Is it possible to toggle the mode consisting of #1 and #2 on and off?=C2= =A0 Please help, >and thank you very much! Here is a good resource: http://cscs.umich.edu/lr/Misc/emacs_tabs.htm As the above guide says: ;;force TAB to insert just one TAB: (global-set-key (kbd "TAB") 'self-insert-command) (This would be for every mode - but it may be best to just set it for your C mode) It is worth reading up on the eternal debate of tabs vs spaces. Here is Jamie Zawinski's take: http://www.jwz.org/doc/tabs-vs-spaces.html Cheers, JJG