diff options
| author | Glenn Morris | 2007-09-21 03:19:43 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-09-21 03:19:43 +0000 |
| commit | df3c9fe76a35f0bd541d49eabdd94bde4b4ec46a (patch) | |
| tree | 32066531c05c76b91b98229687eb17fdff69f1c1 | |
| parent | 09b33024ce8d07cba0d27aaca78746ad5c812ee2 (diff) | |
| download | emacs-df3c9fe76a35f0bd541d49eabdd94bde4b4ec46a.tar.gz emacs-df3c9fe76a35f0bd541d49eabdd94bde4b4ec46a.zip | |
Kevin Ryde <user42 at zip.com.au>
(sgml-html-meta-auto-coding-function): Bind `case-fold-search' to t.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/international/mule.el | 39 |
2 files changed, 25 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1b8c6488fd2..efaa7aa0c31 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-09-21 Kevin Ryde <user42@zip.com.au> | ||
| 2 | |||
| 3 | * international/mule.el (sgml-html-meta-auto-coding-function): | ||
| 4 | Bind `case-fold-search' to t. | ||
| 5 | |||
| 1 | 2007-09-21 Glenn Morris <rgm@gnu.org> | 6 | 2007-09-21 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * textmodes/tex-mode.el (tex-validate-region): Handle escaped parens. | 8 | * textmodes/tex-mode.el (tex-validate-region): Handle escaped parens. |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index bfa2e7f1b39..afec59fd806 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -2310,25 +2310,26 @@ This function is intended to be added to `auto-coding-functions'." | |||
| 2310 | (defun sgml-html-meta-auto-coding-function (size) | 2310 | (defun sgml-html-meta-auto-coding-function (size) |
| 2311 | "If the buffer has an HTML meta tag, use it to determine encoding. | 2311 | "If the buffer has an HTML meta tag, use it to determine encoding. |
| 2312 | This function is intended to be added to `auto-coding-functions'." | 2312 | This function is intended to be added to `auto-coding-functions'." |
| 2313 | (setq size (min (+ (point) size) | 2313 | (let ((case-fold-search t)) |
| 2314 | (save-excursion | 2314 | (setq size (min (+ (point) size) |
| 2315 | ;; Limit the search by the end of the HTML header. | 2315 | (save-excursion |
| 2316 | (or (search-forward "</head>" size t) | 2316 | ;; Limit the search by the end of the HTML header. |
| 2317 | ;; In case of no header, search only 10 lines. | 2317 | (or (search-forward "</head>" size t) |
| 2318 | (forward-line 10)) | 2318 | ;; In case of no header, search only 10 lines. |
| 2319 | (point)))) | 2319 | (forward-line 10)) |
| 2320 | ;; Make sure that the buffer really contains an HTML document, by | 2320 | (point)))) |
| 2321 | ;; checking that it starts with a doctype or a <HTML> start tag | 2321 | ;; Make sure that the buffer really contains an HTML document, by |
| 2322 | ;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is | 2322 | ;; checking that it starts with a doctype or a <HTML> start tag |
| 2323 | ;; useful for Mozilla bookmark files. | 2323 | ;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is |
| 2324 | (when (and (re-search-forward "\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)" size t) | 2324 | ;; useful for Mozilla bookmark files. |
| 2325 | (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t)) | 2325 | (when (and (re-search-forward "\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)" size t) |
| 2326 | (let* ((match (match-string 1)) | 2326 | (re-search-forward "<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']" size t)) |
| 2327 | (sym (intern (downcase match)))) | 2327 | (let* ((match (match-string 1)) |
| 2328 | (if (coding-system-p sym) | 2328 | (sym (intern (downcase match)))) |
| 2329 | sym | 2329 | (if (coding-system-p sym) |
| 2330 | (message "Warning: unknown coding system \"%s\"" match) | 2330 | sym |
| 2331 | nil)))) | 2331 | (message "Warning: unknown coding system \"%s\"" match) |
| 2332 | nil))))) | ||
| 2332 | 2333 | ||
| 2333 | ;;; | 2334 | ;;; |
| 2334 | (provide 'mule) | 2335 | (provide 'mule) |