From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#17284: Host name completion in shell mode take 45 seconds Date: Sat, 4 Apr 2015 07:46:40 -0700 (PDT) Message-ID: References: <87a8ypixcn.fsf@yahoo.fr> <4982c9c5-f87b-41f0-8e79-30fb65de6e99@default> <551FA100.2040208@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1428158849 16086 80.91.229.3 (4 Apr 2015 14:47:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Apr 2015 14:47:29 +0000 (UTC) Cc: 17284@debbugs.gnu.org To: martin rudalics , Svend Sorensen , Nicolas Richard Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 04 16:47:15 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YePLs-0007Ca-Mq for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Apr 2015 16:47:12 +0200 Original-Received: from localhost ([::1]:33311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YePLs-0008UI-5a for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Apr 2015 10:47:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YePLn-0008Rp-TJ for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 10:47:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YePLi-0000VE-G7 for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 10:47:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YePLi-0000UU-DE for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 10:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YePLh-00063S-UU for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 10:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Apr 2015 14:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17284 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17284-submit@debbugs.gnu.org id=B17284.142815881123255 (code B ref 17284); Sat, 04 Apr 2015 14:47:01 +0000 Original-Received: (at 17284) by debbugs.gnu.org; 4 Apr 2015 14:46:51 +0000 Original-Received: from localhost ([127.0.0.1]:44831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YePLX-000631-EJ for submit@debbugs.gnu.org; Sat, 04 Apr 2015 10:46:51 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:41147) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YePLV-00062o-Pb for 17284@debbugs.gnu.org; Sat, 04 Apr 2015 10:46:50 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t34EkdAr015949 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 4 Apr 2015 14:46:40 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t34EkdCc021275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 4 Apr 2015 14:46:39 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t34EkdCB021149; Sat, 4 Apr 2015 14:46:39 GMT In-Reply-To: <551FA100.2040208@gmx.at> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101185 Archived-At: > (defun string-before-p (string) > "Return t if string before `point' equals STRING." > (let ((start (- (point) (length string)))) > (and (>=3D start (point-min)) > =09 (string-equal > =09 (buffer-substring-no-properties start (point)) > =09 string)))) `buffer-substring-no-properties' is defined in C. I can't tell whether this is more efficient because of that or less efficient because it creates a potentially giant string before starting to compare. I was trying to compare starting from the far end, thinking that that might lead to earlier failure detection. But I'll take your word for it that this is probably better. (I guess if we were really worried about the long-string case we could do what Isearch does, for the comparison.) I didn't mention this before, because my implementation of `chars-before' uses `char-before'. But with such a function, if it is defined without using `char-before' then the latter function could be eliminated: (chars-before "a") instead of (char-before ?a). > And for simpler cases giving `char-before' a second argument > to specify the position of the character before `point' might help too. Yes. (And that could apply as well to `chars-before', aka `string-before-p' - optionally specify the start or end position.) > But many occurrences of `looking-back' in the code base are inherently > tied to regexps specified via defcustoms or passed as arguments and it > doesn't seem easy to get rid of them. Hence we should probably add a > TODO item to fix all occurrences of `looking-back' either via the LIMIT > argument, by string or character comparison. An appetizing formulation > of such an item would be very welcome. Yes. And I think you just formulated it, appetizingly enough. ;-)