comparison lisp/international/mule.el @ 62154:2d0b029e8560

(sgml-xml-auto-coding-function): Recognize encoding='FOO' in single quotes as well as in double quotes.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 07 May 2005 15:53:56 +0000
parents eaf711995ea5
children c36561fe0657 5ae8a8b0a308 62afea0771d8
comparison
equal deleted inserted replaced
62153:41d7701663fa 62154:2d0b029e8560
2178 This function is intended to be added to `auto-coding-functions'." 2178 This function is intended to be added to `auto-coding-functions'."
2179 (setq size (+ (point) size)) 2179 (setq size (+ (point) size))
2180 (when (re-search-forward "\\`[[:space:]\n]*<\\?xml" size t) 2180 (when (re-search-forward "\\`[[:space:]\n]*<\\?xml" size t)
2181 (let ((end (save-excursion 2181 (let ((end (save-excursion
2182 ;; This is a hack. 2182 ;; This is a hack.
2183 (re-search-forward "\"\\s-*\\?>" size t)))) 2183 (re-search-forward "[\"']\\s-*\\?>" size t))))
2184 (when end 2184 (when end
2185 (if (re-search-forward "encoding=\"\\(.+?\\)\"" end t) 2185 (if (re-search-forward "encoding=[\"']\\(.+?\\)[\"']" end t)
2186 (let* ((match (match-string 1)) 2186 (let* ((match (match-string 1))
2187 (sym (intern (downcase match)))) 2187 (sym (intern (downcase match))))
2188 (if (coding-system-p sym) 2188 (if (coding-system-p sym)
2189 sym 2189 sym
2190 (message "Warning: unknown coding system \"%s\"" match) 2190 (message "Warning: unknown coding system \"%s\"" match)