Results 1 to 3 of 3

Thread: ruby-mode for emacs

  1. #1
    Join Date
    Jan 2007
    Location
    Baltimore, MD
    Beans
    841
    Distro
    Ubuntu

    ruby-mode for emacs

    can anyone help me install ruby-mode for emacs?

    i've tried a couple things, but nothing is working thus far.

    i followed the instructions on this site (despite it being intended for the windows version of emacs)
    http://sodonnell.wordpress.com/2007/...macs-ruby-foo/

    i've downloaded ruby-mode.el from the Ruby source distribution as directed and placed it in /usr/share/emacs/site-lisp
    i even gave it execute priveledges.

    i then added these lines to my .emacs file:
    Code:
    ; loads ruby mode when a .rb file is opened.
    (autoload 'ruby-mode "ruby-mode" "Major mode for editing ruby scripts." t)
    (setq auto-mode-alist  (cons '(".rb$" . ruby-mode) auto-mode-alist))
    (setq auto-mode-alist  (cons '(".rhtml$" . html-mode) auto-mode-alist))
    i also tried installing ruby1.8-elisp package from the repos.

    when i load up a .rb file, emacs says it loaded ruby mode, but i dont see any syntax highlighting
    any help is appreciated. i like the functionality of emacs, but i always have trouble customizing it.

  2. #2
    Join Date
    Dec 2006
    Location
    Linköping, Sweden
    Beans
    195
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: ruby-mode for emacs

    You must turn on font-lock-mode. Try M-X font-lock-mode after you have opened a ruby file. Look at this page on how to customize this behaviour. sunsite.ualberta.ca/Documentation/Gnu/emacs-21.1/html_chapter/faq_5.html#SEC75

  3. #3
    Join Date
    Jan 2007
    Location
    Baltimore, MD
    Beans
    841
    Distro
    Ubuntu

    Re: ruby-mode for emacs

    enabling global-font-lock-mode in my .emacs file:
    Code:
    	
    
    (global-font-lock-mode 1)
    makes all kinds of pretty syntax colors appear. yay! thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •