summaryrefslogtreecommitdiff
path: root/src/elisp/urweb-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'src/elisp/urweb-mode.el')
-rw-r--r--src/elisp/urweb-mode.el20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/elisp/urweb-mode.el b/src/elisp/urweb-mode.el
index 308bd1af..048efcad 100644
--- a/src/elisp/urweb-mode.el
+++ b/src/elisp/urweb-mode.el
@@ -500,22 +500,10 @@ If anyone has a good algorithm for this..."
(defun urweb-tag-matching-indent ()
"Seek back to a matching opener tag and get its line's indent"
(save-excursion
- (let ((depth 0)
- (done nil))
- (while (and (not done) (search-backward ">" nil t))
- (if (save-excursion (backward-char 1) (looking-at "/"))
- (when (not (search-backward "<" nil t))
- (setq done t))
- (if (search-backward "<" nil t)
- (if (looking-at "</")
- (incf depth)
- (if (= depth 0)
- (setq done t)
- (decf depth)))
- (setq done t))))
- (if (looking-at "<xml")
- (+ (current-indentation) 2)
- (current-indentation)))))
+ (urweb-tag-matcher)
+ (if (looking-at "<xml")
+ (+ (current-indentation) 2)
+ (current-indentation))))
(defun urweb-calculate-indentation ()
(save-excursion