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: Fri, 23 Dec 2016 07:41:02 -0800 (PST) Message-ID: References: <87k2at2t28.fsf@gmail.com> <36cb0896-f437-41f6-92d1-1f8897ff141d@default> <87vauclh42.fsf@gmail.com> <871swzjeza.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 1482507734 29455 195.159.176.226 (23 Dec 2016 15:42:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Dec 2016 15:42:14 +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 Fri Dec 23 16:42:09 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 1cKRyy-00072L-5i for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 16:42:08 +0100 Original-Received: from localhost ([::1]:39678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKRz2-0001XG-S6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 10:42:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKRyx-0001WF-5L for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 10:42:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKRys-0002zr-9a for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 10:42:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37440) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cKRys-0002zj-5W for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 10:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cKRyr-0001gz-Ss for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 10:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2016 15:42:01 +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.14825076756438 (code B ref 25243); Fri, 23 Dec 2016 15:42:01 +0000 Original-Received: (at 25243) by debbugs.gnu.org; 23 Dec 2016 15:41:15 +0000 Original-Received: from localhost ([127.0.0.1]:52839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKRy7-0001fm-3q for submit@debbugs.gnu.org; Fri, 23 Dec 2016 10:41:15 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:51491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKRy5-0001fY-LC for 25243@debbugs.gnu.org; Fri, 23 Dec 2016 10:41:14 -0500 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uBNFf76j024900 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Dec 2016 15:41:07 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uBNFf6Cg006176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Dec 2016 15:41:07 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uBNFf5iP010921; Fri, 23 Dec 2016 15:41:05 GMT In-Reply-To: <871swzjeza.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: aserv0022.oracle.com [141.146.126.234] 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:127371 Archived-At: below > > 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. > Yes, `natnump' is a better choice. > + (if (or (not (natnump 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 "")))) I'd suggest the other way around. What you have lets someone or some code assign a non-number and get the same slow behavior we want to avoid. I'd say (and (natnump ...) (< region-len ...)). IOW, if it's not a natnump and the size is not smaller than that number then don't use the region. The rest sounds good to me.