🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Trouble loading a js-html-mode.el

Started by
1 comment, last by Lucidquiet 15 years, 10 months ago
Alright, I'm a complete Emacs Newb (admitting it now). I want to use a js mode (Steve Yegge's) but I don't know the command for loading the file and then have it used when I do a find-file for a .js file. Please help -- it sucks being an Emacs Newb. L-
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net
Advertisement
I'm not familiar with the specific mode you mention, but usually, when you install an emacs mode, it adds a hook to the file opening procedure that detects a ".js" extension and automatically loads the mode.

Manually, you'd be adding a line like this to your .emacs file:

(setq auto-mode-alist
(cons '("\\.js$" . js-mode) auto-mode-alist))
Right I got this to work.

What I did was compile the Lisp code and put the resulting .elc in the /lisp dir.

Then I added the following lines to my .emacs file:

(global-font-lock-mode t)
(load-library "js2-20080616a.elc")
(autoload 'js2-mode "js2-20080616a" "&#106avascript 1.7" t)<br>(setq auto-mode-alist (cons '("\\.js$" . js2-mode) auto-mode-alist))<br><br>This seemed to do the trick.<br><br>Thanks,<br>L-
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net

This topic is closed to new replies.

Advertisement