From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bastien Newsgroups: gmane.emacs.help Subject: Re: copy-line Date: Tue, 24 Jul 2012 19:44:57 +0200 Organization: GNU Message-ID: <87394hdpeu.fsf@gnu.org> References: <1341515294.71719.YahooMailNeo@web163106.mail.bf1.yahoo.com> <1343146015.53752.YahooMailNeo@web163101.mail.bf1.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1343151871 28211 80.91.229.3 (24 Jul 2012 17:44:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 Jul 2012 17:44:31 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Enda Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 24 19:44:30 2012 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 1Stj9n-0002Qq-Ot for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Jul 2012 19:44:27 +0200 Original-Received: from localhost ([::1]:51681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Stj9n-0003zT-47 for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Jul 2012 13:44:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Stj9h-0003z5-NY for help-gnu-emacs@gnu.org; Tue, 24 Jul 2012 13:44:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Stj9d-0006ih-OV for help-gnu-emacs@gnu.org; Tue, 24 Jul 2012 13:44:21 -0400 Original-Received: from mail-wg0-f49.google.com ([74.125.82.49]:39801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Stj9d-0006iZ-HP for help-gnu-emacs@gnu.org; Tue, 24 Jul 2012 13:44:17 -0400 Original-Received: by wgbez12 with SMTP id ez12so5799138wgb.30 for ; Tue, 24 Jul 2012 10:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:organization:references :user-agent:date:message-id:mime-version:content-type; bh=kCRR+OKdvpa/UMWrNUWQdZ0NCg6n0POiTSuQD3UhuP4=; b=kdKgocoNfb+DbPhf0ovHjTNlzJRhxzFO1dX4NFi3kQZCwacQSKA6MvYxQDyB6VdNsM gQ5g326Jmv1Onl2vsQq/Uo3UoigOuUgr7l6H69TLG258Jj1MEi6Dj4lwxclr37ncSe4s FNcTFCBgswn2USs+uSaVnxqvsO6IVd/KzJzJgpjfzDX4o8rv1Oxnl3rrnlkvFtYf0Btb NTkzaBoRCji972OD8OG/qhBjBoIiFAQy+4Z47bmSbg9LpBF2qEHxR56kb/SFxL9IkAEW NL8LocewpG/COLRoj3rgbRUYjGNbYBuaiPw+tVj2kxhwrPr00UysYMUI0uneIKq9vbie 8ohw== Original-Received: by 10.180.100.37 with SMTP id ev5mr8982856wib.5.1343151856606; Tue, 24 Jul 2012 10:44:16 -0700 (PDT) Original-Received: from myhost.localdomain (mar75-2-81-56-68-112.fbx.proxad.net. [81.56.68.112]) by mx.google.com with ESMTPS id j6sm8289254wiy.4.2012.07.24.10.44.15 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 10:44:15 -0700 (PDT) Original-Received: by myhost.localdomain (Postfix, from userid 1000) id D31A18207; Tue, 24 Jul 2012 19:44:57 +0200 (CEST) In-Reply-To: <1343146015.53752.YahooMailNeo@web163101.mail.bf1.yahoo.com> (Enda's message of "Tue, 24 Jul 2012 09:06:55 -0700 (PDT)") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.49 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:86003 Archived-At: Enda writes: > Usedn't there be a copy-line in Emacs (which would copy the line). In > Vi, copying a line is yy, what is the shortest way of copying a line > in Emacs (without writing a lisp function in .emacs)? Should there be > a default keystroke for copying a line? What about one of these two? (defun kill-line-save (&optional arg) "Save the rest of the line as if killed, but don't kill it." (interactive "P") (let ((buffer-read-only t)) (kill-line arg) (message "Line(s) copied to the kill ring"))) (defun copy-line (&optional arg) "Copy the current line." (interactive "P") (copy-region-as-kill (point-at-bol) (+ (if kill-whole-line 1 0) (point-at-eol arg)))) -- Bastien