I think the Change Log mode in emacs (spacemacs) acts crazily and I want to turn it off when editing my CHANGELOG. How do I do that for good?
change-log-mode exists to help with viewing and editing Change Log files like the one Emacs itself uses. You might consider simply modifying the mode's settings so it behaves like you want instead of "throwing the baby out with the bath water" so to speak. :)
Since that wasn't the specific question you asked, you can use a different mode by modifying
auto-mode-alist. This variable tells Emacs what mode to load based on a regex matching of the file being loaded. For Change Logs, by default, it shows this:
'(("[cC]hange\\.?[lL]og?\\'" . change-log-mode) ("[cC]hange[lL]og[-.][0-9]+\\'" . change-log-mode) ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) ("[cC]hange[lL]og[-.][-0-9a-z]+\\'" . change-log-mode))
You can simply get rid of it like this:
(setq auto-mode-alist (rassq-delete-all 'change-log-mode auto-mode-alist))
You shouldn't need to do that, though, as adding to the list overrides settings. So you can just replace it like this:
(setq auto-mode-alist (append '(("[cC]hange\\.?[lL]og?\\'" . text-mode) ("[cC]hange[lL]og[-.][0-9]+\\'" . text-mode) ("\\$CHANGE_LOG\\$\\.TXT" . text-mode) ("[cC]hange[lL]og[-.][-0-9a-z]+\\'" . text-mode)) auto-mode-alist))
(defalias 'change-log-mode #'text-mode)
This suggestion has (not unreasonably) garnered some down-votes. I'm not deleting it, but it needs some extra notes:
cyberbisson's answer is the correct solution to the question in the title: "How do I disassociate a filetype and mode?". In general, that's the sensible approach to take (and is of course completely fine in this case).
My suggestion was 100% aimed at the specific use-case of eradicating
change-log-mode. I'm mostly sure this mode has a sufficiently-limited set of uses that in practice clobbering the mode function is going to be fine. Assuming that is indeed the case, this is just a very very easy approach.
I'm not recommending this approach as a general solution (although it would undoubtedly also work fine in practice in numerous other cases). DoMiNeLa10 commented that it might break things, and that's definitely possible for arbitrary uses of defalias to clobber modes, but (I suspect) not likely to be a problem for this example.
This approach has one advantage (or disadvantage) over the
auto-mode-alistapproach in that it also prevents
change-log-modefrom being triggered in any other way. This is probably not relevant, but worth pointing out.
add-logRET would redefine
change-log-modeto its normal value, if you wanted to do that.