[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 59fb9ce03f 06/26: Use string-replace instead of
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 59fb9ce03f 06/26: Use string-replace instead of replace-regexp-in-string |
Date: |
Fri, 22 Apr 2022 18:58:13 -0400 (EDT) |
branch: elpa/git-commit
commit 59fb9ce03fe364e29ab5057cd93c96bff601dedc
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Use string-replace instead of replace-regexp-in-string
---
lisp/magit-base.el | 7 ++++---
lisp/magit-bookmark.el | 7 +++----
lisp/magit-extras.el | 4 ++--
lisp/magit-git.el | 8 ++++----
lisp/magit-log.el | 2 +-
lisp/magit-push.el | 4 ++--
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index 91a3aede48..a9866f5b84 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -844,8 +844,9 @@ ACTION is a member of option `magit-slow-confirm'."
(defun magit-confirm-make-prompt (action)
(let ((prompt (symbol-name action)))
- (replace-regexp-in-string
- "-" " " (concat (upcase (substring prompt 0 1)) (substring prompt 1)))))
+ (string-replace "-" " "
+ (concat (upcase (substring prompt 0 1))
+ (substring prompt 1)))))
(defun magit-read-number-string (prompt &optional default _history)
"Like `read-number' but return value is a string.
@@ -1187,7 +1188,7 @@ or (last of all) the value of EXP."
(defun org-man-export--magit-gitman (fn link description format)
(if (and (eq format 'texinfo)
(string-prefix-p "git" link))
- (replace-regexp-in-string "%s" link "
+ (string-replace "%s" link "
@ifinfo
@ref{%s,,,gitman,}.
@end ifinfo
diff --git a/lisp/magit-bookmark.el b/lisp/magit-bookmark.el
index a803aeeae5..0d958178f1 100644
--- a/lisp/magit-bookmark.el
+++ b/lisp/magit-bookmark.el
@@ -58,10 +58,9 @@ and the buffer-local values of the variables referenced in
its
(--keep (and (oref it hidden)
(cons (oref it type)
(if (derived-mode-p 'magit-stash-mode)
- (replace-regexp-in-string
- (regexp-quote magit-buffer-revision)
- magit-buffer-revision-hash
- (oref it value))
+ (string-replace magit-buffer-revision
+ magit-buffer-revision-hash
+ (oref it value))
(oref it value))))
(oref magit-root-section children)))
bookmark)
diff --git a/lisp/magit-extras.el b/lisp/magit-extras.el
index 5cb052f22c..2d4e186cda 100644
--- a/lisp/magit-extras.el
+++ b/lisp/magit-extras.el
@@ -722,13 +722,13 @@ the minibuffer too."
(when pnt-format
(when idx-format
(setq pnt-format
- (replace-regexp-in-string "%N" idx pnt-format t t)))
+ (string-replace "%N" idx pnt-format)))
(magit-rev-insert-format pnt-format rev pnt-args)
(backward-delete-char 1))
(when eob-format
(when idx-format
(setq eob-format
- (replace-regexp-in-string "%N" idx eob-format t t)))
+ (string-replace "%N" idx eob-format)))
(save-excursion
(goto-char (point-max))
(skip-syntax-backward ">s-")
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 842dc6ea66..b785691028 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1747,10 +1747,10 @@ the name of a remote and REF is the ref local to the
remote."
(src (match-string 2 line))
(dst (match-string 3 line)))
(and (string-match (format "\\`%s\\'"
- (replace-regexp-in-string
- "*" "\\(.+\\)" dst t t))
+ (string-replace
+ "*" "\\(.+\\)" dst))
ref)
- (cons rmt (replace-regexp-in-string
+ (cons rmt (string-replace
"*" (match-string 1 ref) src))))))
(magit-git-lines "config" "--local" "--list")))))
@@ -2162,7 +2162,7 @@ and this option only controls what face is used.")
((string-match re it) (concat "refs/remotes/"
it))
(t (concat "refs/" it)))
(split-string
- (replace-regexp-in-string "tag: " "refs/tags/"
string)
+ (string-replace "tag: " "refs/tags/" string)
regexp t))))
(setq names (split-string string regexp t)))
(let (state head upstream tags branches remotes other combined)
diff --git a/lisp/magit-log.el b/lisp/magit-log.el
index 39c3faf9d0..afd980b4d6 100644
--- a/lisp/magit-log.el
+++ b/lisp/magit-log.el
@@ -782,7 +782,7 @@ restrict the log to the lines that the region touches."
(magit-log-setup-buffer
(list rev)
(cons (format "-L:%s%s:%s"
- (replace-regexp-in-string ":" "\\:" (regexp-quote fn) nil t)
+ (string-replace ":" "\\:" (regexp-quote fn))
(if (derived-mode-p 'lisp-mode 'emacs-lisp-mode)
;; Git doesn't treat "-" the same way as
;; "_", leading to false-positives such as
diff --git a/lisp/magit-push.el b/lisp/magit-push.el
index 89e3dc25b4..a0ab43ccef 100644
--- a/lisp/magit-push.el
+++ b/lisp/magit-push.el
@@ -90,7 +90,7 @@ argument the push-remote can be changed before pushed to it."
(magit--select-push-remote "push there")))
(when changed
(magit-confirm 'set-and-push
- (replace-regexp-in-string
+ (string-replace
"%" "%%"
(format "Really use \"%s\" as push-remote and push \"%s\" there"
remote branch))))
@@ -152,7 +152,7 @@ the upstream."
;; is what the user wants to happen.
(setq merge (concat "refs/heads/" merge)))
(magit-confirm 'set-and-push
- (replace-regexp-in-string
+ (string-replace
"%" "%%"
(format "Really use \"%s\" as upstream and push \"%s\" there"
upstream branch))))
- [nongnu] elpa/git-commit 571b4346c1 05/26: Depend on the compat package from GNU Elpa, (continued)
- [nongnu] elpa/git-commit 571b4346c1 05/26: Depend on the compat package from GNU Elpa, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit e766c891fe 03/26: Limit a workaround to the Emacs versions that need it, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 6cd8bcaf18 01/26: Use string-prefix-p and string-suffix-p, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 485b265dd3 02/26: magit-generate-changelog: Minor error message tweak, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 7671e46a8b 07/26: Use string-search instead of string-match-p, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 1553a4fa36 11/26: Use and-let* for side-effects, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 4bcb303154 12/26: Use and-let* for side-effects even more, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 9ce3859dd2 13/26: Use when-let* for multiple bindings, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 5f23a34a5f 19/26: Use compat-dired-marked-files, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 4d1d00e6fa 20/26: Fix finding remote executables, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 59fb9ce03f 06/26: Use string-replace instead of replace-regexp-in-string,
ELPA Syncer <=
- [nongnu] elpa/git-commit bba16d4f3e 08/26: Use string-search instead of string-match, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit a20dc0b83e 09/26: Use string-trim, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 264e92436c 10/26: Use xor, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit b4b2098c91 15/26: Use with-environment-variables, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit b280fd7625 17/26: Use compat-assoc-delete-all, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit b0ababbde4 18/26: Use compat-alist-get, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit d69f062a8a 23/26: Refresh library headers, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 77cc75ed90 16/26: Use image-property, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 40fb3d2002 26/26: make: Improve creation of autoloads file, ELPA Syncer, 2022/04/22
- [nongnu] elpa/git-commit 8842230bca 14/26: Use length= and length>, ELPA Syncer, 2022/04/22