* bug#15589: [PATCH] `how-many' throws when called with two arguments.
@ 2013-10-11 14:33 Oleh
2013-10-13 5:30 ` Glenn Morris
0 siblings, 1 reply; 2+ messages in thread
From: Oleh @ 2013-10-11 14:33 UTC (permalink / raw)
To: 15589
[-- Attachment #1: Type: text/plain, Size: 181 bytes --]
Hi,
It's strange that it throws, since there's a sane default for `rend'
which is (point-max). It's currently used when neither `rstart' or
`rend' are provided.
I attach a patch.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-replace.el-how-many-rend-argument-defaults-to-point-.patch --]
[-- Type: text/x-diff, Size: 973 bytes --]
From e315068e21519a11b0f28e8d45fb08b5bab35850 Mon Sep 17 00:00:00 2001
From: Oleh Krehel <ohwoeowho@gmail.com>
Date: Fri, 11 Oct 2013 16:27:20 +0200
Subject: [PATCH] * replace.el (how-many): rend argument defaults to
(point-max) if not provided.
---
replace.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/replace.el b/replace.el
index abb59a6..d92fb68 100644
--- a/replace.el
+++ b/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))
--
1.8.4
[-- Attachment #3: Type: text/plain, Size: 15 bytes --]
regards,
Oleh
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#15589: [PATCH] `how-many' throws when called with two arguments.
2013-10-11 14:33 bug#15589: [PATCH] `how-many' throws when called with two arguments Oleh
@ 2013-10-13 5:30 ` Glenn Morris
0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2013-10-13 5:30 UTC (permalink / raw)
To: 15589-done
Version: 24.4
Thanks; applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-13 5:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-11 14:33 bug#15589: [PATCH] `how-many' throws when called with two arguments Oleh
2013-10-13 5:30 ` Glenn Morris
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).