EmacsWiki:CategoryJavaScript - I’ve been doing a lot of twiddling with this page lately (2013.05)


a REPL for JS from Emacs
also EmacsWiki:MozRepl - haven’t gotten to work yet — spent < 5 mins on it, error’d on launch. possible relies on older version of javascript.el? see notes at page, and re-investigate .....



See the installation follies


I tried to run init.el from within my existing emacs, but got an error, so I launched it suppressing my config-files
emacs -q -l d:\home\emacs.js\init.el


Basically got the following error:

Debugger entered--Lisp error: (invalid-function (tool-bar-mode -1))
  ((tool-bar-mode -1) (menu-bar-mode -1) (scroll-bar-mode -1))
  (if window-system ((tool-bar-mode -1) (menu-bar-mode -1) (scroll-bar-mode -1)))
  eval((if window-system ((tool-bar-mode -1) (menu-bar-mode -1) (scroll-bar-mode -1))))
  call-interactively(eval-last-sexp nil nil)


The root seems to be THIS snippet that doesn’t like to work from appearance.el


(if window-system
    ((tool-bar-mode -1)
     (menu-bar-mode -1)
     (scroll-bar-mode -1)))


Now, each of those lines can execute individually, but none of them like to execute in that block.
Why is that?


Oh, my elisp-fu is woefully faded.


hrm. THIS seems to work:


(if window-system
    (progn (tool-bar-mode -1)
           (menu-bar-mode -1)
           (scroll-bar-mode -1)))


so. I update that.


set-default-font: Font Inconsolata-12′ is not defined





Setting up Emacs as a Javascript Editing Environment (for fun an profit)


NOTE: Just about everything manually installed on that page seems to be part of EmacsJs.


Recommended auto-complete-mode which I found to be the same as the auto-complete package (available from ELPA).
So, easy install.


The page reccomend making a symlink to alias javascript-mode to js-mode
Since I’m on windows, I just got old-school (ok, “bad-practices-school”) and renamed a copy of the file.


and then add to your .emacs:

(add-to-list 'load-path "~/path-to/auto-complete")
; Load the default configuration
(require 'auto-complete-config)
; Make sure we can find the dictionaries
(add-to-list 'ac-dictionary-directories "~/emacs/auto-complete/dict")
; Use dictionaries by default
(setq-default ac-sources (add-to-list 'ac-sources 'ac-source-dictionary))
(global-auto-complete-mode t)
; Start auto-completion after 2 characters of a word
(setq ac-auto-start 2)
; case sensitivity is important when finding matches
(setq ac-ignore-case nil)


I skipped ‘load-path and ‘ac-dictionary-directories and ac-sources as all that seems to have been handled by ELPA.


You now have auto-completion for all variable names in all open Javascript buffers, as well as for standard syntax words (setTimeout, parseInt, onFocus etc)



... more to come...



xpi files

editing xpi files directly in Emacs -- as long as you’ve got a working archive-program. Mine isn’t working right? Dig through customizations.... I set the zip program to point to 7z (which also needed to be added to my PATH), and updated the param... it extracts, but doesn’t auto-open w/in emacs... if that is what is _supposed_ to happen.. hrm.



See Also

Java Script.Grease Monkey
JavaScript.Emacs (I forgot I already had an Emacs page on the subject; need to merge these two)




Emacs javascript



No comments yet.



Add Comment

 Your Message
 Enter value ← Have you entered the code number?