From: Kristof Bastiaensen Date: 2004-05-14T06:34:04+09:00 Subject: Re: are there any ruby IDEs? On Thu, 13 May 2004 21:15:36 +0200, Ruben wrote: > I use Emacs for Ruby programming.. and programming in general, and for > all kinds of other stuffs. I really should try out the Ruby > Refactoring Browser, as it seems that it's meant to be used through > emacs for now :) I really wonder how good it is. > > Ruben That's interesting, I will also take a look at it. Are there other packages that are commonly used by emacs programmers? What I am missing is a way to execute code inside a emacs session, like *scratch* for elisp. I am currently using irb, but many times I am entering multiline code in irb, just to find out I made a mistake and have to retype it. Another nice thing would be a class browser, where you could browse by method and class, in stead of by file (a la smalltalk). If you are interested, I find the following replacements very useful. Replacement for kill-line, basicly it either preserves indentation, or removes all whitespace, not just mess it up. (defun my-kill-line (&optional arg) "Improved version of kill-line ;-) preserves indentation and removes extra whitespace" (interactive "_P") (let ((col (current-column)) (old-point (point))) (cond ((or (and (numberp arg) (< arg 0)) (not (looking-at "[ \t]*$"))) ;use default behavior when calling with a negative argument. ;who calls kill-line with a negative argument anyway? (kill-line arg)) ((and (skip-chars-backward " \t") ;always true (bolp) (save-excursion (forward-line arg) (not (looking-at "[ \t]*$")))) ; killing from an empty line: ; preserve indentation of the next line (kill-region (point) (save-excursion (forward-line arg) (point))) (skip-chars-forward " \t") (if (> (current-column) col) (move-to-column col))) (t ; killing from not empty line: ; kill all indentation (goto-char old-point) (kill-region (point) (save-excursion (forward-line arg) (skip-chars-forward " \t") (point))))))) (global-set-key '(control k) 'my-kill-line) replacement for beginning-of-line, (this seems to be standard in most editors): (defun beginning-of-line-or-indent () "Go to the first non blank character on the line, or if already there, to the first character." (interactive) (let ((oldpoint (point))) (beginning-of-line 1) (skip-chars-forward " \t") (if (= oldpoint (point)) (beginning-of-line 1)))) (global-set-key '(home) 'beginning-of-line-or-indent) (global-set-key '(control a) 'beginning-of-line-or-indent) Kristof