This is an automated email from the git hooks/post-receive script. bengen pushed a commit to branch master in repository sepia.
commit 479d5873e2ede083d1235dcf53774f29e0d58e76 Author: Hilko Bengen <[email protected]> Date: Tue May 15 23:07:50 2007 +0200 Imported Debian patch 0.72-1 --- ChangeLog | 23 +++++++++ META.yml | 4 +- Makefile.PL | 14 ++++-- debian/changelog | 6 +++ debian/control | 8 +++- debian/emacsen-install | 2 +- debian/emacsen-remove | 2 +- debian/emacsen-startup | 21 ++------- debian/watch | 3 ++ lib/Sepia.pm | 125 +++++++++++++++++++++++++++++++++++++++---------- sepia.el | 9 ++-- 11 files changed, 162 insertions(+), 55 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d226b8..7ea9ed4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2007-05-12 Sean O'Rourke <[email protected]> + + * VERSION: 0.72 + * Makefile.PL: add license. + +2007-05-09 Sean O'Rourke <[email protected]> + + * VERSION: 0.71 + * sepia.el (sepia-load-file): set inhibit-read-only when + displaying errors. + * lib/Sepia.pm (repl_methods): walk ISA hierarchy looking for + functions (XXX: this is much too coarse). + (repl_help): use %REPL_DOC to hold command documentation for + easier extension. + (repl): display error on canceled continued statement. + +2007-05-07 Sean O'Rourke <[email protected]> + + * lib/Sepia.pm (repl_strict): add 'strict mode' (thanks to + Lexical::Persistence) for those who swing that way (I don't), + inspired by Devel::REPL. + (repl_wantarray): Fix logic. + 2007-04-25 Sean O'Rourke <[email protected]> * VERSION: 0.70 diff --git a/META.yml b/META.yml index 0588911..0227425 100644 --- a/META.yml +++ b/META.yml @@ -1,8 +1,8 @@ --- #YAML:1.0 name: Sepia -version: 0.70 +version: 0.72 abstract: Simple Emacs-Perl InterAction -license: ~ +license: perl generated_by: ExtUtils::MakeMaker version 6.31 distribution_type: module requires: diff --git a/Makefile.PL b/Makefile.PL index 4bb6a02..fc8f4fa 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -12,7 +12,8 @@ WriteMakefile( ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (AUTHOR => "Sean O'Rourke <seano\@cpan.org>", ABSTRACT => 'Simple Emacs-Perl InterAction') - : ()) + : ()), + LICENSE => 'perl' ); print <<EOS; @@ -25,7 +26,14 @@ eval { require PadWalker }; if ($@) { print <<EOS; -Some features of the interactive debugger require PadWalker >= 1.0. -Please install it to enable them. +Stack/lexical inspection requires PadWalker >= 1.0. +EOS +} + +eval { require Lexical::Persistence }; +if ($@) { + print <<EOS; + +Strict mode requires Lexical::Persistence. EOS } diff --git a/debian/changelog b/debian/changelog index 620925a..08fdfa0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sepia (0.72-1) unstable; urgency=low + + * New upstream release + + -- Hilko Bengen <[email protected]> Tue, 15 May 2007 23:07:50 +0200 + sepia (0.70-1) unstable; urgency=low * New upstream release diff --git a/debian/control b/debian/control index 1b7a633..504ad87 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,13 @@ Standards-Version: 3.7.2 Package: sepia Architecture: all -Depends: ${perl:Depends}, libpadwalker-perl (>= 1.0), libmodule-info-perl, libsub-uplevel-perl, emacs-snapshot +Depends: ${perl:Depends}, + libpadwalker-perl (>= 1.0), libmodule-info-perl, libsub-uplevel-perl, + emacs21 | emacs-snapshot, + emacs-goodies-el | emacs-snapshot, + semi | emacs-snapshot, + flim | emacs-snapshot, + apel | emacs-snapshot Recommends: w3m-el Description: Simple Emacs-Perl InterAction Sepia is a set of features to make Emacs a better tool for Perl diff --git a/debian/emacsen-install b/debian/emacsen-install index 666ea86..fa4f9ce 100644 --- a/debian/emacsen-install +++ b/debian/emacsen-install @@ -9,7 +9,7 @@ FLAVOR=$1 PACKAGE=sepia case ${FLAVOR} in -# emacs21);; + emacs21);; emacs-snapshot);; *) exit 0;; esac diff --git a/debian/emacsen-remove b/debian/emacsen-remove index 638a812..0529381 100644 --- a/debian/emacsen-remove +++ b/debian/emacsen-remove @@ -5,7 +5,7 @@ FLAVOR=$1 PACKAGE=sepia case ${FLAVOR} in -# emacs21);; + emacs21);; emacs-snapshot);; *) exit 0;; esac diff --git a/debian/emacsen-startup b/debian/emacsen-startup index af50e3b..8753643 100644 --- a/debian/emacsen-startup +++ b/debian/emacsen-startup @@ -1,26 +1,11 @@ ;; -*-emacs-lisp-*- -;; -;; Emacs startup file, e.g. /etc/emacs/site-start.d/50sepia.el -;; for the Debian sepia package -;; -;; Originally contributed by Nils Naumann <[email protected]> -;; Modified by Dirk Eddelbuettel <[email protected]> -;; Adapted for dh-make by Jim Van Zandt <[email protected]> - -;; The sepia package follows the Debian/GNU Linux 'emacsen' policy and -;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, -;; xemacs19, emacs20, xemacs20...). The compiled code is then -;; installed in a subdirectory of the respective site-lisp directory. -;; We have to add this to the load-path: (let ((package-dir (concat "/usr/share/" (symbol-name flavor) "/site-lisp/sepia"))) + ;; If package-dir does not exist, the sepia package must have ;; removed but not purged, and we should skip the setup. - (when (file-directory-p package-dir) (setq load-path (cons package-dir load-path)) -; (autoload 'sepia-init "sepia" -; "foo!" t) - )) - + (autoload 'sepia-init "sepia" + "Perform the initialization necessary to start Sepia." t ))) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..72ec679 --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=3 + +http://www.cpan.org/modules/by-module/Sepia/Sepia-(.*)\.tar\.gz diff --git a/lib/Sepia.pm b/lib/Sepia.pm index 47900ee..14b10b3 100644 --- a/lib/Sepia.pm +++ b/lib/Sepia.pm @@ -6,7 +6,7 @@ Sepia - Simple Emacs-Perl Interface =cut -$VERSION = '0.70'; +$VERSION = '0.72'; @ISA = qw(Exporter); require Exporter; @@ -17,13 +17,36 @@ use Module::Info; use Text::Abbrev; use Carp; use B; + +use vars qw($PS1 $dies $STOPDIE $STOPWARN %REPL %RK %REPL_DOC + $PACKAGE $WANTARRAY $PRINTER $STRICT); + BEGIN { eval { require PadWalker; import PadWalker qw(peek_my) }; if ($@) { *peek_my = sub { +{ } }; } + eval { require Lexical::Persistence; import Lexical::Persistence }; + if ($@) { + *repl_strict = sub { + print STDERR "Strict mode requires Lexical::Persistence.\n"; + 0; + }; + } else { + *repl_strict = sub { + my $x = as_boolean(shift, $STRICT); + if ($x && !$STRICT) { + $STRICT = new Lexical::Persistence; + } elsif (!$x) { + undef $STRICT; + } + 0; + }; + } } +=over 4 + =item C<@compls = completions($string [, $type])> Find a list of completions for C<$string> with glob type $type. @@ -515,10 +538,10 @@ Behavior is controlled in part through the following package-globals: =item C<$PRINTER> -- result printer (default: print_dumper) +=back + =cut -use vars qw($PS1 $dies $STOPDIE $STOPWARN %REPL %RK - $PACKAGE $WANTARRAY $PRINTER); BEGIN { no strict; $PS1 = "> "; @@ -530,11 +553,32 @@ BEGIN { $PRINTER = \&Sepia::print_dumper; %REPL = (help => \&Sepia::repl_help, cd => \&Sepia::repl_chdir, + methods => \&Sepia::repl_methods, package => \&Sepia::repl_package, who => \&Sepia::repl_who, wantarray => \&Sepia::repl_wantarray, format => \&Sepia::repl_format, + strict => \&Sepia::repl_strict, ); + %REPL_DOC = ( + cd => + 'cd DIR Change directory to DIR', + format => + 'format [dumper|dump|yaml|plain] + Set output formatter (default: dumper)', + help => + 'help Display this message', + methods => + 'methods X List methods for reference or package X', + package => + 'package PACKAGE Set evaluation package to PACKAGE', + strict => + 'strict [0|1] Turn \'use strict\' mode on or off', + wantarray => + 'wantarray [0|1] Set or toggle evaluation context', + who => + 'who PACKAGE List variables and subs in PACKAGE', + ); %RK = abbrev keys %REPL; } @@ -587,17 +631,11 @@ sub debug_inspect sub repl_help { - print <<EOS; -REPL commands (prefixed with ','): - cd DIR Change directory to DIR - define - format [dumper|dump|yaml|plain] - Set output formatter (default: dumper) - help Display this message - package PACKAGE Set evaluation package to PACKAGE - wantarray [0|1] Set or toggle evaluation context - who PACKAGE List variables and subs in PACKAGE -EOS + print "REPL commands (prefixed with ','):\n"; + for (sort keys %REPL) { + print " ", + exists $REPL_DOC{$_} ? "$REPL_DOC{$_}\n": "$_ (undocumented)\n"; + } 0; } @@ -654,10 +692,37 @@ sub repl_who 0; } -sub repl_wantarray +sub methods +{ + my $pack = shift; + no strict; + (grep(defined &{"$pack\::$_"}, keys %{$pack.'::'}), + defined @{$pack.'::ISA'} ? (map methods($_), @{$pack.'::ISA'}) : ()); +} + +sub repl_methods { my $x = shift; - $WANTARRAY = defined $x ? $x : !$WANTARRAY; + $x =~ s/^\s+//; + $x =~ s/\s+$//; + if ($x =~ /^\$/) { + $x = eval "ref $x"; + return 1 if $@; + } + Sepia::printer [methods $x]; + 0; +} + +sub as_boolean +{ + my ($val, $cur) = @_; + $val =~ s/\s+//g; + length($val) ? $val : !$cur; +} + +sub repl_wantarray +{ + $WANTARRAY = as_boolean shift, $WANTARRAY; 0; } @@ -704,15 +769,25 @@ sub repl_eval my ($buf, $wantarray, $pkg) = @_; no strict; local $PACKAGE = $pkg || $PACKAGE; - $buf = "do { package $PACKAGE; no strict; $buf }"; - my $wa = $WANTARRAY; - if (!defined $wa) { - $wa = wantarray ? 'ARRAY' : 'SCALAR'; - } - if ($wa) { - eval $buf; + if ($STRICT) { + if (!$WANTARRAY) { + $buf = 'scalar($buf)'; + } + my $ctx = join(',', keys %{$STRICT->get_context('_')}); + $ctx = $ctx ? "my ($ctx);" : ''; + $buf = eval "sub { package $PACKAGE; use strict; $ctx $buf }"; + if ($@) { + print STDERR "ERROR\n$@\n"; + return; + } + $STRICT->call($buf); } else { - scalar eval $buf; + $buf = "do { package $PACKAGE; no strict; $buf }"; + if ($WANTARRAY) { + eval $buf; + } else { + scalar eval $buf; + } } } @@ -814,7 +889,7 @@ sub repl if ($@ =~ /at EOF$/m) { ## Possibly-incomplete line if ($in eq "\n") { - print "*** cancel ***\n", prompt; + print "Error:\n$@\n*** cancel ***\n", prompt; $buf = ''; } else { print ">> "; diff --git a/sepia.el b/sepia.el index c4a1b33..87634e9 100644 --- a/sepia.el +++ b/sepia.el @@ -665,10 +665,11 @@ also rebuild the xref database." (when (and collect-warnings (> (length errs) 1)) (with-current-buffer (get-buffer-create collect-warnings) - (delete-region (point-min) (point-max)) - (insert errs) - (sepia-display-errors (point-min) (point-max)) - (pop-to-buffer (current-buffer))))) + (let ((inhibit-read-only t)) + (delete-region (point-min) (point-max)) + (insert errs) + (sepia-display-errors (point-min) (point-max)) + (pop-to-buffer (current-buffer)))))) (when rebuild-p (xref-rebuild))) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/sepia.git _______________________________________________ Pkg-perl-cvs-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits
