emacs-devel
[Top][All Lists]
Advanced

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

Re: A simple implementation of context-sensitive keys


From: Lennart Borgman (gmail)
Subject: Re: A simple implementation of context-sensitive keys
Date: Thu, 11 Sep 2008 15:41:56 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Stefan Monnier wrote:
>>> In any case, the main problem with such things (whichever way they're
>>> implemented) is that the rest of Emacs doesn't know and/or expect such
>>> condition bindings, so C-h k gives only partial information, and
>>> similarly where-is doesn't know how to tell the whole story.
> 
>> Sure, so I'd say that in general modes shouldn't use such facilities by
>> default.  Which commands should be executed depending on which context
>> is a quite subjective decision anyway.  But to have the possibilities
>> right at hand is great, whichever one you use.
> 
> I hope we can do better than that, i.e. come up with a way to do
> something like what you proposed, but still have where-is, C-h k,
> etc... take it into account.


I am starting to wonder whether this is the right way to go.

As I said something reminding of this is done in smart-tab, tabkey2 and
hippie-expand. But all these are kind of brute force method to handle
the frustrating situations with the many uncoordinated completion
alternatives there are. And actually I find that special use useful.

However before doing what Tassilo suggest I think it would be better to
look at the background for it.

If I understand it correctly the problem is at least partly how the
keymaps for minor modes cooperates. If they do have the same key binding
then we have the question which one should be used.

And that may very well happen since their is no mechanism at all to
prevent it.

Currently the problem of which minor mode gets the key press is resolved
just by the corresponding minor mode's position in minor-mode-map-alist.
The first one gets it.

There is no notion in where-is, C-h k, etc that there is any key binding
conflict. There is no easy way for users to reorder minor-mode-map-alist.

I think this is where we should start. And after that come back to
Tassilo's suggestion.




reply via email to

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