help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keybinding


From: Uday S Reddy
Subject: Re: keybinding
Date: Fri, 30 Jul 2010 20:47:58 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1

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!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]