* Re: Scanning keymaps for keybindings
[not found] <f63f2762-b0c0-45d4-a421-ca1fc1911fc4@a9g2000pro.googlegroups.com>
@ 2010-11-09 20:37 ` despen
[not found] ` <f7cba2f3-7cc9-4b6e-a62a-53fb6bae8aa6@u10g2000yqk.googlegroups.com>
[not found] ` <87oc9yf4bo.fsf@kuiper.lan.informatimago.com>
[not found] ` <jwv4obpqczb.fsf-monnier+gnu.emacs.help@gnu.org>
2 siblings, 1 reply; 6+ messages in thread
From: despen @ 2010-11-09 20:37 UTC (permalink / raw)
To: help-gnu-emacs
Elena <egarrulo@gmail.com> writes:
> Hello,
>
> I'd like to remap some keybindings in different contexts, for
> consistency.
>
> I've read the relevant section of the Elisp manual, but it seems there
> is no way to list all keymaps variables for a search. `current-active-
> maps' returns the value of keymaps, not keymaps' variables' names.
>
> I think I could list all variables and then pattern match them against
> ".*-map$". `describe-variable' lists variables, but I've not been
> able to extract the variable listing code.
>
> Any help? Thanks.
^h m
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?
Most people (myself), just start with the global-map and then
make mode bindings as needed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Scanning keymaps for keybindings
[not found] ` <f7cba2f3-7cc9-4b6e-a62a-53fb6bae8aa6@u10g2000yqk.googlegroups.com>
@ 2010-11-09 21:31 ` despen
[not found] ` <87c203d6-9a60-494e-8652-a5d47151b0ae@u10g2000yqk.googlegroups.com>
[not found] ` <87eiaucgpf.fsf@puma.rapttech.com.au>
1 sibling, 1 reply; 6+ messages in thread
From: despen @ 2010-11-09 21:31 UTC (permalink / raw)
To: help-gnu-emacs
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.
Keymaps are created on the fly.
Use MH-E and you get the mh-folder-map and a bunch of other maps.
If you haven't used mh-e, the map doesn't exist.
What you want would have to be done with grep and the .el files
and would still only see what you have installed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Scanning keymaps for keybindings
[not found] ` <87eiaucgpf.fsf@puma.rapttech.com.au>
@ 2010-11-09 22:10 ` Elena
0 siblings, 0 replies; 6+ messages in thread
From: Elena @ 2010-11-09 22:10 UTC (permalink / raw)
To: help-gnu-emacs
On Nov 9, 10:47 pm, Tim X <t...@nospam.dev.null> wrote:
> 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.
The goal I'd like to accomplish is remapping a keybinding without
having to dig through the documentation and Elisp files. Yes, I know
you can type "C-h c" to know what the name of the command which is
bound to a specific key, then you can grep such name to know which
keymap you'd have to change; but since I'm a keyboard layout
thinkerer, I'd prefer to automate that.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Scanning keymaps for keybindings
[not found] ` <8739rab1qf.fsf@fh-trier.de>
@ 2010-11-09 22:17 ` Elena
0 siblings, 0 replies; 6+ messages in thread
From: Elena @ 2010-11-09 22:17 UTC (permalink / raw)
To: help-gnu-emacs
On Nov 9, 10:56 pm, Andreas Politz <poli...@fh-trier.de> wrote:
> Are you looking for `mapatoms' ?
Yes, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Scanning keymaps for keybindings
[not found] ` <87oc9yf4bo.fsf@kuiper.lan.informatimago.com>
@ 2010-11-10 11:08 ` Elena
0 siblings, 0 replies; 6+ messages in thread
From: Elena @ 2010-11-10 11:08 UTC (permalink / raw)
To: help-gnu-emacs
On 9 Nov, 23:46, p...@informatimago.com (Pascal J. Bourguignon) wrote:
> It means that there may exist a lot of keymaps that are not bound to any
> variable, but that will nontheless be activated upon a mode change (and
> then accessible via the current-active-maps function).
>
> More over, a mode may very well compute its keymaps dynamically, when it
> is activated or at some other time.
>
> So there is no way to get an exhaustive list of keymaps with a static
> analysis. All you can do is to try to collect some keymap objects at
> some specific time. And perhaps try again later.
How true! Being stucked on keymap scanning, I thought I'd just write
a simpler function with a regex guessing based search. The first
command I have tried is `ido-prev-work-directory', bound to "M-p". I
thought it should have existed a keymap variable whose name would
match "ido-.*-map", but according to `describe-variable' there isn't
any. Digging into "ido.el", showed such function was being bound by
`ido-init-completion-maps', thus requiring source modification, I
think.
Hard times in Emacs for keyboard remappers :-(
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Scanning keymaps for keybindings
[not found] ` <jwv4obpqczb.fsf-monnier+gnu.emacs.help@gnu.org>
@ 2010-11-10 19:41 ` Elena
0 siblings, 0 replies; 6+ messages in thread
From: Elena @ 2010-11-10 19:41 UTC (permalink / raw)
To: help-gnu-emacs
On Nov 10, 6:56 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> I think you're going about it in the wrong way. If you tell us more
> precisely what you're trying to do, we can probably give you some better
> indications of how to do it.
Nevermind. My understanding now is that the only effective way is
tracking down by hand where the key are bound and write the
appropriate fix on a case by case basis.
However, for the curious, here is the full story. Being a Viper
+Vimpulse user, I'm used to J and K to go to next and to previous
line. For the sake of consistency, I'd like to use M-j and M-k
instead of M-p (ido-prev-work-directory) and M-n (ido-next-work-
directory) to go back and forth in IDO's (ido.el) directory history.
Of course, since N-based and P-based bindings for next and previous
items are pervasive in Emacs (for consistency) this meant I had to do
quite a few remappings. This raised the learning challenge to
somewhat automate the task.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-11-10 19:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <f63f2762-b0c0-45d4-a421-ca1fc1911fc4@a9g2000pro.googlegroups.com>
2010-11-09 20:37 ` Scanning keymaps for keybindings despen
[not found] ` <f7cba2f3-7cc9-4b6e-a62a-53fb6bae8aa6@u10g2000yqk.googlegroups.com>
2010-11-09 21:31 ` despen
[not found] ` <87c203d6-9a60-494e-8652-a5d47151b0ae@u10g2000yqk.googlegroups.com>
[not found] ` <8739rab1qf.fsf@fh-trier.de>
2010-11-09 22:17 ` Elena
[not found] ` <87eiaucgpf.fsf@puma.rapttech.com.au>
2010-11-09 22:10 ` Elena
[not found] ` <87oc9yf4bo.fsf@kuiper.lan.informatimago.com>
2010-11-10 11:08 ` Elena
[not found] ` <jwv4obpqczb.fsf-monnier+gnu.emacs.help@gnu.org>
2010-11-10 19:41 ` Elena
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).