I'd like Emacs to display a big (but short) "pop up" text

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

I'd like Emacs to display a big (but short) "pop up" text

Marcin Borkowski-3
Hi all,

I'd like to display a "pop up"/"tip", i.e., a short text (a few
characters).  The thing is, I want it to be visible: large font,
preferably centered on the screen.  My use case is demoing Emacs, and
before showing the effects of e.g. C-x 2, I'd like to show
a big-lettered "C-x 2" on the screen.  It would be nice to use something
like the blocks in M-x tetris to build the letters, or anything else
that would clearly show "C-x 2" or whatever keychord I'm showing.

Any ideas?

--
Marcin Borkowski

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I'd like Emacs to display a big (but short) "pop up" text

Eric Abrahamsen-2
Marcin Borkowski <[hidden email]> writes:

> Hi all,
>
> I'd like to display a "pop up"/"tip", i.e., a short text (a few
> characters).  The thing is, I want it to be visible: large font,
> preferably centered on the screen.  My use case is demoing Emacs, and
> before showing the effects of e.g. C-x 2, I'd like to show
> a big-lettered "C-x 2" on the screen.  It would be nice to use something
> like the blocks in M-x tetris to build the letters, or anything else
> that would clearly show "C-x 2" or whatever keychord I'm showing.
>
> Any ideas?

I've wanted this too -- it seems like this is something alert.el would
be good for. It would be particularly nice to be able to filter on key
prefixes, or major mode commands, or something like that. Maybe a
post-command-hook that examines the function called, and decides whether
to pop up a key-press display or not...


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I'd like Emacs to display a big (but short) "pop up" text

Stephen Berman
In reply to this post by Marcin Borkowski-3
On Tue, 08 Aug 2017 07:00:19 +0200 Marcin Borkowski <[hidden email]> wrote:

> Hi all,
>
> I'd like to display a "pop up"/"tip", i.e., a short text (a few
> characters).  The thing is, I want it to be visible: large font,
> preferably centered on the screen.  My use case is demoing Emacs, and
> before showing the effects of e.g. C-x 2, I'd like to show
> a big-lettered "C-x 2" on the screen.  It would be nice to use something
> like the blocks in M-x tetris to build the letters, or anything else
> that would clearly show "C-x 2" or whatever keychord I'm showing.
>
> Any ideas?

How about tooltip-show with a large face, e.g.:

(set-face-attribute 'tooltip nil :height 4.0
                    :foreground "white" :background "red")

You'd also have to play with tooltip-frame-parameters to get the
position the way you want.

Steve Berman

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: I'd like Emacs to display a big (but short) "pop up" text

Drew Adams
In reply to this post by Marcin Borkowski-3
> I'd like to display a "pop up"/"tip", i.e., a short text (a few
> characters).  The thing is, I want it to be visible: large font,
> preferably centered on the screen.  My use case is demoing Emacs, and
> before showing the effects of e.g. C-x 2, I'd like to show
> a big-lettered "C-x 2" on the screen.  It would be nice to use something
> like the blocks in M-x tetris to build the letters, or anything else
> that would clearly show "C-x 2" or whatever keychord I'm showing.

I created ‘showkey.el’ for just this.  It shows keys and other events
as you use them.

You can tailor the behavior to ignore given event types for display.
There are 2 ways to show keys:

* ‘showkey-tooltip-mode’ – Show only the last key used, in a tooltip.
  Refreshed with each such event.

* ‘showkey-log-mode’ – Show a log of such events, in a separate frame.
  Refreshed with each new event.  On top of other frames, without
  stealing focus.

Description: https://www.emacswiki.org/emacs/ShowKey
Code: https://www.emacswiki.org/emacs/download/showkey.el (or MELPA)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I'd like Emacs to display a big (but short) "pop up" text

Eric Abrahamsen-2
Drew Adams <[hidden email]> writes:

>> I'd like to display a "pop up"/"tip", i.e., a short text (a few
>> characters).  The thing is, I want it to be visible: large font,
>> preferably centered on the screen.  My use case is demoing Emacs, and
>> before showing the effects of e.g. C-x 2, I'd like to show
>> a big-lettered "C-x 2" on the screen.  It would be nice to use something
>> like the blocks in M-x tetris to build the letters, or anything else
>> that would clearly show "C-x 2" or whatever keychord I'm showing.
>
> I created ‘showkey.el’ for just this.  It shows keys and other events
> as you use them.

That looks perfect, thanks for the link, and the library!


Loading...