kaushalmodi / .emacs.d

My emacs configuration
MIT License
261 stars 49 forks source link

How can I activate hydra-nav-error ? #14

Closed smithx closed 8 years ago

smithx commented 8 years ago

Are there any key binding to activate this hydra ? I can't find.

defhydra hydra-nav-error

kaushalmodi commented 8 years ago

Here I am using the "Style 1" method of binding hydra which is described here.

(defhydra hydra-nav-error
  (nil "M-g"
       :bind (lambda (key cmd) (bind-key key cmd modi-mode-map))
       :color pink)
  "nav-error"
  ("g"        first-error    "first")
  ("n"        next-error     "next")
  ("p"        previous-error "prev")
  ("q"        nil            "cancel")
  ("<return>" nil            "cancel"))

Above means that the hydra is activated when I hit M-g. But it is "actually active" only for the listed heads: g, n, p, q, <return>. So the hints will appear only when I press one of these keys.

The reason for doing so is that I still want to preserve other emacs-default bindings that start with M-g, like M-g c for goto-char, M-g M-g for goto-line, etc.

So to answer your question in another way, you an activate this hydra by typing M-g followed by one of these: g, n, p, q, <return>.

smithx commented 8 years ago

Thank you very much, It is my fault, I must be "more RTFM"

kaushalmodi commented 8 years ago

Not a problem. Glad to help.