 (defconst scala-mode-version "0.3 ($Revision$)")
 (defconst scala-bug-e-mail "Michel.Schinz@epfl.ch")
 (defconst scala-web-url "http://lamp.epfl.ch/scala/")
+
+;; XEmacs compatibility
+
+(defun scala-regexp-opt-charset (cset)
+  (regexp-opt-charset (if (integerp ?a)
+                          cset
+                        (mapcar #'char-to-string cset))))
 
 ;; Customization
 

(defvar scala-font-lock-keywords
  `(;; keywords
    (,scala-keywords-re
     1 font-lock-keyword-face nil)

    ;; constants
    (,scala-constants-re

  "List of all Scala special characters.")

(defconst scala-most-special-char-re
  (scala-regexp-opt-charset scala-most-special-chars)
  "Regular expression matching a single Scala special character")

(defconst scala-all-special-char-re
  (scala-regexp-opt-charset scala-all-special-chars)
  "Regular expression matching a single Scala special character")

(defconst scala-keywords-re
