From: duke Date: 2011-04-19T05:16:05+09:00 Subject: Re: Running Ruby script in emacs On Apr 16, 2:43 pm, "mouser" wrote: > On 16-Apr-2011, duke wrote: > > > It executes OK, and the program output is correct, but I may be taking > > "the long way around". :) Thanks for your input. > > You might find the following will make your life easier. > > Uninstall ruby-compilation from ELPA (hit 'd' on it's line in > package-list-packages, then hit 'x').  Then, install the source for > ruby-compilation (fromhttps://github.com/eschulte/rinari/raw/master/util/ruby-compilation.el) in > your load path (somewhere in ~/.emacs.d for instance).  Next, add "(require > 'ruby-compilation)" to ~/.emacs.  Finally, open up the ruby-compilation.el > file in your load path and add "(define-key map [return] > 'comint-send-input)" to defvar ruby-compilation-minor-mode-map (for instance > at line 279).  The last part is required because for some reason > compilation-mode shadows the comint-send-input binding though it's not > immediately apparent where that is happening. > > This gives you a couple advantages over installing it from ELPA.  C-x t will > invoke ruby-compilation-this-buffer whenever you are in ruby-mode, and now > hitting return/enter will invoke comint-send-input in the compilation > buffer. OK! Followed your instructions to the letter ... and hacked my .emacs for the key map stuff, as per Ryans advice ... NO joy! In *Messages* buffer, I get: "compilation-next-error: No error here" after being asked for the required input. The script does work BTW. Any ideas? > By the way, you might find the following useful for learning and programming > Ruby in Emacs.  Seehttp://www.emacswiki.org/emacs/FlymakeRubyfor automated > syntax checking.  Also, install the ruby-debug (or ruby-debug19 for Ruby > 1.9) gem for Ruby debugging.  Take a look at http://bashdb.sourceforge.net/ruby-debug/rdebug-emacs.htmlfor Emacs > integration of this debugger. Thanks a lot for all those links. They surely will be useful to me. Much obliged! -- duke