about summary refs log tree commit diff
path: root/misc
diff options
context:
space:
mode:
authorPascal Wittmann <mail@pascal-wittmann.de>2015-10-10T10·08+0200
committerPascal Wittmann <mail@pascal-wittmann.de>2015-10-10T19·20+0200
commit5f1a3201ec0c451bf05f42a15a33d61b4c203603 (patch)
tree3bc8c204ab5805d4e73f8259e27687be395ba752 /misc
parent133a421bb40cca3a74c93b05f3abe310110c6258 (diff)
emacs mode: match keywords on the start/end of symbols
If keywords are matched on the start/end of words then
keywords are also matched if they are surrounded by dashes
or underscores. For example the keyword with is highlighted
in geany-with-vte. When matching on the start/end of symbols
the keyword is only highlighted if it is not part of an other
identifier.
Diffstat (limited to 'misc')
-rw-r--r--misc/emacs/nix-mode.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/misc/emacs/nix-mode.el b/misc/emacs/nix-mode.el
index 790799d858..10035e96ef 100644
--- a/misc/emacs/nix-mode.el
+++ b/misc/emacs/nix-mode.el
@@ -9,16 +9,16 @@
 ;;; Code:
 
 (defconst nix-font-lock-keywords
-  '("\\<if\\>" "\\<then\\>" "\\<else\\>" "\\<assert\\>" "\\<with\\>"
-    "\\<let\\>" "\\<in\\>" "\\<rec\\>" "\\<inherit\\>" "\\<or\\>"
-    ("\\<true\\>" . font-lock-builtin-face)
-    ("\\<false\\>" . font-lock-builtin-face)
-    ("\\<null\\>" . font-lock-builtin-face)
-    ("\\<import\\>" . font-lock-builtin-face)
-    ("\\<derivation\\>" . font-lock-builtin-face)
-    ("\\<baseNameOf\\>" . font-lock-builtin-face)
-    ("\\<toString\\>" . font-lock-builtin-face)
-    ("\\<isNull\\>" . font-lock-builtin-face)
+  '("\\_<if\\_>" "\\_<then\\_>" "\\_<else\\_>" "\\_<assert\\_>" "\\_<with\\_>"
+    "\\_<let\\_>" "\\_<in\\_>" "\\_<rec\\_>" "\\_<inherit\\_>" "\\_<or\\_>"
+    ("\\_<true\\_>" . font-lock-builtin-face)
+    ("\\_<false\\_>" . font-lock-builtin-face)
+    ("\\_<null\\_>" . font-lock-builtin-face)
+    ("\\_<import\\_>" . font-lock-builtin-face)
+    ("\\_<derivation\\_>" . font-lock-builtin-face)
+    ("\\_<baseNameOf\\_>" . font-lock-builtin-face)
+    ("\\_<toString\\_>" . font-lock-builtin-face)
+    ("\\_<isNull\\_>" . font-lock-builtin-face)
     ("[a-zA-Z][a-zA-Z0-9\\+-\\.]*:[a-zA-Z0-9%/\\?:@&=\\+\\$,_\\.!~\\*'-]+"
      . font-lock-constant-face)
     ("\\<\\([a-zA-Z_][a-zA-Z0-9_'\-\.]*\\)[ \t]*="