New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty initial candidate list #115
Comments
I am having the same issue and am having a hard time getting to the bottom of it. I cannot reproduce it with the following minimal config using
However, I can reproduce it using my normal config if I do the following:
I will try eliminating parts of my config to get at which setting is causing the error. I鈥檓 also willing to supply my entire configs for the relevant packages if @minad needs more info. |
@cmacrae I cannot reproduce this with emacs -Q. |
I also see this, but don't have a more narrow repro. Restarting emacs fixes it. Disabling mini-frame fixes it too (until I re-enable it). |
For me, the problem is the input-pending-p check After this line in mini-frame Removing the |
Thanks for looking into this @aaronjensen. Unfortunately your fix did not solve my particular bug. I'll dive into the issue deeper asap. |
Thanks so much for looking into this @aaronjensen 馃檱 I'm running your changes now. So far so good, but I haven't been using them for long. Will report back in a little while :) |
@aaronjensen Thanks for looking into this. Can you please report this issue to mini-frame to see if it can be worked around there? As an alternative I have a small mini-popup package which is technically a bit simpler than mini-frame and might work for you. However it is more limited than mini-frame, doesn't play well with exwm for example. On the other hand it seems to work more robustly in my limited tests. I've recently seen there is also a vertico-posframe package, but I didn't try it yet. Also note the vertico-buffer extension which allows you to open the minibuffer at the top - but you probably still prefer a floating minibuffer? |
I think it'd have to go all the way to emacs. I don't see that mini-frame is doing anything special. Of note, from the docs of
I wonder if this is one of those "doubt" situations... I may be able to try and narrow a repro down at some point. I did try mini-popup, but I can't remember why I switched back to mini-frame other than I already had exclusions and faces set up right on it. There may have been other things... I can try it again. I'll also look at |
Also, you may want to consider something like #131 regardless. Right now if there is actually input pending for some legitimate reason it would break in the same way, I think. |
I am not inclined to merge this workaround, for these reasons:
|
I totally agree with this. I'm not able to be convinced it is a mini-frame issue yet, but that's just from lack of clarity.
This also makes sense, but would it be reasonable to have a method of resuming if it is interrupted? That's ultimately the issue right now is that something (unclear what) interrupts the first update, but it will not update again until there is user input. I'd venture a guess that the expectation is that that update would get to run again immediately after the pending input is processed, allowing results to be displayed. That said, I'm happy to play around with the alternatives and see if I can get something working. I looked at vertico-posframe and it currently lacks a way to opt out of using it for certain commands, but I'm sure I can hack that in if I end up using that. |
Why is that? You said yourself that you don't see the issue without mini-frame. From my experience mini-frame is not a robust package, so I am quicker to blame it, which may be unfair. But there is a reason why I attempted something else with mini-popup. I also argue that the Vertico code in its current form makes sense, even if it would happen with the default Emacs minibuffer I would wonder if there doesn't actually exist an underlying input handling bug in
No such mechanism exists, one could use a timer. I just assume that
Above I criticized that mini-frame is not robust. My criticism also applies to posframe. Therefore I am using the child frame API directly in corfu and mini-popup. But if you look at the code of mini-popup, miniframe, corfu and posframe - they are all full of hacks to get the child frames to work. The underlying cause is that the Emacs child frame code is hard to use and buggy. I don't recommend child frames at all if they can be avoided. Personally I am using Corfu and it works well enough for my purposes but from time to time new child frame bugs crop up there, which I also port to mini-popup then. |
Because I have no idea how
Well, the idea of it is that it aborts what it is doing when there is input. It will not resume unless you explicitly build that (for example, one could set a timer to run the operation again if it was interrupted, which would allow the pending input to be processed. (I see you just mentioned a timer in the PR 馃憤 ) |
I also don't know. But what I know is that the child frame API is buggy and hard to use. For me it isn't unexpected to see such issues. On the other hand I haven't seen this with mini-popup, which points at mini-frame being the problem and not the underlying child frame code.
I disagree with that. If input is pending, the input will be processed and execute further commands and the
You mentioned timer before in your PR - I just acknowledged that this would be a potential solution. This does not mean that I will merge such a work around for the given reasons. At first the root cause should be narrowed down better. |
There is the mysterious documentation I referenced earlier: "Actually, the value is nil only if we can be sure that no input is available; if there is a doubt, the value is t." which essentially says this cannot be relied on.
Sounds good. If I get some time I'll see what I can figure out. The most odd thing is that this is not constant. If I restart emacs, it doesn't happen. Something happens that causes the input-pending issue, and once that happens, it's always there until I restart again. |
You are probably right about this if one wants to be on the safe side. I am also kind of astonished that it works so well without a manual restart. I never observed spurious event issues and I've yet to see a reproducible where mini-frame is not involved. And if there are certain spurious events one could add them to
Sure. But note that I won't merge a special workaround for mini-frame. I've been strict on this one before (also regarding Consult) and it then lead to fixes in mini-frame which is a better outcome. Currently there is exactly one mini-frame work around (as I am aware) in Vertico: Line 538 in 0df75c0
But this work around is of a general nature and therefore feels acceptable. Vertico resizing generally bails out of window resizing when the minibuffer window lives in its own frame. |
One more remark - there has been some Emacs upstream discussion in bug#38024 about the usage of |
The issues being discussed are a little above my pay grade, but I did narrow down what was causing my particular issue. It was the package yascroll. To reproduce, eval the following in the scratch buffer of an
Then in a new line type the word "texts", enter a new line, type "tex", My lisp skills are not good enough to diagnose why the |
I have a patch ready to apply, which fixes the underlying emacs issue. See: https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01242.html Unfortunately, this workaround prevents it from working because
|
@aaronjensen Great, thank you for looking into the underlying issue! How is icomplete affected by this? Line 429 in 0c73d61
|
I wish I knew. I have no idea why narrowing that list fixes anything or even what the initial problem was. |
@aaronjensen Btw, are the other child frame packages (vertico-posframe, mini-popup) a solution for you? See https://github.com/minad/vertico#child-frames-and-popups. vertico-posframe seems to be pretty solid now, while my experience with mini-frame has always been a bit shaky. |
I forgot to report back here, but the fix for input-pending-p was installed to master. Another change was installed as well that makes it so the problem should only happen the first time after mousing over the echo area, so even override of while-no-input-ignore-events it should only happen once. I can't reproduce the issue with vertico-posframe, though I have no idea what it does that is different. I prefer mini-frame because it does dynamic resizing and has a variable that lets me ignore specific commands, which I make use of. If you added help-echo to the override of |
I found the difference. What would you think about adding |
I can not reproduce the icomplete bug using the original repro when the workaround is removed. I'm going to submit a patch to remove the work around because it does not seem necessary anymore and it is having downstream impacts when it is copied to other libraries like this. |
@aaronjensen: I ran into this problem. Do I understand correctly that your patch applies only to Emacs 29, and a workaround for pre-29 requires use of the |
@gcv that all sounds right. |
Hey @minad 馃憢
Thank you very much for vertico 馃檱
I seem to have some strange issue with candidates not appearing in the initial list.
This seemingly happens at "some point" after I've started Emacs. Initially it seems to work fine, providing candidates like so:
But after a while, initial candidates disappear:
If I type
<SPC>
then<Backspace>
the list populates.Any ideas what could be causing this?
Here's the config I'm using:
The text was updated successfully, but these errors were encountered: