prompt
(mapcar (lambda (e) (list (symbol-name (car e))))
mm-mime-mule-charset-alist)
- nil t)))))))
+ nil t))))
+ (subst-char-in-string
+ . (lambda (from to string) ;; stolen (and renamed) from nnheader.el
+ "Replace characters in STRING from FROM to TO."
+ (let ((string (substring string 0)) ;Copy string.
+ (len (length string))
+ (idx 0))
+ ;; Replace all occurrences of FROM with TO.
+ (while (< idx len)
+ (when (= (aref string idx) from)
+ (aset string idx to))
+ (setq idx (1+ idx)))
+ string)))
+ )))
(eval-and-compile
(defalias 'mm-char-or-char-int-p
(t
nil)))
-(static-if (fboundp 'subst-char-in-string)
- (defsubst mm-replace-chars-in-string (string from to)
- (subst-char-in-string from to string))
- (defun mm-replace-chars-in-string (string from to)
- "Replace characters in STRING from FROM to TO."
- (let ((string (substring string 0)) ;Copy string.
- (len (length string))
- (idx 0))
- ;; Replace all occurrences of FROM with TO.
- (while (< idx len)
- (when (= (aref string idx) from)
- (aset string idx to))
- (setq idx (1+ idx)))
- string)))
+(defsubst mm-replace-chars-in-string (string from to)
+ (mm-subst-char-in-string from to string))
(defsubst mm-enable-multibyte ()
"Enable multibyte in the current buffer."
(defun mm-mime-charset (charset)
"Return the MIME charset corresponding to the MULE CHARSET."
+ (if (eq charset 'unknown)
+ (error "8-bit characters are found in the message, please specify charset."))
(if (and (fboundp 'coding-system-get) (fboundp 'get-charset-property))
;; This exists in Emacs 20.
(or