jerrypnz / major-mode-hydra.el

Spacemacs-esque major mode leader key powered by Hydra
297 stars 9 forks source link

Use command name if there's no hint. #20

Closed Kungsgeten closed 5 years ago

Kungsgeten commented 5 years ago

I had a go at #10 The tests are failing though, since the expected column width isn't correct for a head without hint. Also there may be other problems, if using :width parameter, or :toggle or some other stuff I haven't tested. I thought that this might be a good start for discussion though :)

jerrypnz commented 5 years ago

Thanks for looking at it. I actually wanted to fix it as part of a bigger change but forgot about it later (I personally always specify hints in my hydras). There is a currently unused function pretty-hydra--normalize-head that was designed for this purpose. You can check for existence of explicit hints there and add the command name if there is none, then you just need to do a (-map #'pretty-hydra--normalize-head heads) before generating docstrings etc.

Need to think about the edge case where cmd is an expression not a command. I think it should just signal an error in that case saying hint is required.

jerrypnz commented 5 years ago

Actually fixed it in commit https://github.com/jerrypnz/major-mode-hydra.el/commit/c6554ead6d683fcee1318ae38f5b4188980df2ac now available on develop branch only.