[ANN] ri-emacs

[ANN] Ri for (X)Emacs 0.1

Ri-Emacs is a emacs wrapper for ri, designed to make your
life as a Ruby coder in (X)Emacs easier. (Actually it is
designed to make my life as a coder in XEmacs easier, but
it should work for you to).

It has the following features:
- automatic completion of methods and classes
- asks for a class name when needed (with completion)
- shows a nicely colored output (using ansi output)
- display help in a help window (so you can quickly get
  rid of it by pressing q)

No need anymore to grab for an xterm to look up a method!

It currently works only with ri for Ruby1.8

You can find it at:
<http://rubyforge.org/frs/?group_id=317>

Regards,
KB

Kristof Bastiaensen <kristof@vleeuwen.org> writes:

[ANN] Ri for (X)Emacs 0.1

Ri-Emacs is a emacs wrapper for ri, designed to make your
life as a Ruby coder in (X)Emacs easier. (Actually it is
designed to make my life as a coder in XEmacs easier, but
it should work for you to).

It has the following features:
- automatic completion of methods and classes
- asks for a class name when needed (with completion)
- shows a nicely colored output (using ansi output)
- display help in a help window (so you can quickly get
  rid of it by pressing q)

No need anymore to grab for an xterm to look up a method!

It currently works only with ri for Ruby1.8

You can find it at:
<http://rubyforge.org/frs/?group_id=317&gt;

Regards,
KB

I love you.

  mikael

Hi --

No need anymore to grab for an xterm to look up a method!

That was my thinking when I wrote my ri mode for Emacs, which was
added to the /contrib directory of the ri distribution in 2001 :slight_smile:
It's still available in that package (the older separate ri package,
not the ri that ships with Ruby).

I'm glad to see the tradition continuing; clearly the impulse to have
it all at one's fingertips is not confined to me :slight_smile:

David

···

On Fri, 30 Jul 2004, Kristof Bastiaensen wrote:

--
David A. Black
dblack@wobblini.net

Kristof Bastiaensen wrote:

[ANN] Ri for (X)Emacs 0.1

This is great. I've always missed an equivalent of M-x cperl-perldoc.

However, I'm having a bit of trouble getting it to run (GNU Emacs 21.3 on WinXP).

I've got the following in my .emacs

(setq ri-ruby-script "C:/ruby/1.8.1/bin/ri-emacs.rb")
(autoload 'ri "C:/Program Files/emacs-21.3-cvs/site-lisp/ri-ruby.el" nil t)

When I try to run ri "Hash" for example, I get the stuff below. I'm afraid I don't know enough Emacs Lisp to understand what might be going awry...

thanks
alex

Debugger entered--Lisp error: (wrong-type-argument listp C:/ruby/1\.8\.1/bin/ri-emacs\.rb:31:in)
   cdr(C:/ruby/1\.8\.1/bin/ri-emacs\.rb:31:in)
   (null (cdr classes))
   (cond ((null classes) nil) ((null ...) (caar classes)) (t (completing-read "class name: " classes nil t)))
   (let* ((classes ...) (class ...) (method ...) (info ...)) (cond (info ....) (...) (t ... ... ...)))
   ri("Hash")
   eval((ri "Hash"))
   eval-last-sexp-1(nil)
   eval-last-sexp(nil)
   call-interactively(eval-last-sexp)

Hi --

Hi

No need anymore to grab for an xterm to look up a method!

That was my thinking when I wrote my ri mode for Emacs, which was added to
the /contrib directory of the ri distribution in 2001 :slight_smile:

Oh, I didn't know this one existed too! I must give it a try.
I knew about the other one, but it didn't really
have the features I wanted (I am a big fan of completion :-).
Oh well, now people have more choice. Perhaps I could
merge some of the features, if I find more time.

Kind Regards,
Kristof

···

On Fri, 30 Jul 2004 10:31:33 +0900, David A. Black wrote:

On Fri, 30 Jul 2004, Kristof Bastiaensen wrote:

It seems that the ruby-script is returning an error. I
have yet to find a way to give a meaningfull message when
the script dies.
Could you run it on the command-line, and see if it gives
an error? Otherwise it will wait for input, and you can
stop it with control-c. I will add a test to this script
to check for other runtime errors.

Regards,
KB

···

On Fri, 30 Jul 2004 11:42:22 +0100, Alex Fenton wrote:

However, I'm having a bit of trouble getting it to run (GNU Emacs 21.3 on
WinXP).

I've got the following in my .emacs

(setq ri-ruby-script "C:/ruby/1.8.1/bin/ri-emacs.rb") (autoload 'ri
"C:/Program Files/emacs-21.3-cvs/site-lisp/ri-ruby.el" nil t)

When I try to run ri "Hash" for example, I get the stuff below. I'm afraid
I don't know enough Emacs Lisp to understand what might be going awry...

Kristof Bastiaensen wrote:

It seems that the ruby-script is returning an error. I
have yet to find a way to give a meaningfull message when
the script dies.

>

Could you run it on the command-line, and see if it gives
an error?

Yep, it's failing because it can't load 'rdoc/ri/display'; the class RiDisplay seems to be defined in $RUBY/bin/ri in my installed version. My RDoc seems to be 1.0pr1 - what version were you working on?

cheers
alex

ri --version returns V1.0pr1 (on Debian linux). That ruby
script is the weak point, since it is closely tied to the
ri-implementation, but this is the only way I could have
fast completion (or writing my own version of ri).
Anyway it is strange that RiDisplay is
included in bin/ri. My version of ri contains only:

ri = RiDriver.new
ri.process_args

The obvious solution would be to include the RiDisplay class
in the package, and load it if necessary. I still wonder
why it is there, though. (Perhaps the authors of ri didn't
expect the implementation to be used?)

Regards,
KB

···

On Fri, 30 Jul 2004 17:49:35 +0100, Alex Fenton wrote:

Kristof Bastiaensen wrote:

It seems that the ruby-script is returning an error. I have yet to find
a way to give a meaningfull message when the script dies.

>

Could you run it on the command-line, and see if it gives an error?

Yep, it's failing because it can't load 'rdoc/ri/display'; the class
RiDisplay seems to be defined in $RUBY/bin/ri in my installed version. My
RDoc seems to be 1.0pr1 - what version were you working on?

Kristof Bastiaensen wrote:

Yep, it's failing because it can't load 'rdoc/ri/display'; the class
RiDisplay seems to be defined in $RUBY/bin/ri in my installed version. My
RDoc seems to be 1.0pr1 - what version were you working on?

ri --version returns V1.0pr1 (on Debian linux).

My version of ri contains only:
ri = RiDriver.new
ri.process_args

The obvious solution would be to include the RiDisplay class
in the package, and load it if necessary. I still wonder
why it is there, though. (Perhaps the authors of ri didn't
expect the implementation to be used?)

Strange. I did try that, which required a small tweak to the constructor copied from ri. It does then hang on a command prompt, waiting. However, it also does this when I run it from within Emacs, rather than prompting for the search string when I do M-x ri. I have to quit out of this using C-g. strange.

thanks
alex