86 |
(multibyte-char-to-unibyte . identity)))) |
(multibyte-char-to-unibyte . identity)))) |
87 |
|
|
88 |
(eval-and-compile |
(eval-and-compile |
89 |
|
(cond |
90 |
|
((fboundp 'replace-in-string) |
91 |
|
(defalias 'mm-replace-in-string 'replace-in-string)) |
92 |
|
((fboundp 'replace-regexp-in-string) |
93 |
|
(defun mm-replace-in-string (string regexp newtext &optional literal) |
94 |
|
"Replace all matches for REGEXP with NEWTEXT in STRING. |
95 |
|
If LITERAL is non-nil, insert NEWTEXT literally. Return a new |
96 |
|
string containing the replacements. |
97 |
|
|
98 |
|
This is a compatibility function for different Emacsen." |
99 |
|
(replace-regexp-in-string regexp newtext string nil literal))) |
100 |
|
(t |
101 |
|
(defun mm-replace-in-string (string regexp newtext &optional literal) |
102 |
|
"Replace all matches for REGEXP with NEWTEXT in STRING. |
103 |
|
If LITERAL is non-nil, insert NEWTEXT literally. Return a new |
104 |
|
string containing the replacements. |
105 |
|
|
106 |
|
This is a compatibility function for different Emacsen." |
107 |
|
(let ((start 0) tail) |
108 |
|
(while (string-match regexp string start) |
109 |
|
(setq tail (- (length string) (match-end 0))) |
110 |
|
(setq string (replace-match newtext nil literal string)) |
111 |
|
(setq start (- (length string) tail)))) |
112 |
|
string)))) |
113 |
|
|
114 |
|
(eval-and-compile |
115 |
(defalias 'mm-char-or-char-int-p |
(defalias 'mm-char-or-char-int-p |
116 |
(cond |
(cond |
117 |
((fboundp 'char-or-char-int-p) 'char-or-char-int-p) |
((fboundp 'char-or-char-int-p) 'char-or-char-int-p) |
632 |
|
|
633 |
;; Load the Latin Unity library, if available. |
;; Load the Latin Unity library, if available. |
634 |
(when (and (not (featurep 'latin-unity)) (locate-library "latin-unity")) |
(when (and (not (featurep 'latin-unity)) (locate-library "latin-unity")) |
635 |
(require 'latin-unity)) |
(ignore-errors (require 'latin-unity))) |
636 |
|
|
637 |
;; Now, can we use it? |
;; Now, can we use it? |
638 |
(if (featurep 'latin-unity) |
(if (featurep 'latin-unity) |
677 |
|
|
678 |
(defmacro mm-xemacs-find-mime-charset (begin end) |
(defmacro mm-xemacs-find-mime-charset (begin end) |
679 |
(when (featurep 'xemacs) |
(when (featurep 'xemacs) |
680 |
`(mm-xemacs-find-mime-charset-1 ,begin ,end))) |
`(and (featurep 'mule) (mm-xemacs-find-mime-charset-1 ,begin ,end)))) |
681 |
|
|
682 |
(defun mm-find-mime-charset-region (b e &optional hack-charsets) |
(defun mm-find-mime-charset-region (b e &optional hack-charsets) |
683 |
"Return the MIME charsets needed to encode the region between B and E. |
"Return the MIME charsets needed to encode the region between B and E. |