From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Sean Richards Newsgroups: gmane.emacs.help Subject: Re: TAB Date: Tue, 18 Nov 2003 08:49:19 +1300 Organization: Xtra Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87he12srls.fsf@hugin.valhalla.net> References: <3FB905DC.7010706@yahoo.com> Reply-To: sean_news@myrealbox.com NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1069100243 30139 80.91.224.253 (17 Nov 2003 20:17:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Nov 2003 20:17:23 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 17 21:17:19 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ALpoF-00059d-00 for ; Mon, 17 Nov 2003 21:17:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ALqYG-0002Ot-1E for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Nov 2003 16:04:52 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!enews.sgi.com!news.xtra.co.nz!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:50NXD1WjWXPexIdJFbREkjv8WhI= Original-Lines: 46 Original-NNTP-Posting-Host: 203.96.102.28 Original-X-Complaints-To: newsadmin@xtra.co.nz Original-X-Trace: news.xtra.co.nz 1069098508 203.96.102.28 (Tue, 18 Nov 2003 08:48:28 NZDT) Original-NNTP-Posting-Date: Tue, 18 Nov 2003 08:48:28 NZDT Original-Xref: shelby.stanford.edu gnu.emacs.help:118388 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14329 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14329 Dan Anderson writes: > On Mon, 2003-11-17 at 12:31, Kevin Rodgers wrote: >> David Rasmussen wrote: >> >> > When I edit java-files, most of the times emacs inserts spaces when I >> > press TAB to indent something. But sometimes I've found it inserts a TAB >> > character instead. Why? >> >> >> C-h v indent-tabs-mode >> >> > How can I turn it off? I never want TAB >> > characters when editing Java or C++ source code files. >> >> (setq-default indent-tabs-mode nil) ; for all modes, or >> >> (add-hook 'java-mode-hook ; for just java mode >> (lambda () (setq indent-tabs-mode nil))) > > That tells him how to turn of tabs. Is there any way to change tabs to > spaces? i.e. when tabbing insert 4 spaces instead of a tab (if tabs > default to 4 spaces long)? I use in my ~/.emacs (setq-default tab-width 4) (setq-default indent-tabs-mode nil) That makes Emacs insert 4 spaces instead of a tab. >>From the Emacs manual .... Tabs vs. Spaces =============== Emacs normally uses both tabs and spaces to indent lines. If you prefer, all indentation can be made from spaces only. To request this, set `indent-tabs-mode' to `nil'. This is a per-buffer variable, so altering the variable affects only the current buffer, but there is a default value which you can change as well. *Note Locals::. Sean -- "Hver sin smak", sa vintapperen, han drakk mens de andre sloss.