From: Oleh <oleh.krehel@gmail.com>
To: 15589@debbugs.gnu.org
Subject: bug#15589: [PATCH] `how-many' throws when called with two arguments.
Date: Fri, 11 Oct 2013 16:33:29 +0200 [thread overview]
Message-ID: <87y55zand2.fsf@gmail.com> (raw)
[-- 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
next reply other threads:[~2013-10-11 14:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 14:33 Oleh [this message]
2013-10-13 5:30 ` bug#15589: [PATCH] `how-many' throws when called with two arguments Glenn Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y55zand2.fsf@gmail.com \
--to=oleh.krehel@gmail.com \
--cc=15589@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.