Skip to content

Refactor overleaf keymap to support dynamic prefix changes#15

Merged
vale981 merged 1 commit intovale981:mainfrom
ultronozm:main
Jun 21, 2025
Merged

Refactor overleaf keymap to support dynamic prefix changes#15
vale981 merged 1 commit intovale981:mainfrom
ultronozm:main

Conversation

@ultronozm
Copy link
Contributor

This PR streamlines how the prefix key is handled, following standard practices in built-in Emacs modes (follow.el, outline.el, ...). The only user-facing difference is that keys are rebound as soon as the prefix key is modified.

@vale981
Copy link
Owner

vale981 commented Jun 21, 2025

Thanks for this! I knew the prefix configuration was quite broken, but haven't bothered to fix it yet.

Could you squash your commits into one add the "refactor: " prefix to the message.

I could do it, too of you'd like.

@ultronozm
Copy link
Contributor Author

Could you squash your commits into one add the "refactor: " prefix to the message.

I could do it, too of you'd like.

I think I've done this just now, but the PR looks a bit messed up. Let me know if I should resubmit it.

@vale981
Copy link
Owner

vale981 commented Jun 21, 2025

Oddly, there's one commit too many

* overleaf.el (overleaf-keymap-prefix): Move definition after helper
functions and add custom setter to update keymaps dynamically.  Change
type from 'string to 'key.
(overleaf--key): Remove macro as it's no longer needed with new keymap
structure.
(overleaf-command-map): New keymap variable with overleaf commands.
(overleaf-mode-map): New keymap variable that maps the prefix key to
the command map.
(overleaf-mode): Simplify keymap definition by using the new
overleaf-mode-map variable instead of generating keymap from list of
key definitions.

* README.org (Usage): Remove incomplete sentence fragment.
@ultronozm
Copy link
Contributor Author

Oddly, there's one commit too many

OK, gave it another whirl. Hopefully this does the trick.

@vale981
Copy link
Owner

vale981 commented Jun 21, 2025

Merci beaucoup !

@vale981 vale981 merged commit 37308c1 into vale981:main Jun 21, 2025
1 check passed
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 this pull request may close these issues.

2 participants