From: Oleh Krehel Date: Sun, 13 Oct 2013 05:30:23 +0000 (-0700) Subject: * lisp/replace.el (how-many): Fix rstart and !rend case. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1284^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fc7f501bc04f23af297fda7b6cb17df493b59397;p=emacs.git * lisp/replace.el (how-many): Fix rstart and !rend case. Fixes: debbugs:15589 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bd2a69c89a8..ec59ce1fb66 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2013-10-13 Oleh Krehel + + * replace.el (how-many): Fix rstart and !rend case. (Bug#15589) + 2013-10-13 Andreas Politz * progmodes/sql.el (sql-add-product): Fix paren typo. (Bug#15435) diff --git a/lisp/replace.el b/lisp/replace.el index abb59a674e3..d92fb6809ef 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -810,9 +810,12 @@ a previously found match." (keep-lines-read-args "How many matches for regexp")) (save-excursion (if rstart - (progn - (goto-char (min rstart rend)) - (setq rend (max rstart rend))) + (if rend + (progn + (goto-char (min rstart rend)) + (setq rend (max rstart rend))) + (goto-char rstart) + (setq rend (point-max))) (if (and interactive transient-mark-mode mark-active) (setq rstart (region-beginning) rend (region-end))