]> code.delx.au - gnu-emacs-elpa/log
gnu-emacs-elpa
9 years agohydra.el (hydra--hint): allow duplicate functions in heads
Oleh Krehel [Mon, 9 Feb 2015 17:33:13 +0000 (18:33 +0100)]
hydra.el (hydra--hint): allow duplicate functions in heads

* hydra.el (hydra--hint): Duplicate functions will be concatenated.

Example:

    (defhydra hydra-zoom (global-map "<f2>")
      "zoom"
      ("g" text-scale-increase "in")
      ("l" text-scale-decrease "out")
      ("0" (text-scale-set 0) "reset")
      ("1" (text-scale-set 0) :bind nil)
      ("2" (text-scale-set 0) :bind nil :color blue))

Here, the hint will be: "zoom: [g]: in, [l]: out, [0 1 2]: reset."
And "2" will be colored blue.

Fixes #26

9 years agoAllow some heads with no hints
Oleh Krehel [Mon, 9 Feb 2015 16:14:41 +0000 (17:14 +0100)]
Allow some heads with no hints

* hydra.el (hydra--hint): If the HINT part of HEAD is explicitely nil,
  omit it from the compound hint.

Example:

    (global-set-key
     (kbd "C-M-o")
     (defhydra hydra-window (:color amaranth)
       "window"
       ("h" windmove-left nil)
       ("j" windmove-down nil)
       ("k" windmove-up nil)
       ("l" windmove-right nil)
       ("v" (lambda ()
              (interactive)
              (split-window-right)
              (windmove-right))
            "vert")
       ("x" (lambda ()
              (interactive)
              (split-window-below)
              (windmove-down))
            "horz")
       ("q" nil "cancel")))

Here, "h", "j", "k", "l" will not be in the echo area.

9 years agoREADME.md: update
Oleh Krehel [Sun, 8 Feb 2015 14:15:06 +0000 (15:15 +0100)]
README.md: update

9 years agoAllow a sexp as head's CMD paramater
Oleh Krehel [Sun, 8 Feb 2015 14:07:12 +0000 (15:07 +0100)]
Allow a sexp as head's CMD paramater

* hydra.el (hydra--make-callable): New function.
(defhydra): Use `hydra--make-callable'. Now, head's CMD is either:
command name, nil, a sexp. In case of a sexp, it will be wrapped
unevaluated in an interactive lambda. You can use a `progn' to have many
statements in the sexp.

Fixes #25.

Example:

    (defhydra hydra-launcher (:color blue)
       "Launch"
       ("h" man "man")
       ("r" (browse-url "http://www.reddit.com/r/emacs/") "reddit")
       ("w" (browse-url "http://www.emacswiki.org/") "emacswiki")
       ("s" shell "shell")
       ("q" nil "cancel"))
    (global-set-key (kbd "C-c r") 'hydra-launcher/body)

9 years agoUpdate comments and mark the old examples obsolete
Oleh Krehel [Sun, 8 Feb 2015 13:28:37 +0000 (14:28 +0100)]
Update comments and mark the old examples obsolete

9 years agoAllow lambda :bind property for body and heads
Oleh Krehel [Sat, 7 Feb 2015 21:00:56 +0000 (22:00 +0100)]
Allow lambda :bind property for body and heads

* hydra.el (hydra--head-property): Clean up doc.
(hydra--make-defun): Clean up doc.
(defhydra): Improve doc.
Both body and heads recognize :bind property in their plist.
It can be either nil or a lambda of `global-set-key' format.

Example:

    (defhydra hydra-goto (global-map "M-g"
                          :bind
                          (lambda (key cmd)
                            (bind-key key cmd)))
      ("g" goto-line "goto-line" :bind global-set-key)
      ("c" goto-char "goto-char"))

Here, `global-set-key' will be used to bind `goto-line' to "M-g g".
And `bind-key' will be used to bind `goto-char' to "M-g c".
Note that since `bind-key' is a macro, it was necessary to wrap it
in a lambda.

Since this commit, it's not possible to pass a lambda instead of
the whole BODY arg, as was advertised before. Just put it on
:bind now.

9 years agoREADME.md: update
Oleh Krehel [Sat, 7 Feb 2015 17:20:31 +0000 (18:20 +0100)]
README.md: update

9 years ago`hydra/body' will pass the initial `current-prefix-arg' along
Oleh Krehel [Fri, 6 Feb 2015 17:13:16 +0000 (18:13 +0100)]
`hydra/body' will pass the initial `current-prefix-arg' along

* hydra.el (hydra--make-defun): Take an additional arg to paste as the
  last statement.
(defhydra): Set `hydra-foo/body' last statement to
`(setq prefix-arg current-prefix-arg)'.

* hydra-test.el: Update tests.

Example:

    (global-set-key
     (kbd "C-z")
     (defhydra hydra-vi ()
       "vi"
       ("l" forward-char)
       ("q" nil "quit")))

Now, "C-u C-z l" will result in (forward-char 4). All the other "l" will
normally call (forward-char 1), unless an additional prefix is given.

The previous behavior allowed only for "C-z C-u l" to get
(forward-char 4).

Fixes #21.

9 years agofix typo - single not singe
Jason Lewis [Fri, 6 Feb 2015 11:55:24 +0000 (22:55 +1100)]
fix typo - single not singe

9 years agoFix "catch 'hydra-disable"
Oleh Krehel [Fri, 6 Feb 2015 09:31:33 +0000 (10:31 +0100)]
Fix "catch 'hydra-disable"

* hydra.el (hydra--make-defun): `(catch 'hydra-disable ...)' should
  extend thoughout the whole defun. The scope was reduced by mistake
  earlier, now restoring.

* hydra-test.el: Update tests.

9 years agoUpdate semantics for local heads to `:bind nil'
Oleh Krehel [Fri, 6 Feb 2015 09:04:54 +0000 (10:04 +0100)]
Update semantics for local heads to `:bind nil'

* hydra.el (hydra--head-property): Accept an optional DEFAULT arg.
(defhydra): A head will not be bound in the body map when it has `:bind
nil' in its plist.

Example:

    (defhydra hydra-next-error (c++-mode-map "C-x")
      "next-error"
      ("`" next-error "next")
      ("j" next-error "next" :bind nil)
      ("k" previous-error "previous" :bind nil))

Here, only "C-x `" will be bound in `c++-mode-map', "C-x j" and "C-x k"
will not be bound.  However, e.g. "C-x `jjk" will be possible.

9 years agoSupport local hydra heads
François Févotte [Thu, 5 Feb 2015 22:35:35 +0000 (23:35 +0100)]
Support local hydra heads

Local heads are not bound in the global keymap, only in the transient keymap.

9 years agohydra.el (defhydra): Declare indent 2
Oleh Krehel [Thu, 5 Feb 2015 18:32:00 +0000 (19:32 +0100)]
hydra.el (defhydra): Declare indent 2

9 years agoAllow :pre and :post to be function symbols
Oleh Krehel [Thu, 5 Feb 2015 18:24:50 +0000 (19:24 +0100)]
Allow :pre and :post to be function symbols

* hydra.el (defhydra): :pre and :post are eihter sexps or function
  symbols.

Re #16.

Example:

    (defun hydra-vi/pre ()
      (set-cursor-color "#e52b50"))

    (defun hydra-vi/post ()
      (set-cursor-color "#ffffff"))

    (global-set-key
     (kbd "C-z")
     (defhydra hydra-vi
         (:pre hydra-vi/pre
               :post hydra-vi/post
               :color amaranth)
       "vi"
       ("l" forward-char)
       ("h" backward-char)
       ("j" next-line)
       ("k" previous-line)
       ("m" set-mark-command "mark")
       ("a" move-beginning-of-line "beg")
       ("e" move-end-of-line "end")
       ("d" delete-region "del" :color blue)
       ("y" kill-ring-save "yank" :color blue)
       ("q" nil "quit")))

9 years agohydra.el (hydra-keyboard-quit): New custom var
Oleh Krehel [Thu, 5 Feb 2015 17:50:39 +0000 (18:50 +0100)]
hydra.el (hydra-keyboard-quit): New custom var

* hydra.el (hydra-keyboard-quit): New custom var.
(defhydra): Bind `hydra-keyboard-quit' to disable an amaranth Hydra.

* hydra-test.el (hydra-amaranth-vi): Update test.

9 years agoMove defun-creating code into a defun
Oleh Krehel [Thu, 5 Feb 2015 17:27:58 +0000 (18:27 +0100)]
Move defun-creating code into a defun

* hydra.el (hydra--doc): New function.
(defhydra): Simplify.

* hydra-test.el: Update tests.

9 years agoUpdate :post for amaranth Hydras
Oleh Krehel [Thu, 5 Feb 2015 14:19:17 +0000 (15:19 +0100)]
Update :post for amaranth Hydras

* hydra.el (defhydra): Since the transient map isn't technically going
  away when a foreign key binding is pressed, don't call :post in that
  case. This means that only blue heads will call :post for Hydras with
  amaranth body.

Fixes #17.

9 years agohydra-test.el: update the test to not fail for older Emacs
Oleh Krehel [Thu, 5 Feb 2015 13:33:15 +0000 (14:33 +0100)]
hydra-test.el: update the test to not fail for older Emacs

9 years agoBump version
Oleh Krehel [Thu, 5 Feb 2015 13:17:26 +0000 (14:17 +0100)]
Bump version

9 years agohydra-test.el: add test
Oleh Krehel [Thu, 5 Feb 2015 13:13:43 +0000 (14:13 +0100)]
hydra-test.el: add test

* README.md: update.

9 years agoAdd amaranth (immortal) Hydras
Oleh Krehel [Thu, 5 Feb 2015 12:09:05 +0000 (13:09 +0100)]
Add amaranth (immortal) Hydras

* hydra.el (hydra-face-amaranth): New face.
(hydra--face): Update.
(defhydra): If the body color is amaranth, it's only possible to exit
this Hydra through a blue head. None of the other key bindings, even
"C-g" will work. There's a check in place that the current Hydra should
have at least one blue head.

Re #17.

Example:

    (defhydra hydra-vi
         (:pre
          (set-cursor-color "#40e0d0")
          :post
          (set-cursor-color "#ffffff")
          :color amaranth)
       "vi"
       ("l" forward-char)
       ("h" backward-char)
       ("j" next-line)
       ("k" previous-line)
       ("q" nil "quit"))

    (global-set-key (kbd "C-z") 'hydra-vi/body)

9 years agoREADME.md: update for 0.7.0
Oleh Krehel [Wed, 4 Feb 2015 16:44:04 +0000 (17:44 +0100)]
README.md: update for 0.7.0

9 years agoAdd :pre and :post clauses to Hydra body
Oleh Krehel [Wed, 4 Feb 2015 15:28:40 +0000 (16:28 +0100)]
Add :pre and :post clauses to Hydra body

* hydra.el (defhydra): the PLIST part of BODY argument now recognizes
  :pre and :post keys. These should be single Elisp statements,
  wrappable in a lambda. When you need more than one statement, use a
  `progn'.

:pre will be called by `hydra-foo/body', as well as by all heads.
:post will be called by the blue heads, as well as on Hydra termination
by a command that isn't a head.

Fixes #16.

An Example:

    (global-set-key
     (kbd "C-z")
     (defhydra hydra-vi
         (:pre
          (set-cursor-color "#40e0d0")
          :post
          (set-cursor-color "#ffffff"))
       "vi"
       ("l" forward-char)
       ("h" backward-char)
       ("j" next-line)
       ("k" previous-line)
       ("q" nil "quit")))

9 years agoUpdate the call order and allow called functions to exit
Oleh Krehel [Tue, 3 Feb 2015 17:43:24 +0000 (18:43 +0100)]
Update the call order and allow called functions to exit

* hydra.el (defhydra): First disable the transient map, then call red
  head, allowing it to throw `hydra-disable' to break, then re-set
  transient map.

  If the called function raises an error, display this error for a
  while, but still set the transient map.

* hydra-test.el: Update test.

Re #15.

9 years agoImprove the names of functions generated from lambdas
Oleh Krehel [Tue, 3 Feb 2015 17:09:12 +0000 (18:09 +0100)]
Improve the names of functions generated from lambdas

* hydra.el (defhydra): Improve.

Here, `hydra-window/lambda-v' function will be defined.

    (defhydra hydra-window ()
      "window"
      ("v" (lambda ()
             (interactive)
             (split-window-right)
             (windmove-right))
           "vert"))

9 years agoBump version
Oleh Krehel [Tue, 3 Feb 2015 16:13:29 +0000 (17:13 +0100)]
Bump version

* README.md: Update.

9 years agohydra.el (hydra-disable): adapt to Emacs 24.4.1
Oleh Krehel [Tue, 3 Feb 2015 14:49:55 +0000 (15:49 +0100)]
hydra.el (hydra-disable): adapt to Emacs 24.4.1

The old thing should work for Emacs 25, and some versions older than
24.4.1.

Fixes #14.

9 years agohydra-examples.el: splitters take numeric argument
Oleh Krehel [Tue, 3 Feb 2015 13:38:44 +0000 (14:38 +0100)]
hydra-examples.el: splitters take numeric argument

* hydra-examples.el (hydra-move-splitter-left): Take ARG.
(hydra-move-splitter-right): Take ARG.
(hydra-move-splitter-up): Take ARG.
(hydra-move-splitter-down): Take ARG.

9 years agoAdd support for `universal-argument' and `digit-argument'
Oleh Krehel [Tue, 3 Feb 2015 12:27:37 +0000 (13:27 +0100)]
Add support for `universal-argument' and `digit-argument'

* hydra.el (hydra-base-map): Model after `universal-argument-map'; all
  Hydra keymaps will inherit from this one.
(hydra-curr-map): Current Hydra keymap. This is necessary for
e.g. `hydra--digit-argument' to return to the orignial keymap.
(hydra--universal-argument): New function.
(hydra--digit-argument): New function.
(hydra--negative-argument): New function.
(hydra--hint): Fix dangling `body-color'.
(defhydra): keymap will inherit `hydra-base-map'.
`hydra-current-map' will be set by red heads. In red heads, make the
function call after `set-transient-map' so that e.g. "Beginning of
buffer" error will not exit the Hydra.

* hydra-test.el: Update tests.

Fixes #13.

9 years agohydra-test.el: Add licence
Oleh Krehel [Mon, 2 Feb 2015 14:39:51 +0000 (15:39 +0100)]
hydra-test.el: Add licence

9 years agoDistinguish red and blue hydra heads
Oleh Krehel [Sun, 1 Feb 2015 17:43:44 +0000 (18:43 +0100)]
Distinguish red and blue hydra heads

* hydra.el (hydra-face-red): New face.
(hydra-face-blue): New face.

(hydra--color): Each head now has a color: red is persistent, blue is
single-use. Head color inherits body color if it's not explicitly
overridden. Body color is red unless explicitly stated.

(hydra--face): Return face that corresponds to color.
(hydra--hint): New function, moved out of `defhydra'.
(hydra-disable): New function, moved out of `defhydra'.
(hydra--doc): New function, moved out of `defhydra'.

(defhydra): Commands that will vanquish the Hydra should be colored with
`hydra-face-blue'. The ones that will make the Hydra persist should be
colored with `hydra-face-red'.
Add autoload, move some code outside, Test HEAD's second element with
`null' instead of `functionp'.

* hydra-test.el (defhydra-red-error): Rename from `defhydra'.
(hydra-blue-toggle): Add test.

* README.md: Update.

Example:

    (global-set-key
     (kbd "C-c C-v")
     (defhydra toggle ()
       "toggle"
       ("t" toggle-truncate-lines "truncate" :color blue)
       ("f" auto-fill-mode "fill" :color blue)
       ("a" abbrev-mode "abbrev" :color blue)
       ("q" nil "cancel")))

Alternatively, since heads inherit color from the body:

    (global-set-key
     (kbd "C-c C-v")
     (defhydra toggle (:color blue)
       "toggle"
       ("a" abbrev-mode "abbrev")
       ("d" toggle-debug-on-error "debug")
       ("f" auto-fill-mode "fill")
       ("t" toggle-truncate-lines "truncate")
       ("w" whitespace-mode "whitespace")
       ("q" nil "cancel")))

9 years agohydra.el (defhydra): fix a bug for old Emacs versions
Oleh Krehel [Fri, 30 Jan 2015 19:23:41 +0000 (20:23 +0100)]
hydra.el (defhydra): fix a bug for old Emacs versions

re #10

9 years agoBump version
Oleh Krehel [Fri, 30 Jan 2015 16:07:13 +0000 (17:07 +0100)]
Bump version

9 years agohydra.el (defhydra): Use `clear-temporary-overlay-map'
Oleh Krehel [Fri, 30 Jan 2015 10:35:19 +0000 (11:35 +0100)]
hydra.el (defhydra): Use `clear-temporary-overlay-map'

* hydra.el (defhydra): Add a fix for old Emacs versions that don't have
`set-transient-map'.

Fixes #10.

9 years agoWhen calling `prefix/nil', make sure there's something to disable
Oleh Krehel [Thu, 29 Jan 2015 22:05:10 +0000 (23:05 +0100)]
When calling `prefix/nil', make sure there's something to disable

* hydra.el (defhydra): Update.

Fixes #10.

9 years agoREADME.md: update
Oleh Krehel [Thu, 29 Jan 2015 17:35:30 +0000 (18:35 +0100)]
README.md: update

9 years agohydra-examples.el: Update commentary
Oleh Krehel [Thu, 29 Jan 2015 17:30:13 +0000 (18:30 +0100)]
hydra-examples.el: Update commentary

9 years agoAdd automated testing
Oleh Krehel [Thu, 29 Jan 2015 17:21:13 +0000 (18:21 +0100)]
Add automated testing

* hydra-test.el (defhydra): Add test.

9 years agohydra.el (defhydra): new macro to create hydras.
Oleh Krehel [Thu, 29 Jan 2015 15:29:18 +0000 (16:29 +0100)]
hydra.el (defhydra): new macro to create hydras.

* hydra.el (hydra--callablep): New function.
(hydra-create): Write down in terms of `defhydra'.
(defhydra): New macro.

`defhydra' uses more parameters than `hydra-create' and looks more like
a `defun':

    (defhydra hydra-windmove (global-map "C-M-o")
      "windmove"
      ("h" windmove-left)
      ("j" windmove-down)
      ("k" windmove-up)
      ("l" windmove-right)
      ("o"))

    (defhydra hydra-zoom (global-map "<f2>")
      "zoom"
      ("g" text-scale-increase "in")
      ("l" text-scale-decrease "out"))

    (defhydra lispy-knight ()
      "knight"
      ("j" lispy-knight-down)
      ("k" lispy-knight-up)
      ("z"))

Important advantages:

- Hydra body can be omitted. If you do this, you can bind the functions
  that `defhydra' produced (in the example above, `lispy-knight/body')
  yourself. It can be useful e.g. if you want to call these functions
  conditionally.

