unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "tubescreamer808@gmail.com" <tubescreamer808@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Key binding problem
Date: 26 Feb 2007 05:23:29 -0800	[thread overview]
Message-ID: <1172496209.317241.112620@s48g2000cws.googlegroups.com> (raw)

Hi all,

I'm trying to bind a few keys in c mode and so far, didn't have much
success with it. I have the following defined in my .emacs:

(defun my-c-mode-common-hook ()
  (local-set-key [C-|] 'indent-region)
  (local-set-key [C-%] 'query-replace-regexp)
  (local-set-key (kbd "RET") 'newline-and-indent)
  (local-set-key [C-/] 'comment-region)
  (local-set-key [C-?] 'uncomment-region)
  (c-subword-mode 1)
  )

(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

The only binding that works is the one for the newline-and-indent
command. For the other ones, emacs tells me that the key combination
is not defined. However, if I run local-set-key interactively once
emacs is done loading and after visiting a C++ file, it works. I tried
the same bindings in c++-mode-hook but, unsurprisingly, it made no
difference at all which.

What am I doing wrong?

Thanks in advance
Jean

             reply	other threads:[~2007-02-26 13:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-26 13:23 tubescreamer808 [this message]
2007-02-26 13:33 ` Key binding problem weber
2007-02-26 14:19   ` tubescreamer808
2007-02-26 16:12   ` Lennart Borgman (gmail)
     [not found]   ` <mailman.118.1172506366.7795.help-gnu-emacs@gnu.org>
2007-02-26 16:54     ` tubescreamer808
2007-02-26 18:41       ` Xavier Maillard
2007-02-26 19:15         ` Drew Adams
2007-02-26 20:28           ` Xavier Maillard
     [not found]           ` <mailman.136.1172521894.7795.help-gnu-emacs@gnu.org>
2007-02-27  8:50             ` tubescreamer808
2007-02-27 10:15               ` Lennart Borgman (gmail)

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=1172496209.317241.112620@s48g2000cws.googlegroups.com \
    --to=tubescreamer808@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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).