(OT) Programmer's editors for the Mac

R

Ruth A. Kramer

Jarek said:
You can use "M-x customize[Return]" to setup Emacs. In the "Faces" group
find "default" face and change it to suit your taste.

Jarek,

Great, thanks! (That answers the followup question I posted in response
to Jim Weirich's reply.)

Randy Kramer
 
A

apviper

Jarek Rzeszótko wrote: [snip]
Don't forget that real programmers use Emacs.
[snip]

I'd love if you could point me to a tutorial on how to use emacs with
ruby. I'm running gentoo, and have installed ruby-mode, but I can't
get anything but syntax highlighting to work. Not auto-tabbing,
imbedded interpreting, etc. As for now, I'm using scite and vim.
Scite's pretty cool. You can install it on OSX, but you'll have to run
it through an XServer, there website doesn't mention a native OSX port.
 
J

Jarek Rzeszótko

I'd love if you could point me to a tutorial on how to use emacs with
ruby. I'm running gentoo, and have installed ruby-mode, but I can't
get anything but syntax highlighting to work. Not auto-tabbing,
imbedded interpreting, etc. As for now, I'm using scite and vim.
Scite's pretty cool. You can install it on OSX, but you'll have to run
it through an XServer, there website doesn't mention a native OSX port.
I am not a MacOSX user, but as far as I know the Carbon Emacs
distribution doesn't require a X server.
Read more about this here:
http://home.att.ne.jp/alpha/z123/emacs-mac-e.html
http://www.emacswiki.org/cgi-bin/emacs-en/EmacsForMacOS

And for the ruby-mode tutorial, I don't know any. But try adding this to
your ".emacs" file:

;;; begining
(autoload 'ruby-mode "ruby-mode" "Ruby mode" t)
(defun my-ruby-run ()
(interactive)
(compile (concat "ruby " (buffer-file-name)))
)
(defun my-ruby-mode-hook ()
(define-key ruby-mode-map "\r" 'ruby-reindent-then-newline-and-indent)
(local-set-key [f9] 'my-ruby-run)
(make-variable-buffer-local 'compilation-error-regexp-alist)
(setq compilation-error-regexp-alist
(append compilation-error-regexp-alist
(list (list
(concat
"\\(.*?\\)\\([0-9A-Za-z_./\:-]+\\.rb\\):\\([0-9]+\\)") 2 3))))
(make-variable-buffer-local 'compile-command)
(setq compile-command (concat "ruby " (buffer-file-name) " "))
(message "My ruby-mode customizations loaded")
))

(add-hook 'ruby-mode-hook 'my-ruby-mode-hook)
(setq auto-mode-alist
(append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
(setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
interpreter-mode-alist))
(autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
(autoload 'inf-ruby-keys "inf-ruby" "Set local key defs for inf-ruby in
ruby-mode")
(add-hook 'ruby-mode-hook
'(lambda ()
(inf-ruby-keys)
))
;;;end

This will turn on autoindent and bind F9 to the "compile" command that
will let you run your Ruby program and jump to the possible errors. If
you want to run an embedded Ruby interpreter type "M-x run-ruby" when
editing a .rb file. You can also run your program in the embedded
interpreter by using "M-x ruby-load-file". Look for more informations here:
http://www.emacswiki.org
http://www.rubygarden.org/ruby?EmacsExtensions

Jarek Rzeszótko
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top