-
Notifications
You must be signed in to change notification settings - Fork 142
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
sly-read-symbol-name + helm => eval error #214
Comments
seems to be caused by a14e64c. I managed to work around the issue by replacing |
I don't know exactly what is at stake here, but if you must break out of the loop for helm to work, then I'd suggest it's a problem in helm. But I'll take a closer look when I can. |
In the meantime, thanks a lot for the analysis @good-as-soma and @pouar |
@joaotavora, I hope to spend more time working on it and find out for sure whether it's sly or helm, and ideally find a satisfactory solution. Something I noticed that might help with your inquiry: Stepping through |
I mostly found it with git bisect and came up with the workaround after looking through the Emacs documentation. Only happened inside helm, so I added a check to the function to see if Emacs had a helm window up. |
Hi @good-as-soma, sorry for the delay in answering. I am still analysing this, and part of my response to it depends on the outcome of this Emacs bug: https://debbugs.gnu.org/34394. There is also the question the question of why you are calling helm directly on
Since those implementation details are supposed to be hidden behind Emacs |
Hi @joaotavora, thanks for replying, delayed or not. I first came across the bug while using Spacemacs with the common-lisp-sly layer from @mfiano. It would occur when using functions (both interactively and programmatically) that relied on
and that trying the call in isolation reproduced the bug. When debugging, I normally reproduce it by evaluating
as it better reflects how I would be interacting with the code. Sorry the initial snippet and report I provided were unclear. As an update to my debugging, I think the bug may be related to Thank you for your time, and good luck on the emacs bug. |
I am not sure if that even still works. I stopped maintaining |
Hmm, good to know. Thanks! |
well, |
Hi @ramenbytes and @pouar, I finally had a change to test Helm out with SLY to debug these things.
I got a working SLY repl. Completions are accessible through Anyway, I'm removing the "serious" label, but keeping the issue open while I try to understand and fix the original problem. |
* lib/sly-completion.el (sly-read-symbol-name): Ensure completing-read-function is the default.
I've pushed a workaround. You can now use SLY with Helm loaded, but SLY's interface for completing symbols will be used instead of Helm's (you'll still probably use Helm's for everything else). I'll open an issue in the Helm repository for some support. |
I've been using it for sly-edit-definition, but I worked around it with |
Oh, ok. Can you check if my recent commit ff6771d has the same effect as your workaround? I'm still keeping the issue open so I can eventually get Helm working properly with SLY (i.e. using Helm's UI). |
doesn't seem to |
although using (defun pouar-completing-read-sly (prompt collection &optional predicate require-match
initial-input hist def inherit-input-method)
(sly--with-sly-minibuffer
(let ((icomplete-mode nil)
(completing-read-function #'completing-read-default))
(completing-read prompt collection predicate require-match
initial-input hist def inherit-input-method))))
(setf (alist-get 'sly-edit-definition helm-completing-read-handlers-alist) 'pouar-completing-read-sly) does |
@pouar I can't reproduce this behaviour. I just tried with the latest git heads of both SLY and Helm and any symbol query works as expected (i.e. it uses SLY's UI). Perhaps you have a stale .elc file when you upgraded to the latest SLY head? |
ok, it works, I forgot that I installed from MELPA instead of git |
This introduces a new "backenbd" completion style (per completion-styles-alist) that allows SLY's function backend to be written more concisely and comply more closely with other UI's (such as icomplete or others), which can be used if the user turns off sly-symbol-completion-mode. Also motivated by emacs-helm/helm#2165. * lib/sly-completion.el (completion-styles-alist): Add backend completion-style. (completion--backend-call, completion-backend-try-completion) (completion-backend-all-completions): New helpers. (sly--completion-function-wrapper): Simplify, and rewrite. (sly--completion-request-completions): Remove "no completion message" (sly-simple-completions): Add a bit of doc. (sly--completion-function-wrapper): Rewrite. (sly--completion-setup-target-buffer): Remove. (sly--setup-completion): New helper. (sly-symbol-completion-mode): New minor mode (sly-mode-hook): Use sly--setup-completion. (sly--completion-in-region-function): Cleanup slightly. (sly--with-sly-minibuffer): Simplify. (sly-minibuffer-setup-hook): Add a bit of doc.
Here's an update on the situation:
I'm closing this, may reopen if someone thinks there is still something to be done on the SLY side. |
This introduces a new "backend" completion style (per completion-styles-alist) that allows SLY's function backend to be written more concisely and comply more closely with other UI's (such as icomplete or others), which can be used if the user turns off sly-symbol-completion-mode. Also motivated by emacs-helm/helm#2165. * lib/sly-completion.el (completion-styles-alist): Add backend completion-style. (completion--backend-call, completion-backend-try-completion) (completion-backend-all-completions): New helpers. (sly--completion-function-wrapper): Simplify, and rewrite. (sly--completion-request-completions): Remove "no completion message" (sly-simple-completions): Add a bit of doc. (sly--completion-function-wrapper): Rewrite. (sly--completion-setup-target-buffer): Remove. (sly--setup-completion): New helper. (sly-symbol-completion-mode): New minor mode (sly-mode-hook): Use sly--setup-completion. (sly--completion-in-region-function): Cleanup slightly. (sly--with-sly-minibuffer): Simplify. (sly-minibuffer-setup-hook): Add a bit of doc.
Great! Thanks @joaotavora and @pouar for the work put into fixing this. |
This should start emacs with helm and sly loaded and a repl waiting. If I eval this elisp snippet:
(helm-comp-read "foo " (sly--completion-function-wrapper sly-complete-symbol-function))
I get a helm completions buffer with prompt
foo
, so far so good. If, however, I start typing into that buffer it will take one character and then quit. Running this in IELM yields the following error:*** Eval error *** Quit during evaluation
Certain characters do not trigger this, they are:
!@#$^&*()_=+{}[]|\,.<>?~;
and the space and backquote characters.Unless I missed one, all the other characters I have tried (U.S qwerty keyboard) result in an eval error. Typing one of the exempt characters and then typeing erroring characters is permitted, such as
&rest
.I do not think it is something originating in the returned sly completion function based on some debugging, but I am not certain. I do not recall being able to replicate the error with different
collection
arguments tohelm-comp-read
.I'm working through the backtrace and call tree trying to find out what's up, but would appreciate any help and/or input you can offer. Thanks for all your work with Sly, I really appreciate what it adds to my programming experience.
The text was updated successfully, but these errors were encountered: