-
Notifications
You must be signed in to change notification settings - Fork 115
Fix: prevent preamble evaluation breaking completion framework #285
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Use empty string instead of nil as fallback for "h:".
Hi Caleb, Thanks for your thorough investigation. The problem is that the predicate has no argument when the query is given for preamble expansion. This isn't unique to the So what's probably really needed is for the That's a bit more involved, but it's probably The Right Way(TM) to fix it. By the way, I'm considering publishing org-ql on GNU ELPA, in which case major code contributions would require FSF copyright assignment, like Emacs itself. So before you write any more code, you should keep that in mind. Thanks. |
By the way, while I see the same error you see when I just type |
Yeah, that sounds like a reasonable solution to me.
Thanks for the heads up. Unfortunately I'll have to pass on implementing your Right Way solution then, because I don't want to go through the rigamarole involved. I think you should still be able to merge whichever parts of this PR that you're interested in, if any, since it's short enough to meet FSF's trivial change exception. If you get a chance you might want to call this out in your readme or in a
Now that's interesting... Do you know what commit or version of Vertico you're using? I'd like to try with the same one t
8000
o see what's going on. I'm on minad/vertico@afd1e1b, which is in between tags 0.24 and 0.25 (the |
I thought about it some more a few days ago (when I wasn't in front of a keyboard), and IIRC even that wasn't the best solution. So we'll see.
The eventual solution (if I write one) probably won't involve any of that code, but thanks for the offer. (This is why I generally recommend filing an issue before sending a PR, to avoid writing code that doesn't get used--unless you want the coding exercise, that is.)
This is a very recent idea, brought to my attention by another user and contributor, so I haven't made it official yet. If and when I do, it will be documented.
According to Emacs, I'm currently using Vertico 0.14, originally installed from GNU ELPA. I didn't realize it was so far out-of-date, but of course, it works fine, so why upgrade... :) |
Hi Caleb, I've pushed a fix for this problem. I decided to go over all of the predicates and make sure each one that needed to handle nil arguments worked correctly. In my tests with Thanks for your help with this issue. |
Tested and verified this fix works, no need for my workaround anymore. Thank you! |
Hi @alphapapa,
I encountered an issue using the heading predicate with
org-ql-find
interactively. Typingh:
throws an error which isn't caught, so in my case as a vertico user it prevents any more completion updates from displaying (i.e. typing into the completion minibuffer no longer updates the completions results list). I think this is an issue with org-ql, not vertico, because org-ql should either prevent the error or catch it.Reproduction
org-ql-find
h:
TAB
for default Emacs completion)Result: backtrace that ends with
Alternative reproduction method: run the following elisp snippet and observe the backtrace.
Fix
I made two different commits with different solutions:
heading
preamble specifically.You could use both commits or just one of them depending on what solution seems preferable to you. Let me know if you would prefer a different solution too.