emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-tng-mode 12c7148 040/385: leave fontification in c


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 12c7148 040/385: leave fontification in comments and strings
Date: Tue, 5 Oct 2021 23:58:57 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit 12c7148b1dc38dca8057266a78ea3ff5c349d6a1
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]