* bug#4069: 23.1.50; whitespace.el
@ 2009-08-06 20:31 Craig Falls
0 siblings, 0 replies; 3+ messages in thread
From: Craig Falls @ 2009-08-06 20:31 UTC (permalink / raw)
To: emacs-pretest-bug
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.
In GNU Emacs 23.1.50.8 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4)
of 2009-08-03 on nyc-qws-005
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default-enable-multibyte-characters: t
Major mode: GNUmakefile
Minor modes in effect:
shell-dirtrack-mode: t
flyspell-mode: t
desktop-save-mode: t
diff-auto-refine-mode: t
partial-completion-mode: t
dynamic-completion-mode: t
show-paren-mode: t
recentf-mode: t
iswitchb-mode: t
global-auto-revert-mode: t
tooltip-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
global-auto-composition-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
/mnt/global/dev/lib/elisp/inf-caml hides /mnt/global/dev/lib/elisp/caml-mode/inf-caml
/mnt/global/dev/lib/elisp/tuareg-mode/camldebug hides /mnt/global/dev/lib/elisp/caml-mode/camldebug
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#4069: 23.1.50; whitespace.el
@ 2009-08-15 23:17 Chong Yidong
2009-08-16 1:08 ` Vinicius Jose Latorre
0 siblings, 1 reply; 3+ messages in thread
From: Chong Yidong @ 2009-08-15 23:17 UTC (permalink / raw)
To: Vinicius Jose Latorre; +Cc: 4069, Craig Falls
Hi Vinicius,
Could you take a look at this bug report? Thanks:
"Craig Falls" <cfalls@janestcapital.com> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#4069: 23.1.50; whitespace.el
2009-08-15 23:17 bug#4069: 23.1.50; whitespace.el Chong Yidong
@ 2009-08-16 1:08 ` Vinicius Jose Latorre
0 siblings, 0 replies; 3+ messages in thread
From: Vinicius Jose Latorre @ 2009-08-16 1:08 UTC (permalink / raw)
To: Chong Yidong; +Cc: 4069, Craig Falls
Hi Chong,
> Could you take a look at this bug report? Thanks:
>
>
> "Craig Falls" <cfalls@janestcapital.com> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-08-16 1:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-15 23:17 bug#4069: 23.1.50; whitespace.el Chong Yidong
2009-08-16 1:08 ` Vinicius Jose Latorre
-- strict thread matches above, loose matches on Subject: below --
2009-08-06 20:31 Craig Falls
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).