unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* remap C-c C-d in C file
@ 2013-04-24 19:34 Rami A
  2013-04-24 22:13 ` Alan Mackenzie
  0 siblings, 1 reply; 3+ messages in thread
From: Rami A @ 2013-04-24 19:34 UTC (permalink / raw)
  To: help-gnu-emacs

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-24 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 19:34 remap C-c C-d in C file Rami A
2013-04-24 22:13 ` Alan Mackenzie
2013-04-24 22:52   ` Rami A

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).