unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: unhelpful menu keybinding notes
Date: Mon, 17 Apr 2006 12:29:57 -0400	[thread overview]
Message-ID: <jwvr73wmas7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <DNEMKBNJBGPAOPIJOOICGEOEDEAA.drew.adams@oracle.com> (Drew Adams's message of "Mon, 17 Apr 2006 08:50:00 -0700")

>     Alternatively, one could put explicit keyboard help strings into the
>     menus (or have some property for that purpose on the function?).  One
>     might assume that the people with actual "<cut>", "<paste>", "<copy>"
>     keys would still try using them without being prompted for them.

> Yes, this is a general problem with `substitute-command-keys', which we have
> discussed before. Whenever there is more than one key sequence bound to a
> command, the problem surfaces.

> No matter what algorithm is used to choose (ASCII, non-ASCII, shortest,
> longest, chords, non-chords, whatever), people will want to be able to
> specify the binding to use in the result, and there is no way to do that
> now. I hope we will address this after the release and find a good solution.

> In my own libraries I sometimes hard-code explicit bindings and sometimes
> rely upon \\[...]. The advantage of the former is that you can control what
> gets communicated; the disadvantage is that that can be incorrect if the
> user has changed the bindings.

In some pars of Emacs we use another trick: make and use an alias, like
`advertised-undo'.  I think this is a bad solution because C-h f undo RET
then lists all bindings except for the "advertised" one C-x u.

Maybe a better solution is to add a `advertised-binding' property to the
function's symbol:

  (put 'undo 'advertised-binding [?\C-x ?u])

which could be used similarly to the :key-sequence property in menus
(i.e. it's used if the key seuqnece is indeed bound to the specified
command).


        Stefan

  reply	other threads:[~2006-04-17 16:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-17  3:36 unhelpful menu keybinding notes Miles Bader
2006-04-17  7:10 ` Lennart Borgman
2006-04-17  7:28 ` Eli Zaretskii
2006-04-17  8:19   ` Lennart Borgman
2006-04-17  8:41     ` Eli Zaretskii
2006-04-17  8:46       ` David Kastrup
2006-04-17 15:50         ` Drew Adams
2006-04-17 16:29           ` Stefan Monnier [this message]
2006-04-17 16:57             ` Drew Adams
2006-04-18  1:42             ` Richard Stallman
2006-04-18  1:42           ` Richard Stallman
2006-04-17 19:11         ` Lennart Borgman

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=jwvr73wmas7.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@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).