- Each Hydra gets a nice name, like `hydra-windmove/windmove-left'
  instead of the old `hydra-C-M-o-windmove-left'.

- Hydra hint (base) can now be customized.

9 years agoBump version
Oleh Krehel [Sat, 24 Jan 2015 19:50:02 +0000 (20:50 +0100)]
Bump version

9 years agohydra-examples.el: add a `windmove' Hydra
Oleh Krehel [Thu, 22 Jan 2015 16:08:45 +0000 (17:08 +0100)]
hydra-examples.el: add a `windmove' Hydra

* hydra-examples.el (hydra-example-windmove): New variable.

9 years agoAvoid evaling METHOD.
Oleh Krehel [Thu, 22 Jan 2015 12:11:05 +0000 (13:11 +0100)]
Avoid evaling METHOD.

* hydra.el (hydra-create): Update.

METHOD doesn't need to be evaled: it's either nil, a lambda, or assume
that it's a valid keymap without evaling. This will prevent eager
macroexpansion failure for this argument.

There still is a problem with eager macroexpansion failure in HEADS
argument.

Re #9

9 years agoPrepare for the first version in GNU ELPA
Oleh Krehel [Wed, 21 Jan 2015 18:31:57 +0000 (19:31 +0100)]
Prepare for the first version in GNU ELPA

