r2379 - in packages/libterm-readline-perl-perl/trunk: . ReadLine debian

Krzysztof Krzyzaniak eloy at costa.debian.org
Thu Mar 16 13:10:58 UTC 2006


Author: eloy
Date: 2006-03-16 13:10:57 +0000 (Thu, 16 Mar 2006)
New Revision: 2379

Modified:
   packages/libterm-readline-perl-perl/trunk/CHANGES
   packages/libterm-readline-perl-perl/trunk/ReadLine/Perl.pm
   packages/libterm-readline-perl-perl/trunk/ReadLine/readline.pm
   packages/libterm-readline-perl-perl/trunk/debian/changelog
   packages/libterm-readline-perl-perl/trunk/test.pl
Log:
eloy: new upstream release


Modified: packages/libterm-readline-perl-perl/trunk/CHANGES
===================================================================
--- packages/libterm-readline-perl-perl/trunk/CHANGES	2006-03-16 12:57:19 UTC (rev 2378)
+++ packages/libterm-readline-perl-perl/trunk/CHANGES	2006-03-16 13:10:57 UTC (rev 2379)
@@ -163,3 +163,9 @@
 	Untested Win32 support for cut&paste.
 	Alias $var_DeleteSelection for $rl_delete_selection (thus accessible
 		via .inputrc).
+1.0208:	Allow 2-arg form for test.pl
+	Open CONIN$ on Win (if asked for CON), and open RW (bug in Win devdriver).
+	Allow non-first Digit-Arguments to be escaped too.
+	Allow Alt-char translation to \M-char on DOSISH.
+	Apparently, self-loaded empty subroutines are still crashing.
+		Work-around: put "1;" into non-implemented stuff.

Modified: packages/libterm-readline-perl-perl/trunk/ReadLine/Perl.pm
===================================================================
--- packages/libterm-readline-perl-perl/trunk/ReadLine/Perl.pm	2006-03-16 12:57:19 UTC (rev 2378)
+++ packages/libterm-readline-perl-perl/trunk/ReadLine/Perl.pm	2006-03-16 13:10:57 UTC (rev 2379)
@@ -3,7 +3,7 @@
 @ISA = qw(Term::ReadLine::Stub Term::ReadLine::Compa Term::ReadLine::Perl::AU);
 #require 'readline.pl';
 
