* keybinding
@ 2010-07-30 3:36 Z
2010-07-30 19:47 ` keybinding Uday S Reddy
0 siblings, 1 reply; 4+ messages in thread
From: Z @ 2010-07-30 3:36 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 364 bytes --]
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?
Many thanks
Z.
[-- Attachment #2: Type: text/html, Size: 434 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: keybinding
2010-07-30 3:36 keybinding Z
@ 2010-07-30 19:47 ` Uday S Reddy
2010-07-30 20:34 ` keybinding Burton Samograd
2010-07-31 0:24 ` keybinding Deniz Dogan
0 siblings, 2 replies; 4+ messages in thread
From: Uday S Reddy @ 2010-07-30 19:47 UTC (permalink / raw)
To: help-gnu-emacs
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!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: keybinding
2010-07-30 19:47 ` keybinding Uday S Reddy
@ 2010-07-30 20:34 ` Burton Samograd
2010-07-31 0:24 ` keybinding Deniz Dogan
1 sibling, 0 replies; 4+ messages in thread
From: Burton Samograd @ 2010-07-30 20:34 UTC (permalink / raw)
To: help-gnu-emacs
Uday S Reddy <u.s.reddy@cs.bham.ac.uk> writes:
> On 7/30/2010 4:36 AM, Z wrote:
> you can add to it a function that sets C-[down] to the same thing that
> C-c C-e is set to
To find out the name of the function, you can use C-h k C-c C-e.
> (add-hook 'caml-mode-hook
> (lambda ()
> (local-set-key "C-[down]" the-function-that-sends-current-phrase))))
Should be:
(add-hook 'caml-mode-hook
(lambda ()
(local-set-key (kbd "C-<down>") 'the-function-that-sends-current-phrase)))
> PS: The Emacs aficionados reading this list might think about why it
> needs to be this complicated!
Sometimes that's just how it is with this much extensability.
--
Burton Samograd
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: keybinding
2010-07-30 19:47 ` keybinding Uday S Reddy
2010-07-30 20:34 ` keybinding Burton Samograd
@ 2010-07-31 0:24 ` Deniz Dogan
1 sibling, 0 replies; 4+ messages in thread
From: Deniz Dogan @ 2010-07-31 0:24 UTC (permalink / raw)
To: Uday S Reddy; +Cc: help-gnu-emacs
2010/7/30 Uday S Reddy <u.s.reddy@cs.bham.ac.uk>:
> PS: The Emacs aficionados reading this list might think about why it needs
> to be this complicated!
>
With great power comes great responsibility.
Or more specifically: if you want to be able to customize very
specific needs like this you should expect that you have to understand
just a bit of Emacs Lisp.
--
Deniz Dogan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-31 0:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-30 3:36 keybinding Z
2010-07-30 19:47 ` keybinding Uday S Reddy
2010-07-30 20:34 ` keybinding Burton Samograd
2010-07-31 0:24 ` keybinding Deniz Dogan
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.