From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: yank-repeat-newline Date: Tue, 26 Jul 2011 21:24:03 +0200 Message-ID: <4E2F1453.5010604@easy-emacs.de> References: <4E2F11A3.3090102@easy-emacs.de> <87tya8rgrz.fsf@mithlond.arda> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1311708262 31736 80.91.229.12 (26 Jul 2011 19:24:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 26 Jul 2011 19:24:22 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Teemu Likonen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 26 21:24:18 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 1QlnEo-0008GZ-2F for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Jul 2011 21:24:18 +0200 Original-Received: from localhost ([::1]:50381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlnEi-00024l-EK for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Jul 2011 15:24:12 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlnEc-0001x4-P9 for help-gnu-emacs@gnu.org; Tue, 26 Jul 2011 15:24:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlnEb-0008TR-Q6 for help-gnu-emacs@gnu.org; Tue, 26 Jul 2011 15:24:06 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.9]:53471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlnEb-0008TJ-DS for help-gnu-emacs@gnu.org; Tue, 26 Jul 2011 15:24:05 -0400 Original-Received: from [192.168.178.27] (brln-4dbc49d1.pool.mediaWays.net [77.188.73.209]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LuYWS-1RU20B3eUK-00zn6e; Tue, 26 Jul 2011 21:24:04 +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: <87tya8rgrz.fsf@mithlond.arda> X-Provags-ID: V02:K0:h5b+0cV/2LaWtMpAKUdA1TGrQ+qnohMYQS6ETIE6X/k QevtR/cmuSfrNe+GiJrSaeaiyHkrDMekQGXZkHM1iSqBN3mN29 mUqRVuR8NQOS49/w/5aWBM1wQpzgnxxTRk2VukMPqhcPey6H3P ZqZCVRiKEoKANjZVG3hb0/BB7y76H/wGa769zOzjedBqtbLxWh n7H/xfttdsIyaOc+npvQVksAVl7Bmp9il4KWsrc2w8= 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:81792 Archived-At: Am 26.07.2011 21:19, schrieb Teemu Likonen: > * 2011-07-26T21:12:35+02:00 * Andreas Röhler wrote: > >> Now when trying to combine both, get difficulties >> >> ;; not working now >> (defun yank-repeat-newline (arg&optional nl) >> "With numerical ARG, repeat last yank ARG times. >> With optional arg NL, also insert newlines. " >> (interactive "p\nP*") >> (let ((nl nl) >> (num arg)) >> (dotimes (i num) >> (if nl >> (insert (concat (car kill-ring) "\n")) >> (insert (car kill-ring)))))) >> >> What is the recommended way writing that? > > Please tell us what you want. How should the command work? How do you > want to execute it and what should it do? > It's in the docstring: repeat last yank resp. to numerical arg. Also I want in some cases have a newline added - ie insert yanks vertically.