1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-07 15:21:46 +00:00

(sgml-html-meta-auto-coding-function):

Limit the search by the end of the HTML header (if any).
This commit is contained in:
Kenichi Handa 2006-06-02 03:54:14 +00:00
parent 605e71f10e
commit b3a726d586

View 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))