hydra.el (hydra-set-transient-map): new alias

`set-transient-map' only works for Emacs>=24.4.

9 years agohydra-examples.el (hydra-example-goto-error): add doc
Oleh Krehel [Wed, 21 Jan 2015 17:56:17 +0000 (18:56 +0100)]
hydra-examples.el (hydra-example-goto-error): add doc

9 years agoSimplify and improve the generated defuns
Oleh Krehel [Wed, 21 Jan 2015 17:23:02 +0000 (18:23 +0100)]
Simplify and improve the generated defuns

* hydra.el (hydra-create): Update.

9 years agoAdd a `next-error'/`previous-error'/`first-error' example
Oleh Krehel [Wed, 21 Jan 2015 17:05:31 +0000 (18:05 +0100)]
Add a `next-error'/`previous-error'/`first-error' example

* hydra-examples.el (hydra-example-goto-error): New example.

* README.md: Update.

Re #8, thanks, @glucas.

9 years agoDon't undefine BODY's map binding when it's a prefix
Oleh Krehel [Wed, 21 Jan 2015 16:43:33 +0000 (17:43 +0100)]
Don't undefine BODY's map binding when it's a prefix

* hydra.el (hydra-create): Update.

Basically the same fix as before, only for bindings relating to a map.

Now this will work:

    (hydra-create "C-y"
      '(("l" forward-char)
        ("h" backward-char)
        ("j" next-line)
        ("k" previous-line)
        ("z"))
      lispy-mode-map)

even though "C-y" is bound to a command in `lispy-mode-map'. The
previous binding will be undefined.

