Re: [perl #42170] [PATCH] Report line numbers on trailing_space.t

2007-04-01 Thread Paul Cochrane

On 30/03/07, Eric Hanchrow [EMAIL PROTECTED] wrote:

 jerry == jerry gay [EMAIL PROTECTED] writes:

jerry i've never run emacs, so i don't know the lispy analog.
jerry i'm sure somebody will chime in with it.

This does what you think it does:
(setq-default show-trailing-whitespace t)

Emacs 22 users can highlight tabs like this:
(global-hi-lock-mode 1)
(highlight-regexp \t)


These configuration options (both emacs and vim) have been added to
docs/project/cage_cleaners_guide.pod if people wish to refer to them
again.

Paul


Re: [perl #42170] [PATCH] Report line numbers on trailing_space.t

2007-03-30 Thread Eric Hanchrow
 jerry == jerry gay [EMAIL PROTECTED] writes:

jerry i've never run emacs, so i don't know the lispy analog.
jerry i'm sure somebody will chime in with it.

This does what you think it does:
(setq-default show-trailing-whitespace t)

Emacs 22 users can highlight tabs like this:
(global-hi-lock-mode 1)
(highlight-regexp \t)
--
... apart from the sanitation, the medicine,education, wine,
public order, irrigation, roads, a fresh water system, and public
health, what have the Romans ever done for us?
-- Reg, JPF



[perl #42170] [PATCH] Report line numbers on trailing_space.t

2007-03-29 Thread via RT
# New Ticket Created by  Will Coleda 
# Please include the string:  [perl #42170]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42170 


For steve_p on #parrot.

I find this a little too verbose, but would not object if someone  
applied it.

=== t/codingstd/trailing_space.t
==
--- t/codingstd/trailing_space.t(revision 4828)
+++ t/codingstd/trailing_space.t(local)
@@ -50,14 +50,13 @@
  # slurp in the file
  open( my $fh, '', $path )
  or die Cannot open '$path' for reading: $!\n;
+
+while (my $line=$fh)
  {
-local $/;
-$buf = $fh;
+if ( $line =~ m{.?[ \t]+$} ) {
+push @failed_files, $path:$.;
+}
  }
-
-if ( $buf =~ m{.?[ \t]+$}m ) {
-push @failed_files, $path;
-}
}
# check the file



--
Will Coke Coleda
[EMAIL PROTECTED]




Re: [perl #42170] [PATCH] Report line numbers on trailing_space.t

2007-03-29 Thread jerry gay

On 3/29/07, via RT Will Coleda [EMAIL PROTECTED] wrote:

# New Ticket Created by  Will Coleda
# Please include the string:  [perl #42170]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42170 


For steve_p on #parrot.

I find this a little too verbose, but would not object if someone
applied it.

=== t/codingstd/trailing_space.t
==
--- t/codingstd/trailing_space.t(revision 4828)
+++ t/codingstd/trailing_space.t(local)
@@ -50,14 +50,13 @@
  # slurp in the file
  open( my $fh, '', $path )
  or die Cannot open '$path' for reading: $!\n;
+
+while (my $line=$fh)
  {
-local $/;
-$buf = $fh;
+if ( $line =~ m{.?[ \t]+$} ) {
+push @failed_files, $path:$.;
+}
  }
-
-if ( $buf =~ m{.?[ \t]+$}m ) {
-push @failed_files, $path;
-}
}
# check the file


do you really need a line number in test output? in vim:
  / $

will find you every line with trailing spaces.
better yet, do like i do, and set this in your .vimrc:
 set list
 set listchars=trail:-,tab:\.\

NOTE: there is a trailing space on the line above. it's IMPORTANT.
not only will this show you trailing spaces (as dashes), but leading
tabs (as dot followed by space). that way you'll notice and fix them
before you commit. i've never run emacs, so i don't know the lispy
analog. i'm sure somebody will chime in with it.
~jerry