emacs-devel
[Top][All Lists]
Advanced

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

Re: Question about completion behavior


From: Ergus
Subject: Re: Question about completion behavior
Date: Wed, 9 Mar 2022 02:46:19 +0100

On Tue, Mar 08, 2022 at 07:22:11PM -0500, Stefan Monnier wrote:
Ergus [2022-03-09 01:10:13] wrote:
In the code that hides the completions there is actually a comment about
this:

;; We could also decide to refresh the completions,
;; if they're displayed (and assuming there are
;; completions left).

Is anyone working on this?

When I wrote that code (and that comment), my main goal was to rewrite
the C code into ELisp, introduce the `completion-styles` system and add
`partial-completion` to the default.

To maximize the chances that it be accepted, I made every effort to try
and preserve the old behavior w.r.t everything else.

Was all this behavior intended or how do you propose to solve this?

I think this can be changed.
Patches welcome.

I am struggling how to preserve the old behavior indeed, because what I
find a bit confusing is actually the default behavior.

We could just add an extra custom to change this detail on demand, but
my initial concert was about the inconsistency itself in the default
behavior. For me it seems like the hide-completions may be inside the
if.

Something like:

```
(completed
       (when exact
         (minibuffer-hide-completions)
         ;; If completion did not put point at end of field,
         ;; it's a sign that completion is not finished.
         (completion--done completion
                           (if (< comp-pos (length completion))
                               'exact 'unknown))
         ))
```

gives a consistent behavior IMO.

But as I know that changing a behavior may be impossible maybe we need
another custom with something like:


```
(completed
       (when (or exact the-new-custom)
            (minibuffer-hide-completions))
       (when exact
           ;; If completion did not put point at end of field,
           ;; it's a sign that completion is not finished.
         (completion--done completion
                           (if (< comp-pos (length completion))
                               'exact 'unknown))))
```

Do think that you any of those may be valid? Some side effect I am not
aware of?



       Stefan

Thanks,
Ergus


reply via email to

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