From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.bugs Subject: bug#17284: Host name completion in shell mode take 45 seconds Date: Fri, 03 Apr 2015 12:36:20 +0200 Message-ID: <551E6D24.4020408@yahoo.fr> References: <87a8ypixcn.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1428057381 13531 80.91.229.3 (3 Apr 2015 10:36:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Apr 2015 10:36:21 +0000 (UTC) Cc: 17284@debbugs.gnu.org To: Svend Sorensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 03 12:36: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 1YdyxQ-0007Se-Gn for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Apr 2015 12:36:12 +0200 Original-Received: from localhost ([::1]:33461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdyxP-0003hs-VB for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Apr 2015 06:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdyxM-0003eI-7N for bug-gnu-emacs@gnu.org; Fri, 03 Apr 2015 06:36:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YdyxG-0007wT-19 for bug-gnu-emacs@gnu.org; Fri, 03 Apr 2015 06:36:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdyxF-0007wP-Tu for bug-gnu-emacs@gnu.org; Fri, 03 Apr 2015 06:36:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YdyxF-0002oI-N8 for bug-gnu-emacs@gnu.org; Fri, 03 Apr 2015 06:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Richard Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Apr 2015 10:36: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.142805731210742 (code B ref 17284); Fri, 03 Apr 2015 10:36:01 +0000 Original-Received: (at 17284) by debbugs.gnu.org; 3 Apr 2015 10:35:12 +0000 Original-Received: from localhost ([127.0.0.1]:43748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YdywS-0002nC-Ar for submit@debbugs.gnu.org; Fri, 03 Apr 2015 06:35:12 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:21026) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YdywQ-0002n1-2g for 17284@debbugs.gnu.org; Fri, 03 Apr 2015 06:35:10 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8BACdsHlWkD4Xx/2dsb2JhbAANTxqEH4MVrycBAQEBAQEGmSUCgXcBAQEBAQGFHQEBBCMPAUUBEAsYAgIFFgsCAgkDAgECAUUGDQEFAgEBiBYBA7NWcIFrkCkBhgkBAQEBAQEBAQEBAQEBAQEBAQEagSGEboIzgmeCR4FNZQeCaIFFAQSFEAqJQYpIgUeHAocahi+EE22BAoFBAQEB Original-Received: from mathsrv4.ulb.ac.be (HELO [172.19.79.241]) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 03 Apr 2015 12:35:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: X-TagToolbar-Keys: D20150403123620720 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:101150 Archived-At: Le 03/04/2015 11:09, Svend Sorensen a écrit : > On Thu, Apr 2, 2015 at 10:39 PM, Nicolas Richard > wrote: >> >> Does it help to replace (looking-back ",") by (eq ?, (char-before)) ? > > The function runs quickly with that change. Thanks. I'm still not confident enough to push my commits without approval from actual devs so here's what I suggest: Commit fd89dbb0e9658874f71a75f0b84ce2f1a3021252 References: yf/bug-17284 Author: Nicolas Richard AuthorDate: Fri Apr 3 12:28:40 2015 +0200 Commit: Nicolas Richard CommitDate: Fri Apr 3 12:33:42 2015 +0200 pcmpl-ssh-known-hosts: Use `char-before' instead of `looking-back'. Fixes: debbugs:17284 * lisp/pcmpl-unix.el (pcmpl-ssh-known-hosts): Use `char-before' instead of `looking-back'. 1 parent commit, 2 merged branches, 1 containing branch Parent | 0b914ba ; Tweak the previous change Merged | emacs-24 yf/bug-17284 Containing | yf/bug-17284 Follows | emacs-24.5-rc1 (4152) 2 files changed, 6 insertions(+), 1 deletion(-) lisp/ChangeLog | 5 +++++ lisp/pcmpl-unix.el | 2 +- modified lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-04-03 Nicolas Richard + + * pcmpl-unix.el (pcmpl-ssh-known-hosts): Use `char-before' instead + of `looking-back' (bug#17284). + 2015-04-03 Dmitry Gutov * progmodes/js.el (js-indent-line): Do nothing when bol is inside modified lisp/pcmpl-unix.el @@ -157,7 +157,7 @@ (defun pcmpl-ssh-known-hosts () (while (re-search-forward (concat "^ *" host-re) nil t) (add-to-list 'ssh-hosts-list (concat (match-string 1) (match-string 2))) - (while (and (looking-back ",") + (while (and (eq (char-before) ?,) (re-search-forward host-re (line-end-position) t)) (add-to-list 'ssh-hosts-list (concat (match-string 1) (match-string 2))))) -- Nico.