unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Davis Herring" <herring@lanl.gov>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: RE: bind commands that change buffer contents to `undefined' when  read-only?
Date: Mon, 24 Sep 2007 10:38:52 -0700 (PDT)	[thread overview]
Message-ID: <46501.128.165.123.18.1190655532.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <BNELLINCGFJLDJIKDGACCEBBCDAA.drew.adams@oracle.com>

> It's not about the reaction to `C-h c' or to the read-only error message.
> It's about a user looking for available keys to bind in a particular
> context.
>
> Are you assuming that a user looking for available keys to bind starts
> with that error message, that is, by trying a key and seeing if it
> produces an error?

I've often done something like that: chosen a key first, then made sure it
was available (though perhaps with C-h c instead for safety).

> A user is more likely to try `C-h b' to see which keys are available.
> Especially if s?he wants to find multiple available bindings for a set of
> related commands. Have you never done that: check to see which keys are
> not bound in the current mode?

I wrote unbound.el (http://www.emacswiki.org/cgi-bin/wiki/unbound.el);
does that count?  C-h b is so verbose that it's useless to me.  And anyone
who is trying to find bindings for a whole family of commands is probably
sufficiently clued to just look at C-h m (and its description of the local
map) directly.

> So, yes, such an isolated error message might (though a bit indirectly)
> help
> a user to see that that particular key is, in effect, available. But:
>
> a. It is an indirect indication. It requires understanding that since that
> key cannot be used here because the buffer is read-only, it is, in effect,
> available for some other use. It is far clearer to simply tell the user
> that the key is `undefined'.

Er, it's clearer to tell them that if that is in fact the case!  But that
supposes your conclusion, that they should be undefined.  The status quo
is that, aside from self-inserters that we don't even really think of as
commands (but rather as "keyboard keys"), major modes override keys only
when they have something better to assign them.  This means that some
useless commands slip through; more on this under (c).

> b. The information is after the fact (after trying that particular key).

This is redundant with your (c): how would any key-specific help tell you
anything -before- you told it what key you were interested in?

> c. It provides information for only that one key - it does not help you
> see that _all_ "such keys" are also available, and it doesn't tell you
> what those keys are.

I think you may have (accidentally?) found the real point here.  What are
"such keys"?  Our presumed definition is "buffer-modifying keys in modes
associated with read-only buffers", but this is vague, incomplete, and
insufficiently specific all at once:

Vague: Is M-: a "buffer-modifying key"?  What about C-u M-:?

Incomplete: C-x 4 a never modifies the current buffer, but is quite
useless in, say, *Messages*.  Should we unbind it there?  (If so, in what
map?)  Similarly I -hope- `ffap' is useless to most people in hexl-mode.

Unspecific: I often find it useful to "hack" a Dired listing by making the
buffer writable and then using something like M-x keep-lines.  Obviously
M-x wouldn't be unbound, so this would continue to work, but why shouldn't
I also be able to use M-z in such a case?

Summary: trying to second-guess the global map by deciding that some of
its keys are "useless" in some environment is trying to be too clever. 
Instead: (continued)

> d. It helps only if you start by trying that key, not if you try to look
> up the current bindings (`C-h b') to see all that might be available.

And here you have the solution.  Let's take your list of modifying
commands (and any other commands that might be useless in some environment
or another) and add a simple command that runs `where-is' on it, dropping
any results that say "not bound".  Then a user can run the new M-x
what-keys-are-useless (with a better name) and have all and only the
relevant information, without any change to any keymaps.

> Please see also the rest of the referenced email - in particular, point #1
> and this part of #2:
>
>> I don't think you have given any reason _why_ you "don't like much this
>> idea"; you've just stated a preference. What are the disadvantages you
>> see to this idea? Deciding on a good way to handle this should
>> involve weighing the pros & cons.

Please do not tell me (I know this was not originally written to me, but
you have written similar things so directly) that I have not justified my
statements simply because you do not agree with the justifications.  I
said that I didn't think the use case (of a person looking for keys to
bind) was significantly improved by your proposal, which is why I don't
like it.  (Now, with more thought, I think I have come up with a better
proposal as well as better-understood why I prefer it.)

Never mind the necessary bias in favor of the status quo (necessary to
avoid endlessly reconsidering equally justified alternatives): it is up to
the proponent of a proposal to give -more- justification for it than can
be given for anything else.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.

  reply	other threads:[~2007-09-24 17:38 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-22  1:18 TAB for non-editing modes Dan Nicolaescu
2007-09-22  8:22 ` Lennart Borgman (gmail)
2007-09-25 20:29   ` S-SPC for non-editing modes (was: TAB for non-editing modes) Juri Linkov
2007-09-25 21:14     ` Drew Adams
2007-09-25 21:59       ` S-SPC for non-editing modes Juri Linkov
2007-09-25 22:12         ` Drew Adams
2007-09-25 22:09       ` S-SPC for non-editing modes (was: TAB for non-editing modes) Andreas Schwab
2007-09-22 15:47 ` TAB for non-editing modes Richard Stallman
2007-09-22 16:35   ` Dan Nicolaescu
2007-09-22 19:01     ` Drew Adams
2007-09-22 21:23       ` Lennart Borgman (gmail)
2007-09-22 21:40         ` Drew Adams
2007-09-22 21:51       ` Dan Nicolaescu
2007-09-22 22:16         ` bind commands that change buffer contents to `undefined' when read-only? Drew Adams
2007-09-23  0:37           ` bind commands that change buffer contents to `undefined' whenread-only? Drew Adams
2007-09-23  1:20             ` bind commands that change buffer contents to `undefined'whenread-only? Drew Adams
2007-09-23  1:49               ` Stefan Monnier
2007-09-23  2:18                 ` bind commands that change buffer contents to `undefined' when read-only? Drew Adams
2007-09-23 18:16                   ` Stefan Monnier
2007-09-23 20:42                     ` Drew Adams
2007-09-24  1:25                       ` Stefan Monnier
2007-09-24  2:02                         ` Drew Adams
2007-09-24 15:24                       ` Davis Herring
2007-09-24 16:12                         ` Drew Adams
2007-09-24 17:38                           ` Davis Herring [this message]
2007-09-24 21:49                             ` Drew Adams
2007-09-24 18:14                           ` Stefan Monnier
2007-09-25 10:44                             ` Richard Stallman
2007-09-25 18:00                               ` bind commands that change buffer contents to `undefined' whenread-only? Drew Adams
2007-09-24 18:19                     ` bind commands that change buffer contents to `undefined' when read-only? Richard Stallman
2007-09-25 14:15                       ` Stefan Monnier
2007-09-22 22:44         ` TAB for non-editing modes Drew Adams
2007-09-23 14:48           ` Bastien
2007-09-23 23:59           ` Juri Linkov
2007-09-23 15:05       ` Richard Stallman
2007-09-23 16:43         ` Drew Adams
2007-09-24  0:11           ` Johan Bockgård
2007-09-24  0:33             ` Drew Adams
2007-09-24  0:46               ` Johan Bockgård
2007-09-23 15:04     ` Richard Stallman
2007-09-24  0:56       ` Dan Nicolaescu
2007-09-24 18:20         ` Richard Stallman

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=46501.128.165.123.18.1190655532.squirrel@webmail.lanl.gov \
    --to=herring@lanl.gov \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).