From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: Repeat count for yanking Date: Tue, 05 Jul 2011 19:27:23 +0200 Message-ID: <4E13497B.50007@easy-emacs.de> References: <128vsdeyqg.fsf@news.eternal-september.org> <0A0F98DA-B6DA-4C1B-B3E2-D5F76299AD75@gmail.com> <87y60c99s4.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1309893015 5844 80.91.229.12 (5 Jul 2011 19:10:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2011 19:10:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 05 21:10:11 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QeB0b-00081g-DO for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Jul 2011 21:10:09 +0200 Original-Received: from localhost ([::1]:43229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeB0Z-0005n7-Vm for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Jul 2011 15:10:08 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qe9PL-0002qn-Jx for help-gnu-emacs@gnu.org; Tue, 05 Jul 2011 13:27:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qe9PJ-0003FM-Ej for help-gnu-emacs@gnu.org; Tue, 05 Jul 2011 13:27:35 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.9]:55319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qe9PI-0003Ei-Qa for help-gnu-emacs@gnu.org; Tue, 05 Jul 2011 13:27:33 -0400 Original-Received: from [192.168.178.27] (brln-4d0c2515.pool.mediaWays.net [77.12.37.21]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Lnlst-1RBZgk2o7r-00hGvO; Tue, 05 Jul 2011 19:27:29 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11 In-Reply-To: <87y60c99s4.fsf@gmail.com> X-Provags-ID: V02:K0:bRuWUh6Cbi14cS6r3SLnoBFkZNye9rZlV2M4ndD74mB ULOCB9/zPocxZeq+W5kK3QvSyaXmHiO+Ag7EiZIIX3LwZTGlbX /NXKJpEkSsh7ZwRl3eBM/n/P17XXHOdGQJZ0gE9Yl0gb9W1EZt Wk7bl0n1/6pLlv2UWgMeQd/QwrmtvhEWUhn5ZukWBS1JlK/Ogm yosI5bjmkPdOknQB0TNw8/WUUtgXJYvQlpgVfrk50g= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.17.9 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:81499 Archived-At: Am 05.07.2011 14:44, schrieb Thierry Volpiatto: > Perry Smith writes: > >> On Jul 5, 2011, at 6:46 AM, Richard Riley wrote: >> >>> C K Kashyap writes: >>> >>>> Hi, >>>> How can I provide a repeat count to yank - >>>> >>>> I'd like to kill a line and then paste it 100 times - how can I >>>> achieve this? >>>> >>>> Regards, >>>> Kashyap >>>> >>>> >>> >>> I was looking at this recently. >>> >>> http://stackoverflow.com/questions/71985/emacs-equivalent-of-vims-yy10p >> >> If it is a one time thing, I usually do it in powers of two. e.g. yank it maybe 4 times, then kill that and yank 4 times. Now you have 16 lines. ... >> >> Remember that M-< sets the mark. So if you narrow the region you can paste a lot of lines rather quickly. >> >> If I was going to do this moderately frequently, I would toy around and learn how to do it via M-; (eval). Seems like one line of lisp could do this. >> >> > M-: (loop repeat 5 do (progn (yank) (insert "\n"))) > nice, and what about that: (defun yank-repeat (&optional arg) (interactive "p") (dotimes (i arg) (insert (car kill-ring))))