From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: C K Kashyap Newsgroups: gmane.emacs.help Subject: need help in improving my boring-repeat function Date: Fri, 24 Jan 2014 14:14:20 +0530 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1390553092 29293 80.91.229.3 (24 Jan 2014 08:44:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jan 2014 08:44:52 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 24 09:44:59 2014 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 1W6cNn-0002vg-8v for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Jan 2014 09:44:59 +0100 Original-Received: from localhost ([::1]:45066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6cNm-0003y3-RY for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Jan 2014 03:44:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6cNc-0003xy-5L for help-gnu-emacs@gnu.org; Fri, 24 Jan 2014 03:44:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6cNV-0002Pq-Ue for help-gnu-emacs@gnu.org; Fri, 24 Jan 2014 03:44:48 -0500 Original-Received: from mail-qa0-x230.google.com ([2607:f8b0:400d:c00::230]:45255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6cNV-0002Pg-Pe for help-gnu-emacs@gnu.org; Fri, 24 Jan 2014 03:44:41 -0500 Original-Received: by mail-qa0-f48.google.com with SMTP id f11so3530489qae.21 for ; Fri, 24 Jan 2014 00:44:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=vPJ+39paZP+1f0HUOHmJ6qhZ7d9rOXuPWKE7nyEjCgQ=; b=Mm689FDv1mDGIAx7PPlGvWpkRPlpGxwuA9BN9bVvko9ZDCSS1Hmk3YnxZSjiVZ40Fd gZDl4J6fVaPl5F7vtafDJNNNTKMjLvYQcktNDp9UU4kmdADG3NS+3fGnf6Ug9njX4V1y kQj5pLzJzwmrkXSXqJWvqRvJbsmsINNsKdKf9dCp340FErzeBOcWBqTaUcELm1qQcW4H vNieI1oXLie/oNQ5qwc+hBRx7I9XcZiYiIphG8/k/rC49uG7qWRCugtRrej22Gf08NIk u0Bt+7Hfu8jQnGB3kDr5MJMQnGbgByh9QWnGsUIzV7dOqAsqfvu2AJD0ZEwTLNRXO2Wb QcXQ== X-Received: by 10.140.24.71 with SMTP id 65mr17682379qgq.12.1390553080443; Fri, 24 Jan 2014 00:44:40 -0800 (PST) Original-Received: by 10.229.30.66 with HTTP; Fri, 24 Jan 2014 00:44:20 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c00::230 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:95607 Archived-At: Hi, I've written a function to do some repeated insertions of lines like this - (defun boring-repeat (count str) (interactive "sEnter count: \nsEnter format string: \n") (dotimes (i (string-to-number count)) (insert (format str i)))) I was wondering how I could modify it so that I could optionally take a function that could modify "i" So if I call boring-repeat with 2 and hello%2d -> I'd get hello00 hello02 but say I could want hello01 and hello 02 or someother transformation on i How can I go about implementing it? Regards, Kashyap