[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
need help in improving my boring-repeat function
From: |
C K Kashyap |
Subject: |
need help in improving my boring-repeat function |
Date: |
Fri, 24 Jan 2014 14:14:20 +0530 |
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
- need help in improving my boring-repeat function,
C K Kashyap <=