help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Scanning keymaps for keybindings


From: Tim X
Subject: Re: Scanning keymaps for keybindings
Date: Wed, 08 Dec 2010 15:35:12 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Elena <egarrulo@gmail.com> writes:

> On Nov 9, 9:37 pm, des...@verizon.net wrote:
>> You need to issue that in each mode you want to fool with.
>>
>> I'm not sure what you mean by keymap variables.
>> Are you after all the modes you are using?
>
> Yes, I'm after *all* keymaps.  Since `describe-variable' can list all
> global variables, I think it can be done.  I know I will get some
> false-positives with a regex-based approach, but I will just discard
> variables which are not keymaps.

I don't think you can get *all* key maps. The closest you can get is to
list all currently loaded keymaps at the time you run the function.
Likewise, searching on variables with -map in their name will only give
currently defined/loaded keymaps. 

A further problem is that each buffer has a local key map that overrides
global keymaps (and possibly a minor mode keymap that overrides that), so
the results you get may also depend on the buffer you are in when you
execute the command. 

Depending on what you want to do, you may be able to use something like
after-change-major-mode hook or similar to update things after a new
mode is used. However, this assumes all modes have been written
following standard conventions, which cannot be guaranteed. 

Tim


-- 
tcross (at) rapttech dot com dot au


reply via email to

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