From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uday S Reddy Newsgroups: gmane.emacs.help Subject: Re: keybinding Date: Fri, 30 Jul 2010 20:47:58 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1280519356 23218 80.91.229.12 (30 Jul 2010 19:49:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Jul 2010 19:49:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 30 21:49:14 2010 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.69) (envelope-from ) id 1OevZs-0004dB-Ix for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jul 2010 21:49:08 +0200 Original-Received: from localhost ([127.0.0.1]:37772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OevZs-0000qc-0A for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jul 2010 15:49:08 -0400 Original-Received: from [140.186.70.92] (port=60621 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OevZ0-0000ms-I2 for help-gnu-emacs@gnu.org; Fri, 30 Jul 2010 15:48:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OevYz-00043F-H2 for help-gnu-emacs@gnu.org; Fri, 30 Jul 2010 15:48:14 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:57412) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OevYz-000434-AB for help-gnu-emacs@gnu.org; Fri, 30 Jul 2010 15:48:13 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OevYw-00043g-Uq for help-gnu-emacs@gnu.org; Fri, 30 Jul 2010 21:48:10 +0200 Original-Received: from cpc10-harb6-0-0-cust112.perr.cable.virginmedia.com ([92.232.137.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 Jul 2010 21:48:10 +0200 Original-Received: from u.s.reddy by cpc10-harb6-0-0-cust112.perr.cable.virginmedia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 Jul 2010 21:48:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpc10-harb6-0-0-cust112.perr.cable.virginmedia.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 In-Reply-To: X-detected-operating-system: by eggs.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:74360 Archived-At: On 7/30/2010 4:36 AM, Z wrote: > Hello, > > I am a beginner to emacs . I would like to ask some advices to achieve such a > keybinding problem. > > Typing C-c C-e in a buffer in Caml mode sends the current phrase > (containing the point) to the Caml toplevel, and evaluates it. I would like > that achieve this by simply type C- downarrow. Would you like to give some > hints to achieve it? The general thing to do is to find the variable that contains the "hooks" that are called when caml-mode is entered. Supposing the variable is called caml-mode-hook, you can add to it a function that sets C-[down] to the same thing that C-c C-e is set to. It will look something like (add-hook 'caml-mode-hook (lambda () (local-set-key "C-[down]" the-function-that-sends-current-phrase)))) If there are any users of Caml mode on this list, they can give you more a specific tip. But you would be better off reading the Emacs manual chapter on Customizing Key Bindings. Cheers, Uday PS: The Emacs aficionados reading this list might think about why it needs to be this complicated!