Package: erlang / 1:21.2.6+dfsg-1

atomsfontlock.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Author: Sergei Golovan
Description: Patch uses the default font for atoms enclosed in single
 quotes similar to the ordinary atoms instead of font-lock-string-face
 font to make atoms less confusing with strings.
Last-Modified: Tue, 24 Apr 2018 17:44:51 +0300
Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597248

--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -1432,8 +1432,17 @@
 
 (defun erlang-syntax-table-init ()
   (erlang-ensure-syntax-table-is-initialized)
+  (setq font-lock-syntactic-face-function 'erlang-syntactic-face-function)
   (set-syntax-table erlang-mode-syntax-table))
 
+(defun erlang-syntactic-face-function (state)
+  (cond
+   ((nth 3 state) ;strings and stringlike elements
+    (case (nth 3 state)
+      (?\" font-lock-string-face)
+      (?\' 'default)))
+   (t font-lock-comment-face)))
+
 (defun erlang-ensure-syntax-table-is-initialized ()
   (unless erlang-mode-syntax-table
     (let ((table (make-syntax-table)))