aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/international/mule.el39
2 files changed, 25 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1b8c6488fd2..efaa7aa0c31 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-09-21 Kevin Ryde <user42@zip.com.au>
2
3 * international/mule.el (sgml-html-meta-auto-coding-function):
4 Bind `case-fold-search' to t.
5
12007-09-21 Glenn Morris <rgm@gnu.org> 62007-09-21 Glenn Morris <rgm@gnu.org>
2 7
3 * textmodes/tex-mode.el (tex-validate-region): Handle escaped parens. 8 * textmodes/tex-mode.el (tex-validate-region): Handle escaped parens.
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index bfa2e7f1b39..afec59fd806 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -2310,25 +2310,26 @@ This function is intended to be added to `auto-coding-functions'."
2310(defun sgml-html-meta-auto-coding-function (size) 2310(defun sgml-html-meta-auto-coding-function (size)
2311 "If the buffer has an HTML meta tag, use it to determine encoding. 2311 "If the buffer has an HTML meta tag, use it to determine encoding.
2312This function is intended to be added to `auto-coding-functions'." 2312This function is intended to be added to `auto-coding-functions'."
2313 (setq size (min (+ (point) size) 2313 (let ((case-fold-search t))
2314 (save-excursion 2314 (setq size (min (+ (point) size)
2315 ;; Limit the search by the end of the HTML header. 2315 (save-excursion
2316 (or (search-forward "</head>" size t) 2316 ;; Limit the search by the end of the HTML header.
2317 ;; In case of no header, search only 10 lines. 2317 (or (search-forward "</head>" size t)
2318 (forward-line 10)) 2318 ;; In case of no header, search only 10 lines.
2319 (point)))) 2319 (forward-line 10))
2320 ;; Make sure that the buffer really contains an HTML document, by 2320 (point))))
2321 ;; checking that it starts with a doctype or a <HTML> start tag 2321 ;; Make sure that the buffer really contains an HTML document, by
2322 ;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is 2322 ;; checking that it starts with a doctype or a <HTML> start tag
2323 ;; useful for Mozilla bookmark files. 2323 ;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is
2324 (when (and (re-search-forward "\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)" size t) 2324 ;; useful for Mozilla bookmark files.
2325 (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t)) 2325 (when (and (re-search-forward "\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)" size t)
2326 (let* ((match (match-string 1)) 2326 (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t))
2327 (sym (intern (downcase match)))) 2327 (let* ((match (match-string 1))
2328 (if (coding-system-p sym) 2328 (sym (intern (downcase match))))
2329 sym 2329 (if (coding-system-p sym)
2330 (message "Warning: unknown coding system \"%s\"" match) 2330 sym
2331 nil)))) 2331 (message "Warning: unknown coding system \"%s\"" match)
2332 nil)))))
2332 2333
2333;;; 2334;;;
2334(provide 'mule) 2335(provide 'mule)