From 5db63f68a16f19fedc665692f05c5c32f8dd5ac0 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Wed, 10 Jun 2015 13:16:09 +0200 Subject: [PATCH] lispy-pkg.el: Update dependencies * lispy-pkg.el (hydra): Remove dependency. (multiple-cursors): Remove dependency. * lispy.el (defhydra): Add a stub macro that offers to install hydra and recompile/reload lispy when a hydra command is called. Re #74 Fixes #46 --- lispy-pkg.el | 6 ++---- lispy.el | 14 +++++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lispy-pkg.el b/lispy-pkg.el index 7ec91123..493e82ed 100644 --- a/lispy-pkg.el +++ b/lispy-pkg.el @@ -1,8 +1,6 @@ (define-package "lispy" "0.24.0" "vi-like Paredit" '((emacs "24.1") - (ace-window "0.8.0") - (hydra "0.12.1") + (ace-window "0.9.0") (iedit "0.97") - (multiple-cursors "1.3.0") - (swiper "0.2.0"))) + (swiper "0.4.0"))) diff --git a/lispy.el b/lispy.el index 55d3b083..7c7218c8 100644 --- a/lispy.el +++ b/lispy.el @@ -151,7 +151,6 @@ (require 'lispy-inline) (require 'iedit) (require 'delsel) -(require 'hydra) (require 'swiper) ;;* Customization @@ -6188,6 +6187,19 @@ FUNC is obtained from (`lispy--insert-or-call' DEF PLIST)." ("f" lispy-flatten) ("a" lispy-teleport))) +(unless (package-installed-p 'hydra) + (defmacro defhydra (name &rest _) + "This is a stub for uninstalled `hydra' package." + `(defun ,(intern (format "%S/body" name)) () + (interactive) + (if (yes-or-no-p "Package `hydra' not installed. Install?") + (progn + (package-install 'hydra) + (save-window-excursion + (find-library "lispy") + (byte-compile-file (buffer-file-name) t))) + (error "Please install `hydra' and recompile/reinstall `lispy'"))))) + (defhydra lh-knight () "knight" ("j" lispy-knight-down)