unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: "Ben Wing" <ben@666.com>, "Pavel Janík" <Pavel@Janik.cz>,
	"Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu>,
	"Richard Stallman" <rms@gnu.org>,
	gerd@gnu.org, emacs-devel@gnu.org
Subject: Re: C-l while in menu?
Date: 23 Apr 2002 14:06:02 +0200	[thread overview]
Message-ID: <5x7kmyhb6d.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <buo662irc44.fsf@mcspd15.ucom.lsi.nec.co.jp>

Miles Bader <miles@lsi.nec.co.jp> writes:

> Ben Wing <ben@666.com> writes:
> > the fact is that things work quite well when you have only a meta key.
> > e.g. meta+letter is an accelerator only when such a menu exists;
> > otherwise, you get the regular binding -- and even then you can
> > retrieve the shadowed binding with shift+meta+letter.
> 
> Do people really like this?  It sounds astonishly annoying to have
> random meta keys stolen by the menus, especially since emacs has many
> useful and common commands on M-letter keys.  E.g., doesn't the `File'
> menu steal `M-f', the `Buffers' menu `M-b', etc.?
> 
> I am skeptical ...

So am I.

I rarely use the menus, so I definitely don't want any accellerator
keys to steal *ANY* of the M- key bindings which are hardwired into my
spine after +15 years of emacs usage...

On the other hand, I think many new users would expect that M-f would
open the File menu, and since he doesn't already know that M-f runs
forward-word, he'll probably never be bothered with having to use S-M-f
to invoke that command.

Personally, I wouldn't mind if I could use S-M-f to open the File menu
- but if I'm in message mode, I'd much rather prefer if it opened the
Field menu...

So, what's the right approach here?

Well, at least make the accellerator modifier(s) configurable!!!

Default could be 'meta or 'alt or '(shift meta) or nil -- depending
on whether we want to help new users (annoying old-timers), or vice versa.


BTW, I think most of this logic be implemented in lisp if we
just had two built-in functions like

  (menu-bar-item-matching-p key) -> returns t if menu starting with KEY exists
  (open-menu-bar-item-matching key) -> opens that menu.

