Skip to content

Conversation

@kira-bruneau
Copy link

Currently json-mode uses magic-mode-alist for mode detection. This list is prioritized over auto-mode-alist so it causes problems when a file starts with a either { or [ but isn't actually JSON.

Emacs provides magic-fallback-mode-alist which is essentially the same thing as magic-mode-alist, but is checked after auto-mode-alist. In a fresh install of emacs, it's used for detecting things like html/xml, so this seems like it would be a better fit for json-mode.

See Choosing Modes in the emacs manual for more details.

@joshwnj
Copy link
Collaborator

joshwnj commented Jan 23, 2019

Thanks @Metadark !

@joshwnj joshwnj merged commit 0e819e5 into json-emacs:master Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants