Replies: 11 comments 26 replies
-
@armindarvish, perhaps sorting |
Beta Was this translation helpful? Give feedback.
-
requiring consult-web-sources.el breaks it for me, since I don't have for example |
Beta Was this translation helpful? Give feedback.
-
So, the problem with DuckDuckGo is that it appears to only working for single word searches and it doesn't work if you enter multiple, space-separated clauses. Google and Brave in contrast work for both. Oh wait... no, I'm wrong. It does sometimes work for multi-word searches, hmm, I guess DDG API is just weird. |
Beta Was this translation helpful? Give feedback.
-
Update: I looked into ths a bit more closely, and I think I now understand why the order of the groups seem random. In the original design of Overall, this is something that would take time for me to work on because right now I am in the process of cleaning up and moving things around with all the new sources I have added. In ym own workflow I am using vertico's cycling (e.g. |
Beta Was this translation helpful? Give feedback.
-
@minad General question for you. If I have multiple sources (async and sync, ...) and the candidates arrive at random times. Is there a way to force vertico to group them in a particular order (maning defining the order of groups)? For example, see the screenshot below. I have turned off grouping in this case and as you can see the list of candidates is a mix of items from different sources in the order they arrived. Right now , when I group them, it seems like vertico is going over the list in a loop and sorts them in groups, and therefore the final order depends on the order in this list (picture below). For example if the second itme in the first picture from Github (kserge/...) had arrived a little bit later after the items from the notes, then the notes group would end up above Github groups in the second picture. I would like to know if there is an easy way to customize that (or perhaps add an step in the consult-completion-refresh-hooks) to rearrange the groups into a fixed order? How would I go about this? |
Beta Was this translation helpful? Give feedback.
-
Well, I think the most efficient way to solve this is to keep references
to the end cons cell of each source. Then you can mutably insert at point.
Right now the consult--async-sink also appends mutably in that way, in
constant time.
Hmmm, that sounds like a great idea but I'm afraid it might be beyond my
comfort zone to implement right now, so I guess all I have to do is wait
for you to get it in Consult!
That seems pretty straightforward, I can take a crack at it sometime.
… —
Reply to this email directly, view it on GitHub
<#29 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBVOLC75FQIBLFF4KYCZB3ZIRWLPAVCNFSM6AAAAABJQ47IYWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQNBSHAZTM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Emacs lists are singly linked cons cells, so inserting in the middle is
free if you have a reference to the address of that cell. It just needs to
change a few pointers, no data needs to be moved in memory. (Conversely,
non-sequential access is expensive since you have to move through the list
cell by cell to find the nth element.)
I'm not a programmer either, so minad can correct me if I'm wrong.
…On Fri, Jun 21, 2024, 12:22 PM Armin Darvish ***@***.***> wrote:
@minad <https://github.com/minad> and @karthink
<https://github.com/karthink> Thinking about this inserting at point, I
am now curios, form a low-level memory perspective, how does a list of
lists, with growing sub-lists get stored? I am not a computer scientists
and don't understand the low-level memory handling at all, but intuitively
I think inserting items in the middle of a list (even if we keep reference
to the cons cell and insert at point) would require moving things around in
the memory and can become expensive once you have thousands of items in the
list. But I have no idea how emacs handles any of this, so I am curious to
learn if any of you can shed some light on that.
—
Reply to this email directly, view it on GitHub
<#29 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBVOLB344VKRJXRTZQKUSLZIR4OTAVCNFSM6AAAAABJQ47IYWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQNBTGEZTO>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ag Ibragimov ***@***.***> writes:
afaik, Elisp lists are not the most efficient for inserting in the middle, they
have O(n) complexity. A bit more efficient for inserting in the middle is a
vector, but they too, have O(n) time complexity. The most efficient thing for
middle insertions in Elisp is I think a "gap buffer".
No, this is not correct as long as you keep a reference to the insertion
point. This is what I'd propose. Then complexity is O(1).
|
Beta Was this translation helpful? Give feedback.
-
afaik, Elisp lists are not the most efficient for inserting in the middle,
they have O(n) complexity. A bit more efficient for inserting in the middle
is a vector, but they too, have O(n) time complexity. The most efficient
thing for middle insertions in Elisp is I think a "gap buffer".
In the current context, we have a reference to the insertion point in the
list so it's very cheap, no traversal necessary.
—
… Reply to this email directly, view it on GitHub
<#29 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBVOLEKODN7PA7BUTLCIYTZIR5ZRAVCNFSM6AAAAABJQ47IYWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQNBTGIYTA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@armindarvish How is the async branch doing apart from the Consult core? I have some ideas to make the gptel source more useful, and to make the Elfeed source faster/use less memory. If you're interested and the basic structure of the source definitions etc is finalized, I can work on PRs now -- or wait until the async branch is done. |
Beta Was this translation helpful? Give feedback.
-
alright consult-omni is now public. We can move the rest of this discussion there. I made one topic already for sorting the groups: armindarvish/consult-omni#1 |
Beta Was this translation helpful? Give feedback.
-
I thought instead of piling every tiny notion about async-branch-related things in the issue #17, maybe better to have a thread here?
Beta Was this translation helpful? Give feedback.
All reactions