help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

remap C-c C-d in C file


From: Rami A
Subject: remap C-c C-d in C file
Date: Wed, 24 Apr 2013 12:34:06 -0700 (PDT)
User-agent: G2/1.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]