From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: [External] : Re: Improvement proposals for `completing-read' Date: Thu, 8 Apr 2021 17:22:20 +0000 Message-ID: References: <0342c2d5-02dd-ad9e-5b8e-dfe52f6469c6@daniel-mendler.de> <264397e8-5a03-9eff-436c-639d76514775@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4170"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Stefan Monnier , Daniel Mendler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 08 19:27:36 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 1lUYRK-0000vv-L7 for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Apr 2021 19:27:34 +0200 Original-Received: from localhost ([::1]:38068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUYRJ-0001mk-Lt for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Apr 2021 13:27:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUYMg-0008G6-8i for emacs-devel@gnu.org; Thu, 08 Apr 2021 13:22:46 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:47876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUYMd-00056d-Qu for emacs-devel@gnu.org; Thu, 08 Apr 2021 13:22:46 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 138HJYUJ194154; Thu, 8 Apr 2021 17:22:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=R2r7MR+Rx1ayr1pOTjZKLRlANi4RpDvODyOIcJa7bZo=; b=uyGofWYMT7+/TXLISExp6Q5FimS0DgnpNT9H2g+Io12kpKmjwB4x7tOKhQH03BflHpjE K7QxnmT/fIcwYwWjCmqguTBwvOBAjADgV3N1WCpD17NAO0yFpe0d8dN93Ll7lDH81l5G maLux55LYfNwLB9FqkoZaG17t+xPaJrQ9y9XvzMZpTvlFHj9balhcTjuXgAsyn59fzf/ vpd0411J2JArmXjJQq+SSYgdZ+RG7AYeWLbY1pA9SA0/vxU2DcY8tNU4HyvZs8Ox+/Af sBh84UJvb3wFjBuUtzg7TjKBuX+o+UOrbQwa8wA1V34ReD8kEeiH3qU+u98VJ5Pk95vd VQ== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 37rva66qaj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 08 Apr 2021 17:22:22 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 138HK3CE021657; Thu, 8 Apr 2021 17:22:22 GMT Original-Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by userp3030.oracle.com with ESMTP id 37rvbfy7f2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 08 Apr 2021 17:22:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DPmi4sm430bBcyDMgdsda3GsHTSYyCnzpGkAfHWISzao5eJS4TP390vVNyQgNotKDi5wxYcjuVayxWyENNE8J90y4UkIlPGaBgfNeYaQ5XlMYD4vJvC+Hz7WghFwxiChgOpvCruAJlsAvqL2kpyP9cM2tlYs5kZhmNhyOOWgUqQQEoXC7J9GW9qPpHoDMrRDt5u0G2njyIpv6MMZ32Z4ClPKhgBKwu2TGGqakQADi94ZFD9WIBBtZY5J68DlPiPYNq7rAKV4MC5T3jTX303mQRlAywmBaV1YnCslamu9r6B0zXU0NEWzH9JUegcyJme4KG63eTXczKw/wbOWqeODsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R2r7MR+Rx1ayr1pOTjZKLRlANi4RpDvODyOIcJa7bZo=; b=Yt9QI8UNYqCy7Tca1e7yEVpBL35PZ6ap0+pHUYvZjb9Gin+PIh3/U71bqLcvaRdA8Ykr8fMYdIdYf8GdkNZtANT0FeFw90sBEF9STcbE5uPlW54x7Nv0qAGGYZYyT9KbUadeUU5g2g2MoNF42CeqZf7n6JQTXOCgmXwE0YDxOA71SpmOjEwo0ND/QyC5GbDZRsGPBfNKYI3vRkq9/weLrQH2TihRA4XRNlLCXYE4VxyDylCAx3c2qLO5RIOYOz7vYbdscj17DduwjPbz5qPqKuiF2JlKRI9E/M8apz+JFduNtXWlzkN5zzurN6yGE/6dZffLmse142q1/x7gjq6H3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R2r7MR+Rx1ayr1pOTjZKLRlANi4RpDvODyOIcJa7bZo=; b=AD1HfCYpVCjS7B8/PxMcsoRkCLJ33Pa4om6sPW9XowV5A/9rLynb7Fmy4nnNjHOORC3OtSyLARtsd1Be6aU5b1jAuU6AzOSKw78QRdAQ3SwglqJxUSOIwpEdxzKnMapPiBJZRfHZoFTnrqV8d5sMal7Z+GdriLzKuKBQSOjrwiU= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SA2PR10MB4746.namprd10.prod.outlook.com (2603:10b6:806:11c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Thu, 8 Apr 2021 17:22:20 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315%5]) with mapi id 15.20.3999.034; Thu, 8 Apr 2021 17:22:20 +0000 Thread-Topic: [External] : Re: Improvement proposals for `completing-read' Thread-Index: AQHXLIYsMakc9nsVHUWxSB/uPHmKE6qqzutA In-Reply-To: Accept-Language: en-US Content-Language: en-US authentication-results: iro.umontreal.ca; dkim=none (message not signed) header.d=none;iro.umontreal.ca; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f667f2c3-ef92-475b-20b6-08d8fab2dd9f x-ms-traffictypediagnostic: SA2PR10MB4746: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: claQ4OLurDVfXF95pgfT2UBhmxo6lb5zRpVYcYiFbN+1qDe2aZkYmnDG053NtQdS7mbevIW+JGBuP9L/E57nuD39BHTJ92rjtFyS3TWVE2WJWB8/wydaOVDopAWCnj4LDKCx54CM4PfIF1DQ7Tnd3MeuTPeodODYPLIE7kMagN318iFgPINXXC7wUUpe8F+kh0PbVk+cu5xxxhNdtrG8ALHa88G2Xng9hamqV5/Oy4Y0kDVwU+R/NvzApZVXD+rL+M8SfJVAHEaTsxvnJdwUcyWMPCb75p/PT3ZkhHejlBDznJWgkoO6UcLU4p/7zmgpz71UZ92Gl2cMNVsTYoS74difNNy0fmkjmrnbuqEw+tpeW2VXpSdQS6Rj6RVwt6xSbhYF8ZRED0Jq0VBXdm17t/7kIrTuE1IQ2DKcI7wZhfJiLDg3warNXvPmwYXbjn45baU89WiE+bhEtGIfZ/YeNWAlRvY4IzcN/K5HK71ogbd9fAXDlbUDfJ/rxFfU4eoYyB5Ob7GNFhjStRzNTNurtkGpMgNZ63WZiZuj1x+dGV1FdxP4H2XwbTm9s+AnlsUF4HPKw+vO2vom1dRVLemu5C4/9kzrxXlPXVsGGSOBiztW7djJ0xsIX7vC9r72ADI1oEQuOKSYCs1kA0m33M8yAGLOdm4AaUYIKNFPeGQZmQMGyGsITl0R8BmsUx0r186hXQLZPQkdoT1KnhMgF6BXHXK0Mhv3P2tBBGNAvZTJVfSI3cx6E0Loq+HalD7g9 Aeg8uCkKUvp9ddwU+0uH17cfA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4474.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(136003)(396003)(366004)(376002)(346002)(9686003)(33656002)(71200400001)(55016002)(296002)(316002)(26005)(7696005)(966005)(44832011)(110136005)(186003)(38100700001)(4326008)(66946007)(64756008)(5660300002)(83380400001)(76116006)(52536014)(86362001)(6506007)(8936002)(478600001)(2906002)(66556008)(66446008)(66476007)(8676002)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?hI3R/D67dDlfZA3tdNjl+9/NgI54A8QURcnkEbKyPF2Vs6O6t8kuYAK20ICY?= =?us-ascii?Q?aa/xI8Dqi/dSBM1msh/z/cieDsnGqxKO2+Nj3D+c2FWOnyRJScoGpUt3a1C8?= =?us-ascii?Q?2rpUF59vjFa2Tv1OOiVls9YvdH3lVgA702IPuhymcZsSt0KzZ3du7SLdgCZj?= =?us-ascii?Q?TSogGaNTivkGUsmMpn8IbLSjs3zsLi6zkqC9lmki8Djc4HLoqVbCQwxZMTz1?= =?us-ascii?Q?lgpe5IsaGCDhkulzYBgYuF6ToADj2/YuLN2qMAQ3G4JLaeoe2TdDOIKvITSG?= =?us-ascii?Q?wRrLuh717MHHcHjxlYLUwpvFqBSGkJM9vbl8taKpVfJAer2Jp5TDNPHl6vEb?= =?us-ascii?Q?Bi+elrv035Nf3hmmHIn82Uof5omP+VN7FAtIBSlgXs4vxy90V6PJuCMgyDUm?= =?us-ascii?Q?JLCxUM/eWbiR5cyIvODl/9uZuwCi2EtRS3plEL/GPxlsXz2daAiZ/7r+yxPk?= =?us-ascii?Q?fsJL7g72dsDOpo/FkpwDaM/4TO+O5kW7JUVymLHFn6okGIzn2ejwwX0Ue0u2?= =?us-ascii?Q?pCuajdhAQ8llRvoyaAZdpxmSlsTNX4p9tq79/qfApsGh1wnU1dCS08apXpt8?= =?us-ascii?Q?XZyU94uEzy1bgKREEyh3dUO1OTu7KSozYM6LC/tYgoydIcRxtIkakcmISMCM?= =?us-ascii?Q?W0zu x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4474.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f667f2c3-ef92-475b-20b6-08d8fab2dd9f X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Apr 2021 17:22:20.1514 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: B1MNJt9lTG1A1fuJvKcRWcwar9hMUmXc5TDvFF7ES+nk+AN5enHCUvmz9GdBVAaaHi4Li1F+kq83xg0h3sqt1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4746 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9948 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104080115 X-Proofpoint-GUID: UXGWLOTim_xZY7_lNdsGKHt4p2CeJeLr X-Proofpoint-ORIG-GUID: UXGWLOTim_xZY7_lNdsGKHt4p2CeJeLr X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9948 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 impostorscore=0 phishscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104080115 Received-SPF: pass client-ip=156.151.31.86; envelope-from=drew.adams@oracle.com; helo=userp2130.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-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:267636 Archived-At: > maybe we could arrange for the minibuffer text to be > matched against the *annotated* candidates in some cases. > I think this requires more thought, together with concrete > examples. In Icicles there's a distinction: 1. Annotations are _not_ matchable (intentionally). 2. Completion candidates can be multi-part. Each part can be matched separately. Use of any part by a user is optional. So if a command wants to make what might normally be considered an annotation matchable it just uses multi-completion, that is, it gives candidates two parts, the second being what would have been the annotation. It's also possible for particular parts not to be displayed in *Completions*. You can nevertheless complete against them. An example is choosing a file or buffer name. The commands for this use multi-completion. The first part of a candidate is the file or buffer name. The second part is the file or buffer content. The content part is _not_ shown in *Completions*. So you can choose a file or buffer by matching its name or its content or both. Users can completely ignore the content part. They can even not know it's available to match against. (It's created only on demand, so no performance penalty when you don't match content.) Doing this is fairly straightforward. It would be even more so if vanilla `completing-read-default' took care of it. As it is, I need to fudge the parts together for `completing-read-default', and tease them apart when needed. As a candidate for `(icicle-)completing-read', a multi-completion just has a list of strings as its car instead of a single string. That possibility is currently unexploited (aka available) by vanilla. (Multi-completions are thus possible only for alist collections. That restriction could be removed if underlying code such as `completing-read-default' took care of them.) >From the doc of `icicle-completing-read': The car of an alist entry can also be a list of strings. In this case, the completion candidate is a multi-completion. The strings are joined pairwise with `icicle-list-join-string' to form the completion candidate seen by the user. You can use variable `icicle-candidate-properties-alist' to control the appearance of multi-completions in buffer `*Completions*'. You can use variables `icicle-list-use-nth-parts' and `icicle-list-nth-parts-join-string' to control the minibuffer behavior of multi-completions. See https://www.emacswiki.org/emacs/Icicles_-_Programming_Multi-Completions= . > you can't do the highlighting correctly for > `partial-completion` without having access to > the "pattern" against which it was matches. Exactly. The pattern and the kind of matching. E.g., for regexp patterns `string-match' is relevant for finding the matched part of a candidate. Highlighting candidate match parts (and their common expansion, if there is one) should be done only in the function that displays the candidates (e.g. in *Completions*).