emacs-devel
[Top][All Lists]
Advanced

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

RE: button-buffer-map should inherit from special-mode-map


From: Drew Adams
Subject: RE: button-buffer-map should inherit from special-mode-map
Date: Thu, 21 Feb 2013 10:29:49 -0800

> 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 via email to

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