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

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

[elpa] scratch/add-vdiff b2ba7ab 070/258: Move hydra to main file and av


From: Justin Burkett
Subject: [elpa] scratch/add-vdiff b2ba7ab 070/258: Move hydra to main file and avoid dependency
Date: Wed, 17 May 2017 08:13:25 -0400 (EDT)

branch: scratch/add-vdiff
commit b2ba7ab84eb18aa1c6f5d71cef90c578e6a4ac3a
Author: justbur <address@hidden>
Commit: justbur <address@hidden>

    Move hydra to main file and avoid dependency
---
 vdiff-hydra.el | 53 -----------------------------------------------------
 vdiff.el       | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+), 53 deletions(-)

diff --git a/vdiff-hydra.el b/vdiff-hydra.el
deleted file mode 100644
index 3c0beff..0000000
--- a/vdiff-hydra.el
+++ /dev/null
@@ -1,53 +0,0 @@
-;;; vdiff-hydra.el --- A hydra for vdiff -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2016 Justin Burkett
-
-;; Author: Justin Burkett <address@hidden>
-;; URL: https://github.com/justbur/emacs-vdiff
-;; Version: 0
-;; Keywords:
-;; Package-Requires: ((emacs "24.3") (hydra "0.13.6")
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Defines a hydra for quick access to vdiff commands
-
-;;; Code:
-(require 'hydra)
-(require 'vdiff)
-
-(defhydra vdiff-hydra (nil nil :hint nil)
-  "
- Navigation^^             Transmit^^        Folds^^^^                Other^^
- -^^-------------------  --^^------------  -^^^^------------------  
--^-^---------------
- [_n_] next change        [_s_] send        [_o_/_O_] open (all)     [_w_] 
save buffers
- [_p_] previous change    [_r_] receive     [_c_/_C_] close (all)    [_q_] 
quit hydra
- [_g_] goto corr. line     ^ ^               ^ ^ ^ ^                 [_Q_] 
quit vdiff "
-  ("g" vdiff-goto-corresponding-line)
-  ("n" vdiff-next-change)
-  ("p" vdiff-previous-change)
-  ("s" vdiff-send-changes)
-  ("r" vdiff-receive-changes)
-  ("Q" vdiff-quit)
-  ("w" vdiff-save-buffers)
-  ("o" vdiff-open-fold)
-  ("O" vdiff-open-all-folds)
-  ("c" vdiff-close-fold)
-  ("C" vdiff-close-all-folds)
-  ("q" nil :exit t))
-
-(provide 'vdiff-hydra)
-;;; vdiff-hydra.el ends here
diff --git a/vdiff.el b/vdiff.el
index 0d769a6..a062d91 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -1005,5 +1005,26 @@ enabled automatically if `vdiff-lock-scrolling' is 
non-nil."
           (remove-hook 'post-command-hook #'vdiff-mirror-commands t))
          (message "Scrolling unlocked"))))
 
+(when (fboundp 'defhydra)
+  (defhydra vdiff-hydra (nil nil :hint nil :foreign-keys run)
+    "
+ Navigation^^             Transmit^^        Folds^^^^                Other^^
+ -^^-------------------  --^^------------  -^^^^------------------  
--^-^---------------
+ [_n_] next change        [_s_] send        [_o_/_O_] open (all)     [_w_] 
save buffers
+ [_p_] previous change    [_r_] receive     [_c_/_C_] close (all)    [_q_] 
quit hydra
+ [_g_] goto corr. line     ^ ^               ^ ^ ^ ^                 [_Q_] 
quit vdiff "
+    ("g" vdiff-goto-corresponding-line)
+    ("n" vdiff-next-change)
+    ("p" vdiff-previous-change)
+    ("s" vdiff-send-changes)
+    ("r" vdiff-receive-changes)
+    ("Q" vdiff-quit)
+    ("w" vdiff-save-buffers)
+    ("o" vdiff-open-fold)
+    ("O" vdiff-open-all-folds)
+    ("c" vdiff-close-fold)
+    ("C" vdiff-close-all-folds)
+    ("q" nil :exit t)))
+
 (provide 'vdiff)
 ;;; vdiff.el ends here



reply via email to

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