From a4469cd9564dffc9bcd249561762dc8145a44d41 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Fri, 29 May 2015 20:09:30 +0200 Subject: [PATCH] Prevent keyword symbols redefinition --- haskell-font-lock.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/haskell-font-lock.el b/haskell-font-lock.el index 194291159..5bf500e4b 100644 --- a/haskell-font-lock.el +++ b/haskell-font-lock.el @@ -253,8 +253,10 @@ Returns keywords suitable for `font-lock-keywords'." (,topdecl-var (1 'haskell-definition-face)) (,topdecl-var2 (2 'haskell-definition-face)) (,topdecl-bangpat (1 'haskell-definition-face)) - (,topdecl-sym (2 'haskell-definition-face)) - (,topdecl-sym2 (1 'haskell-definition-face)) + (,topdecl-sym (2 (unless (member (match-string 2) '("\\" "=" "->" "→" "<-" "←" "::" "∷" "," ";" "`")) + 'haskell-definition-face))) + (,topdecl-sym2 (1 (unless (member (match-string 1) '("\\" "=" "->" "→" "<-" "←" "::" "∷" "," ";" "`")) + 'haskell-definition-face))) ;; These four are debatable... ("(\\(,*\\|->\\))" 0 'haskell-constructor-face) @@ -269,7 +271,8 @@ Returns keywords suitable for `font-lock-keywords'." (,conid 0 'haskell-constructor-face) - (,sym 0 (if (eq (char-after (match-beginning 0)) ?:) + (,sym 0 (if (and (eq (char-after (match-beginning 0)) ?:) + (not (member (match-string 0) '("::" "∷")))) 'haskell-constructor-face 'haskell-operator-face)))) keywords))