From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anselm Helbig Newsgroups: gmane.emacs.help Subject: Re: Ruby Date: Tue, 12 May 2009 00:06:19 +0200 Organization: Freie Universitaet Berlin Message-ID: <87eiuvi9b8.wl%anselm.helbig+news2009@googlemail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1242081659 14004 80.91.229.12 (11 May 2009 22:40:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 May 2009 22:40:59 +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 May 12 00:40:49 2009 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 1M3eAy-0008P9-8F for geh-help-gnu-emacs@m.gmane.org; Tue, 12 May 2009 00:40:48 +0200 Original-Received: from localhost ([127.0.0.1]:50973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3eAx-0001Ww-MA for geh-help-gnu-emacs@m.gmane.org; Mon, 11 May 2009 18:40:47 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!news.glorb.com!news2.glorb.com!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 73 Original-X-Trace: news.uni-berlin.de C+ef8cJ+PahOKNjwlm7SdQ9UMojw6yl5ZVNg2oWOaBB6J0SiX7sTY2Pvnm Cancel-Lock: sha1:9/zM+UhoH+aDOuzwqnEWiU+rnjs= In-Reply-To: Mail-Followup-To: anselm.helbig+news2009@googlemail.com User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/22.3 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) Original-Xref: news.stanford.edu gnu.emacs.help:169091 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:64354 Archived-At: At Mon, 11 May 2009 23:59:48 +0400, Vladimir Passwordoff wrote: > > [1 ] > > [2 ] > Can anyone, who program on Ruby, share the bit of ~/.emacs with ruby configuration, and the ruby-files for emacs? I only install the irb and ruby-mode, but ri, flymode - i > cannot. See the emacswiki for setting up flymake http://www.emacswiki.org/emacs/FlymakeRuby I'm using emacs-rails which already sets this up for you: http://dima-exe.ru/rails-on-emacs (I don't really like the fact that emacs-rails configures so much stuff for you: it's generally easier to turn on a feature you want than to turn off a feature that you don't want - in the latter case you don't know where it was activated and what was done to configure it.) For ri, I use the fastri gem which includes the `ri-emacs' executable. Note that you have to start a fastri-server before you can use it (should be done in some startup script). You still need to get ri-ruby.el from http://rubyforge.org/projects/ri-emacs/ and put it somewhere in your emacs load-path: (mapc (lambda (func) (autoload func "ri-ruby" nil t)) '(ri ri-ruby-complete-symbol ri-ruby-show-args)) ;; this only works if ri-emacs can be found in your PATH (setq ri-ruby-script (locate-file "ri-emacs" exec-path)) ;; the default ANSI colours are not really readable with a light background (setq ansi-color-names-vector ["black" "red" "#009900" "yellow" "blue" "magenta" "#990099" "white"]) (setq ansi-color-map (ansi-color-make-color-map)) (add-hook 'ruby-mode-hook (lambda () (local-set-key "\M-\C-i" 'ri-ruby-complete-symbol) (local-set-key (kbd "") 'ri-ruby-show-args))) Apart from the rails-specific stuff I only have these smaler customizations for ruby: ;; allows for navigation by word in camel-cased constants (defun turn-on-c-subword-mode () (c-subword-mode 1)) (add-hook 'ruby-mode-hook 'turn-on-c-subword-mode) ;; highlight some keywords (font-lock-add-keywords 'ruby-mode '(("\\<\\(FIXME\\|HACK\\|XXX\\|FLUNK\\|TODO\\|ToDo\\)" 1 font-lock-warning-face prepend))) ;; highlights matching blocks, get it from ;; http://www.emacswiki.org/emacs/ruby-block.el (autoload 'ruby-block-mode "ruby-block" nil t) (add-hook 'ruby-mode-hook (lambda () (ruby-block-mode t))) My other customizations are either too specific (rails) or too general to mention here. HTH, Anselm -- Anselm Helbig mailto:anselm.helbig+news2009@googlemail.com