branch: elpa/git-commit commit 59fb9ce03fe364e29ab5057cd93c96bff601dedc Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@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))))