unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* precedence of keymaps
@ 2008-10-21 16:32 Andreas Politz
  2008-10-21 19:11 ` Xah
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Politz @ 2008-10-21 16:32 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

some time ago I wrote a little global minor mode,
which defines a couple of keys for resizing, moving windows etc.
The idea is, that every key which is not bound in this mode
is bound to "exit-mode, restuff event".

The problem is that some modes shadow my modes map. Scanning
through the manual it seems that the precedence of keymaps
is determined by some mode list. My intuition tells me
that the last activated mode should always take precedence.

Do I have to always reorder said mode list or is there a better
way to ensure that some keymap is always on top, when it is
activated ?

-ap


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: precedence of keymaps
  2008-10-21 16:32 precedence of keymaps Andreas Politz
@ 2008-10-21 19:11 ` Xah
  2008-10-21 21:02   ` Lennart Borgman (gmail)
  2008-10-21 21:05   ` Andreas Politz
  0 siblings, 2 replies; 4+ messages in thread
From: Xah @ 2008-10-21 19:11 UTC (permalink / raw)
  To: help-gnu-emacs

On Oct 21, 9:32 am, Andreas Politz <poli...@fh-trier.de> wrote:
> Hi,
>
> some time ago I wrote a little global minor mode,
> which defines a couple of keys for resizing, moving windows etc.
> The idea is, that every key which is not bound in this mode
> is bound to "exit-mode, restuff event".

humm? i don't quite understand what u mean ... exit-mode and restuff
event?

> The problem is that some modes shadow my modes map. Scanning
> through the manual it seems that the precedence of keymaps
> is determined by some mode list. My intuition tells me
> that the last activated mode should always take precedence.

you are aware that local keymaps override global ones, right?

> Do I have to always reorder said mode list or is there a better
> way to ensure that some keymap is always on top, when it is
> activated ?

... perhaps someone who knows better can answer.

i am also interested in a mechanism so that user defined keys has
absolute priority everywhere.

i haven't really read thru the whole chapter on keymaps
http://xahlee.org/elisp/Keymaps.html
but i'll do so now...

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: precedence of keymaps
  2008-10-21 19:11 ` Xah
@ 2008-10-21 21:02   ` Lennart Borgman (gmail)
  2008-10-21 21:05   ` Andreas Politz
  1 sibling, 0 replies; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2008-10-21 21:02 UTC (permalink / raw)
  Cc: help-gnu-emacs

>> The problem is that some modes shadow my modes map. Scanning
>> through the manual it seems that the precedence of keymaps
>> is determined by some mode list. My intuition tells me
>> that the last activated mode should always take precedence.
> 
> you are aware that local keymaps override global ones, right?

See

  (info "(elisp) Searching Keymaps")

As you have found out the minor mode maps competes with each other.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: precedence of keymaps
  2008-10-21 19:11 ` Xah
  2008-10-21 21:02   ` Lennart Borgman (gmail)
@ 2008-10-21 21:05   ` Andreas Politz
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Politz @ 2008-10-21 21:05 UTC (permalink / raw)
  To: help-gnu-emacs

Xah wrote:
> On Oct 21, 9:32 am, Andreas Politz <poli...@fh-trier.de> wrote:
>> Hi,
>>
>> some time ago I wrote a little global minor mode,
>> which defines a couple of keys for resizing, moving windows etc.
>> The idea is, that every key which is not bound in this mode
>> is bound to "exit-mode, restuff event".
> 
> humm? i don't quite understand what u mean ... exit-mode and restuff
> event?
> 

Like the repeat `mode', where you press 'y' and it repeats the last command,
but every other key works normally.
When a keymap has a (t . some-command) cons, every key not mapped calls
some-command. If this some-command turns of the keymap (the mode) and
pushes the event, which was not mapped, back in the event loop, it's like
auto-shut-down (mode wise), might call it a mini-mode.

-ap


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-21 21:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-21 16:32 precedence of keymaps Andreas Politz
2008-10-21 19:11 ` Xah
2008-10-21 21:02   ` Lennart Borgman (gmail)
2008-10-21 21:05   ` Andreas Politz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).