* c indentation - replace spaces with tabs
@ 2003-12-07 13:57 Micha Feigin
2003-12-07 15:19 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Micha Feigin @ 2003-12-07 13:57 UTC (permalink / raw)
Is it possible 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).
I am looking to get the same functionality gotten in vim for:
set ts=8
set sw=4
For example, when a line is indented 12 spaces it would be replaced with
[tab]4*[space]
^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <mailman.1301.1070809217.399.help-gnu-emacs@gnu.org>]
* Re: c indentation - replace spaces with tabs
[not found] <mailman.1301.1070809217.399.help-gnu-emacs@gnu.org>
@ 2003-12-08 21:21 ` Alan Mackenzie
0 siblings, 0 replies; 3+ messages in thread
From: Alan Mackenzie @ 2003-12-08 21:21 UTC (permalink / raw)
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").
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-12-08 21:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-07 13:57 c indentation - replace spaces with tabs Micha Feigin
2003-12-07 15:19 ` Eli Zaretskii
[not found] <mailman.1301.1070809217.399.help-gnu-emacs@gnu.org>
2003-12-08 21:21 ` Alan Mackenzie
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).