Automatically detect tab width for json / js files? Hi,
emacs noob here!

I found that it's possible to set "js-indent-level" to change the default size of the tab width for js and json files, but I wonder if it's possible for emacs to just detect the one used by the file and indent accordingly.

At work I'm working with some json files that have 2 spaces indentation, while others use 4 spaces, and although it's possible to set it for a single file ("M-x set-variable") I'd be happy to find a better option.

Thanks