misc/emacs: Derive mode from prog-mode if possible

R=golang-dev, bradfitz
CC=adonovan, cw, golang-dev, patrick.allen.higgins
https://codereview.appspot.com/7956044

Committer: Brad Fitzpatrick <bradfitz@golang.org>