I would like emacs to switch to gnuplot-mode
when I open a file ending in .g
or .gnuplot
.
I tried
;; gnuplot mode-name
(add-to-list 'gnuplot-mode '("\\.g\\'" . gnuplot-mode))
or
;; gnuplot mode-name
(add-to-list 'gnuplot '("\\.g\\'" . gnuplot))
Neither works. How do I make Emacs behave this way?