# Ruby and xemacs syntax highlighting

**URL:** <https://www.ruby-forum.com/t/ruby-and-xemacs-syntax-highlighting/56713>\
**Category:** Ruby\
**Created:** [April 3, 2006, 8:49am UTC](https://www.ruby-forum.com/t/ruby-and-xemacs-syntax-highlighting/56713 "2006-04-03T08:49:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pieter\_Breed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@Pieter\_Breed](https://www.ruby-forum.com/u/Pieter_Breed)\
**Post date:** [April 3, 2006, 8:49am UTC](https://www.ruby-forum.com/t/ruby-and-xemacs-syntax-highlighting/56713/1 "2006-04-03T08:49:26Z")

</div>

Hi All,

I am trying to get syntax highlighting to work with xemacs. I have the  
latest xemacs, I downloaded and installed the ruby package, it does  
detect ruby mode (once I do the font-lock thing), but

Only my constanc strings are highlighted. None of the keywords or  
variable names are highlighted. Can you please help me with this?

Regards,  
Pieter

---

<div class="post-metadata">

**Author:** ![Pieter\_Breed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@Pieter\_Breed](https://www.ruby-forum.com/u/Pieter_Breed)\
**Post date:** [April 3, 2006, 3:12pm UTC](https://www.ruby-forum.com/t/ruby-and-xemacs-syntax-highlighting/56713/2 "2006-04-03T15:12:10Z")

</div>

Here’s my relevant section. By the way this gives you the Ink  
(whatever they call it look)

;; ruby-mode  
(autoload 'ruby-mode “ruby-mode” “Load ruby-mode”)  
(add-to-list 'auto-mode-alist '("\.rb$" . ruby-mode))

;; uncomment the next line if you want syntax highlighting  
(add-hook 'ruby-mode-hook 'turn-on-font-lock)

(cond ((fboundp 'global-font-lock-mode)  
;; Customize face attributes  
(setq font-lock-face-attributes  
;; Symbol-for-Face Foreground Background Bold Italic  
Underline  
'((font-lock-comment-face “Purple”)  
(font-lock-string-face “green”)  
(font-lock-keyword-face “orange red”)  
(font-lock-function-name-face “orange1”)  
(font-lock-variable-name-face “white”)  
(font-lock-type-face “white” “black” “false”  
“false” “true”)  
(font-lock-reference-face “Purple”)  
))  
;; Load the font-lock package.  
(require 'font-lock)  
;; Maximum colors  
(setq font-lock-maximum-decoration t)  
;; Turn on font-lock in all modes that support it  
(global-font-lock-mode t)))
