unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [ELPA] New package: use-package-hydra
@ 2018-08-18  8:35 Toon Claes
  2018-08-20  2:21 ` John Wiegley
  0 siblings, 1 reply; 2+ messages in thread
From: Toon Claes @ 2018-08-18  8:35 UTC (permalink / raw)
  To: emacs-devel


[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ELPA] New package: use-package-hydra
  2018-08-18  8:35 [ELPA] New package: use-package-hydra Toon Claes
@ 2018-08-20  2:21 ` John Wiegley
  0 siblings, 0 replies; 2+ messages in thread
From: John Wiegley @ 2018-08-20  2:21 UTC (permalink / raw)
  To: Toon Claes; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]

>>>>> "TC" == Toon Claes <toon@iotcl.com> writes:

TC> use-package isn't on ELPA, but it might be one day. See
TC> https://github.com/jwiegley/use-package

Either ELPA, or added into core, once I find some time to make sure the
documentation is in suitable shape.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-20  2:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-18  8:35 [ELPA] New package: use-package-hydra Toon Claes
2018-08-20  2:21 ` John Wiegley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).