-
Notifications
You must be signed in to change notification settings - Fork 93
Add transient menu #343
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
base: main
Are you sure you want to change the base?
Add transient menu #343
Conversation
- Adds a new file, `chatgpt-shell-transient.el`, providing transient menus. - Defines a transient prefix `chatgpt-shell-transient--popup`. - Implements various actions for shell interaction, region manipulation, and configuration. - Provides a `chatgpt-shell-transient` function to invoke the menu. - Includes actions for model swapping, transcript management, and version display. - Uses autoload to ensure dependencies are loaded correctly. - Provides a `chatgpt-shell-transient` function to invoke the menu.
- Restructured the transient menu into groups based on context. - Added conditional availability based on buffer mode and region activity. - Moved "Clear Shell Buffer" and "Interrupt Request" to shell-specific group. - Changed "K" to "I" to avoid conflict with "Previous Source Block". - Added "Swap Model" and "Swap System Prompt" to utilities group. - Added "Save Transcript" and "Restore Transcript" to utilities group. - Added a helper predicate `chatgpt-shell-transient--in-shell-p`. - Defined a suffix command for cleaner menu definition.
- Add `transient` to `Package-Requires`. - Require `chatgpt-shell-transient.el`. - Bind `C-c C-t` to `chatgpt-shell-transient`.
Hi @rogsme! Thanks a lot for the PR! It'll be super handy to have these menus. While I haven't done a thorough review, maybe we should iterate on the menu organization, naming, bindings... you know thet stuff we all love to bikeshed on :) You have a really great selection of commands. I'm thinking we can likely consolidate some sections a little and maybe tweak some names... Menu organizationThe following is only a rough brain dump (and totally open for discussion), there's no need to implement just yet. The idea is to pin down general menu organization and once we have that, we can go and implement.
BindingsWe have options here:
Vanilla vs EvilIf possible, let's try to use idiomatic bindings when possible. For example, n/p are prevalent in Emacs for moving next/previous (gotta say though TAB is pretty handy). Executing org blocks is well known to be C-c C-c, etc. We could also make it smart to use vanilla vs evil. StickinessI think this is possible with transient, but I haven't looked, maybe making the menu sticky for certain commands that are meant to be repeated? For example next/previous. These are just thoughts for now. Lemme know what you think. |
Closes #341
Here's the new transient menu!
How it looks outside the chatgpt-shell buffer:
How it looks in the
chatgpt-shell
buffer (C-c C-t
by default):How it looks on region selection:
Some videos:
General demo:
demo.mp4
Region selection demo:
highlight-demo.mp4