programming layout: Emacs class regex more reliable

For example Ubuntu uses "Emacs24" class instead of "Emacs"