From cbbea94e4afceeb21ebbf41362e7d74b3896bfca Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 6 Apr 2013 18:20:20 +0100 Subject: [PATCH] el/dot-emacs.el: Fontify strings and characters for Go. Some versions of the mode don't do this themselves. Our fontification is more precise anyway. --- el/dot-emacs.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/el/dot-emacs.el b/el/dot-emacs.el index b24e50c..a5b7300 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -1674,6 +1674,24 @@ doesn't match any of the regular expressions in (list (concat "\\<\\(" go-intrinsics "\\)\\>") '(0 font-lock-variable-name-face)) + ;; Strings and characters. + (list (concat "'" + "\\(" "[^\\']" "\\|" + "\\\\" + "\\(" "[abfnrtv\\'\"]" "\\|" + "[0-7]\\{3\\}" "\\|" + "x" "[0-9A-Fa-f]\\{2\\}" "\\|" + "u" "[0-9A-Fa-f]\\{4\\}" "\\|" + "U" "[0-9A-Fa-f]\\{8\\}" "\\)" "\\)" + "'" + "\\|" + "\"" + "\\(" "[^\n\\\"]+" "\\|" "\\\\." "\\)*" + "\\(\"\\|$\\)" + "\\|" + "`" "[^`]+" "`") + '(0 font-lock-string-face)) + ;; Handle numbers too. ;; ;; The following isn't quite right, but it's close enough. -- 2.11.0