# HG changeset patch # User Stefan Monnier # Date 1053292021 0 # Node ID e5124f8f4dc93e812d88b66c625cd9325d6141c3 # Parent bd6dedbdc53f51ed6f678fd4b6766c4c1f615fd7 (sgml-xml-auto-coding-function, sgml-html-meta-auto-coding-function): Don't assume point-min == 1. diff -r bd6dedbdc53f -r e5124f8f4dc9 lisp/international/mule.el --- a/lisp/international/mule.el Sun May 18 21:02:22 2003 +0000 +++ b/lisp/international/mule.el Sun May 18 21:07:01 2003 +0000 @@ -2044,7 +2044,8 @@ (defun sgml-xml-auto-coding-function (size) "Determine whether the buffer is XML, and if so, its encoding. This function is intended to be added to `auto-coding-functions'." - (when (re-search-forward "\\`[[:space:]\n]*<\\?xml" nil t) + (setq size (+ (point) size)) + (when (re-search-forward "\\`[[:space:]\n]*<\\?xml" size t) (let ((end (save-excursion ;; This is a hack. (re-search-forward "\"\\s-*\\?>" size t)))) @@ -2061,7 +2062,7 @@ (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 size + (setq size (min (+ (point) size) ;; Only search forward 10 lines (save-excursion (forward-line 10)