From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.help Subject: Re: copy-line Date: Sun, 01 Feb 2009 09:41:55 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1233481255 1509 80.91.229.12 (1 Feb 2009 09:40:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Feb 2009 09:40:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 01 10:42:09 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LTYpu-00033Z-Bw for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Feb 2009 10:41:54 +0100 Original-Received: from localhost ([127.0.0.1]:56717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LTYob-0007pg-LO for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Feb 2009 04:40:33 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.kpnqwest.it!news.kpnqwest.it.POSTED!not-for-mail Original-NNTP-Posting-Date: Sun, 01 Feb 2009 02:41:45 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:bqP8R0JFl0O2sAsnSj2fY+wvIUk= Original-Lines: 16 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 195.254.226.97 Original-X-Trace: sv3-rqMWjZGdGqOL6XPvdiFAHjspKuYNB14GAbPfIx02H+iePUWZsoKdsvJ1fPh/gE/DK9AaiMyaWBA942n!WWVTM8jk/PIbbKzpPbT2pUKR4Cb/Nq1jmrdtqYcklaa6uZ+Yskqj2foFIocdw4g= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Original-Xref: news.stanford.edu gnu.emacs.help:166501 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61820 Archived-At: Thanks to everyone who replied. Apparently Emacs has no standard command to do that. I'll use the code below and bind it to C-x , 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)))