help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Button widget keymap conflicting with major mode.


From: Kevin Rodgers
Subject: Re: Button widget keymap conflicting with major mode.
Date: Fri, 26 Feb 2010 00:41:25 -0700
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Drew Adams wrote:
WIBNI widget-create took a :keymap keyword so you could specify
widget-keymap as its value?

It does, doesn't it? You can pass any keyword args to it.

Excellent, I didn't try...

Not sure I understand what you're saying.

... because the Widget info manual doesn't say that the push-button
widget is/like an editable-field or text widget, which are the only
types that support the :keymap property.

(widget-create 'push-button :keymap widget-keymap) `C-x C-e'

=>

(push-button
 :keymap
 (keymap
  (13 . widget-button-press)
  (down-mouse-1 . widget-button-click)
  (down-mouse-2 . widget-button-click)
  (backtab . widget-backward)
  (S-tab . widget-backward)
  (27 keymap (9 . widget-backward))
  (9 . widget-forward))
 :button-overlay #<overlay from 242 to 244 in *scratch*> :from #<marker
 (moves after insertion)
 at 242 in *scratch*> :to #<marker at 244 in *scratch*>)

`C-u C-x =' on the button (e.g. position 243) shows:

There is an overlay here:
 From 242 to 244
  button               push-button (widget)Top
  evaporate            t
  face                 widget-button
  follow-link          nil
  help-echo            nil
  keymap               [Show]
  mouse-face           (highlight)
  pointer              hand

Clicking [Show] or hitting RET there shows the same keymap as above.

Well, that's the clincher: the keymap was actually installed on the keymap
property of the overlay (not just included in the widget's list representation).

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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