From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rami A Newsgroups: gmane.emacs.help Subject: remap C-c C-d in C file Date: Wed, 24 Apr 2013 12:34:06 -0700 (PDT) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1366834973 19844 80.91.229.3 (24 Apr 2013 20:22:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Apr 2013 20:22:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 24 22:22:57 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UV6DP-0001yc-2O for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Apr 2013 22:22:55 +0200 Original-Received: from localhost ([::1]:42609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV6DO-0005CT-Lk for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Apr 2013 16:22:54 -0400 X-Received: by 10.224.217.195 with SMTP id hn3mr25515223qab.5.1366832047250; Wed, 24 Apr 2013 12:34:07 -0700 (PDT) X-Received: by 10.50.149.132 with SMTP id ua4mr5197470igb.8.1366832047022; Wed, 24 Apr 2013 12:34:07 -0700 (PDT) Original-Path: usenet.stanford.edu!gp5no2404693qab.0!news-out.google.com!ef9ni16888qab.0!nntp.google.com!gp5no5767653qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=148.87.19.198; posting-account=HZ4YzgoAAABkTSCruZ7Bs4hufjlOUmBF Original-NNTP-Posting-Host: 148.87.19.198 User-Agent: G2/1.0 Injection-Date: Wed, 24 Apr 2013 19:34:07 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:198066 X-Mailman-Approved-At: Wed, 24 Apr 2013 16:22:39 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90334 Archived-At: 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.