From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Re: Completion with (:exclusive 'no) is called twice, and doesn't pass over on sole completion. Date: Sun, 18 Mar 2012 00:33:44 +0100 Organization: EUR Message-ID: <87haxmx0o7.fsf@gmail.com> References: <87haxoyff9.fsf@gmail.com> <87sjh8wdbw.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1332027241 3557 80.91.229.3 (17 Mar 2012 23:34:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 17 Mar 2012 23:34:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 18 00:34:00 2012 Return-path: Envelope-to: ged-emacs-devel@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 1S938H-0005jj-L8 for ged-emacs-devel@m.gmane.org; Sun, 18 Mar 2012 00:33:57 +0100 Original-Received: from localhost ([::1]:33208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S938G-0003fa-IR for ged-emacs-devel@m.gmane.org; Sat, 17 Mar 2012 19:33:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S938D-0003ep-37 for emacs-devel@gnu.org; Sat, 17 Mar 2012 19:33:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S938A-0003ef-Vg for emacs-devel@gnu.org; Sat, 17 Mar 2012 19:33:52 -0400 Original-Received: from mail-ey0-f169.google.com ([209.85.215.169]:33784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S938A-0003eY-MY for emacs-devel@gnu.org; Sat, 17 Mar 2012 19:33:50 -0400 Original-Received: by eaal1 with SMTP id l1so2707345eaa.0 for ; Sat, 17 Mar 2012 16:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=NCIkl7pdi/P2+QG5pV+6kqNmhO8UHV+GlLXetYmvfr4=; b=wkTEWKbLTLzEs3iBlt7FcB5k4A3fWZfKuiypD/c//kdaqTaM7bdglO5lYfp18AldtV Z/VlIESl2aaaGVc0+WB4IKdsWI2LYYiw2JO2+vlWPjwIcM8YAcBkRTllai8gsDiAaAYd QKO4yIwQNwEGH8T2KrkC2ilsf4Fl11UK8//VEbrC40OkXsFVG6EYcMZCYIHWLGe/HfrV 3MQLWYbTIbac4NMa4mM18CEMJTGw7cOk9weMz9CA0BNofk7ZC0dgfEZZG1QUw803xul6 zmryOrylcgwfxUWgG/V5zJCazOsYUL+iWrpP47Dt6vvmG6aUZ0reVcQP8PamYv5cISil +5qw== Original-Received: by 10.213.31.71 with SMTP id x7mr470161ebc.125.1332027227739; Sat, 17 Mar 2012 16:33:47 -0700 (PDT) Original-Received: from localhost (e138158.upc-e.chello.nl. [213.93.138.158]) by mx.google.com with ESMTPS id v15sm33133412eem.1.2012.03.17.16.33.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Mar 2012 16:33:46 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sat, 17 Mar 2012 18:34:31 -0400") User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.94 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149117 Archived-At: >>>> Stefan Monnier >>>> on Sat, 17 Mar 2012 18:34:31 -0400 wrote: >> Please see my other message with a more serious related issue. >> It might give some clues. > I do not see your other message. Is it on emacs-devel or a bug-report? Yes to emacs-devel, http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00249.html >> In my case it's meaningful, as I retrieve completions from a >> process. > Then you should probably get your completions from the completion-table, > rather than from completion-at-point-functions. > IOW your completion-at-point-functions should return (without contacting > any process, other than maybe checking whether a process exists) > a completion table that's a function, e.g. built with > completion-table-dynamic, or using complete-with-action and it's *that* > function which contacts the process. Thanks for the pointer. I was not aware of this distinction. But why would that make a difference? Isn't the end result the same? Info is silent on this. >> Also I think, popup functions should use a different list (like >> completion-popup-functions). > That might be right (tho I hope it's not), but it doesn't eliminate the > fact that completion-at-point-functions might be called in > various circumstances. I've written auto-complete support and emacs-24 completion at point for R. And it turned out that these two are really distinct features. One is fast, cache based and sloppy, as it should not interfere with the editing. Another one is exact and might be very slow, because it contacts the associated process. The TAB completions can afford to be slow, as there is no editing. >> As users might want to use different sets of completions. > I expect completion-at-point-functions to be setup by major modes rather > than by users. Take auto-complete as an example. There are plenty of different ac-sources, and users use whatever completion they want. Related topic. It would be great to have a separate "namespace" for all buildin completions, or even a dedicated package. Then users and developers can easily find buildin stuff. For instance `completion-filename' instead of `comint-filename-completion', `completion-etags' instead of `tags-completion-at-point-function' etc. Auto-complete package is a good example here - all sources start with "ac-source-". >> Also popup completions *must* be considerably less computationally >> intensive, so it's probably a different set of functions anyhow. > The way I see it, completion-at-point-functions would instead include in > the `props' it returns, enough info to determine whether to use that > completion data for popup completion. To return the props it still must be called, right? Indeed if the completion function were aware that it was called from popup, then it can simply return nil to be skipped. But, AFAICT, this is not currently the case. Vitalie.