Skip to content
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

can't dynamically change prescient-filter-method for org-refile #146

Open
aspiers opened this issue Jun 3, 2023 · 2 comments
Open

can't dynamically change prescient-filter-method for org-refile #146

aspiers opened this issue Jun 3, 2023 · 2 comments

Comments

@aspiers
Copy link

aspiers commented Jun 3, 2023

In #83 I was hoping to achieve a mechanism where I can automatically set prescient-filter-method according to the current completion context (e.g. the command which invoked completion).

I finally got round to trying out the solution kindly provided by @peterstuart in #110, and while I see it calling the prescient-filter-method function, I can't see any way to test whether the command invoking completion was org-refile. this-command is set to self-insert-command; completion-category evaluates to nil, current-minibuffer-command is set to nil.

Am I missing something, or does this mechanism simply not provide enough context to detect when certain commands such as org-refile are invoking completion?

@okamsn
Copy link
Contributor

okamsn commented Jun 16, 2023

I haven't tried it, but maybe Vertico Multiform Mode would work? See https://github.com/minad/vertico#configure-vertico-per-command-or-completion-category.

They give an example that seems to suggest that it would work:

;; Change the default sorting function.
;; See `vertico-sort-function' and `vertico-sort-override-function'.
(setq vertico-multiform-commands
      '((describe-symbol (vertico-sort-function . vertico-sort-alpha))))

Regardless, you might be interested in how they are detecting commands.

@aspiers
Copy link
Author

aspiers commented Jun 16, 2023

Thanks! I think I should try migrating to vertico anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants