profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/minad/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

libtom/libtommath 472

LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.

judofyr/temple 432

Template compilation framework in Ruby

mimemagicrb/mimemagic 392

Mime type detection in ruby via file extension or file content

minad/affe 85

:monkey: affe.el - Asynchronous Fuzzy Finder for Emacs

minad/bibsync 56

BibSync is a tool to synchronize scientific papers and bibtex bibliography files

decentral1se/tasty-discover 36

Haskell test discovery for the tasty framework :eyes:

minad/3delta 30

Host software especially suited for delta 3d printers

minad/bookmark-view 17

bookmark-view.el - Use bookmarks to persist the current view

minad/9mount 4

Unmaintained fork of http://sqweek.dnsdojo.org/hg/9mount

minad/analyzer 3

Some tools for physics calculations

issue commentminad/vertico

completing-read with obarray

Yes, it appears at the top since "" is a valid return value and the current input takes precedence over the default value if it matches the input exactly. However even if you select "", in the end the default value is returned since the empty string is always treated as the default. So in other words - empty strings can be considered invalid candidates. I suggest you get rid of your empty variable then or patch helpful-predicate-p ;)

haji-ali

comment created time in 4 days

push eventminad/vertico

Daniel Mendler

commit sha 1819c6ad5948417acc459ab2a12ad61ddfc781d5

Revert "Fix oddity for empty candidate strings (See #134)" This reverts commit 25f1ed19676829d146141afd0ad42ee4efdb3b42.

view details

push time in 4 days

push eventminad/vertico

Daniel Mendler

commit sha 25f1ed19676829d146141afd0ad42ee4efdb3b42

