Giter Site home page Giter Site logo

Comments (8)

darth10 avatar darth10 commented on August 22, 2024

Transient doesn't allow entering any keys (including M-x) other than the ones shown in the popup dialog.

You could try customising god-exempt-major-modes (which currently includes magit-popup-mode) and see if that helps.

from god-mode.

rudolf-adamkovic avatar rudolf-adamkovic commented on August 22, 2024

@darth10 Wait, but god-exempt-major-modes will not allow me to control Magit popups with God, will it?

from god-mode.

darth10 avatar darth10 commented on August 22, 2024

Given the way transient works, I doubt it, but it's worth a shot.
I've tried it out, and that doesn't work.

A more important question would be whether God mode is actually needed to control transient UI popups.
IMHO the popups generally have single key bindings, so you wouldn't gain a lot through God mode.

from god-mode.

rudolf-adamkovic avatar rudolf-adamkovic commented on August 22, 2024

I think the main reason is accessibility. If someone uses God to avoid RSI, or recover from RSI, they might prefer to use ESC g instead of C-g (given that m is M-), and the like. Another reason is consistency; once one gets used to God, they do not need to context switch.

from god-mode.

darth10 avatar darth10 commented on August 22, 2024

That makes sense for C-g vs. ESC g, but for any other bindings, transient will print an Unbound suffix: ... message.

Maybe some more examples of what you're trying to achieve would be helpful here.
Is it just ESC g that you need?

from god-mode.

rudolf-adamkovic avatar rudolf-adamkovic commented on August 22, 2024

Here is a real-world example:

Working in Org, I wanted to export a document as an HTML fragment.

I hit c e in God mode. Then, in the transient window:

  • actual: C-b C-v h H
  • expected: b v ESC h H (no C-, no RSI, no context switch)

More generally, these transient UIs can (and do) have C--bound shortcuts.

from god-mode.

darth10 avatar darth10 commented on August 22, 2024

That's a great example, but c e in org-mode invokes org-export-dispatch (ox.el) which doesn't use transient 😄

Coming back to transient specifically, have you tried customising transient-map to fit your workflow?

(define-key transient-map (kbd "<escape> g") 'transient-quit-one) ;; ESC g

I understand this is hard to do for every command you intend to use, but it's even harder to implement in God mode for every popup dialog mode that Emacs supports.
For example, for org-export-dispatch, since the popup buffer uses read-char-exclusive to read keys in org-export--dispatch-action, there's nothing to hook God mode into for the purpose of adding modifier keys.
Transient on the other hand uses keymaps, so might be a bit more straightforward to implement.
Evil doesn't support transient UI buffers though (see emacs-evil/evil-magit#77).
Regardless, God mode needs be aware of every popup mode out there to have 100% consistency in all popups.

There was some potential in using set-transient-map in #113, but that has been abandoned as it wouldn't support Magit.

I'll explore how this can be implemented cleanly, but it could take a while.

from god-mode.

rudolf-adamkovic avatar rudolf-adamkovic commented on August 22, 2024

@darth10

have you tried customising

To be honest, customizing a single key binding is not what I am after. Instead, I would like to see a solution that would always work reliably in all buffers, with no exceptions.

from god-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.