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

Symex state bindings become inactive upon entering other states #9

Open
countvajhula opened this issue Oct 14, 2021 · 0 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@countvajhula
Copy link
Owner

countvajhula commented Oct 14, 2021

(Note: the workaround below has already been added to the Rigpa Emacs config in the README. It will be removed once we have a fix.)

As a result of a recent change in Symex, entering View mode or Window mode momentarily (to e.g. adjust the zoom level) and then returning to Symex mode loses the symex keybindings. The bindings are restored upon re-entering Symex state once again.

(Scroll to the bottom for a workaround)

Explanation
This happens because the fix in the symex package involved adding a hook to disable the editing minor mode in case rigpa isn't present, to ensure that the bindings are disabled upon exiting symex state. This behavior conflicts with Rigpa's handling of the same functionality. They ordinarily should not interfere since symex defers to Rigpa's handling if it knows rigpa is installed.

But at the moment, Rigpa (via init.el configuration) loads after symex (I don't recall exactly why at the moment), so at the time Symex loads on emacs init, rigpa isn't available and the hook to disable the minor mode within Symex gets initialized, causing it to interfere with Rigpa later on.

Workaround
The workaround for now is to evaluate this expression sometime after Emacs loads:

(remove-hook 'evil-symex-state-exit-hook #'symex-disable-editing-minor-mode)

Possible Fixes
A proper fix would be to:

  1. understand why Rigpa disables minor modes on the entry hooks to other states rather than on the exit hook of the concerned state (I think there was a reason, but it would be nice if we could do it on the latter, since that's cleaner and it's what Symex does now)
  2. avoid dependence of these packages on one another at load time. Or at least, have Symex load after Rigpa
  3. Ideally make the behavior here compatible across the two packages whether the other package is installed or not
  4. Worst case, explicitly disable third-party (i.e. Symex) hooks in Rigpa that may interfere with its functionality
@countvajhula countvajhula added bug Something isn't working good first issue Good for newcomers labels Oct 14, 2021
countvajhula added a commit that referenced this issue Aug 9, 2024
This streamlines these actions so they're taken at the appropriate
points in the mode transition lifecycle. Currently, some of these are
no longer functioning correctly (e.g. keybindings no longer active in
Symex state, #9), but we'll hopefully restore their functioning in a
proper way as we go.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant