From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#17284: Host name completion in shell mode take 45 seconds Date: Sat, 04 Apr 2015 10:29:52 +0200 Message-ID: <551FA100.2040208@gmx.at> References: <87a8ypixcn.fsf@yahoo.fr> <4982c9c5-f87b-41f0-8e79-30fb65de6e99@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1428136289 27388 80.91.229.3 (4 Apr 2015 08:31:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Apr 2015 08:31:29 +0000 (UTC) Cc: 17284@debbugs.gnu.org To: Drew Adams , Svend Sorensen , Nicolas Richard Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 04 10:31:18 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 1YeJU3-0006JW-NH for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Apr 2015 10:31:15 +0200 Original-Received: from localhost ([::1]:36655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeJU2-0001Dm-VR for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Apr 2015 04:31:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeJTu-0001BG-VT for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 04:31:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YeJTp-0008PJ-Vw for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 04:31:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeJTp-0008PF-T3 for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 04:31:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YeJTp-0003vD-KS for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 04:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Apr 2015 08:31: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.142813621715021 (code B ref 17284); Sat, 04 Apr 2015 08:31:01 +0000 Original-Received: (at 17284) by debbugs.gnu.org; 4 Apr 2015 08:30:17 +0000 Original-Received: from localhost ([127.0.0.1]:44331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeJT6-0003te-Hr for submit@debbugs.gnu.org; Sat, 04 Apr 2015 04:30:17 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:61529) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeJT2-0003su-8x for 17284@debbugs.gnu.org; Sat, 04 Apr 2015 04:30:13 -0400 Original-Received: from [194.118.143.212] ([194.118.143.212]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0Lbuo0-1ZL2kP1i8C-00jFS5; Sat, 04 Apr 2015 10:30:01 +0200 In-Reply-To: <4982c9c5-f87b-41f0-8e79-30fb65de6e99@default> X-Provags-ID: V03:K0:ttV/3CekbMcTsGkF3e/4+ddTxU+8aqAFu8+rev9duXpQcnCaslw lL3MZMgcfMfKwb/FYMT8jCBYHeJkAbB4b4yTRQTCT38WwCpDG+EbsSntDFASb4AqpIimMDa mb4R3JSDzdxVsZJJJlTovRFLlI6bG3Gm0y+e86ueubgOaNqvZgdKU9EAKRfFLn7cvsM26sq Pxi0zmAaZAL6bu5iinauA== X-UI-Out-Filterresults: notjunk:1; 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:101176 Archived-At: > 1. Is it really about LIMIT? Or is it instead about looking back > at a literal string of chars? And typically a short string. > I'm guessing that that is the use case to pursue here. Right. > 2. Instead of (or in addition to) a byte-compiler warning for > `looking-back', how about adding a function `chars-before'? This would be useful. > Since I use multiple Emacs versions, some quite old, I use this. > But I'm sure that a much better (including prettier) definition > can be had for recent Emacs. Or (better) define it in C. I guess something like (defun string-before-p (string) "Return t if string before `point' equals STRING." (let ((start (- (point) (length string)))) (and (>= start (point-min)) (string-equal (buffer-substring-no-properties start (point)) string)))) would do. And for simpler cases giving `char-before' a second argument to specify the position of the character before `point' might help too. 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. martin