GNU bug report logs - #10956
make-mode.el - improve makefile-warn-suspicious-lines

Previous Next

Package: emacs;

Reported by: Jari Aalto <jari.aalto <at> cante.net>

Date: Tue, 6 Mar 2012 12:24:02 UTC

Severity: minor

Tags: moreinfo

Found in version 23.3+1-5

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 10956 in the body.
You can then email your comments to 10956 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#10956; Package emacs. (Tue, 06 Mar 2012 12:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jari Aalto <jari.aalto <at> cante.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 06 Mar 2012 12:24:03 GMT) Full text and rfc822 format available.

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

From: Jari Aalto <jari.aalto <at> cante.net>
To: submit <at> debbugs.gnu.org
Subject: make-mode.el - improve makefile-warn-suspicious-lines
Date: Tue, 06 Mar 2012 07:22:02 -0500
[Message part 1 (text/plain, inline)]
Package: emacs
Version: 23.3+1-5
Severity: minor

Here is a small patch to check any extra whitespace at the beginning of
line. The patch is against Emacs Vcs-Git ba7322c dated 2012-02-29.

2012-03-06 Tue  Jari Aalto  <jari.aalto <at> cante.net>

	* progmodes/make-mode.el (makefile-warn-suspicious-lines):
	improve whitespace check.

-- System Information
Debian Release: wheezy/sid
  APT Prefers unstable
  APT policy: (990, unstable)
Architecture: i386
Kernel: Linux taiko 3.2.0-1-686-pae #1 SMP Fri Feb 17 06:27:21 UTC 2012 i686 GNU/Linux
Locale: LANG=en_US.UTF-8

