From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Button widget keymap conflicting with major mode.
Date: Tue, 23 Feb 2010 21:29:11 -0700 [thread overview]
Message-ID: <hm29um$cll$1@dough.gmane.org> (raw)
In-Reply-To: <BE8DB67C34A64AF7B65AB4572E9A3B00@us.oracle.com>
Drew Adams wrote:
>> A read-only buffer has a major mode which defines bindings for RET and
>> other keys which are also used by button widgets created by
>>
>> (widget-create 'push-button ...
>>
>> The bindings for the major mode override the button bindings
>> (it is not possible to user RET when the point is on the
>> button for invoking it). I can make the button work with
>> (use-local-map widget-keymap), but then the bindings for
>> the major mode are gone.
>>
>> Is there a way for RET invoking the button when the point is
>> over it and invoke the major mode binding otherwise?
>>
>> Using Emacs 23.1.
>
> `keymap' text property would be one way.
>
> See node `Special Properties' of the Elisp manual.
WIBNI widget-create took a :keymap keyword so you could specify
widget-keymap as its value?
Otherwise, I guess you have to do something like:
(let* ((push-button (widget-create 'push-button ...))
(button-overlay (widget-get push-button :button-overlay)))
(overlay-put button-overlay 'keymap widget-keymap))
Or maybe local-map would be the appropriate property for this purpose.
--
Kevin Rodgers
Denver, Colorado, USA
next prev parent reply other threads:[~2010-02-24 4:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-21 4:07 Button widget keymap conflicting with major mode Óscar Fuentes
2010-02-21 5:54 ` Drew Adams
2010-02-24 4:29 ` Kevin Rodgers [this message]
2010-02-24 5:18 ` Drew Adams
2010-02-26 7:41 ` Kevin Rodgers
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='hm29um$cll$1@dough.gmane.org' \
--to=kevin.d.rodgers@gmail.com \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.