jed-users mailing list

[2007 Date Index] [2007 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: python-mode and fold-mode


Hello G.,

"G. Milde" <milde@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On 25.05.07, Jörg Sommer wrote:
>> "G. Milde" <milde@xxxxxxxxxxxxxxxxxxxxx> wrote:
>> > On 24.05.07, John E. Davis wrote:
>> >
>> >> Also this is consistent with the view that folding mode is a "minor"
>> >> mode, and minor modes make use of the _Reserved_Key_Prefix.
>
> However, 
>
>> > * Looking at the source of many JED modes, I see definekey_reserved()
>> >   widely used by "major" modes (language modes).
> ...
>
> I'd like to see Johns decision on whether the _Reserved_Key_Prefix is
> reserved for "major" or "minor" modes.

It's up to John to make the real decision, but I follow you that
_Reserved_Key_Prefix should only be used by major modes.

>> This sounds good, but how do these other bindings conflict with your CUA
>> mode? Do we need another mechanism to select a key for these minor modes?
>
> IMO, keybindings for "minor" modes in the Jed standard library should be
> set in the emulation mode and not use the _Reserved_Key_Prefix.

What about implementing a function that makes the decision?

define minor_mode_key_prefix(mode, keymap)
{
    % Give the user the chance to make its own decisions
    if exists(local_minor_mode_key_prefix)
      answ = local_minor_mode_key_prefix(mode, keymap);
      if answ != ""
        % the user made a decision
        return answ;

    if keymap != "Global"
      % refuse the request, e.g. the mode should not use keybindings
      return NULL;

    switch (mode)
    { case "xyz": return "^A"; }
    { case … }

    % if we don't know the mode, we don't give him access
    return NULL;
}

This way, every emulation (EDT, emacs, IDE, vi) can implement it's own
version of minor_mode_key_prefix() and the user can change settings.

Bye, Jörg.
-- 
Angenehme Worte sind nie wahr,
wahre Worte sind nie angenehm.

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2007 date index] [2007 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]