From: mouser Date: 2011-04-17T05:45:48+09:00 Subject: Re: Running Ruby script in emacs 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 (from https://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. By the way, you might find the following useful for learning and programming Ruby in Emacs. See http://www.emacswiki.org/emacs/FlymakeRuby for 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.html for Emacs integration of this debugger.