There are insert function, but no insert-line function. What I need is to insert a line like "commit;" every 1000 lines in the current buffer. So I need to loop and then need some function like
(insert-line 1000 "commit;")
Here is a very basic version:
(defun insert-lines (skip text)
"Insert `text' every `skip' lines."
(while (zerop (forward-line skip))
(insert text)))
You can use it with M-: (insert-lines 10 "commit;\n") RET.
You can add bells and whistles yourself, like interactive
and save-excursion
.