I found this question somewhat on the topic, but is there a way [in emacs] to set a minor mode (or a list thereof) based on extension? For example, it\'s pretty easy to
The answer by Trey Jackson seems to be a very robust and extensible solution, but I was looking for something simpler. The following code will enable the fictional hmmm-mode
when editing .hmmm
files:
(add-hook 'find-file-hook
(lambda ()
(when (string= (file-name-extension buffer-file-name) "hmmm")
(hmmm-mode +1))))