Commit ef4aaf5f authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(perform-replace): store-match-data => set-match-data.

parent 25c80f5c
...@@ -769,7 +769,7 @@ which will run faster and probably do exactly what you want." ...@@ -769,7 +769,7 @@ which will run faster and probably do exactly what you want."
(setq replacement-index (% (1+ replacement-index) (length replacements))))) (setq replacement-index (% (1+ replacement-index) (length replacements)))))
(if (not query-flag) (if (not query-flag)
(progn (progn
(store-match-data real-match-data) (set-match-data real-match-data)
(replace-match next-replacement nocasify literal) (replace-match next-replacement nocasify literal)
(setq replace-count (1+ replace-count))) (setq replace-count (1+ replace-count)))
(undo-boundary) (undo-boundary)
...@@ -777,7 +777,7 @@ which will run faster and probably do exactly what you want." ...@@ -777,7 +777,7 @@ which will run faster and probably do exactly what you want."
;; Loop reading commands until one of them sets done, ;; Loop reading commands until one of them sets done,
;; which means it has finished handling this occurrence. ;; which means it has finished handling this occurrence.
(while (not done) (while (not done)
(store-match-data real-match-data) (set-match-data real-match-data)
(replace-highlight (match-beginning 0) (match-end 0)) (replace-highlight (match-beginning 0) (match-end 0))
;; Bind message-log-max so we don't fill up the message log ;; Bind message-log-max so we don't fill up the message log
;; with a bunch of identical messages. ;; with a bunch of identical messages.
...@@ -786,7 +786,7 @@ which will run faster and probably do exactly what you want." ...@@ -786,7 +786,7 @@ which will run faster and probably do exactly what you want."
(setq key (read-event)) (setq key (read-event))
;; Necessary in case something happens during read-event ;; Necessary in case something happens during read-event
;; that clobbers the match data. ;; that clobbers the match data.
(store-match-data real-match-data) (set-match-data real-match-data)
(setq key (vector key)) (setq key (vector key))
(setq def (lookup-key map key)) (setq def (lookup-key map key))
;; Restore the match data while we process the command. ;; Restore the match data while we process the command.
...@@ -811,7 +811,7 @@ which will run faster and probably do exactly what you want." ...@@ -811,7 +811,7 @@ which will run faster and probably do exactly what you want."
(goto-char (car elt)) (goto-char (car elt))
(setq replaced (eq t (cdr elt))) (setq replaced (eq t (cdr elt)))
(or replaced (or replaced
(store-match-data (cdr elt))) (set-match-data (cdr elt)))
(setq stack (cdr stack))) (setq stack (cdr stack)))
(message "No previous match") (message "No previous match")
(ding 'no-terminate) (ding 'no-terminate)
...@@ -846,7 +846,7 @@ which will run faster and probably do exactly what you want." ...@@ -846,7 +846,7 @@ which will run faster and probably do exactly what you want."
((eq def 'recenter) ((eq def 'recenter)
(recenter nil)) (recenter nil))
((eq def 'edit) ((eq def 'edit)
(store-match-data (set-match-data
(prog1 (match-data) (prog1 (match-data)
(save-excursion (recursive-edit)))) (save-excursion (recursive-edit))))
;; Before we make the replacement, ;; Before we make the replacement,
...@@ -857,7 +857,7 @@ which will run faster and probably do exactly what you want." ...@@ -857,7 +857,7 @@ which will run faster and probably do exactly what you want."
(match-data))))) (match-data)))))
((eq def 'delete-and-edit) ((eq def 'delete-and-edit)
(delete-region (match-beginning 0) (match-end 0)) (delete-region (match-beginning 0) (match-end 0))
(store-match-data (set-match-data
(prog1 (match-data) (prog1 (match-data)
(save-excursion (recursive-edit)))) (save-excursion (recursive-edit))))
(setq replaced t)) (setq replaced t))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment