From: Dominik Honnef Date: Mon, 6 Jan 2014 16:11:03 +0000 (-0500) Subject: misc/emacs: fontify type switch correctly X-Git-Tag: go1.3beta1~1056 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=79653e412132c02b455ea010733c3adfe40c7313;p=gostls13.git misc/emacs: fontify type switch correctly Require at least one space after "type" and do not fontify closing parenthesis of type switch as a type. R=adonovan CC=golang-codereviews https://golang.org/cl/37720050 --- diff --git a/misc/emacs/go-mode.el b/misc/emacs/go-mode.el index aabaa13493..6adac91ab9 100644 --- a/misc/emacs/go-mode.el +++ b/misc/emacs/go-mode.el @@ -264,8 +264,8 @@ For mode=set, all covered lines will have this weight." `((,go-func-meth-regexp 1 font-lock-function-name-face))) ;; method name `( - (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]*\\([^[:space:]]+\\)") 1 font-lock-type-face) ;; types - (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]*" go-identifier-regexp "[[:space:]]*" go-type-name-regexp) 1 font-lock-type-face) ;; types + (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]+\\([^[:space:]]+\\)") 1 font-lock-type-face) ;; types + (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]+" go-identifier-regexp "[[:space:]]*" go-type-name-regexp) 1 font-lock-type-face) ;; types (,(concat "[^[:word:][:multibyte:]]\\[\\([[:digit:]]+\\|\\.\\.\\.\\)?\\]" go-type-name-regexp) 2 font-lock-type-face) ;; Arrays/slices (,(concat "\\(" go-identifier-regexp "\\)" "{") 1 font-lock-type-face) (,(concat (go--regexp-enclose-in-symbol "map") "\\[[^]]+\\]" go-type-name-regexp) 1 font-lock-type-face) ;; map value type