From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@gmx.net (=?iso-8859-1?q?Kai_Gro=DFjohann?=) Newsgroups: gmane.emacs.help Subject: Re: replace TAB with 8 whitespaces Date: Mon, 16 Jun 2003 09:26:43 +0200 Organization: University of Duisburg, Germany Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <84r85ufpos.fsf@lucy.is.informatik.uni-duisburg.de> References: <848ys67985.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1055751314 24140 80.91.224.249 (16 Jun 2003 08:15:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 16 Jun 2003 08:15:14 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 16 10:15:10 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19Rp8b-0006GI-00 for ; Mon, 16 Jun 2003 10:14:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Rp9M-0004RT-FR for gnu-help-gnu-emacs@m.gmane.org; Mon, 16 Jun 2003 04:15:36 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!lucy.is.informatik.uni-duisburg.DE!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: lucy.is.informatik.uni-duisburg.de (134.91.35.216) Original-X-Trace: fu-berlin.de 1055751148 20692195 134.91.35.216 (16 [73968]) Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:YGpNdK6DR4orN1n8auODQWCT0Sw= Original-Xref: shelby.stanford.edu gnu.emacs.help:114469 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10961 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10961 "jinneemop" writes: > On Fri, 13 Jun 2003 09:00:26 +0200, Kai Großjohann wrote: > >> [x] Something interesting, please specify: It seems like one tab > and one space. It inserts a tab and a space? That's strange. Is it always like this, or only in some situations. Note the following snippet: int main(int argc, char* argv[]) { int a; printf("some %string\n", argv[0]); } Here, the "argv[0]" line will be indented in such a way that it aligns with the parenthesis above. This means that the indentation depends on the length of the function name "printf". For example, if it was "fprintf", then the indentation would be one column more. Further, Emacs uses an optimum mix of tabs and spaces to achieve the desired indentation. In the above example, the argv[0] line needs to be indented 15 columns, and since a tab is eight columns wide, the optimum mix is one tab and 7 spaces. This behavior can be controlled with the variable indent-tabs-mode. Type M-x customize-variable RET indent-tabs-mode RET to change it. If indent-tabs-mode is nil (off, false), then Emacs will use 15 spaces instead of 1 tab plus 7 spaces in the above case -- Emacs will never use tabs for indentation when indent-tabs-mode is off. Does that explain Emacs' behavior? Does changing indent-tabs-mode achieve what you want? -- This line is not blank.