GNU bug report logs - #15589
[PATCH] `how-many' throws when called with two arguments.

Previous Next

Package: emacs;

Reported by: Oleh <oleh.krehel <at> gmail.com>

Date: Fri, 11 Oct 2013 14:35:01 UTC

Severity: normal

Tags: patch

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15589 in the body.
You can then email your comments to 15589 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15589; Package emacs. (Fri, 11 Oct 2013 14:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleh <oleh.krehel <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 11 Oct 2013 14:35:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Oleh <oleh.krehel <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] `how-many' throws when called with two arguments.
Date: Fri, 11 Oct 2013 16:33:29 +0200
[Message part 1 (text/plain, inline)]
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.
[0001-replace.el-how-many-rend-argument-defaults-to-point-.patch (text/x-diff, inline)]
From e315068e21519a11b0f28e8d45fb08b5bab35850 Mon Sep 17 00:00:00 2001
From: Oleh Krehel <ohwoeowho <at> 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

[Message part 3 (text/plain, inline)]
regards,
Oleh

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sun, 13 Oct 2013 05:31:01 GMT) Full text and rfc822 format available.

Notification sent to Oleh <oleh.krehel <at> gmail.com>:
bug acknowledged by developer. (Sun, 13 Oct 2013 05:31:02 GMT) Full text and rfc822 format available.

Message #10 received at 15589-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 15589-done <at> debbugs.gnu.org
Subject: Re: bug#15589: [PATCH] `how-many' throws when called with two
 arguments.
Date: Sun, 13 Oct 2013 01:30:36 -0400
Version: 24.4

Thanks; applied.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 10 Nov 2013 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.