From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: whitespace issues Date: Tue, 30 Jun 2015 09:21:12 -0700 (PDT) Message-ID: <6e46f3bf-4b26-4f22-b7d9-54a3a2542d10@googlegroups.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1435681520 32710 80.91.229.3 (30 Jun 2015 16:25:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Jun 2015 16:25:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 30 18:25:20 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z9yLY-00044y-1c for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Jun 2015 18:25:20 +0200 Original-Received: from localhost ([::1]:47806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9yLX-00019r-Fy for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Jun 2015 12:25:19 -0400 X-Received: by 10.52.92.69 with SMTP id ck5mr28435241vdb.7.1435681272720; Tue, 30 Jun 2015 09:21:12 -0700 (PDT) X-Received: by 10.50.79.137 with SMTP id j9mr300710igx.15.1435681272644; Tue, 30 Jun 2015 09:21:12 -0700 (PDT) Original-Path: usenet.stanford.edu!j5no14312qga.1!news-out.google.com!t2ni1658igk.0!nntp.google.com!j8no2490575igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=61.1.37.246; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 61.1.37.246 User-Agent: G2/1.0 Injection-Date: Tue, 30 Jun 2015 16:21:12 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:213039 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105327 Archived-At: On Tuesday, June 30, 2015 at 8:32:21 PM UTC+5:30, Jorge A. Alfaro-Murillo wrote: > Rusi writes: > > > I have two somewhat related questions, both around whitespace: > > > > 1. Is it possible to have some sort of save-hook so that all > > leading (indentation) whitespace is cleaned up to space alone > > and tabs are removed? > > (add-hook 'before-save-hook > (lambda () (save-excursion (untabify (point-min) > (point-max))))) How to have this only for (say) python-mode?