/[emacs]/emacs/lisp/gnus/mm-util.el
ViewVC logotype

Diff of /emacs/lisp/gnus/mm-util.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36 by miles, Sun Feb 13 08:47:44 2005 UTC revision 1.37 by miles, Wed Mar 30 08:14:32 2005 UTC
# Line 86  Line 86 
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)
# Line 606  But this is very much a corner case, so Line 632  But this is very much a corner case, so
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)
# Line 651  But this is very much a corner case, so Line 677  But this is very much a corner case, so
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.

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26