summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/seq.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-09-24 19:41:03 +0200
committerStefan Kangas <stefan@marxist.se>2021-09-24 19:41:03 +0200
commit35d0675467e61aff30c21544f87f55b1b1a2cfd3 (patch)
treedfbc48f1575e762352d60b55bb25facfa438875b /lisp/emacs-lisp/seq.el
parent8fbf816ccd0fe223568d6c31c4571ca45dffaa8d (diff)
downloademacs-35d0675467e61aff30c21544f87f55b1b1a2cfd3.tar.gz
emacs-35d0675467e61aff30c21544f87f55b1b1a2cfd3.tar.bz2
emacs-35d0675467e61aff30c21544f87f55b1b1a2cfd3.zip
Prefer seq-random-elt to nth+random
* lisp/emacs-lisp/seq.el (seq-random-elt): Autoload. * lisp/avoid.el (mouse-avoidance-random-shape): * lisp/epa-ks.el (epa-ks--query-url): * lisp/erc/erc-networks.el (erc-server-select): * lisp/gnus/gnus-fun.el (gnus--random-face-with-type) (gnus-fun-ppm-change-string): * lisp/net/soap-inspect.el (soap-sample-value-for-xs-simple-type): * lisp/obsolete/landmark.el (landmark-random-move): * lisp/play/mpuz.el (mpuz-build-random-perm): * lisp/play/zone.el (zone-pgm-stress): * lisp/vc/add-log.el (add-change-log-entry): * test/lisp/net/tramp-tests.el (tramp-test44-asynchronous-requests): Prefer seq-random-elt to nth+random.
Diffstat (limited to 'lisp/emacs-lisp/seq.el')
-rw-r--r--lisp/emacs-lisp/seq.el1
1 files changed, 1 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index ae5988296d8..baafc51693c 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -570,6 +570,7 @@ SEQUENCE must be a sequence of numbers or markers."
If no element is found, return nil."
(ignore-errors (seq-elt sequence n)))
+;;;###autoload
(cl-defgeneric seq-random-elt (sequence)
"Return a random element from SEQUENCE.
Signal an error if SEQUENCE is empty."