From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] 0001-Add-icomplete-count-format Date: Thu, 10 Jun 2021 16:23:19 +0000 Message-ID: <87o8cdwux4.fsf@posteo.net> References: <10b39c09.41d1.179f4e7a630.Coremail.tumashu@163.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29233"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: tumashu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 10 18:24:02 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 1lrNTN-0007P7-O4 for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Jun 2021 18:24:01 +0200 Original-Received: from localhost ([::1]:40002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrNTM-0003Qt-PK for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Jun 2021 12:24:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrNSo-0002Oi-8N for emacs-devel@gnu.org; Thu, 10 Jun 2021 12:23:26 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:42607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrNSl-0007DL-K6 for emacs-devel@gnu.org; Thu, 10 Jun 2021 12:23:26 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 21398240026 for ; Thu, 10 Jun 2021 18:23:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1623342201; bh=pxWvLHS3bmWBBAsS+sfnaZNxGM/hvCzM1Ay1mP/H8hA=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=eOuck51k1Y2tAstdpRUbvalL441V1xqAc+OtTX26uPi+DSnIzzhc25ebqP08UY3Mo pI0TkuPpP2foKxvkn2kPBdy47UghSlPutpJ29tzsBULcOpNROnZJppvXzIL1kz23YG BlVkrcpu3BYNmTKPA2L2Ihlm8wi3WntPs0BYZe+a5+xVY2oDS1GhB5LJwA8Y/OvL+i +aV4WIeLMy0t2XnOuMEi0j6TrBrnkl3dK5oEr+4inPnW87YvKw+SP6rHuRLCLjb8op jbTJSyH2IWZg+Npo1gtGpBR+C/qM9Jfw0xXePvdCAdVmuUsv0uFeGgyoNKE1dKQpUA C+FJnMgQScdjw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4G18RD1Xjzz9rxB; Thu, 10 Jun 2021 18:23:19 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=mutual; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: <10b39c09.41d1.179f4e7a630.Coremail.tumashu@163.com> (tumashu@163.com's message of "Thu, 10 Jun 2021 15:51:32 +0800 (CST)") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:270652 Archived-At: tumashu writes: > From 6074e1f4c5564e5d9e56041cc7db6fd7125571cb Mon Sep 17 00:00:00 2001 > From: Feng Shu > Date: Thu, 10 Jun 2021 15:48:51 +0800 > Subject: [PATCH] Add icomplete-count-format. > > * lisp/icomplete.el (icomplete-count-format): New variable. > (icomplete-exhibit): Use icomplete-count-format. > --- > lisp/icomplete.el | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/lisp/icomplete.el b/lisp/icomplete.el > index 08b4ef2030..0881bade98 100644 > --- a/lisp/icomplete.el > +++ b/lisp/icomplete.el > @@ -70,6 +70,10 @@ icomplete-hide-common-prefix > :type 'boolean > :version "24.4") > > +(defcustom icomplete-count-format (cons "%-7s" "%s/%s ") > + "Format string used for the candidate count." > + :type '(choice (const nil) (cons string string))) You need a :version "28.1" here. > (defvar icomplete-tidy-shadowed-file-names nil > "If non-nil, automatically delete superfluous parts of file names. > For example, if the user types ~/ after a long path name, > @@ -696,12 +700,13 @@ 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)))))) > + (format (car icomplete-count-format) Does this really have to be another format string? Or would this always just be used for justification? > + (let ((past (length icomplete--scrolled-past))) > + (format > + (cdr icomplete-count-format) > + (1+ past) > + (+ past > + (safe-length completion-all-sorted-completions))))))) > (overlay-put icomplete-overlay 'after-string text)))))))) > > (defun icomplete--affixate (md prospects) -- Philip K.