help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: replace TAB with 8 whitespaces


From: Kai Großjohann
Subject: Re: replace TAB with 8 whitespaces
Date: Mon, 16 Jun 2003 15:17:35 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

"jinneemop" <jinneemop@sohu.com> writes:

> Thanks a lot. 
> I add (setq indent-tabs-mode nil) to .emacs, and Emacs uses no 
> tabs. But it inserts only 2 spaces!
> Then I add this (googled from internet) to .emacs:
>     (defun my-c++-mode-hook ()
>       (c-set-style "k&r")
>       (setq tab-width 8)
>       (setq c-basic-offset 8)
>       (define-key c++-mode-map "\C-m" 'reindent-then-newline-and-indent)
>       (define-key c++-mode-map "\C-ce" 'c-comment-edit)
>       (setq c++-auto-hungry-initial-state 'none)
>       (setq c++-delete-function 'backward-delete-char)
>       (setq c++-tab-always-indent t)
>       (setq c-indent-level 8)
>       (setq c-continued-statement-offset 8)
>       (setq c++-empty-arglist-indent 8))
>     (add-hook 'c++-mode-hook 'my-c++-mode-hook)
> It works.

That's good :-)

> But becase I konw little about lisp, it is Greek to me. :-( How can
> I start to learn lisp?

There is an Emacs Lisp Introduction.  It is part of the development
version of Emacs, I think, but also available on ftp.gnu.org and its
mirrors.

Maybe it would have worked to use M-x customize-variable RET to set
c-default-style and c-basic-offset.  That would have been simple and
would not have required Lisp knowledge.
-- 
This line is not blank.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]