I enabled js2-mode
in emacs by adding this snippet in .emacs,
(add-to-list 'auto-mode-alist '("\\.js$'" . js2-mode))
But still for .js files, emacs tries to load javascript-mode alias js-mode as
the major mode. And god knows, how did javascript-mode
function go missing in my emacs. It crashes like this,
Debugger entered--Lisp error: (error "Autoloading failed to define function javascript-mode")
javascript-mode()
set-auto-mode-0(javascript-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil t)
find-file-noselect-1(#<buffer a.js> "~/a.js" nil nil "~/a.js" (1840059 2049))
find-file-noselect("/home/sk/a.js" nil nil)
ido-file-internal(raise-frame)
ido-find-file()
call-interactively(ido-find-file nil nil)
This leads to another question, does emacs consider the last (or) first regex entry in auto-mode-alist
for loading the major mode?