[ANN] ri-emacs

Discussion in 'Ruby' started by Kristof Bastiaensen, Jul 30, 2004.

  1. [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, Jul 30, 2004
    #1
    1. Advertising

  2. Kristof Bastiaensen <> 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>
    >
    > Regards,
    > KB


    I love you.

    mikael
    Mikael Brockman, Jul 30, 2004
    #2
    1. Advertising

  3. Hi --

    On Fri, 30 Jul 2004, Kristof Bastiaensen wrote:

    > 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 :)
    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 :)


    David

    --
    David A. Black
    David A. Black, Jul 30, 2004
    #3
  4. Kristof Bastiaensen

    Alex Fenton Guest

    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)
    Alex Fenton, Jul 30, 2004
    #4
  5. On Fri, 30 Jul 2004 10:31:33 +0900, David A. Black wrote:

    > Hi --

    Hi
    >
    > On Fri, 30 Jul 2004, Kristof Bastiaensen wrote:
    >
    >> 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 :)


    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
    Kristof Bastiaensen, Jul 30, 2004
    #5
  6. 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...
    >


    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
    Kristof Bastiaensen, Jul 30, 2004
    #6
  7. Kristof Bastiaensen

    Alex Fenton Guest

    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
    Alex Fenton, Jul 30, 2004
    #7
  8. 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?
    >


    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
    Kristof Bastiaensen, Jul 30, 2004
    #8
  9. Kristof Bastiaensen

    Alex Fenton Guest

    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
    Alex Fenton, Jul 30, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    84
  2. Replies:
    2
    Views:
    114
    rubikitch
    Dec 25, 2005
  3. Replies:
    0
    Views:
    102
  4. Mauricio Fernandez
    Replies:
    7
    Views:
    133
    Mauricio Fernandez
    Mar 1, 2007
  5. Adam Funk
    Replies:
    4
    Views:
    214
    Adam Funk
    Jan 29, 2007
Loading...

Share This Page