- (char-to-string 255)))
- (eq (point) (point-max))))
- (setq buffer-file-coding-system 'raw-text-unix)
- (insert "(require 'mule)\n;;;###coding system: escape-quoted\n")
- (setq buffer-file-coding-system 'escape-quoted)
- ;; #### Lazy loading not yet implemented for MULE files
- ;; mrb - Fix this someday.
- (save-excursion
- (set-buffer byte-compile-inbuffer)
- (setq byte-compile-dynamic nil
- byte-compile-dynamic-docstrings nil))
- ;;(external-debugging-output (prin1-to-string (buffer-local-variables))))
- ))
+ (char-to-string 255))))
+ (setq ces
+ (if (eq (point) (point-max))
+ (if (and (featurep 'utf-2000)
+ (re-search-backward "\\\\u[0-9A-Fa-f]+" nil t))
+ 'utf-8-mcs-unix
+ 'binary)
+ (when (featurep 'utf-2000)
+ (goto-char (point-min))
+ (if (re-search-forward "\\\\u[0-9A-Fa-f]+" nil t)
+ 'utf-8-mcs-unix)))))
+ (setq ces 'binary))
+ (if (eq ces 'binary)
+ (setq buffer-file-coding-system 'binary)
+ (cond ((eq ces 'utf-8-mcs-unix)
+ (insert
+ "(require 'mule)\n;;;###coding system: utf-8-mcs-unix\n")
+ (setq buffer-file-coding-system 'utf-8-mcs-unix)
+ )
+ (t
+ (insert "(require 'mule)\n;;;###coding system: escape-quoted\n")
+ (setq buffer-file-coding-system 'escape-quoted)
+ ))
+ ;; #### Lazy loading not yet implemented for MULE files
+ ;; mrb - Fix this someday.
+ (save-excursion
+ (set-buffer byte-compile-inbuffer)
+ (setq byte-compile-dynamic nil
+ byte-compile-dynamic-docstrings nil))
+ ;; (external-debugging-output
+ ;; (prin1-to-string (buffer-local-variables)))
+ )))