From: Jim Hunter <jhunter@paradigmshift.homelinux.net>
Subject: Re: Trying to bind a new key in C mode
Date: 12 Feb 2005 11:59:21 -0600 [thread overview]
Message-ID: <87ll9tslqe.fsf@paradigmshift.homelinux.net> (raw)
In-Reply-To: mailman.1836.1108176936.2841.help-gnu-emacs@gnu.org
August <fusionfive@comhem.se> writes:
> On fre, 2005-02-11 at 18:09 -0600, Jim Hunter wrote:
> > I would like to bind C-c c to run the 'compile' function in C mode
> > (and, ultimately, C-c r to run 'recompile'), but cannot get it to
> > work. Unfortunately, I know nothing about Lisp, so I simply copied
> > the example from the Emacs info page "Local Keymaps" and modified it
> > to this (in my .emacs file):
> >
> > (add-hook 'c-mode-hook
> > '(lambda ()
> > (define-key c-mode-map "\C-cc" 'compile)))
> >
>
> Try
>
> (add-hook 'c-mode-hook
> '(lambda () (local-set-key "\C-cc" 'compile)))
>
[snip]
Thanks very much for the reply. When your example also didn't work,
I realized that cc-mode might be loading before that part of .emacs was
processed. Moving the add-hook call before my desktop was loaded fixed
it -- both for your example and the original example.
Thanks again!
Jim
prev parent reply other threads:[~2005-02-12 17:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-12 0:09 Trying to bind a new key in C mode Jim Hunter
2005-02-12 2:41 ` August
[not found] ` <mailman.1836.1108176936.2841.help-gnu-emacs@gnu.org>
2005-02-12 17:59 ` Jim Hunter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ll9tslqe.fsf@paradigmshift.homelinux.net \
--to=jhunter@paradigmshift.homelinux.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).