diff options
| author | Stefan Monnier | 2003-05-18 21:07:01 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-18 21:07:01 +0000 |
| commit | c069d3ac3391b17d735c4868bda7d8148a9333af (patch) | |
| tree | 25e7d5a5956429826ca82cb14dd6c0ba541782fc | |
| parent | 2254377e6767f12326b26213f1105cf0f806b514 (diff) | |
| download | emacs-c069d3ac3391b17d735c4868bda7d8148a9333af.tar.gz emacs-c069d3ac3391b17d735c4868bda7d8148a9333af.zip | |
(sgml-xml-auto-coding-function, sgml-html-meta-auto-coding-function):
Don't assume point-min == 1.
| -rw-r--r-- | lisp/international/mule.el | 5 |
1 files changed, 3 insertions, 2 deletions
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 | |||
| 2044 | (defun sgml-xml-auto-coding-function (size) | 2044 | (defun sgml-xml-auto-coding-function (size) |
| 2045 | "Determine whether the buffer is XML, and if so, its encoding. | 2045 | "Determine whether the buffer is XML, and if so, its encoding. |
| 2046 | This function is intended to be added to `auto-coding-functions'." | 2046 | This function is intended to be added to `auto-coding-functions'." |
| 2047 | (when (re-search-forward "\\`[[:space:]\n]*<\\?xml" nil t) | 2047 | (setq size (+ (point) size)) |
| 2048 | (when (re-search-forward "\\`[[:space:]\n]*<\\?xml" size t) | ||
| 2048 | (let ((end (save-excursion | 2049 | (let ((end (save-excursion |
| 2049 | ;; This is a hack. | 2050 | ;; This is a hack. |
| 2050 | (re-search-forward "\"\\s-*\\?>" size t)))) | 2051 | (re-search-forward "\"\\s-*\\?>" size t)))) |
| @@ -2061,7 +2062,7 @@ This function is intended to be added to `auto-coding-functions'." | |||
| 2061 | (defun sgml-html-meta-auto-coding-function (size) | 2062 | (defun sgml-html-meta-auto-coding-function (size) |
| 2062 | "If the buffer has an HTML meta tag, use it to determine encoding. | 2063 | "If the buffer has an HTML meta tag, use it to determine encoding. |
| 2063 | This function is intended to be added to `auto-coding-functions'." | 2064 | This function is intended to be added to `auto-coding-functions'." |
| 2064 | (setq size (min size | 2065 | (setq size (min (+ (point) size) |
| 2065 | ;; Only search forward 10 lines | 2066 | ;; Only search forward 10 lines |
| 2066 | (save-excursion | 2067 | (save-excursion |
| 2067 | (forward-line 10) | 2068 | (forward-line 10) |