-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use Lithium instead of Hydra and Evil #20
base: main
Are you sure you want to change the base?
Commits on Jul 26, 2024
-
Use Lithium instead of Hydra in View mode
Hydra was useful to prototype Rigpa modes, but we need more lifecycle hooks in order to ensure clean mode entry and exit. There were a number of hacks in Chimera (the modal interface abstraction layer that was introduced specifically to abstract such hacks and present a simple modal API) to achieve an approximation of the expected behavior with mode transitions, but there were still some corner cases that could not be addressed. With Lithium, we use Emacs's built-in minor modes to implement the more rigid Vim-style (and yet, "point-free," Symex-style) modes we're looking for. This allows us to benefit from all of the existing infrastructure available for minor modes, and keeps the overlying additions "lightweight." By having an in-house, dedicated, modal interface framework, we also gain the flexibility to add the lifecycle hooks we need and tailor the implementation, without having to work around design choices that may have been made for requirements different from our own.
Configuration menu - View commit details
-
Copy full SHA for fa3f433 - Browse repository at this point
Copy the full SHA fa3f433View commit details -
Update .emacs.d config for installing Rigpa in the README
Mention including Lithium config as well since that package isn't on MELPA (or another package archive) either, and (as I understand it) cannot be declared as a dependency using `Package-Requires`.
Configuration menu - View commit details
-
Copy full SHA for 974ac42 - Browse repository at this point
Copy the full SHA 974ac42View commit details -
Configuration menu - View commit details
-
Copy full SHA for 45d7652 - Browse repository at this point
Copy the full SHA 45d7652View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e1d97a - Browse repository at this point
Copy the full SHA 4e1d97aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3225010 - Browse repository at this point
Copy the full SHA 3225010View commit details
Commits on Jul 29, 2024
-
Move buffer mode entry actions into the entry hook
As a convention, we'll avoid specifying anything beyond keybindings in the mode definition, leaving everything else to happen via state lifecycle hooks.
Configuration menu - View commit details
-
Copy full SHA for a2027dc - Browse repository at this point
Copy the full SHA a2027dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for b10d781 - Browse repository at this point
Copy the full SHA b10d781View commit details -
Configuration menu - View commit details
-
Copy full SHA for b07eb71 - Browse repository at this point
Copy the full SHA b07eb71View commit details
Commits on Aug 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c436ba0 - Browse repository at this point
Copy the full SHA c436ba0View commit details -
Rename
enter-mode
→switch-mode
to highlight transitionThis runs exit hooks for the previous mode and entry hooks for the new mode. We also don't run any hooks for Lithium modes which do all their hooks internally and via their exposed API. We currently use `manage-hooks` as a proxy for "is this a Lithium mode?" Just a temporary bridge to something more explicit.
Configuration menu - View commit details
-
Copy full SHA for e92a6fb - Browse repository at this point
Copy the full SHA e92a6fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 991233f - Browse repository at this point
Copy the full SHA 991233fView commit details -
Configuration menu - View commit details
-
Copy full SHA for bc3f248 - Browse repository at this point
Copy the full SHA bc3f248View commit details -
Configuration menu - View commit details
-
Copy full SHA for a80b0b2 - Browse repository at this point
Copy the full SHA a80b0b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1046964 - Browse repository at this point
Copy the full SHA 1046964View commit details -
Toggle evil supporting minor modes via lifecycle hooks
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.
Configuration menu - View commit details
-
Copy full SHA for 8f2ff66 - Browse repository at this point
Copy the full SHA 8f2ff66View commit details -
Use exit hook to disable supporting minor mode for evil states
Rather than post-exit hook, as the latter is only called in the high level switch mode function and not the low level mode transitions used in enter-appropriate-mode.
Configuration menu - View commit details
-
Copy full SHA for 14a9b8c - Browse repository at this point
Copy the full SHA 14a9b8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 37fe904 - Browse repository at this point
Copy the full SHA 37fe904View commit details -
Configuration menu - View commit details
-
Copy full SHA for b23e09c - Browse repository at this point
Copy the full SHA b23e09cView commit details -
Configuration menu - View commit details
-
Copy full SHA for afdb4a3 - Browse repository at this point
Copy the full SHA afdb4a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for e103240 - Browse repository at this point
Copy the full SHA e103240View commit details -
Migrate Application mode from Hydra → Lithium
Retain transparency menu in Hydra
Configuration menu - View commit details
-
Copy full SHA for c73f6b4 - Browse repository at this point
Copy the full SHA c73f6b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 40a91d5 - Browse repository at this point
Copy the full SHA 40a91d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b54ebd - Browse repository at this point
Copy the full SHA 8b54ebdView commit details -
Remove remaining Hydra modal provider code
We now use Lithium for global modes as it provides the lifecycle hooks we need to be able to cleanly treat it as a modal interface provider. We still use Hydra for features where a menu-driven interface is desired and not formally a modal one.
Configuration menu - View commit details
-
Copy full SHA for 5d01c75 - Browse repository at this point
Copy the full SHA 5d01c75View commit details
Commits on Aug 14, 2024
-
Use the new global Lithium mode macro
Also disable Evil Normal state in these modes as that would otherwise take precedence over the Lithium mode bindings.
Configuration menu - View commit details
-
Copy full SHA for 0cafc9c - Browse repository at this point
Copy the full SHA 0cafc9cView commit details -
Enter and exit corresponding evil states in all buffers
For global modes, we need to do this to ensure that the mode reflects correctly in all buffers via the Evil state indicator, and all that these evil states don't take keybinding precedence over the active global Lithium mode.
Configuration menu - View commit details
-
Copy full SHA for d737e55 - Browse repository at this point
Copy the full SHA d737e55View commit details
Commits on Aug 15, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7344b6e - Browse repository at this point
Copy the full SHA 7344b6eView commit details -
Don't run any actions in the minibuffer
This avoids encountering a `nil' evil state in some post-exit actions that were being performed "for all buffers" (as I recall).
Configuration menu - View commit details
-
Copy full SHA for 4a39fcf - Browse repository at this point
Copy the full SHA 4a39fcfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a108f3 - Browse repository at this point
Copy the full SHA 3a108f3View commit details
Commits on Aug 20, 2024
-
Incorporate wrapping hooks into low-level mode transitions
We recently fixed an infinite recursion where post-exit hooks enter the "appropriate" mode which calls the main "switch mode" interface, which itself attempts to exit the current mode before entering the next, and thus triggers post-exit hooks again. To address that, we had the "appropriate" mode entry function call the low-level entry function instead of the main switch mode transition function, but this meant that these were no longer triggering the pre-entry hooks as part of mode entry. This moves the pre-entry and post-exit hooks into the low-level entry and exit functions, respectively, so that they are correctly triggered in either of these cases (while still avoiding the original infinite loop since we only _enter_ and do not _exit_ (again) as part of post-exit hooks, while still doing both in the high level "switch"). We also need to explicitly call low level mode exit in on-demand mode transitions like "enter lower" and "escape higher" when in a non-local starting mode.
Configuration menu - View commit details
-
Copy full SHA for 8d65090 - Browse repository at this point
Copy the full SHA 8d65090View commit details -
Configuration menu - View commit details
-
Copy full SHA for f44a206 - Browse repository at this point
Copy the full SHA f44a206View commit details -
Handle an odd corner case in view mode exit
The built-in predicate for whether a buffer position is visible on screen returns true if we pass in a null buffer position, which is not what we expect here.
Configuration menu - View commit details
-
Copy full SHA for d1f0501 - Browse repository at this point
Copy the full SHA d1f0501View commit details -
Implement Line mode as a local Lithium mode
Instead of using Evil. For the kind of simple point-free ("Rumpelstiltskin") modal interfaces used in Rigpa, Evil is more than we need.
Configuration menu - View commit details
-
Copy full SHA for 82374be - Browse repository at this point
Copy the full SHA 82374beView commit details
Commits on Aug 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0701bfa - Browse repository at this point
Copy the full SHA 0701bfaView commit details
Commits on Aug 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 20577c2 - Browse repository at this point
Copy the full SHA 20577c2View commit details
Commits on Aug 27, 2024
-
consolidate line mode exit actions
We don't need anything in pre-entry currently since it isn't evil-based anymore.
Configuration menu - View commit details
-
Copy full SHA for 18ba844 - Browse repository at this point
Copy the full SHA 18ba844View commit details -
disable character cursor in line mode
The line highlight itself is the relevant cursor in line mode.
Configuration menu - View commit details
-
Copy full SHA for 89ea161 - Browse repository at this point
Copy the full SHA 89ea161View commit details -
Configuration menu - View commit details
-
Copy full SHA for c556f4c - Browse repository at this point
Copy the full SHA c556f4cView commit details -
Configuration menu - View commit details
-
Copy full SHA for bf23233 - Browse repository at this point
Copy the full SHA bf23233View commit details
Commits on Aug 29, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 35dc30c - Browse repository at this point
Copy the full SHA 35dc30cView commit details -
Configuration menu - View commit details
-
Copy full SHA for dcbb891 - Browse repository at this point
Copy the full SHA dcbb891View commit details
Commits on Aug 30, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1968cd1 - Browse repository at this point
Copy the full SHA 1968cd1View commit details
Commits on Aug 31, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1f9dde5 - Browse repository at this point
Copy the full SHA 1f9dde5View commit details
Commits on Sep 2, 2024
-
Use the enter and exit thunks defined by lithium
Avoid defining these separately for each mode within Rigpa.
Configuration menu - View commit details
-
Copy full SHA for 69f4161 - Browse repository at this point
Copy the full SHA 69f4161View commit details -
register modes with explicit lifecycle actions
Don't rely on name-matching interning magic.
Configuration menu - View commit details
-
Copy full SHA for ee2471f - Browse repository at this point
Copy the full SHA ee2471fView commit details -
Configuration menu - View commit details
-
Copy full SHA for a210707 - Browse repository at this point
Copy the full SHA a210707View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e8e53e - Browse repository at this point
Copy the full SHA 0e8e53eView commit details
Commits on Sep 3, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 35db7a1 - Browse repository at this point
Copy the full SHA 35db7a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for f550fcc - Browse repository at this point
Copy the full SHA f550fccView commit details
Commits on Sep 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4f5725b - Browse repository at this point
Copy the full SHA 4f5725bView commit details -
more robust current mode inference
Checks if there is a lithium mode active, and otherwise uses evil state.
Configuration menu - View commit details
-
Copy full SHA for 362619a - Browse repository at this point
Copy the full SHA 362619aView commit details
Commits on Sep 10, 2024
-
Don't exit current mode when entering another mode in some cases
Now that Lithium supports mode "stacks," in some cases (i.e. native → foreign transition), we want the native mode to be preserved and the new one just pushed onto the mode stack. So in such cases, we do not exit the source mode before entering the target.
Configuration menu - View commit details
-
Copy full SHA for 0e226ab - Browse repository at this point
Copy the full SHA 0e226abView commit details -
on foreign mode exit, just exit the mode
Don't attempt to enter any other mode, as with the mode stack, there should already be an active mode once the foreign mode has been exited (popped).
Configuration menu - View commit details
-
Copy full SHA for 322c069 - Browse repository at this point
Copy the full SHA 322c069View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c5334f - Browse repository at this point
Copy the full SHA 7c5334fView commit details -
On exiting foreign modes, only set the local evil state
We no longer rely on the evil state as the source of truth on what the current mode is (except for evil-backed states, which currently are just the built-in evil states). But we do still rely on evil for UI feedback, to indicate visually which mode we are in, even for modes that are not evil-backed. We do this just because there is existing infrastructure for this for Evil, in the form of mode line enhancements and perhaps other things. Eventually we will likely want to move away from this, but for now, the only thing we still need to do upon exiting forreign modes is to enter the appropriate evil state for UI feedback purposes, which we do now instead of attempting to enter any particular local mode (which we don't need to do since there would still be a local mode on the stack upon foreign mode exit).
Configuration menu - View commit details
-
Copy full SHA for 73f8671 - Browse repository at this point
Copy the full SHA 73f8671View commit details -
fix another spot where we were using the evil state
We no longer want to rely on evil as the source of truth for the "current mode."
Configuration menu - View commit details
-
Copy full SHA for c206488 - Browse repository at this point
Copy the full SHA c206488View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd1fa6c - Browse repository at this point
Copy the full SHA fd1fa6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9afc33c - Browse repository at this point
Copy the full SHA 9afc33cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9d4ce2 - Browse repository at this point
Copy the full SHA e9d4ce2View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9e583d - Browse repository at this point
Copy the full SHA e9e583dView commit details
Commits on Sep 11, 2024
-
Merge pull request #22 from countvajhula/symex-on-lithium
Support symex implemented as a lithium mode
Configuration menu - View commit details
-
Copy full SHA for 6f99d62 - Browse repository at this point
Copy the full SHA 6f99d62View commit details -
(history) move git-timemachine init to pre-entry hook
This still ends up setting the evil state in the original buffer rather than the timemachine buffer, though the evil state is set post-entry. Not sure why. Note the evil state is purely for UI feedback purposes and has no functional effect.
Configuration menu - View commit details
-
Copy full SHA for 7524136 - Browse repository at this point
Copy the full SHA 7524136View commit details
Commits on Sep 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f447d8e - Browse repository at this point
Copy the full SHA f447d8eView commit details -
don't rely on evil state when reconciling level
This is a general step towards maintaining a distinct notion of a current mode within Rigpa, which may use the current mode reported by Evil or Lithium as part of its operation. But it also is in response to a bug where [u]ndo'ing while in Symex mode causes the level to be reconciled to the level of Normal in the current tower (e.g. 2), even though we remain in Symex state. This seems to happen because as of emacs-evil/evil#1888, undoing explicitly goes into Normal state first, and then returns to whatever the original state was. In Rigpa, Normal is backed by Evil but Symex is backed by Lithium, even though it sets the Evil state for UI feedback purposes. As a result, we only watch the Evil state transition to reconcile the level when entering Normal state, but not Symex state, since we do not expect the Evil state transition to be the way in which Symex state is entered (it's rather just an effect of Symex mode entry via Lithium). As a result, during the undo operation, we see the transition to Normal and reconcile the level to 2, but do not see the transition back to (evil) Symex state, and thus do not reconcile the level back again to 1. This fix alleviates the bug because even though `rigpa--reconcile-level` is still only called upon Normal state entry, it does not result in the level actually changing because Rigpa's determination of current mode now first checks whether a Lithium mode is active, before checking the evil state. So even though the latter has changed during the undo operation, the mode remains the same as before, as the former has not changed.
Configuration menu - View commit details
-
Copy full SHA for 562f9ed - Browse repository at this point
Copy the full SHA 562f9edView commit details
Commits on Sep 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 11d83db - Browse repository at this point
Copy the full SHA 11d83dbView commit details -
escape to normal from replace state
While in replace state, escaping was having no effect. As it is considered a foreign state, it attempts to only exit the mode, which for evil-backed modes is a no-op. Additionally, as it isn't a lithium mode, there isn't even a notion of a stack wherein exiting replace mode would reinstate any prior mode. Escaping to normal seems the most straightforward thing to do, but I'm not sure if there may be a more correct handling.
Configuration menu - View commit details
-
Copy full SHA for aed4bd2 - Browse repository at this point
Copy the full SHA aed4bd2View commit details
Commits on Sep 19, 2024
-
exit mode in meta levels prior to returning to ground
Formerly I think with hydra we were implicitly exiting. With lithium, global modes like Buffer remain active even when the original buffer is killed, so we need to explicitly exit at the appropriate time.
Configuration menu - View commit details
-
Copy full SHA for efe4ca3 - Browse repository at this point
Copy the full SHA efe4ca3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 484605c - Browse repository at this point
Copy the full SHA 484605cView commit details