   (setq comment-end "")
   (set (make-local-variable 'fill-paragraph-function)
        'espresso-c-fill-paragraph)
+
+  ;; Parse cache
+  (add-hook 'before-change-functions #'espresso--flush-caches t t)
+
+  ;; Frameworks
+  (espresso--update-quick-match-re)
 
   ;; Imenu
   (setq imenu-case-fold-search nil)

       'espresso--end-of-defun)

  (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil)

  (set (make-local-variable 'font-lock-defaults)
       (list espresso--font-lock-keywords
	     nil nil nil nil

                       pos
                     (setq pos (point)))))))))

(defun espresso--up-nearby-list ()
  "Like (up-list -1), but only considers lists that end nearby"
  (save-restriction
    ;; Look at a very small region so our compuation time doesn't
    ;; explode in pathological cases.
    (narrow-to-region (max (point-min) (- (point) 500)) (point))
    (up-list -1)))

(defun espresso--inside-param-list-p ()
  "Return non-nil iff point is inside a function parameter list."
  (ignore-errors
    (save-excursion
      (espresso--up-nearby-list)
      (and (looking-at "(")
           (progn (forward-symbol -1)
                  (or (looking-at "function")
                      (progn (forward-symbol -1)
                             (looking-at "function"))))))))

(defun espresso--inside-dojo-class-list-p ()
  "Return non-nil iff point is inside a Dojo multiple-inheritance
class block."
  (ignore-errors
    (save-excursion
      (espresso--up-nearby-list)
      (let ((list-begin (point)))
        (forward-line 0)
        (and (looking-at espresso--dojo-class-decl-re)
             (goto-char (match-end 0))
             (looking-at "\"\\s-*,\\s-*\\[")
             (eq (match-end 0) (1+ list-begin)))))))

(defun espresso--syntax-begin-function ()
  (when (< espresso--cache-end (point))
    (goto-char (max (point-min) espresso--cache-end)))

  (let ((pitem))
    (while (and (setq pitem (car (espresso--backward-pstate)))
                (not (eq 0 (espresso--pitem-paren-depth pitem)))))

    (when pitem
      (goto-char (espresso--pitem-h-begin pitem )))))

;;; Font Lock



(defun espresso--make-framework-matcher (framework &rest regexps)
  "Create a byte-compiled function that only matches the given
regular expressions (that concatenation of REGEXPS) if FRAMEWORK
is in espresso-enabled-frameworks"

  (setq regexps (apply #'concat regexps))
  (byte-compile
   `(lambda (limit)
      (when (memq (quote ,framework) espresso-enabled-frameworks)
        (re-search-forward ,regexps limit t)))))

;; Limitations with variable declarations: There seems to be no
;; sensible way to highlight variables occuring after an initialized
