mathquill/mathquill — pull request #247 by laughinghan (2014-02-26 04:39:52+00:00)
Title: Feature: Auto-unitalicize sin, log etc as seq of Letter's

Rather than each being a single `NonItalicizedFunction` command like `\sin`,
they're now a sequence of individual `Letter`s with special
styling. Any sequence of `Letter`s `s`, `i`, and `n` will be
automatically unitalicized to look like `\sin`, but the cursor can go
between and edit individual letters.

`Node::respace` was the only hook called on a very useful event, the creation
or deletion of an immediate sibling, but wasn't provided enough
information. Replace with new hooks `.sibling{Created,Deleted}()` with specific
information about the creation or deletion of immediate siblings.

This lets `Letter`, which wants to auto-unitalicize contiguous runs of
letters whenever they're edited, to only search for contiguous runs once
per insertion or deletion of a letter, rather than each letter
`.respace()` is called on (that's 3 letters for a letter inserted between
2 other letters) repeating the same search.

Also add an `UnItalicized` class so that typing or parsing `\sin`, `\cos`,
`\log` etc results in the appropriate sequence of `Letter`s.