(X)Emacs users going to RubyCOnf

Discussion in 'Ruby' started by Forrest Chang, Jul 27, 2005.

  1. 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
     
    Forrest Chang, Jul 27, 2005
    #1
    1. Advertising

  2. Forrest Chang

    Jim Freeze Guest

    * Forrest Chang <> [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
     
    Jim Freeze, Jul 27, 2005
    #2
    1. Advertising

  3. Forrest Chang

    Jim Weirich Guest

    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://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)
     
    Jim Weirich, Jul 27, 2005
    #3
  4. On 7/27/05, Jim Weirich <> 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?InstallingEmacsExtensions
    http://www.rubygarden.org/ruby?EmacsExtensions
    http://www.rubygarden.org/ruby?EmacsKeyStrokes

    Thanks,

    - Dimitri
     
    Dimitri Aivaliotis, Jul 27, 2005
    #4
  5. Forrest Chang

    Jeff Wood Guest

    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 <> wrote:
    > On 7/27/05, Jim Weirich <> 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?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
     
    Jeff Wood, Jul 27, 2005
    #5
  6. 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_
     
    Matt Lawrence, Jul 27, 2005
    #6
  7. Forrest Chang

    Scott Barron Guest

    On 7/26/05, Forrest Chang <> 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
     
    Scott Barron, Jul 27, 2005
    #7
  8. Jim Weirich <> 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 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)
     
    Forrest Chang, Jul 29, 2005
    #8
  9. Jim Freeze <> 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
     
    Forrest Chang, Jul 29, 2005
    #9
  10. 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
     
    Kristof Bastiaensen, Jul 30, 2005
    #10
  11. Forrest Chang

    Jim Freeze Guest

    * Forrest Chang <> [2005-07-30 06:51:02 +0900]:

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

    --
    Jim Freeze
     
    Jim Freeze, Jul 30, 2005
    #11
  12. Forrest Chang

    Bill Atkins Guest

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

    On 7/30/05, Jim Freeze <> wrote:
    >=20
    > * Forrest Chang <> [2005-07-30 06:51:02 +0900]:
    >=20
    > > 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=

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



    --=20
    Bill Atkins

    ------=_Part_11614_27648233.1122776538145--
     
    Bill Atkins, Jul 31, 2005
    #12
  13. Forrest Chang

    Eric Luo Guest

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

    On 8/3/05, Forrest Chang <> wrote:
    >
    > Bill Atkins <> writes:
    >
    > >
    > > I won't be able to make it to RubyConf, but it would be cool if the

    > folks=3D
    > > =3D20
    > > who participated in this could summarize it on RubyGarden or

    > something=3D20
    > > similar.

    >
    > 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--
     
    Eric Luo, Oct 31, 2005
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Skip Montanaro
    Replies:
    0
    Views:
    485
    Skip Montanaro
    Nov 21, 2004
  2. David A. Black
    Replies:
    4
    Views:
    191
    Francis Hwang
    Apr 27, 2005
  3. David A. Black
    Replies:
    0
    Views:
    118
    David A. Black
    Sep 6, 2005
  4. Curt Hibbs
    Replies:
    19
    Views:
    178
    James Britt
    Oct 14, 2005
  5. Adam Funk
    Replies:
    4
    Views:
    258
    Adam Funk
    Jan 29, 2007
Loading...

Share This Page