Re #4.

9 years agoDon't undefine BODY's global binding when it's a prefix
Oleh Krehel [Wed, 21 Jan 2015 16:11:10 +0000 (17:11 +0100)]
Don't undefine BODY's global binding when it's a prefix

* hydra.el (hydra-create): Update.

Before, this would result in a disaster - all bindings of "C-x" would be
cleared:

    (hydra-create "C-x" hydra-example-move-window-splitter)

Now this should be OK. Fixes #4.

9 years ago`hydra-create' will also define `hydra-...-body'
Oleh Krehel [Tue, 20 Jan 2015 22:36:48 +0000 (23:36 +0100)]
`hydra-create' will also define `hydra-...-body'

* hydra.el (hydra-create): Update.

In order to bind hydras in `lispy', I need a way to split the body from
the heads. Now, this is possible:

    (hydra-create "C-z"
      '(("l" forward-char)
        ("h" backward-char)
        ("j" next-line)
        ("k" previous-line)
        ("z"))
      lispy-mode-map)

    (lispy-define-key lispy-mode-map "z" 'hydra-C-z-body)

9 years agoAllow to add one head that disables the Hydra
Oleh Krehel [Tue, 20 Jan 2015 22:31:55 +0000 (23:31 +0100)]
Allow to add one head that disables the Hydra

* hydra.el (hydra-last): Store the lambda to disable the Hydra.
(hydra-create): Update.

Sometimes, I have nothing particualr on my mind to do, but I want to
stop the Hydra. I could just type "C-g", but it's possible to have
something more convenient. For instance:

    (hydra-create "C-z"
      '(("l" forward-char)
        ("h" backward-char)
        ("j" next-line)
        ("k" previous-line)
        ("z")))

9 years agoFix `kbd' interpretting "<tab>" char-by-char
Oleh Krehel [Wed, 21 Jan 2015 12:19:42 +0000 (13:19 +0100)]
Fix `kbd' interpretting "<tab>" char-by-char

* hydra.el (hydra-create): Update.

Fixes #6.

9 years agoRequire cl at compile time
Oleh Krehel [Wed, 21 Jan 2015 08:23:40 +0000 (09:23 +0100)]
Require cl at compile time

Should fix #5

9 years agoFix the bugged `global-set-key' version
Oleh Krehel [Tue, 20 Jan 2015 20:02:30 +0000 (21:02 +0100)]
Fix the bugged `global-set-key' version

* hydra.el (hydra-create): Fix.

9 years agoMake sure `windmove-wrap-around' is nil during tests
Oleh Krehel [Tue, 20 Jan 2015 19:58:31 +0000 (20:58 +0100)]
Make sure `windmove-wrap-around' is nil during tests

* hydra-examples.el (hydra-move-splitter-left): Update.
(hydra-move-splitter-right): Update.
(hydra-move-splitter-up): Update.
(hydra-move-splitter-down): Update.

9 years agoDon't unbind hydra's body, unless using global-set-key
Oleh Krehel [Tue, 20 Jan 2015 18:38:47 +0000 (19:38 +0100)]
Don't unbind hydra's body, unless using global-set-key

* hydra.el (hydra-create): Update.

Fixes #3.

9 years agoUpdate `hydra-create' format
Oleh Krehel [Tue, 20 Jan 2015 18:24:05 +0000 (19:24 +0100)]
Update `hydra-create' format

* hydra.el (hydra-create): Expects a lists of lists for HEADS, instead
  of list of cons cells. The optional thrid element of each list is the
  hint.

* hydra-examples.el: Update the examples.

* README.md: Update.

Re #2

9 years agoAdd `hydra-is-helpful' custom var
Oleh Krehel [Tue, 20 Jan 2015 17:52:50 +0000 (18:52 +0100)]
Add `hydra-is-helpful' custom var

* hydra.el (hydra-is-helpful): New custom.
(hydra-create): Display a hint in the echo area when `hydra-is-helpful'
is t.

