Jim Freeze said:
Forrest, I think that is a great idea. And, as a non emacs user,
but a potential emacs user, I would appreciate if someone could
give a 15-30minute overview of all the cool things that you can
do with emacs and ruby.
I can give a quick answer to what I know. I think I'd be happy to
start up some kind of comprehensive "(X)EMACS as Ruby IDE" at some
point. I'm hoping to see enough good uses of emacs (coz there are so
many different ways you can go about it), distill a coherent subset,
as well as add some tools to work with emacs -- I have intellisense
type stuff, class browser in mind)
Some of the things I have heard you can do with emacs, but have
never seen are:
run ruby code that you are editing
Primarily this is done via emacs's compile mode. The easiest out
the box is to invoke the compile command (Xemacs comes with an
existing button for such), but you can always use m-x compile. THe
default command is make, which you can change, but for out of the box,
you can change it to ruby <whatever file>.
When you do, the run will be in the *compilation* buffer. THere
are 3 benefits of this 1) your run is a buffer that is easily
searchable, editable 2) your "compile errors" can be navigated via next
and previous error and jumped to in the code 3) your runtime errors
also are navigatable (try that compiled languages)
Naturally, if you setup a makefile, you could use compile mode as is.
Since I try to TDD the majority of the time, I prefer a modified
mode compile ( I basically, duplicated the perl entries with ruby
entries). WHat this allows is for emacs to determine the proper
compile command based on the mode, so perl files will have perl run on
it, ruby ruby, c files cc. This is handy when you switch languages,
but for convenience's sake, it knows to run the "compiler" on whatever
buffer you invoked the command.
I use xemacs and ruby in various environments, and in some of
the older ones, the last mode-compile command is saved as the last
compile command, so I can jump around code, using mode-compile when I
want to change the file, at other times I just reissue the compile
command and get the last command. For example, I'll be in the test
file, I'll mode compile that so ruby will run the test file. I'll
then have to change the source file, I'll edit it and just reissue the
compile command which recalls the test file. SInce I have all these
bound to keys, it's all effortless
There's an irb inferior mode that I don't use. I believe the granddaddy
of this was a lisp inferior mode, which I used with scheme, many many
many years ago. Since I TDD, I don't use this mode, but I might look
at it again.
run snippets of ruby code have run ouput brought up in emacs window
I think you're talking about the ability of ruby mode to zap over code segments to irb inferior mode.
you could do a shell command, but I would guess there's a cool
feature. SImilarly, you can do man from emacs, so I suspect there is
a similar elisp feature to allow easy ri from emacs
run tests and have emacs jump to location of a failure
THis is a feature of the compile mode. WHen you run a compile (across
all languages, and greps as well). YOu have the ability to navigate
to the referred code via the next and previous error. THe
mode-compile.el file allows you to customize what the errors look like
via regexp so they can recognized
run ruby in debug mode run a
Haven't done this yet. I lean towards writing something like the
perl tk wrapper to perl debugger and having it communicate with emacs.
shell inside emacs - not ruby related
type m-x shell, you'll have a live shell as an inferior buffer.
There's also termulator (sp?) that gives you the ability to run curses
apps within the buffer
Having something that demonstrate how to configure and use these
options for a newby would be very compelling. One of the things
Again, to my big picture idea, I wanna grab the best coherent set of
things, and package them together a bit more "mac like" in being super
easy to use. You can modify the speedbar to recognize ruby to some
extent and other things. I wanna a big unified ruby mode to grab all
the good things and put them together, and be easy to use w/o having
to read the elisp. SO perhaps sometime after RubyCOnf, you can goto my rubyforge page...
Forrest