Commits

Anonymous committed 35ecddb

Update to latest upstream version.

Comments (0)

Files changed (10)

+2004-05-14  Jerry James  <james@xemacs.org>
+
+	* Sync with upstream 1.45.
+
 2003-10-31  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.06 released.
 # Boston, MA 02111-1307, USA.
 
 VERSION = 1.06
-AUTHOR_VERSION = 1.44
-MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
+AUTHOR_VERSION = 1.45
+MAINTAINER = Jerry James <james@xemacs.org>
 PACKAGE = haskell-mode
 PKG_TYPE = regular
 REQUIRES = dired mail-lib xemacs-base edit-utils

haskell-decl-scan.el

 ;; . Would be nice to scan other top-level declarations such as
 ;;   methods of a class, datatype field labels...  any more?
 ;;
-;; . Support for Green Card?
+;; . Support for GreenCard?
 ;;
 ;; . Re-running (literate-)haskell-imenu should not cause the problems
 ;;   that it does.  The ability to turn off scanning would also be

haskell-font-lock.el

 ;;; haskell-font-lock.el --- Font locking module for Haskell Mode
 
 ;; Copyright 1997-1998 Graeme E Moss, and Tommy Thorn
+;; Copyright 2003 Free Software Foundation, Inc.
 
 ;; Authors: 1997-1998 Graeme E Moss <gem@cs.york.ac.uk> and
 ;;                    Tommy Thorn <thorn@irisa.fr>
+;;          2003  Dave Love <fx@gnu.org>
 ;; Keywords: faces files Haskell
 ;; Version: 1.2
-;; URL: http://www.cs.york.ac.uk/~gem/haskell-mode/font-lock.html
 
 ;;; This file is not part of GNU Emacs.
 
 ;; Purpose:
 ;;
 ;; To support fontification of standard Haskell keywords, symbols,
-;; functions, etc.  Supports full Latin1 Haskell 1.4 as well as
+;; functions, etc.  Supports full Haskell 1.4 as well as LaTeX- and
 ;; Bird-style literate scripts.
 ;;
-;;
 ;; Installation:
 ;; 
 ;; To turn font locking on for all Haskell buffers under the Haskell
 ;; mode of Moss&Thorn, add this to .emacs:
 ;;
