Function: fortune-message
fortune-message is an autoloaded, interactive and byte-compiled
function defined in fortune.el.gz.
Signature
(fortune-message &optional FILE)
Documentation
Display a fortune cookie to the mini-buffer.
If called with a prefix, it has the same behavior as fortune.
Optional FILE is a fortune file from which a cookie will be selected.
Probably introduced at or before Emacs version 26.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/play/fortune.el.gz
;;;###autoload
(defun fortune-message (&optional file)
"Display a fortune cookie to the mini-buffer.
If called with a prefix, it has the same behavior as `fortune'.
Optional FILE is a fortune file from which a cookie will be selected."
(interactive (list (if current-prefix-arg
(fortune-ask-file)
fortune-file)))
(with-temp-buffer
(let ((fortune-buffer-name (current-buffer)))
(fortune-in-buffer t file)
;; Avoid trailing newline.
(if (bolp) (delete-char -1))
(message "%s" (buffer-string)))))