Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > (X)Emacs users going to RubyCOnf

Reply
Thread Tools

(X)Emacs users going to RubyCOnf

 
 
Forrest Chang
Guest
Posts: n/a
 
      07-26-2005
Hi All:

Just wondering who's an emacs user that's going to RubyConf.

I'd like to see what folks are doing and distill the best practices,
as well as ideas on additions to make emacs even better for developing in ruby.

Forrest
 
Reply With Quote
 
 
 
 
Jim Freeze
Guest
Posts: n/a
 
      07-27-2005
* Forrest Chang <(E-Mail Removed)> [2005-07-27 12:06:00 +0900]:

> Just wondering who's an emacs user that's going to RubyConf.
>
> I'd like to see what folks are doing and distill the best practices,
> as well as ideas on additions to make emacs even better for developing in ruby.


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.
Some of the things I have heard you can do with emacs, but have
never seen are:
run ruby code that you are editing
run snippets of ruby code
have run ouput brought up in emacs window
run ri inside emacs
run irb inside emacs
run tests and have emacs jump to location of a failure
run ruby in debug mode
run a shell inside emacs - not ruby related

Having something that demonstrate how to configure and use these
options for a newby would be very compelling. One of the things
that has kept me from learning emacs is the time that it would
take to learn it beyond what one could get from pico.
(No, I don't use pico. )

--
Jim Freeze


 
Reply With Quote
 
 
 
 
Jim Weirich
Guest
Posts: n/a
 
      07-27-2005
On Tuesday 26 July 2005 11:06 pm, Forrest Chang wrote:
> =A0 =A0Just wondering who's an emacs user that's going to RubyConf.


I'll be there. I have donwloaded brain cells into my elisp macros so tha=
t I=20
am only half functional when not using emacs.

--=20
-- Jim Weirich http://www.velocityreviews.com/forums/(E-Mail Removed) http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,=20
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)


 
Reply With Quote
 
Dimitri Aivaliotis
Guest
Posts: n/a
 
      07-27-2005
On 7/27/05, Jim Weirich <(E-Mail Removed)> wrote:
> On Tuesday 26 July 2005 11:06 pm, Forrest Chang wrote:
> > Just wondering who's an emacs user that's going to RubyConf.

>=20
> I'll be there. I have donwloaded brain cells into my elisp macros so tha=

t I
> am only half functional when not using emacs.
>=20


Care to share these macros with those that won't be there?

Anything beyond what's to be found at the following?

http://www.rubygarden.org/ruby?Insta...macsExtensions
http://www.rubygarden.org/ruby?EmacsExtensions
http://www.rubygarden.org/ruby?EmacsKeyStrokes

Thanks,

- Dimitri


 
Reply With Quote
 
Jeff Wood
Guest
Posts: n/a
 
      07-27-2005
I'm an xemacs user ...=20

here's a copy of my .xemacs/init.el script ... maybe some useful stuff
for you...

I've done a bit of tweaking.

++ BEGIN FILE ++

;; Tired of Ctrl-Z minimizing disable it.
(when window-system
=09(global-unset-key "\C-z")
) ; iconify-or-deiconify-frame (C-x C-z)



