This is an automated email from the git hooks/post-receive script. bengen pushed a commit to branch master in repository sepia.
commit cc086cd7fe11968797a81b4f694b518d3c9ab12b Author: Hilko Bengen <ben...@debian.org> Date: Thu Apr 26 09:30:15 2007 +0200 Imported Debian patch 0.70-1 --- ChangeLog | 20 ++++ META.yml | 4 +- Makefile.PL | 17 ++- README | 19 +++- debian/changelog | 8 +- debian/control | 4 +- debian/copyright | 19 +++- lib/Sepia.pm | 34 +++--- lib/Sepia/Xref.pm | 3 +- sepia.el | 321 +++++++++++++++++++++++++++++++++++++++--------------- 10 files changed, 323 insertions(+), 126 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e98650..6d226b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2007-04-25 Sean O'Rourke <sorou...@cs.ucsd.edu> + + * VERSION: 0.70 + * README: add license. + * Makefile.PL: remove dependency on Sub::Uplevel, make PadWalker + optional. + * lib/Sepia.pm (who): add optional regex filter. + (debug_inspect): fix non-scalar printing. + * sepia.el (sepia-dwim): fix staleness; change to find + documentation for modules. + (sepia-find-module-file): new function to try sepia- and xref- + module file-finding functions. + (sepia-next): use it. + (sepia-filter-by-module,sepia-filter-by-all): remove. + (sepia-keymap): use `sepia-dwim' for M-. + +2007-04-15 Sean O'Rourke <sorou...@cs.ucsd.edu> + + * lib/Sepia.pm (who): add optional regex argument. + 2007-03-30 Sean O'Rourke <sorou...@cs.ucsd.edu> * sepia-w3m.el (sepia-module-list, sepia-package-list): added diff --git a/META.yml b/META.yml index 6a0189a..0588911 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Sepia -version: 0.69 +version: 0.70 abstract: Simple Emacs-Perl InterAction license: ~ generated_by: ExtUtils::MakeMaker version 6.31 @@ -8,9 +8,7 @@ distribution_type: module requires: B::Module::Info: 0 Data::Dumper: 0 - PadWalker: 1 Scalar::Util: 0 - Sub::Uplevel: 0 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.2.html version: 1.2 diff --git a/Makefile.PL b/Makefile.PL index 188deb2..4bb6a02 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -7,8 +7,6 @@ WriteMakefile( 'VERSION_FROM' => 'lib/Sepia.pm', # finds $VERSION 'PREREQ_PM' => { 'Data::Dumper' => 0, 'B::Module::Info' => 0, - 'PadWalker' => 1.0, - 'Sub::Uplevel' => 0, 'Scalar::Util' => 0, }, ($] >= 5.005 ? ## Add these new keywords supported since 5.005 @@ -18,7 +16,16 @@ WriteMakefile( ); print <<EOS; -*** To actually use this package in a useful way, you probably need to -*** move the Emacs Lisp files somewhere. Where will depend on your -*** installation. +NOTE: To actually use this package in a useful way, you probably need +to move the Emacs Lisp files somewhere. Where will depend on your +installation. EOS + +eval { require PadWalker }; +if ($@) { + print <<EOS; + +Some features of the interactive debugger require PadWalker >= 1.0. +Please install it to enable them. +EOS +} diff --git a/README b/README index c512eb7..84a9ed4 100644 --- a/README +++ b/README @@ -118,14 +118,15 @@ Start or switch to a Perl interaction buffer. ** Finding definitions and uses *** `M-. KEY' keys - M-. sepia-location + M-. sepia-dwim + l sepia-location a sepia-apropos A sepia-var-apropos f sepia-defs - C sepia-callees c sepia-callers - V sepia-var-defs + C sepia-callees v sepia-var-uses + V sepia-var-defs m sepia-module-find d sepia-w3m-perldoc-this j sepia-jump-to-symbol @@ -154,6 +155,13 @@ Go to a named function's definition. *** `M-. r' (`sepia-rebuild') Rebuild the Xref database. +*** `M-.' (`sepia-dwim') +Try to do the right thing with identifier at point: + * Find all definitions, if thing-at-point is a function + * Find all uses, if thing-at-point is a variable + * Find documentation, if thing-at-point is a module + * Prompt otherwise + ** Miscellany *** (`sepia-init') Perform the initialization necessary to start Sepia, a set of @@ -258,3 +266,8 @@ key components have been stolen and adapted from other packages: * Sepia::Xref is taken from B::Xref. * sepia-w3m is taken from w3m-perldoc. +* COPYRIGHT AND LICENCE +Copyright (C) 2004-2007 by Sean O'Rourke + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. diff --git a/debian/changelog b/debian/changelog index 8da4963..620925a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,12 @@ +sepia (0.70-1) unstable; urgency=low + + * New upstream release + + -- Hilko Bengen <ben...@debian.org> Thu, 26 Apr 2007 09:30:15 +0200 + sepia (0.69-1) unstable; urgency=low - * Initial Release. + * Initial (non-public) package. -- Hilko Bengen <ben...@debian.org> Tue, 24 Apr 2007 00:03:57 +0200 diff --git a/debian/control b/debian/control index 0aaf77a..1b7a633 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,13 @@ Source: sepia Section: perl Priority: optional Build-Depends: debhelper (>= 5.0.0) -Build-Depends-Indep: perl (>= 5.8.8-7), libpadwalker-perl (>= 1), libmodule-info-perl, libsub-uplevel-perl +Build-Depends-Indep: perl (>= 5.8.8-7), libpadwalker-perl (>= 1.0), libmodule-info-perl, libsub-uplevel-perl Maintainer: Hilko Bengen <ben...@debian.org> Standards-Version: 3.7.2 Package: sepia Architecture: all -Depends: ${perl:Depends}, libpadwalker-perl (>= 1), libmodule-info-perl, libsub-uplevel-perl, emacs21 | emacs-snapshot +Depends: ${perl:Depends}, libpadwalker-perl (>= 1.0), libmodule-info-perl, libsub-uplevel-perl, 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/copyright b/debian/copyright index 5d26888..a308e7c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,8 +1,17 @@ -This is the debian package for the Sepia module. -It was created by Hilko Bengen <ben...@debian.org> using dh-make-perl. +This is the debian package for the Sepia module. downloaded from CPAN +<http://search.cpan.org/~seano/Sepia-0.70/> -This copyright info was automatically extracted from the perl module. -It may not be accurate, so you better check the module sources -if don't want to get into legal troubles. +It was created by Hilko Bengen <ben...@debian.org> using dh-make-perl. The upstream author is: Sean O'Rourke <se...@cpan.org>. + +Copyright (C) 2004-2007 by Sean O'Rourke + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + + +Perl is distributed under your choice of the GNU General Public License or +the Artistic License. On Debian GNU/Linux systems, the complete text of the +GNU General Public License can be found in `/usr/share/common-licenses/GPL' +and the Artistic Licence in `/usr/share/common-licenses/Artistic'. diff --git a/lib/Sepia.pm b/lib/Sepia.pm index 4eec060..47900ee 100644 --- a/lib/Sepia.pm +++ b/lib/Sepia.pm @@ -6,7 +6,7 @@ Sepia - Simple Emacs-Perl Interface =cut -$VERSION = '0.69'; +$VERSION = '0.70'; @ISA = qw(Exporter); require Exporter; @@ -14,11 +14,15 @@ use strict; use Cwd 'abs_path'; use Scalar::Util 'looks_like_number'; use Module::Info; -use PadWalker qw(peek_my peek_our peek_sub closed_over); -use Sub::Uplevel; use Text::Abbrev; use Carp; use B; +BEGIN { + eval { require PadWalker; import PadWalker qw(peek_my) }; + if ($@) { + *peek_my = sub { +{ } }; + } +} =item C<@compls = completions($string [, $type])> @@ -545,16 +549,6 @@ sub Dump { }; } -my $FRAMES = 4; - -sub hiding_me -{ - my ($fn, @args) = @_; - sub { - uplevel $FRAMES, $fn, @args - } -} - sub eval_in_env { my ($expr, $env) = @_; @@ -571,7 +565,7 @@ sub debug_upeval { my ($lev, $exp) = $_[0] =~ /^\s*(\d+)\s+(.*)/; print " <= $exp\n"; - (0, eval_in_env($exp, PadWalker::peek_my(0+$lev))); + (0, eval_in_env($exp, peek_my(0+$lev))); } sub debug_inspect @@ -580,10 +574,12 @@ sub debug_inspect for my $i (split) { my $sub = (caller $i)[3]; next unless $sub; - my $h = PadWalker::peek_my($i); + my $h = peek_my($i); print "[$i] $sub:\n"; + no strict; for (sort keys %$h) { - print "\t", Sepia::Dump($h->{$_}, $_); + local @res = $h->{$_}; + print "\t$_ = ", $PRINTER->(), "\n"; } } 0; @@ -638,9 +634,11 @@ sub repl_chdir sub who { - my $pack = shift || ''; + my ($pack, $re) = (shift =~ /^(\S+)(?:\s+(\S.*))?/); + $re ||= ''; + $re = qr/$re/; no strict; - sort map { + sort grep /$re/, map { (defined %{$pack.'::'.$_} ? '%'.$_ : (), defined ${$pack.'::'.$_} ? '$'.$_ : (), # ? defined @{$pack.'::'.$_} ? '@'.$_ : (), diff --git a/lib/Sepia/Xref.pm b/lib/Sepia/Xref.pm index 8b0020c..c496649 100644 --- a/lib/Sepia/Xref.pm +++ b/lib/Sepia/Xref.pm @@ -75,8 +75,7 @@ require Exporter; our @ISA = qw(Exporter); my @most = qw(redefined forget rebuild callers callees var_defs var_uses - mod_subs mod_files mod_decls mod_apropos - apropos var_apropos file_apropos); + var_apropos); our @EXPORT_OK = (@most, qw(xref_definitions xref_object xref_main %call %callby %var_use %var_def)); diff --git a/sepia.el b/sepia.el index dae33d1..c4a1b33 100644 --- a/sepia.el +++ b/sepia.el @@ -37,6 +37,9 @@ to by `perl-collect-output'.") "Current perl output for miscellaneous user interaction, used to look for \";;;###\" lisp evaluation markers.") +(defvar sepia-perl-builtins nil +"List of Perl builtins for completion.") + (defun sepia-collect-output (string) "Collect perl output for `sepia-eval-raw' into sepia-output." (setq sepia-output (concat sepia-output string)) @@ -174,8 +177,9 @@ subs from the evaluation package, it may not always work.") ("v" . sepia-var-uses) ("V" . sepia-var-defs) ;; ("V" . sepia-var-assigns) - ;; ("\M-." . sepia-dwim) - ("\M-." . sepia-location) + ("\M-." . sepia-dwim) + ;; ("\M-." . sepia-location) + ("l" . sepia-location) ("f" . sepia-defs) ("r" . sepia-rebuild) ("m" . sepia-module-find) @@ -270,6 +274,7 @@ Does not require loading.") (location "Find an identifier's location.") (mod-subs "Find all subs defined in a package.") (mod-decls "Generate declarations for subs in a package.") + (mod-file "Find the file defining a package.") (apropos "Find subnames matching RE.") (lexicals "Find lexicals for a sub.") )) @@ -290,64 +295,12 @@ Does not require loading.") (var-uses "Find all uses of a variable.") (mod-redefined "Rebuild Xref information for a given package.") - (mod-files "Find the file defining a package.") (guess-module-file "Guess file corresponding to module.") (file-modules "List the modules defined in a file."))) (apply #'define-xref-function "Sepia::Xref" x)) - (dolist (x '("abs" "accept" "alarm" "atan2" - "bind" "binmode" "bless" - "caller" "chdir" "chmod" "chomp" "chop" - "chown" "chr" "chroot" "close" "closedir" - "connect" "continue" "cos" "crypt" - "dbmclose" "dbmopen" "defined" "delete" - "die" "dump" - "each" "endgrent" "endhostent" "endnetent" - "endprotoent" "endpwent" "endservent" "eof" - "eval" "exec" "exists" "exit" "exp" - "fcntl" "fileno" "flock" "fork" "format" - "formline" - "getc" "getgrent" "getgrgid" "getgrnam" - "gethostbyaddr" "gethostbyname" "gethostent" - "getlogin" "getnetbyaddr" "getnetbyname" - "getnetent" "getpeername" "getpgrp" "getppid" - "getpriority" "getprotobyname" "getprotobynumber" - "getprotoent" "getpwent" "getpwnam" "getpwuid" - "getservbyname" "getservbyport" "getservent" - "getsockname" "getsockopt" "glob" "gmtime" - "goto" "grep" - "hex" - "import" "index" "int" "ioctl" - "join" - "keys" "kill" - "last" "lc" "lcfirst" "length" "link" "listen" - "local" "localtime" "log" "lstat" - "map" "mkdir" "msgctl" "msgget" "msgrcv" "msgsnd" - "next" - "oct" "open" "opendir" "ord" - "pack" "package" "pipe" "pop" "pos" "print" "printf" - "prototype" "push" "quotemeta" - "rand" "read" "readdir" "readline" "readlink" - "readpipe" "recv" "redo" "ref" "rename" "require" - "reset" "return" "reverse" "rewinddir" "rindex" - "rmdir" - "scalar" "seek" "seekdir" "select" "semctl" "semget" - "semop" "send" "setgrent" "sethostent" "setnetent" - "setpgrp" "setpriority" "setprotoent" "setpwent" - "setservent" "setsockopt" "shift" "shmctl" "shmget" - "shmread" "shmwrite" "shutdown" "sin" "sleep" - "socket" "socketpair" "sort" "splice" "split" - "sprintf" "sqrt" "srand" "stat" "study" "sub" - "sub*" "substr" "symlink" "syscall" "sysopen" - "sysread" "sysseek" "system" "syswrite" - "tell" "telldir" "tie" "tied" "time" "times" - "truncate" - "uc" "ucfirst" "umask" "undef" "unlink" - "unpack" "unshift" "untie" "utime" - "values" "vec" - "wait" "waitpid" "wantarray" "warn" "write")) - (puthash x t sepia-perl-builtins))) - + ;; Initialize built hash + (sepia-init-perl-builtins)) (add-hook 'cperl-mode-hook 'sepia-install-eldoc) (add-hook 'cperl-mode-hook 'sepia-doc-update) (add-hook 'cperl-mode-hook 'sepia-cperl-mode-hook) @@ -440,11 +393,14 @@ symbol at point." (message "%s" result)) result) +(defun sepia-find-module-file (mod) + (or (sepia-module-file mod) + (car (xref-guess-module-file mod)))) + (defun sepia-module-find (mod) "Find the file defining module MOD." (interactive (list (sepia-interactive-arg 'module))) - (let ((fn (or (sepia-module-file mod) - (car (xref-guess-module-file mod))))) + (let ((fn (sepia-find-module-file mod))) (when fn (message "Module %s in %s." mod fn) (pop-to-buffer (find-file-noselect (expand-file-name fn)))))) @@ -483,17 +439,6 @@ symbol at point." (grep-mode) (goto-char (point-min))))) -(defun sepia-filter-by-module (x) - "Filter to limit hits by module only." - (when (or (not module) (string= module (fourth x))) - (list x))) - -(defun sepia-filter-by-all (x) - "Filter to limit hits by module and file." - (when (and (or (not module) (string= module (fourth x))) - (or (not file) (string= file (first x)))) - (list x))) - (defmacro define-sepia-query (name doc &optional gen test prompt) "Define a sepia querying function." `(defun ,name (ident &optional module file line display-p) @@ -607,25 +552,24 @@ to this location." "Try to do the right thing with identifier at point. * Find all definitions, if thing-at-point is a function * Find all uses, if thing-at-point is a variable -* Find all definitions, if thing-at-point is a module +* Find documentation, if thing-at-point is a module * Prompt otherwise " (interactive "P") (multiple-value-bind (type obj) (sepia-ident-at-point) - (setq type (if type (string type) "")) - (message "%s %S" type obj) - (if type - (progn -;; (sepia-set-found nil 'variable) - (let ((ret (case type - (function (list (sepia-location raw))) - (variable (xref-var-uses raw)) - (module `((,(car (xref-mod-files mod)) 1 nil nil)))))) - (if display-p - (sepia-show-locations ret) - (sepia-set-found ret type) - (sepia-next)))) - (call-interactively 'sepia-defs)))) + (sepia-set-found nil type) + (let ((ret + (cond + ((member type '(?% ?$ ?@)) (xref-var-defs obj)) + ((or (equal type ?&) + (let (case-fold-search) + (string-match "^[^A-Z]" obj))) + (list (sepia-location obj))) + (t `((,(sepia-w3m-perldoc-this obj) 1 nil nil)))))) + (if display-p + (sepia-show-locations ret) + (sepia-set-found ret type) + (sepia-next))))) (defun sepia-rebuild () "Rebuild the Xref database." @@ -785,13 +729,13 @@ also rebuild the xref database." (destructuring-bind (file line short &optional mod &rest blah) (car sepia-found) (unless file - (setq file (and mod (sepia-module-file mod))) + (setq file (and mod (sepia-find-module-file mod))) (if file (setf (caar sepia-found) file) (error "No file for %s." (car sepia-found)))) (message "%s at %s:%s" short file line) (when (file-exists-p file) - (find-file (or file (car (xref-mod-files mod)))) + (find-file (or file (sepia-find-module-file mod))) (when sepia-found-refiner (funcall sepia-found-refiner line short)) (beginning-of-line) @@ -1220,7 +1164,210 @@ calling ``cperl-describe-perl-symbol''." (t (concat "{" (mapconcat #'sepia-lisp-to-perl thing ", ") "}")))) -(defconst sepia-perl-builtins (make-hash-table)) +(defun sepia-init-perl-builtins () + (setq sepia-perl-builtins (make-hash-table)) + (dolist (s '("abs" +"accept" +"alarm" +"atan2" +"bind" +"binmode" +"bless" +"caller" +"chdir" +"chmod" +"chomp" +"chop" +"chown" +"chr" +"chroot" +"close" +"closedir" +"connect" +"continue" +"cos" +"crypt" +"dbmclose" +"dbmopen" +"defined" +"delete" +"die" +"dump" +"each" +"endgrent" +"endhostent" +"endnetent" +"endprotoent" +"endpwent" +"endservent" +"eof" +"eval" +"exec" +"exists" +"exit" +"exp" +"fcntl" +"fileno" +"flock" +"fork" +"format" +"formline" +"getc" +"getgrent" +"getgrgid" +"getgrnam" +"gethostbyaddr" +"gethostbyname" +"gethostent" +"getlogin" +"getnetbyaddr" +"getnetbyname" +"getnetent" +"getpeername" +"getpgrp" +"getppid" +"getpriority" +"getprotobyname" +"getprotobynumber" +"getprotoent" +"getpwent" +"getpwnam" +"getpwuid" +"getservbyname" +"getservbyport" +"getservent" +"getsockname" +"getsockopt" +"glob" +"gmtime" +"goto" +"grep" +"hex" +"import" +"index" +"int" +"ioctl" +"join" +"keys" +"kill" +"last" +"lc" +"lcfirst" +"length" +"link" +"listen" +"local" +"localtime" +"log" +"lstat" +"map" +"mkdir" +"msgctl" +"msgget" +"msgrcv" +"msgsnd" +"next" +"oct" +"open" +"opendir" +"ord" +"pack" +"package" +"pipe" +"pop" +"pos" +"print" +"printf" +"prototype" +"push" +"quotemeta" +"rand" +"read" +"readdir" +"readline" +"readlink" +"readpipe" +"recv" +"redo" +"ref" +"rename" +"require" +"reset" +"return" +"reverse" +"rewinddir" +"rindex" +"rmdir" +"scalar" +"seek" +"seekdir" +"select" +"semctl" +"semget" +"semop" +"send" +"setgrent" +"sethostent" +"setnetent" +"setpgrp" +"setpriority" +"setprotoent" +"setpwent" +"setservent" +"setsockopt" +"shift" +"shmctl" +"shmget" +"shmread" +"shmwrite" +"shutdown" +"sin" +"sleep" +"socket" +"socketpair" +"sort" +"splice" +"split" +"sprintf" +"sqrt" +"srand" +"stat" +"study" +"sub" +"sub*" +"substr" +"symlink" +"syscall" +"sysopen" +"sysread" +"sysseek" +"system" +"syswrite" +"tell" +"telldir" +"tie" +"tied" +"time" +"times" +"truncate" +"uc" +"ucfirst" +"umask" +"undef" +"unlink" +"unpack" +"unshift" +"untie" +"utime" +"values" +"vec" +"wait" +"waitpid" +"wantarray" +"warn" +"write" +)) + (puthash s t sepia-perl-builtins))) (provide 'sepia) ;;; sepia.el ends here -- 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 Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits