diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-06-27 10:57:02 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-06-27 10:59:08 -0700 |
commit | efc262f5f8a16d25c0db4e80fa52e693897fa41f (patch) | |
tree | 6a78ad9a601676202619bbf50eccff61f2936e83 /lisp/emacs-lisp/cl-lib.el | |
parent | 5e3fde03b45877d3e30f859a14c10043e637aa63 (diff) | |
download | emacs-efc262f5f8a16d25c0db4e80fa52e693897fa41f.tar.gz emacs-efc262f5f8a16d25c0db4e80fa52e693897fa41f.tar.bz2 emacs-efc262f5f8a16d25c0db4e80fa52e693897fa41f.zip |
Initialize cl--gensym-counter to 0
Previously it was initialized to a random value, which made it
harder to reproduce earlier Emacs runs. The need for a random
value went away when Emacs introduced and used the #: syntax for
uninterned symbols (Bug#20862).
* doc/misc/cl.texi (Creating Symbols, Common Lisp Compatibility):
Document that cl--gensym-counter now starts with 0.
* lisp/emacs-lisp/cl-lib.el (cl--gensym-counter): Remove.
(cl--random-time): Move to near only remaining use.
* lisp/emacs-lisp/cl-macs.el (cl--gensym-counter): Initialize to 0.
Diffstat (limited to 'lisp/emacs-lisp/cl-lib.el')
-rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index b6f3a793be6..2dd05192019 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -249,16 +249,6 @@ so that they are registered at compile-time as well as run-time." `(progn ,@body)))) ; Avoid loading cl-macs.el for cl-eval-when. -;;; Symbols. - -(defun cl--random-time () - (let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0)) - (while (>= (cl-decf i) 0) (setq v (+ (* v 3) (aref time i)))) - v)) - -(defvar cl--gensym-counter (* (logand (cl--random-time) 1023) 100)) - - ;;; Numbers. (define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4") @@ -298,6 +288,11 @@ If true return the decimal value of digit CHAR in RADIX." (let ((n (aref cl-digit-char-table char))) (and n (< n (or radix 10)) n))) +(defun cl--random-time () + (let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0)) + (while (>= (cl-decf i) 0) (setq v (+ (* v 3) (aref time i)))) + v)) + (defvar cl--random-state (vector 'cl--random-state-tag -1 30 (cl--random-time))) |