From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: complexity in minibuffer (was: (icomplete-vertical-mode): Add support for affixations and, annotations) Date: Wed, 02 Jun 2021 10:19:01 -0400 Message-ID: References: <87y2c24lww.fsf@mail.linkov.net> <871r9t2lsy.fsf@mail.linkov.net> <22880197-6d05-c821-2c58-328ed3cfc02e@daniel-mendler.de> <87eedruui3.fsf@gmail.com> <8dd915fe-fe67-2a45-67ff-8aaa3e9b9aca@daniel-mendler.de> <878s3zuq47.fsf@gmail.com> <09f2a253-84ba-5cfd-552e-0b89109864a5@daniel-mendler.de> <875yyxaoxp.fsf@gmail.com> <871r9laj6a.fsf@gmail.com> <1b73a130-204c-76fb-2b60-02b814aee0f0@daniel-mendler.de> <87r1hl8xom.fsf@gmail.com> <878s3t8tzw.fsf@gmail.com> <3c68bd00-70ca-fa18-f9b8-cd03029f9294@daniel-mendler.de> <8735u18lsd.fsf@gmail.com> <8e33bbfe-0015-b85c-b57c-ba448f2e6215@yandex.ru> <3d519805-f602-fa52-ec69-0506bb6cb568@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37206"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Dmitry Gutov , Daniel Mendler , "emacs-devel@gnu.org" , Juri Linkov To: =?windows-1252?B?Sm/jbyBU4XZvcmE=?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 02 16:20:20 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 1loRjI-0009Nt-10 for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Jun 2021 16:20:20 +0200 Original-Received: from localhost ([::1]:51380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loRjG-0005Gy-VG for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Jun 2021 10:20:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loRiD-0004Za-V6 for emacs-devel@gnu.org; Wed, 02 Jun 2021 10:19:13 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39782) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loRi8-00037U-M5 for emacs-devel@gnu.org; Wed, 02 Jun 2021 10:19:12 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A7AD88063C; Wed, 2 Jun 2021 10:19:04 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D455A80625; Wed, 2 Jun 2021 10:19:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622643542; bh=ND8hq3HpWWlHDD9b1KWXdc5ZsLtCl1Dd0yN5k5PppH0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=jRplAEAhSJfnnr1JcZ657Dl5MbSE4EcpYzgexXLvVp5IKwM7QimQk11XnSMGnPPye 47ftd7trCJ/gcKjDQ+bt56mxNMXDuLCWKdPoJr0AoPEnev7qQdvTCtyMwu3r191vOz xzLT4gCsnVV4jM4os39nlNrAq04kMaJ/Qp1nTCaQ3SB6wZWpA+lGFs6xKfg9otA5u/ NYpgfhethQ1O2H25o3lfFCVdqCnrCzm8OQtCDeZPnuv2ddKYJKuqCpkXEYE3LXoIBp F2lL0pmO858ZWMfbMlJJ/UbWEmKaIGZeWRKOOTaBngN1Y1v3m3E7S/AyP2R70B7vrg hSQ0wlkZfieOw== Original-Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6DB2D1201C9; Wed, 2 Jun 2021 10:19:02 -0400 (EDT) In-Reply-To: (=?windows-1252?Q?=22Jo=E3o_T=E1vora=22's?= message of "Wed, 2 Jun 2021 01:02:02 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:270293 Archived-At: > Another pain point in minibuffer is the representation of candidates. > Sometimes they are strings, sometimes they are lists of strings with > prefixes and suffixes, lots of silly "if consp". I must say I'm not sure what you're referring to here. So I went searching for `consp` in minibuffer.el, and IIUC you're talking about the code which takes a set of completions and displays it in *Completions*. E.g. the code in `completion--insert-*`. Is that right? [ If so, it explains why I wasn't sure what you referred to, since it's not part of the code with which I'm familiar ;-) ] Indeed, I wonder why we have that. I know `display-completion-list` is documented to work with lists of various things (strings, symbols, and lists of strings, IIRC), but that's an old "feature" of `display-completion-list` that's not used by the current completion code, AFAIK (and potentially not used by any code at all). So we could have a quick loop through the completion candidates at the entry of `display-completion-list` which converts each candidate to a plain string and then calls a streamlined `completion--insert-strings` where we don't need those `consp` any more. [ And in most cases we could call `completion--insert-strings` directly rather than go through the old `display-completion-list`. ] WDYT? Am I missing something? Stefan