diff options
author | Juri Linkov <juri@linkov.net> | 2019-07-12 22:00:56 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2019-07-12 22:00:56 +0300 |
commit | 38e420af451c61dd0e77c7d73adf6fd1f6a021a9 (patch) | |
tree | 0058c2428c36e942ccb3d5241178f9147e716c8c | |
parent | 391e8e530a6a271810f96ee7aa2d544b8c01d597 (diff) | |
download | emacs-38e420af451c61dd0e77c7d73adf6fd1f6a021a9.tar.gz emacs-38e420af451c61dd0e77c7d73adf6fd1f6a021a9.tar.bz2 emacs-38e420af451c61dd0e77c7d73adf6fd1f6a021a9.zip |
* test/lisp/replace-tests.el (replace-tests-with-undo): Override
replace-highlight to emulate clobbering match-data (bug#36328).
-rw-r--r-- | test/lisp/replace-tests.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el index ed948ad8554..c908d4e2a71 100644 --- a/test/lisp/replace-tests.el +++ b/test/lisp/replace-tests.el @@ -441,7 +441,7 @@ Return the last evalled form in BODY." ;; If `replace-tests-bind-read-string' is non-nil, then ;; bind `read-string' as well. (cl-letf (((symbol-function 'read-event) - (lambda (&rest args) + (lambda (&rest _args) (cl-incf ,count) (pcase ,count ; Build the clauses from CHAR-NUMS ,@(append @@ -456,8 +456,13 @@ Return the last evalled form in BODY." `((_ ,def-chr)))))) ((symbol-function 'read-string) (if replace-tests-bind-read-string - (lambda (&rest args) replace-tests-bind-read-string) - (symbol-function 'read-string)))) + (lambda (&rest _args) replace-tests-bind-read-string) + (symbol-function 'read-string))) + ;; Emulate replace-highlight clobbering match-data via + ;; isearch-lazy-highlight-new-loop and sit-for (bug#36328) + ((symbol-function 'replace-highlight) + (lambda (&rest _args) + (string-match "[A-Z ]" "ForestGreen")))) (perform-replace ,from ,to t t nil)) ,@body)))) |