-$VERSION = $VERSION = 0.99;
+$VERSION = $VERSION = 1.0208;
 
 sub readline {
   shift; 
@@ -43,7 +43,12 @@
   if (!@_) {
     if (!defined $term) {
       ($IN,$OUT) = Term::ReadLine->findConsole();
-      open(IN,"<$IN") || croak "Cannot open $IN for read";
+      # Old Term::ReadLine did not have a workaround for a bug in Win devdriver
+      $IN = 'CONIN$' if $^O eq 'MSWin32' and "\U$IN" eq 'CON';
+      open IN,
+	# A workaround for another bug in Win device driver
+	(($IN eq 'CONIN$' and $^O eq 'MSWin32') ? "+< $IN" : "< $IN")
+	  or croak "Cannot open $IN for read";
       open(OUT,">$OUT") || croak "Cannot open $OUT for write";
       $readline::term_IN = \*IN;
       $readline::term_OUT = \*OUT;

Modified: packages/libterm-readline-perl-perl/trunk/ReadLine/readline.pm
===================================================================
--- packages/libterm-readline-perl-perl/trunk/ReadLine/readline.pm	2006-03-16 12:57:19 UTC (rev 2378)
+++ packages/libterm-readline-perl-perl/trunk/ReadLine/readline.pm	2006-03-16 13:10:57 UTC (rev 2379)
@@ -49,7 +49,7 @@
 ## while writing this), and for Roland Schemers whose line_edit.pl I used
 ## as an early basis for this.
 ##
-$VERSION = $VERSION = '1.0207';
+$VERSION = $VERSION = '1.0208';
 
 ##            - Changes from Slaven Rezic (slaven at rezic.de):
 ##		* reverted the usage of $ENV{EDITOR} to set startup mode
@@ -722,18 +722,18 @@
 		  qq/"\0\4"/,  'YankClipboard',    # 4: <Shift>+<Insert>
 		  qq/"\0\5"/,  'KillRegionClipboard',    # 5: <Shift>+<Delete>
 		  qq/"\0\16"/, 'Undo', # 14: <Alt>+<Backspace>
-		  qq/"\0\23"/, 'RevertLine', # 19: <Alt>+<R>
-		  qq/"\0\24"/, 'TransposeWords', # 20: <Alt>+<T>
-		  qq/"\0\25"/, 'YankPop', # 21: <Alt>+<Y>
-		  qq/"\0\26"/, 'UpcaseWord', # 22: <Alt>+<U>
-		  qq/"\0\31"/, 'ReverseSearchHistory', # 25: <Alt>+<P>
-		  qq/"\0\40"/, 'KillWord', # 32: <Alt>+<D>
-		  qq/"\0\41"/, 'ForwardWord', # 33: <Alt>+<F>
-		  qq/"\0\46"/, 'DownCaseWord', # 38: <Alt>+<L>
+#		  qq/"\0\23"/, 'RevertLine', # 19: <Alt>+<R>
+#		  qq/"\0\24"/, 'TransposeWords', # 20: <Alt>+<T>
+#		  qq/"\0\25"/, 'YankPop', # 21: <Alt>+<Y>
+#		  qq/"\0\26"/, 'UpcaseWord', # 22: <Alt>+<U>
+#		  qq/"\0\31"/, 'ReverseSearchHistory', # 25: <Alt>+<P>
+#		  qq/"\0\40"/, 'KillWord', # 32: <Alt>+<D>
+#		  qq/"\0\41"/, 'ForwardWord', # 33: <Alt>+<F>
+#		  qq/"\0\46"/, 'DownCaseWord', # 38: <Alt>+<L>
 		  #qq/"\0\51"/, 'TildeExpand', # 41: <Alt>+<\'>
-		  qq/"\0\56"/, 'CapitalizeWord', # 46: <Alt>+<C>
-		  qq/"\0\60"/, 'BackwardWord', # 48: <Alt>+<B>
-		  qq/"\0\61"/, 'ForwardSearchHistory', # 49: <Alt>+<N>
+#		  qq/"\0\56"/, 'CapitalizeWord', # 46: <Alt>+<C>
+#		  qq/"\0\60"/, 'BackwardWord', # 48: <Alt>+<B>
+#		  qq/"\0\61"/, 'ForwardSearchHistory', # 49: <Alt>+<N>
 		  #qq/"\0\64"/, 'YankLastArg', # 52: <Alt>+<.>
 		  qq/"\0\65"/, 'PossibleCompletions', # 53: <Alt>+</>
 		  qq/"\0\107"/, 'BeginningOfLine', # 71: <Home>
@@ -768,6 +768,11 @@
 	defined $ {"$KeyMap{name}_27"}[ord $_];
       push(@add_bindings, "M-$_", 'DoLowercaseVersion');
     }
+    if ($inDOS) {
+	# Default translation of Alt-char
+	$ {"$KeyMap{name}_0"}{'Esc'} = *{"$KeyMap{name}_27"};
+	$ {"$KeyMap{name}_0"}{'default'} = 'F_DoEscVersion';
+    }
     &rl_bind(@add_bindings);
     
     # Vi input mode.
@@ -1556,6 +1561,7 @@
 	    $D = 0;
 	    $cmd = 'F_BackwardDeleteChar' if $cmd eq 'F_DeleteChar';
 	}
+	undef $doingNumArg;
 	&$cmd(1, ord($input));			## actually execute input
 	$rl_first_char = 0;
 	*KeyMap = $var_EditingMode;           # JP: added
@@ -2624,7 +2630,10 @@
     $D = $olddot if defined($olddot);
 }
 
-sub F_TransposeWords { } ## not implemented yet
+sub F_TransposeWords {
+    1;
+    ## not implemented yet
+}
 
 ##
 ## Switch char at dot with char before it.
@@ -2835,9 +2844,16 @@
     &TextInsert($_[0], $KillBuffer);
 }
 
-sub F_YankPop    { } ## not implemented yet
-sub F_YankNthArg { } ## not implemented yet
+sub F_YankPop    {
+   1;
+   ## not implemented yet
+}
 
+sub F_YankNthArg {
+   1;
+   ## not implemented yet
+}
+
 ##
 ## Kill to the end of the current word. If not on a word, kill to
 ## the end of the next word.
