Mercurial > emacs
comparison lisp/gnus/nnheader.el @ 33300:cae923af5a5d
Wrap subst-char-in-string def in eval-and-compile.
(gnus-intersection, gnus-sorted-complement): Autoload.
author | Dave Love <fx@gnu.org> |
---|---|
date | Wed, 08 Nov 2000 15:35:07 +0000 |
parents | a51631f90704 |
children | c1c373a70748 |
comparison
equal
deleted
inserted
replaced
33299:be95f43e08db | 33300:cae923af5a5d |
---|---|
32 | 32 |
33 (eval-when-compile (require 'cl)) | 33 (eval-when-compile (require 'cl)) |
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.") |
40 | 43 |
41 (defvar nnheader-head-chop-length 2048 | 44 (defvar nnheader-head-chop-length 2048 |
691 (if (string-match "%" format) | 694 (if (string-match "%" format) |
692 (insert (apply 'format format args)) | 695 (insert (apply 'format format args)) |
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." |
713 (let ((string (substring string 0)) ;Copy string. | 717 (let ((string (substring string 0)) ;Copy string. |
714 (len (length string)) | 718 (len (length string)) |