diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2016-02-11 16:13:08 +1100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2016-02-11 16:13:08 +1100 |
commit | 21cfd14d54370cddc1160d30bc47e17c5ac3a162 (patch) | |
tree | 1ed08374d1e42dd89d674a2ef840097ea3d4d905 /lisp/gnus/mailcap.el | |
parent | 16b7e605f32862c592ffd1134079b91e3ee4ef91 (diff) | |
download | emacs-21cfd14d54370cddc1160d30bc47e17c5ac3a162.tar.gz |
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.
Diffstat (limited to 'lisp/gnus/mailcap.el')
-rw-r--r-- | lisp/gnus/mailcap.el | 35 |
1 files changed, 12 insertions, 23 deletions
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 @@ (autoload 'mm-delete-duplicates "mm-util") 'mm-delete-duplicates)) -;; `mailcap-replace-in-string' is an alias like `gnus-replace-in-string'. -(eval-and-compile - (cond - ((fboundp 'replace-regexp-in-string) - (defun mailcap-replace-in-string (string regexp newtext &optional literal) - "Replace all matches for REGEXP with NEWTEXT in STRING. -If LITERAL is non-nil, insert NEWTEXT literally. Return a new -string containing the replacements. -This is a compatibility function for different Emacsen." - (replace-regexp-in-string regexp newtext string nil literal))) - ((fboundp 'replace-in-string) - (defalias 'mailcap-replace-in-string 'replace-in-string)))) - (defgroup mailcap nil "Definition of viewers for MIME types." :version "21.1" @@ -1047,16 +1034,18 @@ If FORCE, re-parse even if already parsed." (commands ;; Command strings from `viewer' field of the MIME info (mailcap-delete-duplicates - (delq nil (mapcar (lambda (mime-info) - (let ((command (cdr (assoc 'viewer mime-info)))) - (if (stringp command) - (mailcap-replace-in-string - ;; Replace mailcap's `%s' placeholder - ;; with dired's `?' placeholder - (mailcap-replace-in-string - ;; Remove the final filename placeholder - command "[ \t\n]*\\('\\)?%s\\1?[ \t\n]*\\'" "" t) - "%s" "?" t)))) + (delq nil (mapcar + (lambda (mime-info) + (let ((command (cdr (assoc 'viewer mime-info)))) + (if (stringp command) + (replace-regexp-in-string + ;; Replace mailcap's `%s' placeholder + ;; with dired's `?' placeholder + (replace-regexp-in-string + ;; Remove the final filename placeholder + command "[ \t\n]*\\('\\)?%s\\1?[ \t\n]*\\'" "" + nil t) + "%s" "?" nil t)))) common-mime-info))))) commands)) |