Forum: Ruby Spacing issues when using Inferior-Ruby Emacs mode

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Josh Staiger (Guest)
on 2006-02-27 18:28
Hello,

I'm seeing some rather strange behavior when using Inferior-Ruby-Mode in
Emacs (on Windows XP).

It's a bit difficult to describe what the problem is, but here goes.

Whenever I hit enter my cursor is positioned in the wrong place for the
next prompt.  Instead of being positioned just to the right of the '>',
it is positioned one line below and slightly to the right of where it
should be.

I'm not sure how this will display for everyone, but here is an example
of what I'm seeing if I hit :test[ENTER]:test2[ENTER]:test3[ENTER]


irb(main):001:0> :test
:test
:test
irb(main):002:0>
                   :test2
:test2
:test2
irb(main):004:0>
                   :test3
:test3
:test3

irb(main):006:0>
                   [cursor goes here]

As you can see, I'm also seeing another issue of evaluations echoing
twice instead of just once.

Does anyone have any tricks for getting this to work nicely?

I've not changed the default (seemingly) relevant variables in
inf-ruby.el:

(defvar ruby-program-name "irb --inf-ruby-mode"
  "*Program invoked by the run-ruby command")

(defvar inferior-ruby-first-prompt-pattern "^irb(.*)[0-9:]+0> *"
  "first prompt regex pattern of ruby interpreter.")

(defvar inferior-ruby-prompt-pattern "^\\(irb(.*)[0-9:]+[>*\"'] *\\)+"
  "prompt regex pattern of ruby interpreter.")


and my enter key is bound to the default comint-send-input command.

Any help would be appreciated, (including a referall to a more
emacs-focused list if necessary).

Thank you!

Josh Staiger
http://joshstaiger.org
This topic is locked and can not be replied to.