-;;    (add-hook haskell-mode-hook 'turn-on-haskell-font-lock)
+;;    (add-hook 'haskell-mode-hook 'turn-on-haskell-font-lock)
 ;;
 ;; Otherwise, call `turn-on-haskell-font-lock'.
 ;;
 ;; below, email gem@cs.york.ac.uk and thorn@irisa.fr quoting the
 ;; version of the mode you are using, the version of emacs you are
 ;; using, and a small example of the problem or suggestion.  Note that
-;; this module requires a reasonably recent version of Emacs.
+;; this module requires a reasonably recent version of Emacs.  It
+;; requires Emacs 21 to cope with Unicode characters and to do proper
+;; syntactic fontification.
+;;
+;; Version 1.3:
+;;   From Dave Love:
+;;   Support for proper behaviour (including with Unicode identifiers)
+;;   in Emacs 21 only hacked in messily to avoid disturbing the old
+;;   stuff.  Needs integrating more cleanly.  Allow literate comment
+;;   face to be customized.  Some support for fontifying definitions.
+;;   (I'm not convinced the faces should be customizable -- fontlock
+;;   faces are normally expected to be consistent.)
 ;;
 ;; Version 1.2:
 ;;   Added support for LaTeX-style literate scripts.  Allow whitespace
 ;;
 ;; Present Limitations/Future Work (contributions are most welcome!):
 ;;
-;; . Nested comments are not highlighted properly, eg. {- {- -} -}
-;;   The first closing dash-brace returns the face to default.  It is
-;;   not known to us if this is actually possible with font lock.
-;;
 ;; . Debatable whether `()' `[]' `(->)' `(,)' `(,,)' etc. should be
 ;;   highlighted as constructors or not.  Should the `->' in
 ;;   `id :: a -> a' be considered a constructor or a keyword?  If so,
 ;;   how do we distinguish this from `\x -> x'?  What about the `\'?
 ;;
-;; . Unicode is still a mystery...  has anyone used it yet?  We still
-;;   support Latin-ISO-8859-1 though (the character set of Haskell 1.3).
-;;
-;; . Font lock fails on:
-;;   - `\' at the beginning of a line not starting a string continuation
-;;     that does contain a `"', eg. when defining a lambda expression;
-;;   - `--' or `{-' used within strings;
-;;
 ;; . XEmacs can support both `--' comments and `{- -}' comments
 ;;   simultaneously.  If XEmacs is detected, this should be used.
 ;; 
-;; . Support for Green Card?
-;;
-;; . Support for \begin{code}..\end{code} style of literate scripts?
+;; . Support for GreenCard?
 ;;
 
 ;;; All functions/variables start with
 ;;; `(turn-(on/off)-)haskell-font-lock' or `haskell-fl-'.
 
+(eval-when-compile (require 'haskell-mode))
+(require 'font-lock)
+
 ;; Version.
-(defconst haskell-font-lock-version "1.2"
+(defconst haskell-font-lock-version "1.3"
   "haskell-font-lock version number.")
 (defun haskell-font-lock-version ()
   "Echo the current version of haskell-font-lock in the minibuffer."
 (defvar latex-literate-haskell-font-lock-keywords-2 ()
   "High level font lock definitions for LaTeX-style literate Haskell.")
 
+(eval-and-compile
+(defconst haskell-emacs21-features (string-match "[[:alpha:]]" "x")
+  "Non-nil if we have regexp char classes.
+Assume this means we have other useful features from Emacs 21.")
+
+  (if haskell-emacs21-features
+(defvar haskell-literate-comment-face 'haskell-comment-face
+  "Face with which to fontify literate comments.
+Set to `default' to avoid fontification of them."))
+
 ;; The font lock regular expressions.
+  (if haskell-emacs21-features
+(defun haskell-font-lock-keywords-create (bird-literate latex-literate level)
+  "Creates appropriate LEVEL (1 or 2) of fontification definitions
+for (BIRD-LITERATE or LATEX-LITERATE) Haskell scripts.  Returns keywords
+suitable for `font-lock-keywords'."
+  (let* (;; Bird-style literate scripts start a line of code with
+	 ;; "^>", otherwise a line of code starts with "^".
+	 (line-prefix (if bird-literate "^>" "^"))
+
+	 ;; Most names are borrowed from the lexical syntax of the Haskell
+	 ;; report. 
+
+         ;; We allow _ as the first char to fit GHC
+         (id "\\b[[:alnum:]'_]+\\b")
+         (varid "\\b[[:lower:]_][[:alnum:]'_]*\\b")
+         (conid "\\b[[:upper:]][[:alnum:]'_]*\\b")
+	 (modid (concat "\\b" conid "\\(?:\\." conid "\\)*\\b"))
+         (qconid (concat modid "\\." conid))
+	 (sym
+	  ;; Add backslash to the symbol-syntax chars.  This seems to
+	  ;; be thrown for some reason by backslash's escape syntax.
+	  "\\(?:\\s_\\|\\\\\\)+")
+	 font-lock-keywords)
+
+    (setq font-lock-keywords
+	  `(
+;;
+;; NOTICE the ordering below is significant
+;;
+	    ("^#.*$" 0 'font-lock-warning-face t)
+	    ,(eval-when-compile
+	       (regexp-opt
+		;; ?? `as' and `qualified' aren't in the Haskell98 list.
+		;; `_' can go in here since it has temporary word syntax.
+		'("as" "case" "class" "data" "default" "deriving" "do" "else"
+		  "hiding" "if" "import" "in" "infix" "infixl" "infixr"
+		  "instance" "let" "module" "newtype" "of" "qualified" "then"
+		  "type" "where" "_")
+		'words))
+	    (,(eval-when-compile
+		;; Would lose at bol.
+		(concat "\\S_"
+			(regexp-opt '(".." "::" "=" "\\" "|" "<-" "->"
+				      "@" "~" "=>")
+				    t)
+			"\\S_"))
+	     (1 'haskell-operator-face))
+
+	    ;; These four are debatable...
+	    ("()" 0 'haskell-constructor-face)
+	    ("(,*)" 0 'haskell-constructor-face)
+	    ("\\[\\]" 0 'haskell-constructor-face)
+	    ("(->)" 0 'haskell-constructor-face)
+	    ,`(,qconid 0 'haskell-constructor-face)
+	    ,@(if (eq level 2)
+		  `(,`(,(concat "\`" varid "\`") 0 'haskell-operator-face)))
+	    ;; Expensive.
+	    ,`(,conid 0 'haskell-constructor-face)
+	    ,@(if (eq level 2)
+		  (list (list (concat "\\S_\\(:\\(?:" sym "\\)?\\)")
+			      '(1 'haskell-constructor-face))))
+	    ,@(if (eq level 2)
+		  (list (list sym '(0 'haskell-operator-face))))
+
+	    ;; Declarations.
+	    (,(concat line-prefix "\\(" varid "\\)\\s-*\\(?:" varid
+		      "\\|::\\|=\\||\\)")
+	     (1 'haskell-definition-face))
+	    (,(concat line-prefix "\\(" varid "\\)\\s-*\\(" sym "\\)")
+	     (1 'default)
+	     (2 'haskell-definition-face))
+	    (,(concat line-prefix "\\(" varid "\\)\\s-*\\s(")
+	     (1 'haskell-definition-face))
+	    (,(concat line-prefix "(\\(" sym "\\))")
+	     (1 'haskell-definition-face))))
+      (if bird-literate
+	  ;; Don't colour the Bird tracks.
+	  (setq font-lock-keywords
+		(append font-lock-keywords '(("^>" 0 'default t)))))
+      font-lock-keywords))
 (defun haskell-font-lock-keywords-create (bird-literate latex-literate level)
   "Creates appropriate LEVEL (1 or 2) of fontification definitions
 for (BIRD-LITERATE or LATEX-LITERATE) Haskell scripts.  Returns keywords
             (setq font-lock-keywords
                   `((haskell-fl-latex-comments 0 'font-lock-comment-face t)
                     ,@font-lock-keywords))))
-      font-lock-keywords))
+      font-lock-keywords))))
+
+;; The next three aren't used in Emacs 21.
 
 (defvar haskell-fl-latex-cache-pos nil
   "Position of cache point used by `haskell-fl-latex-cache-in-comment'.
             ;; If one found, mark it as a comment, otherwise finish.
             (point))))))
 
+(eval-and-compile
+  (if haskell-emacs21-features
+(defvar haskell-fl-syntax
+  ;; The mode syntax table will basically DTRT.  However, it's
+  ;; convenient to treat the non-ASCII punctuation characters as
+  ;; symbol.  (We probably have to keep `,' and `;' as
+  ;; punctuation, so we can't just consider sequences of
+  ;; punctuation and symbol syntax.  We could also use
+  ;; categories.)
+  `((?_ . "w")				; in case _ has normal syntax
+    (?' . "w")
+    ,@(let (cs i lim)
+	(let ((table (make-syntax-table)))
+	  (map-char-table
+	   (lambda (k v)
+	     ;; The current Emacs 22 codebase can pass either a char
+	     ;; or a char range.
+	     (if (consp k)
+		 (setq i (car k)
+		       lim (cdr k))
+	       (setq i k 
+		     lim k))
+	     (if (<= i lim)
+		 (when (and (> i 127)
+			    (equal v '(1)))
+		   (push (cons i "-") cs))
+	       (setq i (1+ i))))
+	   (standard-syntax-table)))
+	cs))  
+  "Syntax required for font locking.
+Given as a list of pairs for use in `font-lock-defaults'.")
 (defvar haskell-fl-syntax
   ;; It's easier for us to manually set the ISO Latin1 syntax as I'm
   ;; not sure what libraries are available and how they differ from
 	      (concat (haskell-enum-from-to ?\300 ?\326) (haskell-enum-from-to ?\330 ?\337)
 		      (haskell-enum-from-to ?\340 ?\366) (haskell-enum-from-to ?\370 ?\377))))
   "Syntax required for font locking.  Given as a list of pairs for use
-in `font-lock-defaults'.")
+in `font-lock-defaults'.")))
+
+(defconst haskell-basic-syntactic-keywords
+  '(
+    ;; Character constants (since apostrophe can't have string syntax)
+    ("\\Sw\\('\\)\\([^\\']\\|\\\\[^']+\\|\\\\'\\)\\('\\)" (1 "|") (3 "|"))
+    ;; Deal with instances of `--' which don't form a comment.
+    ("\\s_\\{3,\\}" (0 (if (string-match "\\`-*\\'" (match-string 0))
+			   nil		; Sequence of hyphens.  Do nothing in
+					; case of things like `{---'.
+			 "_")))))	; other symbol sequence
+
+(defconst haskell-bird-syntactic-keywords
+  (cons '("^\\([^\n>]\\)[^\n]*\\(\n\\)"  (1 "!") (2 "!"))
+	haskell-basic-syntactic-keywords))
+
+(defun haskell-fl-bobp (end)
+  "Find first non-newline character at beginning of buffer."
+  (if (= (point) 1)			; not bobp in case of narrowing
+      (re-search-forward "[^\n]" nil t)))
+
+(defconst haskell-latex-syntactic-keywords
+  (append
+   '(("^\\\\begin{code}\\(\n\\)" 1 "!")
+     (haskell-fl-bobp (0 "!"))	       ; start comment at buffer start
+     ("^\\(\\\\\\)end{code}$" 1 "!"))
+   haskell-basic-syntactic-keywords))
+
+(defun haskell-syntactic-face-function (state)
+  "`font-lock-syntactic-face-function' for Haskell."
+  (if (nth 3 state)
+      'font-lock-string-face		; as normal
+    ;; Else comment.  If it's from syntax table, use default face.
+    (if (eq 'syntax-table (nth 7 state))
+	haskell-literate-comment-face
+      'haskell-comment-face)))
 
 (defun haskell-font-lock-defaults-create (bird-literate latex-literate)
-  "Makes local variable `font-lock-defaults' suitable for Haskell font
-locking.  If BIRD-LITERATE is non-nil then the font locking is made
+  "Locally set `font-lock-defaults' for Haskell.
+If BIRD-LITERATE is non-nil then the font locking is made
 suitable for Bird-style literate Haskell scripts, and similarly for
 LATEX-LITERATE and LaTeX-style literate Haskell scripts."
   (setq haskell-font-lock-keywords-1
   (make-local-variable 'font-lock-defaults)
   (setq font-lock-defaults
 	(if bird-literate
-	    (list '(bird-literate-haskell-font-lock-keywords
-		    bird-literate-haskell-font-lock-keywords-1
-		    bird-literate-haskell-font-lock-keywords-2)
-		  nil nil haskell-fl-syntax)
+	    (append (list '(bird-literate-haskell-font-lock-keywords
+			    bird-literate-haskell-font-lock-keywords-1
+			    bird-literate-haskell-font-lock-keywords-2)
+			  nil nil haskell-fl-syntax)
+		    (if haskell-emacs21-features
+			(list nil
+			      (cons 'font-lock-syntactic-keywords
+				    haskell-bird-syntactic-keywords)
+			      '(font-lock-syntactic-face-function
+				. haskell-syntactic-face-function))))
           (if latex-literate
-              (list '(latex-literate-haskell-font-lock-keywords
-                      latex-literate-haskell-font-lock-keywords-1
-                      latex-literate-haskell-font-lock-keywords-2)
-                    nil nil haskell-fl-syntax)
-            (list '(haskell-font-lock-keywords
-                    haskell-font-lock-keywords-1
-                    haskell-font-lock-keywords-2)
-                  nil nil haskell-fl-syntax)))))
+	      (append
+	       (list '(latex-literate-haskell-font-lock-keywords
+		       latex-literate-haskell-font-lock-keywords-1
+		       latex-literate-haskell-font-lock-keywords-2)
+		     nil nil haskell-fl-syntax)
+	       (if haskell-emacs21-features
+		   (list nil
+			 (cons 'font-lock-syntactic-keywords
+			       haskell-latex-syntactic-keywords)
+			 '(font-lock-syntactic-face-function
+			   . haskell-syntactic-face-function))))
+            (append
+	     (list '(haskell-font-lock-keywords
+		     haskell-font-lock-keywords-1
+		     haskell-font-lock-keywords-2)
+		   nil nil haskell-fl-syntax)
+	     (if haskell-emacs21-features
+		 (list nil
+		       (cons 'font-lock-syntactic-keywords
+			     haskell-basic-syntactic-keywords))))))))
 
 ;; Faces required for font locking.
 (defun haskell-fl-faces ()
   (copy-face 'font-lock-function-name-face 'haskell-operator-face)
   (copy-face 'font-lock-comment-face 'haskell-comment-face)
   (copy-face 'default 'haskell-default-face)
-;  (copy-face 'font-lock-reference-face 'haskell-definition-face)
+  (copy-face 'font-lock-variable-name-face 'haskell-definition-face)
   )
 
 ;; The main functions.
   (let ((literate (if (boundp 'haskell-literate) haskell-literate)))
     (haskell-font-lock-defaults-create (eq literate 'bird)
                                        (eq literate 'latex)))
+  ;; Get help from font-lock-syntactic-keywords.
+  (set (make-local-variable 'parse-sexp-lookup-properties) t)
   (run-hooks 'haskell-font-lock-hook)
   (turn-on-font-lock))
 
   "Turns off font locking in current buffer."
   (interactive)
   (if (and (boundp 'font-lock-mode) font-lock-mode)
-      (font-lock-mode)))
+      (font-lock-mode -1)))
 
 ;;; Provide ourselves:
 
   (setq comint-input-sentinel 'shell-directory-tracker)
 
   ;; GHCi prompt should be of the form `ModuleName> '.
-  (setq comint-prompt-regexp  "^\\*?[A-Z][_a-zA-Z0-9]*\\( \\*?[A-Z][_a-zA-Z0-9]*\\)*> ")
+  (setq comint-prompt-regexp  "^\\*?[A-Z][\\._a-zA-Z0-9]*\\( \\*?[A-Z][\\._a-zA-Z0-9]*\\)*> ")
 
   ;; History syntax of comint conflicts with Haskell, e.g. !!, so better
   ;; turn it off.
   (setq shell-dirtrackp         t)
   (setq comint-input-sentinel   'shell-directory-tracker)
                                 ; ? or  module name in Hugs 1.4
-  (setq comint-prompt-regexp  "^\? \\|^[A-Z][_a-zA-Z0-9]*> ")
+  (setq comint-prompt-regexp  "^\? \\|^[A-Z][_a-zA-Z0-9\.]*> ")
     ;; comint's history syntax conflicts with Hugs syntax, eg. !!
   (setq comint-input-autoexpand nil)
   (run-hooks 'haskell-hugs-hook)

haskell-indent.el

   (interactive)
   (make-local-variable 'indent-line-function)
   (setq indent-line-function 'haskell-indent-cycle)
-  (local-set-key "\177"  'backward-delete-char-untabify)
+;  Removed: remapping DEL seems a bit naughty --SDM
+;  (local-set-key "\177"  'backward-delete-char-untabify)
   (local-set-key "\t"    'haskell-indent-cycle)
   (local-set-key "\C-c=" 'haskell-indent-insert-equal)
   (local-set-key "\C-c|" 'haskell-indent-insert-guard)
-;;; haskell-mode.el --- A Haskell editing mode
+;;; haskell-mode.el --- A Haskell editing mode    -*-coding: iso-8859-1;-*-
 
 ;; Copyright (C) 1992, 1997-1998 Simon Marlow, Graeme E Moss, and Tommy Thorn
+;; Copyright (C) 2003 Free Software Foundation, Inc
 
 ;; Authors: 1992      Simon Marlow
 ;;          1997-1998 Graeme E Moss <gem@cs.york.ac.uk> and
 ;;                    Tommy Thorn <thorn@irisa.fr>,
 ;;          2001-2002 Reuben Thomas (>=v1.4)
+;;          2003      Dave Love <fx@gnu.org>
 ;; Keywords: faces files Haskell
 ;; Version: 1.43
 ;; URL: http://www.haskell.org/haskell-mode/
 ;;   Interaction with GHCi interpreter.
 ;;
 ;;
-;; This mode supports full Latin1 Haskell 1.4 including literate scripts.
+;; This mode supports full Haskell 1.4 including literate scripts.
+;; In some versions of (X)Emacs it may only support Latin-1, not Unicode.
 ;;
 ;; Installation:
 ;; 
 ;;   Ville Skytt� <scop@xemacs.org>.
 ;;
 ;; Version 1.42:
-;;   Added autoload for GHCi inferior mode (thanks to Scott 
+;;   Added autoload for GHCi inferior mode (thanks to Scott
 ;;   Williams for the bug report and fix).
 ;;
 ;; Version 1.41:
 
 ;; Present Limitations/Future Work (contributions are most welcome!):
 ;;
-;; . Unicode is still a mystery...  has anyone used it yet?  We still
-;;   support Latin-ISO-8859-1 though (the character set of Haskell 1.3).
-;;
 ;; . Would like RET in Bird-style literate mode to add a ">" at the
 ;;   start of a line when previous line starts with ">".  Or would
 ;;   "> " be better?
 ;;
-;; . Support for Green Card?
+;; . Support for GreenCard?
 ;;
 
 ;;; All functions/variables start with `(literate-)haskell-'.
 Always buffer-local.")
 (make-variable-buffer-local 'haskell-literate)
 ;; Default literate style for ambiguous literate buffers.
-(defvar haskell-literate-default 'bird
-  "*If the style of a literate buffer is ambiguous, then this variable
-gives the default value for `haskell-literate'.  This variable should
+(defcustom haskell-literate-default 'bird
+  "*Default value for `haskell-literate'.
+Used if the style of a literate buffer is ambiguous.  This variable should
 be set to the preferred literate style.  For example, place within
 .emacs:
 
-   (setq haskell-literate-default 'latex)")
+   (setq haskell-literate-default 'latex)"
+  :type '(choice bird latex nil)
+  :group 'haskell)
 
 ;; Mode maps.
-(defvar haskell-mode-map ()
+(defvar haskell-mode-map (let ((keymap (make-sparse-keymap)))
+			   (define-key keymap "\C-c\C-c" 'comment-region)
+			   keymap)
   "Keymap used in Haskell mode.")
-(make-variable-buffer-local 'haskell-mode-map)
-
-(if (not (default-value 'haskell-mode-map))
-    (set-default 'haskell-mode-map
-                 (progn
-                   (let ((keymap (make-sparse-keymap)))
-                     (define-key keymap "\C-c\C-c" 'comment-region)
-                     keymap))))
 
 ;; Syntax table.
-(defvar haskell-mode-syntax-table nil
+(defvar haskell-mode-syntax-table
+  (let ((table (make-syntax-table)))
+    (modify-syntax-entry ?\  " " table)
+    (modify-syntax-entry ?\t " " table)
+    (modify-syntax-entry ?\" "\"" table)
+    (modify-syntax-entry ?\' "\'" table)
+    (modify-syntax-entry ?_  "w" table)
+    (modify-syntax-entry ?\( "()" table)
+    (modify-syntax-entry ?\) ")(" table)
+    (modify-syntax-entry ?\[  "(]" table)
+    (modify-syntax-entry ?\]  ")[" table)
+
+    (cond ((featurep 'xemacs)
+	   ;; I don't know whether this is equivalent to the below
+	   ;; (modulo nesting).  -- fx
+	   (modify-syntax-entry ?{  "(}1" table)
+	   (modify-syntax-entry ?}  "){4" table)
+	   (modify-syntax-entry ?-  "_ 23" table))
+	  (t
+	   ;; The following get comment syntax right, similarly to C++
+	   ;; (but the `b' style needs to be the other way round).  In
+	   ;; Emacs 21, the `n' indicates that they nest.  Proper
+	   ;; treatment of comments requires syntactic font-lock
+	   ;; support.
+	   (modify-syntax-entry ?\{  "(}1nb" table)
+	   (modify-syntax-entry ?\}  "){4nb" table)
+	   (modify-syntax-entry ?-  "_ 123" table)
+	   (modify-syntax-entry ?\n ">" table)))
+
+    (modify-syntax-entry ?\` "$`" table)
+    (modify-syntax-entry ?\\ "\\" table)
+    (mapcar (lambda (x)
+	      (modify-syntax-entry x "_" table))
+	    ;; Some of these are actually OK by default.
+	    "!#$%&*+./:<=>?@^|~")
+    (unless (featurep 'mule)
+      ;; Non-ASCII syntax should be OK, at least in Emacs.
+      (mapcar (lambda (x)
+		(modify-syntax-entry x "_" table))
+	      (concat (haskell-enum-from-to ?\241 ?\277)
+		      "\327\367"))
+      (mapcar (lambda (x)
+		(modify-syntax-entry x "w" table))
+	      (concat (haskell-enum-from-to ?\300 ?\326)
+		      (haskell-enum-from-to ?\330 ?\337)
+		      (haskell-enum-from-to ?\340 ?\366)
+		      (haskell-enum-from-to ?\370 ?\377))))
+    table)
   "Syntax table used in Haskell mode.")
 
-(if (not haskell-mode-syntax-table)
-    (progn
-      (setq haskell-mode-syntax-table (make-syntax-table))
-  (modify-syntax-entry ?\  " " haskell-mode-syntax-table)
-  (modify-syntax-entry ?\t " " haskell-mode-syntax-table)
-  (modify-syntax-entry ?\" "\"" haskell-mode-syntax-table)
-  (modify-syntax-entry ?\' "\'" haskell-mode-syntax-table)
-  (modify-syntax-entry ?_  "w" haskell-mode-syntax-table)
-  (modify-syntax-entry ?\( "()" haskell-mode-syntax-table)
-  (modify-syntax-entry ?\) ")(" haskell-mode-syntax-table)
-  (modify-syntax-entry ?[  "(]" haskell-mode-syntax-table)
-  (modify-syntax-entry ?]  ")[" haskell-mode-syntax-table)
-  (modify-syntax-entry ?{  "(}1" haskell-mode-syntax-table)
-  (modify-syntax-entry ?}  "){4" haskell-mode-syntax-table)
-  (modify-syntax-entry ?-  "_ 23" haskell-mode-syntax-table)
-  (modify-syntax-entry ?\` "$`" haskell-mode-syntax-table)
-  (modify-syntax-entry ?\\ "\\" haskell-mode-syntax-table)
-  (mapcar (lambda (x)
-            (modify-syntax-entry x "_" haskell-mode-syntax-table))
-          (concat "!#$%&*+./:<=>?@^|~"
-                  (haskell-enum-from-to ?\241 ?\277)
-                  "\327\367"))
-  (mapcar (lambda (x)
-            (modify-syntax-entry x "w" haskell-mode-syntax-table))
-          (concat (haskell-enum-from-to ?\300 ?\326)
-                  (haskell-enum-from-to ?\330 ?\337)
-                  (haskell-enum-from-to ?\340 ?\366)
-                  (haskell-enum-from-to ?\370 ?\377)))))
-
 ;; Various mode variables.
 (defun haskell-vars ()
   (kill-all-local-variables)
 Blank lines separate paragraphs, comments start with `-- '.
 
 \\<haskell-mode-map>\\[indent-for-comment] will place a comment at an appropriate place on the current line.
-\\<haskell-mode-map>\\[comment-region] comments (or with prefix arg, uncomments) each line in the region.
+\\[comment-region] comments (or with prefix arg, uncomments) each line in the region.
 
 Literate scripts are supported via `literate-haskell-mode'.  The
 variable `haskell-literate' indicates the style of the script in the
          haskell-literate-default)))))
 
 (defun haskell-mode-generic (literate)
-  "Common part of `haskell-mode' and `literate-haskell-mode'.  Former
-calls with LITERATE nil.  Latter calls with LITERATE 'bird or 'latex."
+  "Common part of `haskell-mode' and `literate-haskell-mode'.
+Former calls this with LITERATE nil.  Latter calls with LITERATE `bird' or
+`latex'."
 
   (haskell-vars)
   (setq major-mode 'haskell-mode)
 HREF="mailto:simonmar@microsoft.com">mail</A> if you have an idea, or a
 module we might hook into.</EM>
 
-<P><A HREF="haskell-mode-1.44.tar.gz">The latest versions of the basic
+<P><A HREF="haskell-mode-1.45.tar.gz">The latest versions of the basic
 mode and the above modules</A>.</P>
 
 <P>The basic mode was written by Graeme E Moss, Tommy Thorn and Simon

installation-guide.html

 <H2>Installation</H2>
 
 <UL>
+<LI><P>If you are using XEmacs, the haskell-mode package should be
+available for installation through the XEmacs package UI.</P></LI>
 
-<LI><P>If you are using XEmacs, the haskell-mode package should be
-available for installation through the XEmacs package UI.
-Otherwise:</P>
+<LI><P>If you are using Debian, you can install the package haskell-mode with
+a command like "apt-get install haskell-mode".</P></LI>
+</UL>
 
+<P>Otherwise:</P>
+
+<UL>
 <LI><P>Download the and unpack the basic mode and modules into a
 suitable directory, e.g. <CODE>~/lib/emacs</CODE> where <CODE>~</CODE>
 stands for your home directory.</P>
 (add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
 (add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
 (add-hook 'haskell-mode-hook 'turn-on-haskell-hugs)
+(add-hook 'haskell-mode-hook 'turn-on-haskell-ghci)
 </PRE>
 
 <P>Note that the two indentation modules are mutually exclusive - add