all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

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.