* gnus: how to redefine a keymap
@ 2009-10-23 20:41 Francis Moreau
2009-10-24 8:13 ` B. T. Raven
0 siblings, 1 reply; 4+ messages in thread
From: Francis Moreau @ 2009-10-23 20:41 UTC (permalink / raw)
To: help-gnu-emacs
hello,
I'd like to redefine the 'g' key in the group buffer so it queries
only groups with a specific level or lower.
To do that I tried this:
(defun my-gnus-group-get-new-news ()
(interactive)
(gnus-group-get-new-news 2))
(add-hook 'gnus-group-mode-hook
(lambda ()
(define-key gnus-group-mode-map
[g] 'my-gnus-group-get-new-news)))
but it doesn't work.
If I map my-gnus-group-get-new-news function to 'F6' for example it
works.
Could anybody tell me why it doesn't work with 'g' key ?
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gnus: how to redefine a keymap
2009-10-23 20:41 gnus: how to redefine a keymap Francis Moreau
@ 2009-10-24 8:13 ` B. T. Raven
2009-10-24 11:16 ` Andreas Politz
[not found] ` <mailman.9394.1256383005.2239.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 4+ messages in thread
From: B. T. Raven @ 2009-10-24 8:13 UTC (permalink / raw)
To: help-gnu-emacs
Francis Moreau wrote:
> hello,
>
> I'd like to redefine the 'g' key in the group buffer so it queries
> only groups with a specific level or lower.
>
> To do that I tried this:
>
> (defun my-gnus-group-get-new-news ()
> (interactive)
> (gnus-group-get-new-news 2))
>
> (add-hook 'gnus-group-mode-hook
> (lambda ()
> (define-key gnus-group-mode-map
> [g] 'my-gnus-group-get-new-news)))
>
> but it doesn't work.
>
> If I map my-gnus-group-get-new-news function to 'F6' for example it
> works.
>
> Could anybody tell me why it doesn't work with 'g' key ?
>
> Thanks
How about:
.... [(g)] .....
or .... [?g]....
or .... "g" .....
??
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gnus: how to redefine a keymap
2009-10-24 8:13 ` B. T. Raven
@ 2009-10-24 11:16 ` Andreas Politz
[not found] ` <mailman.9394.1256383005.2239.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 4+ messages in thread
From: Andreas Politz @ 2009-10-24 11:16 UTC (permalink / raw)
To: help-gnu-emacs
"B. T. Raven" <nihil@nihilo.net> writes:
> Francis Moreau wrote:
>> hello,
>>
>> I'd like to redefine the 'g' key in the group buffer so it queries
>> only groups with a specific level or lower.
>>
>> To do that I tried this:
>>
>> (defun my-gnus-group-get-new-news ()
>> (interactive)
>> (gnus-group-get-new-news 2))
>>
>> (add-hook 'gnus-group-mode-hook
>> (lambda ()
>> (define-key gnus-group-mode-map
>> [g] 'my-gnus-group-get-new-news)))
>>
>> but it doesn't work.
>>
>> If I map my-gnus-group-get-new-news function to 'F6' for example it
>> works.
>>
>> Could anybody tell me why it doesn't work with 'g' key ?
Because `g' is a symbol, not a character. On the other hand, function
keys are mapped by symbols (like 'F6).
Anyway you should probablly stick to the `kbd' macro, where you can
, in most cases, declare the key as you seem to expect.
(kbd "g")
(kbd "C-g")
Keys which are represented by symbols (e.g. function keys,Home,etc.)
need to be embraced.
(kbd "<f6>")
(kbd "C-<f6>")
>>
>> Thanks
>
> How about:
>
> .... [(g)] .....
>
> or .... [?g]....
>
> or .... "g" .....
>
>
> ??
I vote for the 2nd option.
-ap
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gnus: how to redefine a keymap
[not found] ` <mailman.9394.1256383005.2239.help-gnu-emacs@gnu.org>
@ 2009-10-24 12:16 ` Francis Moreau
0 siblings, 0 replies; 4+ messages in thread
From: Francis Moreau @ 2009-10-24 12:16 UTC (permalink / raw)
To: help-gnu-emacs
Andreas Politz <politza@fh-trier.de> writes:
> "B. T. Raven" <nihil@nihilo.net> writes:
>
[...]
>
> Because `g' is a symbol, not a character. On the other hand, function
> keys are mapped by symbols (like 'F6).
>
> Anyway you should probablly stick to the `kbd' macro, where you can
> , in most cases, declare the key as you seem to expect.
>
> (kbd "g")
> (kbd "C-g")
>
> Keys which are represented by symbols (e.g. function keys,Home,etc.)
> need to be embraced.
>
> (kbd "<f6>")
> (kbd "C-<f6>")
ah ok thanks for the tips
>>
>> How about:
>>
>> .... [(g)] .....
>>
>> or .... [?g]....
>>
>> or .... "g" .....
>>
>>
>> ??
>
> I vote for the 2nd option.
>
Just out of curiosity, why the 2nd one ? it looks to me the less
readable :)
--
Francis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-10-24 12:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-23 20:41 gnus: how to redefine a keymap Francis Moreau
2009-10-24 8:13 ` B. T. Raven
2009-10-24 11:16 ` Andreas Politz
[not found] ` <mailman.9394.1256383005.2239.help-gnu-emacs@gnu.org>
2009-10-24 12:16 ` Francis Moreau
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).