From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bijan Soleymani Newsgroups: gmane.emacs.help Subject: Re: Unable to Set Tab Width Date: 21 Mar 2003 08:39:10 -0500 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87fzpgltz5.fsf@server.crasseux.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1048253701 22674 80.91.224.249 (21 Mar 2003 13:35:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 21 Mar 2003 13:35:01 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 21 14:34:58 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 18wMfi-0005tJ-00 for ; Fri, 21 Mar 2003 14:34:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18wMcI-00042z-02 for gnu-help-gnu-emacs@m.gmane.org; Fri, 21 Mar 2003 08:31:26 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!nntp.cs.ubc.ca!cyclone.bc.net!snoopy.risq.qc.ca!wesley.videotron.net!weber.videotron.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-NNTP-Posting-Host: 24.201.123.149 Original-X-Complaints-To: abuse@videotron.ca Original-X-Trace: weber.videotron.net 1048253404 24.201.123.149 (Fri, 21 Mar 2003 08:30:04 EST) Original-NNTP-Posting-Date: Fri, 21 Mar 2003 08:30:04 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:111283 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:7783 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7783 Chris writes: > Despite countless efforts, I cannot set the tab width > in emacs to 2 spaces instead of 4. > > >uname -a > HP-UX host B.11.00 U 9000/785 2007718834 unlimited-user license > > >/usr/local/bin/emacs-21.2.1 > >cat .emacs > (setq default-tab-width 2) > > I thought the above command would set the tab width to 2, > but it is stuck at 4! > > That is all I have in the emacs file. > > I did have that long list of tab stops such as 2 4 6 8 ... > but that didn't help. > > Any suggestions? > > It's driving me nuts while editing perl or java. > > I thought emacs was configurable... no? > > I have the same trouble with a Win32 version of emacs (20.7.1). > There is a difference between tab stops, tab-width, and what the "tab" key does. The tab keys behaviour depends on which mode you are on, what time of day it is, etc :). If you really want to set tab stops then consult the emacs manual under the heading "tab stops" under the section "indentation". It recommends running M-x edit-tab-stops. Btw it says at the bottom of that info node that tab-to-tab-stops have nothing to do with displaying tab characters. There is a link to the secton on customizing the display, where it says that "tab-width" controls how tabs are shown, but doesn't affect the tab stops. I think what that means is that a tab character will display as tab-width, but indenting will use multiple tabs and/or spaces to indent to the next tab stop. Tab width only affect 'tab' character (i.e. \t) in the buffer. But many programming modes use a combination of spaces and tabs. I don't know if this is the problem you're having. Hope that helps, Bijan