summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorOleh Krehel <ohwoeowho@gmail.com>2013-10-12 22:30:23 -0700
committerGlenn Morris <rgm@gnu.org>2013-10-12 22:30:23 -0700
commitfc7f501bc04f23af297fda7b6cb17df493b59397 (patch)
tree86fb5b87de23c132ac3a014a766e0562aede030b /lisp
parentfdcb2049f193c889c36e67cd5c230286660d113a (diff)
downloademacs-fc7f501bc04f23af297fda7b6cb17df493b59397.tar.gz
* lisp/replace.el (how-many): Fix rstart and !rend case.
Fixes: debbugs:15589
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/replace.el9
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 <ohwoeowho@gmail.com>
+
+ * replace.el (how-many): Fix rstart and !rend case. (Bug#15589)
+
2013-10-13 Andreas Politz <politza@hochschule-trier.de>
* 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))