bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4069: 23.1.50; whitespace.el


From: Vinicius Jose Latorre
Subject: bug#4069: 23.1.50; whitespace.el
Date: Sat, 15 Aug 2009 22:08:52 -0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.22) Gecko/20090606 SeaMonkey/1.1.17

Hi Chong,


Could you take a look at this bug report?  Thanks:


"Craig Falls" <address@hidden> 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.


I already sent back an answer to Craig.

This is neither a bug nor a problem, Craig had implemented a wrong function to do what he wanted.

Should I send to you and emacsbugs list all the emails about this conversation?


Regards,


Vinicius






reply via email to

[Prev in Thread] Current Thread [Next in Thread]