|
22 | 22 | ;; This mode is mostly intended for highlighting {#...#} hooks. |
23 | 23 | ;; |
24 | 24 | ;; Quick setup: |
25 | | -;; (autoload 'c2hs-mode "c2hs-mode" nil t) |
26 | | -;; (add-to-list 'auto-mode-alist '("\\.chs\\'" . c2hs-mode)) |
| 25 | +;; (autoload 'haskell-c2hs-mode "haskell-c2hs-mode" nil t) |
| 26 | +;; (add-to-list 'auto-mode-alist '("\\.chs\\'" . haskell-c2hs-mode)) |
27 | 27 | ;; |
28 | 28 |
|
29 | 29 | (require 'haskell-mode) |
30 | 30 | (require 'haskell-font-lock) |
31 | 31 | (require 'haskell-utils) |
32 | 32 |
|
33 | 33 | ;;;###autoload |
34 | | -(add-to-list 'auto-mode-alist '("\\.chs\\'" . c2hs-mode)) |
| 34 | +(add-to-list 'auto-mode-alist '("\\.chs\\'" . haskell-c2hs-mode)) |
35 | 35 |
|
36 | | -(defface c2hs-hook-pair-face |
| 36 | +(defface haskell-c2hs-hook-pair-face |
37 | 37 | '((t (:inherit 'font-lock-preprocessor-face))) |
38 | 38 | "Face for highlighting {#...#} pairs." |
39 | 39 | :group 'haskell) |
40 | 40 |
|
41 | | -(defface c2hs-hook-name-face |
| 41 | +(defface haskell-c2hs-hook-name-face |
42 | 42 | '((t (:inherit 'font-lock-keyword-face))) |
43 | 43 | "Face for highlighting c2hs hook names." |
44 | 44 | :group 'haskell) |
45 | 45 |
|
46 | | -(defvar c2hs-font-lock-keywords |
| 46 | +(defvar haskell-c2hs-font-lock-keywords |
47 | 47 | `((,(haskell--rx-let ((ws (any ?\s ?\t ?\n ?\r)) |
48 | 48 | (anychar (or (not (any ?#)) |
49 | 49 | (seq "#" |
|
176 | 176 | (* anychar) |
177 | 177 | (group-n 9 "#}")) |
178 | 178 | ;; Override highlighting for pairs in order to always distinguish them. |
179 | | - (1 'c2hs-hook-pair-face t) |
180 | | - (2 'c2hs-hook-name-face) |
| 179 | + (1 'haskell-c2hs-hook-pair-face t) |
| 180 | + (2 'haskell-c2hs-hook-name-face) |
181 | 181 | ;; Make matches lax, i.e. do not signal error if nothing |
182 | 182 | ;; matched. |
183 | | - (3 'c2hs-hook-name-face nil t) |
184 | | - (4 'c2hs-hook-name-face nil t) |
185 | | - (5 'c2hs-hook-name-face nil t) |
186 | | - (6 'c2hs-hook-name-face nil t) |
187 | | - (7 'c2hs-hook-name-face nil t) |
| 183 | + (3 'haskell-c2hs-hook-name-face nil t) |
| 184 | + (4 'haskell-c2hs-hook-name-face nil t) |
| 185 | + (5 'haskell-c2hs-hook-name-face nil t) |
| 186 | + (6 'haskell-c2hs-hook-name-face nil t) |
| 187 | + (7 'haskell-c2hs-hook-name-face nil t) |
188 | 188 | (8 'font-lock-negation-char-face nil t) |
189 | 189 | ;; Override highlighting for pairs in order to always distinguish them. |
190 | | - (9 'c2hs-hook-pair-face t)) |
| 190 | + (9 'haskell-c2hs-hook-pair-face t)) |
191 | 191 | ,@(haskell-font-lock-keywords))) |
192 | 192 |
|
193 | 193 | ;;;###autoload |
194 | | -(define-derived-mode c2hs-mode haskell-mode "C2HS" |
| 194 | +(define-derived-mode haskell-c2hs-mode haskell-mode "C2HS" |
195 | 195 | "Mode for editing *.chs files of the c2hs haskell tool." |
196 | 196 | (setq-local font-lock-defaults |
197 | | - (cons 'c2hs-font-lock-keywords |
| 197 | + (cons 'haskell-c2hs-font-lock-keywords |
198 | 198 | (cdr font-lock-defaults)))) |
199 | 199 |
|
200 | 200 |
|
|
0 commit comments