From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Samuel Wales Newsgroups: gmane.emacs.help Subject: Re: copy-line Date: Sat, 31 Jan 2009 19:06:06 -0700 Message-ID: <20524da70901311806u4567964cy85d3a1588123adae@mail.gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1233454000 17808 80.91.229.12 (1 Feb 2009 02:06:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Feb 2009 02:06:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Helmut Eller Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 01 03:07:53 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 1LTRkU-0001hn-Hc for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Feb 2009 03:07:50 +0100 Original-Received: from localhost ([127.0.0.1]:57966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LTRjC-0003Iq-2h for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Jan 2009 21:06:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LTRis-0003IT-9I for help-gnu-emacs@gnu.org; Sat, 31 Jan 2009 21:06:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LTRip-0003IH-Rj for help-gnu-emacs@gnu.org; Sat, 31 Jan 2009 21:06:08 -0500 Original-Received: from [199.232.76.173] (port=54310 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LTRip-0003IE-Ln for help-gnu-emacs@gnu.org; Sat, 31 Jan 2009 21:06:07 -0500 Original-Received: from mail-ew0-f20.google.com ([209.85.219.20]:58802) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LTRip-0003kS-3b for help-gnu-emacs@gnu.org; Sat, 31 Jan 2009 21:06:07 -0500 Original-Received: by ewy13 with SMTP id 13so1454213ewy.18 for ; Sat, 31 Jan 2009 18:06:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bMYMP/HacrxZDTBG5GNZyPmLi6y3u9euMo0lLucXXCM=; b=qX5oES1AoL9jW7y06CgAU1QGwD/DAXF4Kc/ZctC3sjMIqZSq2riaJSMC9+HDBst/Hs 5lh0ghtmaVaKr22af6sfbnORN2ov4AguP0XW/VSfDHniXdqMkMylZ5e4BZYTqbiZ71/w 5rTQPWlYDIBlSLzRjeRrizD246PJ8+cRiVgCw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=T2PxtijeFclVO+MaHDGcQ9l1YHSVn5JpcqjUbLy/CFcc4wqSnmdl42T9eOrCU06rwX Rft6JROI2tch5zDqiWD8Lk6iRYDiTfRyiwptqX0bqbkHwS+fil0H+K43oWgrMUDFHcUH mvGimom5Qe7GXgrfFvMtmLSzIuIR51ByRZazo= Original-Received: by 10.210.90.10 with SMTP id n10mr3171582ebb.98.1233453966349; Sat, 31 Jan 2009 18:06:06 -0800 (PST) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:61814 Archived-At: (defun alpha-open-line-entire (&optional arg) "Open a line above. If there is a prefix argument of just C-u, then repeat the line. If there are two, repeat and comment. If there is a natural numeric argument, repeat that many lines." (interactive "*P") (if arg (progn (repeat-line (if (consp arg) 1 (prefix-numeric-value arg))) ;;put a commented line in front of the line (when (= (car arg) 16) (comment-region (point-at-bol) (point-at-eol)) ;;this misplaces point, but cannot be fixed without ;;knowing whether ;;; or ;; or #. (next-line) '(back-to-indentation))) (progn (beginning-of-line) ;;2004-01-30 open-line just went awol, acting like yank ;;(open-line 1) (newline 1) (forward-line -1) (unless (bobp) ;;(let ((indent-line-function 'alpha-indent-to-next-indentation)) (indent-according-to-mode))))) On Sat, Jan 31, 2009 at 11:26, Helmut Eller wrote: > Hello, > > is there a command (and standard key) to copy the current line? The > command should duplicate the text of the current line and move point to > the copied line. I think that vi has something like that, and > occasionally it would be quite useful. > > I can write that myself but maybe Emacs has something already and I > don't know it? It's also a bit hard to find a free key :-) > > Helmut. > -- For personal and corporate gain, myalgic encephalomyelitis denialists are knowingly causing massive suffering and 25-years-early death by grossly corrupting science. http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm