aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2016-02-11 16:13:08 +1100
committerLars Ingebrigtsen2016-02-11 16:13:08 +1100
commit21cfd14d54370cddc1160d30bc47e17c5ac3a162 (patch)
tree1ed08374d1e42dd89d674a2ef840097ea3d4d905
parent16b7e605f32862c592ffd1134079b91e3ee4ef91 (diff)
downloademacs-21cfd14d54370cddc1160d30bc47e17c5ac3a162.tar.gz
emacs-21cfd14d54370cddc1160d30bc47e17c5ac3a162.zip
gnus-replace-in-string -> replace-regexp-in-string
* lisp/gnus/gnus-util.el (gnus-replace-in-string): Declare obsolete. Transform all usages of it into replace-regexp-in-string. * lisp/gnus/mailcap.el (mailcap-replace-in-string): Remove.
-rw-r--r--lisp/gnus/gnus-art.el29
-rw-r--r--lisp/gnus/gnus-bookmark.el2
-rw-r--r--lisp/gnus/gnus-gravatar.el2
-rw-r--r--lisp/gnus/gnus-group.el6
-rw-r--r--lisp/gnus/gnus-msg.el2
-rw-r--r--lisp/gnus/gnus-sum.el10
-rw-r--r--lisp/gnus/gnus-util.el19
-rw-r--r--lisp/gnus/mail-source.el2
-rw-r--r--lisp/gnus/mailcap.el35
-rw-r--r--lisp/gnus/message.el4
-rw-r--r--lisp/gnus/mm-decode.el7
-rw-r--r--lisp/gnus/nnir.el34
-rw-r--r--lisp/gnus/nnmaildir.el22
-rw-r--r--lisp/gnus/nnml.el2
-rw-r--r--lisp/gnus/nnrss.el8
-rw-r--r--lisp/gnus/spam-report.el10
-rw-r--r--lisp/gnus/spam.el6
17 files changed, 90 insertions, 110 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 5a27bf8be69..f16a4c66ab6 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -7522,7 +7522,7 @@ address, `ask' if unsure and `invalid' if the string is invalid."
7522 (list gnus-button-mid-or-mail-heuristic-alist) 7522 (list gnus-button-mid-or-mail-heuristic-alist)
7523 (result 0) rate regexp lpartlen elem) 7523 (result 0) rate regexp lpartlen elem)
7524 (setq lpartlen 7524 (setq lpartlen
7525 (length (gnus-replace-in-string mid-or-mail "^\\(.*\\)@.*$" "\\1"))) 7525 (length (replace-regexp-in-string mid-or-mail "^\\(.*\\)@.*$" "\\1")))
7526 (gnus-message 8 "`%s', length of local part=`%s'." mid-or-mail lpartlen) 7526 (gnus-message 8 "`%s', length of local part=`%s'." mid-or-mail lpartlen)
7527 ;; Certain special cases... 7527 ;; Certain special cases...
7528 (when (string-match 7528 (when (string-match
@@ -7593,7 +7593,7 @@ address, `ask' if unsure and `invalid' if the string is invalid."
7593 (setq guessed 7593 (setq guessed
7594 ;; get rid of surrounding angles... 7594 ;; get rid of surrounding angles...
7595 (funcall pref 7595 (funcall pref
7596 (gnus-replace-in-string mid-or-mail "^<\\|>$" ""))) 7596 (replace-regexp-in-string mid-or-mail "^<\\|>$" "")))
7597 (if (or (eq 'mid guessed) (eq 'mail guessed)) 7597 (if (or (eq 'mid guessed) (eq 'mail guessed))
7598 (setq pref guessed) 7598 (setq pref guessed)
7599 (setq pref 'ask))) 7599 (setq pref 'ask)))
@@ -7625,13 +7625,13 @@ as a symbol to FUN."
7625 "Call `describe-function' when pushing the corresponding URL button." 7625 "Call `describe-function' when pushing the corresponding URL button."
7626 (describe-function 7626 (describe-function
7627 (intern 7627 (intern
7628 (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))) 7628 (replace-regexp-in-string url gnus-button-handle-describe-prefix ""))))
7629 7629
7630(defun gnus-button-handle-describe-variable (url) 7630(defun gnus-button-handle-describe-variable (url)
7631 "Call `describe-variable' when pushing the corresponding URL button." 7631 "Call `describe-variable' when pushing the corresponding URL button."
7632 (describe-variable 7632 (describe-variable
7633 (intern 7633 (intern
7634 (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))) 7634 (replace-regexp-in-string url gnus-button-handle-describe-prefix ""))))
7635 7635
7636(defun gnus-button-handle-symbol (url) 7636(defun gnus-button-handle-symbol (url)
7637"Display help on variable or function. 7637"Display help on variable or function.
@@ -7645,7 +7645,7 @@ Calls `describe-variable' or `describe-function'."
7645(defun gnus-button-handle-describe-key (url) 7645(defun gnus-button-handle-describe-key (url)
7646 "Call `describe-key' when pushing the corresponding URL button." 7646 "Call `describe-key' when pushing the corresponding URL button."
7647 (let* ((key-string 7647 (let* ((key-string
7648 (gnus-replace-in-string url gnus-button-handle-describe-prefix "")) 7648 (replace-regexp-in-string url gnus-button-handle-describe-prefix ""))
7649 (keys (ignore-errors (eval `(kbd ,key-string))))) 7649 (keys (ignore-errors (eval `(kbd ,key-string)))))
7650 (if keys 7650 (if keys
7651 (describe-key keys) 7651 (describe-key keys)
@@ -7653,30 +7653,31 @@ Calls `describe-variable' or `describe-function'."
7653 7653
7654(defun gnus-button-handle-apropos (url) 7654(defun gnus-button-handle-apropos (url)
7655 "Call `apropos' when pushing the corresponding URL button." 7655 "Call `apropos' when pushing the corresponding URL button."
7656 (apropos (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) 7656 (apropos (replace-regexp-in-string
7657 url gnus-button-handle-describe-prefix "")))
7657 7658
7658(defun gnus-button-handle-apropos-command (url) 7659(defun gnus-button-handle-apropos-command (url)
7659 "Call `apropos' when pushing the corresponding URL button." 7660 "Call `apropos' when pushing the corresponding URL button."
7660 (apropos-command 7661 (apropos-command
7661 (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) 7662 (replace-regexp-in-string url gnus-button-handle-describe-prefix "")))
7662 7663
7663(defun gnus-button-handle-apropos-variable (url) 7664(defun gnus-button-handle-apropos-variable (url)
7664 "Call `apropos' when pushing the corresponding URL button." 7665 "Call `apropos' when pushing the corresponding URL button."
7665 (funcall 7666 (funcall
7666 (if (fboundp 'apropos-variable) 'apropos-variable 'apropos) 7667 (if (fboundp 'apropos-variable) 'apropos-variable 'apropos)
7667 (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) 7668 (replace-regexp-in-string url gnus-button-handle-describe-prefix "")))
7668 7669
7669(defun gnus-button-handle-apropos-documentation (url) 7670(defun gnus-button-handle-apropos-documentation (url)
7670 "Call `apropos' when pushing the corresponding URL button." 7671 "Call `apropos' when pushing the corresponding URL button."
7671 (funcall 7672 (funcall
7672 (if (fboundp 'apropos-documentation) 'apropos-documentation 'apropos) 7673 (if (fboundp 'apropos-documentation) 'apropos-documentation 'apropos)
7673 (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) 7674 (replace-regexp-in-string url gnus-button-handle-describe-prefix "")))
7674 7675
7675(defun gnus-button-handle-library (url) 7676(defun gnus-button-handle-library (url)
7676 "Call `locate-library' when pushing the corresponding URL button." 7677 "Call `locate-library' when pushing the corresponding URL button."
7677 (gnus-message 9 "url=`%s'" url) 7678 (gnus-message 9 "url=`%s'" url)
7678 (let* ((lib (locate-library url)) 7679 (let* ((lib (locate-library url))
7679 (file (gnus-replace-in-string (or lib "") "\\.elc" ".el"))) 7680 (file (replace-regexp-in-string (or lib "") "\\.elc" ".el")))
7680 (if (not lib) 7681 (if (not lib)
7681 (gnus-message 1 "Cannot locale library `%s'." url) 7682 (gnus-message 1 "Cannot locale library `%s'." url)
7682 (find-file-read-only file)))) 7683 (find-file-read-only file))))
@@ -8274,7 +8275,7 @@ url is put as the `gnus-button-url' overlay property on the button."
8274 "Fetch a man page." 8275 "Fetch a man page."
8275 (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url) 8276 (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url)
8276 (when (eq gnus-button-man-handler 'woman) 8277 (when (eq gnus-button-man-handler 'woman)
8277 (setq url (gnus-replace-in-string url "([1-9][X1a-z]*).*\\'" ""))) 8278 (setq url (replace-regexp-in-string url "([1-9][X1a-z]*).*\\'" "")))
8278 (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url) 8279 (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url)
8279 (funcall gnus-button-man-handler url)) 8280 (funcall gnus-button-man-handler url))
8280 8281
@@ -8289,8 +8290,8 @@ url is put as the `gnus-button-url' overlay property on the button."
8289 ")" (gnus-url-unhex-string (match-string 2 url))))) 8290 ")" (gnus-url-unhex-string (match-string 2 url)))))
8290 ((string-match "([^)\"]+)[^\"]+" url) 8291 ((string-match "([^)\"]+)[^\"]+" url)
8291 (setq url 8292 (setq url
8292 (gnus-replace-in-string 8293 (replace-regexp-in-string
8293 (gnus-replace-in-string url "[\n\t ]+" " ") "\"" "")) 8294 (replace-regexp-in-string url "[\n\t ]+" " ") "\"" ""))
8294 (gnus-info-find-node url)) 8295 (gnus-info-find-node url))
8295 (t (error "Can't parse %s" url)))) 8296 (t (error "Can't parse %s" url))))
8296 8297
@@ -8428,7 +8429,7 @@ url is put as the `gnus-button-url' overlay property on the button."
8428 (if (fboundp func) 8429 (if (fboundp func)
8429 (funcall func) 8430 (funcall func)
8430 (message-position-on-field (caar args))) 8431 (message-position-on-field (caar args)))
8431 (insert (gnus-replace-in-string 8432 (insert (replace-regexp-in-string
8432 (mapconcat 'identity (reverse (cdar args)) ", ") 8433 (mapconcat 'identity (reverse (cdar args)) ", ")
8433 "\r\n" "\n" t)) 8434 "\r\n" "\n" t))
8434 (setq args (cdr args))) 8435 (setq args (cdr args)))
diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el
index a16ac531ba0..cb3de92a2ae 100644
--- a/lisp/gnus/gnus-bookmark.el
+++ b/lisp/gnus/gnus-bookmark.el
@@ -226,7 +226,7 @@ So the cdr of each bookmark is an alist too.")
226 "-" (car subject) "-" (cadr subject))) 226 "-" (car subject) "-" (cadr subject)))
227 (default-name-1 227 (default-name-1
228 ;; Strip "[]" chars from the bookmark name: 228 ;; Strip "[]" chars from the bookmark name:
229 (gnus-replace-in-string default-name-0 "[]_[]" "")) 229 (replace-regexp-in-string default-name-0 "[]_[]" ""))
230 (name (read-from-minibuffer 230 (name (read-from-minibuffer
231 (format "Set bookmark (%s): " default-name-1) 231 (format "Set bookmark (%s): " default-name-1)
232 nil nil nil nil 232 nil nil nil nil
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index 77fce259b4b..28caed2e80d 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -94,7 +94,7 @@ Set image category to CATEGORY."
94 (mail-address (cadr address))) 94 (mail-address (cadr address)))
95 (when (if real-name 95 (when (if real-name
96 (re-search-forward 96 (re-search-forward
97 (concat (gnus-replace-in-string 97 (concat (replace-regexp-in-string
98 (regexp-quote real-name) "[\t ]+" "[\t\n ]+") 98 (regexp-quote real-name) "[\t ]+" "[\t\n ]+")
99 "\\|" 99 "\\|"
100 (regexp-quote mail-address)) 100 (regexp-quote mail-address))
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 838e7470856..190acf13870 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -2218,7 +2218,7 @@ if it is not a list."
2218 (setq group 2218 (setq group
2219 (mm-encode-coding-string 2219 (mm-encode-coding-string
2220 group (gnus-group-name-charset nil group)))) 2220 group (gnus-group-name-charset nil group))))
2221 (gnus-replace-in-string group "\n" ""))) 2221 (replace-regexp-in-string group "\n" "")))
2222 2222
2223;;;###autoload 2223;;;###autoload
2224(defun gnus-fetch-group (group &optional articles) 2224(defun gnus-fetch-group (group &optional articles)
@@ -2476,8 +2476,8 @@ the bug number, and browsing the URL must return mbox output."
2476 (while (re-search-forward "^To: " nil t) 2476 (while (re-search-forward "^To: " nil t)
2477 (end-of-line) 2477 (end-of-line)
2478 (insert (format ", %s@%s" (car ids) 2478 (insert (format ", %s@%s" (car ids)
2479 (gnus-replace-in-string 2479 (replace-regexp-in-string
2480 (gnus-replace-in-string mbox-url "^http://" "") 2480 (replace-regexp-in-string mbox-url "^http://" "")
2481 "/.*$" "")))))) 2481 "/.*$" ""))))))
2482 (gnus-group-read-ephemeral-group 2482 (gnus-group-read-ephemeral-group
2483 (format "nndoc+ephemeral:bug#%s" 2483 (format "nndoc+ephemeral:bug#%s"
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 8f0dbfdc205..5bf0f7cb0bf 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1138,7 +1138,7 @@ See the variable `gnus-user-agent'."
1138 (gnus-v 1138 (gnus-v
1139 (when (memq 'gnus gnus-user-agent) 1139 (when (memq 'gnus gnus-user-agent)
1140 (concat "Gnus/" 1140 (concat "Gnus/"
1141 (gnus-replace-in-string 1141 (replace-regexp-in-string
1142 (format "%1.8f" (gnus-continuum-version gnus-version)) 1142 (format "%1.8f" (gnus-continuum-version gnus-version))
1143 "0+\\'" "") 1143 "0+\\'" "")
1144 " (" gnus-version ")"))) 1144 " (" gnus-version ")")))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index b85a4034cd1..a8a4c3faebc 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -9086,7 +9086,7 @@ non-numeric or nil fetch the number specified by the
9086 (gnus-warp-to-article) 9086 (gnus-warp-to-article)
9087 (when (and (stringp message-id) 9087 (when (and (stringp message-id)
9088 (not (zerop (length message-id)))) 9088 (not (zerop (length message-id))))
9089 (setq message-id (gnus-replace-in-string message-id " " "")) 9089 (setq message-id (replace-regexp-in-string message-id " " ""))
9090 ;; Construct the correct Message-ID if necessary. 9090 ;; Construct the correct Message-ID if necessary.
9091 ;; Suggested by tale@pawl.rpi.edu. 9091 ;; Suggested by tale@pawl.rpi.edu.
9092 (unless (string-match "^<" message-id) 9092 (unless (string-match "^<" message-id)
@@ -9564,10 +9564,10 @@ article. If BACKWARD (the prefix) is non-nil, search backward instead."
9564 9564
9565(defun gnus-summary-print-truncate-and-quote (string &optional len) 9565(defun gnus-summary-print-truncate-and-quote (string &optional len)
9566 "Truncate to LEN and quote all \"(\"'s in STRING." 9566 "Truncate to LEN and quote all \"(\"'s in STRING."
9567 (gnus-replace-in-string (if (and len (> (length string) len)) 9567 (replace-regexp-in-string (if (and len (> (length string) len))
9568 (substring string 0 len) 9568 (substring string 0 len)
9569 string) 9569 string)
9570 "[()]" "\\\\\\&")) 9570 "[()]" "\\\\\\&"))
9571 9571
9572(defun gnus-summary-print-article (&optional filename n) 9572(defun gnus-summary-print-article (&optional filename n)
9573 "Generate and print a PostScript image of the process-marked (mail) articles. 9573 "Generate and print a PostScript image of the process-marked (mail) articles.
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index a883de9b083..950bb7feb95 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -78,23 +78,14 @@
78(autoload 'nnheader-replace-chars-in-string "nnheader") 78(autoload 'nnheader-replace-chars-in-string "nnheader")
79(autoload 'mail-header-remove-comments "mail-parse") 79(autoload 'mail-header-remove-comments "mail-parse")
80 80
81(eval-and-compile 81(defun gnus-replace-in-string (string regexp newtext &optional literal)
82 (cond 82 "Replace all matches for REGEXP with NEWTEXT in STRING.
83 ;; Prefer `replace-regexp-in-string' (present in Emacs, XEmacs 21.5,
84 ;; SXEmacs 22.1.4) over `replace-in-string'. The latter leads to inf-loops
85 ;; on empty matches:
86 ;; (replace-in-string "foo" "/*$" "/")
87 ;; (replace-in-string "xe" "\\(x\\)?" "")
88 ((fboundp 'replace-regexp-in-string)
89 (defun gnus-replace-in-string (string regexp newtext &optional literal)
90 "Replace all matches for REGEXP with NEWTEXT in STRING.
91If LITERAL is non-nil, insert NEWTEXT literally. Return a new 83If LITERAL is non-nil, insert NEWTEXT literally. Return a new
92string containing the replacements. 84string containing the replacements.
93 85
94This is a compatibility function for different Emacsen." 86This is a compatibility function for different Emacsen."
95 (replace-regexp-in-string regexp newtext string nil literal))) 87 (declare (obsolete replace-regexp-in-string "25.2"))
96 ((fboundp 'replace-in-string) 88 (replace-regexp-in-string regexp newtext string nil literal))
97 (defalias 'gnus-replace-in-string 'replace-in-string))))
98 89
99(defun gnus-boundp (variable) 90(defun gnus-boundp (variable)
100 "Return non-nil if VARIABLE is bound and non-nil." 91 "Return non-nil if VARIABLE is bound and non-nil."
@@ -431,7 +422,7 @@ Cache the result as a text property stored in DATE."
431 422
432(defun gnus-mode-string-quote (string) 423(defun gnus-mode-string-quote (string)
433 "Quote all \"%\"'s in STRING." 424 "Quote all \"%\"'s in STRING."
434 (gnus-replace-in-string string "%" "%%")) 425 (replace-regexp-in-string string "%" "%%"))
435 426
436;; Make a hash table (default and minimum size is 256). 427;; Make a hash table (default and minimum size is 256).
437;; Optional argument HASHSIZE specifies the table size. 428;; Optional argument HASHSIZE specifies the table size.
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index f4a9e191010..f9c89f52cb7 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -603,7 +603,7 @@ If CONFIRM is non-nil, ask for confirmation before removing a file."
603 currday (+ currday (* low2days (nth 1 (current-time))))) 603 currday (+ currday (* low2days (nth 1 (current-time)))))
604 (while files 604 (while files
605 (let* ((ffile (car files)) 605 (let* ((ffile (car files))
606 (bfile (gnus-replace-in-string 606 (bfile (replace-regexp-in-string
607 ffile "\\`.*/\\([^/]+\\)\\'" "\\1")) 607 ffile "\\`.*/\\([^/]+\\)\\'" "\\1"))
608 (filetime (nth 5 (file-attributes ffile))) 608 (filetime (nth 5 (file-attributes ffile)))
609 (fileday (* (car filetime) high2days)) 609 (fileday (* (car filetime) high2days))
diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el
index bf7ba0817ea..85d0411a1e3 100644
--- a/lisp/gnus/mailcap.el
+++ b/lisp/gnus/mailcap.el
@@ -39,19 +39,6 @@
39 (autoload 'mm-delete-duplicates "mm-util") 39 (autoload 'mm-delete-duplicates "mm-util")
40 'mm-delete-duplicates)) 40 'mm-delete-duplicates))
41 41
42;; `mailcap-replace-in-string' is an alias like `gnus-replace-in-string'.
43(eval-and-compile
44 (cond
45 ((fboundp 'replace-regexp-in-string)
46 (defun mailcap-replace-in-string (string regexp newtext &optional literal)
47 "Replace all matches for REGEXP with NEWTEXT in STRING.
48If LITERAL is non-nil, insert NEWTEXT literally. Return a new
49string containing the replacements.
50This is a compatibility function for different Emacsen."
51 (replace-regexp-in-string regexp newtext string nil literal)))
52 ((fboundp 'replace-in-string)
53 (defalias 'mailcap-replace-in-string 'replace-in-string))))
54
55(defgroup mailcap nil 42(defgroup mailcap nil
56 "Definition of viewers for MIME types." 43 "Definition of viewers for MIME types."
57 :version "21.1" 44 :version "21.1"
@@ -1047,16 +1034,18 @@ If FORCE, re-parse even if already parsed."
1047 (commands 1034 (commands
1048 ;; Command strings from `viewer' field of the MIME info 1035 ;; Command strings from `viewer' field of the MIME info
1049 (mailcap-delete-duplicates 1036 (mailcap-delete-duplicates
1050 (delq nil (mapcar (lambda (mime-info) 1037 (delq nil (mapcar
1051 (let ((command (cdr (assoc 'viewer mime-info)))) 1038 (lambda (mime-info)
1052 (if (stringp command) 1039 (let ((command (cdr (assoc 'viewer mime-info))))
1053 (mailcap-replace-in-string 1040 (if (stringp command)
1054 ;; Replace mailcap's `%s' placeholder 1041 (replace-regexp-in-string
1055 ;; with dired's `?' placeholder 1042 ;; Replace mailcap's `%s' placeholder
1056 (mailcap-replace-in-string 1043 ;; with dired's `?' placeholder
1057 ;; Remove the final filename placeholder 1044 (replace-regexp-in-string
1058 command "[ \t\n]*\\('\\)?%s\\1?[ \t\n]*\\'" "" t) 1045 ;; Remove the final filename placeholder
1059 "%s" "?" t)))) 1046 command "[ \t\n]*\\('\\)?%s\\1?[ \t\n]*\\'" ""
1047 nil t)
1048 "%s" "?" nil t))))
1060 common-mime-info))))) 1049 common-mime-info)))))
1061 commands)) 1050 commands))
1062 1051
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 3c3105649ed..11c10126378 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -8373,8 +8373,8 @@ From headers in the original article."
8373 (let ((value (message-field-value header))) 8373 (let ((value (message-field-value header)))
8374 (dolist (string (mail-header-parse-addresses value 'raw)) 8374 (dolist (string (mail-header-parse-addresses value 'raw))
8375 (setq string 8375 (setq string
8376 (gnus-replace-in-string 8376 (replace-regexp-in-string
8377 (gnus-replace-in-string string "^ +\\| +$" "") "\n" "")) 8377 (replace-regexp-in-string string "^ +\\| +$" "") "\n" ""))
8378 (ecomplete-add-item 'mail (car (mail-header-parse-address string)) 8378 (ecomplete-add-item 'mail (car (mail-header-parse-address string))
8379 string)))) 8379 string))))
8380 (ecomplete-save)) 8380 (ecomplete-save))
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 06159bcdd93..4df653c6009 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -28,7 +28,6 @@
28(eval-when-compile (require 'cl)) 28(eval-when-compile (require 'cl))
29 29
30(autoload 'gnus-map-function "gnus-util") 30(autoload 'gnus-map-function "gnus-util")
31(autoload 'gnus-replace-in-string "gnus-util")
32(autoload 'gnus-read-shell-command "gnus-util") 31(autoload 'gnus-read-shell-command "gnus-util")
33 32
34(autoload 'mm-inline-partial "mm-partial") 33(autoload 'mm-inline-partial "mm-partial")
@@ -1360,12 +1359,12 @@ string if you do not like underscores."
1360 1359
1361(defun mm-file-name-delete-control (filename) 1360(defun mm-file-name-delete-control (filename)
1362 "Delete control characters from FILENAME." 1361 "Delete control characters from FILENAME."
1363 (gnus-replace-in-string filename "[\x00-\x1f\x7f]" "")) 1362 (replace-regexp-in-string filename "[\x00-\x1f\x7f]" ""))
1364 1363
1365(defun mm-file-name-delete-gotchas (filename) 1364(defun mm-file-name-delete-gotchas (filename)
1366 "Delete shell gotchas from FILENAME." 1365 "Delete shell gotchas from FILENAME."
1367 (setq filename (gnus-replace-in-string filename "[<>|]" "")) 1366 (setq filename (replace-regexp-in-string filename "[<>|]" ""))
1368 (gnus-replace-in-string filename "^[.-]+" "")) 1367 (replace-regexp-in-string filename "^[.-]+" ""))
1369 1368
1370(defun mm-save-part (handle &optional prompt) 1369(defun mm-save-part (handle &optional prompt)
1371 "Write HANDLE to a file. 1370 "Write HANDLE to a file.
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index 560ba8ad2e5..eb436f51df5 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -928,17 +928,17 @@ ready to be added to the list of search results."
928 928
929 ;; Set group to dirnam without any leading dots or slashes, 929 ;; Set group to dirnam without any leading dots or slashes,
930 ;; and with all subsequent slashes replaced by dots 930 ;; and with all subsequent slashes replaced by dots
931 (let ((group (gnus-replace-in-string 931 (let ((group (replace-regexp-in-string
932 (gnus-replace-in-string dirnam "^[./\\]" "" t) 932 (replace-regexp-in-string dirnam "^[./\\]" "" nil t)
933 "[/\\]" "." t))) 933 "[/\\]" "." nil t)))
934 934
935 (vector (gnus-group-full-name group server) 935 (vector (gnus-group-full-name group server)
936 (if (string-match "\\`nnmaildir:" (gnus-group-server server)) 936 (if (string-match "\\`nnmaildir:" (gnus-group-server server))
937 (nnmaildir-base-name-to-article-number 937 (nnmaildir-base-name-to-article-number
938 (substring article 0 (string-match ":" article)) 938 (substring article 0 (string-match ":" article))
939 group nil) 939 group nil)
940 (string-to-number article)) 940 (string-to-number article))
941 (string-to-number score))))) 941 (string-to-number score)))))
942 942
943;;; Search Engine Interfaces: 943;;; Search Engine Interfaces:
944 944
@@ -1340,9 +1340,10 @@ Tested with swish-e-2.0.1 on Windows NT 4.0."
1340 ;; eliminate all ".", "/", "\" from beginning. Always matches. 1340 ;; eliminate all ".", "/", "\" from beginning. Always matches.
1341 (string-match "^[./\\]*\\(.*\\)$" dirnam) 1341 (string-match "^[./\\]*\\(.*\\)$" dirnam)
1342 ;; "/" -> "." 1342 ;; "/" -> "."
1343 (setq group (gnus-replace-in-string (match-string 1 dirnam) "/" ".")) 1343 (setq group (replace-regexp-in-string
1344 (match-string 1 dirnam) "/" "."))
1344 ;; Windows "\\" -> "." 1345 ;; Windows "\\" -> "."
1345 (setq group (gnus-replace-in-string group "\\\\" ".")) 1346 (setq group (replace-regexp-in-string group "\\\\" "."))
1346 1347
1347 (push (vector (gnus-group-full-name group server) 1348 (push (vector (gnus-group-full-name group server)
1348 (string-to-number artno) 1349 (string-to-number artno)
@@ -1414,7 +1415,7 @@ Tested with swish-e-2.0.1 on Windows NT 4.0."
1414 (when (string-match prefix dirnam) 1415 (when (string-match prefix dirnam)
1415 (setq dirnam (replace-match "" t t dirnam))) 1416 (setq dirnam (replace-match "" t t dirnam)))
1416 (push (vector (gnus-group-full-name 1417 (push (vector (gnus-group-full-name
1417 (gnus-replace-in-string dirnam "/" ".") server) 1418 (replace-regexp-in-string dirnam "/" ".") server)
1418 (string-to-number artno) 1419 (string-to-number artno)
1419 (string-to-number score)) 1420 (string-to-number score))
1420 artlist)) 1421 artlist))
@@ -1612,9 +1613,8 @@ actually)."
1612 group 1613 group
1613 (if (file-directory-p 1614 (if (file-directory-p
1614 (setq group 1615 (setq group
1615 (gnus-replace-in-string 1616 (replace-regexp-in-string
1616 group 1617 group "\\." "/" nil t)))
1617 "\\." "/" t)))
1618 group)))))) 1618 group))))))
1619 (unless group 1619 (unless group
1620 (error "Cannot locate directory for group")) 1620 (error "Cannot locate directory for group"))
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el
index 70a3dd99be7..4b154432c7e 100644
--- a/lisp/gnus/nnmaildir.el
+++ b/lisp/gnus/nnmaildir.el
@@ -656,13 +656,13 @@ by nnmaildir-request-article.")
656 (if (zerop n) 1 (1- (lsh 1 (1+ (logb n)))))) 656 (if (zerop n) 1 (1- (lsh 1 (1+ (logb n))))))
657 657
658(defun nnmaildir--system-name () 658(defun nnmaildir--system-name ()
659 (gnus-replace-in-string 659 (replace-regexp-in-string
660 (gnus-replace-in-string 660 (replace-regexp-in-string
661 (gnus-replace-in-string 661 (replace-regexp-in-string
662 (system-name) 662 (system-name)
663 "\\\\" "\\134" 'literal) 663 "\\\\" "\\134" nil 'literal)
664 "/" "\\057" 'literal) 664 "/" "\\057" nil 'literal)
665 ":" "\\072" 'literal)) 665 ":" "\\072" nil 'literal))
666 666
667(defun nnmaildir-request-type (_group &optional _article) 667(defun nnmaildir-request-type (_group &optional _article)
668 'mail) 668 'mail)
@@ -955,8 +955,8 @@ by nnmaildir-request-article.")
955 pgname (nnmaildir--pgname nnmaildir--cur-server pgname) 955 pgname (nnmaildir--pgname nnmaildir--cur-server pgname)
956 group (symbol-value group) 956 group (symbol-value group)
957 ro (nnmaildir--param pgname 'read-only)) 957 ro (nnmaildir--param pgname 'read-only))
958 (insert (gnus-replace-in-string 958 (insert (replace-regexp-in-string
959 (nnmaildir--grp-name group) " " "\\ " t) 959 (nnmaildir--grp-name group) " " "\\ " nil t)
960 " ") 960 " ")
961 (princ (nnmaildir--group-maxnum nnmaildir--cur-server group) 961 (princ (nnmaildir--group-maxnum nnmaildir--cur-server group)
962 nntp-server-buffer) 962 nntp-server-buffer)
@@ -985,7 +985,7 @@ by nnmaildir-request-article.")
985 (princ (nnmaildir--group-maxnum nnmaildir--cur-server group) 985 (princ (nnmaildir--group-maxnum nnmaildir--cur-server group)
986 nntp-server-buffer) 986 nntp-server-buffer)
987 (insert " " 987 (insert " "
988 (gnus-replace-in-string gname " " "\\ " t) 988 (replace-regexp-in-string gname " " "\\ " nil t)
989 "\n"))))) 989 "\n")))))
990 'group) 990 'group)
991 991
@@ -1116,7 +1116,7 @@ by nnmaildir-request-article.")
1116 (insert " ") 1116 (insert " ")
1117 (princ (nnmaildir--group-maxnum nnmaildir--cur-server group) 1117 (princ (nnmaildir--group-maxnum nnmaildir--cur-server group)
1118 nntp-server-buffer) 1118 nntp-server-buffer)
1119 (insert " " (gnus-replace-in-string gname " " "\\ " t) "\n") 1119 (insert " " (replace-regexp-in-string gname " " "\\ " nil t) "\n")
1120 t)))) 1120 t))))
1121 1121
1122(defun nnmaildir-request-create-group (gname &optional server _args) 1122(defun nnmaildir-request-create-group (gname &optional server _args)
@@ -1278,7 +1278,7 @@ by nnmaildir-request-article.")
1278 (insert "\t" (nnmaildir--nov-get-beg nov) "\t" 1278 (insert "\t" (nnmaildir--nov-get-beg nov) "\t"
1279 (nnmaildir--art-msgid article) "\t" 1279 (nnmaildir--art-msgid article) "\t"
1280 (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir " 1280 (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir "
1281 (gnus-replace-in-string gname " " "\\ " t) ":") 1281 (replace-regexp-in-string gname " " "\\ " nil t) ":")
1282 (princ num nntp-server-buffer) 1282 (princ num nntp-server-buffer)
1283 (insert "\t" (nnmaildir--nov-get-end nov) "\n")))) 1283 (insert "\t" (nnmaildir--nov-get-end nov) "\n"))))
1284 (catch 'return 1284 (catch 'return
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index 3350933f949..28dcd9aad4a 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -1077,7 +1077,7 @@ Use the nov database for the current group if available."
1077 ;; 1/ Move the article to a new file: 1077 ;; 1/ Move the article to a new file:
1078 (let* ((oldfile (nnml-article-to-file old-number)) 1078 (let* ((oldfile (nnml-article-to-file old-number))
1079 (newfile 1079 (newfile
1080 (gnus-replace-in-string 1080 (replace-regexp-in-string
1081 oldfile 1081 oldfile
1082 ;; nnml-use-compressed-files might be any string, but 1082 ;; nnml-use-compressed-files might be any string, but
1083 ;; probably it's sufficient to take into account only 1083 ;; probably it's sufficient to take into account only
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index bef8203ef27..857c58a478e 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -111,7 +111,7 @@ for decoding when the cdr that the data specify is not available.")
111;;; Interface functions 111;;; Interface functions
112 112
113(defsubst nnrss-format-string (string) 113(defsubst nnrss-format-string (string)
114 (gnus-replace-in-string string " *\n *" " ")) 114 (replace-regexp-in-string string " *\n *" " "))
115 115
116(defun nnrss-decode-group-name (group) 116(defun nnrss-decode-group-name (group)
117 (if (and group (mm-coding-system-p 'utf-8)) 117 (if (and group (mm-coding-system-p 'utf-8))
@@ -292,7 +292,7 @@ for decoding when the cdr that the data specify is not available.")
292 (let ((rfc2047-encoding-type 'mime) 292 (let ((rfc2047-encoding-type 'mime)
293 rfc2047-encode-max-chars) 293 rfc2047-encode-max-chars)
294 (rfc2047-encode-string 294 (rfc2047-encode-string
295 (gnus-replace-in-string group "[\t\n ]+" "_"))))) 295 (replace-regexp-in-string group "[\t\n ]+" "_")))))
296 (when nnrss-content-function 296 (when nnrss-content-function
297 (funcall nnrss-content-function e group article)))) 297 (funcall nnrss-content-function e group article))))
298 (cond 298 (cond
@@ -805,8 +805,8 @@ It is useful when `(setq nnrss-use-local t)'."
805 (nnrss-node-just-text node) 805 (nnrss-node-just-text node)
806 node)) 806 node))
807 (cleaned-text (if text 807 (cleaned-text (if text
808 (gnus-replace-in-string 808 (replace-regexp-in-string
809 (gnus-replace-in-string 809 (replace-regexp-in-string
810 text "^[\000-\037\177]+\\|^ +\\| +$" "") 810 text "^[\000-\037\177]+\\|^ +\\| +$" "")
811 "\r\n" "\n")))) 811 "\r\n" "\n"))))
812 (if (string-equal "" cleaned-text) 812 (if (string-equal "" cleaned-text)
diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el
index 0086dd14792..7ebff197b2b 100644
--- a/lisp/gnus/spam-report.el
+++ b/lisp/gnus/spam-report.el
@@ -162,9 +162,9 @@ submitted at once. Internal variable.")
162 rpt-host 162 rpt-host
163 (concat 163 (concat
164 "/" 164 "/"
165 (gnus-replace-in-string 165 (replace-regexp-in-string
166 (gnus-replace-in-string 166 (replace-regexp-in-string
167 (gnus-replace-in-string 167 (replace-regexp-in-string
168 (mail-header-xref (gnus-summary-article-header article)) 168 (mail-header-xref (gnus-summary-article-header article))
169 "/raw" ":silent") 169 "/raw" ":silent")
170 "^.*article.gmane.org/" "") 170 "^.*article.gmane.org/" "")
@@ -207,7 +207,7 @@ submitted at once. Internal variable.")
207 (when host 207 (when host
208 (when (string-equal "permalink.gmane.org" host) 208 (when (string-equal "permalink.gmane.org" host)
209 (setq host rpt-host) 209 (setq host rpt-host)
210 (setq report (gnus-replace-in-string 210 (setq report (replace-regexp-in-string
211 report "/\\([0-9]+\\)$" ":\\1"))) 211 report "/\\([0-9]+\\)$" ":\\1")))
212 (setq url (format "http://%s%s" host report))) 212 (setq url (format "http://%s%s" host report)))
213 (if (not (and host report url)) 213 (if (not (and host report url))
@@ -227,7 +227,7 @@ the function specified by `spam-report-url-ping-function'."
227 227
228(defcustom spam-report-user-mail-address 228(defcustom spam-report-user-mail-address
229 (and (stringp user-mail-address) 229 (and (stringp user-mail-address)
230 (gnus-replace-in-string user-mail-address "@" "<at>")) 230 (replace-regexp-in-string user-mail-address "@" "<at>"))
231 "Mail address of this user used for spam reports to Gmane. 231 "Mail address of this user used for spam reports to Gmane.
232This is initialized based on `user-mail-address'." 232This is initialized based on `user-mail-address'."
233 :type '(choice string 233 :type '(choice string
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index ab0584fdcf6..39181eaa62f 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -1199,7 +1199,7 @@ Note this has to be fast."
1199 (if header-content 1199 (if header-content
1200 (cond 1200 (cond
1201 ((eq header 'X-Spam-Status) 1201 ((eq header 'X-Spam-Status)
1202 (string-to-number (gnus-replace-in-string 1202 (string-to-number (replace-regexp-in-string
1203 header-content 1203 header-content
1204 spam-spamassassin-score-regexp 1204 spam-spamassassin-score-regexp
1205 "\\1"))) 1205 "\\1")))
@@ -1207,8 +1207,8 @@ Note this has to be fast."
1207 ((string-match "( pR: \\([0-9.-]+\\)" header-content) 1207 ((string-match "( pR: \\([0-9.-]+\\)" header-content)
1208 (- (string-to-number (match-string 1 header-content)))) 1208 (- (string-to-number (match-string 1 header-content))))
1209 ((eq header 'X-Bogosity) 1209 ((eq header 'X-Bogosity)
1210 (string-to-number (gnus-replace-in-string 1210 (string-to-number (replace-regexp-in-string
1211 (gnus-replace-in-string 1211 (replace-regexp-in-string
1212 header-content 1212 header-content
1213 ".*spamicity=" "") 1213 ".*spamicity=" "")
1214 ",.*" ""))) 1214 ",.*" "")))