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 11:26:36 -0800

> > Why assume that the characteristics of `special-mode-map' 
> > (e.g. keys) are appropriate for all uses of `button-buffer-map'?
> 
> Because special-mode-map is supposed to be appropriate for any
> non-self-insert buffer,

Where does it say so?  In any case, I take issue with such a claim.

It is doubtful that there is ANY given set of key bindings or ANY particular
predefined behavior that is appropriate for ALL non-self-insert buffers.
(Except the empty set of keys and empty behavior.)

`special-mode-map' certainly does not fill that bill.

> and button-buffer-map is only used in such buffers,

What buffers - non-self-insert buffers?  Are you claiming also that b-b-map is
appropriate for ALL buffers where keys are not self-inserting?  That too I
disagree with.

`button-buffer-map' is defined only as a

   "Keymap useful for buffers containing buttons."

There is nothing in that straightforward definition that implies that every
buffer that has buttons must be non-self-insert.  Whether buttons make sense for
a given buffer is not dependent on whether the buffer allows some keys to
self-insert.

> so, whenever a map inherits from button-buffer-map but not
> special-mode-map, it can be assumed to be an oversight.

Your logic is sound: N => S and B => N, therefore B => S:

1. Assume: non-self-insert buffer implies s-m-map is appropriate.

2. Assume: b-b-map implies non-self-insert buffer.

3. Therefore, any map that inherits from b-b-m should also inherit from s-m-map.

The logic is fine.  What I reject are the assertions, #1 and #2.

> > What's really gained by this additional coupling?
> 
> Simplicity and clarity of code and intent.

The intent of `button-buffer-map' is clear, and that stated intention does not
jibe with the interpretation you want to give it.  Sorry.

`button-buffer-map' is a keymap for buffers where buttons are appropriate.
Nothing more, nothing less.  Up to the person who uses b-b-map to decide whether
buttons are appropriate in any given context.

`button-buffer-map' does not imply `special-mode-map'.  And it does not imply
that the buffer does not allow any self-insertion.




reply via email to

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