Skip to content
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

Minor mode support. #8

Closed
WolfeCub opened this issue Apr 24, 2018 · 5 comments
Closed

Minor mode support. #8

WolfeCub opened this issue Apr 24, 2018 · 5 comments

Comments

@WolfeCub
Copy link

I know this goes against the package name but is there any reason you don't support minor modes?

I have similar functionality to this package in my dotfiles but when I switched over to this package I noticed it was missing minor mode support.

Is there any chance of this being added?

Thanks!

@jerrypnz
Copy link
Owner

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?

@WolfeCub
Copy link
Author

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.

@jerrypnz
Copy link
Owner

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.

@jerrypnz
Copy link
Owner

@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.

@WolfeCub
Copy link
Author

Great! Thanks for the follow up.

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

No branches or pull requests

2 participants