Giter Site home page Giter Site logo

Comments (5)

jerrypnz avatar jerrypnz commented on June 22, 2024

Sorry for the late response. Somehow I didn't receive notification for this.

That's an interesting idea. I never thought about it and don't have a use-case for it. I'm also not sure how it's gonna work because for a given buffer, multiple minor modes might be enabled. How should it decide which "minor mode hydra" to open when you invoke the command?

from major-mode-hydra.el.

WolfeCub avatar WolfeCub commented on June 22, 2024

I never really ran into that issue since I typically used it for modes that don't conflict but I suppose there could be a priority list in the config that determines the precedence of each mode.

from major-mode-hydra.el.

jerrypnz avatar jerrypnz commented on June 22, 2024

I don't know if I'd implement exactly what you want at this point. But I do have something in mind that will make it easier to achieve what you want. Basically I plan to introduce a new command where you can specify how you'd want to dispatch to different hydras.

from major-mode-hydra.el.

jerrypnz avatar jerrypnz commented on June 22, 2024

@WolfeCub On develop branch a new function was introduced: https://github.com/jerrypnz/major-mode-hydra.el/blob/develop/major-mode-hydra.el#L142

It should allow you to do something like this:

(major-mode-hydra-bind foobar-mode "Eval"
  ("b" eval-buffer "buffer")
  ("e" eval-defun "defun")
  ("r" eval-region "region"))

(major-mode-hydra-bind foobar-mode "Test"
  ("t" ert "prompt")
  ("T" (ert t) "all")
  ("F" (ert :failed) "failed"))

(major-mode-hydra-bind foobar-mode "Doc"
  ("d" describe-foo-at-point "thing-at-pt")
  ("f" describe-function)
  ("v" describe-variable))

(defun call-foobar-hydra ()
  (interactive)
  (major-mode-hydra-dispatch 'foobar-mode))

You can create commands on top of that function to do your own dispatching.

from major-mode-hydra.el.

WolfeCub avatar WolfeCub commented on June 22, 2024

Great! Thanks for the follow up.

from major-mode-hydra.el.

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.