From: Dave Love Date: Wed, 8 Nov 2000 15:35:07 +0000 (+0000) Subject: Wrap subst-char-in-string def in eval-and-compile. X-Git-Tag: emacs-pretest-21.0.90~225 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9e153fefd2a2bad4f6932aea46940ba0291f2d8e;p=emacs.git Wrap subst-char-in-string def in eval-and-compile. (gnus-intersection, gnus-sorted-complement): Autoload. --- diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 67bbfa9957e..e3a98f36173 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -34,6 +34,9 @@ (require 'mail-utils) (require 'mm-util) +(eval-and-compile + (autoload 'gnus-intersection "gnus-range") + (autoload 'gnus-sorted-complement "gnus-range")) (defvar nnheader-max-head-length 4096 "*Max length of the head of articles.") @@ -693,20 +696,21 @@ 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))) +(eval-and-compile + (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)))) (defun nnheader-replace-duplicate-chars-in-string (string from to) "Replace characters in STRING from FROM to TO."