diff options
author | 2011-09-26 02:54:52 +0400 | |
---|---|---|
committer | 2011-09-26 02:54:52 +0400 | |
commit | 3a4d6cc2769e92b7d92b3d23f560aa40e60f2a8b (patch) | |
tree | 6a9f368e25c6aeb2c06b660b9271a10221f94598 | |
parent | 5dbc51a838dcf8951b0bce270eb5855dda0d076e (diff) |
Minor tweak to speed up Emacs mode.
-rw-r--r-- | src/elisp/urweb-mode.el | 17 |
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) |