comparison lisp/international/mule.el @ 71154:cb001b5b571b

(sgml-html-meta-auto-coding-function): Limit the search by the end of the HTML header (if any).
author Kenichi Handa <handa@m17n.org>
date Fri, 02 Jun 2006 03:54:14 +0000
parents 48b2a1baa586
children bb2f67aa85f1
comparison
equal deleted inserted replaced
71153:d15d9ffb9a58 71154:cb001b5b571b
2254 "If the buffer has an HTML meta tag, use it to determine encoding. 2254 "If the buffer has an HTML meta tag, use it to determine encoding.
2255 This function is intended to be added to `auto-coding-functions'." 2255 This function is intended to be added to `auto-coding-functions'."
2256 (setq size (min (+ (point) size) 2256 (setq size (min (+ (point) size)
2257 ;; Only search forward 10 lines 2257 ;; Only search forward 10 lines
2258 (save-excursion 2258 (save-excursion
2259 (forward-line 10) 2259 ;; Limit the search by the end of the HTML header.
2260 (or (search-forward "</head>" size t)
2261 ;; In case of no header, search only 10 lines.
2262 (forward-line 10))
2260 (point)))) 2263 (point))))
2261 (when (and (search-forward "<html" size t) 2264 (when (and (search-forward "<html" size t)
2262 (re-search-forward "<meta\\s-+http-equiv=\"content-type\"\\s-+content=\"text/\\sw+;\\s-*charset=\\(.+?\\)\"" size t)) 2265 (re-search-forward "<meta\\s-+http-equiv=\"content-type\"\\s-+content=\"text/\\sw+;\\s-*charset=\\(.+?\\)\"" size t))
2263 (let* ((match (match-string 1)) 2266 (let* ((match (match-string 1))
2264 (sym (intern (downcase match)))) 2267 (sym (intern (downcase match))))