# HG changeset patch # User Vladimir Shabanov # Date 1316991292 -14400 # Node ID 9c7b79214caef4f327b301f2cfac13d10f2c4d2a # Parent da11f7b180676b94641e9c31671a48a63055f7fa Minor tweak to speed up Emacs mode. diff -r da11f7b18067 -r 9c7b79214cae src/elisp/urweb-mode.el --- a/src/elisp/urweb-mode.el Fri Sep 23 23:11:59 2011 -0500 +++ b/src/elisp/urweb-mode.el Mon Sep 26 02:54:52 2011 +0400 @@ -185,7 +185,22 @@ (setq answer t) (setq finished t)))) ((looking-at "") - (incf depth)))) + (incf depth)) + + ((and (= depth 0) + (not (looking-at " + (eq font-lock-tag-face + (get-text-property (point) 'face))) + ;; previous code was highlighted as tag, seems we are in xml + (progn + (setq answer t) + (setq finished t))) + + ((= depth 0) + ;; previous thing was a tag like, but not tag + ;; seems we are in usual code or comment + (setq finished t)) + )) answer))) (defun amAttribute (face)