(setq make-backup-files nil)
(column-number-mode t)
(global-set-key "\C-xa" 'mark-whole-buffer)
;; (when window-system (speedbar 1))

(if (load "mwheel" t)
=09=09(mwheel-install))

(global-set-key "\C-xB" 'bury-buffer)
(global-set-key "\C-xE" 'apply-macro-to-region-lines)
(global-set-key "\C-xI" 'insert-buffer)

(global-set-key "\C-cg" 'goto-line)
(global-set-key "\C-cG" 'goto-char)
(global-set-key "\C-cw" 'delete-region)
(global-set-key "\C-cc" 'comment-region)
(global-set-key "\C-cu" 'uncomment-region)

(put 'narrow-to-region 'disabled nil)
(put 'erase-buffer 'disabled nil)
(put 'overwrite-mode 'disabled t)

(setq x-select-enable-clipboard t)

(setq special-display-buffer-names
=09=09=09(nconc '("*Backtrace*" "*VC-log*" "*compilation*" "*grep*")
=09=09=09=09=09=09 special-display-buffer-names))

(add-to-list 'special-display-frame-alist '(tool-bar-lines . 0))



;; enable visual feedback on selections
;(setq transient-mark-mode t)

;; default to better frame titles
(setq frame-title-format
(concat "%b - emacs@" system-name))

;; default to unified diffs
(setq diff-switches "-u")

( add-to-list 'load-path "~/.xemacs/" )

( require 'ruby-electric )
( require 'color-theme )
( color-theme-dark-laptop )

(autoload 'ruby-mode "ruby-mode" "Load ruby-mode")
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))

(defun my-ruby-mode-hook ()
=09(font-lock-mode)
=09(ruby-electric-mode))


(add-hook 'ruby-mode-hook 'my-ruby-mode-hook)

(add-hook 'after-save-hook
'(lambda ()
(progn
(and (save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(save-match-data
(looking-at "^#!"))))
(shell-command (concat "chmod u+x " buffer-file-name))
(message (concat "Saved as script: " buffer-file-name))
))))


(setq inferior-lisp-program "lisp")
(add-to-list 'load-path "~/slime-1.2.1")
(require 'slime)
(slime-setup)

++ END FILE ++

On 7/27/05, Dimitri Aivaliotis <(E-Mail Removed)> wrote:
> On 7/27/05, Jim Weirich <(E-Mail Removed)> wrote:
> > On Tuesday 26 July 2005 11:06 pm, Forrest Chang wrote:
> > > Just wondering who's an emacs user that's going to RubyConf.

> >
> > I'll be there. I have donwloaded brain cells into my elisp macros so t=

hat I
> > am only half functional when not using emacs.
> >

>=20
> Care to share these macros with those that won't be there?
>=20
> Anything beyond what's to be found at the following?
>=20
> http://www.rubygarden.org/ruby?Insta...macsExtensions
> http://www.rubygarden.org/ruby?EmacsExtensions
> http://www.rubygarden.org/ruby?EmacsKeyStrokes
>=20
> Thanks,
>=20
> - Dimitri
>=20
>=20



--=20
"So long, and thanks for all the fish"

Jeff Wood


 
Reply With Quote
 
Matt Lawrence
Guest
Posts: n/a
 
      07-27-2005
On Thu, 28 Jul 2005, Jeff Wood wrote:

> I'm an xemacs user ...


These things happen, even in the best of families. Have you considered a
12 step program?

-- Matt
Nothing great was ever accomplished without _passion_



 
Reply With Quote
 
Scott Barron
Guest
Posts: n/a
 
      07-27-2005
On 7/26/05, Forrest Chang <(E-Mail Removed)> wrote:
> Hi All:
>=20
> Just wondering who's an emacs user that's going to RubyConf.
>=20
> I'd like to see what folks are doing and distill the best practices,
> as well as ideas on additions to make emacs even better for developing in=

ruby.
>=20
> Forrest
>=20
>=20


I'm a (GNU)Emacs user, and I'll be there. Meeting up with fellow
enlightened would be great.

As for tips, I've been using dmacro quite a bit lately, it's pretty
nice. MMM mode is also quite interesting, if not a bit of a bear to
set up.

-Scott


 
Reply With Quote
 
Forrest Chang
Guest
Posts: n/a
 
      07-29-2005
Jim Weirich <(E-Mail Removed)> writes:

> On Tuesday 26 July 2005 11:06 pm, Forrest Chang wrote:
>> * *Just wondering who's an emacs user that's going to RubyConf.

>
> I'll be there. I have donwloaded brain cells into my elisp macros so that I
> am only half functional when not using emacs.
>


Cool. Look forward to meeting with you and seeing how you use
emacs. Also looking forward to the dependency injection talk. Seems like no
one else going to RubyConf has responded. I believe Matz uses emacs, if I
recall, he wrote ruby-mode

Forrest

> --
> -- Jim Weirich (E-Mail Removed) http://onestepback.org
> -----------------------------------------------------------------
> "Beware of bugs in the above code; I have only proved it correct,
> not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

 
Reply With Quote
 
Forrest Chang
Guest
Posts: n/a
 
      07-29-2005
Jim Freeze <(E-Mail Removed)> writes:

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

> run irb inside emacs


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.

> run ri inside emacs


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

> that has kept me from learning emacs is the time that it would
> take to learn it beyond what one could get from pico.
> (No, I don't use pico. )
>
> --
> Jim Freeze

 
Reply With Quote
 
Kristof Bastiaensen
Guest
Posts: n/a
 
      07-30-2005
At Fri, 29 Jul 2005 21:47:47 GMT,
Forrest Chang wrote:
> > run ri inside emacs

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


Have a look at ri-emacs:
http://rubyforge.org/projects/ri-emacs/
It works best on XEmacs, but should work fine on Emacs.

Kristof
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Going to RubyConf? Please post to RubyConf2005Facebook Curt Hibbs Ruby 19 10-13-2005 11:16 PM
[RubyConf] Registration is CLOSING SOON for RubyConf 2005! David A. Black Ruby 0 09-06-2005 01:28 PM
[RubyConf] Conference Hotel/Venue info for RubyConf 2005 David A. Black Ruby 4 04-27-2005 09:29 PM
floppy drive just keeps on going and going and ... Weylon Bulloch Computer Support 1 09-07-2003 07:17 AM
VPN going up but traffic going one way PLP Cisco 1 07-11-2003 08:28 AM



Advertisments