From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#25243: 26.0.50; ffap-guesser very slow w/ region active in large diff files Date: Thu, 22 Dec 2016 09:22:38 -0800 (PST) Message-ID: References: <87k2at2t28.fsf@gmail.com> <36cb0896-f437-41f6-92d1-1f8897ff141d@default> <87vauclh42.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1482427400 22695 195.159.176.226 (22 Dec 2016 17:23:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 22 Dec 2016 17:23:20 +0000 (UTC) Cc: 25243@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 22 18:23:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cK75A-0004Oq-2F for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Dec 2016 18:23:08 +0100 Original-Received: from localhost ([::1]:35392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cK75E-0008Sq-E9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Dec 2016 12:23:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cK758-0008SY-OV for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2016 12:23:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cK754-00072s-RZ for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2016 12:23:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36403) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cK754-00072o-OR for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2016 12:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cK754-0001pJ-Ig for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2016 12:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2016 17:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25243 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 25243-submit@debbugs.gnu.org id=B25243.14824273706987 (code B ref 25243); Thu, 22 Dec 2016 17:23:02 +0000 Original-Received: (at 25243) by debbugs.gnu.org; 22 Dec 2016 17:22:50 +0000 Original-Received: from localhost ([127.0.0.1]:51802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cK74s-0001oc-It for submit@debbugs.gnu.org; Thu, 22 Dec 2016 12:22:50 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:43664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cK74q-0001oO-12 for 25243@debbugs.gnu.org; Thu, 22 Dec 2016 12:22:48 -0500 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uBMHMe7v026254 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 22 Dec 2016 17:22:41 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id uBMHMejc029546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 22 Dec 2016 17:22:40 GMT Original-Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uBMHMeWw016274; Thu, 22 Dec 2016 17:22:40 GMT In-Reply-To: <87vauclh42.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:127331 Archived-At: Thanks for working on this, Tino. Some minor comments below. > +(defvar ffap-max-region-length 1024 > + "Maximum allowed region length in `ffap-string-at-point'.") 1. I think it should say "active region". Very minor (can be ignored): If we say something is not allowed it is unclear what happens. In particular, it can suggest that we raise an error. You might want to say here that if the active region is larger ... it is considered empty. (Or just refer to `ffap-string-at-point', which you do already.)=20 > + (region-len (- (max beg end) (min beg end)))) > + (if (or (null ffap-max-region-length) > + (< region-len ffap-max-region-length)) ; Bug#25243. > + (setf ffap-string-at-point-region (list beg end) > + ffap-string-at-point > + (buffer-substring-no-properties beg end)) > + (setf ffap-string-at-point-region (list 1 1) > + ffap-string-at-point "")))) 1. The doc string should say that if the active region is larger than `ffap-max-region-length' then those two vars are set to ... and .... 2. Instead of testing whether the max-length var is nil, I'd suggest testing it with `natnump', to take care of the unexpected case where it might get assigned a non-number.