branch: elpa/haskell-tng-mode commit 12c7148b1dc38dca8057266a78ea3ff5c349d6a1 Author: Tseen She <ts33n....@gmail.com> Commit: Tseen She <ts33n....@gmail.com>
leave fontification in comments and strings --- haskell-tng-font-lock.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/haskell-tng-font-lock.el b/haskell-tng-font-lock.el index 9115fe9..bda9ce4 100644 --- a/haskell-tng-font-lock.el +++ b/haskell-tng-font-lock.el @@ -187,7 +187,7 @@ . 'haskell-tng:constructor) ;; some things look nicer without faces - (,(rx (any ?\( ?\) ?\[ ?\] ?\{ ?\} ?,)) + (haskell-tng:font:none (0 'default t)) ;; TODO: remove faces instead of adding 'default @@ -220,6 +220,16 @@ Some complexity to avoid matching on operators." (goto-char open) (re-search-forward (rx (+ anything)) close t))))))) +(defun haskell-tng:font:none (limit) + "Things that should not be fontified." + (when-let ((p (re-search-forward + (rx (any ?\( ?\) ?\[ ?\] ?\{ ?\} ?,)) + limit t)) + (pp (syntax-ppss))) + (if (or (nth 3 pp) (nth 4 pp)) + (haskell-tng:font:none limit) + p))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Here are `function' matchers for use in `font-lock-keywords' and ;; `font-lock-extend-region-functions' procedures for extending the region.