unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* List of current key maps
@ 2007-05-17 20:45 Will
  2007-05-18  4:02 ` Tim X
  2007-06-09 23:53 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Will @ 2007-05-17 20:45 UTC (permalink / raw)
  To: help-gnu-emacs

Hi!

Is there a way to find all active key maps used in the current buffer 
with their actual variable names so one can use those names to make 
lcoal keybindings like

(define-key ess-mode-map [(control ?c) (control ?t)] "Test!")
             ^^^^^^^^^^^^

Using the variable search function C-h v map [enter] is not helpful as 
it searches only for variables beginning with "map" not containing "map" 
somewhere in its name (opposite to "C-h a"-behavior, is this a bug of 
C-h v???)

Thanks for helping,

Will

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

* Re: List of current key maps
  2007-05-17 20:45 List of current key maps Will
@ 2007-05-18  4:02 ` Tim X
  2007-05-18 14:10   ` Drew Adams
  2007-05-19 13:43   ` Will
  2007-06-09 23:53 ` Stefan Monnier
  1 sibling, 2 replies; 5+ messages in thread
From: Tim X @ 2007-05-18  4:02 UTC (permalink / raw)
  To: help-gnu-emacs

Will <schimpanski@gmx.de> writes:

> Hi!
>
> Is there a way to find all active key maps used in the current buffer with
> their actual variable names so one can use those names to make lcoal
> keybindings like
>
> (define-key ess-mode-map [(control ?c) (control ?t)] "Test!")
>             ^^^^^^^^^^^^
>
> Using the variable search function C-h v map [enter] is not helpful as it
> searches only for variables beginning with "map" not containing "map" somewhere
> in its name (opposite to "C-h a"-behavior, is this a bug of C-h v???)
>
> Thanks for helping,
>

Try M-x apropos-variable

and no, the C-h v behavior is correct, not a bug. 

Tim

-- 
tcross (at) rapttech dot com dot au

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

* RE: List of current key maps
  2007-05-18  4:02 ` Tim X
@ 2007-05-18 14:10   ` Drew Adams
  2007-05-19 13:43   ` Will
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2007-05-18 14:10 UTC (permalink / raw)
  To: help-gnu-emacs

> > Using the variable search function C-h v map [enter] is not
> > helpful as it searches only for variables beginning with "map"
> > not containing "map" somewhere in its name (opposite to
> > "C-h a"-behavior, is this a bug of C-h v???)

http://www.emacswiki.org/cgi-bin/wiki/Icicles

In Icicles:

* `C-h v map S-TAB' completes to variables whose names contains "map".

* `C-h v map TAB' completes to variables whose names start with "map" (just
as in vanilla Emacs).

* You can use `M-*' to match against multiple patterns (e.g. "map",
"mode",...) - as many as you want. So, for example, `C-h v map M-* local M-*
mini' completes to variable names that contain "map", "local", and "mini",
in any order.

* You can use `C-~' (complement) to remove matches. So, for example, `C-h v
map M-* local M-* mini C-~' matches variable names that contain "map" and
"local" but do not contain "mini".

* You can use regexps, not just substrings, as match patterns for `S-TAB'.
So, for example, `C-h v [^-]map' completes to variables whose names contain
"map" following any character except `-'. And `C-h v map.' completes to
variables whose names contain "map" but don't end in "map" (more precisely,
contain "map" followed by a non-newline character).

* The same completion features are available for any kind of completion:
buffer name, file name, command, and so on. So, for example, `C-x C-f map'
completes to files whose names contain "map".

* You can use `C-M-mouse-2' to get help about selected completion candidates
on the fly, before choosing one to use. So, for example, `M-x map S-TAB'
followed by `C-M-mouse-2' on selected completions in buffer *Completions*
prints the descriptions of those clicked commands (whose names contain
"map") - as many as you like, in any order. (Hit `RET' to finally choose one
to execute, or hit `C-g' to cancel.) Or, for example, `C-x f ab TAB'
followed by `C-M-mouse-2' on selected file names (which all begin with "ab")
prints file properties (file type, permissions, size, times, etc.).

Icicles has a lot to offer, and the doc describes it all, but the basic
features are simple to use - you can take advantage of them without reading
any doc. And `C-?' during completion gives you summary help.

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

* Re: List of current key maps
  2007-05-18  4:02 ` Tim X
  2007-05-18 14:10   ` Drew Adams
@ 2007-05-19 13:43   ` Will
  1 sibling, 0 replies; 5+ messages in thread
From: Will @ 2007-05-19 13:43 UTC (permalink / raw)
  To: help-gnu-emacs

Tim X skrev:
> Will <schimpanski@gmx.de> writes:
> 
>> Hi!
>>
>> Is there a way to find all active key maps used in the current buffer with
>> their actual variable names so one can use those names to make lcoal
>> keybindings like
>>
>> (define-key ess-mode-map [(control ?c) (control ?t)] "Test!")
>>             ^^^^^^^^^^^^
>>
>> Using the variable search function C-h v map [enter] is not helpful as it
>> searches only for variables beginning with "map" not containing "map" somewhere
>> in its name (opposite to "C-h a"-behavior, is this a bug of C-h v???)
>>
>> Thanks for helping,
>>
> 
> Try M-x apropos-variable
> 
> and no, the C-h v behavior is correct, not a bug. 
> 
> Tim
> 

Thanks, Tim for the hint. However, it does not deliver the necessary 
"map" variable names, one has to submit a numerical argument like

C-u 1 M-x apropos-variable

or add this line to your .emacs file

(setq-default apropos-do-all 1)

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

* Re: List of current key maps
  2007-05-17 20:45 List of current key maps Will
  2007-05-18  4:02 ` Tim X
@ 2007-06-09 23:53 ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2007-06-09 23:53 UTC (permalink / raw)
  To: help-gnu-emacs

> (define-key ess-mode-map [(control ?c) (control ?t)] "Test!")

Typically, the keymap is not defined at startup, so you can't do the above
directly: you have to do it in a hook or somesuch.  So a common solution is
to do:

  (add-hook 'ess-mode-hook
            (lambda ()
              (local-set-key [(control ?c) (control ?t)] "Test!")))


-- Stefan

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

end of thread, other threads:[~2007-06-09 23:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-17 20:45 List of current key maps Will
2007-05-18  4:02 ` Tim X
2007-05-18 14:10   ` Drew Adams
2007-05-19 13:43   ` Will
2007-06-09 23:53 ` Stefan Monnier

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).