            (if (and popup (boundp 'mode-popup-menu))
                (funcall (symbol-function 'set)
                         'mode-popup-menu erlang-xemacs-popup-menu))))
-        ((>= erlang-emacs-major-version 19)
+        ((>= emacs-major-version 19)
          (define-key keymap (vector 'menu-bar (intern name))
            (erlang-menu-make-keymap name items)))
         (t nil)))

(defun inferior-erlang-window (&optional all-frames)
  "Return the window containing the inferior Erlang, or nil."
  (and (inferior-erlang-running-p)
       (if (and all-frames (>= erlang-emacs-major-version 19))
           (get-buffer-window inferior-erlang-buffer t)
         (get-buffer-window inferior-erlang-buffer))))


  (make-local-variable 'indent-region-function)
  (setq indent-region-function 'erlang-indent-region)
  (set (make-local-variable 'comment-indent-function) 'erlang-comment-indent)
  (if (<= emacs-major-version 18)
      (set (make-local-variable 'comment-indent-hook) 'erlang-comment-indent))
  (set (make-local-variable 'parse-sexp-ignore-comments) t)
  (set (make-local-variable 'dabbrev-case-fold-search) nil)
