Ruby syntax highlighting problem with Emacs

Discussion in 'Ruby' started by Rich, Jan 6, 2006.

  1. Rich

    Rich Guest

    I was attempting to install ruby support into my emacs installation by
    following the directions at the RubyGarden. When I load a ruby file,
    Emacs switches to Ruby mode but doesn't do syntax highlighting. Does
    anybody have any insight? Here is the relevant portion of my .emacs
    file:

    (autoload 'ruby-mode "ruby-mode"
    "Mode for editing ruby source files")
    (add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
    (add-hook 'ruby-mode-hook 'turn-on-font-lock) ;; <- Is supposed to
    enable font lock.

    (setq interpreter-mode-alist (append '(("^#!.*ruby" . ruby-mode))
    interpreter-mode-alist))

    (setq ruby-indent-level 4)


    I do not have ruby-electric.el installed, for the interested. Thank you.

    -Rich
    Rich, Jan 6, 2006
    #1
    1. Advertising

  2. --YZ5djTAD1cGYuMQK
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline

    On Fri, Jan 06, 2006 at 01:35:38PM +0900, Rich wrote:
    > When I load a ruby file, Emacs switches to Ruby mode but doesn't do
    > syntax highlighting. Does anybody have any insight?


    Perhaps you need to turn syntax highlighting on in general:

    (global-font-lock-mode 1)


    --YZ5djTAD1cGYuMQK
    Content-Type: application/pgp-signature; name="signature.asc"
    Content-Description: Digital signature
    Content-Disposition: inline

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)

    iD8DBQFDvfylnhUz11p9MSARAoyqAJ0ZCfHcS/O4EGBOYI8wrrwio+GqkACgykd6
    ul5kDEOIW1KIWJWP+iDmtaI=
    =c5qC
    -----END PGP SIGNATURE-----

    --YZ5djTAD1cGYuMQK--
    Edward Faulkner, Jan 6, 2006
    #2
    1. Advertising

  3. Rich

    Rich Guest

    That did it. Thank you very much.

    On 1/6/06, Edward Faulkner <> wrote:
    > On Fri, Jan 06, 2006 at 01:35:38PM +0900, Rich wrote:
    > > When I load a ruby file, Emacs switches to Ruby mode but doesn't do
    > > syntax highlighting. Does anybody have any insight?

    >
    > Perhaps you need to turn syntax highlighting on in general:
    >
    > (global-font-lock-mode 1)
    >
    >
    >
    > -----BEGIN PGP SIGNATURE-----
    > Version: GnuPG v1.4.1 (GNU/Linux)
    >
    > iD8DBQFDvfylnhUz11p9MSARAoyqAJ0ZCfHcS/O4EGBOYI8wrrwio+GqkACgykd6
    > ul5kDEOIW1KIWJWP+iDmtaI=3D
    > =3Dc5qC
    > -----END PGP SIGNATURE-----
    >
    >
    >
    Rich, Jan 6, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nigel Wilkinson

    Can xemacs do syntax highlighting for ruby

    Nigel Wilkinson, Dec 13, 2003, in forum: Ruby
    Replies:
    2
    Views:
    98
    Daniel Carrera
    Dec 13, 2003
  2. Josef 'Jupp' SCHUGT

    Ruby syntax highlighting for Ruby

    Josef 'Jupp' SCHUGT, Feb 20, 2004, in forum: Ruby
    Replies:
    5
    Views:
    158
    Josef 'Jupp' SCHUGT
    Feb 24, 2004
  3. Tim Ferrell

    emacs syntax highlighting problem

    Tim Ferrell, Feb 17, 2005, in forum: Ruby
    Replies:
    9
    Views:
    289
    Dee Zsombor
    Feb 23, 2005
  4. Daniel Harple

    Emacs syntax highlighting error

    Daniel Harple, Jan 12, 2006, in forum: Ruby
    Replies:
    2
    Views:
    93
    George Ogata
    Jan 14, 2006
  5. Replies:
    1
    Views:
    96
Loading...

Share This Page