summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vladimir Shabanov <vshabanoff@gmail.com>2011-09-26 02:54:52 +0400
committerGravatar Vladimir Shabanov <vshabanoff@gmail.com>2011-09-26 02:54:52 +0400
commitdfafca5fcf01c61ed0183e4b80cdef90dfbfa822 (patch)
tree6a9f368e25c6aeb2c06b660b9271a10221f94598
parentf926b6418df3e6b835f8bc5b7c44906c9742a085 (diff)
Minor tweak to speed up Emacs mode.
-rw-r--r--src/elisp/urweb-mode.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/elisp/urweb-mode.el b/src/elisp/urweb-mode.el
index c4cb3476..ea14b4e1 100644
--- a/src/elisp/urweb-mode.el
+++ b/src/elisp/urweb-mode.el
@@ -185,7 +185,22 @@ See doc for the variable `urweb-mode-info'."
(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)