From 6c7aba0e2275706f5c24f9141e7f9d3f2d3d8534 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Fri, 31 Jan 2020 17:30:42 +0100 Subject: [PATCH] update hydra --- .../hydra-autoloads.el | 28 ++++++++-- .../hydra-examples.el | 0 .../hydra-ox.el | 0 .../hydra-pkg.el | 2 +- .../hydra.el | 10 ++-- elpa/hydra-readme.txt | 51 +++++++++++++++++++ 6 files changed, 81 insertions(+), 10 deletions(-) rename elpa/{hydra-20190821.939 => hydra-20191125.955}/hydra-autoloads.el (72%) rename elpa/{hydra-20190821.939 => hydra-20191125.955}/hydra-examples.el (100%) rename elpa/{hydra-20190821.939 => hydra-20191125.955}/hydra-ox.el (100%) rename elpa/{hydra-20190821.939 => hydra-20191125.955}/hydra-pkg.el (81%) rename elpa/{hydra-20190821.939 => hydra-20191125.955}/hydra.el (99%) create mode 100644 elpa/hydra-readme.txt diff --git a/elpa/hydra-20190821.939/hydra-autoloads.el b/elpa/hydra-20191125.955/hydra-autoloads.el similarity index 72% rename from elpa/hydra-20190821.939/hydra-autoloads.el rename to elpa/hydra-20191125.955/hydra-autoloads.el index d3428dda..66f654e9 100644 --- a/elpa/hydra-20190821.939/hydra-autoloads.el +++ b/elpa/hydra-20191125.955/hydra-autoloads.el @@ -1,9 +1,12 @@ ;;; hydra-autoloads.el --- automatically extracted autoloads ;; ;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + -;;;### (autoloads nil "hydra" "hydra.el" (23994 42600 207958 9000)) +;;;### (autoloads nil "hydra" "hydra.el" (0 0 0 0)) ;;; Generated autoloads from hydra.el (autoload 'defhydra "hydra" "\ @@ -64,10 +67,26 @@ result of `defhydra'. (function-put 'defhydra 'doc-string-elt '3) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "hydra" '("hydra-" "defhydra"))) + +;;;*** + +;;;### (autoloads nil "hydra-examples" "hydra-examples.el" (0 0 0 +;;;;;; 0)) +;;; Generated autoloads from hydra-examples.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "hydra-examples" '("hydra-" "org-agenda-cts" "whitespace-mode"))) + +;;;*** + +;;;### (autoloads nil "hydra-ox" "hydra-ox.el" (0 0 0 0)) +;;; Generated autoloads from hydra-ox.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "hydra-ox" '("hydra-ox"))) + ;;;*** -;;;### (autoloads nil nil ("hydra-examples.el" "hydra-ox.el" "hydra-pkg.el") -;;;;;; (23994 42600 209767 474000)) +;;;### (autoloads nil nil ("hydra-pkg.el") (0 0 0 0)) ;;;*** @@ -75,5 +94,6 @@ result of `defhydra'. ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t +;; coding: utf-8 ;; End: ;;; hydra-autoloads.el ends here diff --git a/elpa/hydra-20190821.939/hydra-examples.el b/elpa/hydra-20191125.955/hydra-examples.el similarity index 100% rename from elpa/hydra-20190821.939/hydra-examples.el rename to elpa/hydra-20191125.955/hydra-examples.el diff --git a/elpa/hydra-20190821.939/hydra-ox.el b/elpa/hydra-20191125.955/hydra-ox.el similarity index 100% rename from elpa/hydra-20190821.939/hydra-ox.el rename to elpa/hydra-20191125.955/hydra-ox.el diff --git a/elpa/hydra-20190821.939/hydra-pkg.el b/elpa/hydra-20191125.955/hydra-pkg.el similarity index 81% rename from elpa/hydra-20190821.939/hydra-pkg.el rename to elpa/hydra-20191125.955/hydra-pkg.el index ac073f7e..a6887567 100644 --- a/elpa/hydra-20190821.939/hydra-pkg.el +++ b/elpa/hydra-20191125.955/hydra-pkg.el @@ -1,4 +1,4 @@ -(define-package "hydra" "20190821.939" "Make bindings that stick around." +(define-package "hydra" "20191125.955" "Make bindings that stick around." '((cl-lib "0.5") (lv "0")) :keywords diff --git a/elpa/hydra-20190821.939/hydra.el b/elpa/hydra-20191125.955/hydra.el similarity index 99% rename from elpa/hydra-20190821.939/hydra.el rename to elpa/hydra-20191125.955/hydra.el index a33be7a3..35085327 100644 --- a/elpa/hydra-20190821.939/hydra.el +++ b/elpa/hydra-20191125.955/hydra.el @@ -33,7 +33,7 @@ ;; heads can be called in succession with only a short extension. ;; The Hydra is vanquished once Hercules, any binding that isn't the ;; Hydra's head, arrives. Note that Hercules, besides vanquishing the -;; Hydra, will still serve his orignal purpose, calling his proper +;; Hydra, will still serve his original purpose, calling his proper ;; command. This makes the Hydra very seamless, it's like a minor ;; mode that disables itself automagically. ;; @@ -327,7 +327,7 @@ Exitable only through a blue head.") "Navigate to hydras with `find-function-search-for-symbol'." (prog1 ad-do-it (when (symbolp symbol) - ;; The orignial function returns (cons (current-buffer) (point)) + ;; The original function returns (cons (current-buffer) (point)) ;; if it found the point. (unless (cdr ad-return-value) (with-current-buffer (find-file-noselect library) @@ -1072,7 +1072,7 @@ If CELL-FORMATS is nil, `hydra-cell-format' is used for all columns." (mapconcat #'identity x " ")))) (defun hydra-reset-radios (names) - "Set varibles NAMES to their defaults. + "Set variables NAMES to their defaults. NAMES should be defined by `defhydradio' or similar." (dolist (n names) (set n (aref (get n 'range) 0)))) @@ -1123,7 +1123,7 @@ Each head of NORMALIZED-HEADS must have a column property." finally return balanced-heads-groups)) (defun hydra--generate-matrix (heads-groups) - "Return a copy of HEADS-GROUPS decorated with table formating information. + "Return a copy of HEADS-GROUPS decorated with table formatting information. Details of modification: 2 virtual heads acting as table header were added to each heads-group. Each head is decorated with 2 new properties max-doc-len and max-key-len @@ -1174,7 +1174,7 @@ representing the maximum dimension of their owning group. (defun hydra--hint-from-matrix (body heads-matrix) - "Generate a formated table-style docstring according to BODY and HEADS-MATRIX. + "Generate a formatted table-style docstring according to BODY and HEADS-MATRIX. HEADS-MATRIX is expected to be a list of heads with following features: Each heads must have the same length Each head must have a property max-key-len and max-doc-len." diff --git a/elpa/hydra-readme.txt b/elpa/hydra-readme.txt new file mode 100644 index 00000000..300c6fac --- /dev/null +++ b/elpa/hydra-readme.txt @@ -0,0 +1,51 @@ +This package can be used to tie related commands into a family of +short bindings with a common prefix - a Hydra. + +Once you summon the Hydra (through the prefixed binding), all the +heads can be called in succession with only a short extension. +The Hydra is vanquished once Hercules, any binding that isn't the +Hydra's head, arrives. Note that Hercules, besides vanquishing the +Hydra, will still serve his original purpose, calling his proper +command. This makes the Hydra very seamless, it's like a minor +mode that disables itself automagically. + +Here's an example Hydra, bound in the global map (you can use any +keymap in place of `global-map'): + + (defhydra hydra-zoom (global-map "") + "zoom" + ("g" text-scale-increase "in") + ("l" text-scale-decrease "out")) + +It allows to start a command chain either like this: +" gg4ll5g", or " lgllg". + +Here's another approach, when you just want a "callable keymap": + + (defhydra hydra-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")) + +This binds nothing so far, but if you follow up with: + + (global-set-key (kbd "C-c C-v") 'hydra-toggle/body) + +you will have bound "C-c C-v a", "C-c C-v d" etc. + +Knowing that `defhydra' defines e.g. `hydra-toggle/body' command, +you can nest Hydras if you wish, with `hydra-toggle/body' possibly +becoming a blue head of another Hydra. + +If you want to learn all intricacies of using `defhydra' without +having to figure it all out from this source code, check out the +wiki: https://github.com/abo-abo/hydra/wiki. There's a wealth of +information there. Everyone is welcome to bring the existing pages +up to date and add new ones. + +Additionally, the file hydra-examples.el serves to demo most of the +functionality. -- 2.47.3