GNU bug report logs - #25936
Fix for whitespace.el to make it read tab-width and indent-tabs-mode correctly

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Thu, 2 Mar 2017 13:49:02 UTC

Severity: minor

Tags: fixed, patch

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25936 in the body.
You can then email your comments to 25936 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25936; Package emacs. (Thu, 02 Mar 2017 13:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt <at> sc3d.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 02 Mar 2017 13:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: bug-emacs <bug-emacs <at> gnu.org>
Subject: Fix for whitespace.el to make it read tab-width and indent-tabs-mode
 correctly
Date: Thu, 2 Mar 2017 13:48:19 +0000
[Message part 1 (text/plain, inline)]
I noticed that whitespace-mode was not correctly diagnosing whitespace
problems in some files.

On investigation, this was because whitespace-report-region didn't call
whitespace-ensure-local-variables, so it didn't catch changes to
indent-tabs-mode in file-find hook functions.

However, on further investigation, I can't see why these local variables
are needed. Currently, whitespace-mode makes buffer-local copies of
indent-tabs-mode and tab-width, with names prefixed by "whitespace-". But
these variables are buffer-local if necessary already, and whitespace-mode
never tries to change them.

Hence, I attach a patch for review which simply removes these (apparently
unnecessary) local variables.

-- 
http://rrt.sc3d.org
[Message part 2 (text/html, inline)]
[0001-Fix-reading-of-tab-settings-in-whitespace-mode.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25936; Package emacs. (Fri, 24 Mar 2017 00:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 25936 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 25936 <at> debbugs.gnu.org, Stephen Deasey <sdeasey <at> gmail.com>,
 Vinicius Jose Latorre <viniciusjl <at> ig.com.br>
Subject: Re: bug#25936: Fix for whitespace.el to make it read tab-width and
 indent-tabs-mode correctly
Date: Thu, 23 Mar 2017 20:06:51 -0400
Reuben Thomas <rrt <at> sc3d.org> writes:

> However, on further investigation, I can't see why these local variables
> are needed. Currently, whitespace-mode makes buffer-local copies of
> indent-tabs-mode and tab-width, with names prefixed by "whitespace-". But
> these variables are buffer-local if necessary already, and whitespace-mode
> never tries to change them.

These variables seem to have been introduced in [1: 55d1cfe870].  I
agree that it looks like there is no need for them, but I'll wait
another couple weeks in case someone else has some insights.  Adding
author of that commit (and the person mentioned as "suggesting" it) on
CC in case they might remember anything about it.

1: 2008-04-16 03:41:17 +0000 55d1cfe8703c5829bacc8d129277f1f9b33950f6
  Honor the indent-tabs-mode and tab-width setting from user.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25936; Package emacs. (Tue, 18 Apr 2017 12:06:01 GMT) Full text and rfc822 format available.

Message #11 received at 25936 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 25936 <at> debbugs.gnu.org, Stephen Deasey <sdeasey <at> gmail.com>
Subject: Re: bug#25936: Fix for whitespace.el to make it read tab-width and
 indent-tabs-mode correctly
Date: Tue, 18 Apr 2017 08:06:23 -0400
npostavs <at> users.sourceforge.net writes:

> Reuben Thomas <rrt <at> sc3d.org> writes:
>
>> However, on further investigation, I can't see why these local variables
>> are needed. Currently, whitespace-mode makes buffer-local copies of
>> indent-tabs-mode and tab-width, with names prefixed by "whitespace-". But
>> these variables are buffer-local if necessary already, and whitespace-mode
>> never tries to change them.
>
> These variables seem to have been introduced in [1: 55d1cfe870].  I
> agree that it looks like there is no need for them, but I'll wait
> another couple weeks in case someone else has some insights.  Adding
> author of that commit (and the person mentioned as "suggesting" it) on
> CC in case they might remember anything about it.
>
> 1: 2008-04-16 03:41:17 +0000 55d1cfe8703c5829bacc8d129277f1f9b33950f6
>   Honor the indent-tabs-mode and tab-width setting from user.

I guess they won't answer.  The compiler is telling me you missed a
reference of whitespace-tab-width though.

whitespace.el:2095:45:Warning: reference to free variable
    ‘whitespace-tab-width’





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25936; Package emacs. (Wed, 19 Apr 2017 23:26:02 GMT) Full text and rfc822 format available.

Message #14 received at 25936 <at> debbugs.gnu.org (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 25936 <at> debbugs.gnu.org, Stephen Deasey <sdeasey <at> gmail.com>
Subject: Re: bug#25936: Fix for whitespace.el to make it read tab-width and
 indent-tabs-mode correctly
Date: Thu, 20 Apr 2017 00:25:29 +0100
[Message part 1 (text/plain, inline)]
On 18 April 2017 at 13:06,  <npostavs <at> users.sourceforge.net> wrote:
> npostavs <at> users.sourceforge.net writes:
>
> I guess they won't answer.  The compiler is telling me you missed a
> reference of whitespace-tab-width though.
>
> whitespace.el:2095:45:Warning: reference to free variable
>     ‘whitespace-tab-width’

Thanks very much for this. Revised patch attached.

-- 
http://rrt.sc3d.org
[0006-Fix-reading-of-tab-settings-in-whitespace-mode.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25936; Package emacs. (Fri, 21 Apr 2017 03:17:02 GMT) Full text and rfc822 format available.

Message #17 received at 25936 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 25936 <at> debbugs.gnu.org, Stephen Deasey <sdeasey <at> gmail.com>
Subject: Re: bug#25936: Fix for whitespace.el to make it read tab-width and
 indent-tabs-mode correctly
Date: Thu, 20 Apr 2017 23:17:27 -0400
tags 25936 fixed
close 25936 26.1
quit

Reuben Thomas <rrt <at> sc3d.org> writes:

> On 18 April 2017 at 13:06,  <npostavs <at> users.sourceforge.net> wrote:
>
> Thanks very much for this. Revised patch attached.

Thanks, pushed to master [1: a6b375ba4b].

[1: a6b375ba4b]: 2017-04-20 22:39:15 -0400
  Fix reading of tab settings in whitespace-mode
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a6b375ba4bfc9453abc428dcb73e65bfcf61b794




Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 21 Apr 2017 03:17:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.1, send any further explanations to 25936 <at> debbugs.gnu.org and Reuben Thomas <rrt <at> sc3d.org> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 21 Apr 2017 03:17:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 19 May 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.