From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#11906: 24.1; completion-at-point failures Date: Sat, 07 Dec 2013 10:05:20 +0800 Message-ID: References: <87li776gym.fsf@yandex.ru> <87pppcasli.fsf@yandex.ru> <52A1221D.90501@yandex.ru> <52A1534D.3000902@yandex.ru> <52A1CDDD.1050808@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386381978 13092 80.91.229.3 (7 Dec 2013 02:06:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Dec 2013 02:06:18 +0000 (UTC) Cc: 11906@debbugs.gnu.org, Dmitry Gutov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 07 03:06:21 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 1Vp7Hh-0006FL-2z for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Dec 2013 03:06:21 +0100 Original-Received: from localhost ([::1]:34265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vp7Hg-0006zV-FM for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2013 21:06:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vp7HW-0006z7-1A for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 21:06:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vp7HO-0002Tb-LP for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 21:06:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vp7HO-0002TU-IJ for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 21:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vp7HO-0007Oh-0r for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2013 21:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Dec 2013 02:06:01 +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.138638193728404 (code B ref 11906); Sat, 07 Dec 2013 02:06:01 +0000 Original-Received: (at 11906) by debbugs.gnu.org; 7 Dec 2013 02:05:37 +0000 Original-Received: from localhost ([127.0.0.1]:35195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp7Gx-0007O0-Ut for submit@debbugs.gnu.org; Fri, 06 Dec 2013 21:05:36 -0500 Original-Received: from mail-pb0-f41.google.com ([209.85.160.41]:35091) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vp7Gq-0007Nk-FJ for 11906@debbugs.gnu.org; Fri, 06 Dec 2013 21:05:29 -0500 Original-Received: by mail-pb0-f41.google.com with SMTP id jt11so2075778pbb.14 for <11906@debbugs.gnu.org>; Fri, 06 Dec 2013 18:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=NAdnsMFIj/EMwu02WfQnji9b0Qu2obLie+8Bkgamnyc=; b=UxuuYRvfGoMzvPx4yPXy9/hqhVtaITrKKzcGPBiUpriHlrYCcFLPKR+DGsvsmMbL41 G5M7U69/M4xr3zCdruorGqWDClBrFrEe94WWOMxXCe86LEkc/u92h7ooqS62ND6/z8qs wpYj992nhPaufY99QMZjcRlR9IWKcXUcR2TGp8me9TUkFCcIrcS12l0KkWfQC5hXE25B mqn3SKvKqrFlZW3w+93Y8vndhSJxRdMTxOTe0yAOgO7UP2bGL5amTutz99XnLAxVhtjM Igcn9mnDAJQV8UYEa1YNtQCyM/jlD+T5kwzVZ9tNdAleZkgNRpoUQH8i9I8gTJydi1F4 4SmA== X-Received: by 10.66.121.131 with SMTP id lk3mr7566595pab.61.1386381927445; Fri, 06 Dec 2013 18:05:27 -0800 (PST) Original-Received: from localhost ([123.119.93.169]) by mx.google.com with ESMTPSA id dq3sm690436pbc.35.2013.12.06.18.05.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Dec 2013 18:05:26 -0800 (PST) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAGFBMVEUKDAg1NjRWV1V9fnyg op/DxcLk5uP8/voi63ReAAAACXBIWXMAAAWJAAAFiQFtaJ36AAAAB3RJTUUH1goZAgAz00bgXgAA AeVJREFUKM9lk0Fz2jAQhQXJD3CCO70CmcC1YMtcWyTZ14Bl69xats4N9r6/3zWQBlodNKNPu/s0 b1cCQFuZGpfVVh3vAvBJolIXRkapSuoRUtIdFyo1Y5xSdlAj7OtvD1XnXxmWRi+eWgcxyCed1lVV B1CrKyujMoi+eLA5kU1SsjoHlW+nQjTtFxk4MXgrOxvIqzoTZR8XgPaLl419zgsMaSGFPiUOZCIh thsx5Xy9NsK8Kwf/JoQgMxcVJ301HKkcSWaT0O7FY056J4U9xcYfnmVXG4801lW6lqwu2nKFZoHC HuzvaTVndZ+LaRQgZdthXw1cpynEkLEwyFHXk/aIxNQ6QeooJuzPMB+wn+D7JJNsiCcVA13/A3h/ xE9J+WidpAwoYNmRFwyvSRhNVtsdaAewzZZP5uw82QL9+tyNfocyP0McAzICUr5Mk9RdIjWasUNx aIIt6NK4ZtXIMdfMQt3nuMAyWbLI4DqZ4xPq/ag8jPond4XU/cLuOgw6XCFX/YCUfcDAMMH58fD4 G9kDchwfqVefkBwup2uZM+Q4WhJt5jN3AxXCsaS2yXEDuWgS8VOzW0gFjhEPmLyFMKBFaLb1HRwc DiaKwx0EeTMRYnYPQRW3PP4HApvlMv0PttX5v/D6Aws3IOSEwzmLAAAAAElFTkSuQmCC In-Reply-To: (Stefan Monnier's message of "Fri, 06 Dec 2013 12:35:07 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.9) 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:81572 Archived-At: On 2013-12-07 01:35 +0800, Stefan Monnier wrote: [snipped 5 lines] > This would be a bug (probably in the completion-at-point-function). [snipped 4 lines] > That should "never" be necessary. On 2013-12-07 01:36 +0800, Stefan Monnier wrote: [snipped 3 lines] > There's no technical reason not to, but... why would we want to do that? [snipped 3 lines] For this case: --8<---------------cut here---------------start------------->8--- Assume three candidates (ObjC selectors) for completion and completion-cycle-threshold is 5: 1. stringWithContentsOfFile: 2. stringWithContentsOfFile:encoding:error: 3. stringWithContentsOfFile:usedEncoding:error: After cycling a few times, I see: [NSString stringWithContentsOfFile:stringWithContentsOfFile:encoding:error:stringWithContentsOfFile:usedEncodin$ --8<---------------cut here---------------end--------------->8--- So indeed it is the capf's failure to go back to the proper starting point after the insertion of the first completion candidate. But the capf could have no idea what chars the completion candidates can be made of. In the example it is : that capf needs to handle. sometimes it is SPC or [ or { or whatever. How can this be handled reliably? Thus my proposal to use marker. i.e. in the beginning of a completion session set a start marker. In general the idea is to make the completion machinery in minibuffer.el only have to ask capf for information once for each completion session. Leo