all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* getting started with the `hydra' package from GNU Elpa -- fail with simplest example
@ 2017-09-17 19:58 N. Jackson
  2017-09-18  4:19 ` Marcin Borkowski
  0 siblings, 1 reply; 3+ messages in thread
From: N. Jackson @ 2017-09-17 19:58 UTC (permalink / raw)
  To: help-gnu-emacs

Hello everyone,

Is this a suitable list for getting help with the `hydra' package
from GNU Elpa?

If not, can anyone point me to the right list?

I am running the current version of `hydra', 0.14.0, installed
(from GNU Elpa using the Emacs package manager) for the first time
today.

I'm trying to run the simplest example from the readme file for
the package [1]. I take the following steps:

0. $ emacs -Q

1. M-x package-initialize RET

2. In *scratch* type the example code from the readme:

(defhydra hydra-zoom (global-map "<f2>")
  "zoom"
  ("g" text-scale-increase "in")
  ("l" text-scale-decrease "out"))

3. C-x C-e to evaluate it

4. Hit F2 to run it

Expected behaviour:

A prompt is displayed listing `g' and `l' as possible keys;
pressing 'g' or `l' changes the font size; pressing any other key
exits the hydra.

Observed behaviour:

No prompt is displayed. Only "f2-" is displayed in the echo area.
Pressing `g' or `l' changes font size as expected and _after_
pressing either `g' or `l' at least once, a hydra prompt is
displayed and subsequently pressing any other key exits the hydra
as expected. However, if a key other than `g' of `l' is pressed
before either `g' or `l' is pressed an error message is displayed.
E.g. pressing `n' produces

  <f2> n is undefined

After the error message is printed, text typed in the buffer at
point is coloured red. [Presumably text properties or an overlay
that was meant to go in the minibuffer were applied at point.]

Any help or pointers would be much appreciated.

Thanks.
N.

[1] <https://github.com/abo-abo/hydra#sample-hydras>




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

* Re: getting started with the `hydra' package from GNU Elpa -- fail with simplest example
  2017-09-17 19:58 getting started with the `hydra' package from GNU Elpa -- fail with simplest example N. Jackson
@ 2017-09-18  4:19 ` Marcin Borkowski
  2017-09-22 15:28   ` N. Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2017-09-18  4:19 UTC (permalink / raw)
  To: N. Jackson; +Cc: help-gnu-emacs


On 2017-09-17, at 21:58, N. Jackson <nljlistbox2@gmail.com> wrote:

> Any help or pointers would be much appreciated.

I do not know how the `global-key' option is supposed to work, but did
you try just saying

(global-set-key (kbd "<f2>") 'hydra-zoom/body)

instead of `global-key' after the hydra is defined?

Best,

-- 
Marcin Borkowski



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

* Re: getting started with the `hydra' package from GNU Elpa -- fail with simplest example
  2017-09-18  4:19 ` Marcin Borkowski
@ 2017-09-22 15:28   ` N. Jackson
  0 siblings, 0 replies; 3+ messages in thread
From: N. Jackson @ 2017-09-22 15:28 UTC (permalink / raw)
  To: help-gnu-emacs

At 06:19 +0200 on Monday 2017-09-18, Marcin Borkowski wrote:
>
> I do not know how the `global-key' option is supposed to work, but did
> you try just saying
>
> (global-set-key (kbd "<f2>") 'hydra-zoom/body)
>
> instead of `global-key' after the hydra is defined?

Hello Marcin,

No, I hadn't tried that and

  (defhydra hydra-zoom ()
    "zoom"
    ("g" text-scale-increase "in")
    ("l" text-scale-decrease "out"))

  (global-set-key (kbd "<f2>") 'hydra-zoom/body)

does work, indeed. Thank you.

I have submitted a but report [1] to let the maintainer know that his
first/simplest example no longer works.

N.

[1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28550





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

end of thread, other threads:[~2017-09-22 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-17 19:58 getting started with the `hydra' package from GNU Elpa -- fail with simplest example N. Jackson
2017-09-18  4:19 ` Marcin Borkowski
2017-09-22 15:28   ` N. Jackson

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.