aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-11-08 15:35:07 +0000
committerDave Love2000-11-08 15:35:07 +0000
commit9e153fefd2a2bad4f6932aea46940ba0291f2d8e (patch)
treec7e4de31f68059ab9b2ee9d6296f4124449699bc
parent2d5fdf6346143dbfbd21e8c3d2f3f3595855b8ec (diff)
downloademacs-9e153fefd2a2bad4f6932aea46940ba0291f2d8e.tar.gz
emacs-9e153fefd2a2bad4f6932aea46940ba0291f2d8e.zip
Wrap subst-char-in-string def in eval-and-compile.
(gnus-intersection, gnus-sorted-complement): Autoload.
-rw-r--r--lisp/gnus/nnheader.el32
1 files changed, 18 insertions, 14 deletions
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 @@
34 34
35(require 'mail-utils) 35(require 'mail-utils)
36(require 'mm-util) 36(require 'mm-util)
37(eval-and-compile
38 (autoload 'gnus-intersection "gnus-range")
39 (autoload 'gnus-sorted-complement "gnus-range"))
37 40
38(defvar nnheader-max-head-length 4096 41(defvar nnheader-max-head-length 4096
39 "*Max length of the head of articles.") 42 "*Max length of the head of articles.")
@@ -693,20 +696,21 @@ without formatting."
693 (apply 'insert format args)) 696 (apply 'insert format args))
694 t)) 697 t))
695 698
696(if (fboundp 'subst-char-in-string) 699(eval-and-compile
697 (defsubst nnheader-replace-chars-in-string (string from to) 700 (if (fboundp 'subst-char-in-string)
698 (subst-char-in-string from to string)) 701 (defsubst nnheader-replace-chars-in-string (string from to)
699 (defun nnheader-replace-chars-in-string (string from to) 702 (subst-char-in-string from to string))
700 "Replace characters in STRING from FROM to TO." 703 (defun nnheader-replace-chars-in-string (string from to)
701 (let ((string (substring string 0)) ;Copy string. 704 "Replace characters in STRING from FROM to TO."
702 (len (length string)) 705 (let ((string (substring string 0)) ;Copy string.
703 (idx 0)) 706 (len (length string))
704 ;; Replace all occurrences of FROM with TO. 707 (idx 0))
705 (while (< idx len) 708 ;; Replace all occurrences of FROM with TO.
706 (when (= (aref string idx) from) 709 (while (< idx len)
707 (aset string idx to)) 710 (when (= (aref string idx) from)
708 (setq idx (1+ idx))) 711 (aset string idx to))
709 string))) 712 (setq idx (1+ idx)))
713 string))))
710 714
711(defun nnheader-replace-duplicate-chars-in-string (string from to) 715(defun nnheader-replace-duplicate-chars-in-string (string from to)
712 "Replace characters in STRING from FROM to TO." 716 "Replace characters in STRING from FROM to TO."