Function: cookie

cookie is an autoloaded, interactive and byte-compiled function defined in cookie1.el.gz.

Signature

(cookie PHRASE-FILE &optional STARTMSG ENDMSG)

Documentation

Return a random phrase from PHRASE-FILE.

When the phrase file is read in, display STARTMSG at the beginning of load, ENDMSG at the end. Interactively, PHRASE-FILE defaults to cookie-file, unless that is nil or a prefix argument is used.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/play/cookie1.el.gz
;;;###autoload
(defun cookie (phrase-file &optional startmsg endmsg)
  "Return a random phrase from PHRASE-FILE.
When the phrase file is read in, display STARTMSG at the beginning
of load, ENDMSG at the end.
Interactively, PHRASE-FILE defaults to `cookie-file', unless that
is nil or a prefix argument is used."
  (interactive (list (if (or current-prefix-arg (not cookie-file))
			 (read-file-name "Cookie file: " nil
					 cookie-file t cookie-file)
		       cookie-file) nil nil))
  (setq phrase-file (cookie-check-file phrase-file))
  (let ((cookie-vector (cookie-snarf phrase-file startmsg endmsg))
	res)
    (cookie-shuffle-vector cookie-vector)
    (setq res (aref cookie-vector 0))
    (if (called-interactively-p 'interactive)
	(message "%s" res)
      res)))