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

Unicode substitution broken with helm #204

Closed
non-Jedi opened this issue Jan 25, 2024 · 7 comments
Closed

Unicode substitution broken with helm #204

non-Jedi opened this issue Jan 25, 2024 · 7 comments

Comments

@non-Jedi
Copy link
Contributor

non-Jedi commented Jan 25, 2024

@giordano reports:

Yes, "\alph" for me is completed to "\alpha", not "α", further pressing M-C-i does nothing. Not sure it's relevant, but I use Helm. I also have auto-complete installed, but doesn't seem the mode is active in my julia buffer.

Locally, I've confirmed that with only julia-mode installed, C-M-i correctly completes "\alph" to "α". If helm is installed with the following minimal config, C-M-i completes "\alph" to "\alpha":

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

(package-install 'julia-mode)

(package-install 'helm)
(helm-mode 1)

This seems like a re-occurrence of emacs-helm/helm#2356, but more investigation is needed.

@non-Jedi
Copy link
Contributor Author

Ran the snippet from emacs-helm/helm#2356, and this issue is not the same as emacs-helm/helm#2356; :exit-function is properly called with 'finished. Will need to do some more digging to figure out what's going on here.

@non-Jedi
Copy link
Contributor Author

Workaround until this issue is resolved is to manually call expand-abbrev (C-x ' in default emacs keybindings) after completing a latex symbol or enable abbrev-mode.

@MasonProtter
Copy link

MasonProtter commented Feb 29, 2024

For anyone else running into this, another solution is just to revert to the version of julia-emacs before all the completion changes from the PR #185 were introduced. I use commit 7aafa8e which also fixes #188

@MasonProtter
Copy link

#196 appears to fix it too

non-Jedi added a commit that referenced this issue Mar 15, 2024
According to the docstring for completion-extra-properties, the "STRING" passed to the
:exit-function should be the bare text to which the field was completed, but helm-mode adds
an extra space at the end of "STRING". Since none of our latexsubs include whitespace, we
can safely strip whitespace in the :exit-function and work around this helm bug.

I will file an upstring bug report against helm, but I think it's worth fixing quickly here
since it's only a simple 3-line change.

Closes #204.
@non-Jedi
Copy link
Contributor Author

Reopening per #206 (comment)

@non-Jedi non-Jedi reopened this Mar 18, 2024
@non-Jedi
Copy link
Contributor Author

So the current issue is that \alph<TAB> calls :exit-function with 'finished whereas \alpha<TAB> calls :exit-function with 'exact. According to the docstring for completion-extra-properties, this is a helm bug since the text may not "be further completed". This bug, unlike the one fixed in #206 is a similar but more specific version of emacs-helm/helm#2356.

@non-Jedi
Copy link
Contributor Author

Thierry fixed things on the helm side (emacs-helm/helm#2646). Could you please check again that the issue is fixed for you with latest master of helm @giordano?

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

Successfully merging a pull request may close this issue.

2 participants