summaryrefslogtreecommitdiff
path: root/lisp/international
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2007-01-06 15:25:16 +0000
committerKaroly Lorentey <lorentey@elte.hu>2007-01-06 15:25:16 +0000
commit191ae1cf7cd2571277635b3b8e488e773ca5c9b9 (patch)
treee0b26e3040767dae38fb39a03b757da05088c58f /lisp/international
parent382707ecfb50f8c7794a7ba3d8cd9db9b6cd29d0 (diff)
parentf85c5e3b72855951b071eacb7b6e2d002c5fc4be (diff)
downloademacs-191ae1cf7cd2571277635b3b8e488e773ca5c9b9.tar.gz
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-585 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-586 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-587 Update from erc--emacs--22 * emacs@sv.gnu.org/emacs--devo--0--patch-588 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-589 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-590 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-591 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-592
Diffstat (limited to 'lisp/international')
-rw-r--r--lisp/international/mule.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index f9de9ecdf91..0a2c7cbe9ad 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -2299,7 +2299,12 @@ This function is intended to be added to `auto-coding-functions'."
;; In case of no header, search only 10 lines.
(forward-line 10))
(point))))
- (when (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t)
+ ;; 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)