]> git.eshelyaron.com Git - emacs.git/commitdiff
(sgml-html-meta-auto-coding-function):
authorKenichi Handa <handa@m17n.org>
Fri, 2 Jun 2006 03:54:14 +0000 (03:54 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 2 Jun 2006 03:54:14 +0000 (03:54 +0000)
Limit the search by the end of the HTML header (if any).

lisp/international/mule.el

index b66345ea3a89a73aee4de5ef5cec0be1f01b2c75..c2d398b440e926a02ccec8c8f1b37f9ae39d198e 100644 (file)
@@ -2256,7 +2256,10 @@ This function is intended to be added to `auto-coding-functions'."
   (setq size (min (+ (point) size)
                  ;; Only search forward 10 lines
                  (save-excursion
-                   (forward-line 10)
+                   ;; 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))