unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10956: make-mode.el - improve makefile-warn-suspicious-lines
@ 2012-03-06 12:22 Jari Aalto
  2012-03-21 17:54 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Jari Aalto @ 2012-03-06 12:22 UTC (permalink / raw)
  To: 10956

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

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@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)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-progmodes-make-mode.el-makefile-warn-suspicious-line.patch --]
[-- Type: text/x-diff, Size: 1068 bytes --]

From a24603ab69a72fc693119f2885e76ebfad1dbc4f Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto@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@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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#10956: make-mode.el - improve makefile-warn-suspicious-lines
  2012-03-06 12:22 bug#10956: make-mode.el - improve makefile-warn-suspicious-lines Jari Aalto
@ 2012-03-21 17:54 ` Stefan Monnier
  2012-03-21 18:52   ` jaalto
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-03-21 17:54 UTC (permalink / raw)
  To: Jari Aalto; +Cc: 10956

> 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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10956: make-mode.el - improve makefile-warn-suspicious-lines
  2012-03-21 17:54 ` Stefan Monnier
@ 2012-03-21 18:52   ` jaalto
  2012-03-22 16:36     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: jaalto @ 2012-03-21 18:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10956

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10956: make-mode.el - improve makefile-warn-suspicious-lines
  2012-03-21 18:52   ` jaalto
@ 2012-03-22 16:36     ` Stefan Monnier
  2014-02-06  0:51       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-03-22 16:36 UTC (permalink / raw)
  To: jaalto; +Cc: 10956

> | > 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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10956: make-mode.el - improve makefile-warn-suspicious-lines
  2012-03-22 16:36     ` Stefan Monnier
@ 2014-02-06  0:51       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-06  0:51 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10956, jaalto

Stefan Monnier <monnier@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/





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-06  0:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-06 12:22 bug#10956: make-mode.el - improve makefile-warn-suspicious-lines Jari Aalto
2012-03-21 17:54 ` Stefan Monnier
2012-03-21 18:52   ` jaalto
2012-03-22 16:36     ` Stefan Monnier
2014-02-06  0:51       ` Lars Ingebrigtsen

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).