GNU bug report logs -
#13837
24.2; Make it possible to turn whitespace-mode only when there are no existing problems
Previous Next
Reported by: Reuben Thomas <rrt <at> sc3d.org>
Date: Wed, 27 Feb 2013 21:45:02 UTC
Severity: wishlist
Found in version 24.2
Fixed in version 25.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #62 received at 13837 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 27 January 2014 01:52, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
>
> I could be convinced to install it if it's "obviously safe".
> The patch as sent is a large chunk of "new" code plus a large chunk of
> "removed" code, so it's not very appealing. Diffing while ignoring
> whitespace indicates it's more of a "refactoring", and by introducing an
> "artificial" new function while helps keep the text lines in the
> original order (and hence helps reduce the size of the diff), I get the
> patch below.
>
Thanks very much for trying.
> But it's not obviously safe to me. Two non-obvious parts are:
> - the removal of "(add-to-list 'whitespace-style (car option))".
>
The removal looks wrong to me too: without that code, the force argument
has no effect. On the other hand, the way it's implemented also seems
wrong, as it permanently changes whitespace-style.
> - the change from has-bogus to bogus-list, where bogus-list will
> (initially) only be nil if whitespace-report-list is nil.
>
As far as I can see, has-bogus was set whenever an element was added to
bogus-list. Hence, bogus-list is nil when has-bogus was nil. bogus-list is
a list of whichever elements of whitespace-report-list problems are found,
so if no problem is found, it will be nil.
> Another problem is that the docstring of whitespace-test-region does not
> accurately describe its return value.
>
So the return value is currently a list of flags corresponding to elements
of whitespace-report-list.
Two more things:
1. I would like to refactor the description of whitespace problems in
whitespace-report-region to move those which are the same regardless of the
value of indent-tabs-mode into a separate list.
2. Since we're no longer going for getting this into 24.4, can we fold your
"artificial" whitespace--report-report-region back into
whitespace-report-region, which both simplifies the end result slightly,
and avoids the question of whether the new function should be moved down
into "internal functions"?
[Message part 2 (text/html, inline)]
This bug report was last modified 10 years and 235 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.