From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Emacs should provide more modern item completion out of the box Date: Wed, 29 Jan 2020 18:57:07 -0500 Message-ID: References: <87eevje3tm.fsf@mail.linkov.net> <87v9otkgvn.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="10500"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: ndame , "emacs-devel@gnu.org" , Dmitry Gutov To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 30 01:10:13 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iwxPQ-0002gD-GW for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Jan 2020 01:10:12 +0100 Original-Received: from localhost ([::1]:53786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwxPP-000110-Gj for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Jan 2020 19:10:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45805) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwxCu-0004lg-0G for emacs-devel@gnu.org; Wed, 29 Jan 2020 18:57:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwxCs-0000lM-Qq for emacs-devel@gnu.org; Wed, 29 Jan 2020 18:57:15 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23447) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iwxCs-0000iK-KN for emacs-devel@gnu.org; Wed, 29 Jan 2020 18:57:14 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id ED04D100F88; Wed, 29 Jan 2020 18:57:11 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 81697100E8C; Wed, 29 Jan 2020 18:57:09 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1580342229; bh=MN9cPLW5rXN5wv2pDy2QWvHgFJ129VnVS7NKjWguoA0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=WdT/qrjKKBge1D7GaepZeX1xyskPZ+VE3NAp/F/HFMRkPkc4p4Do/tvAHazitlGlT aWr9Sa9kZuECPoH3HmuViFIwOaHXwar1DptxHQYjSbbVe/FxZcWp5VG2WHn56hdk5H JhKUxoBHMX5lQ4lenCNKGbMerjjNLNKJ+zoWB6OXKg3O4GVb3IYxUQi3yoJ5dO/cDY f/exxyRAGnUkUYqSJkELlegtfdfxafVx0AXWf2YP/0joUCL6rsC1Avr6ue8984HQYm S1ojZ/TzVeRJDKQphyyHKC0j/SShNlto3gjoDNW0eiYR9sPsXy62JCbrudaVobIHN9 mbUuVbmY46xQw== Original-Received: from pastel (unknown [45.72.213.248]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6389712048D; Wed, 29 Jan 2020 18:57:08 -0500 (EST) In-Reply-To: <87v9otkgvn.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 30 Jan 2020 01:00:28 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244760 Archived-At: >> (and I'm not sure why you bind `completion-styles` since it will only >> take effect during the display but not when the user finally hits RET). > > This part I don't understand - it seems its main point is to take effect > during the display. But with the code you proposed, the display list won't be in-sync with the completion candidates used for RET, so you can get for example the display to say that `rename-uniquely` is the only matching candidate and then RET to reject saying there's "no match". > But anyway completion styles should be customized separately, Exactly. >> Also, you probably want to run this within a `while-no-input` of some kind. > 'while-no-input' feels still too laggy when tried with this: > (defun minibuffer-quick-update () > (when (and minibuffer-completion-table > (>= (length (minibuffer-contents)) minibuffer-quick-min)) > (let ((non-essential t)) > (while-no-input > (minibuffer-completion-help))))) > > Maybe better to use run-with-idle-timer that could be customized with > a number of seconds to delay. Probably, Stefan