unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: tumashu <tumashu@163.com>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: [PATCH] 0001-Add-icomplete-count-format
Date: Thu, 10 Jun 2021 16:23:19 +0000	[thread overview]
Message-ID: <87o8cdwux4.fsf@posteo.net> (raw)
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)")

tumashu <tumashu@163.com> writes:

> From 6074e1f4c5564e5d9e56041cc7db6fd7125571cb Mon Sep 17 00:00:00 2001
> From: Feng Shu <tumashu@163.com>
> 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.



  parent reply	other threads:[~2021-06-10 16:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  7:51 [PATCH] 0001-Add-icomplete-count-format tumashu
2021-06-10  9:53 ` 0001-Add-icomplete-count-format tumashu
2021-06-10 16:23 ` Philip Kaludercic [this message]
2021-06-11  0:09   ` Re:Re: [PATCH] 0001-Add-icomplete-count-format tumashu
2021-06-17  3:24     ` tumashu
2021-06-17  8:02       ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8cdwux4.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=tumashu@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).