Fix oddity for empty candidate strings (See #134) (completing-read "Test: " '("" "x") nil t nil nil "t") (completing-read "Test: " '("" "x" "t") nil t nil nil "t") (completing-read "Test: " '("" "x") nil t)

view details

push time in 4 days

issue commentminad/vertico

completing-read with obarray

There was still some odd behavior if empty candidates are present.

(completing-read "Test: " '("" "x") nil t nil nil "t")
(completing-read "Test: " '("" "x" "t") nil t nil nil "t")
(completing-read "Test: " '("" "x") nil t)
haji-ali

comment created time in 4 days

issue closedminad/vertico

completing-read with obarray

Running (completing-read "Test" obarray nil t nil nil "t") on my Emacs 27.2, the first item in the completion list is an empty string instead of "t" which is the second item. I am not 100% sure where the empty item is coming from.

Is this expected?

closed time in 4 days

haji-ali

issue commentminad/vertico

completing-read with obarray

Is this expected?

Yes. You can create an empty symbol with (intern ""). Using obarray without a predicate is not particularly meaningful.

haji-ali

comment created time in 4 days

issue commentminad/consult

Command wishlist

@mohkale Maybe advise completing-read locally? Prefiltering the completion table with the initial input is also possible. I don't think there is a quick solution.

minad

comment created time in 4 days

issue closedminad/corfu

Corfu completion with yasnippet and/or auctex

Hi all,

I like the package very much, more than company. Really good work!

I wonder if it works with yasnippet and/or auctex because I'm working a lot with latex. In company there is company-yasnippet.

Could not find anything about it.

Regards Thorsten

closed time in 5 days

thorstengrothe

issue commentminad/corfu

Corfu completion with yasnippet and/or auctex

Thanks!

As far as I know there does not exist a Yasnippet capf backend. Corfu only provides a UI and supports only capf backends. Maybe company-yasnippet can be ported over to implement a capf instead of a company backend? Another more general solution would be a general capf wrapper around company backends. But I am afraid that this will be difficult to get right.

Maybe you also use my Consult and Vertico packages? As alternatives you may want to look into consult-company and consult-yasnippet. These packages integrate Company backends or Yasnippet with Consult and work well with Vertico. It is not related to Corfu though.

cc @mohkale, who is the author of consult-yasnippet and consult-company. He can probably tell you more about available yasnippet UIs. I am neither using yasnippet nor company.

thorstengrothe

comment created time in 5 days

issue commentoantolin/embark

Add a customize variable to help user add actions can run directly?

Seems better to not hard code this.

TxGVNN

comment created time in 5 days

issue closedminad/vertico

Auto-select a single candidate

I am switching from selectrum to vertico (I like the minimalism).

The only functionality I am unable to replicate so far is selecting a candidate as soon as it is matched (see https://github.com/raxod502/selectrum/issues/517). It has two features:

  1. The input is matched from the beginning.
  2. Unless the input start with a space, a candidate is accepted automatically when it is the only one remaining, i.e., without having to press RET.

The solution that was suggested in https://github.com/raxod502/selectrum/issues/517 relies on selectrum-refine-candidates-function among other functionality as follows

(defun my/completing-char (prompt collection)
  (let ((selectrum-refine-candidates-function
         (lambda (input candidates)
           (prescient-filter (concat "^" (regexp-quote input))
                             candidates))))
    (minibuffer-with-setup-hook
        (lambda ()
          (add-hook 'post-command-hook
                    (defun submit-for-single-cand ()
                      (when (and
                             selectrum--refined-candidates
                             (null (cdr selectrum--refined-candidates))
                             (not (string-prefix-p " " selectrum--virtual-input)))
                        (selectrum-select-current-candidate)))
                    nil t))
      (string-trim-left (completing-read prompt collection) " "))))

Is this doable in vertico?

closed time in 5 days

haji-ali

issue commentminad/vertico

Auto-select a single candidate

(2) can be solved by the solution given by @clemera in raxod502/selectrum/issues/517 using the hook.

(defun submit-for-single-cand ()
  (when (= 1 vertico--total)
    ;; (2) exit if only a single candidate
    (vertico-exit)))
  
(minibuffer-with-setup-hook
    (lambda ()
      ;; (1) adjust completion style to achieve desired matching
      (setq-local completion-styles '(basic))
      (add-hook 'post-command-hook 'submit-for-single-cand nil t))
  (completing-read "Example: " '("abab" "bcbc" "cdcd"))

The other question (1) of matching at the beginning is too unspecific. Vertico uses completion styles for filtering. Prescient is unsupported. If you are using Orderless as an alternative you can use an Orderless style dispatcher which was also already pointed out by @clemera. In the example above I set the completion style locally to the basic completion style, which always matches from the beginning. You can also write your own completion style and install it locally only for the current completion session. See for example https://github.com/minad/vertico#tramp-hostname-completion, where I define the special basic-remote completion style. I hope this answers your questions.

haji-ali

comment created time in 5 days

issue commentmohkale/consult-eglot

Do you plan to put this on MELPA?

Thanks for your answer. My opinion regarding bibtex-completion is that instead of functions, it should use commands directly with an interactive specification to select entries via completing-read. This was originally proposed in a PR to bibtex-completion, but didn't make it in. I've heard that bibtex-actions is slowly abandoning bibtex-completion and moving over to parsebib only. Regarding org-ref there seems to be also some movement to make it more decoupled from helm and ivy and integrate it with the new org-cite extension and abandoning org-ref-cite on the way. We will see which solution turns out to attract most users.

That said there should probably be a unifying package bundling them all together. Just like I believe you mentioned eventually there'll be one for consult+embark+marginalia+selectrum/vertico etc.

No, I never believed such a unifying bundling package should exist. There was some talking on reddit and on the issue trackers that selectrum etc is too hard to setup and such a bundle should exist. I was never convinced of that. I think it is much better to have small modular components and user put them together in their configuration. Users who want something prebundled can use distributions like Doom, Spacemacs or build something from some existing configurations. I also don't think the packages are hard to setup - not harder than other commonly used Emacs packages. See https://github.com/minad/vertico/#complementary-packages for my recommended way to use the packages, which should even be beginner friendly. At least if there is some basic familiarity with how Emacs works.

minad

comment created time in 6 days

issue closedminad/consult

Can't find match by consult-isearch

Linux Mint 20 Emacs 27.1 consult

In some buffer I has a text:

emacs
Emacs
emacs-27
emacs-26
GNU Emacs
Emacs-28

Match those that end with a number.

I use regexp [0-9]$ for this and use built-in Emacs function

isearch-forward-regexp

Result 1

As you can see it success find 3 matches. Nice.

Now I want to do same by consult. I use command:

consult-isearch

Result: 2 3

As you can see nothing found.

closed time in 6 days

alexei-28

issue commentminad/consult

Can't find match by consult-isearch

consult-isearch has a different purpose, the command allows you to select a search string from a previous search. It is supposed to be a replacement for M-s e. The docstring of consult-isearch documents this.

alexei-28

comment created time in 6 days

issue commentmohkale/consult-eglot

Do you plan to put this on MELPA?

Cool. I wonder a bit about of the necessity of consult-bibtex. Isn't bibtex-actions more sophisticated and flexible? I also like that it is completion system agnostic. There are so many bibliography-related packages, I lost track.

  • consult-bibtex
  • bibtex-actions
  • bibtex-completion, ivy-bibtex, helm-bibtex
  • org-ref
  • org-ref-cite
  • org-cite mechanism in org
  • biblio
  • ...

Of course there may be some genuine advantage of each of these packages, but I would prefer it more if there is some consolidation.

minad

comment created time in 6 days

issue commentmohkale/consult-eglot

Do you plan to put this on MELPA?

Regarding you other consult-* packages, I assume you will also publish them via MELPA? I linked your packages here: https://github.com/minad/consult/#recommended-packages

minad

comment created time in 6 days

issue commentminad/vertico

Empty initial candidate list

One more remark - there has been some Emacs upstream discussion in bug#38024 about the usage of while-no-input in icomplete before. It may make sense to dig up that discussion and its conclusion. I haven't seen manual restart using a timer being discussed there, but I also don't remember what the actual problem was.

cmacrae

comment created time in 6 days

issue commentminad/vertico

Empty initial candidate list

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.

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 while-no-input-ignore-events. However the reason for me not seeing spurious event issues is that these input events are rare since the recomputation is often fast enough. This is like relying on a race condition :shrug: However when typing the input quickly the character inputs are usually not lost, otherwise Emacs wouldn't work at all. I think here we are talking about another type of event, maybe not even a keypress event. Admittedly I never looked carefully into these input event types, so I am out of my depth here.

Sounds good. If I get some time I'll see what I can figure out.

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:

https://github.com/minad/vertico/blob/0df75c0bbc545b1bd008718b1af2e6c0df18fe74/vertico.el#L538

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.

cmacrae

comment created time in 6 days

push eventminad/consult

Daniel Mendler

commit sha 6f07e1bdb2023871855b44f44153ad87af15a9ee

Update bug report section

view details

push time in 6 days

GollumEvent

push eventminad/consult

Daniel Mendler

commit sha f02258470406434b500298c8d5089e92ef952f75

Add acknowledgments and update links to other

view details

push time in 6 days

issue commentminad/vertico

Empty initial candidate list

Because I have no idea how make-frame-visible could trigger there being pending input when there wasn't before.

I also don't know. But what I know is that the child frame API and the display code is complicated and buggy. It isn't unexpected to see such bugs. On the other hand I haven't seen this with mini-popup, which points at mini-frame being the problem.

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.

I disagree with that. If input is pending, the input will be processed and execute further commands and the post-command-hook. However the assumption is probably too restricted if frames are involved since the post-command-hook is buffer local in the minibuffer and while-no-input is unrestricted. On the other hand there is while-no-input-ignore-events to explicitly exclude events, if these particular events will not lead to commands and post command hooks. Also note that the while-no-input pattern and post-command-hook pattern are used in the same form by icomplete. I didn't invent this, so I am not particularly happy to invent my own fix here or at least I would like to see a similar fix proposed to upstream.

I see you just mentioned a timer in the PR

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.

cmacrae

comment created time in 6 days

PR closed minad/vertico

Do not respect input-pending-p on initial load

Fixes #115

This may not be the best solution, but unless someone knows what is causing input-pending-p to get set, or a timer would be better, this was the most straight-forward approach that I could think of.

+11 -3

1 comment

1 changed file

aaronjensen

pr closed time in 6 days

pull request commentminad/vertico

Do not respect input-pending-p on initial load

Closing this for the reasons discussed in https://github.com/minad/vertico/issues/115#issuecomment-925033279. Hopefully the issue can be dealt with on another level. If not, we can revisit. However preventing the initial candidate computation from being interruptible is harmful. A timer as workaround may be the better solution in order to ensure restart for spurious input events.

aaronjensen

comment created time in 6 days

issue commentminad/vertico

Empty initial candidate list

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.

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.

This also makes sense, but would it be reasonable to have a method of resuming if it is interrupted?

No such mechanism exists, one could use a timer. I just assume that while-no-input etc do the right thing. This may not be the case but then one would need some clarification from Emacs upstream on how this API is actually supposed to be used. However I rarely had issues with such spurious interrupts and if it happens you can always press space ;)

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.

Sure, that's the assumption. That's the point of the while-no-input API.

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.

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, corfu and posframe - they are 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.

cmacrae

comment created time in 6 days

issue commentminad/vertico

Empty initial candidate list

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:

  1. I don't like to add fixes here, which should actually be fixed at the root. mini-frame is the issue here, the issue does not occur with the usual minibuffer. mini-frame does a lot of special things.
  2. The input pending check I have right now is there for a reason - it makes sense like this. If there is input pending (even after init), the expensive candidate computation must be interruptible such that the UI stays responsive. This is particularly important during initialization, since then the initial minibuffer input is usually empty such that no filtering is performed. This leads to the computation and sorting of all available candidates, which is expensive and which should be interruptible.
cmacrae

comment created time in 6 days

issue commentminad/corfu

Suggestion: "soft" highlight first implicit candidate when none are selected

@salutis (1) is exactly what @jdtsmith proposed. See https://github.com/minad/corfu/issues/45#issuecomment-895876009 for the issue with pre-selection. For (2), to get rid of the magic it probably suffices to unbind RET or to rebind it to newline.

jdtsmith

comment created time in 6 days

issue commentminad/vertico

Empty initial candidate list

@aaronjensen thanks for looking into this. Can you report this issue upstream to see if it can be worked around in mini-frame.

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 with exwm for example. On the other hand it seems to work more robustly in my tests. I've recently seen there is also a vertico-posframe package, but I didn't try it yet.

cmacrae

comment created time in 6 days

issue closedminad/vertico

Unknown face

CleanShot 2021-09-22 at 07 24 58@2x

In some of my vertico completions, the letter after my search term is highlighted differently than the rest of the line and the term. How do I go about figuring out which face that is so I can adjust it, and why is it doing that?

closed time in 6 days

aaronjensen