From 5f1a3201ec0c451bf05f42a15a33d61b4c203603 Mon Sep 17 00:00:00 2001 From: Pascal Wittmann Date: Sat, 10 Oct 2015 12:08:58 +0200 Subject: 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. --- misc/emacs/nix-mode.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'misc') diff --git a/misc/emacs/nix-mode.el b/misc/emacs/nix-mode.el index 790799d858cc..10035e96ef30 100644 --- a/misc/emacs/nix-mode.el +++ b/misc/emacs/nix-mode.el @@ -9,16 +9,16 @@ ;;; Code: (defconst nix-font-lock-keywords - '("\\" "\\" "\\" "\\" "\\" - "\\" "\\" "\\" "\\" "\\" - ("\\" . font-lock-builtin-face) - ("\\" . font-lock-builtin-face) - ("\\" . font-lock-builtin-face) - ("\\" . font-lock-builtin-face) - ("\\" . font-lock-builtin-face) - ("\\" . font-lock-builtin-face) - ("\\" . font-lock-builtin-face) - ("\\" . font-lock-builtin-face) + '("\\_" "\\_" "\\_" "\\_" "\\_" + "\\_" "\\_" "\\_" "\\_" "\\_" + ("\\_" . font-lock-builtin-face) + ("\\_" . font-lock-builtin-face) + ("\\_" . font-lock-builtin-face) + ("\\_" . font-lock-builtin-face) + ("\\_" . font-lock-builtin-face) + ("\\_" . font-lock-builtin-face) + ("\\_" . font-lock-builtin-face) + ("\\_" . 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]*=" -- cgit 1.4.1