-
Notifications
You must be signed in to change notification settings - Fork 0
/
n3-mode.el
44 lines (36 loc) · 1.06 KB
/
n3-mode.el
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;;; n3-mode.el --- mode for Notation 3
; $Id: n3-mode.el 4084 2007-12-15 17:10:13Z hugoh $
;; Copyright (c) 2003-2007 Hugo Haas <[email protected]>
;; For documentation on Notation 3, see:
;; http://www.w3.org/DesignIssues/Notation3.html
;;; Comentary:
;; Goals:
;; - sytax highlighting
;; - completion
;; - indentation
;; What it does now:
;; - Syntax highlighting
;;; Code:
(require 'generic)
(define-generic-mode 'n3-mode
;; comment char
(list "# ")
;; keywords
(list "this" "a")
;; additional font-lock'ing
'(("\\(@prefix\\)\\>" 1 font-lock-keyword-face t)
("\\(\\S-*?:\\)" 1 font-lock-type-face t)
(":\\(\\S-+?\\)\\>" 1 font-lock-constant-face t)
("\\(<.*?>\\)" 1 font-lock-function-name-face t)
("\\(\\\".*?\\\"\\)" 1 font-lock-string-face t)
; Bug: some trailing characters are highlighted; restricting comments regexp
; ("\\(#.*\\)" 1 font-lock-comment-face t)
("^\\s-*\\(#.*\\)" 1 font-lock-comment-face t)
)
;; auto-mode
(list "\\.n3$")
;; additional setup
nil
;; description
"Mode for Notation 3 documents."
)