From f5a8ff4219d24bad6e6ff89b186c71906477848e Mon Sep 17 00:00:00 2001 From: "U-Yuriy-PC\\Yuriy" Date: Sun, 5 Jul 2015 22:20:42 -0400 Subject: [PATCH 1/3] Add '{type|data} family' to font-lock-keywords-create --- haskell-font-lock.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/haskell-font-lock.el b/haskell-font-lock.el index 6990933ed..e62b9b384 100644 --- a/haskell-font-lock.el +++ b/haskell-font-lock.el @@ -250,6 +250,12 @@ Returns keywords suitable for `font-lock-keywords'." (2 'haskell-keyword-face nil lax) (3 'haskell-keyword-face nil lax)) + ;; Special case for `type family' and `data family'. + ;; `family' is only reserved in these contexts. + ("\\<\\(type\\|data\\)[ \t]+\\(family\\>\\)" + (1 'haskell-keyword-face nil lax) + (2 'haskell-keyword-face nil lax)) + ;; Toplevel Declarations. ;; Place them *before* generic id-and-op highlighting. (,topdecl-var (1 'haskell-definition-face)) From 41f1f7b797a95ed72a558be47622e632657bcdb1 Mon Sep 17 00:00:00 2001 From: "U-Yuriy-PC\\Yuriy" Date: Sun, 5 Jul 2015 22:42:17 -0400 Subject: [PATCH 2/3] Add 'family' keyword to doc-reserved-ids --- haskell-doc.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/haskell-doc.el b/haskell-doc.el index 95d5f133c..e9119e8b3 100644 --- a/haskell-doc.el +++ b/haskell-doc.el @@ -479,7 +479,8 @@ It is probably best to manipulate this data structure with the commands ("where" . "exp where { decl; ...; decl [;] }") ; check that ; see also class, instance, module ("as" . "import [qualified] modid [as modid] [impspec]") ("qualified" . "import [qualified] modid [as modid] [impspec]") - ("hiding" . "hiding ( import1 , ... , importn [ , ] )")) + ("hiding" . "hiding ( import1 , ... , importn [ , ] )") + ("family" . "(type family type [kind] [= type_fam_equations]) | (data family type [kind])")) "An alist of reserved identifiers. Each element is of the form (ID . DOC) where both ID and DOC are strings. DOC should be a concise single-line string describing the construct in which From 52bb2c8342b0eba7347c726761a84e6784596e6f Mon Sep 17 00:00:00 2001 From: "U-Yuriy-PC\\Yuriy" Date: Sun, 5 Jul 2015 22:46:23 -0400 Subject: [PATCH 3/3] Add 'family' to indentation-peek-token --- haskell-indentation.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell-indentation.el b/haskell-indentation.el index d4596e1dc..ec6bb455b 100644 --- a/haskell-indentation.el +++ b/haskell-indentation.el @@ -1163,7 +1163,7 @@ the current buffer." (defun haskell-indentation-peek-token () "Return token starting at point." - (cond ((looking-at "\\(if\\|then\\|else\\|let\\|in\\|mdo\\|rec\\|do\\|proc\\|case\\|of\\|where\\|module\\|deriving\\|data\\|type\\|newtype\\|class\\|instance\\)\\([^[:alnum:]'_]\\|$\\)") + (cond ((looking-at "\\(if\\|then\\|else\\|let\\|in\\|mdo\\|rec\\|do\\|proc\\|family\\|case\\|of\\|where\\|module\\|deriving\\|data\\|type\\|newtype\\|class\\|instance\\)\\([^[:alnum:]'_]\\|$\\)") (match-string-no-properties 1)) ((looking-at "[][(){}[,;]") (match-string-no-properties 0))