summaryrefslogtreecommitdiff
path: root/lisp/transient.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2021-10-25 20:16:54 +0200
committerJonas Bernoulli <jonas@bernoul.li>2021-10-25 20:18:05 +0200
commit40400e69771eb955c80d64092256bd65466a7b14 (patch)
tree3611751c48ca88887406a7181f5570731d5b48ba /lisp/transient.el
parent214c2e268c8422a13c463a1d45be9fb2fe63d0fe (diff)
downloademacs-40400e69771eb955c80d64092256bd65466a7b14.tar.gz
; Revert parts of "Use string-replace instead of replace-regexp-in-string"
"transient.el" is also distributed as a separate package, which supports Emacs versions as old as 25.1 (see "Package-Requires").
Diffstat (limited to 'lisp/transient.el')
-rw-r--r--lisp/transient.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/transient.el b/lisp/transient.el
index 2adb4c573ee..c1b82377f68 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -3064,18 +3064,18 @@ Optional support for popup buttons is also implemented here."
((equal (seq-take seq len) transient--redisplay-key)
(let ((pre (key-description (vconcat (seq-take seq len))))
(suf (key-description (vconcat (seq-drop seq len)))))
- (setq pre (string-replace "RET" "C-m" pre))
- (setq pre (string-replace "TAB" "C-i" pre))
- (setq suf (string-replace "RET" "C-m" suf))
- (setq suf (string-replace "TAB" "C-i" suf))
+ (setq pre (replace-regexp-in-string "RET" "C-m" pre t))
+ (setq pre (replace-regexp-in-string "TAB" "C-i" pre t))
+ (setq suf (replace-regexp-in-string "RET" "C-m" suf t))
+ (setq suf (replace-regexp-in-string "TAB" "C-i" suf t))
;; We use e.g. "-k" instead of the more correct "- k",
;; because the former is prettier. If we did that in
;; the definition, then we want to drop the space that
;; is reinserted above. False-positives are possible
;; for silly bindings like "-C-c C-c".
(unless (string-match-p " " key)
- (setq pre (string-replace " " "" pre))
- (setq suf (string-replace " " "" suf)))
+ (setq pre (replace-regexp-in-string " " "" pre))
+ (setq suf (replace-regexp-in-string " " "" suf)))
(concat (propertize pre 'face 'default)
(and (string-prefix-p (concat pre " ") key) " ")
(transient--colorize-key suf cmd)