From fc7f501bc04f23af297fda7b6cb17df493b59397 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Sat, 12 Oct 2013 22:30:23 -0700 Subject: [PATCH] * lisp/replace.el (how-many): Fix rstart and !rend case. Fixes: debbugs:15589 --- lisp/ChangeLog | 4 ++++ lisp/replace.el | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) 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)) -- 2.11.4.GIT