- (save-excursion
- (set-buffer byte-compile-inbuffer)
- (goto-char (point-min))
- ;; mrb- There must be a better way than skip-chars-forward
- (skip-chars-forward (concat (char-to-string 0) "-"
- (char-to-string 255)))
- (if (eq (point) (point-max))
- (setq ces 'raw-text)
- (goto-char (point-min))
- (while (< (point)(point-max))
- (cond ((eq (char-after) ?\;)
- (delete-region (point)(point-at-eol))
- (if (eq (char-after) ?\n)
- (delete-char 1)
- (forward-char))
- )
- ((eq (char-after) ?\?)
- (forward-char 2)
- )
- ((eq (char-after) ?\n)
- (forward-char)
- )
- ((eq (char-after) ?\")
- (forward-char)
- (while (and (< (point)(point-max))
- (not (when (eq (char-after) ?\")
- (forward-char)
- t)))
- (if (eq (char-after) ?\\)
- (forward-char 2)
- (forward-char)))
- )
- (t
- (forward-char))))
- (goto-char (point-min))
- (skip-chars-forward (concat (char-to-string 0) "-"
- (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-unix
- 'raw-text)))))
- (if (eq ces 'raw-text)
- (setq buffer-file-coding-system 'raw-text)
- (cond ((eq ces 'utf-8-unix)
- (insert "(require 'mule)\n;;;###coding system: utf-8-unix\n")
- (setq buffer-file-coding-system 'utf-8-unix)
+ (if (featurep 'mule)
+ (save-excursion
+ (set-buffer byte-compile-inbuffer)
+ (goto-char (point-min))
+ ;; mrb- There must be a better way than skip-chars-forward
+ (skip-chars-forward (concat (char-to-string 0) "-"
+ (char-to-string 255)))
+ (if (eq (point) (point-max))
+ (setq ces 'binary)
+ (goto-char (point-min))
+ (while (< (point)(point-max))
+ (cond ((and (eq (char-after) ?\;)
+ (not (eq (char-after (1- (point))) ?\\)))
+ (delete-region (point)(point-at-eol))
+ (if (eq (char-after) ?\n)
+ (delete-char 1)
+ (forward-char))
+ )
+ ((eq (char-after) ?\?)
+ (forward-char 2)
+ )
+ ((eq (char-after) ?\n)
+ (forward-char)
+ )
+ ((eq (char-after) ?\")
+ (forward-char)
+ (while (and (< (point)(point-max))
+ (not (when (eq (char-after) ?\")
+ (forward-char)
+ t)))
+ (if (eq (char-after) ?\\)
+ (forward-char 2)
+ (forward-char)))
+ )
+ (t
+ (forward-char))))
+ (goto-char (point-min))
+ (skip-chars-forward (concat (char-to-string 0) "-"
+ (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))))
+ (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)