From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: How to change key bindings in a particular mode Date: Wed, 22 Apr 2009 13:30:46 -0700 Message-ID: <004e01c9c389$3811b430$c2b22382@us.oracle.com> References: <20090422.221207.07882522.guoqiang@smail.hust.edu.cn> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1240432974 22674 80.91.229.12 (22 Apr 2009 20:42:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Apr 2009 20:42:54 +0000 (UTC) To: "'Guo Qiang'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 22 22:44:14 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 1LwjHt-0002uZ-93 for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Apr 2009 22:43:21 +0200 Original-Received: from localhost ([127.0.0.1]:36553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwjGU-00035x-4N for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Apr 2009 16:41:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lwj5w-0007uM-TC for help-gnu-emacs@gnu.org; Wed, 22 Apr 2009 16:31:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lwj5s-0007tQ-Ac for help-gnu-emacs@gnu.org; Wed, 22 Apr 2009 16:31:00 -0400 Original-Received: from [199.232.76.173] (port=47273 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lwj5s-0007tN-4R for help-gnu-emacs@gnu.org; Wed, 22 Apr 2009 16:30:56 -0400 Original-Received: from rcsinet13.oracle.com ([148.87.113.125]:16967 helo=rgminet13.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lwj5r-0001NU-N2 for help-gnu-emacs@gnu.org; Wed, 22 Apr 2009 16:30:55 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n3MKUmpI025409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 22 Apr 2009 20:30:51 GMT Original-Received: from acsmt704.oracle.com (acsmt704.oracle.com [141.146.40.82]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n3MKUjnV016631; Wed, 22 Apr 2009 20:30:47 GMT Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 22 Apr 2009 13:30:45 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <20090422.221207.07882522.guoqiang@smail.hust.edu.cn> Thread-Index: AcnDh2/F88PXDsHnTaec/Q1+Uz90mgAADDhQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt704.oracle.com [141.146.40.82] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010205.49EF7E77.00F6:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:63958 Archived-At: > I am now writing a small function for mew. I want to remake > key bingings to a function in mew's draft mode. How can I do > that ? 1. Find the name of the mode: `C-h v major-mode'. Example: `foo-mode'. 2. The mode's keymap is probably the same, with `-map' appended. Example: `foo-mode-map'. 3. Define or redefine each of the keys you want in that map, using function `define-key'. Example: (define-key foo-mode-map "\C-a" 'my-cmd) To see the key bindings for a mode, use `C-h b'. To better see the key bindings in a particular keymap, use `describe-keymap', avaiable in library `help-fns+.el': http://www.emacswiki.org/emacs/help-fns%2b.el http://www.emacswiki.org/emacs/HelpPlus