unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Rami A <rami.ammari@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: remap C-c C-d in C file
Date: Wed, 24 Apr 2013 12:34:06 -0700 (PDT)	[thread overview]
Message-ID: <d040c43e-92d1-4237-9a34-fba47b80d340@googlegroups.com> (raw)

Greetings,
I have these functions defined in my dotemacs file:

;; Duplicate entire line
(defun paste-line ()
  "Go to beginning of next line, then yank.(eam)"
  "Note: this yanks whatever was last killed, whether it was a line,"
  "      multiple lines, or part of a line."
  (interactive)
  (forward-line 1)
  (yank))
(defun duplicate-entire-line ()
  "Copy the whole line that point is on.(eam)"
  (interactive)
  (forward-line 1) 
  (let ((end (point))) 
  (forward-line -1) 
  (copy-region-as-kill (point) end)
  (paste-line)))
(global-set-key "\C-c\C-d"       'duplicate-entire-line)

So pressing C-c C-d works in assembly files and it duplicates the current line.
However, in C files it just proceeds to delete a character.
How to remap these keys combinations to "duplicate-entire-line"?
Thanks.


             reply	other threads:[~2013-04-24 19:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 19:34 Rami A [this message]
2013-04-24 22:13 ` remap C-c C-d in C file Alan Mackenzie
2013-04-24 22:52   ` Rami A

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=d040c43e-92d1-4237-9a34-fba47b80d340@googlegroups.com \
    --to=rami.ammari@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).