From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Diepenmaat Newsgroups: gmane.emacs.help Subject: Re: ruby and emacs Date: Tue, 23 Sep 2008 00:47:29 +0200 Organization: Zeekat Softwareonwikkeling Message-ID: <87y71jg5mm.fsf@zeekat.nl> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222126866 25821 80.91.229.12 (22 Sep 2008 23:41:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Sep 2008 23:41:06 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 23 01:42:02 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Khv2X-000670-I7 for geh-help-gnu-emacs@m.gmane.org; Tue, 23 Sep 2008 01:42:01 +0200 Original-Received: from localhost ([127.0.0.1]:41135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Khv1V-0006hj-Rg for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Sep 2008 19:40:57 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!news.skynet.be!newsgate.cistron.nl!xs4all!transit2.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAABgAAAAwBAMAAAD5pqeQAAAAAXNSR0IArs4c6QAAABhQTFRF URgKoyIAmTMXqF5KuYl7y6ui4NDM+/r4zJNdmwAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsT AQCanBgAAAAHdElNRQfXDBIUAgGiEa2aAAABYUlEQVQoz02SvXaDMAyF3aHdZegD2PxkJhQ8J4R6 juGUuZDUe43R61eGJA0D8B1dXV0LGCJaDDePyOjZBtT9MgSYbIu+UpNl2A+/ukPXfNUku2ROdWhM 99myqzWX3Czp8dhY1n+MfWau+X4fZGNZpecuSwpFMHOZnpskFppgEaksGs5lFoYeYilOEMkjzcGC CzjxJJoowZIAQMPhfdYEecGhBFCOwO9GKkFkXZDtfIAax2C9wwKAWzwFyPGwQrXCIkimbzAHeFtl Ts0vJHvFkRI01ssVwpyMAoHkGmfFqL+TEmSNXjHMXeiHZAjZqjOsVxxSV8UG3Fi2ZGID2Fs2t7d3 6mLTdIdUM+PuECvW/T6gfobnSqTY+DDgmrnmATSnfMiQrTvcDOikyT1OWHxZPIF8As8P/waOjzdn IGt+vRVgYD7CrakFTSfFbwAB0Y+ghWj0IjP0Scz6I2E3zIlFb/8AfR6DwKVgwNYAAAAASUVORK5C YII= Cancel-Lock: sha1:p+Y0mgS45+wiH8TIK/+wIUyaGbg= Original-Lines: 59 Original-NNTP-Posting-Host: 80.126.3.69 Original-X-Trace: 1222123684 news.xs4all.nl 200 [::ffff:80.126.3.69]:43567 Original-X-Complaints-To: abuse@xs4all.nl Original-Xref: news.stanford.edu gnu.emacs.help:162589 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57931 Archived-At: "aidy lewis" writes: > Hi, > > Does anyone know how I set up Ruby syntax highlighting with emacs? The base ruby install includes ruby-mode. You should probably get that file plus its support files and put it in your load-path. The following is some stuff that I've got in my .emacs file. You can probably get away with just putting the add-to-list and autoload stuff there. See also http://www.emacswiki.org/cgi-bin/wiki/RubyMode (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files") (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode)) (add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode)) (add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode)) (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) (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))) (autoload 'rubydb "rubydb3x" "Ruby debugger" t) (add-hook 'ruby-mode-hook 'turn-on-font-lock) (add-hook 'ruby-mode-hook (lambda () (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) " ")))) (setq ri-ruby-script "~/.emacs.d/ri-emacs/ri-emacs.rb") (autoload 'ri "~/.emacs.d/ri-emacs/ri-ruby" nil t) (add-hook 'ruby-mode-hook (lambda () (require 'speedbar) (require 'rails) (local-set-key [C-c C-o] 'ri) (local-set-key [M-C-i] 'ri-ruby-complete-symbol) (local-set-key [C-c C-a] 'ri-ruby-show-args))) -- Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/