unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <sds@gnu.org>, <emacs-devel@gnu.org>
Subject: RE: button-buffer-map should inherit from special-mode-map
Date: Thu, 21 Feb 2013 10:29:49 -0800	[thread overview]
Message-ID: <64BBBA8150564874B08184FC5A733196@us.oracle.com> (raw)
In-Reply-To: <87y5ehsimf.fsf@gnu.org>

> IMO, button-buffer-map should inherit from special-mode-map because
> whenever it is used, the map which inherits from it is immediately
> subject to suppress-keymap.  If button-buffer-map inherits from
> special-mode-map, then this is done automatically, and,
> additionally, some useful bindings are inherited.
> 
> I will commit a patch to this effect unless someone objects.

I'm no expert on this, but that does not sound right to me.

Different libraries use `button-mode-map' differently.  E.g. `apropos-mode-map'
is a _copy_ of `button-mode-map' and it has `special-mode-map' as its parent.
And `help-mode-map' has as its parent a keymap composed from `button-buffer-map'
and `special-mode-map'.

It seems to me that if some particular map needs the characteristics of both
`button-buffer-map' and `special-mode-map' then it should explicitly adopt them
both, e.g. as `help-mode-map' does.

Why assume that the characteristics of `special-mode-map' (e.g. keys) are
appropriate for all uses of `button-buffer-map'?  What's really gained by this
additional coupling?

IMO, there has been too liberal a use of `special-mode-map' recently, which has
sometimes required later backing out some such coupled behavior (e.g. keys).

In general, this alone should be a red flag (watch out!): "and additionally,
some useful bindings are inherited".

One person's or one library's handy convenience is another's obstacle that must
be overcome.  What if those "useful bindings" are not appropriate for your mode
that inherits from `button-buffer-map'?

Why not keep these maps separate, and let code couple/compose them explicitly
when appropriate?




  reply	other threads:[~2013-02-21 18:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-21 17:04 button-buffer-map should inherit from special-mode-map Sam Steingold
2013-02-21 18:29 ` Drew Adams [this message]
2013-02-21 18:42   ` Sam Steingold
2013-02-21 19:26     ` Drew Adams
2013-02-21 19:57       ` Sam Steingold
2013-02-21 21:13         ` Drew Adams

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=64BBBA8150564874B08184FC5A733196@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=sds@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).