all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to set tab to be 4 (!) spaces for indention?
@ 2007-12-18 19:40 xz
  2007-12-18 20:10 ` Tyler Smith
  2007-12-18 20:13 ` Drew Adams
  0 siblings, 2 replies; 3+ messages in thread
From: xz @ 2007-12-18 19:40 UTC (permalink / raw)
  To: help-gnu-emacs

It's so annoooooooooooooying that the default indention is only 2
spaces.

I googled a lot but cannot change this.

For example, I tried

(setq default-tab-width 4)

in the .emacs file.

But it don't change nothing!

How can I make the indention to be 4 spaces?

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

* Re: How to set tab to be 4 (!) spaces for indention?
  2007-12-18 19:40 How to set tab to be 4 (!) spaces for indention? xz
@ 2007-12-18 20:10 ` Tyler Smith
  2007-12-18 20:13 ` Drew Adams
  1 sibling, 0 replies; 3+ messages in thread
From: Tyler Smith @ 2007-12-18 20:10 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-12-18, xz <zhang.xi.cn@gmail.com> wrote:
> For example, I tried
>
> (setq default-tab-width 4)
>
> in the .emacs file.
>
> But it don't change nothing!

No, it changed how tab characters are displayed. Problem is,
indentation is not created with tab characters ;) If you're working in
cc-mode, for example, you will want to use something like:

(setq c-basic-offset 4)

This is called 'syntax-driven indentation', as described (generally) in
the manual node (emacs)Indentation. Details will depend on the
particular mode you're in, so it will take a bit of poking around to
figure out how to set the correct value for the language you're
coding in.

HTH,

Tyler

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

* RE: How to set tab to be 4 (!) spaces for indention?
  2007-12-18 19:40 How to set tab to be 4 (!) spaces for indention? xz
  2007-12-18 20:10 ` Tyler Smith
@ 2007-12-18 20:13 ` Drew Adams
  1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2007-12-18 20:13 UTC (permalink / raw)
  To: xz, help-gnu-emacs

> It's so annoooooooooooooying that the default indention is only 2
> spaces.
> I googled a lot but cannot change this.
> For example, I tried
> (setq default-tab-width 4)
> in the .emacs file.
> But it don't change nothing!
> How can I make the indention to be 4 spaces?

Does this help?

http://www.emacswiki.org/cgi-bin/wiki/IndentationBasics
http://www.emacswiki.org/cgi-bin/wiki/TabStopList

You can also read the Emacs manual. Try `i' in the manual, enter `tab' and
hit the TAB key to see manual sections that are pertinent.

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

end of thread, other threads:[~2007-12-18 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-18 19:40 How to set tab to be 4 (!) spaces for indention? xz
2007-12-18 20:10 ` Tyler Smith
2007-12-18 20:13 ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.