From cc00bc22362a3fd9a79ea3fcd4692a0372d1b819 Mon Sep 17 00:00:00 2001 From: hmgibson23 Date: Wed, 22 Apr 2015 10:46:31 +0100 Subject: [PATCH 1/2] Use char before and after --- haskell-font-lock.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/haskell-font-lock.el b/haskell-font-lock.el index 553e5a37b..065c8fdce 100644 --- a/haskell-font-lock.el +++ b/haskell-font-lock.el @@ -82,8 +82,9 @@ be disabled at that position.") This is the case if the \".\" is part of a \"forall . \"." (save-excursion (goto-char start) - (re-search-backward "\\[^.\"]*\\=" - (line-beginning-position) t))) + (not (or + (string= " " (string (char-after start))) + (string= " " (string (char-before start))))))) (defface haskell-keyword-face '((t :inherit 'font-lock-keyword-face)) From e55bc1e746934098bb5464cf664b453d05459535 Mon Sep 17 00:00:00 2001 From: hmgibson23 Date: Wed, 22 Apr 2015 12:37:00 +0100 Subject: [PATCH 2/2] Restore forall search --- haskell-font-lock.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/haskell-font-lock.el b/haskell-font-lock.el index 065c8fdce..92efdc98e 100644 --- a/haskell-font-lock.el +++ b/haskell-font-lock.el @@ -82,9 +82,11 @@ be disabled at that position.") This is the case if the \".\" is part of a \"forall . \"." (save-excursion (goto-char start) - (not (or - (string= " " (string (char-after start))) - (string= " " (string (char-before start))))))) + (or (re-search-backward "\\[^.\"]*\\=" + (line-beginning-position) t) + (not (or + (string= " " (string (char-after start))) + (string= " " (string (char-before start)))))))) (defface haskell-keyword-face '((t :inherit 'font-lock-keyword-face))