From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: c indentation - replace spaces with tabs Date: Mon, 8 Dec 2003 21:21:30 +0000 Organization: muc.de e.V. -- private internet access Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1070955077 17489 80.91.224.253 (9 Dec 2003 07:31:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Dec 2003 07:31:17 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 09 08:31:08 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ATcKq-0005Hi-00 for ; Tue, 09 Dec 2003 08:31:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ATdGQ-00036L-BR for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Dec 2003 03:30:38 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.uchicago.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news.f.de.plusline.net!feed.news.tiscali.de!newsfeed.stueberl.de!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1070953908 45601 193.149.49.134 (9 Dec 2003 07:11:48 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 9 Dec 2003 07:11:48 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:119140 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:15078 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15078 Micha Feigin 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").