From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#11906: 24.1; completion-at-point failures Date: Fri, 10 May 2013 16:36:05 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1368218221 1342 80.91.229.3 (10 May 2013 20:37:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 May 2013 20:37:01 +0000 (UTC) Cc: 11906@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 10 22:36:59 2013 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 1Uau3k-0001Gw-Ib for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 May 2013 22:36:56 +0200 Original-Received: from localhost ([::1]:35057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uau3k-0000ND-2N for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 May 2013 16:36:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uau3g-0000Mx-2V for bug-gnu-emacs@gnu.org; Fri, 10 May 2013 16:36:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uau3f-0003DX-3g for bug-gnu-emacs@gnu.org; Fri, 10 May 2013 16:36:52 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uau3f-0003DT-04 for bug-gnu-emacs@gnu.org; Fri, 10 May 2013 16:36:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Uau3q-0007cG-FU for bug-gnu-emacs@gnu.org; Fri, 10 May 2013 16:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 May 2013 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11906 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11906-submit@debbugs.gnu.org id=B11906.136821818929201 (code B ref 11906); Fri, 10 May 2013 20:37:02 +0000 Original-Received: (at 11906) by debbugs.gnu.org; 10 May 2013 20:36:29 +0000 Original-Received: from localhost ([127.0.0.1]:35930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uau3E-0007ao-0u for submit@debbugs.gnu.org; Fri, 10 May 2013 16:36:28 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:37088) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uau37-0007aZ-JG for 11906@debbugs.gnu.org; Fri, 10 May 2013 16:36:22 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r4AKa586011869; Fri, 10 May 2013 16:36:05 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 3A494B4161; Fri, 10 May 2013 16:36:05 -0400 (EDT) In-Reply-To: (Leo Liu's message of "Fri, 10 May 2013 14:38:09 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4575=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4575> : streams <958174> : uri <1416861> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:74142 Archived-At: >>> completion-at-point also invokes those functions in order to decide when >>> to exit. This causes problems illustrated at the beginning of this >>> report and, for example, I have also experienced delay in inserting >>> space, dot, etc following a completion. >> Can you explain how "this causes problems"? What makes you think >> it's related? > OK, I just hit another performance issue with this repetitive invoking > of completion functions by completion-at-point. To see this issue: > 1. emacs -q (choose an emacs that doesn't have the fix in revision 112539) > 2. M-x run-octave > 3. Type 'uint ' > 4. Type 'history 10' I don't understand this recipe: where should I type "history 10"? right there after the "uint" text? > You should see: > 1040 completion_matches ("uint"); > 1041 completion_matches ("uint"); > 1042 completion_matches ("uint"); > 1043 history 5 Where should I see it? Ah, OK. so I should type RET before "history 10", so history shows me the last commands run by octave. > So basically computation for the matches against 'uint' has been done > three times. Fine, yes. There can be various reasons why the completion table is run several times. In the present case, 2 is the minimum: once to try and complete "uint" (which just returns "uint") and once to get the completion candidates. Why there's a third call? I couldn't tell you off the top of my head. Maybe it's an inefficiency somewhere. > Now when the computation is expensive (such as against the > empty string "") one should observe a terrible delay. The difference between 2 and 3 calls shouldn't be sufficiently large to go from "acceptable" to "terrible delay". > I have to work around this issue in octave by revision 112539. Using a cache is a good idea: when there's no completion, the completion code may call the completion-table many more times than just 3 times (typically, it will call it at least once per completion-style). Stefan