From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#4069: 23.1.50; whitespace.el Date: Sat, 15 Aug 2009 19:17:40 -0400 Message-ID: <877hx4ll9n.fsf@cyd.mit.edu> Reply-To: Chong Yidong , 4069@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1250378911 24197 80.91.229.12 (15 Aug 2009 23:28:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Aug 2009 23:28:31 +0000 (UTC) Cc: 4069@emacsbugs.donarmstrong.com, Craig Falls To: Vinicius Jose Latorre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 16 01:28:24 2009 Return-path: Envelope-to: geb-bug-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 1McSff-0006P9-EX for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Aug 2009 01:28:23 +0200 Original-Received: from localhost ([127.0.0.1]:40236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McSfe-0003H2-Qh for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Aug 2009 19:28:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1McSeM-0001nG-64 for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 19:27:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1McSeF-0001el-Fs for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 19:27:01 -0400 Original-Received: from [199.232.76.173] (port=40909 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McSeF-0001eN-7K for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 19:26:55 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:43712) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1McSeE-00022O-CY for bug-gnu-emacs@gnu.org; Sat, 15 Aug 2009 19:26:54 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7FNQnPQ006821; Sat, 15 Aug 2009 16:26:51 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7FNP8J2006550; Sat, 15 Aug 2009 16:25:08 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 15 Aug 2009 23:25:08 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4069 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4069-submit@emacsbugs.donarmstrong.com id=B4069.12503782035217 (code B ref 4069); Sat, 15 Aug 2009 23:25:08 +0000 Original-Received: (at 4069) by emacsbugs.donarmstrong.com; 15 Aug 2009 23:16:43 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7FNGgBe005212 for <4069@emacsbugs.donarmstrong.com>; Sat, 15 Aug 2009 16:16:43 -0700 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id DE1FD57E21C; Sat, 15 Aug 2009 19:17:40 -0400 (EDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 15 Aug 2009 19:27:00 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30237 Archived-At: Hi Vinicius, Could you take a look at this bug report? Thanks: "Craig Falls" wrote: > There is a problem with whitespace-cleanup, when called before > whitespace-turn-on. The buffer-local variable > whitespace-indentation-regexp doesn't get updated to correspond to the > buffer-local value of indent-tabs-mode. This means that even if > indent-tabs-mode is nil, a line with text following a single tab > character will not be converted into a line of text following 8 space > characters when whitespace-cleanup is called. There is a simple > work-around -- just turn whitespace on and off again to set the > buffer-local variables: > (defun my-whitespace-cleanup () > "Fixes a bug in whitespace-cleanup in which buffer-local > indent-tabs-mode is not respected." > (interactive) > (whitespace-turn-on) ;; sets buffer-local variables > (whitespace-turn-off) ;; don't actually want the mode to be on > (whitespace-cleanup)) > Here are instructions to replicate the problem: > Start up with no .emacs. Set indent-tabs-mode to nil. Make sure > 'indentation is in whitespace-style. Insert a tab character into a > buffer with no spaces after it, e.g. the line could be "\tfoo". Run > whitespace-cleanup in the buffer. Note that the tab character is still > there. Now run my-whitespace-cleanup. Note that the tab character has > been replaced by spaces. > The fact that indent-tabs-mode is buffer-local is important. For > example, makefile-mode sets it to true since tabs are a necessary part > of the syntax of make files.