forked from meow-edit/meow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow user to define custom states (meow-edit#158)
* Allow user to define custom states (meow-edit#155) * Generalized macro to produce define-key helpers Defines a macro meow-generate-define-key which produces a helper function meow-STATE-define-key. This macro is then applied to all keymaps. This commit also introduces the variable meow-keymap-alist to keep track of states to keymaps. * Generalize state disabling Ensure that when normal, insert, and beacon modes are entered, they disable all modes that may conflict with them, including custom modes. We also add meow-state-alist to keep track of all modes. * Generalize meow--update-cursor Use a list of conditions instead of a long cond statement. This ensures you can easily add your own conditions and functions. * Generalize meow--switch-state Modify meow--switch-state such that if the state being switched to is not caught by the case statement, it is looked up in an alist of custom modes. * Generalize meow--current-state This uses the previously defined variable meow-state-alist to generalize the meow--current-state function. * Add function to define custom state Please see docstrings. Adds several macros to help the user easily define custom states. * Autoload meow-define-state to prevent errors on startup * Fix entry function macro and add to meow-define-state * Make keymap generator take customization options Suppression option and sparsity options added * Improve variable declarations Fixed docstrings and made indentation look nicer. Also, removes meow-custom-state-alist in favor of two alists that should always mirror each other. Adds meow--register-state to update both lists at once. * Change meow-escape-or-normal-modal to always work Previously, it only switched you to normal if you were either in insert mode or in fundamental mode. * Indenting consistency My indenter got mad * Fix wrong variable usage * Generalize meow--render-indicator Custom states are now added to meow-replace-state-name-list. meow--render-indicator is rewritten to be much shorter. * Documentation * Rewrite meow--switch-state and extract updating to init functions. * Change macros to functions and remove evals * Remove entry function * Make meow-keymap-alist use symbol keys * Rewrite cursor updating Remove code blocks from meow-update-cursor-functions-alist and make defuns for each one. * Make meow--define-state-keymap accept an override keymap * Documentation * Disable normal mode before saving origin commands in motion * Variable docstring tweak Changes variable documentation for meow-keymap-alist and meow-update-cursor-functions-alist. * Make keypad mode remember custom states. * Rewrite meow--motion-init to save origin command properly * setting previous state before keypad is enabled * remove meow-mode-state-alist * improve getting current state & disabling current state * create default helper functions explictly * Update CUSTOMIZATIONS.org * fix error when leaving beacon state * fix init in fundamental-mode * fixes * change define-state syntax * Factor out keymap generation * Documentation for syntax changes * Loop over motion state keymap directly and remove meow--motion-overwrite-keys * Move meow-keymap-alist and make its values keymaps * Add and use meow-define-keys to define keybindings * update docs for meow-define-keys * Inline mode init functions * Docs * Declare indenting on define-keys and define-state * fix indent spec for meow-define-state, update docs * fix unrenamed meow-intern-string * define existing states with meow-define-state * update changelog Co-authored-by: tianshu <doglooksgood@gmail.com> Co-authored-by: eshrh <esrh@gatech.edu> Co-authored-by: Fredrik Bergroth <fbergroth@gmail.com>
- Loading branch information
1 parent
b04e2ea
commit 0d63977
Showing
11 changed files
with
414 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.