comparison lisp/replace.el @ 16129:f6c51da4c4e3

(perform-replace): Increment replace-count in the places where we do the replacement.
author Richard M. Stallman <rms@gnu.org>
date Wed, 04 Sep 1996 17:13:24 +0000
parents 90dc960355d9
children 024d3847af99
comparison
equal deleted inserted replaced
16128:7af77f490166 16129:f6c51da4c4e3
624 (message "No previous match") 624 (message "No previous match")
625 (ding 'no-terminate) 625 (ding 'no-terminate)
626 (sit-for 1))) 626 (sit-for 1)))
627 ((eq def 'act) 627 ((eq def 'act)
628 (or replaced 628 (or replaced
629 (replace-match next-replacement nocasify literal)) 629 (progn
630 (replace-match next-replacement nocasify literal)
631 (setq replace-count (1+ replace-count))))
630 (setq done t replaced t)) 632 (setq done t replaced t))
631 ((eq def 'act-and-exit) 633 ((eq def 'act-and-exit)
632 (or replaced 634 (or replaced
633 (replace-match next-replacement nocasify literal)) 635 (progn
636 (replace-match next-replacement nocasify literal)
637 (setq replace-count (1+ replace-count))))
634 (setq keep-going nil) 638 (setq keep-going nil)
635 (setq done t replaced t)) 639 (setq done t replaced t))
636 ((eq def 'act-and-show) 640 ((eq def 'act-and-show)
637 (if (not replaced) 641 (if (not replaced)
638 (progn 642 (progn
639 (replace-match next-replacement nocasify literal) 643 (replace-match next-replacement nocasify literal)
644 (setq replace-count (1+ replace-count))
640 (setq replaced t)))) 645 (setq replaced t))))
641 ((eq def 'automatic) 646 ((eq def 'automatic)
642 (or replaced 647 (or replaced
643 (replace-match next-replacement nocasify literal)) 648 (progn
649 (replace-match next-replacement nocasify literal)
650 (setq replace-count (1+ replace-count))))
644 (setq done t query-flag nil replaced t)) 651 (setq done t query-flag nil replaced t))
645 ((eq def 'skip) 652 ((eq def 'skip)
646 (setq done t)) 653 (setq done t))
647 ((eq def 'recenter) 654 ((eq def 'recenter)
648 (recenter nil)) 655 (recenter nil))
680 (mapcar (lambda (elt) 687 (mapcar (lambda (elt)
681 (and elt 688 (and elt
682 (prog1 (marker-position elt) 689 (prog1 (marker-position elt)
683 (set-marker elt nil)))) 690 (set-marker elt nil))))
684 (match-data)))) 691 (match-data))))
685 stack)) 692 stack))))
686 (if replaced (setq replace-count (1+ replace-count)))))
687 (setq lastrepl (point))) 693 (setq lastrepl (point)))
688 (replace-dehighlight)) 694 (replace-dehighlight))
689 (or unread-command-events 695 (or unread-command-events
690 (message "Replaced %d occurrence%s" 696 (message "Replaced %d occurrence%s"
691 replace-count 697 replace-count