Suppose I has text:
test hello
The cursor is after word test. I need to insert random number? Also I need to set range of random (e.g. from 0 to 1000)
The result maybe like this:
test100 hello
(defun my-random-number-insert-at-point ()
"Insert a random number between 0 and 1000."
(interactive)
(insert (number-to-string (random 1000))))
(random t)
since it should be unnecessary. Also, please indent your code properly so it's more readable. Also, you may like to check the consistency between your docstring and your code ;-)
M-: (insert (format "%d" (random 1000)))
.