Ymacs status
This project started out as an experiment and should still be considered so. I decided to release it, however, because (1) it's pretty useful already and (2) it became too big for me alone. I invested more time into it than I could afford, so I'm hoping it will benefit from the open-source community. It is released under a BSD-style license.
Here is a rather disorganized list of stuff that I should look into.
Fixed: Looking_back and search_backward_regexp functions are a lot slower than their counterparts that search forward. JavaScript has no support for "look behind" regexp assertions, which made these quite complicated to implement.
My dirty hack to match Unicode letters doesn't work well for a lot of languages. But there's a bug in current Firefox releases that makes it impossibly slow to use a regexp, as I described in the linked article.
Update: the Firefox bug is fixed in 3.6 (but it has other issues and it's not widespread yet, so my hack is still in place).
The undo stack sometimes behaves strangely and I didn't figure out the exact test case. It seems to happen when a lot of undo and redo are involved. Redo, by the way, is done like in Emacs -- just use some command other than undo, and everything that was undoed goes back into the undo stack, so you can undo the undo, so to say. :) It might seem weird, but it becomes second nature.
Fixed: Movement by balanced expressions is too slow if the code to inspect is bigger than a few dozen lines. They use the full Ymacs_Buffer commands for movement and this is overkill—should be reimplemented on top of an Ymacs_Stream instead, which is lighter. (in fact, this should be applied to many more commands...)
(Now it relies on the parser to figure out starting/closing parens; while the code is not yet fully parsed, it might be slow, but generally it will be blazing fast).
Paren matching sometimes doesn't work (mainly if you're typing fast).
Done: Frames should maintain their own modeline. Currently there's only one modeline that is maintained by the toplevel Ymacs widget, but this is less than ideal when you're working with split frames.
Interactive search for regexps, and replace commands (interactive and not) are must haves.
More modes: a CSS mode, an HTML mode (should combine XML, JS and CSS modes, similarly to CodeMirror), and finally I should implement that lisp-mode.
Update: Basic CSS and Lisp modes now available.
-
There are a few ideas, quite tricky to implement, that should be tested for speeding up the tonekizing/syntax highlighting phase:
-
see if it's safe to stop parsing once we encounter a line that didn't change syntax highlighting. Normally we re-parse all text after line X when something changed before it, but most changes do not actually result in a different coloration of the source, so in almost all cases we can safely stop.
-
if (1) can be applied, see if it's safe to keep the saved parsers after line X, rather than discard them, when a line is inserted or removed before X. The absolute positions of the tokens found would change, but expressed as (line,col) they don't change.
-
The function that generates final HTML seems too complicated.
-
Done: Should add real support for interactive commands (that is, provide a way for commands to receive automatic arguments based on how they are invoked interactively). Support for prefix arguments, prompts in the minibuffer and M-x would be nice too.
Figure out if we can use Web Workers to parse the code. It should be faster than via setTimeout. The Web Workers API is quite brain damaged, so this might require rewriting all the parsers... :-(
Keyboard macros!