From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Kamphausen Newsgroups: gmane.emacs.help Subject: Re: Need to unhook a function in Makefile-mode Date: Thu, 01 Nov 2007 09:18:33 +0100 Organization: Church of Emacs Message-ID: <85r6jafkfa.fsf@usenet.my.skamphausen.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1193919253 18238 80.91.229.12 (1 Nov 2007 12:14:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2007 12:14:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 01 13:14:15 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1InYw8-0002jx-Mr for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Nov 2007 13:14:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1InYvy-0002dk-S5 for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Nov 2007 08:14:02 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!goblin1!goblin.stu.neva.ru!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-X-Trace: news.albasani.net opR/Hkbmz0W8soe5dEu8WsC2xkjMMcEopuwiaHpeiR7fv6Z810AMrGaS/uzQDSPOHo3wXSXRWB9f9TuMICLYA+ASAbTlDA8IaSZW/VUypgeyToQqZFCH7RAWQ4uYnOSK Original-X-Complaints-To: abuse@albasani.net Original-NNTP-Posting-Date: Thu, 1 Nov 2007 08:18:33 +0000 (UTC) X-User-ID: jSJ1uBny2aZcUbjKG1CXeXS30Mb4Y3GAt0/FvxdxcoQ= Cancel-Lock: sha1:ICYYj2eX64z/eybNYxM6r2/6RF4= sha1:IiJGEacKoauJdbdvfEpxYDGJ4WQ= User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.1 (gnu/linux) X-NNTP-Posting-Host: lW7qXlZ2tfxDzpVm+n/bYG/MgD3P+ftZEvc6CeCX+Mw= Original-Xref: shelby.stanford.edu gnu.emacs.help:153481 X-Mailman-Approved-At: Thu, 01 Nov 2007 08:13:46 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48966 Archived-At: Hi, jgombos writes: > ;; LANGUAGE HOOKS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > (add-hook 'c++-mode-hook > '(lambda () > (c-set-style "whitesmith") > (add-hook 'write-file-hooks 'untabify-buffer) > )) > > http://www.emacswiki.org/cgi-bin/emacs-en/UntabifyUponSave This article > suggests a solution, but someone responded to that saying that the > alternative approach screws up formatting (eg. number of spaces equated with > a tab). And I don't want to untabify manually (even though tabs are > highlighted in my view). well the approach given over there in the wiki makes write-file-hooks a /buffer local/ hook by calling (make-local-hook 'write-contents-hooks) I have been using that code for something like 5-8 years (can't really remember) and it always did what I wanted. Note however, it was used in XEmacs and I never hade much code edititing in larger teams (at least no teams not using that same code, too ;-) Kind Regards Stefan -- Stefan Kamphausen --- http://www.skamphausen.de a blessed +42 regexp of confusion (weapon in hand) You hit. The format string crumbles and turns to dust.