help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: General Approach to Troubleshooting Inferior Process


From: formido
Subject: Re: General Approach to Troubleshooting Inferior Process
Date: Wed, 20 Aug 2008 09:33:15 -0700 (PDT)
User-agent: G2/1.0

On Aug 19, 8:50 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> formido <form...@gmail.com> writes:
> > So, I installed the elisp packages for inferior ruby and and ruby
> > mode. Using the repl in the interpreter works correctly. However,
> > sending the ruby process a function definition, or evaluating a region
> > if it's a function definition, fails. It errors with, 'cannot make nil
> > into string' or some such.
>
> Well you would have to debug emacs lisp code.  Are you ready to do that?
> The first step would be to enable the debugger:
> M-x set-variable RET debug-on-error RET t RET

Indeed I am. :) I'm not new to the world of debugging. I expect me and
Emacs to have many long fruitful nights of it going forward.

> But in my experience, when there is this kind of errors on executing
> some basic emacs command,  it's because the el package installed
> doesn't match the version of emacs used.
>
> Perhaps you have or had a different version of emacs installed in
> /usr/local and some .el from /usr/local/share/emacs are used by
> /usr/bin/emacs?  

It's the latest version of the ruby packages from the repository, but
there don't seem to have been changes to it in the last couple years.
I've tried it now on 3 different Emacs on 2 different platforms.
What's weird is, there's an Emacs Rails package out on the web, and it
requires Emacs 22, so I don't know if those guys just don't use ruby-
mode this way or what. Even though I'm an elisp newbie, the code for
comint-send-region looks pretty straightforward--why would a new Emacs
version have broken it? I don't know, but it's not working.

> > In general, what sorts of things could I do to troubleshoot this? The
> > first thing I thought of was 'well, what's emacs *actually* sending to
> > the process?' It uses a function 'process-send-region' which
> > apparently takes a starting point and ending point in the target
> > buffer. What function can I use to display the text between those two
> > points?
>
> (buffer-substring start end) will return a string containing the text
> between start and end in the current buffer.

Ah, awesome.

> --
> __Pascal Bourguignon__                    http://www.informatimago.com/
>
> "Debugging?  Klingons do not debug! Our software does not coddle the
> weak."

Cute. ;)

Michael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]