 		 (misc
 		  (cons "Misc" yacas-menu-misc-menu))
 		 (help 
-		  (if yacas-have-w3
-		      (cons "Help" yacas-menu-help-menu)
-		    nil))))
+                  (cons "Help" yacas-menu-help-menu)
+                  )))
 	      cons
 	      (vec (vector 'rootmenu 'yacas nil))
 	      ;; menus appear in the opposite order that we

  (use-local-map yacas-mode-map)
  (setq major-mode 'yacas-mode)
  (setq mode-name "Yacas")
  (make-local-variable 'font-lock-keywords-case-fold-search)
  (setq font-lock-keywords-case-fold-search nil)
  (make-local-variable 'font-lock-defaults)
  (setq font-lock-defaults
	'(yacas-font-lock-keywords
	  nil nil ((?_ . "w") (?~ . "w")) beginning-of-defun
	  (font-lock-comment-start-regexp . "/*")
	  (font-lock-comment-end-regexp . "*/")
	  (font-lock-mark-block-function . mark-defun)))
  (make-local-variable 'end-comment-column)
  (setq end-comment-column 72)
  (set-syntax-table yacas-mode-syntax-table)
  (make-local-variable 'paragraph-start)
  (setq paragraph-start (concat "^$\\|" page-delimiter))
  (make-local-variable 'paragraph-separate)
  (setq paragraph-separate paragraph-start)
  (make-local-variable 'paragraph-ignore-fill-prefix)
  (setq paragraph-ignore-fill-prefix t)
  (make-local-variable 'parse-sexp-ignore-comments)
  (setq parse-sexp-ignore-comments nil)
  (make-local-variable 'require-final-newline)
  (setq require-final-newline t)
  (make-local-variable 'comment-start)
  (setq comment-start "/*")
  (make-local-variable 'comment-end)
  (setq comment-end "*/")
  (make-local-variable 'comment-start-skip)
  (setq comment-start-skip "/\\*+ *\\|// *")
  (make-local-variable 'comment-indent-hook)
  (setq comment-indent-hook 'c-comment-indent)
  (make-local-variable 'font-lock-defaults)
  (yacas-menu-install-menus)
  (run-hooks 'yacas-mode-hooks))

(setq yacas-have-w3 nil)
(if (or yacas-running-xemacs (require 'w3 "w3" t))
    (progn
      (setq yacas-have-w3 t)
      (defun yacas-help ()
	(interactive)
	(let ((fn (read-string "Help on: ")))
	  (select-window (split-window))
	  (if (string= fn "")
	      (w3-open-local 
	       (concat yacas-documentation-directory "books.html"))
	    (w3-open-local
	     (concat yacas-documentation-directory "ref.html#" fn)))
	  (define-key (current-local-map) "q"
	    '(lambda ()
	       (interactive)
	       (w3-quit)
	       (delete-window)))))))

(defun yacas-newline ()
  "Insert a newline and indent following line like previous line."

(defconst yacas-menu-process
  (list
   "Process"
   ["Start a Yacas process"   yacas-start
                                  (not (processp inferior-yacas-process))]
   ["Run Yacas on buffer"   yacas-buffer]
   ["Run Yacas on region"  yacas-region ]
   ["Run Yacas on line"  yacas-line]
   ["Display the output buffer"  yacas-display-buffer]
   ["Toggle PrettyForm" yacas-toggle-prettyform ]
   ["Reset the Yacas process" yacas-reset]
   ["Send string to Yacas" yacas-eval-string]
   ["Kill Yacas process"  yacas-stop  (processp inferior-yacas-process)])
  "Yacas process commands")

(defconst yacas-menu-formatting
