From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.help Subject: Re: yank-repeat-newline Date: Tue, 26 Jul 2011 22:19:44 +0300 Message-ID: <87tya8rgrz.fsf@mithlond.arda> References: <4E2F11A3.3090102@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: Quoted-Printable X-Trace: dough.gmane.org 1311708005 30071 80.91.229.12 (26 Jul 2011 19:20:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 26 Jul 2011 19:20:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?iso-8859-1?Q?Andreas_R=F6hler?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 26 21:19:58 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 1QlnAb-0006Vs-Qi for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Jul 2011 21:19:57 +0200 Original-Received: from localhost ([::1]:58077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlnAb-0000oa-4q for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Jul 2011 15:19:57 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlnAW-0000oV-VZ for help-gnu-emacs@gnu.org; Tue, 26 Jul 2011 15:19:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlnAW-0007fF-4F for help-gnu-emacs@gnu.org; Tue, 26 Jul 2011 15:19:52 -0400 Original-Received: from mta-out.inet.fi ([195.156.147.13]:47363 helo=jenni2.inet.fi) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlnAV-0007f5-QN for help-gnu-emacs@gnu.org; Tue, 26 Jul 2011 15:19:52 -0400 Original-Received: from mithlond.arda (84.251.132.215) by jenni2.inet.fi (8.5.133) id 4DF73E8501E05A7D; Tue, 26 Jul 2011 22:19:48 +0300 Original-Received: from dtw by mithlond.arda with local (Exim 4.72) (envelope-from ) id 1QlnAP-0002Bh-1H; Tue, 26 Jul 2011 22:19:45 +0300 In-Reply-To: <4E2F11A3.3090102@easy-emacs.de> ("Andreas =?iso-8859-1?Q?R?= =?iso-8859-1?Q?=F6hler=22's?= message of "Tue, 26 Jul 2011 21:12:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 195.156.147.13 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:81791 Archived-At: * 2011-07-26T21:12:35+02:00 * Andreas R=F6hler 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?