emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] 0001-Add-icomplete-count-format


From: Philip Kaludercic
Subject: Re: [PATCH] 0001-Add-icomplete-count-format
Date: Thu, 10 Jun 2021 16:23:19 +0000

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]