Re #2.

9 years agoAllow to use minor-mode-maps and more
Oleh Krehel [Tue, 20 Jan 2015 16:46:48 +0000 (17:46 +0100)]
Allow to use minor-mode-maps and more

* hydra.el (hydra-create): Add a third optional argument. When it's not
  supplied, the behavior should remain the same. Otherwise, it's a
  lambda that's used instead of `global-set-key', with the same semantics.

* README.md: Update.

re #1

9 years agoDepend on cl-lib v0.5 for `cl-mapcar'
Oleh Krehel [Tue, 20 Jan 2015 14:41:33 +0000 (15:41 +0100)]
Depend on cl-lib v0.5 for `cl-mapcar'

9 years agoUnbind hydra's body unconditionally to avoid error
Oleh Krehel [Tue, 20 Jan 2015 14:06:46 +0000 (15:06 +0100)]
Unbind hydra's body unconditionally to avoid error

* hydra.el (hydra-create): Since body will be established as a prefix,
  it can't be bound anyway. Unbind it preemptively and unconditionally.

9 years agoREADME.md: update doc
Oleh Krehel [Tue, 20 Jan 2015 13:58:08 +0000 (14:58 +0100)]
README.md: update doc

9 years agoSplit away the examples
Oleh Krehel [Tue, 20 Jan 2015 13:47:28 +0000 (14:47 +0100)]
Split away the examples

9 years agoInitial import
Oleh Krehel [Tue, 20 Jan 2015 12:00:56 +0000 (13:00 +0100)]
Initial import