From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: Re: gnus: how to redefine a keymap Date: Sat, 24 Oct 2009 13:16:11 +0200 Message-ID: <87pr8dhwjo.fsf@fh-trier.de> References: <70418856-fc02-4177-8ccc-397084621635@d23g2000vbm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1256383042 4707 80.91.229.12 (24 Oct 2009 11:17:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Oct 2009 11:17:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 24 13:17:15 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N1ecT-0000zu-Gj for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Oct 2009 13:17:13 +0200 Original-Received: from localhost ([127.0.0.1]:48348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1ecS-0007gT-SB for geh-help-gnu-emacs@m.gmane.org; Sat, 24 Oct 2009 07:17:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1ebz-0007fy-Jl for help-gnu-emacs@gnu.org; Sat, 24 Oct 2009 07:16:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1ebv-0007ex-Re for help-gnu-emacs@gnu.org; Sat, 24 Oct 2009 07:16:43 -0400 Original-Received: from [199.232.76.173] (port=37499 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1ebv-0007eu-LP for help-gnu-emacs@gnu.org; Sat, 24 Oct 2009 07:16:39 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:43888) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N1ebv-0004lu-Ah for help-gnu-emacs@gnu.org; Sat, 24 Oct 2009 07:16:39 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1N1ebp-0000qJ-Uu for help-gnu-emacs@gnu.org; Sat, 24 Oct 2009 13:16:33 +0200 Original-Received: from dslb-084-059-116-049.pools.arcor-ip.net ([84.59.116.49]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Oct 2009 13:16:33 +0200 Original-Received: from politza by dslb-084-059-116-049.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Oct 2009 13:16:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 62 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-084-059-116-049.pools.arcor-ip.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:VZ5wKDpIxRwn9235Zm3VlhesvvA= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69200 Archived-At: "B. T. Raven" 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 "") (kbd "C-") >> >> Thanks > > How about: > > .... [(g)] ..... > > or .... [?g].... > > or .... "g" ..... > > > ?? I vote for the 2nd option. -ap