From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriel Newsgroups: gmane.emacs.bugs Subject: bug#49321: 28.0.50; [PATCH] Add option icomplete-matches-format Date: Thu, 01 Jul 2021 16:39:45 -0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20122"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 49321@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 01 21:44:23 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lz2bn-00050W-D9 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Jul 2021 21:44:23 +0200 Original-Received: from localhost ([::1]:46456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lz2bl-0003c4-M9 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Jul 2021 15:44:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lz2bT-0003aQ-BP for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 15:44:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lz2bS-000833-Uc for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 15:44:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lz2bS-0003og-Ml for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 15:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gabriel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jul 2021 19:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49321 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162516860414614 (code B ref -1); Thu, 01 Jul 2021 19:44:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Jul 2021 19:43:24 +0000 Original-Received: from localhost ([127.0.0.1]:33727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz2ap-0003ne-Mz for submit@debbugs.gnu.org; Thu, 01 Jul 2021 15:43:23 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:33926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz2ao-0003nW-1l for submit@debbugs.gnu.org; Thu, 01 Jul 2021 15:43:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lz2an-0003Wk-PM for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 15:43:21 -0400 Original-Received: from mail-dm6nam10olkn2049.outbound.protection.outlook.com ([40.92.41.49]:15936 helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lz2al-0007dP-BY for bug-gnu-emacs@gnu.org; Thu, 01 Jul 2021 15:43:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GFhy4zLGw7MtyTzkak47Y0F8TsdVGUbmDQz5bQ1/Y5D3GYmALtvH7fnRQea5gt6nHL0/y9eATS52xqSyB7j5ngwhIhHoxR/XjMJ3c93h4r5LCmuWxH4ldbtExhQcA4/bS1T3GkmqfpRnjSgj0HMtZuhOaM47ymVIiSP41OuvIoioRCS5HDVikpn+yQJqvA48GOV0Ndc3AZ8bjw4KqrvIUUHaHmTnPwDkbJUJfNOXBZGHlLFK0xwr7LJxV0DhgSJmkUumfHTfztYElEhFL5z6zaB+8QilhqndrQ+HK4n3WqgLT1kwT8929CcES/Yi5xJMwV+0O5Rc0ceVivbdx0PPIg== 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=tmDSbCkLvTGb5ApUQdffVAS8bjhYV1j2nuHTE0eqmV0=; b=eAv93Xt5NeBVpRK6eOAhUwhzQTGiFdVbjv7SyMpNEib+2mRxa8mCTRsEJ3hufHs4dDFQP2WBPQIV/dKcGDgsderUaTqT4hKKgjHo3MBSbdaxlnnH8UP7mIjK6ALzvVQXMG6HmNh67qWBLXTkrSDmzy3b+z7dcRP05zWDOOanAHdL/vGJDp+R5pXtGfSVTQk98w0K0RZ829sHgvBuPqSIhZjMSdwu4M3unYOpSbm6Akr2L87Mh9wtvbAB8Flkpw8k89550tPojip8JVtQvzQhbrm1WUHi4Wwnfdcxdofu+EdDYLObQB+U6AsWE5Mp/hdgfW5BkwihZQunU8anf1BG9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tmDSbCkLvTGb5ApUQdffVAS8bjhYV1j2nuHTE0eqmV0=; b=uFVc0cs1s9iEi0gLGtvovhJQVDFUCcePIfIhQN4UTqwF3TaGd+C6fRZdFtHqge8dPNYUUaB/aesi/ON4P2jWDxPSd/yJ5ZoW6cvuI0kYkj+SCSdHbotkbT8Ai5/kB3TWKTCQKcMHfq/F+/zerToVwzbJlFHaLKEC3h3pxGXirL1SGDD3ZsyNyqB3F207ttlECaEWkb+Nl3bD1Iu/U/YHpkIMQ6N95YP2wzJsp3Do/5kadEK7pB8lG7kleEaqf4DRF193cNqYhTZTihEF6IETb5PZA/K8C96WLQ5beH4V5p4Hc/VX6i7qk8doprGGV173VLfpQMAHsucg1OjV8hQNWg== Original-Received: from DM6NAM10FT023.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::50) by DM6NAM10HT242.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::391) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22; Thu, 1 Jul 2021 19:43:05 +0000 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com (2a01:111:e400:7e86::50) by DM6NAM10FT023.mail.protection.outlook.com (2a01:111:e400:7e86::254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Thu, 1 Jul 2021 19:43:05 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:DD5573DAEE338871CF3F08EEFCF925FA45519E5FC251B08F1D4EF9FAB8E34CBE; UpperCasedChecksum:2EBF716FA094CCE3CB26A7FF5ED635CDC1346F3E5AD0FCF5E700D6A2589A4036; SizeAsReceived:7294; Count:43 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com ([fe80::5c64:1750:c3c7:c182]) by CH2PR01MB5879.prod.exchangelabs.com ([fe80::5c64:1750:c3c7:c182%2]) with mapi id 15.20.4264.027; Thu, 1 Jul 2021 19:43:05 +0000 X-TMN: [pLNK5kHP5EBKEHGcSCSn2plSjQmNxObXVeYP6O9WaAEdsgPNcsXCOOjAQ1f3Uu7J] X-ClientProxiedBy: CPYP284CA0016.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:68::21) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: <87fswxesce.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from desktop (2804:431:c7f2:3723:2e97:3346:1d59:b110) by CPYP284CA0016.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:68::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Thu, 1 Jul 2021 19:43:05 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 43 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 167be389-e3b8-4554-0aed-08d93cc8721c X-MS-TrafficTypeDiagnostic: DM6NAM10HT242: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lrWn3jKWYguHXNIZIbDraulNvjnl9fA4FRyS106DcvgVsaXf6RfvpvGlpqq9M4H7HjAHk4NysLuKwqxAJA0Xh6YYazMQtYGLx/Zde2mKCefQl26z1W5nhIbx/jDqm4j94l/1zwKy3QxuvOOTyhSvTiF+gmHf3TemrxXfjS7G1QCpKRJJzZIwjzwdk55o9f9BzHVMb+oqx1oFcxx5F+4+CWYJPQjUM5819+wPs8/erwFZa+yrpfsFO6Ryq8Zv5LQsYKvM0C+3FGDMEWMu7GF3otKxbrXYKhg9zeBnqR9BK+H+wxTvVUajb3zl4UteHkw3alEcRVRRWQSQoo5T/vHMmzNBnd+GuZ9tyR/YbkbHtrV/SNcv/3QETwX1FrM5c38tQus6gyNSGtLyYPrH3v3RDb9KTqMXShxueMOJRMng6dIGJdGd1FVgGkjSG6++JJAf X-MS-Exchange-AntiSpam-MessageData: GVBcLamdxALmbsdUwRZXX8laDGYBzxJVeKNCgiZ3FY5j41edxwdd/d7Mi436Dw+mIfj+VlMl3ji/Oc1ExKQODoKK4wastbbP5lnI7r8IRdq+oeepcPy2UoMDSTg+an5dfkfqLkfDvkRMO2XmD81uBJpDGK8xVoJPbbr1dOXTfUgcq5sbbqX4YIoDWj19FVGQnQO8dbcKLJgyoTdHiz8EhQ== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 167be389-e3b8-4554-0aed-08d93cc8721c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2021 19:43:05.8300 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM10FT023.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM10HT242 Received-SPF: pass client-ip=40.92.41.49; envelope-from=gabriel376@hotmail.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209285 Archived-At: --=-=-= Content-Type: text/plain This patch adds a new user option to lisp/icomplete.el called 'icomplete-matches-format', similar to 'lazy-count-prefix-format'. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-option-icomplete-matches-format.patch >From 47fbdb57abb38972f2b0929760e4043583ba16a8 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Thu, 1 Jul 2021 16:29:24 -0300 Subject: [PATCH 1/1] Add option icomplete-matches-format * lisp/icomplete.el (icomplete-matches-format): New user option. --- lisp/icomplete.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 26698c43cf..67bae49b9e 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -97,6 +97,12 @@ icomplete-with-completion-tables :type '(choice (const :tag "All" t) (repeat function))) +(defcustom icomplete-matches-format "%s/%s " + "Format of the current/total number of matches for the prompt prefix." + :version "28.1" + :type '(choice (const :tag "No prefix" nil) + (string :tag "Prefix format string" "%s/%s "))) + (defface icomplete-first-match '((t :weight bold)) "Face used by Icomplete for highlighting first match." :version "24.4") @@ -696,12 +702,10 @@ icomplete-exhibit (overlay-put icomplete-overlay 'before-string (and icomplete-scroll - (let ((past (length icomplete--scrolled-past))) - (format - "%s/%s " - (1+ past) - (+ past - (safe-length completion-all-sorted-completions)))))) + (let* ((past (length icomplete--scrolled-past)) + (current (1+ past)) + (total (+ past (safe-length completion-all-sorted-completions)))) + (format (or icomplete-matches-format "") current total)))) (overlay-put icomplete-overlay 'after-string text)))))))) (defun icomplete--affixate (md prospects) -- 2.32.0 --=-=-=--