Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Suppose I has text:
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:
M-: (insert (format "%d" (random 1000)))
(random t) ; seed it randomly
(defun my-random-number-insert-at-point ()
"Insert at point a four-digit random number between 0000 to 1000."
(insert (number-to-string (random 100))))
Required, but never shown