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: Óscar Fuentes
Subject: Re: Button widget keymap conflicting with major mode.
Date: Sun, 21 Feb 2010 12:52:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux)

"Drew Adams" <drew.adams@oracle.com> writes:

>> 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.

I thought that the button widget sets those properties when it is
created. Certainly, the user is not suppossed to throw in a good chunk
of extra hairy code measuring how much space the button uses, getting
its position, setting properties, etc when that is what every button
should do on its own, right?




reply via email to

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