all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* need help in improving my boring-repeat function
@ 2014-01-24  8:44 C K Kashyap
  0 siblings, 0 replies; 3+ messages in thread
From: C K Kashyap @ 2014-01-24  8:44 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-24 13:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.12676.1390553090.10748.help-gnu-emacs@gnu.org>
2014-01-24  9:27 ` need help in improving my boring-repeat function marc tfardy
2014-01-24 13:28   ` C K Kashyap
2014-01-24  8:44 C K Kashyap

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.