comparison src/elisp/urweb-mode.el @ 1566:7328dfeb7c0f

Tweaked Emacs mode to handle many "->" faster.
author Vladimir Shabanov <vshabanoff@gmail.com>
date Mon, 26 Sep 2011 03:29:09 +0400
parents 9c7b79214cae
children 5530a8075b62
comparison
equal deleted inserted replaced
1565:9c7b79214cae 1566:7328dfeb7c0f
168 (let ( 168 (let (
169 (depth 0) 169 (depth 0)
170 (finished nil) 170 (finished nil)
171 (answer nil) 171 (answer nil)
172 ) 172 )
173 (while (and (not finished) (re-search-backward "[<{}]" nil t)) 173 (while (and (not finished) (re-search-backward "[-<{}]" nil t))
174 (cond 174 (cond
175 ((looking-at "{") 175 ((looking-at "{")
176 (if (> depth 0) 176 (if (> depth 0)
177 (decf depth) 177 (decf depth)
178 (setq finished t))) 178 (setq finished t)))
184 (progn 184 (progn
185 (setq answer t) 185 (setq answer t)
186 (setq finished t)))) 186 (setq finished t))))
187 ((looking-at "</xml>") 187 ((looking-at "</xml>")
188 (incf depth)) 188 (incf depth))
189
190 ((looking-at "-")
191 (if (looking-at "->")
192 (setq finished (= depth 0))))
189 193
190 ((and (= depth 0) 194 ((and (= depth 0)
191 (not (looking-at "<xml")) ;; ignore <xml/> 195 (not (looking-at "<xml")) ;; ignore <xml/>
192 (eq font-lock-tag-face 196 (eq font-lock-tag-face
193 (get-text-property (point) 'face))) 197 (get-text-property (point) 'face)))