emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hydra b14aaf71cb 07/35: hydra.el (hydra-lv): Remove obs


From: ELPA Syncer
Subject: [elpa] externals/hydra b14aaf71cb 07/35: hydra.el (hydra-lv): Remove obsolete defcustom
Date: Tue, 25 Oct 2022 22:59:04 -0400 (EDT)

branch: externals/hydra
commit b14aaf71cb644d5a7ab852d755fa3b9c4c27a36e
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    hydra.el (hydra-lv): Remove obsolete defcustom
    
    Fixes #344
---
 README.md     | 44 ++++++++++++++++++++++++--------------------
 hydra-test.el |  6 +++---
 hydra.el      |  8 --------
 3 files changed, 27 insertions(+), 31 deletions(-)

diff --git a/README.md b/README.md
index 35aedcacfa..074fe8cadb 100644
--- a/README.md
+++ b/README.md
@@ -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.
diff --git a/hydra-test.el b/hydra-test.el
index f09689d2d3..69ca77f963 100644
--- a/hydra-test.el
+++ b/hydra-test.el
@@ -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"))
diff --git a/hydra.el b/hydra.el
index 246d3d388d..a33be7a351 100644
--- a/hydra.el
+++ b/hydra.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]