From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Benjamin Rutt Newsgroups: gmane.emacs.help Subject: Re: TAB character Date: Fri, 22 Nov 2002 16:56:42 -0500 Organization: The Ohio State University Dept. of Computer and Info. Science Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1038002482 22697 80.91.224.249 (22 Nov 2002 22:01:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 22 Nov 2002 22:01:22 +0000 (UTC) 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 18FLrT-0005tc-00 for ; Fri, 22 Nov 2002 23:01:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18FLrg-00036G-00; Fri, 22 Nov 2002 17:01:32 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.ems.psu.edu!news.cis.ohio-state.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: gamma.cis.ohio-state.edu Mail-Copies-To: nobody User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (sparc-sun-solaris2.8) Cancel-Lock: sha1:VQHUZJIZ4aRtMqcBhecscJn9zUE= Original-Xref: shelby.stanford.edu gnu.emacs.help:107325 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:3880 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:3880 Stirling Olson writes: > How can I make the TAB key just enter a TAB character and never have > that TAB character turn into spaces? > > While editing .java files and other files hitting the TAB key seems to > follow some indenting conventions that I don't understand and don't > prefer. It often enters spaces and sometimes won't even let me enter a > further tab. I just want to have a tab character entered in the buffer > when I hit TAB and when I backspace or delete a tab in the buffer I > don't want it to turn into spaces. In this case, I think you want to pick a number (like 4) that you want to use for the distance between your tab stops. Then, I believe you need to synchronize several variables based off of that number: (add-hook 'java-mode-hook (lambda () (setq tab-width 4) (setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40) (setq c-basic-offset 4)))) Future TAB presses should indent your code only to the tab stop list, and therefore no spaces will be inserted. -- Benjamin