summaryrefslogtreecommitdiff
path: root/src/elisp
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-08-02 17:28:37 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-08-02 17:28:37 -0400
commit2d778aff9a95c2957e22df27091dc1789489ede0 (patch)
treedccc75e711b9c9a05ea3566c3a7af5be139a2016 /src/elisp
parentbd572fc6e38f48574c8aa67e251ff1c184a6d340 (diff)
Improve detection of XML in urweb-mode; small tutorial improvement
Diffstat (limited to 'src/elisp')
-rw-r--r--src/elisp/urweb-mode.el33
1 files changed, 9 insertions, 24 deletions
diff --git a/src/elisp/urweb-mode.el b/src/elisp/urweb-mode.el
index c9fe5f19..c4cb3476 100644
--- a/src/elisp/urweb-mode.el
+++ b/src/elisp/urweb-mode.el
@@ -170,7 +170,7 @@ See doc for the variable `urweb-mode-info'."
(finished nil)
(answer nil)
)
- (while (and (not finished) (re-search-backward "[<>{}]" nil t))
+ (while (and (not finished) (re-search-backward "[<{}]" nil t))
(cond
((looking-at "{")
(if (> depth 0)
@@ -178,29 +178,14 @@ See doc for the variable `urweb-mode-info'."
(setq finished t)))
((looking-at "}")
(incf depth))
- ((save-excursion (backward-char 1) (or (looking-at "=>")
- (looking-at "->")
- (looking-at "<>")))
- nil)
- ((or (looking-at "< ") (looking-at "<="))
- nil)
- ((looking-at "<")
- (setq finished t))
- ((save-excursion (backward-char 1) (looking-at " >"))
- nil)
- ((looking-at ">")
- (cond
- ((> depth 0)
- (if (not (re-search-backward "<" nil t))
- (setq finished t)))
- ((save-excursion (backward-char 1) (looking-at " "))
- (setq finished t))
- (t
- (progn (backward-char 4)
- (setq answer (not (or
- (looking-at "/xml")
- (looking-at "xml/"))))
- (setq finished t)))))))
+ ((looking-at "<xml>")
+ (if (> depth 0)
+ (decf depth)
+ (progn
+ (setq answer t)
+ (setq finished t))))
+ ((looking-at "</xml>")
+ (incf depth))))
answer)))
(defun amAttribute (face)