Mercurial > urweb
comparison src/elisp/urweb-move.el @ 396:040edfade639
Fix XML indenting to ignore comparison operators
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 21 Oct 2008 11:39:13 -0400 |
parents | 782ef3ad8c28 |
children | 4083d0dff94c |
comparison
equal
deleted
inserted
replaced
395:9f67aac13cf7 | 396:040edfade639 |
---|---|
238 (defun urweb-tag-matcher () | 238 (defun urweb-tag-matcher () |
239 "Seek back to a matching opener tag" | 239 "Seek back to a matching opener tag" |
240 (let ((depth 0) | 240 (let ((depth 0) |
241 (done nil)) | 241 (done nil)) |
242 (while (and (not done) (search-backward ">" nil t)) | 242 (while (and (not done) (search-backward ">" nil t)) |
243 (if (save-excursion (backward-char 1) (looking-at "/")) | 243 (cond |
244 (when (not (search-backward "<" nil t)) | 244 ((save-excursion (backward-char 1) (looking-at " ")) |
245 (setq done t)) | 245 nil) |
246 (if (search-backward "<" nil t) | 246 ((save-excursion (backward-char 1) (looking-at "/")) |
247 (when (not (re-search-backward "<[^ =]" nil t)) | |
248 (setq done t))) | |
249 (t | |
250 (if (re-search-backward "<[^ =]" nil t) | |
247 (if (looking-at "</") | 251 (if (looking-at "</") |
248 (incf depth) | 252 (incf depth) |
249 (if (= depth 0) | 253 (if (= depth 0) |
250 (setq done t) | 254 (setq done t) |
251 (decf depth))) | 255 (decf depth))) |
252 (setq done t)))))) | 256 (setq done t))))))) |
253 | 257 |
254 (defun urweb-backward-sexp (prec) | 258 (defun urweb-backward-sexp (prec) |
255 "Move one sexp backward if possible, or one char else. | 259 "Move one sexp backward if possible, or one char else. |
256 Returns t if the move indeed moved through one sexp and nil if not. | 260 Returns t if the move indeed moved through one sexp and nil if not. |
257 PREC is the precedence currently looked for." | 261 PREC is the precedence currently looked for." |