@@ -217,10 +217,6 @@ Inherit from `default' to avoid fontification of them."
217
217
(defvar haskell-default-face 'haskell-default-face )
218
218
(defvar haskell-literate-comment-face 'haskell-literate-comment-face )
219
219
220
- (defconst haskell-emacs21-features (string-match " [[:alpha:]]" " x" )
221
- " Non-nil if we have regexp char classes.
222
- Assume this means we have other useful features from Emacs 21." )
223
-
224
220
(defun haskell-font-lock-compose-symbol (alist )
225
221
" Compose a sequence of ascii chars into a symbol.
226
222
Regexp match data 0 points to the chars."
@@ -379,15 +375,7 @@ Returns keywords suitable for `font-lock-keywords'."
379
375
(" ^=======" 0 'font-lock-warning-face t )
380
376
(" ^>>>>>>> .*$" 0 'font-lock-warning-face t )
381
377
(" ^#.*$" 0 'font-lock-preprocessor-face t )
382
- ,@(unless haskell-emacs21-features ; Supports nested comments?
383
- ; ; Expensive.
384
- `((, string-and-char 1 font-lock-string-face )))
385
-
386
- ; ; This was originally at the very end (and needs to be after
387
- ; ; all the comment/string/doc highlighting) but it seemed to
388
- ; ; trigger a bug in Emacs-21.3 which caused the compositions to
389
- ; ; be "randomly" dropped. Moving it earlier seemed to reduce
390
- ; ; the occurrence of the bug.
378
+
391
379
,@(haskell-font-lock-symbols-keywords)
392
380
393
381
(, reservedid 1 haskell-keyword-face)
@@ -453,37 +441,37 @@ Returns keywords suitable for `font-lock-keywords'."
453
441
(" ^>" 0 haskell-default-face t ))))
454
442
((latex tex)
455
443
(setq keywords
456
- `((haskell-fl -latex-comments 0 'font-lock-comment-face t )
444
+ `((haskell-font-lock -latex-comments 0 'font-lock-comment-face t )
457
445
,@keywords )))))
458
446
keywords))
459
447
460
- ; ; The next three aren't used in Emacs 21.
461
-
462
- (defvar haskell-fl-latex-cache-pos nil
463
- " Position of cache point used by `haskell-fl-latex-cache-in-comment' .
448
+ (defvar haskell-font-lock-latex-cache-pos nil
449
+ " Position of cache point used by `haskell-font-lock-latex-cache-in-comment' .
464
450
Should be at the start of a line." )
451
+ (make-variable-buffer-local 'haskell-font-lock-latex-cache-pos )
465
452
466
- (defvar haskell-fl -latex-cache-in-comment nil
467
- " If `haskell-fl -latex-cache-pos' is outside a
453
+ (defvar haskell-font-lock -latex-cache-in-comment nil
454
+ " If `haskell-font-lock -latex-cache-pos' is outside a
468
455
\\ begin{code}..\\ end{code} block (and therefore inside a comment),
469
456
this variable is set to t, otherwise nil." )
457
+ (make-variable-buffer-local 'haskell-font-lock-latex-cache-in-comment )
470
458
471
- (defun haskell-fl -latex-comments (end )
459
+ (defun haskell-font-lock -latex-comments (end )
472
460
" Sets `match-data' according to the region of the buffer before end
473
461
that should be commented under LaTeX-style literate scripts."
474
462
(let ((start (point )))
475
463
(if (= start end)
476
464
; ; We're at the end. No more to fontify.
477
465
nil
478
- (if (not (eq start haskell-fl -latex-cache-pos))
466
+ (if (not (eq start haskell-font-lock -latex-cache-pos))
479
467
; ; If the start position is not cached, calculate the state
480
468
; ; of the start.
481
469
(progn
482
- (setq haskell-fl -latex-cache-pos start)
470
+ (setq haskell-font-lock -latex-cache-pos start)
483
471
; ; If the previous \begin{code} or \end{code} is a
484
472
; ; \begin{code}, then start is not in a comment, otherwise
485
473
; ; it is in a comment.
486
- (setq haskell-fl -latex-cache-in-comment
474
+ (setq haskell-font-lock -latex-cache-in-comment
487
475
(if (and
488
476
(re-search-backward
489
477
" ^\\ (\\ (\\\\ begin{code}\\ )\\ |\\ (\\\\ end{code}\\ )\\ )$"
@@ -492,7 +480,7 @@ that should be commented under LaTeX-style literate scripts."
492
480
nil t ))
493
481
; ; Restore position.
494
482
(goto-char start)))
495
- (if haskell-fl -latex-cache-in-comment
483
+ (if haskell-font-lock -latex-cache-in-comment
496
484
(progn
497
485
; ; If start is inside a comment, search for next \begin{code}.
498
486
(re-search-forward " ^\\\\ begin{code}$" end 'move )
0 commit comments