From: Stefan Monnier Date: Sun, 18 May 2003 21:07:01 +0000 (+0000) Subject: (sgml-xml-auto-coding-function, sgml-html-meta-auto-coding-function): X-Git-Tag: ttn-vms-21-2-B4~10090 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c069d3ac3391b17d735c4868bda7d8148a9333af;p=emacs.git (sgml-xml-auto-coding-function, sgml-html-meta-auto-coding-function): Don't assume point-min == 1. --- diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 2b9af0f810c..17f47376f29 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -2044,7 +2044,8 @@ Analogous to `define-translation-table', but updates (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 @@ This function is intended to be added to `auto-coding-functions'." (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)