[Top][All Lists]

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

Re: Key bindings proposal

From: Juri Linkov
Subject: Re: Key bindings proposal
Date: Fri, 27 Aug 2010 00:22:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

> Simple analogy: Imagine that `C-x C-f' did not use the actual file and
> directory names, but required you to use a TMM-like UI where you
> drilled down from the root each time using single-key codes (~menu
> accelerators).  Is that a better UI for navigation?

Tmm is a good alternative to binding every command to a key sequence.

When you remember where the command is located in the menu tree,
you can run it by typing its menu accelerators (either in the
graphical menu or in text-based tmm menu) with fewer key strokes
than with completion.

For instance, currently to run `gnus', I need to type `M-x gnus RET'
- 7 keys.

With menu accelerators, the key sequence will be more than twice shorter
- `<f10> t g' ("Tools -> Gnus" menu) - 3 keys.

(And with enabled top-level menu accelerators also 3 keys - `M-t g'.)

> Anyway, Uday's point was about menu accelerators, and my reply was
> that Emacs has them (XEmacs, Lennart/Windows) or could have them.
> And I support it doing so.

IIUC, Windows defines menu accelerators by prepending "~" in front of
the accelerator character in the menu label, Gtk - by prepending "_".
These two are incompatible with each other.

A common Emacs way would be to define a new underlined face and put it
on the accelerator character.  Then menu accelerators will appear
underlined automatically in tmm (but not in Gtk and Windows).

Or more consistent with Emacs menu definitions would be
to use a menu property like `:key-sequence' and `:keys',
e.g. `key-accel':

  (define-key menu-bar-file-menu [write-file]
    `(menu-item ,(purecopy "Save As...") write-file
                :key-accel "A"
                :help ,(purecopy "Write current buffer to another file")))

reply via email to

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