Posted on 2007-01-29 10:36:05-08 by adamfunk
perl-eval-expression in Emacs hangs.

I'm trying to use Emacs-EPL to run perl commands in emacs. (My installation procedure is listed below.) When I run emacs and do

M-x load-library perl

I get the message

Loading perl (source)...done

Then

M-x perl-eval-expression

and at the "Eval Perl: " prompt I type

2+2<CR>

and it hangs until I press C-g. `ps ux` in another xterm shows the following processes running (after I used C-g twice and tried a third time):

emacs /usr/bin/perl -MEmacs::EPL=0.007,:server -MEmacs -MEmacs::Lisp -eEmacs::EPL::loop /usr/bin/perl -MEmacs::EPL=0.007,:server -MEmacs -MEmacs::Lisp -eEmacs::EPL::loop /usr/bin/perl -MEmacs::EPL=0.007,:server -MEmacs -MEmacs::Lisp -eEmacs::EPL::loop

Following Stefan Monnier's suggestion in the gnu.emacs.help and comp.lang.perl.misc newsgroups, I did an emacs debugger backtrace, which is also listed below.

Any idea what I'm doing wrong?

Thanks,
Adam

~~~~~ my installation ~~~~~ I downloaded http://john-edwin-tobey.org/perlmacs/src/Emacs-EPL-0.7.tar.gz and followed the instructions with this result: /usr/local/share/perl/5.8.8/ |-- Emacs | |-- EPL | | `-- Debug.pm | |-- EPL.pm | |-- Forward.pm | `-- Lisp.pm `-- Emacs.pm (I've checked that /usr/local/share/perl/5.8.8/ is in my perl library path.) Then I copied the files epl-compat.el epl.el epl-server.el perl-core.el perl.el into ~/.local/site-lisp/ , which is in my load-path in emacs. ~~~~~ emacs debugger backtrace ~~~~~ Debugger entered--Lisp error: (quit) accept-process-output(#<process perl>) (progn (accept-process-output out) (if (eobp) (error "No output from Perl"))) (if (eobp) (progn (accept-process-output out) (if ... ...))) (when (eobp) (accept-process-output out) (if (eobp) (error "No output from Perl"))) (if ch (progn (unless ... ...) (backward-char)) (when (eobp) (accept-process-output out) (if ... +...)) (forward-char) (char-before)) (save-current-buffer (set-buffer (epl-interp-buffer)) (if ch (progn ... ...) (when ... ... ...) ( +forward-char) (char-before))) (with-current-buffer (epl-interp-buffer) (if ch (progn ... ...) (when ... ... ...) (forward-char) + (char-before))) (let* ((out ...)) (with-current-buffer (epl-interp-buffer) (if ch ... ... ... ...))) epl-read-char() read(epl-read-char) (let ((form ...) reply done msg) (epl-debug (format "Emacs(%d)<<< " ...) form "\n") (unwind-prote +ct (setq reply ... done t) (when ... ... ...)) (epl-debug "Reply: " reply " (" (epl-interp-depth) +")\n") (setq msg (car reply) reply (cdr reply)) (cond (... ...) (... ... ... ...) (... nil) (... . +.. ... ...) (... ...) (... ...) (... ...) (t ...))) (while t (let (... reply done msg) (epl-debug ... form "\n") (unwind-protect ... ...) (epl-debug +"Reply: " reply " (" ... ")\n") (setq msg ... reply ...) (cond ... ... ... ... ... ... ... ...)) ( +or epl-debugging (with-current-buffer ... ...))) (catch (quote return) (epl-debug "+++ " depth "\n") (epl-interp-set-depth (1+ depth)) (while t (l +et ... ... ... ... ... ...) (or epl-debugging ...))) (unwind-protect (catch (quote return) (epl-debug "+++ " depth "\n") (epl-interp-set-depth ...) (w +hile t ... ...)) (epl-debug "--- " depth "\n") (epl-interp-set-depth depth)) (let ((depth ...)) (unwind-protect (catch ... ... ... ...) (epl-debug "--- " depth "\n") (epl-int +erp-set-depth depth))) epl-loop() (condition-case err (epl-loop) (error (epl-destroy) (signal ... ...))) (let* ((process-connection-type nil) (out ...) (epl-interp ...)) (condition-case err (epl-loop) ( +error ... ...)) (epl-interp-set-status (quote ready)) epl-interp) perl-interpreter-new() (setq perl-interpreter (perl-interpreter-new)) (if perl-interpreter (epl-check) (setq perl-interpreter (perl-interpreter-new))) epl-init() (epl-eval (epl-init) nil context "do { package main; " string " }") perl-eval("2+2" scalar-context) (prin1-to-string (perl-eval expression (if prefix ... ...))) (message (prin1-to-string (perl-eval expression ...))) perl-eval-expression("2+2" nil) * call-interactively(perl-eval-expression) execute-extended-command(nil) * call-interactively(execute-extended-command)
Direct Responses: 4184 | Write a response
Posted on 2007-01-29 10:39:49-08 by adamfunk in response to 4183
Re: perl-eval-expression in Emacs hangs.

For reference, here's the usenet thread this came from, although most of the content is copied into my post.

http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/1fb59d27445fbe56/
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.