hydra.el (hydra-lv): Remove obsolete defcustom

Fixes #344
master
Oleh Krehel 7 years ago
parent a91dd72529
commit b14aaf71cb
  1. 44
      README.md
  2. 6
      hydra-test.el
  3. 8
      hydra.el

@ -66,7 +66,7 @@ If you want to quickly understand the concept, see [the video demo](https://www.
## The one with the least amount of code
```cl
```elisp
(defhydra hydra-zoom (global-map "<f2>")
"zoom"
("g" text-scale-increase "in")
@ -95,7 +95,7 @@ Here's the result of pressing <kbd>.</kbd> in the good-old Buffer menu:
The code is large but very simple:
```cl
```elisp
(defhydra hydra-buffer-menu (:color pink
:hint nil)
"
@ -171,22 +171,26 @@ If you name your hydra `hydra-awesome`, the return result of `defhydra` will be
Here's what `hydra-zoom/body` looks like, if you're interested:
```cl
(defun hydra-zoom/body nil
"Create a hydra with a \"<f2>\" body and the heads:
```elisp
(defun hydra-zoom/body ()
"Call the body in the \"hydra-zoom\" hydra.
The heads for the associated hydra are:
\"g\": `text-scale-increase',
\"l\": `text-scale-decrease'
The body can be accessed via `hydra-zoom/body'."
The body can be accessed via `hydra-zoom/body', which is bound to \"<f2>\"."
(interactive)
(require 'hydra)
(hydra-default-pre)
(when hydra-is-helpful
(if hydra-lv
(lv-message
(eval hydra-zoom/hint))
(message
(eval hydra-zoom/hint))))
(let ((hydra--ignore nil))
(hydra-keyboard-quit)
(setq hydra-curr-body-fn
'hydra-zoom/body))
(hydra-show-hint
hydra-zoom/hint
'hydra-zoom)
(hydra-set-transient-map
hydra-zoom/keymap
(lambda nil
@ -203,7 +207,7 @@ This can be any keymap, for instance, `global-map` or `isearch-mode-map`.
For this example:
```cl
```elisp
(defhydra hydra-zoom (global-map "<f2>")
"zoom"
("g" text-scale-increase "in")
@ -215,7 +219,7 @@ For this example:
And here's the relevant generated code:
```cl
```elisp
(unless (keymapp (lookup-key global-map (kbd "<f2>")))
(define-key global-map (kbd "<f2>") nil))
(define-key global-map [f2 103]
@ -229,7 +233,7 @@ As you see, `"<f2>"` is used as a prefix for <kbd>g</kbd> (char value 103) and <
If you don't want to use a map right now, you can skip it like this:
```cl
```elisp
(defhydra hydra-zoom (nil nil)
"zoom"
("g" text-scale-increase "in")
@ -238,7 +242,7 @@ If you don't want to use a map right now, you can skip it like this:
Or even simpler:
```cl
```elisp
(defhydra hydra-zoom ()
"zoom"
("g" text-scale-increase "in")
@ -260,7 +264,7 @@ Below is a list of each key.
You can specify code that will be called before each head, and after the body. For example:
```cl
```elisp
(defhydra hydra-vi (:pre (set-cursor-color "#40e0d0")
:post (progn
(set-cursor-color "#ffffff")
@ -359,7 +363,7 @@ If the result of the Elisp expression is a string and you don't want to quote it
Each head looks like this:
```cl
```elisp
(head-binding head-command head-hint head-plist)
```
@ -392,7 +396,7 @@ The `head-command` can be:
Here's an example of the last option:
```cl
```elisp
(defhydra hydra-launcher (:color blue)
"Launch"
("h" man "man")
@ -411,7 +415,7 @@ You can set the head hint to `nil` to do this.
Example:
```cl
```elisp
(defhydra hydra-zoom (global-map "<f2>")
"
Press _g_ to zoom in.

@ -1322,9 +1322,9 @@ _f_ auto-fill-mode: %`auto-fill-function
'((a b c d) (e f g h) (i nil nil nil)))))
(ert-deftest hydra--cell ()
(should (equal (hydra--cell "% -75s %%`%s" '(hydra-lv hydra-verbose))
"When non-nil, `lv-message' (not `message') will be used to display hints. %`hydra-lv^^^^^
When non-nil, hydra will issue some non essential style warnings. %`hydra-verbose")))
(should (equal (hydra--cell "% -75s %%`%s" '(hydra-hint-display-type hydra-verbose))
"The utility to show hydra hint %`hydra-hint-display-type
When non-nil, hydra will issue some non essential style warnings. %`hydra-verbose^^^^^^^^^^")))
(ert-deftest hydra--vconcat ()
(should (equal (hydra--vconcat '("abc\ndef" "012\n34" "def\nabc"))

@ -253,14 +253,6 @@ the body or the head."
(const posframe))
:group 'hydra)
(define-obsolete-variable-alias
'hydra-lv 'hydra-hint-display-type "0.14.0"
"Use either `hydra-hint-display-type' or `hydra-set-property' :verbosity.")
(defcustom hydra-lv t
"When non-nil, `lv-message' (not `message') will be used to display hints."
:type 'boolean)
(defcustom hydra-verbose nil
"When non-nil, hydra will issue some non essential style warnings."
:type 'boolean)

Loading…
Cancel
Save