Skip to content

Commit

Permalink
Fix argument to `replace-match'
Browse files Browse the repository at this point in the history
* hydra.el (hydra--format): Update.

* hydra-test.el (hydra-format-3): Add test.

Fixes #91
  • Loading branch information
abo-abo committed Mar 24, 2015
1 parent c8c6b8c commit 71491b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions hydra-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,17 @@ _f_ auto-fill-mode: %`auto-fill-function
("q" nil "" :cmd-name bar/nil))))
'(concat (format " bar %s\n" foo) "{a}, [q]"))))

(ert-deftest hydra-format-3 ()
(should (equal
(let ((hydra-fontify-head-function
'hydra-fontify-head-greyscale))
(hydra--format
'bar
nil
"\n_<SPC>_ ^^ace jump\n"
'(("<SPC>" ace-jump-char-mode nil :cmd-name bar/ace-jump-char-mode))))
'(concat (format "%s ace jump\n" "{<SPC>}") ""))))

(ert-deftest hydra-format-with-sexp-1 ()
(should (equal
(let ((hydra-fontify-head-function
Expand Down
2 changes: 1 addition & 1 deletion hydra.el
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ The expressions can be auto-expanded according to NAME."
(or
hydra-key-format-spec
(concat "%" (match-string 3 docstring) "s"))
nil nil docstring)))
t nil docstring)))
(error "Unrecognized key: _%s_" key))))

(t
Expand Down

0 comments on commit 71491b9

Please sign in to comment.