all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: saneman <ddd@sdf.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Comment/Uncomment in C files?
Date: Sat, 19 Apr 2008 10:25:46 +0000	[thread overview]
Message-ID: <20080419102546.GA1833@muc.de> (raw)
In-Reply-To: <4809b5de$0$90267$14726298@news.sunsite.dk>

On Sat, Apr 19, 2008 at 11:06:38AM +0200, saneman wrote:
> I use emacs22 and have enabled CUA mode. I have assigned 
> Comment/Uncomment to:


> ;; Toogle comment/uncomment
> (global-set-key "\C-d" 'comment-dwim)

Quick question: why do you want to do this?  comment-dwim has M-; as a
standard key binding, which is surely just as easy to type, and just as
(un)intuitive ;-).

However, if you just want to do this for no particular reason, .....

> But nothing happens when I press C-d. Does emacs C-mode use some other 
> config files?

C Mode itself binds C-d to c-electric-delete-forward.  More to the point,
it binds it in the keymap c-mode-base-map, and this keymap takes
precedence over the global keymap.  So, if you want your global key
binding to be seen, you'll have to suppress the local keybinding.
Something like this (untested) should work:

(define-key c-mode-base-map "\C-d" nil)

That is, if you _really_ want to do it.

-- 
Alan Mackenzie (Nuremberg, Germany).




  parent reply	other threads:[~2008-04-19 10:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-19  9:06 Comment/Uncomment in C files? saneman
2008-04-19  9:48 ` Lennart Borgman (gmail)
2008-04-19 10:25 ` Alan Mackenzie [this message]
     [not found] ` <mailman.10571.1208599695.18990.help-gnu-emacs@gnu.org>
2008-04-19 10:49   ` saneman
2008-04-19 11:02     ` saneman
2008-04-20 11:40       ` Alan Mackenzie
     [not found]       ` <mailman.10603.1208690550.18990.help-gnu-emacs@gnu.org>
2008-04-20 11:48         ` Joost Kremers
2008-04-20 12:58           ` David Hansen
2008-04-19 17:10 ` David Hansen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080419102546.GA1833@muc.de \
    --to=acm@muc.de \
    --cc=ddd@sdf.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.
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.