(X)Emacs users going to RubyCOnf

F

Forrest Chang

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
 
J

Jim Freeze

* Forrest Chang said:
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. ;) )
 
J

Jim Weirich

=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 (e-mail address removed) http://onestepback.org
 
J

Jeff Wood

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

=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?InstallingEmacsExtensions
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
 
M

Matt Lawrence

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

Scott Barron

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
 
F

Forrest Chang

Jim Weirich said:
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
 
F

Forrest Chang

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

Kristof Bastiaensen

At Fri, 29 Jul 2005 21:47:47 GMT,
Forrest said:
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
 
J

Jim Freeze

* Forrest Chang said:
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...

Sounds good. I just hope I have time to do all these post event activities.
 
B

Bill Atkins

------=_Part_11614_27648233.1122776538145
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I won't be able to make it to RubyConf, but it would be cool if the folks=
=20
who participated in this could summarize it on RubyGarden or something=20
similar.

Bill

=20
=20
rubyforge page...
=20
Sounds good. I just hope I have time to do all these post event=20
activities.
=20


--=20
Bill Atkins

------=_Part_11614_27648233.1122776538145--
 
E

Eric Luo

------=_Part_3092_3448483.1130765689846
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I wonder whether your emacs folks participated the RubyConf had something
new info
to share?

Emacs is my favourite editor, and I use it to write ruby code, Anyway, I am
so new to Emacs
that I couldn't figure out how to customize the EMACS to hightlight the rub=
y
code correctly.
After google the web, I found the ruby-talk thread
131333,<http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/131333>=
but
I don't know what to do with
the explanation about "hook"
Could you please to give me one more clue?

Thanks

If things go well, you should have an easy to use package of stuff.
I think I'll steal the notion of video tutorials from rails.

Forrest

------=_Part_3092_3448483.1130765689846--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top