From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: keybinding to duplicate the current line. Date: Sun, 17 Jan 2010 15:58:05 +0100 Message-ID: References: <27198868.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1263740394 31679 80.91.229.12 (17 Jan 2010 14:59:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Jan 2010 14:59:54 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 17 15:59:46 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NWWbR-0003d2-V5 for ged-emacs-devel@m.gmane.org; Sun, 17 Jan 2010 15:59:46 +0100 Original-Received: from localhost ([127.0.0.1]:52951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWWbS-0008Gq-Sl for ged-emacs-devel@m.gmane.org; Sun, 17 Jan 2010 09:59:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWWaL-00079h-CL for emacs-devel@gnu.org; Sun, 17 Jan 2010 09:58:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWWaG-00073b-Kf for emacs-devel@gnu.org; Sun, 17 Jan 2010 09:58:36 -0500 Original-Received: from [199.232.76.173] (port=50483 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWWaG-00073N-9C for emacs-devel@gnu.org; Sun, 17 Jan 2010 09:58:32 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:55703) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NWWaF-0004GH-Ni for emacs-devel@gnu.org; Sun, 17 Jan 2010 09:58:31 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1NWWaC-0003G2-8p for emacs-devel@gnu.org; Sun, 17 Jan 2010 15:58:28 +0100 Original-Received: from dial-190218.pool.broadband44.net ([212.46.190.218]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Jan 2010 15:58:28 +0100 Original-Received: from eller.helmut by dial-190218.pool.broadband44.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Jan 2010 15:58:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 20 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dial-190218.pool.broadband44.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:9JYEeRyGyXqwqxXMa8GZgKHSvAA= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:120150 Archived-At: * alin.s [2010-01-17 14:40+0100] writes: > Do you consider that such a function would be useful for many of you? A standard keybinding would be useful for me. I use C-x , because that key wasn't taken yet. Helmut (defun copy-line () "Copy the current line." (interactive) (let ((col (current-column)) (beg (progn (beginning-of-line) (point))) (end (progn (end-of-line) (point)))) (forward-line) (save-excursion (insert (buffer-substring beg end) "\n")) (move-to-column col))) (global-set-key "\C-x," 'copy-line)