]> git.eshelyaron.com Git - emacs.git/commitdiff
(sgml-html-meta-auto-coding-function):
authorJuri Linkov <juri@jurta.org>
Fri, 2 Jun 2006 18:17:02 +0000 (18:17 +0000)
committerJuri Linkov <juri@jurta.org>
Fri, 2 Jun 2006 18:17:02 +0000 (18:17 +0000)
Remove the condition `(search-forward "<html" size t)'.
Replace `\"' with `[\"']?' in `re-search-forward'.

lisp/international/mule.el

index d9242f7cb5d2300a2f1b9c42b6c9544e86a49d20..e808f4f5d0fb6561276bfc1981c5c99922f5d33b 100644 (file)
@@ -2284,21 +2284,19 @@ This function is intended to be added to `auto-coding-functions'."
   "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)
-                 ;; Only search forward 10 lines
                  (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))))
-  (when (and (search-forward "<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))))
+  (when (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)