Skip to content

Add Transient menus - #214

Open
charjr wants to merge 1 commit into
godotengine:masterfrom
charjr:transient-menus
Open

Add Transient menus#214
charjr wants to merge 1 commit into
godotengine:masterfrom
charjr:transient-menus

Conversation

@charjr

@charjr charjr commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Features

Main Menu gdscript-menu

Screenshot From 2026-06-20 08-22-01

A main entry point that we could assign to a key, removing the need to memorise complex keychords. Think of it like a bespoke which-key-mode.

Godot Engine Menu gdscript-menu-godot:

Screenshot From 2026-06-20 08-22-13

Wrapping a CLI tool is where Transient really shines, if you've used Magit then the way this menu works should be familiar.

Built In History

I've set up this menu to use transient's built-in history: navigatable with C-x p C-x n.

Saves Last Used Flags

Each time you open the menu, it starts with the same flags you used last. This persists across emacs sessions.

GDScript Menu gdscript-menu-gdscript

Screenshot From 2026-06-20 08-22-24

Conditionally disable GDFormat commands when executable is missing

We could instead hide them completely, but that would make the feature less discoverable.

Additional Notes

Shorthands

I used a Shorthand gd// for transient-specific code. (Emacs automatically translates this into gdscript-menu--). I've done this for two reasons:

  1. It's concise
  2. To discourage external use of internal details.

Missing Menu options

Script

This option has been left out as it has confused users in the past, including me. This could be reconsidered if we make it clear when it will work (via conditional disabling for instance)

Switch to Godot

This may be a personal taste, but I don't use this option. I just use the familiar switch-to-buffer if I want to switch buffer. I'd be curious to hear feedback on this one from other users.

3 menus currently added:
- `gdscript-menu`: the main menu that other menus are accessible from.
- `gdscript-menu-godot`: for anything related to the Godot executable.
- `gdscript-menu-gdscript`: for anything related to GDScript.

History is built-in to transient by including a unique `:history-key`.
History is navigatable with `C-x p` `C-x n`.
History is setup for `gdscript-menu-godot`.
The other menus have no configuration options, so have no use for it.

GDFormat commands are greyed out unless the executable is found.
There is also the option to make it completely hidden,
but that would make the commands less discoverable.

I used a shorthand variable `gd//` for transient-specific code.
Using a shorthand here has two advantages.
1. Concise code
2. Discourage external use of internal details.
@charjr

charjr commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

I have not removed any hydra code yet as I have not built a replacement for the debug hydra yet. But looking at #211, it seems like the debugger might need some fixes before attempting to overhaul it.

I'm pushing this now because, personally I believe these menus surpass the existing hydra for launching godot. It would be good to get some feedback on where I may be wrong.

@NathanLovato

Copy link
Copy Markdown
Collaborator

For the debugging part, basically the godot-debug package can be removed now; it dates back to Godot 3 which didn't support the debugger adapter protocol (DAP). We had to parse the specific data/bytes exchanged with Godot's debugger. Since then DAP became a standard protocol and emacs probably supports it out of the box or with a library. All you should need is define how emacs and godot connect and the rest should be handled by the protocol implementation.

Regarding this menu please let me know if/when you'd like me to test and merge it.

Transient is built-in now? That's pretty cool, whenever there's a suitable built-in API I definitely prefer using this over external dependencies (unless there's a very strong UX reason to go external, something unsupported by built-ins; today I'd also vendor any external dependencies to be able to inspect all the code involved in the entire package).

@charjr

charjr commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

For the debugging part, basically the godot-debug package can be removed now; it dates back to Godot 3 which didn't support the debugger adapter protocol (DAP).

Right so godot-debug supports Godot 3 only, and Godot 4 needs something simpler?

Regarding this menu please let me know if/when you'd like me to test and merge it.

Not just yet, I'll refactor it slightly now that the gdscript-snippet-menu is merged. I might also see if I can figure out the DAP functionality (but if it proves too hard, I'll leave it for a separate PR).

Transient is built-in now? That's pretty cool,

It is indeed 😄

whenever there's a suitable built-in API I definitely prefer using this over external dependencies (unless there's a very strong UX reason to go external

I completely agree

today I'd also vendor any external dependencies to be able to inspect all the code involved in the entire package).

That's what I do locally as well, I've taken to using package-vc with my own forks to review code before I upgrade. (The upcoming Emacs 31 has a feature to view code diffs during package upgrades though, which should make it a lot easier).

@NathanLovato

Copy link
Copy Markdown
Collaborator

Yes the debug package is Godot 3 only. And all the changes to syntax highlighting, for example, are already breaking support for a Godot 3 so the package could completely be removed.

Or well if you wanted to take on extra maintenance the codebase could detect the Godot version and branch features for backward compatibility; But personally, I would freeze the Godot 3 version of the package now that Godot 3 does not move much anymore and has very few users, there's little chance there's even 1 Godot 3 user working with Emacs left. And they could use the last compatible version of the extension for Godot 3.

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