unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Unable to Set Tab Width
@ 2003-03-21  3:57 Chris
  2003-03-21  8:20 ` Erik Simon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chris @ 2003-03-21  3:57 UTC (permalink / raw)


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).

Any help appreciated,
Chris

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to Set Tab Width
  2003-03-21  3:57 Unable to Set Tab Width Chris
@ 2003-03-21  8:20 ` Erik Simon
  2003-03-21 13:39 ` Bijan Soleymani
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Erik Simon @ 2003-03-21  8:20 UTC (permalink / raw)


Hi,

On 21 Mar 2003, matrix2468REMOVETHISTOREPLY@cox.net wrote:
>(setq default-tab-width 2)
>
>I thought the above command would set the tab width to 2,
>but it is stuck at 4!

See the help for default-tab-width, it's for buffers that don't
override it.

>It's driving me nuts while editing perl or java.

Tabs are controlled in java-mode by c-basic-offset (as in C)
Have a look at c-indent-command (C-h f c-indent-command).

In perl-mode, it's controlled by perl-indent-level if I remember
well. I actually never changed those myself, maybe it messes up with
the indent style, dunno...

>I thought emacs was configurable... no?

It is :-)

Good luck
-- 
Erik Simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to Set Tab Width
  2003-03-21  3:57 Unable to Set Tab Width Chris
  2003-03-21  8:20 ` Erik Simon
@ 2003-03-21 13:39 ` Bijan Soleymani
  2003-03-21 20:33 ` Pascal Bourguignon
  2003-03-22  4:27 ` Chris
  3 siblings, 0 replies; 5+ messages in thread
From: Bijan Soleymani @ 2003-03-21 13:39 UTC (permalink / raw)


Chris <matrix2468REMOVETHISTOREPLY@cox.net> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to Set Tab Width
  2003-03-21  3:57 Unable to Set Tab Width Chris
  2003-03-21  8:20 ` Erik Simon
  2003-03-21 13:39 ` Bijan Soleymani
@ 2003-03-21 20:33 ` Pascal Bourguignon
  2003-03-22  4:27 ` Chris
  3 siblings, 0 replies; 5+ messages in thread
From: Pascal Bourguignon @ 2003-03-21 20:33 UTC (permalink / raw)


Chris <matrix2468REMOVETHISTOREPLY@cox.net> 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!


I have this:

(custom-set-variables
 '(indent-tabs-mode nil)
 '(inhibit-c-tab-always-indent nil)
 '(tab-stop 4 t)
 '(tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64)))
 '(tab-width 4)
 '(c-tab-always-indent nil)
)

(add-hook 'shell-mode-hook '(lambda () (set-variable 'tab-width 8)))



-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------
Do not adjust your mind, there is a fault in reality.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Unable to Set Tab Width
  2003-03-21  3:57 Unable to Set Tab Width Chris
                   ` (2 preceding siblings ...)
  2003-03-21 20:33 ` Pascal Bourguignon
@ 2003-03-22  4:27 ` Chris
  3 siblings, 0 replies; 5+ messages in thread
From: Chris @ 2003-03-22  4:27 UTC (permalink / raw)


Thank you!

Everyone's comments were very helpful and I
was able to set the tab stops as needed.

Thanks,
Chris

Chris wrote:
> 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).
> 
> Any help appreciated,
> Chris
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-22  4:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-21  3:57 Unable to Set Tab Width Chris
2003-03-21  8:20 ` Erik Simon
2003-03-21 13:39 ` Bijan Soleymani
2003-03-21 20:33 ` Pascal Bourguignon
2003-03-22  4:27 ` Chris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).