summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2007-09-21 03:21:39 +0000
committerGlenn Morris <rgm@gnu.org>2007-09-21 03:21:39 +0000
commitef44317c7cd6f5758d45ad8eaa14784682b5744a (patch)
tree272c39fe1b39c5c38d27fd2aed81323f72703b16 /lisp
parent41a633fff6730292a31383c094b6167a335ba094 (diff)
downloademacs-ef44317c7cd6f5758d45ad8eaa14784682b5744a.tar.gz
Kevin Ryde <user42 at zip.com.au>
(sgml-html-meta-auto-coding-function): Bind `case-fold-search' to t.
Diffstat (limited to 'lisp')
-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 19f28e89f1a..c3909c0de09 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-21 Kevin Ryde <user42@zip.com.au>
+
+ * international/mule.el (sgml-html-meta-auto-coding-function):
+ Bind `case-fold-search' to t.
+
2007-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
* wid-edit.el (widget-image-insert): Don't merge mouse-face with
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index a7b97b16d20..2d6a0ce5e88 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -2302,25 +2302,26 @@ This function is intended to be added to `auto-coding-functions'."
(defun sgml-html-meta-auto-coding-function (size)
"If the buffer has an HTML meta tag, use it to determine encoding.
This function is intended to be added to `auto-coding-functions'."
- (setq size (min (+ (point) size)
- (save-excursion
- ;; Limit the search by the end of the HTML header.
- (or (search-forward "</head>" size t)
- ;; In case of no header, search only 10 lines.
- (forward-line 10))
- (point))))
- ;; Make sure that the buffer really contains an HTML document, by
- ;; checking that it starts with a doctype or a <HTML> start tag
- ;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is
- ;; useful for Mozilla bookmark files.
- (when (and (re-search-forward "\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)" size t)
- (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t))
- (let* ((match (match-string 1))
- (sym (intern (downcase match))))
- (if (coding-system-p sym)
- sym
- (message "Warning: unknown coding system \"%s\"" match)
- nil))))
+ (let ((case-fold-search t))
+ (setq size (min (+ (point) size)
+ (save-excursion
+ ;; Limit the search by the end of the HTML header.
+ (or (search-forward "</head>" size t)
+ ;; In case of no header, search only 10 lines.
+ (forward-line 10))
+ (point))))
+ ;; Make sure that the buffer really contains an HTML document, by
+ ;; checking that it starts with a doctype or a <HTML> start tag
+ ;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is
+ ;; useful for Mozilla bookmark files.
+ (when (and (re-search-forward "\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)" size t)
+ (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t))
+ (let* ((match (match-string 1))
+ (sym (intern (downcase match))))
+ (if (coding-system-p sym)
+ sym
+ (message "Warning: unknown coding system \"%s\"" match)
+ nil)))))
;;;
(provide 'mule)