emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Menu commands to M-x history?


From: Drew Adams
Subject: RE: Menu commands to M-x history?
Date: Sun, 26 Jul 2009 18:47:58 -0700

> > Perhaps a better way of learning what command is on a button or menu
> > item is to use help such as `M-x help RET k <Menu item> RET'.
> 
> I think that is enough too.

I agree: `C-h k' or a tooltip is sufficient to show the command associated with
a menu item or button.

However, it can also be convenient to be able to complete against commands that
were previously executed using a menu. You might want to do this some of the
time (but probably not by default).


FWIW, this feature is available in Icicles in the following way:

1. Each command executed by `call-interactively' is added to a larger history
list, `icicle-interactive-history'. The normal history for commands,
`extended-command-history', is treated just as before: commands are added to it
only via `M-x'.

2. If you use `C-M-pause' during completion of a command name, your input is
completed against the larger history, `icicle-interactive-history'. You can thus
complete your input to the command that is behind a previously used menu item.

3. If you use `C-M-pause' during any other completion (or if you use it with a
prefix arg during command completion), then you can choose an alternative
history to use for the current completion. You can then use the usual ways of
accessing history entries.

4. If after #3 you use `M-h', you can complete your input against the
alternative history you chose. (`M-h' always completes against the current
history, in Icicles.)

> At first I kind of liked Lennart's idea. For example, sometimes I have
> used the Edit -> Text Properties -> Foreground Color command and have
> been wondering how to do the same from the keyboard (is it possible?)
> but I think I would be annoyed having my precious M-x history filled
> with things I did not expect.

That's why Icicles uses a separate history that includes everything executed by
`call-interactively' (which includes menu items). And it's why you use this
larger history only on demand (via `C-M-pause').

> Quite often I execute the same M-x
> command over and over again, doing something else in between, and if
> what I did in between included executing some menu commands I might be
> annoyed to have to step back some extra steps in order to get at the
> command I want to run.

Yes. Use the larger history only when you want to.

5. Of course, when you complete against a command previously accessed using a
menu, you need to be able to recognize the command name, which is sometimes
quite different from the menu-item name.

Icicles helps here by showing the associated command name (in the *Completions*
mode line) whenever you cycle to a menu item during completion. For example,
library La Carte completes menu items, and Icicles shows the command for the
current item during cycling. (Unlike tmm-menubar, La Carte completes absolute
menu items (paths) - similar to file-name completion).

6. If you use `M-h' during La Carte's menu-item completion, you complete against
all commands previously entered interactively, including those accessed by menu
(via keyboard or otherwise).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]