From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Improvement proposals for `completing-read' Date: Thu, 8 Apr 2021 01:16:04 +0300 Message-ID: <09b67fc5-f8fd-c48a-8b0b-ad47c88761f1@yandex.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9501"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 To: Daniel Mendler , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 08 00:16:59 2021 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 1lUGTr-0002MT-K2 for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Apr 2021 00:16:59 +0200 Original-Received: from localhost ([::1]:34828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUGTq-0003fR-Kt for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Apr 2021 18:16:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUGT5-0003F9-F0 for emacs-devel@gnu.org; Wed, 07 Apr 2021 18:16:11 -0400 Original-Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:35403) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUGT2-0007DJ-Nt for emacs-devel@gnu.org; Wed, 07 Apr 2021 18:16:11 -0400 Original-Received: by mail-wr1-x433.google.com with SMTP id a4so2613927wrr.2 for ; Wed, 07 Apr 2021 15:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=aK/8U835DUBHxWSgHFO+TvkcH5siMJyh7OExG1m2VUw=; b=eIHStc4TFqg9MpUB/6mbJGITS9YA7RCdwejPGfEngB0p3T5KIgGsXkko4I0n3IlXr/ LzQgecc8WXIf9E9D5LC8Xp6gVtOpcl/X74cvXiXSXzpdaLUGc88bDBkRN6EE/F2Ek0VI i4egN7QybbDWXM4aZZF2X5BDFWek5X9+9mw7eIhUWEFl+cBva95PmIMlwjaxyTqDqEU4 s780H9XDKhPO078vqn9H7vPwGxwqrFyE0FbKqo44Qyg7tEZIDMMDbC2Y+QgiCAXUIJlM XpTIcsjRdM3yJnzszZIWU15NGNQAFRFspy1Il3t9ZtTTBY1MkJySDz/tZjH1W9zJz7a1 te8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aK/8U835DUBHxWSgHFO+TvkcH5siMJyh7OExG1m2VUw=; b=JaLTm4tD78cRNjsBACfIoe7Uign1NoBQ3BbEOvqOgCdY6bXE29aN+1OpQa806zAyiZ BvJE+YxRIYirJEa5gZ/pIIFZQiM3xWHROUBJnGNm9EiBxonM6u4+jVFuC4ZYhTYulIKI 86MzWQHw7nCBgx5+151LF16JeQJvfpghWtucmCM0jXSCAItxXAuE/PjoF7fVy/3Gx8a+ B25SlNFpekVjKiYYE9+BDoq4uXvTMuqpmZ1+XYuF0tr/7Fyo+5a3lihs20DyjjLO9TCk 9qYTRzo+Wl5oyBY9zLZxulARJuAeLqyPFLb7UaNcLWP+zIFmI6HTPGmRyYiTxoKzxxP+ DvPQ== X-Gm-Message-State: AOAM531c+FmB2pgA9jAYGBb+Xw4/8q9umO3a/w3JKPOsGlLTSTQ2HdIA aT0w2byBYX3v51P+O9C0qwOD6UxbvUI= X-Google-Smtp-Source: ABdhPJzGZRDTIsHX3jiqyzegOTPajW4na9doRceUSMLAj9GpCYm6oJCxS2Lg9o7p9Ek4IWf7v4zDAA== X-Received: by 2002:a5d:4c52:: with SMTP id n18mr7085986wrt.210.1617833767016; Wed, 07 Apr 2021 15:16:07 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id j23sm10112056wmo.33.2021.04.07.15.16.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Apr 2021 15:16:06 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=raaahh@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:267579 Archived-At: On 07.04.2021 14:16, Daniel Mendler wrote: >   .. Proposal 1: Disabling the history >   .. Proposal 2: More efficient sorting >   .. Proposal 3: Sort file names by history >   .. Proposal 4: Add support for `group-function' >   .. Proposal 5: Forbid the null completions for `REQUIRE-MATCH=t' >   .. Proposal 6: Return text properties from `completing-read' >   .. Proposal 7: Allow duplicates and retain object identity >   .. Proposal 8: Completion style optimization of filtering and > highlighting If you allow me to offer some brief comments and present my own wishlist. 5. would indeed be very nice to have. You can see my current attempt to hack around it in project--completing-read-strict. 6. would indeed make sense, and I'm not sure why we wouldn't want to have it in the non-selection case. Whatever come makes use of the completed value, could do the stripping of properties. Often, completing-read's caller can ensure the properties are there, by using something like (assoc-default completed-string collection) at the end. But that only works if the caller is also the provider of the completion table (otherwise it's an "opaque" data structure). ... 9. completion tables need to be able to delegate all matching logic to an external process, both filtering and sorting. That's an important case for code completion, where we can take advantage of existing code and its "fuzzy matching" implementations. 10. support for delayed/asynchronous fetching of completions which doesn't interrupt user's typing (it would generally abort the request if user input is detected, but there might be other approaches to that). Again, that's helpful when completions are produces by an external process.