3

From SPC f f (counsel-find-file) minibuffer, open Hydra with C-o (hydra-ivy/body). This is what hydra looks on my system: enter image description here

The Hydra right column has "[m] matcher: order". Pressing 'm' rotates matcher between "other" and "ivy". How to active "other" or "ivy"? Why does "order" not appear in the rotation?

Some of the Hydra commands in the menu are not obvious (not to me). Where are the Hydra commands documented?

I am using Emacs 26.1 with Evil Spacemacs 0.200.13 and Ivy.

UPDATE 1:

The screenshot of my Hydra matches the Spacemacs Hydra documentation at: https://github.com/syl20bnr/spacemacs/blob/c7a103a772d808101d7635ec10f292ab9202d9ee/layers/%2Bspacemacs/spacemacs-completion/packages.el > define-transient-state ivy

Seems that my:

  • Hydra menu is for Spacemacs mode
  • Hydra is not running Spacemacs mode
  • Hydra *help* does not describe Hydra Spacemacs mode

Three examples follow.

1) Hydra menu says:

[f] case-fold: auto

Pressing 'f' toggles between 'nil' and 'auto'. In the help, hydra-ivy/body says:

"f": ‘ivy-alt-done &optional’
Exit the minibuffer with the selected candidate.

2) Hydra menu says:

[TAB] alt done

Pressing TAB opens *ivy-occur counsel-find-file ""*<2> like this: enter image description here In the help, hydra-ivy/body does not mention "TAB".

3) Hydra menu says:

[c] & cont

Pressing 'c' opens *ivy-occur counsel-find-file ""*<2>. In the help, hydra-ivy/body says:

"c":    ‘ivy-toggle-calling’

UPDATE 2:

posted issue: Hydra key behaviors do not match the Hydra menu in Spacemacs.

UPDATE 3:

From C-h f hydra-ivy/body RET:

hydra-ivy/body is an interactive autoloaded compiled Lisp function in
‘ivy-hydra.el’.

(hydra-ivy/body)

Call the body in the "hydra-ivy" hydra.

The heads for the associated hydra are:

"h":    ‘ivy-beginning-of-buffer’,
"j":    ‘ivy-next-line’,
"k":    ‘ivy-previous-line’,
"l":    ‘ivy-end-of-buffer’,
"o":    ‘keyboard-escape-quit’,
"C-g":    ‘keyboard-escape-quit’,
"i":    ‘nil’,
"C-o":    ‘nil’,
"f":    ‘ivy-alt-done’,
"C-j":    ‘ivy-alt-done’,
"d":    ‘ivy-done’,
"g":    ‘ivy-call’,
"C-m":    ‘ivy-done’,
"c":    ‘ivy-toggle-calling’,
"m":    ‘ivy-rotate-preferred-builders’,
">":    ‘ivy-minibuffer-grow’,
"<":    ‘ivy-minibuffer-shrink’,
"w":    ‘ivy-prev-action’,
"s":    ‘ivy-next-action’,
"a":    ‘ivy-read-action’,
"t":    ‘(setq truncate-lines (not truncate-lines))’,
"C":    ‘ivy-toggle-case-fold’,
"u":    ‘ivy-occur’,
"D":    ‘(ivy-exit-with-action (lambda (_) (find-function (quote hydra-ivy/body))))’

The body can be accessed via ‘hydra-ivy/body’.
  • By "Where are the Hydra commands documented?" you mean hydra in general or this particular hydra-ivy commands. I find the documentation on the github pages of ivy and hydra quite helpful. – andrej Apr 23 at 12:49
2

In my case hydra-ivy looks a bit different but one can see that here & is just a part of the description of the command being executed. The commands themselves are the usual ivy commands.

For instance [RET] will call ivy-done and I guess that [i] will close the hydra and insert the current match into the minibuffer while [q] will just close the hydra.

I suggest looking at the definition of hydra-ivy, i.e. C-h f hydra-ivy/body RET.

EDIT: After the update of the question it looks to me as if you have a clash of two versions because the actual commands do not match with their description. Your hydra seems to be defined here on the Spacemacs github There you can see which commands by which keys and look up the corresponding commands via C-h f.

  • I looked at hydra-ivy/body help. Details in the main question under UPDATE 1. – wolfv Apr 23 at 23:38
  • Updatet the answer – andrej Apr 24 at 7:54
  • I will install the next version of Emacs when it is released in the dnf package managerer, which is in 6 months. In the meantime, should I submit a bug report? – wolfv Apr 24 at 16:48
  • Well, I'm not sure it is a bug in swiper because the hydra you are using is not from that repo. What does C-h f hydra-ivy/body RET show you? Are the packages swiper, ivy, ivy-hydra also installed from melpa? – andrej Apr 25 at 7:24
  • I added "C-h f hydra-ivy/body RET" results to main question's UPDATE 3. Not sure about melpa, this is in my .spacemacs file: (require 'package) (add-to-list 'package-archives '("melpa-stable" . "stable.melpa.org/packages/") t) (add-to-list 'package-archives '("org" . "orgmode.org/elpa/") t) (package-initialize) – wolfv Apr 25 at 12:25
1

I posted on your Spacemacs issue as well, but thought I'd share my answer here too.

The issue here is that the hydra you are viewing when pressing C-o is not the Ivy hydra. It is a custom hydra set by spacemacs|define-transient-state in the spacemacs-completion layer that @andrej mentioned.

When you press C-o while in an Ivy buffer in Spacemacs, it actually calls the function spacemacs/ivy-transient-state/body, and those are the bindings you are seeing in the menu.

If you want to launch the normal hydra-ivy/body menu, that is mapped to M-SPC in the Spacemacs Ivy layer.

If you want to map C-o to open the standard Ivy hydra, that is certainly doable. But the root cause here is that you are not actually viewing the hydra-ivy/body menu, so the Emacs function help doesn't match up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.