From: Toon Claes <toon@iotcl.com>
To: emacs-devel@gnu.org
Subject: [ELPA] New package: use-package-hydra
Date: Sat, 18 Aug 2018 10:35:18 +0200 [thread overview]
Message-ID: <877eko5ayh.fsf@iotcl.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2122 bytes --]
Hi,
I'd like to request adding use-package-hydra to ELPA.
It uses the powers of hydra, and adds them to use-package. See
https://elpa.gnu.org/packages/hydra.html for info about hydra.
use-package isn't on ELPA, but it might be one day. See
https://github.com/jwiegley/use-package
At the bottom is the README of the package. There are still some feature
I'd like to add in the future, but I think users can benefit from the
current version as-is. And I'm also hoping to attract contributors by
publishing this on ELPA.
Any comment is welcome.
-- Toon
---
* use-package-hydra
This package adds the =:hydra= keyword to the =use-package= macro.
** Usage
You can define [[https://github.com/abo-abo/hydra][Hydras]] directly in the =use-package= definition. The
=:hydra= keyword expects the same arguments as =defhydra= does.
You can define a single hydra, or a list of hydras.
Binding a key to a hydra is similar as with =defhydra=. You can
specify the map and the key in the hydra itself, or you can use the
=use-package= =:bind= keyword to bind a key to the =<hydra-name>/body=
function.
** Examples
#+begin_src emacs-lisp :tangle yes
(use-package yasnippet
:after hydra
:bind (:map yas-minor-mode-map ("<f2>" . hydra-yas/body))
:hydra (hydra-yas (:color blue :hint nil)
"
^YASnippets^
--------------------------------------------
Modes: Load/Visit: Actions:
_g_lobal _d_irectory _i_nsert
_m_inor _f_ile _t_ryout
_e_xtra _l_ist _n_ew
_a_ll
"
("d" yas-load-directory)
("e" yas-activate-extra-mode)
("i" yas-insert-snippet)
("f" yas-visit-snippet-file :color blue)
("n" yas-new-snippet)
("t" yas-tryout-snippet)
("l" yas-describe-tables)
("g" yas/global-mode)
("m" yas/minor-mode)
("a" yas-reload-all)))
#+end_src
** Installation
You can use =use-package= itself to install this extension.
#+begin_src emacs-lisp :tangle yes
(use-package use-package-hydra
:ensure t)
#+end_src
[-- Attachment #1.2: use-package-hydra package --]
[-- Type: application/emacs-lisp, Size: 3181 bytes --]
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next reply other threads:[~2018-08-18 8:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-18 8:35 Toon Claes [this message]
2018-08-20 2:21 ` [ELPA] New package: use-package-hydra John Wiegley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877eko5ayh.fsf@iotcl.com \
--to=toon@iotcl.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.