-- Versions of packages `emacs depends on'.
Depends:
emacs23         23.3+1-5        The GNU Emacs editor (with GTK+ user interfac
emacs23-lucid   23.3+1-5        The GNU Emacs editor
emacs23-nox     23.3+1-5        The GNU Emacs editor (without X support)

[0001-progmodes-make-mode.el-makefile-warn-suspicious-line.patch (text/x-diff, inline)]
From a24603ab69a72fc693119f2885e76ebfad1dbc4f Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto <at> cante.net>
Date: Tue, 6 Mar 2012 07:17:32 -0500
Subject: [PATCH] 	* progmodes/make-mode.el
 (makefile-warn-suspicious-lines): 	improve whitespace
 check.
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit


Signed-off-by: Jari Aalto <jari.aalto <at> cante.net>
---
 lisp/progmodes/make-mode.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index b4ca1ba..de57cd1 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -1642,7 +1642,7 @@ and generates the overview, one line per target name."
   (if (derived-mode-p 'makefile-mode)
       (save-excursion
 	(goto-char (point-min))
-	(if (re-search-forward "^\\(\t+$\\| +\t\\)" nil t)
+	(if (re-search-forward "^\\([ \t]+$\\| +\t\\)" nil t)
 	    (not (y-or-n-p
 		  (format "Suspicious line %d. Save anyway? "
 			  (count-lines (point-min) (point)))))))))
-- 
1.7.9.1


Added tag(s) patch. Request was from Jari Aalto <jari.aalto <at> cante.net> to control <at> debbugs.gnu.org. (Tue, 06 Mar 2012 16:39:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10956; Package emacs. (Wed, 21 Mar 2012 18:26:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jari Aalto <jari.aalto <at> cante.net>
Cc: 10956 <at> debbugs.gnu.org
Subject: Re: bug#10956: make-mode.el - improve makefile-warn-suspicious-lines
Date: Wed, 21 Mar 2012 13:54:40 -0400
> Here is a small patch to check any extra whitespace at the beginning of
> line.  The patch is against Emacs Vcs-Git ba7322c dated 2012-02-29.

I must be missing something.  All it does is change a "\t+$" to
"[ \t]+$", so it's not really "at the beginning of line" (tho there's
also a "^" in the regexp, so it really only applies to whitespace-only
lines).
I don't think we want to consider lines made up of spaces as suspicious.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10956; Package emacs. (Thu, 22 Mar 2012 10:03:02 GMT) Full text and rfc822 format available.

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

From: jaalto <jari.aalto <at> cante.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 10956 <at> debbugs.gnu.org
Subject: Re: bug#10956: make-mode.el - improve makefile-warn-suspicious-lines
Date: Wed, 21 Mar 2012 14:52:42 -0400
On 2012-03-21 13:54, Stefan Monnier wrote:
| > Here is a small patch to check any extra whitespace at the beginning of
| > line.  The patch is against Emacs Vcs-Git ba7322c dated 2012-02-29.
| 
| I must be missing something.  All it does is change a "\t+$" to
| "[ \t]+$", so it's not really "at the beginning of line" (tho there's
| also a "^" in the regexp, so it really only applies to whitespace-only
| lines).
| I don't think we want to consider lines made up of spaces as suspicious.

It would be good if any whitespace only line were flagged as suspicious,
not just \t, like in:

    [SPACE][TAB][SPACE]
    [SPACE][TAB]
    [TAB][SPACE]
    [TAB]

These extra "whitespace" lines are easily missed unless
whitespace-mode is on.

Jari




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10956; Package emacs. (Thu, 22 Mar 2012 17:08:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: jaalto <jari.aalto <at> cante.net>
Cc: 10956 <at> debbugs.gnu.org
Subject: Re: bug#10956: make-mode.el - improve makefile-warn-suspicious-lines
Date: Thu, 22 Mar 2012 12:36:48 -0400
> | > Here is a small patch to check any extra whitespace at the beginning of
> | > line.  The patch is against Emacs Vcs-Git ba7322c dated 2012-02-29.
> | I must be missing something.  All it does is change a "\t+$" to
> | "[ \t]+$", so it's not really "at the beginning of line" (tho there's
> | also a "^" in the regexp, so it really only applies to whitespace-only
> | lines).
> | I don't think we want to consider lines made up of spaces as suspicious.
> It would be good if any whitespace only line were flagged as suspicious,
> not just \t, like in:

>     [SPACE][TAB][SPACE]
>     [SPACE][TAB]
>     [TAB][SPACE]
>     [TAB]

> These extra "whitespace" lines are easily missed unless
> whitespace-mode is on.

I notice the absence of a line with only spaces in your examples.
Would you consider such a line as suspicious?
Could you expand on why you consider your examples as suspicious?
I think I'd agree with "\t[ \t]*" since such lines behave identically to
TAB-only lines, but I'm not so sure about lines starting with a space.

Since such suspicious lines end up prompting the user, we had better be
sure they're really risky, otherwise we might bother people for no
good reason.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10956; Package emacs. (Thu, 06 Feb 2014 00:53:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 10956 <at> debbugs.gnu.org, jaalto <jari.aalto <at> cante.net>
Subject: Re: bug#10956: make-mode.el - improve makefile-warn-suspicious-lines
Date: Wed, 05 Feb 2014 16:51:33 -0800
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

> I notice the absence of a line with only spaces in your examples.
> Would you consider such a line as suspicious?
> Could you expand on why you consider your examples as suspicious?
> I think I'd agree with "\t[ \t]*" since such lines behave identically to
> TAB-only lines, but I'm not so sure about lines starting with a space.
>
> Since such suspicious lines end up prompting the user, we had better be
> sure they're really risky, otherwise we might bother people for no
> good reason.

More information was requested a year ago, but no further progress seems
to have been made.  I'm closing this bug report now, but if you still
think that these lines should be suspicious, please reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




bug closed, send any further explanations to 10956 <at> debbugs.gnu.org and Jari Aalto <jari.aalto <at> cante.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 06 Feb 2014 00:53:02 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. (Thu, 06 Mar 2014 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 105 days ago.

Previous Next


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