From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: B Smith-Mannschott Newsgroups: gmane.emacs.help Subject: Re: Tabs and Spaces Date: Mon, 25 May 2009 18:15:48 +0200 Message-ID: <28c656e20905250915j2fb30a30r711b086f94aab661@mail.gmail.com> References: <77vbbiF1jhhubU1@mid.individual.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1243269104 20432 80.91.229.12 (25 May 2009 16:31:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 May 2009 16:31:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 25 18:31:37 2009 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.50) id 1M8d5M-0001Oj-3R for geh-help-gnu-emacs@m.gmane.org; Mon, 25 May 2009 18:31:36 +0200 Original-Received: from localhost ([127.0.0.1]:36121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M8d5L-0002mw-HX for geh-help-gnu-emacs@m.gmane.org; Mon, 25 May 2009 12:31:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M8cqN-0003FR-Ps for help-gnu-emacs@gnu.org; Mon, 25 May 2009 12:16:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M8cqJ-0003Cr-5A for help-gnu-emacs@gnu.org; Mon, 25 May 2009 12:16:07 -0400 Original-Received: from [199.232.76.173] (port=48952 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M8cqI-0003Cg-PC for help-gnu-emacs@gnu.org; Mon, 25 May 2009 12:16:02 -0400 Original-Received: from mail-bw0-f161.google.com ([209.85.218.161]:64822) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M8cqG-0001NL-CA for help-gnu-emacs@gnu.org; Mon, 25 May 2009 12:16:01 -0400 Original-Received: by bwz5 with SMTP id 5so3378778bwz.42 for ; Mon, 25 May 2009 09:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=dNQIt+d4Q6DpY4N8s86/p7Mf0YQ2oBBt3ppu8UHg2io=; b=b8qHTl4pWNpMy3ZjHHzyxffwUb3JSeuT2dX4G9JUdV4gvukBnqaHpRG5PSW3to+ISc 1edzj597Yu5w7cag9Qvz3eL3Bxy/ogjQDENJBz9LWHWCN826Za4Cc7LDj7LmTCGldqIb ijQc3s4+qsCmuDeOKDZFYkwKjFd6BP8dfadPw= 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 :content-type:content-transfer-encoding; b=PLeoLpJ1EGfK7zXFa3kYTVtgq3QLljFhrsUKa1NpM4eEslgJvWNZ+0kRvN3eiromHe GSGLsHguswTAo1/1zUem4KV9DWyABpgBlak0t5Lm8eH/5XD7k76qxHp3FnORXA7ETa41 zEnsMjQMhLQlZjO5zF7tM+OP9Fx+UlH5i7v+4= Original-Received: by 10.223.118.141 with SMTP id v13mr3638188faq.26.1243268148811; Mon, 25 May 2009 09:15:48 -0700 (PDT) In-Reply-To: <77vbbiF1jhhubU1@mid.individual.net> X-detected-operating-system: by monty-python.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:64702 Archived-At: On Mon, May 25, 2009 at 12:48, Chris Gordon-Smith wrote: > Hello All > > I have recenly started using emacs for programming, after years using > KDevelop. One problem I have is indenting code. I have my own indentation > style. and ideally I would like to setup emacs to support it automatically. > However, in the short term I'll settle for having emacs convert a TAB > keypress into the correct number of spaces to fill whitespace up to the > next tabstop. > > At the moment I have > > (global-set-key (kbd "TAB") 'self-insert-command) > > in my .emacs to force insertion of a tab, but I have to keep invoking > untabify manually (otherwise my code looks misaligned when I upload it to > Google Code). > > Can anyone help. Parital solution: By default, emacs has a nasty habit of indenting with a mix of tabs and spaces. you can disable this by setting indent-tabs-mode to nil. You can do this via M-x customize-apropos or by sprinkling this bit of elisp into your .emacs: (setq-default indent-tabs-mode nil ;;; http://www.emacswiki.org/cgi-bin/wiki/TabsAreEvil ) // Ben