Function: fortune-in-buffer

fortune-in-buffer is a byte-compiled function defined in fortune.el.gz.

Signature

(fortune-in-buffer INTERACTIVE &optional FILE)

Documentation

Put a fortune cookie in the *fortune* buffer.

INTERACTIVE is ignored. Optional argument FILE, when supplied, specifies the file to choose the fortune from.

Source Code

;; Defined in /usr/src/emacs/lisp/play/fortune.el.gz
;;; **************
;;; Display fortune
(defun fortune-in-buffer (_interactive &optional file)
  "Put a fortune cookie in the *fortune* buffer.
INTERACTIVE is ignored.  Optional argument FILE, when supplied,
specifies the file to choose the fortune from."
  (let ((fortune-buffer (or (get-buffer fortune-buffer-name)
			    (generate-new-buffer fortune-buffer-name)))
	(fort-file (expand-file-name
		    (substitute-in-file-name
		     (or file fortune-file)))))
    (with-current-buffer fortune-buffer
      (let ((inhibit-read-only t))
        (erase-buffer)
        (if fortune-always-compile
            (fortune-compile fort-file))
        (apply #'call-process
               fortune-program            ; program to call
               nil fortune-buffer nil     ; INFILE BUFFER DISPLAY
               (append (if (stringp fortune-program-options)
                           (split-string fortune-program-options)
                         fortune-program-options) (list fort-file)))))))