Skip to content

Commit

Permalink
lispy-pkg.el: Update dependencies
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
abo-abo committed Jun 10, 2015
1 parent d3c8c77 commit 5db63f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lispy-pkg.el
Original file line number Diff line number Diff line change
@@ -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")))
14 changes: 13 additions & 1 deletion lispy.el
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
(require 'lispy-inline)
(require 'iedit)
(require 'delsel)
(require 'hydra)
(require 'swiper)

;;* Customization
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5db63f6

Please sign in to comment.