Then, in a menu-accell minor mode, we could have code and bindings like

  (defun menu-accell-check-item ()
    (menu-bar-item-matching-p (this-command-key))

  (defun menu-accell-open-item ()
    (interactive)
    (open-menu-bar-item-matching (this-command-key)))

  (defcustom menu-accell-modifiers '(meta))

  ... for KEY in ?a to ?z do ...
  (define-key menu-accell-map 
    (vector (append menu-accell-modifiers (list key)))  ;; eg M-f
    '(menu-item "accell" menu-accell-open-item 
                :filter menu-accell-check-item))


If we want another accellerator modifier, simply clear the menu-accell-map
and rebuild it using the new accellerator modifier.  This can be done
automatically in the :set action of menu-accell-modifiers.

Just an idea...

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  parent reply	other threads:[~2002-04-23 12:06 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m3k7rjoamp.fsf@Janik.cz>
     [not found] ` <200204072343.g37NhIC20114@aztec.santafe.edu>
2002-04-19 18:58   ` C-l while in menu? Pavel Janík
2002-04-20 17:27     ` Richard Stallman
2002-04-20 21:06       ` Pavel Janík
2002-04-21 11:17         ` Gerd Moellmann
2002-04-21 13:23           ` Pavel Janík
2002-04-21 14:04             ` Gerd Moellmann
2002-05-08 14:38           ` Pavel Janík
2002-05-08 18:16             ` Gerd Moellmann
2002-05-08 18:49               ` Pavel Janík
2002-05-10  0:29             ` Richard Stallman
2002-05-11  8:53               ` Pavel Janík
2002-05-13 14:17                 ` Richard Stallman
2002-04-22  7:46         ` Richard Stallman
2002-04-22  8:55           ` Pavel Janík
2002-04-22 10:03             ` Stefan Monnier
2002-04-22 12:59             ` Miles Bader
2002-04-22 17:47               ` Kim F. Storm
2002-04-23  2:05               ` Miles Bader
2002-04-22 19:47             ` Jan D.
2002-04-23 19:30               ` Richard Stallman
2002-04-22  9:28           ` Stefan Monnier
2002-04-22 13:04             ` Ben Wing
2002-04-22 13:42               ` Pavel Janík
2002-04-23  9:13                 ` Ben Wing
2002-04-23  9:35                   ` Miles Bader
2002-04-23 11:08                     ` Eli Zaretskii
2002-04-23 10:22                       ` Gerd Moellmann
2002-04-23 11:25                         ` Eli Zaretskii
2002-04-23 11:42                       ` Simon Josefsson
2002-04-24 17:55                         ` Richard Stallman
2002-04-24 18:29                           ` Simon Josefsson
2002-04-26  3:17                             ` Richard Stallman
2002-04-24 18:37                           ` Gerd Moellmann
2002-04-26  3:20                             ` Richard Stallman
2002-04-24 10:42                       ` Ben Wing
2002-04-24 11:27                         ` Simon Josefsson
2002-04-24 15:54                           ` Eli Zaretskii
2002-04-24 14:40                         ` Pavel Janík
2002-04-24 15:31                         ` Eli Zaretskii
2002-04-25  6:06                           ` Richard Stallman
2002-04-23 12:06                     ` Kim F. Storm [this message]
2002-04-23 11:44                       ` Simon Josefsson
2002-04-24 10:56                         ` Ben Wing
     [not found]                         ` <3CC68F57.4060901@666.com>
2002-04-24 11:15                           ` Simon Josefsson
2002-04-24 12:52                           ` Stefan Monnier
2002-04-24 15:43                           ` Eli Zaretskii
2002-04-23 11:53                       ` Robert J. Chassell
2002-04-23 14:11                       ` Stefan Monnier
2002-04-24 10:44                       ` Ben Wing
2002-04-24 15:37                     ` Kai Großjohann
2002-04-25  6:06                       ` Richard Stallman
2002-04-25  8:05                         ` Stephen J. Turnbull
2002-04-25  9:13                           ` Kai Großjohann
2002-04-25 10:22                             ` Stephen J. Turnbull
2002-04-26  3:18                           ` Richard Stallman
2002-04-26 11:14                             ` Gerd Moellmann
2002-04-25 11:08                         ` Eli Zaretskii
2002-04-23  9:32                 ` Ben Wing
     [not found]                 ` <3CC52A2F.6010704@666.com>
2002-04-23  9:51                   ` Hrvoje Niksic
2002-04-23 11:20                   ` Stephen J. Turnbull
2002-04-23 19:30               ` Richard Stallman
2002-04-23 20:22                 ` Karl Eichwalder
2002-04-24  4:12                   ` Miles Bader
2002-04-25  6:07                   ` Richard Stallman
2002-04-25  7:21                     ` Karl Eichwalder
2002-04-25  7:35                       ` Miles Bader
2002-04-25 12:00                       ` Robert J. Chassell
2002-04-25 12:21                         ` Andreas Schwab
2002-04-25 13:00                           ` Robert J. Chassell
2002-04-25 13:11                             ` Andreas Schwab
2002-04-25 14:54                         ` Eli Zaretskii
2002-04-25 14:39                           ` Kai Großjohann
2002-04-25 16:19                           ` Robert J. Chassell
2002-04-25 19:19                             ` Eli Zaretskii
2002-04-25 20:16                             ` Jason Rumney
2002-04-25 23:10                               ` Robert J. Chassell
2002-04-25 23:21                               ` Robert J. Chassell
2002-04-26  1:23                                 ` Miles Bader
2002-04-26 17:38                               ` Richard Stallman
2002-04-26  3:18                       ` Richard Stallman
2002-04-23  0:24             ` Richard Stallman
2002-04-22 11:39           ` Eli Zaretskii
2002-04-23 19:31             ` Richard Stallman
2002-04-23 20:13               ` Pavel Janík
2002-04-25  6:05                 ` Richard Stallman
2002-04-25 11:05                   ` Eli Zaretskii
2002-04-22  1:27     ` Miles Bader
2002-04-22  6:09       ` Eli Zaretskii
     [not found] <Pine.LNX.4.44.0204241307080.32219-100000@yxa.extundo.com>
2002-04-24 14:36 ` Stephen J. Turnbull
2002-04-24 15:33   ` Kai Großjohann
     [not found]   ` <vaf662hjelc.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de>
2002-04-24 16:23     ` Stephen J. Turnbull
2002-04-24 18:15       ` Kai Großjohann
2002-04-25  2:23     ` Hrvoje Niksic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5x7kmyhb6d.fsf@kfs2.cua.dk \
    --to=storm@cua.dk \
    --cc=Pavel@Janik.cz \
    --cc=ben@666.com \
    --cc=emacs-devel@gnu.org \
    --cc=gerd@gnu.org \
    --cc=monnier+gnu/emacs@RUM.cs.yale.edu \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).