-
Notifications
You must be signed in to change notification settings - Fork 33
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
How to get completion category? #94
Comments
@raxod502 We could allow passing any |
After thinking about it the above wouldn't work because functions like Let-binding With the above considerations I think we should simply allow passing the variables as args to |
What's wrong with just let-binding those variables? If you did something recursively, wouldn't they be let-bound recursively to the correct values? |
Only for the cases where they are let bound. This can be done for the selectrum functions which integrate with the completion API but not for custom commands written by users or for example |
Okay... so I guess then your PR seems fine, but it should have logic in |
Aren't |
Using a named variable as a function argument creates a lexical binding, not a dynamic one (thank goodness). You need to invoke |
Yes but I believe it should be a lexical one sorry if I expressed that confusingly. |
Wait a moment I have to check something. |
Sorry I was confused they should be dynamically bound but I think they are because |
;;; selectrum.el --- Easily select item from list -*- lexical-binding: t -*-
(defvar special-var nil)
(cl-defun check (&key special-var)
(check2))
(defun check2 ()
(message "is see %s" special-var))
(check :special-var "this") |
Actually, I did that test too. But I did it without |
Interesting I did not thought about that first and just assumed special vars are always dynamically bound even when passed as function arguments. I agree that it's better that they are not for regular defun. Ideally that would be the case for |
This seems to be fixed now, so I'm closing this issue. |
I will also soon add instructions to the wiki how to setup embark for selectrum. |
Hello,
User @oantolin has created the packages embark, which allows using commands similar to Ivy or Helm actions. Different commands are made available, depending on what is being completed (file, buffer, etc.).
To do this, they use the following expression to detect what kind of completion is happening:
In Selectrum, this returns that buffer names are being completed, even in commands like
find-file
oramx
. I do not have this problem with normal Emacs completion.Why does this happen, and is there a way to get the actual completion category?
Thank you.
The text was updated successfully, but these errors were encountered: