r46494 - in /branches/upstream/libterm-readline-perl-perl/current: CHANGES META.yml ReadLine/Perl.pm ReadLine/readline.pm test.pl
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Thu Oct 29 02:16:50 UTC 2009
Author: jawnsy-guest
Date: Thu Oct 29 02:16:45 2009
New Revision: 46494
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46494
Log:
[svn-upgrade] Integrating new upstream version, libterm-readline-perl-perl (1.0303)
Added:
branches/upstream/libterm-readline-perl-perl/current/META.yml (with props)
Modified:
branches/upstream/libterm-readline-perl-perl/current/CHANGES
branches/upstream/libterm-readline-perl-perl/current/ReadLine/Perl.pm
branches/upstream/libterm-readline-perl-perl/current/ReadLine/readline.pm
branches/upstream/libterm-readline-perl-perl/current/test.pl
Modified: branches/upstream/libterm-readline-perl-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-perl-perl/current/CHANGES?rev=46494&op=diff
==============================================================================
--- branches/upstream/libterm-readline-perl-perl/current/CHANGES (original)
+++ branches/upstream/libterm-readline-perl-perl/current/CHANGES Thu Oct 29 02:16:45 2009
@@ -210,3 +210,13 @@
if $inDOS too.
Bind C-x @ c and C-x @ m too (as in Emacs).
+1.0303: Would not allow macros with space in them.
+ Never try to display the whole prompt unless it is shorter than
+ screen width ;-).
+ Test supports PERL_RL_TEST_PROMPT_MINLEN in environment.
+ Test hints at special significance of the word `exit'.
+ Avoid a warning on unexpected variable assign (thanks to Robin Barker).
+ Change error message for unknown method.
+ Protect global variables during WINCH processing.
+ F_ReverseSearchHistory was not -w-safe (thanks to Peter Valdemar)
+ Test for $ENV{PERL_MM_NONINTERACTIVE} also to abort tests.
Added: branches/upstream/libterm-readline-perl-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-perl-perl/current/META.yml?rev=46494&op=file
==============================================================================
--- branches/upstream/libterm-readline-perl-perl/current/META.yml (added)
+++ branches/upstream/libterm-readline-perl-perl/current/META.yml Thu Oct 29 02:16:45 2009
@@ -1,0 +1,20 @@
+--- #YAML:1.0
+name: Term-ReadLine-Perl
+version: 1.0303
+abstract: ~
+author: []
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires: {}
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.54
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Propchange: branches/upstream/libterm-readline-perl-perl/current/META.yml
------------------------------------------------------------------------------
svn:executable = *
Modified: branches/upstream/libterm-readline-perl-perl/current/ReadLine/Perl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-perl-perl/current/ReadLine/Perl.pm?rev=46494&op=diff
==============================================================================
--- branches/upstream/libterm-readline-perl-perl/current/ReadLine/Perl.pm (original)
+++ branches/upstream/libterm-readline-perl-perl/current/ReadLine/Perl.pm Thu Oct 29 02:16:45 2009
@@ -3,7 +3,7 @@
@ISA = qw(Term::ReadLine::Stub Term::ReadLine::Compa Term::ReadLine::Perl::AU);
#require 'readline.pl';
-$VERSION = $VERSION = 1.0302;
+$VERSION = $VERSION = 1.0303;
sub readline {
shift;
@@ -117,7 +117,7 @@
sub AUTOLOAD {
{ $AUTOLOAD =~ s/.*:://; } # preserve match data
my $name = "readline::rl_$AUTOLOAD";
- die "Cannot do `$AUTOLOAD' in Term::ReadLine::Perl"
+ die "Unknown method `$AUTOLOAD' in Term::ReadLine::Perl"
unless exists $readline::{"rl_$AUTOLOAD"};
*$AUTOLOAD = sub { shift; &$name };
goto &$AUTOLOAD;
Modified: branches/upstream/libterm-readline-perl-perl/current/ReadLine/readline.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-perl-perl/current/ReadLine/readline.pm?rev=46494&op=diff
==============================================================================
--- branches/upstream/libterm-readline-perl-perl/current/ReadLine/readline.pm (original)
+++ branches/upstream/libterm-readline-perl-perl/current/ReadLine/readline.pm Thu Oct 29 02:16:45 2009
@@ -52,7 +52,7 @@
## while writing this), and for Roland Schemers whose line_edit.pl I used
## as an early basis for this.
##
-$VERSION = $VERSION = '1.0302';
+$VERSION = $VERSION = '1.0303';
## - Changes from Slaven Rezic (slaven at rezic.de):
## * reverted the usage of $ENV{EDITOR} to set startup mode
@@ -403,6 +403,7 @@
sub get_window_size
{
my $sig = shift;
+ local($., $@, $!, $^E, $?); # Preserve $! etc; the rest for hooks
my ($num_cols,$num_rows);
if (defined $term_readkey) {
@@ -1438,7 +1439,7 @@
&rl_set($1, $2, $file);
} elsif (m/^\s*(\S+):\s+("(?:\\.|[^\\\"])*"|'(\\.|[^\\\'])*')/) { # Allow trailing comment
&rl_bind($1, $2);
- } elsif (m/^\s*(\S+):\s+(\S+)/) { # Allow trailing comment
+ } elsif (m/^\s*(\S+|"[^\"]+"):\s+(\S+)/) { # Allow trailing comment
&rl_bind($1, $2);
} else {
chomp;
@@ -1909,7 +1910,8 @@
}
##
- ## Now $dline is what we'd like to display.
+ ## Now $dline is what we'd like to display (with a prepended prompt)
+ ## $D is the position of the cursor on it.
##
## If it's too long to fit on the line, we must decide what we can fit.
##
@@ -1924,13 +1926,15 @@
## Similarly, if the line needs chopped off, we make sure that the
## placement of the tailing '>' won't screw up any 2-byte character in
## the vicinity.
- ##
- if ($D == length($prompt)) {
- $si = 0; ## display from the beginning....
- } elsif ($si >= $D) { # point to the left
+
+ # Now $si keeps the value from previous display
+ if ($D == length($prompt) # If prompts fits exactly, show only if need not show trailing '>'
+ and length($prompt) < $rl_screen_width - (0 != length $dline)) {
+ $si = 0; ## prefer displaying the whole prompt
+ } elsif ($si >= $D) { # point to the left of what was displayed
$si = &max(0, $D - $rl_margin);
$si-- if $si > 0 && $si != length($prompt) && !&OnSecondByte($si);
- } elsif ($si + $rl_screen_width <= $D) { # Point to the right
+ } elsif ($si + $rl_screen_width <= $D) { # Point to the right of ...
$si = &min(length($dline), ($D - $rl_screen_width) + $rl_margin);
$si-- if $si > 0 && $si != length($prompt) && !&OnSecondByte($si);
} elsif (length($dline) - $si < $rl_screen_width - $rl_margin and $si) {
@@ -1957,7 +1961,7 @@
##
$dline = substr($dline, $si, $thislen);
$delta = $D - $si; ## delta is cursor distance from beginning of $dline.
- if (defined $bsel) {
+ if (defined $bsel) { # Highlight the selected part
$bsel -= $si;
$esel = $delta;
($bsel, $esel) = ($esel, $bsel) if $bsel > $esel;
@@ -2346,7 +2350,8 @@
# Skip unknown variables:
return unless defined $ {'readline::'}{"var_$_"};
- local(*V) = $ {'readline::'}{"var_$_"};
+ local(*V); # avoid <Undefined value assign to typeglob> warning
+ { local $^W; *V = $ {'readline::'}{"var_$_"}; }
if (!defined($V)) { # XXX Duplicate check?
warn("Warning$InputLocMsg:\n".
" Invalid variable `$var'\n") if $^W;
@@ -2904,7 +2909,7 @@
&redisplay( '('.($reverse?'reverse-':'') ."i-search) `$searchstr': ");
$c = &getc_with_pending;
- if ($KeyMap[ord($c)] eq 'F_ReverseSearchHistory') {
+ if (($KeyMap[ord($c)] || 0) eq 'F_ReverseSearchHistory') {
if ($reverse && $I != -1) {
if ($tmp = &search($I-1,$searchstr), $tmp >= 0) {
$I = $tmp;
@@ -2913,7 +2918,7 @@
}
}
$reverse = 1;
- } elsif ($KeyMap[ord($c)] eq 'F_ForwardSearchHistory') {
+ } elsif (($KeyMap[ord($c)] || 0) eq 'F_ForwardSearchHistory') {
if (!$reverse && $I != -1) {
if ($tmp = &search($I+1,$searchstr), $tmp >= 0) {
$I = $tmp;
Modified: branches/upstream/libterm-readline-perl-perl/current/test.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libterm-readline-perl-perl/current/test.pl?rev=46494&op=diff
==============================================================================
--- branches/upstream/libterm-readline-perl-perl/current/test.pl (original)
+++ branches/upstream/libterm-readline-perl-perl/current/test.pl Thu Oct 29 02:16:45 2009
@@ -9,8 +9,9 @@
use Carp;
$SIG{__WARN__} = sub { warn Carp::longmess(@_) };
-if ($ENV{AUTOMATED_TESTING}) {
- print "1..0 # skip: \$ENV{AUTOMATED_TESTING} is TRUE\n";
+my $ev;
+if ($ENV{$ev = 'AUTOMATED_TESTING'} or $ENV{$ev = 'PERL_MM_NONINTERACTIVE'}) {
+ print "1..0 # skip: \$ENV{$ev} is TRUE\n";
exit;
}
@@ -29,6 +30,9 @@
$no_print = $ARGV[0] eq '--no-print';
}
$prompt = "Enter arithmetic or Perl expression: ";
+if ((my $l = $ENV{PERL_RL_TEST_PROMPT_MINLEN} | 0) > length $prompt) {
+ $prompt =~ s/(?=:)/ ' ' x ($l - length $prompt)/e;
+}
$OUT = $term->OUT || STDOUT;
%features = %{ $term->Features };
if (%features) {
@@ -38,7 +42,15 @@
} else {
print $OUT "No additional features present.\n";
}
-print $OUT "Flipping rl_default_selected each line.\n";
+print $OUT "\n Flipping rl_default_selected each line.\n";
+print $OUT <<EOP;
+
+ Hint: Entering the word
+ exit
+ would exit the test. ;-) (If feature 'preput' is present,
+ this word should be already entered.)
+
+EOP
while ( defined ($_ = $term->readline($prompt, "exit")) ) {
$res = eval($_);
warn $@ if $@;
More information about the Pkg-perl-cvs-commits
mailing list