From unknown Sun Jun 22 20:56:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15589: [PATCH] `how-many' throws when called with two arguments. Resent-From: Oleh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Oct 2013 14:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15589 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 15589@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.138150206920627 (code B ref -1); Fri, 11 Oct 2013 14:35:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Oct 2013 14:34:29 +0000 Received: from localhost ([127.0.0.1]:43327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUdnQ-0005Mb-1Q for submit@debbugs.gnu.org; Fri, 11 Oct 2013 10:34:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59241) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUdnN-0005MR-Fq for submit@debbugs.gnu.org; Fri, 11 Oct 2013 10:34:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUdnE-0002Zy-RP for submit@debbugs.gnu.org; Fri, 11 Oct 2013 10:34:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUdnE-0002Zu-PM for submit@debbugs.gnu.org; Fri, 11 Oct 2013 10:34:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUdn6-0006KQ-6z for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2013 10:34:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUdmx-0002Xv-ME for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2013 10:34:08 -0400 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:56189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUdmx-0002Xb-Dc for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2013 10:33:59 -0400 Received: by mail-ea0-f171.google.com with SMTP id n15so1941947ead.16 for ; Fri, 11 Oct 2013 07:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:from:to:subject:date:message-id:mime-version :content-type; bh=ZfPenhdM9vYEM7eRrI571qentFgtBIW4BnnWqyHHT5M=; b=FRO6kJMEUI/LvlMM8qfIluVkq023M9Bcn8GuHBBHl6EnuoGdupJYxGdUENMas2Ir7N VMrK1LG82X9UwP3eoRBxXjkVKzTlPjseeH/PzVg778s+3Pd20xjI+4Wec7ncYeLzNx34 9rLeeOpIjLi6sqObz6yAJdjHz7PUaZ0qLKdqNWoSi95zqvAwK9N95iEF7MRKi2Ym7LPn 2w9wRzZcJgkYeo+JVGosioFV127o8fvHv0p22K2/C266M4T83KP6VvKEkFrCTykbzjp0 LHQaVWq5y3KREjOfyPZNzoIMGFaeintzMwt4duCHdFauW96iftCZvF/zyjW21kAb2ioQ eIhQ== X-Received: by 10.14.1.132 with SMTP id 4mr1935343eed.84.1381502038607; Fri, 11 Oct 2013 07:33:58 -0700 (PDT) Received: from firefly (dyn069213.nbw.tue.nl. [131.155.69.213]) by mx.google.com with ESMTPSA id f49sm115393967eec.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 11 Oct 2013 07:33:56 -0700 (PDT) User-agent: mu4e 0.9.9.5; emacs 24.3.4 From: Oleh Date: Fri, 11 Oct 2013 16:33:29 +0200 Message-ID: <87y55zand2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-replace.el-how-many-rend-argument-defaults-to-point-.patch >From e315068e21519a11b0f28e8d45fb08b5bab35850 Mon Sep 17 00:00:00 2001 From: Oleh Krehel 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 --=-=-= Content-Type: text/plain regards, Oleh --=-=-=-- From unknown Sun Jun 22 20:56:49 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Oleh Subject: bug#15589: closed (Re: bug#15589: [PATCH] `how-many' throws when called with two arguments.) Message-ID: References: <87y55zand2.fsf@gmail.com> X-Gnu-PR-Message: they-closed 15589 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 15589@debbugs.gnu.org Date: Sun, 13 Oct 2013 05:31:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1381642262-3526-1" This is a multi-part message in MIME format... ------------=_1381642262-3526-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #15589: [PATCH] `how-many' throws when called with two arguments. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 15589@debbugs.gnu.org. --=20 15589: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D15589 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1381642262-3526-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 15589-done) by debbugs.gnu.org; 13 Oct 2013 05:30:41 +0000 Received: from localhost ([127.0.0.1]:44991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVEGG-0000uJ-Il for submit@debbugs.gnu.org; Sun, 13 Oct 2013 01:30:40 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:51325 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVEGD-0000uA-Qx for 15589-done@debbugs.gnu.org; Sun, 13 Oct 2013 01:30:38 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1VVEGD-0003S1-2W; Sun, 13 Oct 2013 01:30:37 -0400 From: Glenn Morris To: 15589-done@debbugs.gnu.org Subject: Re: bug#15589: [PATCH] `how-many' throws when called with two arguments. References: <87y55zand2.fsf@gmail.com> X-Spook: CID Firewalls Craig Livingstone AIMSX BATF DES MD5 Medco X-Ran: $]9E%\*H=Yu2d{9'{J^^[ul?1p7iY%y0o-K3(jG}$_q60?G"*fy[#vP#dn-#@Fp}VP]SR+ X-Hue: green X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sun, 13 Oct 2013 01:30:36 -0400 In-Reply-To: <87y55zand2.fsf@gmail.com> (Oleh's message of "Fri, 11 Oct 2013 16:33:29 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.2 (-----) X-Debbugs-Envelope-To: 15589-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) Version: 24.4 Thanks; applied. ------------=_1381642262-3526-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 11 Oct 2013 14:34:29 +0000 Received: from localhost ([127.0.0.1]:43327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUdnQ-0005Mb-1Q for submit@debbugs.gnu.org; Fri, 11 Oct 2013 10:34:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59241) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VUdnN-0005MR-Fq for submit@debbugs.gnu.org; Fri, 11 Oct 2013 10:34:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUdnE-0002Zy-RP for submit@debbugs.gnu.org; Fri, 11 Oct 2013 10:34:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUdnE-0002Zu-PM for submit@debbugs.gnu.org; Fri, 11 Oct 2013 10:34:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUdn6-0006KQ-6z for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2013 10:34:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUdmx-0002Xv-ME for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2013 10:34:08 -0400 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:56189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUdmx-0002Xb-Dc for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2013 10:33:59 -0400 Received: by mail-ea0-f171.google.com with SMTP id n15so1941947ead.16 for ; Fri, 11 Oct 2013 07:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:from:to:subject:date:message-id:mime-version :content-type; bh=ZfPenhdM9vYEM7eRrI571qentFgtBIW4BnnWqyHHT5M=; b=FRO6kJMEUI/LvlMM8qfIluVkq023M9Bcn8GuHBBHl6EnuoGdupJYxGdUENMas2Ir7N VMrK1LG82X9UwP3eoRBxXjkVKzTlPjseeH/PzVg778s+3Pd20xjI+4Wec7ncYeLzNx34 9rLeeOpIjLi6sqObz6yAJdjHz7PUaZ0qLKdqNWoSi95zqvAwK9N95iEF7MRKi2Ym7LPn 2w9wRzZcJgkYeo+JVGosioFV127o8fvHv0p22K2/C266M4T83KP6VvKEkFrCTykbzjp0 LHQaVWq5y3KREjOfyPZNzoIMGFaeintzMwt4duCHdFauW96iftCZvF/zyjW21kAb2ioQ eIhQ== X-Received: by 10.14.1.132 with SMTP id 4mr1935343eed.84.1381502038607; Fri, 11 Oct 2013 07:33:58 -0700 (PDT) Received: from firefly (dyn069213.nbw.tue.nl. [131.155.69.213]) by mx.google.com with ESMTPSA id f49sm115393967eec.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 11 Oct 2013 07:33:56 -0700 (PDT) User-agent: mu4e 0.9.9.5; emacs 24.3.4 From: Oleh To: bug-gnu-emacs@gnu.org Subject: [PATCH] `how-many' throws when called with two arguments. Date: Fri, 11 Oct 2013 16:33:29 +0200 Message-ID: <87y55zand2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-replace.el-how-many-rend-argument-defaults-to-point-.patch >From e315068e21519a11b0f28e8d45fb08b5bab35850 Mon Sep 17 00:00:00 2001 From: Oleh Krehel 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 --=-=-= Content-Type: text/plain regards, Oleh --=-=-=-- ------------=_1381642262-3526-1--