From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.help Subject: Re: whitespace-cleanup + untabify? Date: Sat, 14 Jun 2008 14:02:17 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1213460083 8049 80.91.229.12 (14 Jun 2008 16:14:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Jun 2008 16:14:43 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "dsevilla@gmail.com" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 14 18:15:24 2008 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 1K7YPT-0006r2-Ix for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Jun 2008 18:15:23 +0200 Original-Received: from localhost ([127.0.0.1]:42360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7YOf-00057l-FQ for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Jun 2008 12:14:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K7YOM-00057X-OI for help-gnu-emacs@gnu.org; Sat, 14 Jun 2008 12:14:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K7YOL-00056v-B4 for help-gnu-emacs@gnu.org; Sat, 14 Jun 2008 12:14:14 -0400 Original-Received: from [199.232.76.173] (port=51771 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7YOL-00056o-5V for help-gnu-emacs@gnu.org; Sat, 14 Jun 2008 12:14:13 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:39272) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K7XRl-0002Nb-LT for help-gnu-emacs@gnu.org; Sat, 14 Jun 2008 11:13:41 -0400 Original-Received: from ug-out-1314.google.com ([66.249.92.170]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K7USY-0001gv-LN for help-gnu-emacs@gnu.org; Sat, 14 Jun 2008 08:02:18 -0400 Original-Received: by ug-out-1314.google.com with SMTP id l31so198032ugc.48 for ; Sat, 14 Jun 2008 05:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=j4hfTHJv3njto/b7KEyETkYvMxn8pTdXpCid8Y+v39o=; b=g4k5zH8fXu7GbuQEQX1kGAGcG5H5ng6Ibt9Jl1hkJDFejKuGY3UjfIdMcF6WVxVNdg NU5i+QXk5OHcU0aTyWtQokjWTp0ZboIPMtOzVaPVBe+VDBkUpKwqV9vFT5nCAL55gjD1 E7weW3mZpRiZ92PXrNWpGPChdGg1apu/yzwH8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=egQSJTWrZPDPCSAA0YouNwuJWb9jYz6IAsqDWND6ZNMYqVJs47d3xooPTii6tbz01p oju9rgICRueq694a5x4z/Xq8BXPuSZqLVuSbsszYAeZ0W5Fvx5CEiBDvgSQubWA7Qz0f GgCC0lN7lMS8S38J1+6Mw9TqX51RwqzAzafQg= Original-Received: by 10.210.20.17 with SMTP id 17mr3827820ebt.21.1213444937835; Sat, 14 Jun 2008 05:02:17 -0700 (PDT) Original-Received: by 10.210.71.14 with HTTP; Sat, 14 Jun 2008 05:02:17 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:54832 Archived-At: On Sat, Jun 14, 2008 at 12:56, dsevilla@gmail.com wrote: > I haven't found any > option that connects untabify and whitespace-cleanup. I'm using: That really depends on how do you want to do the untabify. For example, you can defadvice `whitespace-cleanup' like so (defadvice whitespace-cleanup (after whitespace-untabify activate compile) (save-restriction (widen) (untabify (point-min) (point-max)))) so when you do M-x whitespace cleanup, it first cleans up and then untabifies. Take into account that untabify removes tabs anywhere in the line; if you prefer only to untabify at the beginning of line, you could use this instead: (defadvice whitespace-cleanup (after whitespace-untabify activate compile) (save-restriction (widen) (let ((tabify-regexp "^\t* [ \t]+")) (untabify (point-min) (point-max))))) Both examples untabify the whole buffer (that's what the `save-restriction' and `widen' calls are for), so if you in fact only want to untabify the region, it's even simpler: (defadvice whitespace-cleanup (after whitespace-untabify activate compile) (untabify (point-min) (point-max))) Does this help? Juanma