#elisp
Function: random &optional limit

This function returns a pseudo-random integer. Repeated calls return a series of pseudo-random integers.

If limit is a positive integer, the value is chosen to be nonnegative and less than limit . Otherwise, the value might be any integer representable in Lisp, i.e., an integer between most-negative-fixnum and most-positive-fixnum (see Integer Basics).

If limit is t, it means to choose a new seed as if Emacs were restarting.

If limit is a string, it means to choose a new seed based on the string’s contents.

If you want to change selection, open document below and click on "Move attachment"

GNU Emacs Lisp Reference Manual: Random Numbers
make the sequence repeat, execute (random "") . This sets the seed to a constant value for your particular Emacs executable (though it may differ for other Emacs builds). You can use other strings to choose various seed values. <span>Function: random &optional limit This function returns a pseudo-random integer. Repeated calls return a series of pseudo-random integers. If limit is a positive integer, the value is chosen to be nonnegative and less than limit . Otherwise, the value might be any integer representable in Lisp, i.e., an integer between most-negative-fixnum and most-positive-fixnum (see Integer Basics). If limit is t , it means to choose a new seed as if Emacs were restarting. If limit is a string, it means to choose a new seed based on the string’s contents. Previous: Math Functions, Up: Numbers [Contents][Index] <span><body><html>