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

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

Re: c indentation - replace spaces with tabs


From: Alan Mackenzie
Subject: Re: c indentation - replace spaces with tabs
Date: Mon, 8 Dec 2003 21:21:30 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Micha Feigin <michf@post.tau.ac.il> wrote on Sun, 7 Dec 2003 15:57:31 +0200:
> Is it possible ....

_Anything_ is possible in Emacs.  Almost.  :-)

> .... to make emacs automatically replace every 8 consecutive
> spaces with a tab? (this can actually be done in indentation time
> instead of write time if I menage to get the indentations right).

If you're happy about tabs being used in any mode, put the following in
your emacs:

(setq indent-tabs-mode t)

.  If you just want it in C Mode, use the C Mode hook:

(defun mf-enable-indent-tabs ()
  (setq indent-tabs-mode t))
(add-hook 'c-mode-hook 'mf-enable-indent-tabs)

.  All the best!

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").



reply via email to

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