2000-11-04 13:08:02 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 4 Nov 2000 17:13:57 +0000 (17:13 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 4 Nov 2000 17:13:57 +0000 (17:13 +0000)
* mm-util.el (mm-subst-char-in-string): New function.
(mm-replace-chars-in-string): Use it.
* message.el (message-replace-chars-in-string): Use it.
* nnheader.el (nnheader-replace-chars-in-string): Use it.
* gnus-mh.el (mh-lib-progs): Shut up.

lisp/ChangeLog
lisp/gnus-mh.el
lisp/message.el
lisp/mm-util.el
lisp/nnheader.el

index fa72e68..304f26d 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-04 13:08:02  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * mm-util.el (mm-subst-char-in-string): New function.
+       (mm-replace-chars-in-string): Use it.
+       * message.el (message-replace-chars-in-string): Use it.
+       * nnheader.el (nnheader-replace-chars-in-string): Use it.
+       * gnus-mh.el (mh-lib-progs): Shut up.
+
 2000-11-04  ShengHuo Zhu  <zsh@cs.rochester.edu>
 
        * base64.el, md5.el: Moved to contrib directory.
index a73e90b..0278d50 100644 (file)
@@ -40,6 +40,9 @@
 (require 'gnus-msg)
 (require 'gnus-sum)
 
+(eval-when-compile
+  (defvar mh-lib-progs))
+
 (defun gnus-summary-save-article-folder (&optional arg)
   "Append the current article to an mh folder.
 If N is a positive number, save the N next articles.
index 3dd752b..40f581d 100644 (file)
@@ -33,6 +33,7 @@
 (eval-when-compile
   (require 'cl)
   (defvar gnus-list-identifiers))      ; gnus-sum is required where necessary
+
 (require 'mailheader)
 (require 'nnheader)
 ;; This is apparently necessary even though things are autoloaded:
@@ -4474,21 +4475,8 @@ regexp varstr."
 
 ;;; Miscellaneous functions
 
-;; stolen (and renamed) from nnheader.el
-(if (fboundp 'subst-char-in-string)
-    (defsubst message-replace-chars-in-string (string from to)
-      (subst-char-in-string from to string))
-  (defun message-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 message-replace-chars-in-string (string from to)
+  (mm-subst-char-in-string from to string))
 
 ;;;
 ;;; MIME functions
index 7e3cacb..c6f5192 100644 (file)
            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
@@ -201,20 +214,8 @@ used as the line break code type of the coding system."
    (t
     nil)))
 
-(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."
index 422cf15..d310489 100644 (file)
@@ -692,20 +692,8 @@ without formatting."
       (apply 'insert format args))
     t))
 
-(if (fboundp 'subst-char-in-string)
-    (defsubst nnheader-replace-chars-in-string (string from to)
-      (subst-char-in-string from to string))
-  (defun nnheader-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 nnheader-replace-chars-in-string (string from to)
+  (mm-subst-char-in-string from to string))
 
 (defun nnheader-replace-duplicate-chars-in-string (string from to)
   "Replace characters in STRING from FROM to TO."