comparison lisp/replace.el @ 7258:68c7b93914fe

(perform-replace): Call substitute-command-keys just once and only if querying.
author Richard M. Stallman <rms@gnu.org>
date Sun, 01 May 1994 22:56:54 +0000
parents dd74576b79f6
children 341906b946dd
comparison
equal deleted inserted replaced
7257:3759ad84023b 7258:68c7b93914fe
465 (keep-going t) 465 (keep-going t)
466 (stack nil) 466 (stack nil)
467 (next-rotate-count 0) 467 (next-rotate-count 0)
468 (replace-count 0) 468 (replace-count 0)
469 (lastrepl nil) ;Position after last match considered. 469 (lastrepl nil) ;Position after last match considered.
470 (match-again t)) 470 (match-again t)
471 (message
472 (if query-flag
473 (substitute-command-keys
474 "Query replacing %s with %s: (\\<query-replace-map>\\[help] for help) "))))
471 (if (stringp replacements) 475 (if (stringp replacements)
472 (setq next-replacement replacements) 476 (setq next-replacement replacements)
473 (or repeat-count (setq repeat-count 1))) 477 (or repeat-count (setq repeat-count 1)))
474 (if delimited-flag 478 (if delimited-flag
475 (setq search-function 're-search-forward 479 (setq search-function 're-search-forward
523 (let (done replaced key def) 527 (let (done replaced key def)
524 ;; Loop reading commands until one of them sets done, 528 ;; Loop reading commands until one of them sets done,
525 ;; which means it has finished handling this occurrence. 529 ;; which means it has finished handling this occurrence.
526 (while (not done) 530 (while (not done)
527 (replace-highlight (match-beginning 0) (match-end 0)) 531 (replace-highlight (match-beginning 0) (match-end 0))
528 (message (substitute-command-keys 532 (message message from-string next-replacement)
529 "Query replacing %s with %s: (\\<query-replace-map>\\[help] for help) ")
530 from-string next-replacement)
531 (setq key (read-event)) 533 (setq key (read-event))
532 (setq key (vector key)) 534 (setq key (vector key))
533 (setq def (lookup-key map key)) 535 (setq def (lookup-key map key))
534 ;; Restore the match data while we process the command. 536 ;; Restore the match data while we process the command.
535 (store-match-data real-match-data) 537 (store-match-data real-match-data)