@@ -505,71 +505,6 @@ that should be commented under LaTeX-style literate scripts."
505
505
; ; Get help from font-lock-syntactic-keywords.
506
506
(parse-sexp-lookup-properties . t ))))
507
507
508
- ; ; The main functions.
509
- (defun turn-on-haskell-font-lock ()
510
- " Turns on font locking in current buffer for Haskell 1.4 scripts.
511
-
512
- Changes the current buffer's `font-lock-defaults' , and adds the
513
- following variables:
514
-
515
- `haskell-keyword-face' for reserved keywords and syntax,
516
- `haskell-constructor-face' for data- and type-constructors, class names,
517
- and module names,
518
- `haskell-operator-face' for symbolic and alphanumeric operators,
519
- `haskell-default-face' for ordinary code.
520
-
521
- The variables are initialised to the following font lock default faces:
522
-
523
- `haskell-keyword-face' `font-lock-keyword-face'
524
- `haskell-constructor-face' `font-lock-type-face'
525
- `haskell-operator-face' `font-lock-function-name-face'
526
- `haskell-default-face' <default face>
527
-
528
- Two levels of fontification are defined: level one (the default)
529
- and level two (more colour). The former does not colour operators.
530
- Use the variable `font-lock-maximum-decoration' to choose
531
- non-default levels of fontification. For example, adding this to
532
- .emacs:
533
-
534
- (setq font-lock-maximum-decoration '((haskell-mode . 2) (t . 0)))
535
-
536
- uses level two fontification for `haskell-mode' and default level for
537
- all other modes. See documentation on this variable for further
538
- details.
539
-
540
- To alter an attribute of a face, add a hook. For example, to change
541
- the foreground colour of comments to brown, add the following line to
542
- .emacs:
543
-
544
- (add-hook 'haskell-font-lock-hook
545
- (lambda ()
546
- (set-face-foreground 'haskell-comment-face \" brown\" )))
547
-
548
- Note that the colours available vary from system to system. To see
549
- what colours are available on your system, call
550
- `list-colors-display' from emacs.
551
-
552
- To turn font locking on for all Haskell buffers, add this to .emacs:
553
-
554
- (add-hook 'haskell-mode-hook 'turn-on-haskell-font-lock)
555
-
556
- To turn font locking on for the current buffer, call
557
- `turn-on-haskell-font-lock' . To turn font locking off in the current
558
- buffer, call `turn-off-haskell-font-lock' .
559
-
560
- Bird-style literate Haskell scripts are supported: If the value of
561
- `haskell-literate-bird-style' (automatically set by the Haskell mode
562
- of Moss&Thorn) is non-nil, a Bird-style literate script is assumed.
563
-
564
- Invokes `haskell-font-lock-hook' if not nil."
565
- (haskell-font-lock-defaults-create)
566
- (run-hooks 'haskell-font-lock-hook )
567
- (turn-on-font-lock ))
568
-
569
- (defun turn-off-haskell-font-lock ()
570
- " Turns off font locking in current buffer."
571
- (font-lock-mode -1 ))
572
-
573
508
(defun haskell-fontify-as-mode (text mode )
574
509
" Fontify TEXT as MODE, returning the fontified text."
575
510
(with-temp-buffer
0 commit comments