diff src/elisp/urweb-mode.el @ 1565:9c7b79214cae

Minor tweak to speed up Emacs mode.
author Vladimir Shabanov <vshabanoff@gmail.com>
date Mon, 26 Sep 2011 02:54:52 +0400
parents a479947efbcd
children 7328dfeb7c0f
line wrap: on
line diff
--- 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 "</xml>")
-          (incf depth))))
+          (incf depth))
+
+         ((and (= depth 0)
+               (not (looking-at "<xml")) ;; ignore <xml/>
+               (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)