>>> "B" == Bodertz writes: > Just for your information, if you don't want a global variable, you can > use let: > (let ((counter 0)) > (defun my-insert-add-counter () > (cl-incf counter) > (insert (int-to-string counter)))) Right, but it feels a bit counterintuitive: to define a function in a let. Anyhow a question of taste I presume.