johnhooks / jove

An Emacs JavaScript Editing Mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

By Jove! Yet Another JavaScript Editing Mode

About

This project is an attempt to create a new JavaScript editing mode for Emacs.

Jove includes a striped down port of the Acorn parser in order to provide complex highlighting and indentation functionality.

Inspiration

Reading on JavaScript Parsers

Installation

Jove is still a work in progress. Though if you want to check it out, clone this repository, add it to your load-path and then require it. Optionally if you think its pretty cool, add it as the default mode for JavaScript.

(add-to-list 'load-path (expand-file-name "elisps/jove"
                                          user-emacs-directory))
(require 'jove)
(add-to-list 'auto-mode-alist '("\\.js$" . jove-mode))

Reasoning

Shear madness.

After getting frustrated in an attempt to modify the indentation code of js.el, I concluded a simple* syntax parser would provide a more complete understanding of the code for editing purposes. Plus I needed something to do in my spare time.

* ha, ha, ha…

Working

The functions of the lexer are complete and tested. The parser functions are mostly complete and untested. I have been performing informal tests of the parser with Underscore and JQuery, it seems to be parsing everything correctly.

Goals

  • JSX indentation is currently non-functional. The biggest hurdle is combining the legacy indentation code from js-align and newer AST funcationality. The end goal is to base all indentation off the AST, meanwhile I want a solution that can use either method.
  • Auto-pairing of JSX tags.
  • Highlighting of JSX tag pairs.

About

An Emacs JavaScript Editing Mode

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 98.5%Language:JavaScript 1.3%Language:Makefile 0.2%