From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: Extending the ecomplete.el data store. Date: Thu, 08 Feb 2018 11:21:11 -0600 Message-ID: <87shabtn20.fsf@red-bean.com> References: <87fu6hcm9r.fsf@red-bean.com> <87zi4lvhxw.fsf@red-bean.com> Reply-To: Karl Fogel NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1518111850 3955 195.159.176.226 (8 Feb 2018 17:44:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Feb 2018 17:44:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 08 18:44:06 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejqEu-0000fn-D5 for ged-emacs-devel@m.gmane.org; Thu, 08 Feb 2018 18:44:04 +0100 Original-Received: from localhost ([::1]:57212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejqGv-0006o3-Lb for ged-emacs-devel@m.gmane.org; Thu, 08 Feb 2018 12:46:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejpsu-00029J-QW for emacs-devel@gnu.org; Thu, 08 Feb 2018 12:21:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejpsp-00065L-1W for emacs-devel@gnu.org; Thu, 08 Feb 2018 12:21:19 -0500 Original-Received: from mail-io0-x235.google.com ([2607:f8b0:4001:c06::235]:34295) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejpso-00063d-S1 for emacs-devel@gnu.org; Thu, 08 Feb 2018 12:21:14 -0500 Original-Received: by mail-io0-x235.google.com with SMTP id x188so47276iod.1 for ; Thu, 08 Feb 2018 09:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:reply-to:date:in-reply-to :message-id:user-agent:mime-version; bh=fiBric+ugH2Y9mrhO56+UbdCV/0KLDWloyMZyB4AbCc=; b=LJLow/7Bsf48wy+meOtmt2xpQezps1QTHG+OuE6nQ8V7DS3DENXvk057hGlcCckQyE MTJ0t9FzlV7n2ttomsgaDsh7ljxGOu0l7PdqxHnnnsQpo4DlcsSJyNWQ/BguNfheO0Ej 0ObFFIIpZrofWaLqbKP5ljGp5jvmgt48F+VIGDK9MTbvzRflM/kPeroqLIssDVUHJS1H xo0scHqTF1SB/uJEgMm6iYILip5TZzQ6KQCTQG/vi3/J1X379IOUFVFtxVLqhn2jF98A o6sMBI8oIiGlmmvxH5q7n3UsfceDOiyHDmMSO2ehdG+JFP+QFREdih9n36WZIqPbuK38 s7xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:reply-to :date:in-reply-to:message-id:user-agent:mime-version; bh=fiBric+ugH2Y9mrhO56+UbdCV/0KLDWloyMZyB4AbCc=; b=k+1iKVXdCm8duG2dCYrl2Fh9uDbH4oXXYgdDFN9z8HL8ofmb283tDesh2Rss8SfSJq JuBi0NqtoDoZZAicajX/gPZDcybyv92GT6uhNntSAIfa9XnWwF+SGJvckePKDPiHiT6Y qWwrBqN9WpG/gq2UmDLjEejRQIsfdYfxsnen5Q33GWlm0VPol+uj64wXGBowyg5yrAEg jJqIHS/UzX01Y4PUNN9SrBj0ccEA6IBnA+3wzdR27Tu8TjOfu3BTWeHUDoXtzIOn6pyP qoCgeZc+NS4KtHY6fhGfDQCCNn84gTdNGnfoc4TDHV6mdl2QUo9sLNtIjx7XZYYquVOw OJSQ== X-Gm-Message-State: APf1xPASc3IGuJ5rTfuV0tlBnJx1ZAs472ho0+ZHzyB8iOpBz8xwDlyV 0pG9lu3NMsFH97uz0n6PonLqRQ== X-Google-Smtp-Source: AH8x225eyIXWfU7ebw6RP2TGQrzw61hZgGH6FeS9ta7ffy6D6MSIAU1IcYf4vHr+QZoPULXMAWGoUw== X-Received: by 10.107.139.19 with SMTP id n19mr1852459iod.147.1518110473700; Thu, 08 Feb 2018 09:21:13 -0800 (PST) Original-Received: from kwork (74-92-190-114-Illinois.hfc.comcastbusiness.net. [74.92.190.114]) by smtp.gmail.com with ESMTPSA id l5sm316234itl.27.2018.02.08.09.21.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2018 09:21:13 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Tue, 06 Feb 2018 18:21:42 -0500") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:222626 Archived-At: Stefan Monnier writes: >A good halfway step would be for mailaprop to provide >a completion-at-point-function so it can also be used for >TAB-completion. Thanks; I'll take a look. >I think the main hurdle is that completion-at-point-function only >directly supports prefix completion. The UI on top of it supports >substring completion, but it does it by requesting "all completions" >from the backend (i.e. from mailaprop in our case) and then doing the >substring search. So if "HAHAHA" appears in one of the variants but not >in the "canonical" name, it won't be found. And more importantly, >listing all completions needs to be fast/memoized otherwise the user >will not like the performance. *nod* I don't know much about how core Emacs handles this. I assume it does not memoize all the possible prefix strings and does not ask callers to do that either. Mailaprop (which operates with substrings rather than just prefixes) memoizes every substring that gets completed at least once. If there's any existing code in Emacs that you can point me to as a good example of the kind of memoization you're thinking of, please do. Best regards, -Karl