@@ -2892,6 +2908,25 @@
 }
 
 ##
+## If the character that got us here is Alt-Char,
+## do the Esc Char equiv...
+##
+sub F_DoEscVersion
+{
+    my ($ord, $t) = $_[1];
+    &F_Ding unless $KeyMap{'Esc'};
+    for $t (([ord 'w', '`1234567890-='],
+		   [ord ',', 'zxcvbnm,./\\'],
+		   [16,      'qwertyuiop[]'],
+		   [ord(' ') - 2, 'asdfghjkl;\''])) {
+      next unless $ord >= $t->[0] and $ord < $t->[0] + length($t->[1]);
+      $ord = ord substr $t->[1], $ord - $t->[0], 1;
+      return &do_command($KeyMap{'Esc'}, $_[0], $ord);
+    }
+    &F_Ding;
+}
+
+##
 ## Undo one level.
 ##
 sub F_Undo
@@ -2963,29 +2998,31 @@
 sub F_DigitArgument
 {
     my $in = chr $_[1];
-    my ($NumericArg, $sign, $explicit) = (1, 1, 0);
+    my ($NumericArg, $sawDigit) = (1, 0);
     my ($increment, $ord);
+    ($NumericArg, $sawDigit) = ($_[0], $_[0] !~ /e0$/i)
+	if $doingNumArg;	# XXX What if Esc-- 1 ?
 
     do
     {
 	$ord = ord $in;
 	if (defined($KeyMap[$ord]) && $KeyMap[$ord] eq 'F_UniversalArgument') {
 	    $NumericArg *= 4;
-	} elsif ($ord == ord('-') && !$explicit) {
-	    $sign = -$sign;
-	    $NumericArg = $sign;
+	} elsif ($ord == ord('-') && !$sawDigit) {
+	    $NumericArg = -$NumericArg;
 	} elsif ($ord >= ord('0') && $ord <= ord('9')) {
-	    $increment = ($ord - ord('0')) * $sign;
-	    if ($explicit) {
+	    $increment = ($ord - ord('0')) * ($NumericArg < 0 ? -1 : 1);
+	    if ($sawDigit) {
 		$NumericArg = $NumericArg * 10 + $increment;
 	    } else {
 		$NumericArg = $increment;
-		$explicit = 1;
+		$sawDigit = 1;
 	    }
 	} else {
 	    local(*KeyMap) = $var_EditingMode;
 	    &redisplay();
-	    &do_command(*KeyMap, $NumericArg, $ord);
+	    $doingNumArg = 1;		# Allow NumArg inside NumArg
+	    &do_command(*KeyMap, $NumericArg . ($sawDigit ? '': 'e0'), $ord);
 	    return;
 	}
 	## make sure it's not toooo big.

Modified: packages/libterm-readline-perl-perl/trunk/debian/changelog
===================================================================
--- packages/libterm-readline-perl-perl/trunk/debian/changelog	2006-03-16 12:57:19 UTC (rev 2378)
+++ packages/libterm-readline-perl-perl/trunk/debian/changelog	2006-03-16 13:10:57 UTC (rev 2379)
@@ -1,3 +1,9 @@
+libterm-readline-perl-perl (1.0208-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org>  Thu, 16 Mar 2006 13:57:26 +0100
+
 libterm-readline-perl-perl (1.0207-1) unstable; urgency=low
 
   * New upstream release (closes: #209263) (closes: #145383)

Modified: packages/libterm-readline-perl-perl/trunk/test.pl
===================================================================
--- packages/libterm-readline-perl-perl/trunk/test.pl	2006-03-16 12:57:19 UTC (rev 2378)
+++ packages/libterm-readline-perl-perl/trunk/test.pl	2006-03-16 13:10:57 UTC (rev 2379)
@@ -16,6 +16,10 @@
 
 if (!@ARGV) {
   $term = new Term::ReadLine 'Simple Perl calc';
+} elsif (@ARGV == 2) {
+  open(IN,"<$ARGV[0]");
+  open(OUT,">$ARGV[1]");
+  $term = new Term::ReadLine 'Simple Perl calc', \*IN, \*OUT;
 } elsif ($ARGV[0] =~ m|^/dev|) {
   open(IN,"<$ARGV[0]");
   open(OUT,">$ARGV[0]");




More information about the Pkg-perl-cvs-commits mailing list